// Extended sample data for the responsive overhaul. Built on top of LMTData
// (events, scenes, suggestions, todayItems, echoes) so every page stays coherent.

// ── Simulated daily activity for the past ~2 months ──────────────────────────
// Prabhat is a software developer (7.7 yrs). This seeds a near-daily stream of
// work + life memories so Today, Timeline, Tree and Graph feel lived-in.
(function seedDaily() {
  if (LMTData.__seeded) return; LMTData.__seeded = true;
  // [daysSince, title, scene, mood, links, fragile, place, people(csv), tags(csv), visibility]
  const rows = [
    [1,'Pushed the hotfix for the login redirect bug','Work · 2026',3,4,false,'Home · desk','','bugfix,deploy','private'],
    [1,'Morning 6k along the lake','Body',4,1,false,'Lake Merritt','','running','private'],
    [2,'Standup, then deep work on the search reindex','Work · 2026',3,2,false,'Office','','focus','private'],
    [2,'Video call with Lin — planning the Kyoto trip','Lin & me',5,3,false,'Home · sunroom','Lin Park','kyoto,trip','scene'],
    [3,'Code review marathon — 14 PRs in one day','Work · 2026',2,5,false,'Office','','review','private'],
    [4,'Shipped the new dashboard to prod','Work · 2026',5,6,false,'Office','','ship,milestone','scene'],
    [4,'Gym — deadlift PR, finally hit 140kg','Body',5,1,false,'Gym','','strength,pr','private'],
    [5,'Called mom — dad\u2019s checkup went fine','Family',4,4,false,'Home','Vera (mom)','parents,health','private'],
    [6,'1:1 with manager about the staff promo','Work · 2026',4,5,false,'Office','Aidan (mgr)','career,1on1','private'],
    [7,'Finished \u201cDesigning Data-Intensive Applications\u201d','Reading',4,2,false,'Home · desk','','book,distributed-systems','scene'],
    [8,'Prod incident at 2am — rolled back v3.4','Work · 2026',2,4,true,'Home · desk','','incident,oncall','private'],
    [9,'Weekend walk with Theo, the long loop','Theo · weekly',4,1,false,'Buena Vista Park','Theo (dog)','walk','scene'],
    [10,'Pair-programmed the onboarding flow with the intern','Work · 2026',4,3,false,'Office','','mentoring','private'],
    [11,'Therapy — talked through the review anxiety','Quiet · me',3,1,true,'Therapist','','mental-health','private'],
    [12,'Rewrote the auth middleware in Rust','Work · 2026',4,4,false,'Office','','rust,refactor','private'],
    [13,'Late-night coding to a lo-fi playlist','Nights',4,1,false,'Home · desk','','flow','private'],
    [14,'Brother Marcus visited for the weekend','Family',5,3,false,'Home','Marcus','family','scene'],
    [16,'Cleared the entire bug backlog','Work · 2026',4,2,false,'Office','','cleanup','private'],
    [18,'Physio for the wrist — RSI flaring up again','Body',2,1,true,'Clinic','','health,rsi','private'],
    [20,'RFC for the event pipeline finally approved','Work · 2026',4,4,false,'Office','','architecture,rfc','scene'],
    [22,'Book club — discussed Sebald','Reading',4,1,false,'Anna\u2019s flat','Anna,Will,Priya','book-club','scene'],
    [24,'Migrated the billing service to Kubernetes','Work · 2026',3,5,false,'Office','','k8s,infra','private'],
    [26,'Cycled to the office, 18km round trip','Body',4,1,false,'Bike path','','cycling','private'],
    [28,'Demoed the memory-graph hack at sprint review','Work · 2026',5,4,false,'Office','','demo,hackathon','scene'],
    [30,'Stargazing from the roof — comet still faintly there','Nights',5,2,false,'Apartment · roof','N.','sky','public'],
    [32,'Mentored a junior through their first deploy','Work · 2026',4,3,false,'Office','','mentoring','private'],
    [34,'Quiet Sunday — journaling and tea','Quiet · me',3,1,false,'Home · sunroom','','journal','private'],
    [36,'Conference talk accepted for the fall','Work · 2026',5,3,false,'Home · desk','','speaking','scene'],
    [38,'Vet visit for Theo — clean bill','Theo · weekly',4,1,false,'Vet','Theo (dog)','vet','scene'],
    [40,'Fixed the flaky CI tests once and for all','Work · 2026',4,2,false,'Office','','ci,tests','private'],
    [42,'Long call with Lin about moving closer','Lin & me',4,3,true,'Home · sunroom','Lin Park','distance','private'],
    [45,'Trail run, 12k — legs felt great','Body',5,1,false,'Lake Anza','','running,trail','private'],
    [47,'On-call week, mercifully quiet','Work · 2026',3,1,false,'Home · desk','','oncall','private'],
    [50,'Refactored the notification service','Work · 2026',3,3,false,'Office','','refactor','private'],
    [52,'Family dinner at the lake','Family',5,4,false,'Lake Anza','Vera,Marcus,Joel','family,dinner','scene'],
    [55,'Started a learning sprint on vector databases','Work · 2026',4,2,false,'Home · desk','','learning,vectordb','private'],
    [58,'Anxious before the promo committee','Quiet · me',2,1,true,'Home · desk','','feelings','private'],
    [60,'Got the Staff Engineer promotion','Work · 2026',5,6,false,'Office','Aidan (mgr)','career,milestone','scene'],
    [62,'Repotted the fig — survived another season','Quiet · me',4,0,false,'Home · sunroom','','plants','private'],
  ];
  const extra = rows.map((r, i) => ({
    id: 'd' + r[0] + '_' + i, title: r[1], t: r[0] + 'd', daysSince: r[0], scene: r[2],
    mood: r[3], tags: r[8] ? r[8].split(',') : [], people: r[7] ? r[7].split(',') : [],
    place: r[6], visibility: r[9], fragile: r[5], links: r[4],
  }));
  LMTData.events.push(...extra);
  LMTData.events.sort((a, b) => a.daysSince - b.daysSince);
})();

window.LMTX2 = (function () {
  const E = LMTData.events;

  const people = [
    { id:'p-lin',   name:'Lin Park',     rel:'closest friend', color:'#15803d', events:9,  scenes:['Lin & me','Family'], lastSeen:'2d',  tone:4, here:true,  blurb:'Lives in Kyoto now. The long-distance one that still feels close.', shared:12 },
    { id:'p-vera',  name:'Vera',         rel:'mom',            color:'#d97706', events:14, scenes:['Family'],            lastSeen:'6d',  tone:5, here:false, blurb:'Biopsy came back clean. We talk on Sundays.', shared:6 },
    { id:'p-n',     name:'N.',           rel:'partner',        color:'#e11d48', events:11, scenes:['N. & me','Nights'],  lastSeen:'18d', tone:3, here:true,  blurb:'It has been a complicated season. Still building.', shared:0 },
    { id:'p-theo',  name:'Theo',         rel:'dog',            color:'#84cc16', events:64, scenes:['Theo · weekly'],     lastSeen:'11d', tone:4, here:false, blurb:'Recovered from surgery. Walks every weekend.', shared:0 },
    { id:'p-marcus',name:'Marcus',       rel:'brother',        color:'#2563eb', events:7,  scenes:['Family'],            lastSeen:'47d', tone:4, here:false, blurb:'Came to dad\'s 70th. We should talk more.', shared:3 },
    { id:'p-anna',  name:'Anna',         rel:'book club',      color:'#9333ea', events:5,  scenes:['Reading'],           lastSeen:'24d', tone:4, here:false, blurb:'Hosts book club at her flat. Finally finished Sebald.', shared:8 },
    { id:'p-aidan', name:'Aidan',        rel:'ex-manager',     color:'#0d9488', events:4,  scenes:['Work · 2026'],       lastSeen:'71d', tone:3, here:false, blurb:'Owe him a reply about the contract.', shared:0 },
    { id:'p-priya', name:'Priya',        rel:'pending person', color:'#64748b', events:3,  scenes:['Reading'],           lastSeen:'24d', tone:3, here:false, blurb:'Appears in 3 unlinked entries — promote to a Person?', shared:0, pending:true },
  ];

  const places = [
    { id:'pl-kyoto', name:'Kyoto · Higashiyama', region:'Japan',        events:6,  color:'#15803d', last:'2d',  lat:35.0,  note:'Where Lin lives. First-snow phone calls.' },
    { id:'pl-bvp',   name:'Buena Vista Park',    region:'San Francisco',events:18, color:'#84cc16', last:'11d', lat:37.7,  note:'The weekly Theo loop.' },
    { id:'pl-anza',  name:'Lake Anza',           region:'Berkeley',     events:5,  color:'#d97706', last:'47d', lat:37.9,  note:'Dad\'s 70th. Family gatherings.', promote:true },
    { id:'pl-merr',  name:'Lake Merritt',        region:'Oakland',      events:9,  color:'#dc2626', last:'120d',lat:37.8,  note:'Started running again here after surgery.' },
    { id:'pl-home',  name:'Home · the apartment',region:'Oakland',      events:31, color:'#2563eb', last:'18d', lat:37.8,  note:'Sunroom, roof, kitchen — most of life.' },
    { id:'pl-bart',  name:'BART · 12th St',      region:'Oakland',      events:4,  color:'#64748b', last:'58d', lat:37.8,  note:'Cried here once, for no reason.' },
  ];

  // Story Weaver — a narrative draft stitched from events.
  const story = {
    title: 'The year the snow came early',
    sub: 'A chapter woven from 6 moments across Lin & me, Family, and Nights',
    threads: ['Lin & me','Family','Nights'],
    beats: [
      { id:'e01', role:'Opening',     note:'Establish the distance, the warmth of the call.' },
      { id:'e03', role:'Turn',        note:'The fear, then the relief. The emotional spine.' },
      { id:'e08', role:'Gathering',   note:'Everyone in one place. The contrast to distance.' },
      { id:'e11', role:'Wonder',      note:'A small awe to breathe between heavy beats.' },
      { id:'e09', role:'Undertow',    note:'A quiet low — honesty keeps it from being saccharine.' },
      { id:'e05', role:'Close',       note:'Unresolved, but real. End on the building, not the built.' },
    ],
  };

  // Ask / chat transcript
  const chat = [
    { who:'you', text:'When did things get hard with N. this year?' },
    { who:'ai',  text:'Two moments stand out. The first real fight in months was 18 days ago, in the kitchen — you marked it fragile. Before that, the comet night on the roof (88 days ago) was a high. The shift sits in between.', cites:['e05','e11'] },
    { who:'you', text:'Show me the low points and what came right after each.' },
  ];

  // Recap / Year in Review stats
  const recap = {
    year: 2026,
    captured: 312, scenes: 8, people: 18, places: 23, words: '41.2k',
    moodAvg: 3.7, longestStreak: 19, fragile: 14, links: 86,
    topScene: 'Theo · weekly', topPlace: 'Home · the apartment', topMonth: 'March',
    months: [12,18,9,27,22,31,19,24,16,33,28,21], // captures per month
    moodByMonth: [3.2,3.0,3.6,3.9,4.1,3.7,3.3,3.8,3.5,4.0,3.9,4.2],
  };

  // Collaboration / presence
  const collaborators = [
    { id:'c1', name:'Vera',   color:'#d97706', scene:'Family',   here:true,  doing:'viewing "Dad\'s 70th"', cursor:{x:62,y:38} },
    { id:'c2', name:'Marcus', color:'#2563eb', scene:'Family',   here:true,  doing:'adding 3 photos',       cursor:{x:30,y:64} },
    { id:'c3', name:'Anna',   color:'#9333ea', scene:'Reading',  here:false, doing:'last active 2h ago' },
    { id:'c4', name:'Lin',    color:'#15803d', scene:'Lin & me', here:true,  doing:'typing a note…',        cursor:{x:78,y:72} },
  ];
  const activity = [
    { who:'Vera',   color:'#d97706', verb:'added a photo to', obj:'Dad\'s 70th — dinner at the lake', t:'2m' },
    { who:'Marcus', color:'#2563eb', verb:'commented on',     obj:'Mom\'s biopsy came back clean',    t:'14m' },
    { who:'Lin',    color:'#15803d', verb:'linked two events in', obj:'Lin & me',                     t:'1h' },
    { who:'Anna',   color:'#9333ea', verb:'created a scene',  obj:'Reading · winter list',            t:'2h' },
    { who:'You',    color:'#15803d', verb:'wove a story from',obj:'6 moments',                        t:'3h' },
  ];

  return { people, places, story, chat, recap, collaborators, activity };
})();
