vestige/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js
Sam Valladares f7530af3db
release: v2.2.1 — Windows embeddings fix + backfill safety + first-run guide (#105)
* patch(backfill-safety): VESTIGE_BACKFILL_AUTOFIRE gate (default OFF) + bounded promote_memory_backfill

Off-by-default env gate around step-8.5 auto-fire in run_consolidation (decouples
backfill from consolidation cadence). New promote_memory_backfill caps stability at
MIN(stability*1.5, stability+365.0) (the bound retroactive_backfill.rs:300 already
computes but discarded); both backfill entry points use it. Fixes the false 'capped'
comment. Cloud-sync excluded at build (--no-default-features). Pending upstream PR to
samvallad33/vestige. omega-backfill-safety-v2.2.0 off tag v2.2.0 (3bcd4667).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* release: v2.2.1 — Windows embeddings fix + backfill safety + first-run guide

Board-clearing patch release.

Fixes:
- #101 Windows embeddings: release.yml already restores vector-search on the
  x86_64-pc-windows-msvc target (merged in #102); this release rebuilds the
  Windows binary so users actually get working embeddings.
- #103 Retroactive Salience Backfill safety (from community PR #104, adjusted):
  * promote_memory_backfill bounds the stability multiply to
    MIN(stability*1.5, stability+365.0) on both auto-fire and manual paths.
  * VESTIGE_BACKFILL_AUTOFIRE gate — default ON (preserves the shipped/documented
    v2.2.0 behavior), disable with 0/false/off/no. Env value is trimmed.
  * Corrected the false "capped" comment and the promote_memory_backfill doc.
  * Added 3 tests: +365 cap binds, *1.5 multiply below crossover, gate parsing.

Docs:
- #83 First-Run: new docs/GETTING-STARTED.md + README pointer.
- Consolidated roadmap issues #82,#84-#92 into docs/ROADMAP.md (Tracked Issues).
- Documented VESTIGE_BACKFILL_AUTOFIRE in docs/CONFIGURATION.md.
- CHANGELOG v2.2.1 entry.

Version bumped to 2.2.1 across all manifests + Cargo.lock + dashboard build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Peter Lauzon <inbijiburu@protonmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 12:02:42 -05:00

8 lines
18 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import"../chunks/Bzak7iHL.js";import{o as tt}from"../chunks/TZu9D97Z.js";import{p as Ue,e as s,h as n,g as e,c as at,f as st,a as u,t as w,r as t,u as k,b as Qe,s as ue,i as W,j as g,au as Oe,d as rt,n as nt}from"../chunks/wpu9U-D0.js";import{d as Xe,s as p,a as Pe}from"../chunks/D8mhvFt8.js";import{i as N}from"../chunks/DKve45Wd.js";import{a as C,e as X,i as he,s as Ie}from"../chunks/60_R_Vbt.js";import{a as Ke}from"../chunks/CZfHMhLI.js";import{s as Ae}from"../chunks/EqHb-9AZ.js";import{p as it}from"../chunks/ByYB047u.js";import{N as ot}from"../chunks/CcUbQ_Wl.js";import{P as dt}from"../chunks/BHDZZvku.js";import{I as lt}from"../chunks/D7A-gG4Z.js";import{D as vt}from"../chunks/CmbJHhgy.js";const Ge=1440*60*1e3;function pe(x){const v=typeof x=="string"?new Date(x):new Date(x);return v.setHours(0,0,0,0),v}function be(x,v){return Math.floor((pe(x).getTime()-pe(v).getTime())/Ge)}function Ye(x){const v=x.getFullYear(),f=String(x.getMonth()+1).padStart(2,"0"),R=String(x.getDate()).padStart(2,"0");return`${v}-${f}-${R}`}function qe(x,v){if(!v)return"none";const f=new Date(v);if(Number.isNaN(f.getTime()))return"none";const R=be(f,x);return R<0?"overdue":R===0?"today":R<=7?"week":"future"}function ze(x,v){if(!v)return null;const f=new Date(v);return Number.isNaN(f.getTime())?null:be(f,x)}function ct(x){if(x.length===0)return 0;let v=0;for(const f of x)v+=f.retentionStrength??0;return v/x.length}function ut(x){const v=pe(x);return v.setDate(v.getDate()-14),v.setDate(v.getDate()-v.getDay()),v}function pt(x,v){let f=0,R=0,I=0,O=0,A=0,G=0;const E=pe(x);for(const B of v){if(!B.nextReviewAt)continue;const H=new Date(B.nextReviewAt);if(Number.isNaN(H.getTime()))continue;const _=be(H,x);_<0&&f++,_<=0&&R++,_<=7&&I++,_<=30&&O++,_>=0&&(A+=(H.getTime()-E.getTime())/Ge,G++)}const b=G>0?A/G:0;return{overdue:f,dueToday:R,dueThisWeek:I,dueThisMonth:O,avgDays:b}}var xt=Oe('<line y1="0" stroke="rgba(129,140,248,0.5)" stroke-width="1"></line>'),gt=Oe('<path fill="none" stroke="var(--color-recall)" stroke-width="1.5" stroke-linejoin="round"></path>'),mt=Oe('<circle r="1.5" fill="var(--color-recall)"></circle>'),ft=g('<div class="text-[10px] text-muted font-mono uppercase tracking-wider text-center"> </div>'),_t=g('<span class="text-[9px] text-muted"> </span>'),ht=g('<span class="text-[9px] text-muted"> </span>'),bt=g('<div class="flex-1 flex flex-col items-center justify-center gap-0.5"><span class="text-base sm:text-lg font-bold leading-none"> </span> <!></div>'),yt=g('<button type="button"><div class="flex flex-col h-full"><div class="flex items-start justify-between"><span> </span> <!></div> <!></div></button>'),wt=g("<span> </span>"),kt=g('<span class="px-1 py-0.5 bg-white/[0.04] rounded text-muted"> </span>'),$t=g('<div class="flex items-start gap-3 p-2.5 rounded-lg bg-white/[0.02] hover:bg-white/[0.04] transition"><span class="w-2 h-2 mt-1.5 rounded-full flex-shrink-0"></span> <div class="flex-1 min-w-0"><p class="text-sm text-text leading-snug line-clamp-2"> </p> <div class="flex items-center gap-2 mt-1 text-[10px] text-muted"><span> </span> <!> <!></div></div> <div class="flex flex-col items-end gap-1 flex-shrink-0"><div class="w-12 h-1 bg-deep rounded-full overflow-hidden"><div class="h-full rounded-full"></div></div> <span class="text-[10px] text-muted"> </span></div></div>'),St=g('<p class="text-xs text-muted text-center pt-2"> </p>'),Dt=g('<div class="p-5 glass rounded-xl space-y-3 animate-panel-in svelte-rs1z7a"><div class="flex items-center justify-between"><div><h3 class="text-sm text-bright font-semibold"> </h3> <p class="text-xs text-dim mt-0.5"> </p></div> <button type="button" class="text-xs text-muted hover:text-dim px-2 py-1 rounded-lg hover:bg-white/[0.03]" aria-label="Close">close ×</button></div> <div class="space-y-2 max-h-96 overflow-y-auto pr-1"><!> <!></div></div>'),Tt=g('<div class="space-y-4"><div class="p-4 glass-subtle rounded-xl"><div class="flex items-center justify-between mb-2"><span class="text-xs text-dim font-medium">Avg retention of memories due — last 2 weeks → next 4</span> <div class="flex items-center gap-3 text-[10px] text-muted"><span class="flex items-center gap-1"><span class="w-2 h-0.5 bg-recall"></span>retention</span> <span class="flex items-center gap-1"><span class="w-px h-3 bg-synapse-glow"></span>today</span></div></div> <svg preserveAspectRatio="none" class="w-full h-12 block" aria-hidden="true"><line x1="0" stroke="rgba(239,68,68,0.18)" stroke-dasharray="2 4" stroke-width="1"></line><line x1="0" stroke="rgba(16,185,129,0.18)" stroke-dasharray="2 4" stroke-width="1"></line><!><!><!></svg></div> <div class="grid grid-cols-7 gap-2 px-1"></div> <div class="grid grid-cols-7 gap-2"></div> <div class="flex items-center gap-4 text-[10px] text-muted flex-wrap px-1"><span class="flex items-center gap-1.5"><span class="w-3 h-3 rounded" style="background: rgba(239,68,68,0.16); border: 1px solid rgba(239,68,68,0.45);"></span> Overdue</span> <span class="flex items-center gap-1.5"><span class="w-3 h-3 rounded" style="background: rgba(245,158,11,0.18); border: 1px solid rgba(245,158,11,0.5);"></span> Due today</span> <span class="flex items-center gap-1.5"><span class="w-3 h-3 rounded" style="background: rgba(99,102,241,0.16); border: 1px solid rgba(99,102,241,0.45);"></span> Within 7 days</span> <span class="flex items-center gap-1.5"><span class="w-3 h-3 rounded" style="background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2);"></span> Future (8+ days)</span></div> <!></div>');function Rt(x,v){Ue(v,!0);let f=it(v,"anchor",19,()=>new Date),R=k(()=>pe(f())),I=k(()=>ut(f())),O=k(()=>(()=>{const r=new Map;for(const a of v.memories){if(!a.nextReviewAt)continue;const o=new Date(a.nextReviewAt);if(Number.isNaN(o.getTime()))continue;const d=Ye(pe(o)),$=r.get(d);$?$.push(a):r.set(d,[a])}return r})()),A=k(()=>(()=>{const r=[];for(let a=0;a<42;a++){const o=new Date(e(I));o.setDate(o.getDate()+a);const d=Ye(o),$=e(O).get(d)??[],y=be(o,e(R));r.push({date:o,key:d,isToday:y===0,inWindow:y>=-14&&y<=28,memories:$,avgRetention:ct($)})}return r})());function G(r){if(r.memories.length===0)return{bg:"rgba(255,255,255,0.02)",border:"rgba(99,102,241,0.06)",text:"#4a4a7a"};const a=be(r.date,e(R));return a<-1?{bg:"rgba(239,68,68,0.16)",border:"rgba(239,68,68,0.45)",text:"#fca5a5"}:a>=-1&&a<=0?{bg:"rgba(245,158,11,0.18)",border:"rgba(245,158,11,0.5)",text:"#fcd34d"}:a>0&&a<=7?{bg:"rgba(99,102,241,0.16)",border:"rgba(99,102,241,0.45)",text:"#a5b4fc"}:{bg:"rgba(168,85,247,0.08)",border:"rgba(168,85,247,0.2)",text:"#c084fc"}}let E=ue(null),b=k(()=>e(A).find(r=>r.key===e(E))??null);function B(r){W(E,e(E)===r?null:r,!0)}const H=600,_=56;let L=k(()=>(()=>{const r=[],a=e(A).length;for(let o=0;o<a;o++){const d=e(A)[o],$=o/(a-1)*H,y=d.avgRetention,D=_-6-y*(_-12);r.push({x:$,y:D,r:y,count:d.memories.length})}return r})()),ye=k(()=>(()=>{const r=e(L).filter(a=>a.count>0);return r.length===0?"":r.map((a,o)=>`${o===0?"M":"L"} ${a.x.toFixed(1)} ${a.y.toFixed(1)}`).join(" ")})()),xe=k(()=>e(A).findIndex(r=>r.isToday)),ge=k(()=>e(xe)>=0?e(xe)/(e(A).length-1)*H:-1);const we=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ne(r){return r.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"})}var ie=Tt(),oe=s(ie),me=n(s(oe),2);C(me,"viewBox","0 0 600 56");var J=s(me);C(J,"x2",H),C(J,"y1",_-6-.3*(_-12)),C(J,"y2",_-6-.3*(_-12));var de=n(J);C(de,"x2",H),C(de,"y1",_-6-.7*(_-12)),C(de,"y2",_-6-.7*(_-12));var ke=n(de);{var Fe=r=>{var a=xt();C(a,"y2",_),w(()=>{C(a,"x1",e(ge)),C(a,"x2",e(ge))}),u(r,a)};N(ke,r=>{e(ge)>=0&&r(Fe)})}var $e=n(ke);{var Ne=r=>{var a=gt();w(()=>C(a,"d",e(ye))),u(r,a)};N($e,r=>{e(ye)&&r(Ne)})}var Ce=n($e);X(Ce,17,()=>e(L),he,(r,a)=>{var o=at(),d=st(o);{var $=y=>{var D=mt();w(()=>{C(D,"cx",e(a).x),C(D,"cy",e(a).y)}),u(y,D)};N(d,y=>{e(a).count>0&&y($)})}u(r,o)}),t(me),t(oe);var i=n(oe,2);X(i,21,()=>we,he,(r,a)=>{var o=ft(),d=s(o,!0);t(o),w(()=>p(d,e(a))),u(r,o)}),t(i);var l=n(i,2);X(l,21,()=>e(A),r=>r.key,(r,a)=>{const o=k(()=>G(e(a)));var d=yt(),$=s(d),y=s($),D=s(y),fe=s(D,!0);t(D);var V=n(D,2);{var Z=h=>{var c=_t(),T=s(c,!0);t(c),w(Y=>p(T,Y),[()=>e(a).date.toLocaleDateString(void 0,{month:"short"})]),u(h,c)},le=k(()=>e(a).date.getDate()===1);N(V,h=>{e(le)&&h(Z)})}t(y);var ve=n(y,2);{var ce=h=>{var c=bt(),T=s(c),Y=s(T,!0);t(T);var ee=n(T,2);{var Q=te=>{var q=ht(),z=s(q);t(q),w(ae=>p(z,`${ae??""}%`),[()=>(e(a).avgRetention*100).toFixed(0)]),u(te,q)};N(ee,te=>{e(a).avgRetention>0&&te(Q)})}t(c),w(()=>{Ae(T,`color: ${e(o).text??""}`),p(Y,e(a).memories.length)}),u(h,c)};N(ve,h=>{e(a).memories.length>0&&h(ce)})}t($),t(d),w((h,c)=>{d.disabled=e(a).memories.length===0,Ie(d,1,`relative aspect-square rounded-lg p-2 text-left transition-all duration-200
${e(a).inWindow?"opacity-100":"opacity-35"}
${e(a).memories.length>0?"hover:scale-[1.03] cursor-pointer":"cursor-default"}
${e(a).isToday?"ring-2 ring-synapse/60 shadow-[0_0_16px_rgba(99,102,241,0.3)]":""}
${e(E)===e(a).key?"ring-2 ring-dream/60 shadow-[0_0_16px_rgba(168,85,247,0.3)]":""}`),Ae(d,`background: ${e(o).bg??""}; border: 1px solid ${e(o).border??""};`),C(d,"title",h),Ie(D,1,`text-[10px] font-mono ${e(a).isToday?"text-synapse-glow font-bold":"text-dim"}`),p(fe,c)},[()=>`${ne(e(a).date)}${e(a).memories.length} due`,()=>e(a).date.getDate()]),Pe("click",d,()=>B(e(a).key)),u(r,d)}),t(l);var m=n(l,4);{var j=r=>{var a=Dt(),o=s(a),d=s(o),$=s(d),y=s($,!0);t($);var D=n($,2),fe=s(D);t(D),t(d);var V=n(d,2);t(o);var Z=n(o,2),le=s(Z);X(le,17,()=>e(b).memories.slice(0,100),h=>h.id,(h,c)=>{var T=$t(),Y=s(T),ee=n(Y,2),Q=s(ee),te=s(Q,!0);t(Q);var q=n(Q,2),z=s(q),ae=s(z,!0);t(z);var Se=n(z,2);{var De=M=>{var U=wt(),se=s(U);t(U),w(()=>p(se,`· ${e(c).reviewCount??""} review${e(c).reviewCount===1?"":"s"}`)),u(M,U)};N(Se,M=>{e(c).reviewCount!==void 0&&M(De)})}var je=n(Se,2);X(je,17,()=>e(c).tags.slice(0,2),he,(M,U)=>{var se=kt(),P=s(se,!0);t(se),w(()=>p(P,e(U))),u(M,se)}),t(q),t(ee);var Te=n(ee,2),_e=s(Te),Me=s(_e);t(_e);var S=n(_e,2),F=s(S);t(S),t(Te),t(T),w(M=>{Ae(Y,`background: ${(ot[e(c).nodeType]||"#8B95A5")??""}`),p(te,e(c).content),p(ae,e(c).nodeType),Ae(Me,`width: ${e(c).retentionStrength*100}%; background: ${e(c).retentionStrength>.7?"var(--color-recall)":e(c).retentionStrength>.4?"var(--color-warning)":"var(--color-decay)"}`),p(F,`${M??""}%`)},[()=>(e(c).retentionStrength*100).toFixed(0)]),u(h,T)});var ve=n(le,2);{var ce=h=>{var c=St(),T=s(c);t(c),w(()=>p(T,`+${e(b).memories.length-100} more`)),u(h,c)};N(ve,h=>{e(b).memories.length>100&&h(ce)})}t(Z),t(a),w((h,c)=>{p(y,h),p(fe,`${e(b).memories.length??""} memor${e(b).memories.length===1?"y":"ies"} due
· avg retention ${c??""}%`)},[()=>ne(e(b).date),()=>(e(b).avgRetention*100).toFixed(0)]),Pe("click",V,()=>W(E,null)),u(r,a)};N(m,r=>{e(b)&&e(b).memories.length>0&&r(j)})}t(ie),u(x,ie),Qe()}Xe(["click"]);var At=g('<span class="sr-only"> </span>'),Ft=g('<div class="px-3 py-2 glass-subtle rounded-lg text-[11px] text-dim"> </div>'),Nt=g('<div class="aspect-square glass-subtle rounded-lg shimmer"></div>'),Ct=g('<div class="h-20 glass-subtle rounded-xl shimmer"></div>'),jt=g('<div class="grid lg:grid-cols-[1fr_280px] gap-6"><div class="space-y-3"><div class="h-14 glass-subtle rounded-xl shimmer"></div> <div class="grid grid-cols-7 gap-2"></div></div> <div class="space-y-3"></div></div>'),Mt=g('<div class="p-10 glass rounded-xl text-center space-y-3"><p class="text-sm text-decay">API unavailable.</p> <p class="text-xs text-dim">Could not fetch memories from /api/memories.</p></div>'),Lt=g(`<div class="p-10 glass rounded-xl text-center space-y-4 enter"><div class="mx-auto w-fit text-dream/50 breathe"><!></div> <p class="text-sm text-bright font-medium">FSRS review schedule not yet populated.</p> <p class="text-xs text-dim max-w-md mx-auto"> <code class="text-muted">nextReviewAt</code> timestamp yet. Run consolidation to compute
next-review dates via FSRS-6.</p> <button type="button" class="px-4 py-2 bg-warning/20 border border-warning/40 text-warning text-sm rounded-xl hover:bg-warning/30 transition">Run Consolidation</button></div>`),Wt=g('<div class="flex items-baseline justify-between"><span class="text-xs text-dim">Overdue</span> <span class="text-2xl font-bold text-decay"> </span></div>'),Pt=g('<p class="text-xs text-muted italic">Nothing in this window.</p>'),It=g('<div class="p-2 rounded-lg bg-white/[0.02] hover:bg-white/[0.04] transition"><p class="text-xs text-text leading-snug line-clamp-2"> </p> <div class="flex items-center gap-2 mt-1 text-[10px]"><span> </span> <span class="text-muted"> </span></div></div>'),Ot=g('<p class="text-[10px] text-muted text-center pt-1"> </p>'),Et=g('<div class="space-y-2 max-h-96 overflow-y-auto pr-1"><!> <!></div>'),Bt=g('<div class="grid lg:grid-cols-[1fr_280px] gap-6"><div class="min-w-0"><!></div> <aside class="space-y-4"><div class="p-5 glass rounded-xl space-y-4"><h2 class="text-xs text-dim font-semibold uppercase tracking-wider">Queue</h2> <div class="space-y-3"><!> <div class="flex items-baseline justify-between"><span class="text-xs text-dim">Due today</span> <span class="text-2xl font-bold text-warning"> </span></div> <div class="flex items-baseline justify-between"><span class="text-xs text-dim">This week</span> <span class="text-2xl font-bold text-synapse-glow"> </span></div> <div class="flex items-baseline justify-between"><span class="text-xs text-dim">This month</span> <span class="text-2xl font-bold text-dream-glow"> </span></div></div> <div class="pt-3 border-t border-synapse/10"><div class="flex items-baseline justify-between"><span class="text-xs text-dim">Avg days until review</span> <span class="text-lg font-semibold text-text"> </span></div> <p class="text-[10px] text-muted mt-1"> </p></div></div> <div class="p-5 glass-subtle rounded-xl space-y-3"><div class="flex items-center justify-between"><h2 class="text-xs text-dim font-semibold uppercase tracking-wider"> </h2> <span class="text-xs text-muted"> </span></div> <!></div></aside></div>'),Ht=g('<div class="p-6 max-w-7xl mx-auto space-y-6"><!> <!> <!> <!></div>');function aa(x,v){Ue(v,!0);let f=ue(rt([])),R=ue(0),I=ue(!0),O=ue(!1),A=ue("week");const G=2e3;async function E(){const i=await Ke.memories.list({limit:String(G)});W(f,i.memories,!0),W(R,i.total,!0)}tt(async()=>{try{await E()}catch{W(O,!0),W(f,[],!0)}finally{W(I,!1)}});let b=k(()=>e(f).filter(i=>!!i.nextReviewAt)),B=k(()=>new Date),H=k(()=>e(R)>e(f).length),_=k(()=>(()=>{const i=e(A);return i==="all"?e(b):e(b).filter(l=>{const m=qe(e(B),l.nextReviewAt);if(m==="none")return!1;if(i==="today")return m==="overdue"||m==="today";if(i==="week")return m!=="future";const j=ze(e(B),l.nextReviewAt);return j!==null&&j<=30})})()),L=k(()=>pt(e(B),e(b)));async function ye(){W(I,!0);try{await Ke.consolidate(),await E(),W(O,!1)}catch{W(O,!0)}finally{W(I,!1)}}const xe=[{key:"today",label:"Due today"},{key:"week",label:"This week"},{key:"month",label:"This month"},{key:"all",label:"All upcoming"}];let ge=k(()=>[{value:"today",label:"Due today",icon:"schedule",badge:e(L).dueToday,color:"#fbbf24"},{value:"week",label:"This week",icon:"schedule",badge:e(L).dueThisWeek,color:"#818cf8"},{value:"month",label:"This month",icon:"schedule",badge:e(L).dueThisMonth,color:"#c084fc"},{value:"all",label:"All upcoming",icon:"schedule",badge:e(b).length,color:"#6ee7b7"}]),we=k(()=>{var i;return((i=xe.find(l=>l.key===e(A)))==null?void 0:i.label)??""});var ne=Ht(),ie=s(ne);dt(ie,{icon:"schedule",title:"Review Schedule",subtitle:"FSRS-6 next-review dates across your memory corpus",accent:"warning",children:(i,l)=>{vt(i,{get options(){return e(ge)},label:"Window",icon:"filter",get value(){return e(A)},set value(m){W(A,m,!0)}})},$$slots:{default:!0}});var oe=n(ie,2);{var me=i=>{var l=At(),m=s(l,!0);t(l),w(()=>p(m,e(we))),u(i,l)};N(oe,i=>{e(we)&&i(me)})}var J=n(oe,2);{var de=i=>{var l=Ft(),m=s(l);t(l),w((j,r)=>p(m,`Showing the first ${j??""} of ${r??""} memories.
Schedule reflects this slice only.`),[()=>e(f).length.toLocaleString(),()=>e(R).toLocaleString()]),u(i,l)};N(J,i=>{!e(I)&&!e(O)&&e(H)&&i(de)})}var ke=n(J,2);{var Fe=i=>{var l=jt(),m=s(l),j=n(s(m),2);X(j,20,()=>Array(42),he,(a,o)=>{var d=Nt();u(a,d)}),t(j),t(m);var r=n(m,2);X(r,20,()=>Array(5),he,(a,o)=>{var d=Ct();u(a,d)}),t(r),t(l),u(i,l)},$e=i=>{var l=Mt();u(i,l)},Ne=i=>{var l=Lt(),m=s(l),j=s(m);lt(j,{name:"schedule",size:42,strokeWidth:1.2}),t(m);var r=n(m,4),a=s(r);nt(2),t(r);var o=n(r,2);t(l),w(()=>p(a,`None of your ${e(f).length??""} memor${e(f).length===1?"y has":"ies have"} a `)),Pe("click",o,ye),u(i,l)},Ce=i=>{var l=Bt(),m=s(l),j=s(m);Rt(j,{get memories(){return e(b)}}),t(m);var r=n(m,2),a=s(r),o=n(s(a),2),d=s(o);{var $=S=>{var F=Wt(),M=n(s(F),2),U=s(M,!0);t(M),t(F),w(()=>p(U,e(L).overdue)),u(S,F)};N(d,S=>{e(L).overdue>0&&S($)})}var y=n(d,2),D=n(s(y),2),fe=s(D,!0);t(D),t(y);var V=n(y,2),Z=n(s(V),2),le=s(Z,!0);t(Z),t(V);var ve=n(V,2),ce=n(s(ve),2),h=s(ce,!0);t(ce),t(ve),t(o);var c=n(o,2),T=s(c),Y=n(s(T),2),ee=s(Y,!0);t(Y),t(T);var Q=n(T,2),te=s(Q);t(Q),t(c),t(a);var q=n(a,2),z=s(q),ae=s(z),Se=s(ae,!0);t(ae);var De=n(ae,2),je=s(De,!0);t(De),t(z);var Te=n(z,2);{var _e=S=>{var F=Pt();u(S,F)},Me=S=>{var F=Et(),M=s(F);X(M,17,()=>e(_).slice().sort((P,K)=>(P.nextReviewAt??"").localeCompare(K.nextReviewAt??"")).slice(0,50),P=>P.id,(P,K)=>{const re=k(()=>qe(e(B),e(K).nextReviewAt)),Ee=k(()=>ze(e(B),e(K).nextReviewAt)??0);var Le=It(),We=s(Le),Je=s(We,!0);t(We);var Be=n(We,2),Re=s(Be),Ve=s(Re,!0);t(Re);var He=n(Re,2),Ze=s(He);t(He),t(Be),t(Le),w(et=>{p(Je,e(K).content),Ie(Re,1,e(re)==="overdue"?"text-decay":e(re)==="today"?"text-warning":e(re)==="week"?"text-synapse-glow":"text-dream-glow"),p(Ve,e(re)==="overdue"?`${-e(Ee)}d overdue`:e(re)==="today"?"today":`in ${e(Ee)}d`),p(Ze,`· ${et??""}%`)},[()=>(e(K).retentionStrength*100).toFixed(0)]),u(P,Le)});var U=n(M,2);{var se=P=>{var K=Ot(),re=s(K);t(K),w(()=>p(re,`+${e(_).length-50} more`)),u(P,K)};N(U,P=>{e(_).length>50&&P(se)})}t(F),u(S,F)};N(Te,S=>{e(_).length===0?S(_e):S(Me,!1)})}t(q),t(r),t(l),w((S,F)=>{p(fe,e(L).dueToday),p(le,e(L).dueThisWeek),p(h,e(L).dueThisMonth),p(ee,S),p(te,`Across ${e(b).length??""} scheduled memor${e(b).length===1?"y":"ies"}`),p(Se,F),p(je,e(_).length)},[()=>e(L).avgDays.toFixed(1),()=>{var S;return(S=xe.find(F=>F.key===e(A)))==null?void 0:S.label}]),u(i,l)};N(ke,i=>{e(I)?i(Fe):e(O)?i($e,1):e(b).length===0?i(Ne,2):i(Ce,!1)})}t(ne),u(x,ne),Qe()}Xe(["click"]);export{aa as component};