@mavea/mavea 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/.vite/manifest.json +354 -354
  3. package/dist/assets/{AnnotationLayer-HanjTRYY.js → AnnotationLayer-CzXCVZCu.js} +1 -1
  4. package/dist/assets/{AppCommandPalette-DBiuHUNL.js → AppCommandPalette-D6904cc9.js} +1 -1
  5. package/dist/assets/{CheckLogRail-CfoGgTqv.js → CheckLogRail-CeRhbIwa.js} +1 -1
  6. package/dist/assets/{ConversationVideoStudio-CEi_cgBR.js → ConversationVideoStudio-Cyu-M9Us.js} +1 -1
  7. package/dist/assets/{CourseLessonReader-CaLT_Y6N.js → CourseLessonReader-BvTabDPT.js} +2 -2
  8. package/dist/assets/{CoursesApp-IfWCeml5.js → CoursesApp-B8kZ6pFr.js} +2 -2
  9. package/dist/assets/{DashPresent-T7I-lAng.js → DashPresent-Dr0LLNnz.js} +1 -1
  10. package/dist/assets/{DashboardDetail-BhRSDenD.js → DashboardDetail-B5JZ6fRz.js} +2 -2
  11. package/dist/assets/{DashboardLoopGate-DBVAR7IS.js → DashboardLoopGate-UHcbTCXN.js} +2 -2
  12. package/dist/assets/DashboardLoopRuntime-BZutKupS.js +1 -0
  13. package/dist/assets/{DashboardsApp-C_awJ3hM.js → DashboardsApp-DzVa4Nqd.js} +2 -2
  14. package/dist/assets/{DeepZoomApp-C-66OasV.js → DeepZoomApp-CN8ZKeS4.js} +1 -1
  15. package/dist/assets/{DelegatePanel-DaJTDkYu.js → DelegatePanel-DO7J_rk_.js} +1 -1
  16. package/dist/assets/{DemoGallery-B9F7SUzp.js → DemoGallery-DMQP4JAa.js} +1 -1
  17. package/dist/assets/{DropSelect-IBjV5Ol1.js → DropSelect-BVDNR47E.js} +1 -1
  18. package/dist/assets/{ExportModal-gckBiikq.js → ExportModal-BVsirsNU.js} +1 -1
  19. package/dist/assets/{ExtractionPreview-DDOkCH9u.js → ExtractionPreview-872OE2ZI.js} +1 -1
  20. package/dist/assets/{FeatureUseNotice-BfnZH8Vt.js → FeatureUseNotice-BNDajs0p.js} +1 -1
  21. package/dist/assets/{FlagshipCommandPalette-CYQdl3Zu.js → FlagshipCommandPalette-mKkMVsza.js} +1 -1
  22. package/dist/assets/{FlagshipShowcase-CFMmbeff.js → FlagshipShowcase-CL_KWgKn.js} +1 -1
  23. package/dist/assets/{FlashcardsApp-KJ1bmlbp.js → FlashcardsApp-COYviD1h.js} +1 -1
  24. package/dist/assets/GalleryApp-B5z9rsrO.css +1 -0
  25. package/dist/assets/{GalleryApp-Dh8Nc_So.js → GalleryApp-D96R7Hdy.js} +2 -2
  26. package/dist/assets/{HonestByDesign-C3LTj4Bx.js → HonestByDesign-DOg91fEf.js} +1 -1
  27. package/dist/assets/{HowItWorks-C5Dqqvl-.js → HowItWorks-D4lHSwEb.js} +1 -1
  28. package/dist/assets/{LegalApp-DYVJIUyF.js → LegalApp-BSPhYvKz.js} +1 -1
  29. package/dist/assets/{LegalMarkdownDocument-CbuQ-pLN.js → LegalMarkdownDocument-DDUOgn72.js} +1 -1
  30. package/dist/assets/{LegalPageShell-CoEyiZGz.js → LegalPageShell-DSbe8dTr.js} +1 -1
  31. package/dist/assets/{LibraryOverlay-TQnxY9R8.js → LibraryOverlay-CEhVoSyv.js} +1 -1
  32. package/dist/assets/{LiveApp-DRnphsFA.js → LiveApp-DtpM4tO0.js} +4 -4
  33. package/dist/assets/{LiveSettings-Cz3XSqv8.js → LiveSettings-C7luyoWU.js} +1 -1
  34. package/dist/assets/{MindMapViewerDrawer-AUJlLC2R.js → MindMapViewerDrawer-DxcjLJzB.js} +1 -1
  35. package/dist/assets/{MindShape-BbuVOTaR.js → MindShape-DhEmAQeq.js} +1 -1
  36. package/dist/assets/{PinToDashboard-BdXI7oo9.js → PinToDashboard-CQHDENt1.js} +1 -1
  37. package/dist/assets/{PlanReview-CGRvSRAt.js → PlanReview-f7EY7XTc.js} +1 -1
  38. package/dist/assets/{PresentationDeck-CoPmOr2f.js → PresentationDeck-Bo1BVx73.js} +1 -1
  39. package/dist/assets/{PrismApp-DPECS285.js → PrismApp-CBr8XpUt.js} +2 -2
  40. package/dist/assets/{PrismBriefingPlayer-BvpG7oZs.js → PrismBriefingPlayer-qNjVbmUq.js} +2 -2
  41. package/dist/assets/{PrismOverlay-c8rcvt4V.js → PrismOverlay-L_lLIH_1.js} +3 -3
  42. package/dist/assets/{PrismWorkbench-BEaD7Arj.js → PrismWorkbench-DK-1IY4A.js} +1 -1
  43. package/dist/assets/{PrivacyApp-_O_MR088.js → PrivacyApp-DT8wZumn.js} +1 -1
  44. package/dist/assets/{ReplayCard-IN-ilb2E.js → ReplayCard-BQr6DWYi.js} +2 -2
  45. package/dist/assets/{ReplayOverlay-ZRjFP-zf.js → ReplayOverlay-CRVixwg2.js} +1 -1
  46. package/dist/assets/{RippleApp-D_Gd8Lw8.js → RippleApp-CMY2OCRm.js} +2 -2
  47. package/dist/assets/{RippleOverlay-vP2KxTiI.js → RippleOverlay-Dwi8Ir43.js} +2 -2
  48. package/dist/assets/{SeeDontRead-BmUyUai5.js → SeeDontRead-BkeAv1Jd.js} +1 -1
  49. package/dist/assets/{ShareModal-_KYCohqO.js → ShareModal-DVwc57KT.js} +2 -2
  50. package/dist/assets/{ShipCourse--ajDej06.js → ShipCourse-BNEPgsV5.js} +1 -1
  51. package/dist/assets/{SignatureLoop-DDw2gtQ_.js → SignatureLoop-C9GvENvP.js} +1 -1
  52. package/dist/assets/{SynthesisApp-CilzogOF.js → SynthesisApp-BPAT6v7a.js} +2 -2
  53. package/dist/assets/{SynthesisOverlay-CAK5h0hB.js → SynthesisOverlay-u_W105hD.js} +1 -1
  54. package/dist/assets/{TemplatePicker-3w18ViSc.js → TemplatePicker-CAC4ggbJ.js} +1 -1
  55. package/dist/assets/{TermsApp-BfTGOTq6.js → TermsApp-BlyUsTrJ.js} +1 -1
  56. package/dist/assets/{TopicCanvas-DSCNWNjv.js → TopicCanvas-CyBGLgb0.js} +2 -2
  57. package/dist/assets/{TourPrism-Y47m-KGq.js → TourPrism-Cn2YHIwh.js} +1 -1
  58. package/dist/assets/{TrackerTile-LXFQXcvH.js → TrackerTile-Ds3ks6Bh.js} +2 -2
  59. package/dist/assets/{TwoSurfaces-CSpKrgfJ.js → TwoSurfaces-cdP8bAG9.js} +1 -1
  60. package/dist/assets/{WorldOverlay-D5FWgYe3.js → WorldOverlay-DPkQobVE.js} +1 -1
  61. package/dist/assets/{WowFeatures-e6mkftpD.js → WowFeatures-BBtcWAOz.js} +1 -1
  62. package/dist/assets/{ZoomDeck-CC9zXPxF.js → ZoomDeck-Cdvkvo2H.js} +1 -1
  63. package/dist/assets/{audioTrack-w1tZwSoU.js → audioTrack-W_18XwGZ.js} +1 -1
  64. package/dist/assets/canvas-BX595EVB.js +1 -0
  65. package/dist/assets/{capture-Bomj_Egy.js → capture-Dyff_zSz.js} +1 -1
  66. package/dist/assets/{confirmAdd-CUFiPNWz.js → confirmAdd-D_hDIeaD.js} +1 -1
  67. package/dist/assets/{dashboardEvents-PktCbV72.js → dashboardEvents-BV0Ly6No.js} +1 -1
  68. package/dist/assets/{deepen-Dz4yTyJs.js → deepen-D8kPrlU5.js} +1 -1
  69. package/dist/assets/docs-6X4Ki_cV.js +1 -0
  70. package/dist/assets/{effort-BKGxLYoq.js → effort-QeWrMtZt.js} +1 -1
  71. package/dist/assets/{generateBeats-BjWC2fwl.js → generateBeats-Da9RmZke.js} +1 -1
  72. package/dist/assets/{generateLive-BLajGcNK.js → generateLive-CDIkclO4.js} +1 -1
  73. package/dist/assets/{index-CKRjGbeR.js → index-BMeoXWPR.js} +3 -3
  74. package/dist/assets/{kokoro-B-rc224u.js → kokoro-DcP-u0Tl.js} +1 -1
  75. package/dist/assets/{loader-BiYFMeRS.js → loader-BRfSnl9t.js} +2 -2
  76. package/dist/assets/{notes-nfocTnUv.js → notes-BDCTTA87.js} +1 -1
  77. package/dist/assets/{perfProbe-BqMK4N56.js → perfProbe-ssw0AtWX.js} +1 -1
  78. package/dist/assets/{pin-IyE46GaQ.js → pin-Bic4-gim.js} +1 -1
  79. package/dist/assets/{portal-C2b5NoMN.js → portal-Dpb34d3-.js} +1 -1
  80. package/dist/assets/{prewarm-Pvdu5Jt0.js → prewarm-xdXDmF8B.js} +1 -1
  81. package/dist/assets/{quietHours-lWcjQ2Iu.js → quietHours-uFS7n8N6.js} +1 -1
  82. package/dist/assets/{registry-BD1Zyd46.js → registry-BV02ROnH.js} +1 -1
  83. package/dist/assets/{registry-OUL5YJry.js → registry-BWx2f_wi.js} +1 -1
  84. package/dist/assets/{registry-BJFqryP_.js → registry-Bs5HUWIJ.js} +1 -1
  85. package/dist/assets/registry-CdPShFc3.js +1 -0
  86. package/dist/assets/{registry-BiT0eNZb.js → registry-DNIasVGX.js} +1 -1
  87. package/dist/assets/{registry-BTUHr4mQ.js → registry-DueizAoA.js} +1 -1
  88. package/dist/assets/{registry-CnmuVlAA.js → registry-PAcazQzL.js} +1 -1
  89. package/dist/assets/{relate-ZHm-ZvaR.js → relate-BHJl3RaA.js} +1 -1
  90. package/dist/assets/{replay-DBeCo_vn.js → replay-DoRQJHjZ.js} +1 -1
  91. package/dist/assets/{select-CejTsgpx.js → select-StjZ4ZRN.js} +1 -1
  92. package/dist/assets/shard010-Bal9PeRL.js +1 -0
  93. package/dist/assets/shard049-C4_IyApZ.js +1 -0
  94. package/dist/assets/{useDashboardLoop-SPlr1Mrm.js → useDashboardLoop-DEE_sLT0.js} +1 -1
  95. package/dist/assets/{walkSync-BtO3jsqQ.js → walkSync-CRhkAQFu.js} +1 -1
  96. package/dist/demo-assets/CREDITS.md +36 -0
  97. package/dist/index.html +1 -1
  98. package/package.json +1 -1
  99. package/dist/assets/DashboardLoopRuntime-B55z8L4b.js +0 -1
  100. package/dist/assets/GalleryApp-B4KBdNyu.css +0 -1
  101. package/dist/assets/canvas-BRGFkCD-.js +0 -1
  102. package/dist/assets/docs-B2aDtm5K.js +0 -1
  103. package/dist/assets/registry-BmjYillB.js +0 -1
  104. package/dist/assets/shard010-CQfR6lnk.js +0 -1
  105. package/dist/assets/shard049-hPaNN2sL.js +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/backup-AymOkasb.js","assets/catalog-vLsIS_Na.js","assets/preload-helper-CiWYd9n-.js","assets/rolldown-runtime-DkW27tQK.js","assets/facts-CNQz8OQz.js","assets/blockTypes-DUDdP3pB.js","assets/liveSchema-eKgFc5D0.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/safeImageUrl-BINWXOTz.js","assets/empty-D51uhW0E.js","assets/catalog-BHjl-1uH.js","assets/sourceHost-BV3t2XDb.js","assets/spokenText-Dy-GZvZV.js","assets/annotations-CftUUB13.js","assets/streamParse-BX0bAppQ.js","assets/store-C9s8Bfz0.js","assets/contentVault-XKWjF2FB.js","assets/keyVault-Aw5Y2PjT.js","assets/localBudget-CxLP6bjE.js","assets/store-D16dGt7I.js","assets/useLiveConfig-CvOQTr0s.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/info-CiqHR5cs.js","assets/providers-CPhoN8j0.js","assets/http-Bqk6nJiH.js","assets/attachments-BW-vki-E.js","assets/route-CMdTFx0P.js","assets/store-DqOaVRLn.js","assets/store-D2IJF4SA.js","assets/store-CgA7mKy1.js","assets/store-B2Rpbqgg.js","assets/ready-_sg3IJkE.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{_ as a,d as o,h as s,o as c,st as l,v as u}from"./index-CKRjGbeR.js";import{n as d}from"./icons-gLFQTv74.js";import{t as f}from"./useFocusTrap-CJmpNZv2.js";import{c as p,d as m,l as h,o as g,u as _}from"./kokoro-B-rc224u.js";import{t as v}from"./FeatureUseNotice-BfnZH8Vt.js";import{i as y,r as b}from"./info-CiqHR5cs.js";import{n as x}from"./store-C9s8Bfz0.js";import{t as ee}from"./time-BHTmJR1s.js";import{t as S}from"./providers-CPhoN8j0.js";import{c as C,d as w,i as T,n as E,s as D,t as te,u as ne}from"./useLiveConfig-CvOQTr0s.js";import{a as re,d as ie,f as ae,l as oe,m as se,n as ce,p as le,r as ue,s as de,u as fe}from"./quietHours-lWcjQ2Iu.js";import{i as pe,n as me,r as he,s as O}from"./store-DqOaVRLn.js";import{t as ge}from"./TemplatePicker-3w18ViSc.js";import{t as _e}from"./DropSelect-IBjV5Ol1.js";import{g as ve}from"./store-D2IJF4SA.js";import{n as ye,t as be}from"./useStudy-70Iz4ZVn.js";import{r as xe,t as Se}from"./ledger-BssK9Pv2.js";var k=e(),A=t(),j=n();function Ce(e){return e.reduce((e,t)=>({calls:e.calls+1,input:e.input+t.input,cachedInput:e.cachedInput+t.cachedInput,output:e.output+t.output}),{calls:0,input:0,cachedInput:0,output:0})}var M=new Intl.NumberFormat;function we(){let e=(0,A.c)(30),t=(0,k.useSyncExternalStore)(xe,Se,Se);if(!t.length){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(`p`,{className:`usage-empty`,children:`No model calls yet this session — the tour and the recorded demos never make one.`}),e[0]=t):t=e[0],t}let n,r,i,a;if(e[1]!==t){let o=Ce(t),s=o.input?Math.round(o.cachedInput/o.input*100):0,c=new Map;for(let e of t)c.set(e.label,(c.get(e.label)??0)+e.input+e.output);let l=[...c.entries()].sort(N);i=`usage-panel`;let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,j.jsx)(`dt`,{children:`Sent`}),e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,j.jsx)(`span`,{className:`usage-unit`,children:` in`}),e[7]=d):d=e[7];let f=(0,j.jsxs)(`div`,{children:[u,(0,j.jsxs)(`dd`,{children:[M.format(o.input),d]})]}),p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,j.jsx)(`dt`,{children:`Cached`}),e[8]=p):p=e[8];let m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,j.jsx)(`span`,{className:`usage-unit`,children:`% of that`}),e[9]=m):m=e[9];let h;e[10]===s?h=e[11]:(h=(0,j.jsxs)(`div`,{children:[p,(0,j.jsxs)(`dd`,{children:[s,m]})]}),e[10]=s,e[11]=h);let g;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,j.jsx)(`dt`,{children:`Written`}),e[12]=g):g=e[12];let _;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,j.jsx)(`span`,{className:`usage-unit`,children:` out`}),e[13]=_):_=e[13];let v=(0,j.jsxs)(`div`,{children:[g,(0,j.jsxs)(`dd`,{children:[M.format(o.output),_]})]}),y;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,j.jsx)(`dt`,{children:`Calls`}),e[14]=y):y=e[14];let b=M.format(o.calls),x;e[15]===b?x=e[16]:(x=(0,j.jsxs)(`div`,{children:[y,(0,j.jsx)(`dd`,{children:b})]}),e[15]=b,e[16]=x),e[17]!==v||e[18]!==x||e[19]!==f||e[20]!==h?(a=(0,j.jsxs)(`dl`,{className:`usage-totals`,children:[f,h,v,x]}),e[17]=v,e[18]=x,e[19]=f,e[20]=h,e[21]=a):a=e[21],n=`usage-sites`,r=l.map(Te),e[1]=t,e[2]=n,e[3]=r,e[4]=i,e[5]=a}else n=e[2],r=e[3],i=e[4],a=e[5];let o;e[22]!==n||e[23]!==r?(o=(0,j.jsx)(`ul`,{className:n,children:r}),e[22]=n,e[23]=r,e[24]=o):o=e[24];let s;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,j.jsx)(`p`,{className:`usage-note`,children:`Counted from what each provider reported for this session only — nothing is stored, and nothing leaves this device. Output tokens usually cost several times what input does.`}),e[25]=s):s=e[25];let c;return e[26]!==i||e[27]!==a||e[28]!==o?(c=(0,j.jsxs)(`div`,{className:i,children:[a,o,s]}),e[26]=i,e[27]=a,e[28]=o,e[29]=c):c=e[29],c}function Te(e){let[t,n]=e;return(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`usage-site-name`,children:t}),(0,j.jsx)(`span`,{className:`usage-site-tokens`,children:M.format(n)})]},t)}function N(e,t){return t[1]-e[1]}var P={display:`flex`,flexDirection:`column`,gap:4,fontSize:13,background:`var(--surface-default)`,border:`1px solid var(--line)`,borderRadius:8,padding:`7px 10px`},F={flex:`0 0 auto`,background:`transparent`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,lineHeight:1,padding:0};function Ee(e){let t=(0,A.c)(40),{node:n,ago:r}=e,[i,a]=(0,k.useState)(!1),[o,s]=(0,k.useState)(n.body),c=(0,k.useRef)(null),l,u;t[0]===i?(l=t[1],u=t[2]):(l=()=>{i&&c.current?.focus()},u=[i],t[0]=i,t[1]=l,t[2]=u),(0,k.useEffect)(l,u);let d;t[3]!==o||t[4]!==n.body||t[5]!==n.id?(d=()=>{let e=o.trim();e&&e!==n.body&&he(n.id,e),a(!1)},t[3]=o,t[4]=n.body,t[5]=n.id,t[6]=d):d=t[6];let f=d,p;t[7]===n.body?p=t[8]:(p=()=>{s(n.body),a(!1)},t[7]=n.body,t[8]=p);let m=p,h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h={display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},g={fontFamily:`var(--font-data, inherit)`,fontSize:10.5,fontWeight:600,color:`var(--presence)`,letterSpacing:`0.02em`},t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===n.concept?_=t[12]:(_=(0,j.jsx)(`span`,{style:g,children:n.concept}),t[11]=n.concept,t[12]=_);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v={fontSize:10.5,color:`var(--text-muted)`,whiteSpace:`nowrap`},t[13]=v):v=t[13];let y;t[14]===r?y=t[15]:(y=(0,j.jsx)(`span`,{style:v,children:r}),t[14]=r,t[15]=y);let b;t[16]!==i||t[17]!==n.concept?(b=!i&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>a(!0),title:`Edit this fact`,"aria-label":`Edit: ${n.concept}`,style:{...F,fontSize:12},children:`Edit`}),t[16]=i,t[17]=n.concept,t[18]=b):b=t[18];let x;t[19]===n.id?x=t[20]:(x=()=>me(n.id),t[19]=n.id,t[20]=x);let ee=`Forget: ${n.concept}`,S;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(S={...F,fontSize:16},t[21]=S):S=t[21];let C;t[22]!==x||t[23]!==ee?(C=(0,j.jsx)(`button`,{type:`button`,onClick:x,title:`Forget this concept`,"aria-label":ee,style:S,children:`×`}),t[22]=x,t[23]=ee,t[24]=C):C=t[24];let w;t[25]!==b||t[26]!==C||t[27]!==_||t[28]!==y?(w=(0,j.jsxs)(`div`,{style:h,children:[_,y,b,C]}),t[25]=b,t[26]=C,t[27]=_,t[28]=y,t[29]=w):w=t[29];let T;t[30]!==m||t[31]!==o||t[32]!==i||t[33]!==n.body||t[34]!==n.concept||t[35]!==f?(T=i?(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`textarea`,{ref:c,value:o,onChange:e=>s(e.target.value),rows:3,"aria-label":`Edit memory: ${n.concept}`,style:{font:`inherit`,fontSize:13,lineHeight:1.4,color:`var(--text-primary)`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:6,padding:`6px 8px`,resize:`vertical`,width:`100%`,boxSizing:`border-box`}}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8,justifyContent:`flex-end`},children:[(0,j.jsx)(`button`,{type:`button`,onClick:m,style:{...F,fontSize:12},children:`Cancel`}),(0,j.jsx)(`button`,{type:`button`,onClick:f,disabled:!o.trim(),style:{...F,fontSize:12,color:`var(--presence)`,fontWeight:600},children:`Save`})]})]}):(0,j.jsx)(`span`,{style:{color:`var(--text-primary)`,lineHeight:1.4},children:n.body}),t[30]=m,t[31]=o,t[32]=i,t[33]=n.body,t[34]=n.concept,t[35]=f,t[36]=T):T=t[36];let E;return t[37]!==w||t[38]!==T?(E=(0,j.jsxs)(`li`,{style:P,children:[w,T]}),t[37]=w,t[38]=T,t[39]=E):E=t[39],E}function I(e){let t=e.concept.indexOf(`.`);return t<0?e.concept:e.concept.slice(0,t)}function De(e){return{profile:`About you`,preferences:`Preferences`,topics:`Topics`,threads:`Open threads`,projects:`Projects`,work:`Work`,life:`Life`}[e]??e.slice(0,1).toUpperCase()+e.slice(1)}function Oe(e){let t=new Map;for(let n of e){let e=I(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.keys()].sort((e,t)=>e===`profile`?-1:t===`profile`?1:e.localeCompare(t)).map(e=>({namespace:e,nodes:t.get(e).slice().sort((e,t)=>t.updatedAt-e.updatedAt)}))}function ke(e){if(!e)return``;try{return new Date(e).toISOString().split(`T`)[0]}catch{return``}}function L(e){let t=ke(e.updatedAt);return`${t?`---\nconcept: ${e.concept}\nupdated: ${t}\n---`:`---\nconcept: ${e.concept}\n---`}\n\n${e.body}`}function Ae(e){return e.length?[...e].sort((e,t)=>e.concept===`profile`?-1:t.concept===`profile`?1:e.concept.localeCompare(t.concept)).map(L).join(`
2
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{_ as a,d as o,h as s,o as c,st as l,v as u}from"./index-BMeoXWPR.js";import{n as d}from"./icons-gLFQTv74.js";import{t as f}from"./useFocusTrap-CJmpNZv2.js";import{c as p,d as m,l as h,o as g,u as _}from"./kokoro-DcP-u0Tl.js";import{t as v}from"./FeatureUseNotice-BNDajs0p.js";import{i as y,r as b}from"./info-CiqHR5cs.js";import{n as x}from"./store-C9s8Bfz0.js";import{t as ee}from"./time-BHTmJR1s.js";import{t as S}from"./providers-CPhoN8j0.js";import{c as C,d as w,i as T,n as E,s as D,t as te,u as ne}from"./useLiveConfig-CvOQTr0s.js";import{a as re,d as ie,f as ae,l as oe,m as se,n as ce,p as le,r as ue,s as de,u as fe}from"./quietHours-uFS7n8N6.js";import{i as pe,n as me,r as he,s as O}from"./store-DqOaVRLn.js";import{t as ge}from"./TemplatePicker-CAC4ggbJ.js";import{t as _e}from"./DropSelect-BVDNR47E.js";import{g as ve}from"./store-D2IJF4SA.js";import{n as ye,t as be}from"./useStudy-70Iz4ZVn.js";import{r as xe,t as Se}from"./ledger-BssK9Pv2.js";var k=e(),A=t(),j=n();function Ce(e){return e.reduce((e,t)=>({calls:e.calls+1,input:e.input+t.input,cachedInput:e.cachedInput+t.cachedInput,output:e.output+t.output}),{calls:0,input:0,cachedInput:0,output:0})}var M=new Intl.NumberFormat;function we(){let e=(0,A.c)(30),t=(0,k.useSyncExternalStore)(xe,Se,Se);if(!t.length){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(`p`,{className:`usage-empty`,children:`No model calls yet this session — the tour and the recorded demos never make one.`}),e[0]=t):t=e[0],t}let n,r,i,a;if(e[1]!==t){let o=Ce(t),s=o.input?Math.round(o.cachedInput/o.input*100):0,c=new Map;for(let e of t)c.set(e.label,(c.get(e.label)??0)+e.input+e.output);let l=[...c.entries()].sort(N);i=`usage-panel`;let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,j.jsx)(`dt`,{children:`Sent`}),e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,j.jsx)(`span`,{className:`usage-unit`,children:` in`}),e[7]=d):d=e[7];let f=(0,j.jsxs)(`div`,{children:[u,(0,j.jsxs)(`dd`,{children:[M.format(o.input),d]})]}),p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,j.jsx)(`dt`,{children:`Cached`}),e[8]=p):p=e[8];let m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,j.jsx)(`span`,{className:`usage-unit`,children:`% of that`}),e[9]=m):m=e[9];let h;e[10]===s?h=e[11]:(h=(0,j.jsxs)(`div`,{children:[p,(0,j.jsxs)(`dd`,{children:[s,m]})]}),e[10]=s,e[11]=h);let g;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,j.jsx)(`dt`,{children:`Written`}),e[12]=g):g=e[12];let _;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,j.jsx)(`span`,{className:`usage-unit`,children:` out`}),e[13]=_):_=e[13];let v=(0,j.jsxs)(`div`,{children:[g,(0,j.jsxs)(`dd`,{children:[M.format(o.output),_]})]}),y;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,j.jsx)(`dt`,{children:`Calls`}),e[14]=y):y=e[14];let b=M.format(o.calls),x;e[15]===b?x=e[16]:(x=(0,j.jsxs)(`div`,{children:[y,(0,j.jsx)(`dd`,{children:b})]}),e[15]=b,e[16]=x),e[17]!==v||e[18]!==x||e[19]!==f||e[20]!==h?(a=(0,j.jsxs)(`dl`,{className:`usage-totals`,children:[f,h,v,x]}),e[17]=v,e[18]=x,e[19]=f,e[20]=h,e[21]=a):a=e[21],n=`usage-sites`,r=l.map(Te),e[1]=t,e[2]=n,e[3]=r,e[4]=i,e[5]=a}else n=e[2],r=e[3],i=e[4],a=e[5];let o;e[22]!==n||e[23]!==r?(o=(0,j.jsx)(`ul`,{className:n,children:r}),e[22]=n,e[23]=r,e[24]=o):o=e[24];let s;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,j.jsx)(`p`,{className:`usage-note`,children:`Counted from what each provider reported for this session only — nothing is stored, and nothing leaves this device. Output tokens usually cost several times what input does.`}),e[25]=s):s=e[25];let c;return e[26]!==i||e[27]!==a||e[28]!==o?(c=(0,j.jsxs)(`div`,{className:i,children:[a,o,s]}),e[26]=i,e[27]=a,e[28]=o,e[29]=c):c=e[29],c}function Te(e){let[t,n]=e;return(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`usage-site-name`,children:t}),(0,j.jsx)(`span`,{className:`usage-site-tokens`,children:M.format(n)})]},t)}function N(e,t){return t[1]-e[1]}var P={display:`flex`,flexDirection:`column`,gap:4,fontSize:13,background:`var(--surface-default)`,border:`1px solid var(--line)`,borderRadius:8,padding:`7px 10px`},F={flex:`0 0 auto`,background:`transparent`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,lineHeight:1,padding:0};function Ee(e){let t=(0,A.c)(40),{node:n,ago:r}=e,[i,a]=(0,k.useState)(!1),[o,s]=(0,k.useState)(n.body),c=(0,k.useRef)(null),l,u;t[0]===i?(l=t[1],u=t[2]):(l=()=>{i&&c.current?.focus()},u=[i],t[0]=i,t[1]=l,t[2]=u),(0,k.useEffect)(l,u);let d;t[3]!==o||t[4]!==n.body||t[5]!==n.id?(d=()=>{let e=o.trim();e&&e!==n.body&&he(n.id,e),a(!1)},t[3]=o,t[4]=n.body,t[5]=n.id,t[6]=d):d=t[6];let f=d,p;t[7]===n.body?p=t[8]:(p=()=>{s(n.body),a(!1)},t[7]=n.body,t[8]=p);let m=p,h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h={display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},g={fontFamily:`var(--font-data, inherit)`,fontSize:10.5,fontWeight:600,color:`var(--presence)`,letterSpacing:`0.02em`},t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===n.concept?_=t[12]:(_=(0,j.jsx)(`span`,{style:g,children:n.concept}),t[11]=n.concept,t[12]=_);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v={fontSize:10.5,color:`var(--text-muted)`,whiteSpace:`nowrap`},t[13]=v):v=t[13];let y;t[14]===r?y=t[15]:(y=(0,j.jsx)(`span`,{style:v,children:r}),t[14]=r,t[15]=y);let b;t[16]!==i||t[17]!==n.concept?(b=!i&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>a(!0),title:`Edit this fact`,"aria-label":`Edit: ${n.concept}`,style:{...F,fontSize:12},children:`Edit`}),t[16]=i,t[17]=n.concept,t[18]=b):b=t[18];let x;t[19]===n.id?x=t[20]:(x=()=>me(n.id),t[19]=n.id,t[20]=x);let ee=`Forget: ${n.concept}`,S;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(S={...F,fontSize:16},t[21]=S):S=t[21];let C;t[22]!==x||t[23]!==ee?(C=(0,j.jsx)(`button`,{type:`button`,onClick:x,title:`Forget this concept`,"aria-label":ee,style:S,children:`×`}),t[22]=x,t[23]=ee,t[24]=C):C=t[24];let w;t[25]!==b||t[26]!==C||t[27]!==_||t[28]!==y?(w=(0,j.jsxs)(`div`,{style:h,children:[_,y,b,C]}),t[25]=b,t[26]=C,t[27]=_,t[28]=y,t[29]=w):w=t[29];let T;t[30]!==m||t[31]!==o||t[32]!==i||t[33]!==n.body||t[34]!==n.concept||t[35]!==f?(T=i?(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`textarea`,{ref:c,value:o,onChange:e=>s(e.target.value),rows:3,"aria-label":`Edit memory: ${n.concept}`,style:{font:`inherit`,fontSize:13,lineHeight:1.4,color:`var(--text-primary)`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:6,padding:`6px 8px`,resize:`vertical`,width:`100%`,boxSizing:`border-box`}}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8,justifyContent:`flex-end`},children:[(0,j.jsx)(`button`,{type:`button`,onClick:m,style:{...F,fontSize:12},children:`Cancel`}),(0,j.jsx)(`button`,{type:`button`,onClick:f,disabled:!o.trim(),style:{...F,fontSize:12,color:`var(--presence)`,fontWeight:600},children:`Save`})]})]}):(0,j.jsx)(`span`,{style:{color:`var(--text-primary)`,lineHeight:1.4},children:n.body}),t[30]=m,t[31]=o,t[32]=i,t[33]=n.body,t[34]=n.concept,t[35]=f,t[36]=T):T=t[36];let E;return t[37]!==w||t[38]!==T?(E=(0,j.jsxs)(`li`,{style:P,children:[w,T]}),t[37]=w,t[38]=T,t[39]=E):E=t[39],E}function I(e){let t=e.concept.indexOf(`.`);return t<0?e.concept:e.concept.slice(0,t)}function De(e){return{profile:`About you`,preferences:`Preferences`,topics:`Topics`,threads:`Open threads`,projects:`Projects`,work:`Work`,life:`Life`}[e]??e.slice(0,1).toUpperCase()+e.slice(1)}function Oe(e){let t=new Map;for(let n of e){let e=I(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.keys()].sort((e,t)=>e===`profile`?-1:t===`profile`?1:e.localeCompare(t)).map(e=>({namespace:e,nodes:t.get(e).slice().sort((e,t)=>t.updatedAt-e.updatedAt)}))}function ke(e){if(!e)return``;try{return new Date(e).toISOString().split(`T`)[0]}catch{return``}}function L(e){let t=ke(e.updatedAt);return`${t?`---\nconcept: ${e.concept}\nupdated: ${t}\n---`:`---\nconcept: ${e.concept}\n---`}\n\n${e.body}`}function Ae(e){return e.length?[...e].sort((e,t)=>e.concept===`profile`?-1:t.concept===`profile`?1:e.concept.localeCompare(t.concept)).map(L).join(`
3
3
 
4
4
  ---
5
5
 
@@ -1 +1 @@
1
- import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{n}from"./icons-gLFQTv74.js";import{t as r}from"./MindShape-BbuVOTaR.js";var i=e(),a=t();function o(e){let t=(0,i.c)(33),{open:o,onClose:s,spec:c}=e,l=`scrim`+(o?` show`:``),u=o?0:-1,d=!o,f;t[0]===s?f=t[1]:(f=e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),s())},t[0]=s,t[1]=f);let p=o?`auto`:`none`,m;t[2]===p?m=t[3]:(m={pointerEvents:p},t[2]=p,t[3]=m);let h;t[4]!==s||t[5]!==l||t[6]!==u||t[7]!==d||t[8]!==f||t[9]!==m?(h=(0,a.jsx)(`div`,{className:l,onClick:s,role:`button`,tabIndex:u,"aria-hidden":d,"aria-label":`Close the map`,onKeyDown:f,style:m}),t[4]=s,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=m,t[10]=h):h=t[10];let g=`drawer`+(o?` show`:``),_=!o,v=!o,y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,a.jsx)(n.x,{}),t[11]=y):y=t[11];let b;t[12]===s?b=t[13]:(b=(0,a.jsx)(`button`,{className:`drawer-x`,onClick:s,"aria-label":`Close the map`,children:y}),t[12]=s,t[13]=b);let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,a.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,a.jsx)(n.sparkle,{style:{width:14,height:14}}),` The thinking behind this`]}),t[14]=x):x=t[14];let S;t[15]===c?S=t[16]:(S=c?.center&&(0,a.jsx)(`div`,{className:`drawer-claim`,children:c.center}),t[15]=c,t[16]=S);let C;t[17]===S?C=t[18]:(C=(0,a.jsxs)(`div`,{className:`drawer-head`,children:[x,S]}),t[17]=S,t[18]=C);let w;t[19]===c?w=t[20]:(w=c&&(0,a.jsx)(r,{asBlock:!0,center:c.center,atoms:c.atoms,links:c.links,clusters:c.clusters,unsaid:c.unsaid}),t[19]=c,t[20]=w);let T;t[21]===w?T=t[22]:(T=(0,a.jsx)(`div`,{className:`drawer-body`,children:w}),t[21]=w,t[22]=T);let E;t[23]!==v||t[24]!==b||t[25]!==C||t[26]!==T||t[27]!==g||t[28]!==_?(E=(0,a.jsxs)(`aside`,{className:g,"aria-hidden":_,inert:v,children:[b,C,T]}),t[23]=v,t[24]=b,t[25]=C,t[26]=T,t[27]=g,t[28]=_,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==h?(D=(0,a.jsxs)(a.Fragment,{children:[h,E]}),t[30]=E,t[31]=h,t[32]=D):D=t[32],D}export{o as MindMapViewerDrawer};
1
+ import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{n}from"./icons-gLFQTv74.js";import{t as r}from"./MindShape-DhEmAQeq.js";var i=e(),a=t();function o(e){let t=(0,i.c)(33),{open:o,onClose:s,spec:c}=e,l=`scrim`+(o?` show`:``),u=o?0:-1,d=!o,f;t[0]===s?f=t[1]:(f=e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),s())},t[0]=s,t[1]=f);let p=o?`auto`:`none`,m;t[2]===p?m=t[3]:(m={pointerEvents:p},t[2]=p,t[3]=m);let h;t[4]!==s||t[5]!==l||t[6]!==u||t[7]!==d||t[8]!==f||t[9]!==m?(h=(0,a.jsx)(`div`,{className:l,onClick:s,role:`button`,tabIndex:u,"aria-hidden":d,"aria-label":`Close the map`,onKeyDown:f,style:m}),t[4]=s,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=m,t[10]=h):h=t[10];let g=`drawer`+(o?` show`:``),_=!o,v=!o,y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,a.jsx)(n.x,{}),t[11]=y):y=t[11];let b;t[12]===s?b=t[13]:(b=(0,a.jsx)(`button`,{className:`drawer-x`,onClick:s,"aria-label":`Close the map`,children:y}),t[12]=s,t[13]=b);let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,a.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,a.jsx)(n.sparkle,{style:{width:14,height:14}}),` The thinking behind this`]}),t[14]=x):x=t[14];let S;t[15]===c?S=t[16]:(S=c?.center&&(0,a.jsx)(`div`,{className:`drawer-claim`,children:c.center}),t[15]=c,t[16]=S);let C;t[17]===S?C=t[18]:(C=(0,a.jsxs)(`div`,{className:`drawer-head`,children:[x,S]}),t[17]=S,t[18]=C);let w;t[19]===c?w=t[20]:(w=c&&(0,a.jsx)(r,{asBlock:!0,center:c.center,atoms:c.atoms,links:c.links,clusters:c.clusters,unsaid:c.unsaid}),t[19]=c,t[20]=w);let T;t[21]===w?T=t[22]:(T=(0,a.jsx)(`div`,{className:`drawer-body`,children:w}),t[21]=w,t[22]=T);let E;t[23]!==v||t[24]!==b||t[25]!==C||t[26]!==T||t[27]!==g||t[28]!==_?(E=(0,a.jsxs)(`aside`,{className:g,"aria-hidden":_,inert:v,children:[b,C,T]}),t[23]=v,t[24]=b,t[25]=C,t[26]=T,t[27]=g,t[28]=_,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==h?(D=(0,a.jsxs)(a.Fragment,{children:[h,E]}),t[30]=E,t[31]=h,t[32]=D):D=t[32],D}export{o as MindMapViewerDrawer};
@@ -1 +1 @@
1
- import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{R as r}from"./index-CKRjGbeR.js";import{t as i}from"./useSpatialCanvas-CfmZOXXP.js";import{t as a}from"./Presence-UqXfH4Y-.js";var o=e(),s=t(),c=1e3,l=26,u=150,d=105,f=82,p=16,m=1.5,h=324,g=252;.1*c;var _=120,v=80;.82*c;var y=120;function b(e,t,n,r=[],i=!1){let a=Array.from(e.keys()),o=t*2+l,s=n*2+l,c=168+Math.max(0,a.length-6)*10,f=i?h:c+d,p=i?g:c+n*.9,m=i?g:p+u;for(let i=0;i<400;i++){for(let[t,n]of a.entries()){let r=e.get(n);if(r.x===500&&r.y===329){let e=t/Math.max(1,a.length)*2*Math.PI;r.x=500+Math.cos(e),r.y=329+Math.sin(e)}let i=r.x-500,o=r.y-329,s=o>=0?m:p,c=i/f,l=o/s,u=Math.hypot(c,l)||1;u<1&&(r.x=500+c/u*f,r.y=329+l/u*s)}let i=!1;for(let t=0;t<a.length;t++)for(let n=t+1;n<a.length;n++){let r=e.get(a[t]),c=e.get(a[n]),l=c.x-r.x,u=c.y-r.y;l===0&&u===0&&(l=t-n,u=n-t);let d=o-Math.abs(l),f=s-Math.abs(u);if(d>0&&f>0){if(i=!0,d<=f){let e=d/2*(l<0?-1:1);r.x-=e,c.x+=e}else{let e=f/2*(u<0?-1:1);r.y-=e,c.y+=e}}}for(let o of a){let a=e.get(o);for(let e of r){let r=t+e.hw+l-Math.abs(a.x-e.x),o=n+e.hh+l-Math.abs(a.y-e.y);r<=0||o<=0||(i=!0,o<=r?a.y+=a.y>=e.y?o:-o:a.x+=a.x>=e.x?r:-r)}}if(!i)break}}function x(e,t,n){let r=Array.from(t.values()),i=new Map(n.map(e=>[e.id,e.members]));for(let n of e){let a=(i.get(n.id)??[]).map(e=>t.get(e.id)).filter(e=>!!e);if(a.length){let e=Math.min(...a.map(e=>e.x)),t=Math.max(...a.map(e=>e.x)),r=Math.min(...a.map(e=>e.y)),i=Math.max(...a.map(e=>e.y)),o=(e+t)/2,s=(r+i)/2,c=o-500,l=s-329;Math.abs(l)>=Math.abs(c)?(n.x=o,n.y=l>=0?i+78+p+14:r-78-p-14):(n.y=s,n.x=c>=0?t+150+f+14:e-150-f-14)}for(let t=0;t<80;t++){let t=!1,i=[...r.map(e=>({point:e,hw:150,hh:78})),...e.filter(e=>e!==n).map(e=>({point:e,hw:f,hh:p}))];for(let e of i){let r=f+e.hw+12-Math.abs(n.x-e.point.x),i=p+e.hh+10-Math.abs(n.y-e.point.y);r<=0||i<=0||(t=!0,i<=r?n.y+=n.y>=e.point.y?i:-i:n.x+=n.x>=e.point.x?r:-r)}if(!t)break}}}function S(e,t,n,r=!1,i=!1){let a=new Map,o=new Map,s=[],l=new Map(e.map(e=>[e.id,e])),u=new Set,d=[];for(let e of t??[]){let t=e.atomIds.map(e=>l.get(e)).filter(e=>!!e);t.length!==0&&(t.forEach(e=>u.add(e.id)),d.push({id:e.id,label:e.label,members:t}))}let f=e.filter(e=>!u.has(e.id));if(f.length&&d.push({id:`__rest`,members:f}),d.length===0)return{positions:a,centroidOf:o,labels:s};let p=d.length,h=p===1,g=h?0:Math.min(250,180+p*20);if(d.forEach((e,t)=>{let r=t/p*2*Math.PI-Math.PI/2,i=h?500:500+g*Math.cos(r),c=h?329:329+g*Math.sin(r);e.label&&s.push({id:e.id,label:e.label,x:i,y:c});let l=e.members.length,u=Math.max(318,230+l*26),d=l<=1?h?u:0:h?u:Math.min(220,110+l*16),f={x:i,y:c};e.members.forEach((e,r)=>{let s=n?.get(e.id);if(s)a.set(e.id,{x:s.x,y:s.y});else{let n=r/Math.max(1,l)*2*Math.PI-Math.PI/2+t*.4;a.set(e.id,{x:i+d*Math.cos(n),y:c+d*Math.sin(n)})}o.set(e.id,f)})}),b(a,150,78,[...r?[{x:820,y:630,hw:y,hh:78}]:[],...i?[{x:100,y:84,hw:_,hh:v}]:[]],i),i){let e=c*.42;for(let t of a.values()){let n=t.x-500,r=Math.abs(n)*m;t.x=500+Math.sign(n)*Math.min(r,Math.max(Math.abs(n),e))}}for(let e of d){let t=e.members.map(e=>a.get(e.id)).filter(e=>!!e);if(!t.length)continue;let n={x:t.reduce((e,t)=>e+t.x,0)/t.length,y:t.reduce((e,t)=>e+t.y,0)/t.length};for(let t of e.members)a.has(t.id)&&o.set(t.id,n)}return x(s,a,d),{positions:a,centroidOf:o,labels:s}}var C=n(),w={person:`#2E9C8E`,option:`#5B63E8`,want:`#B07A2E`,fear:`#C9705E`,constraint:`#7A8194`,tradeoff:`#8B6FD4`,contradiction:`#C9705E`,open_loop:`#C98A1B`,action:`#5B63E8`,value:`#B07A2E`,question:`#C98A1B`},T={person:`Person`,option:`Option`,want:`Want`,fear:`Worry`,constraint:`Constraint`,tradeoff:`Tradeoff`,contradiction:`Contradiction`,open_loop:`Open loop`,action:`Action`,value:`Value`,question:`Question`},E=96,D=18,O=104;function k(e,t,n,r){let i=n-e,a=r-t,o=Math.hypot(i,a)||1,s=-a/o,c=i/o,l=(e+n)/2,u=(t+r)/2,d=l+s*52,f=u+c*52,p=.25*e+.5*d+.25*n+s*18,m=.25*t+.5*f+.25*r+c*18;return{d:`M ${e} ${t} Q ${d} ${f} ${n} ${r}`,lx:p,ly:m}}function ee({atom:e,x:t,y:n,order:r,onRemove:i}){let[a,s]=(0,o.useState)(!1),c=w[e.kind]??`#7A8194`,l=e.status===`stable`;return(0,C.jsxs)(`div`,{className:`ms-card`,"data-status":e.status,"data-open":a?`true`:void 0,style:{left:`${t}px`,top:`${n}px`,"--ms-kind-color":c,"--ms-i":r},onClick:()=>l&&s(e=>!e),role:l?`button`:void 0,tabIndex:l?0:void 0,"aria-expanded":l?a:void 0,onKeyDown:e=>e.key===`Enter`&&l&&s(e=>!e),children:[i&&(0,C.jsx)(`button`,{type:`button`,className:`ms-card-remove`,"aria-label":`Remove “${e.label}”`,onClick:t=>{t.stopPropagation(),i(e.id)},children:`×`}),(0,C.jsxs)(`div`,{className:`ms-card-header`,children:[(0,C.jsx)(`span`,{className:`ms-kind-dot`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`ms-kind-label`,children:T[e.kind]})]}),(0,C.jsx)(`div`,{className:`ms-atom-label`,children:e.label}),l&&(0,C.jsxs)(`div`,{className:`ms-card-quote`,"aria-hidden":!a,children:[(0,C.jsx)(`span`,{className:`ms-you-said`,children:`you said · `}),e.quote]})]})}function te({unsaid:e,onConfirm:t,onDismiss:n}){let r=!!(t||n);return(0,C.jsxs)(`div`,{className:`ms-card ms-unsaid`,"data-status":`maybe`,"data-interactive":r?`true`:void 0,style:{left:`820px`,top:`630px`,"--ms-i":20},"aria-label":`Maybe: ${e.label}`,children:[(0,C.jsxs)(`div`,{className:`ms-card-header`,children:[(0,C.jsx)(`span`,{className:`ms-kind-dot`,style:{background:`var(--warning)`},"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`ms-kind-label`,style:{color:`var(--warning)`},children:`Maybe`})]}),(0,C.jsx)(`div`,{className:`ms-atom-label`,children:e.label}),(0,C.jsx)(`div`,{className:`ms-card-quote`,children:e.why}),r&&(0,C.jsxs)(`div`,{className:`ms-unsaid-actions`,children:[t&&(0,C.jsx)(`button`,{type:`button`,className:`ms-unsaid-btn ms-unsaid-confirm`,onClick:e=>{e.stopPropagation(),t()},children:`Yes, that's it`}),n&&(0,C.jsx)(`button`,{type:`button`,className:`ms-unsaid-btn ms-unsaid-dismiss`,onClick:e=>{e.stopPropagation(),n()},children:`Not this`})]})]})}function ne(e){let t=(0,s.c)(4),{signal:n}=e,r;return t[0]!==n.content||t[1]!==n.id||t[2]!==n.kind?(r=(0,C.jsx)(`div`,{className:`ms-signal-chip`,"data-kind":n.kind,"aria-live":`polite`,children:n.content},n.id),t[0]=n.content,t[1]=n.id,t[2]=n.kind,t[3]=r):r=t[3],r}function re(e,t){let n=e.links.filter(e=>e.kind===`tensions`).length,r=e.atoms.filter(e=>e.kind===`question`).length,i=e.atoms.filter(e=>e.kind===`option`).length,a=e.atoms.length;return t&&n>0?n===1?`1 tension. ${t.a.label} vs ${t.b.label}.`:`${n} tensions. The real pull: ${t.a.label} vs ${t.b.label}.`:r>=3?`${r} open questions.`:i>=2?`${i} options. ${a} things on your mind.`:`${a} thought${a===1?``:`s`}. Here's what I heard.`}function A({center:e,atoms:t=[],links:n=[],clusters:s,unsaid:l,title:u,phase:d=`settled`,intent:f=`general`,isRevealing:p=!1,modelUnavailable:m=!1,currentSignal:h,onAction:g,onRemoveAtom:_,onConfirmUnsaid:v,onDismissUnsaid:y,liveTranscript:b,thoughtCount:x,delay:T=0,asBlock:A=!0}){let j=(0,o.useRef)(new Map),M=r(),N=d===`settled`,P=`${N}|${(s??[]).map(e=>`${e.id}:${e.atomIds.join(`,`)}`).join(`|`)}`,F=(0,o.useRef)(``),ie=P===F.current?j.current:void 0,{positions:I,centroidOf:ae,labels:L}=(0,o.useMemo)(()=>S(t,s,ie,!!l,N),[t,s,l,N]);j.current=I,F.current=P;let oe=!!g&&t.length>0,R=i({clamp:{min:.12,max:1.6},margin:20,insetBottom:oe?O:0}),{fitTo:z}=R,B=(0,o.useMemo)(()=>{let e=318,t=195.6;for(let n of I.values())e=Math.max(e,Math.abs(n.x-500)+150),t=Math.max(t,Math.abs(n.y-329)+78);for(let n of L)e=Math.max(e,Math.abs(n.x-500)+E),t=Math.max(t,Math.abs(n.y-329)+D);return l&&(e=Math.max(e,470),t=Math.max(t,379)),e+=24,t+=24,{x:500-e,y:329-t,w:2*e,h:2*t}},[I,L,l]);(0,o.useEffect)(()=>{z(B)},[B,z]);let V=[...n].sort((e,t)=>(e.kind===`tensions`)-+(t.kind===`tensions`)),H=(0,o.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),U=(0,o.useMemo)(()=>{let e=n.filter(e=>e.kind===`tensions`&&!e.provisional&&e.label);if(e.length===0)return null;let t=e=>H.get(e)?.weight??1,r=e.map(e=>({l:e,w:t(e.from)+t(e.to)})).sort((e,t)=>t.w-e.w||(e.l.from+e.l.to).localeCompare(t.l.from+t.l.to))[0],i=H.get(r.l.from),a=H.get(r.l.to);return!i||!a?null:{a:i,b:a,label:r.l.label}},[n,H]),W=(0,o.useMemo)(()=>t.filter(e=>(e.kind===`open_loop`||e.kind===`action`||e.kind===`question`)&&e.quote&&e.status!==`maybe`).map(e=>({id:e.id,label:e.label,quote:e.quote})),[t]),[G,K]=(0,o.useState)(null),[se,ce]=(0,o.useState)(()=>new Set),le=(0,o.useCallback)(e=>{ce(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),q=(0,o.useRef)(!1),J=(0,o.useRef)(!1),Y=(0,o.useRef)(d===`settled`);(0,o.useEffect)(()=>{d===`settled`&&(f===`planning`&&!J.current?(J.current=!0,K(`plan`)):U&&!q.current&&f!==`planning`&&(q.current=!0,K(`tension`)));let e=Y.current;Y.current=d===`settled`,e&&d!==`settled`&&(q.current=!1,J.current=!1,K(null))},[d,U,f]);let X=d===`listening`?`listening`:d===`pausing`?`thinking`:`idle`,ue=d===`settled`?{decision:`THE DECISION`,planning:`THE PLAN`,exploration:`THE QUESTION`,processing:`WHAT'S GOING ON`,general:`WHAT I HEARD`}[f]??`WHAT I HEARD`:`WHAT I'M HEARING`,de={decision:`Help me decide`,planning:`Build this plan`,exploration:`Take me deeper`,processing:`Help me understand`,general:`Answer this`}[f]??`Answer this`,Z=(0,o.useRef)(null),fe=e=>{!N||e.button!==0||e.target.closest(`.ms-card, .ms-hub, button`)||(Z.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId))},pe=e=>{let t=Z.current;t&&(R.pan(e.clientX-t.x,e.clientY-t.y),Z.current={x:e.clientX,y:e.clientY})},Q=e=>{Z.current&&(Z.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId))},$=(0,C.jsxs)(`div`,{className:`ms-canvas`,ref:R.viewportRef,onPointerDown:fe,onPointerMove:pe,onPointerUp:Q,onPointerCancel:Q,onWheel:e=>{N&&R.zoomAtClient(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)},"data-interactive":!0,"data-explorable":N?`true`:void 0,style:{"--ms-cam-scale":R.camera.scale},"data-phase":d,"data-revealing":p?`true`:void 0,"data-has-actions":g&&t.length>0?`true`:void 0,role:`region`,"aria-label":`Mindshape — the shape of your thought`,children:[(0,C.jsxs)(`div`,{className:`ms-world`,style:{transform:R.transform,"--ms-cam-scale":R.camera.scale},children:[L.map(e=>(0,C.jsx)(`div`,{className:`ms-cluster-label`,style:{left:`${e.x}px`,top:`${e.y}px`},"aria-hidden":`true`,children:e.label},e.id)),(0,C.jsxs)(`svg`,{className:`ms-svg`,viewBox:`0 0 ${c} 700`,"aria-hidden":`true`,children:[t.filter(e=>e.status===`stable`).map((e,t)=>{let n=I.get(e.id),r=ae.get(e.id);return!n||!r?null:(0,C.jsx)(`path`,{className:`ms-spoke`,d:`M ${r.x} ${r.y} L ${n.x} ${n.y}`,pathLength:1,style:{"--ms-spoke-i":t}},`spoke-${e.id}`)}),V.map((e,t)=>{let n=I.get(e.from),r=I.get(e.to);if(!n||!r)return null;let i=e.kind===`tensions`,a=w[H.get(e.from)?.kind??`fear`],{d:o,lx:s,ly:c}=k(n.x,n.y,r.x,r.y),l=i&&U&&e.from===U.a.id&&e.to===U.b.id;return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`path`,{className:i?`ms-thread`:`ms-link`,"data-kind":e.kind,"data-hero":l?`true`:void 0,d:o,pathLength:i?1:void 0,stroke:i?a:void 0,style:{animationDelay:`${.3+t*.12}s`}}),i&&e.label&&(0,C.jsx)(`text`,{className:`ms-thread-label`,x:s,y:c,textAnchor:`middle`,dominantBaseline:`middle`,children:e.label})]},`link-${e.from}-${e.to}-${e.kind}`)})]}),N&&e&&(0,C.jsx)(`div`,{className:`ms-hub`,style:{left:`500px`,top:`329px`},"aria-live":`polite`,children:(0,C.jsx)(`span`,{className:`ms-hub-text`,children:e})}),t.map((e,t)=>{let n=I.get(e.id);return n?(0,C.jsx)(ee,{atom:e,x:n.x,y:n.y,order:t,onRemove:_},e.id):null}),l&&(0,C.jsx)(te,{unsaid:l,onConfirm:v,onDismiss:y})]}),(0,C.jsxs)(`div`,{className:`ms-center`,children:[h&&d!==`settled`&&(0,C.jsx)(ne,{signal:h}),!N&&(0,C.jsx)(`div`,{className:`ms-center-pip-wrap`,ref:M,children:(0,C.jsx)(a,{state:X,emotion:`neutral`,gaze:`center`})}),(0,C.jsx)(`div`,{className:`ms-center-label`,"aria-hidden":`true`,children:ue}),e&&!N&&(0,C.jsx)(`div`,{className:`ms-center-question`,"aria-live":`polite`,children:e}),d===`settled`&&(t.length>0?(0,C.jsx)(`div`,{className:`ms-synthesis-line`,"aria-live":`polite`,children:re({atoms:t,links:n},U)}):m?(0,C.jsx)(`div`,{className:`ms-synthesis-line`,"aria-live":`polite`,children:`I couldn't reach the model just now — nothing you said was lost. Try again in a moment.`}):(0,C.jsx)(`div`,{className:`ms-synthesis-line`,"aria-live":`polite`,children:`Didn't catch enough to map yet — keep talking and I'll shape it.`})),x!==void 0&&x>=0&&d!==`settled`&&(0,C.jsxs)(`div`,{className:`ms-thought-count`,"aria-live":`polite`,children:[(0,C.jsx)(`span`,{className:`ms-mic-dot`,"aria-hidden":`true`}),(()=>{let e=Math.max(x,t.length);return e===0?`Listening…`:`${e} thought${e===1?``:`s`}`})()]}),b&&(0,C.jsx)(`div`,{className:`ms-live-text`,"aria-live":`polite`,"aria-label":`Currently hearing`,children:b})]}),d===`settled`&&U&&G===`tension`&&(0,C.jsxs)(`div`,{className:`ms-tension-callout`,role:`dialog`,"aria-label":`The tension`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-close`,"aria-label":`Dismiss`,onClick:()=>K(null),children:`×`}),(0,C.jsx)(`span`,{className:`ms-tension-eyebrow`,children:`THE TENSION`}),(0,C.jsxs)(`p`,{className:`ms-tension-body`,children:[`You keep coming back to `,(0,C.jsxs)(`strong`,{children:[`“`,U.a.label,`.”`]}),` But you also said`,` `,(0,C.jsxs)(`strong`,{children:[`“`,U.b.label,`.”`]}),` Those may not be the same reason.`]}),g&&(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-cta`,onClick:()=>g(`tell-apart`,{tension:{a:U.a.label,b:U.b.label}}),children:`Help me tell them apart →`})]}),G===`plan`&&(0,C.jsxs)(`div`,{className:`ms-plan`,role:`dialog`,"aria-label":`Turn into a plan`,children:[(0,C.jsxs)(`header`,{className:`ms-plan-head`,children:[(0,C.jsx)(`span`,{className:`ms-plan-title`,children:`The open loops, as steps you control`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-close`,"aria-label":`Close the plan`,onClick:()=>K(null),children:`×`})]}),W.length>0?(0,C.jsx)(`ol`,{className:`ms-plan-steps`,children:W.map(e=>{let t=se.has(e.id);return(0,C.jsxs)(`li`,{className:`ms-plan-step`,"data-done":t?`true`:void 0,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-plan-check`,role:`checkbox`,"aria-checked":t,"aria-label":`Mark “${e.label}” done`,onClick:()=>le(e.id),children:t&&(0,C.jsx)(`span`,{className:`ms-plan-check-mark`,"aria-hidden":`true`,children:`✓`})}),(0,C.jsxs)(`span`,{className:`ms-plan-step-body`,children:[(0,C.jsx)(`span`,{className:`ms-plan-step-label`,children:e.label}),(0,C.jsxs)(`span`,{className:`ms-plan-step-trace`,children:[`from “`,e.quote,`”`]})]})]},e.id)})}):(0,C.jsx)(`p`,{className:`ms-plan-empty`,children:`No open loops to turn into steps yet — keep talking and they’ll surface.`}),(0,C.jsxs)(`footer`,{className:`ms-plan-foot`,children:[(0,C.jsx)(`span`,{className:`ms-plan-note`,children:`Every step traces back to something you said — nothing invented.`}),g&&W.length>0&&(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn ms-action-primary`,onClick:()=>g(`commit-plan`),children:`Make it real →`})]})]}),d===`settled`&&G===`kept`&&(0,C.jsxs)(`div`,{className:`ms-kept`,role:`dialog`,"aria-label":`Kept this shape`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-close`,"aria-label":`Close`,onClick:()=>K(null),children:`×`}),(0,C.jsx)(`span`,{className:`ms-kept-eyebrow`,children:`KEPT THIS SHAPE`}),(0,C.jsx)(`p`,{className:`ms-kept-body`,children:`This is the shape of what you were thinking. It’s yours to revisit.`}),g&&(0,C.jsxs)(`div`,{className:`ms-kept-actions`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-kept-btn`,onClick:()=>g(`answer`),children:`↻ Replay`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-kept-btn`,onClick:()=>g(`share`),children:`↗ Share`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-kept-btn`,onClick:()=>g(`present`),children:`▶ Present mode`})]}),(0,C.jsx)(`span`,{className:`ms-kept-memory`,children:`Nothing was saved to memory — Mavéa asks first before keeping anything personal.`})]}),g&&t.length>0&&(0,C.jsxs)(`div`,{className:`ms-actions`,role:`group`,"aria-label":`What to do with this map`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn ms-action-primary`,onClick:()=>g(`answer`),children:de}),(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`+(G===`plan`?` is-active`:``),"aria-pressed":G===`plan`,onClick:()=>K(e=>e===`plan`?null:`plan`),children:`Turn into a plan`}),d===`settled`&&(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`+(G===`kept`?` is-active`:``),"aria-pressed":G===`kept`,onClick:()=>K(e=>e===`kept`?null:`kept`),children:`That’s it`}),d===`settled`&&(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`,onClick:()=>g(`add-more`),children:`Add more`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`,onClick:()=>g(`not-quite`),children:`Not quite`})]})]});return A?(0,C.jsxs)(`div`,{className:`card reveal`,style:{"--delay":`${T}ms`},children:[u&&(0,C.jsx)(`div`,{className:`card-eyebrow`,children:u}),$]}):$}export{A as t};
1
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{R as r}from"./index-BMeoXWPR.js";import{t as i}from"./useSpatialCanvas-CfmZOXXP.js";import{t as a}from"./Presence-UqXfH4Y-.js";var o=e(),s=t(),c=1e3,l=26,u=150,d=105,f=82,p=16,m=1.5,h=324,g=252;.1*c;var _=120,v=80;.82*c;var y=120;function b(e,t,n,r=[],i=!1){let a=Array.from(e.keys()),o=t*2+l,s=n*2+l,c=168+Math.max(0,a.length-6)*10,f=i?h:c+d,p=i?g:c+n*.9,m=i?g:p+u;for(let i=0;i<400;i++){for(let[t,n]of a.entries()){let r=e.get(n);if(r.x===500&&r.y===329){let e=t/Math.max(1,a.length)*2*Math.PI;r.x=500+Math.cos(e),r.y=329+Math.sin(e)}let i=r.x-500,o=r.y-329,s=o>=0?m:p,c=i/f,l=o/s,u=Math.hypot(c,l)||1;u<1&&(r.x=500+c/u*f,r.y=329+l/u*s)}let i=!1;for(let t=0;t<a.length;t++)for(let n=t+1;n<a.length;n++){let r=e.get(a[t]),c=e.get(a[n]),l=c.x-r.x,u=c.y-r.y;l===0&&u===0&&(l=t-n,u=n-t);let d=o-Math.abs(l),f=s-Math.abs(u);if(d>0&&f>0){if(i=!0,d<=f){let e=d/2*(l<0?-1:1);r.x-=e,c.x+=e}else{let e=f/2*(u<0?-1:1);r.y-=e,c.y+=e}}}for(let o of a){let a=e.get(o);for(let e of r){let r=t+e.hw+l-Math.abs(a.x-e.x),o=n+e.hh+l-Math.abs(a.y-e.y);r<=0||o<=0||(i=!0,o<=r?a.y+=a.y>=e.y?o:-o:a.x+=a.x>=e.x?r:-r)}}if(!i)break}}function x(e,t,n){let r=Array.from(t.values()),i=new Map(n.map(e=>[e.id,e.members]));for(let n of e){let a=(i.get(n.id)??[]).map(e=>t.get(e.id)).filter(e=>!!e);if(a.length){let e=Math.min(...a.map(e=>e.x)),t=Math.max(...a.map(e=>e.x)),r=Math.min(...a.map(e=>e.y)),i=Math.max(...a.map(e=>e.y)),o=(e+t)/2,s=(r+i)/2,c=o-500,l=s-329;Math.abs(l)>=Math.abs(c)?(n.x=o,n.y=l>=0?i+78+p+14:r-78-p-14):(n.y=s,n.x=c>=0?t+150+f+14:e-150-f-14)}for(let t=0;t<80;t++){let t=!1,i=[...r.map(e=>({point:e,hw:150,hh:78})),...e.filter(e=>e!==n).map(e=>({point:e,hw:f,hh:p}))];for(let e of i){let r=f+e.hw+12-Math.abs(n.x-e.point.x),i=p+e.hh+10-Math.abs(n.y-e.point.y);r<=0||i<=0||(t=!0,i<=r?n.y+=n.y>=e.point.y?i:-i:n.x+=n.x>=e.point.x?r:-r)}if(!t)break}}}function S(e,t,n,r=!1,i=!1){let a=new Map,o=new Map,s=[],l=new Map(e.map(e=>[e.id,e])),u=new Set,d=[];for(let e of t??[]){let t=e.atomIds.map(e=>l.get(e)).filter(e=>!!e);t.length!==0&&(t.forEach(e=>u.add(e.id)),d.push({id:e.id,label:e.label,members:t}))}let f=e.filter(e=>!u.has(e.id));if(f.length&&d.push({id:`__rest`,members:f}),d.length===0)return{positions:a,centroidOf:o,labels:s};let p=d.length,h=p===1,g=h?0:Math.min(250,180+p*20);if(d.forEach((e,t)=>{let r=t/p*2*Math.PI-Math.PI/2,i=h?500:500+g*Math.cos(r),c=h?329:329+g*Math.sin(r);e.label&&s.push({id:e.id,label:e.label,x:i,y:c});let l=e.members.length,u=Math.max(318,230+l*26),d=l<=1?h?u:0:h?u:Math.min(220,110+l*16),f={x:i,y:c};e.members.forEach((e,r)=>{let s=n?.get(e.id);if(s)a.set(e.id,{x:s.x,y:s.y});else{let n=r/Math.max(1,l)*2*Math.PI-Math.PI/2+t*.4;a.set(e.id,{x:i+d*Math.cos(n),y:c+d*Math.sin(n)})}o.set(e.id,f)})}),b(a,150,78,[...r?[{x:820,y:630,hw:y,hh:78}]:[],...i?[{x:100,y:84,hw:_,hh:v}]:[]],i),i){let e=c*.42;for(let t of a.values()){let n=t.x-500,r=Math.abs(n)*m;t.x=500+Math.sign(n)*Math.min(r,Math.max(Math.abs(n),e))}}for(let e of d){let t=e.members.map(e=>a.get(e.id)).filter(e=>!!e);if(!t.length)continue;let n={x:t.reduce((e,t)=>e+t.x,0)/t.length,y:t.reduce((e,t)=>e+t.y,0)/t.length};for(let t of e.members)a.has(t.id)&&o.set(t.id,n)}return x(s,a,d),{positions:a,centroidOf:o,labels:s}}var C=n(),w={person:`#2E9C8E`,option:`#5B63E8`,want:`#B07A2E`,fear:`#C9705E`,constraint:`#7A8194`,tradeoff:`#8B6FD4`,contradiction:`#C9705E`,open_loop:`#C98A1B`,action:`#5B63E8`,value:`#B07A2E`,question:`#C98A1B`},T={person:`Person`,option:`Option`,want:`Want`,fear:`Worry`,constraint:`Constraint`,tradeoff:`Tradeoff`,contradiction:`Contradiction`,open_loop:`Open loop`,action:`Action`,value:`Value`,question:`Question`},E=96,D=18,O=104;function k(e,t,n,r){let i=n-e,a=r-t,o=Math.hypot(i,a)||1,s=-a/o,c=i/o,l=(e+n)/2,u=(t+r)/2,d=l+s*52,f=u+c*52,p=.25*e+.5*d+.25*n+s*18,m=.25*t+.5*f+.25*r+c*18;return{d:`M ${e} ${t} Q ${d} ${f} ${n} ${r}`,lx:p,ly:m}}function ee({atom:e,x:t,y:n,order:r,onRemove:i}){let[a,s]=(0,o.useState)(!1),c=w[e.kind]??`#7A8194`,l=e.status===`stable`;return(0,C.jsxs)(`div`,{className:`ms-card`,"data-status":e.status,"data-open":a?`true`:void 0,style:{left:`${t}px`,top:`${n}px`,"--ms-kind-color":c,"--ms-i":r},onClick:()=>l&&s(e=>!e),role:l?`button`:void 0,tabIndex:l?0:void 0,"aria-expanded":l?a:void 0,onKeyDown:e=>e.key===`Enter`&&l&&s(e=>!e),children:[i&&(0,C.jsx)(`button`,{type:`button`,className:`ms-card-remove`,"aria-label":`Remove “${e.label}”`,onClick:t=>{t.stopPropagation(),i(e.id)},children:`×`}),(0,C.jsxs)(`div`,{className:`ms-card-header`,children:[(0,C.jsx)(`span`,{className:`ms-kind-dot`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`ms-kind-label`,children:T[e.kind]})]}),(0,C.jsx)(`div`,{className:`ms-atom-label`,children:e.label}),l&&(0,C.jsxs)(`div`,{className:`ms-card-quote`,"aria-hidden":!a,children:[(0,C.jsx)(`span`,{className:`ms-you-said`,children:`you said · `}),e.quote]})]})}function te({unsaid:e,onConfirm:t,onDismiss:n}){let r=!!(t||n);return(0,C.jsxs)(`div`,{className:`ms-card ms-unsaid`,"data-status":`maybe`,"data-interactive":r?`true`:void 0,style:{left:`820px`,top:`630px`,"--ms-i":20},"aria-label":`Maybe: ${e.label}`,children:[(0,C.jsxs)(`div`,{className:`ms-card-header`,children:[(0,C.jsx)(`span`,{className:`ms-kind-dot`,style:{background:`var(--warning)`},"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`ms-kind-label`,style:{color:`var(--warning)`},children:`Maybe`})]}),(0,C.jsx)(`div`,{className:`ms-atom-label`,children:e.label}),(0,C.jsx)(`div`,{className:`ms-card-quote`,children:e.why}),r&&(0,C.jsxs)(`div`,{className:`ms-unsaid-actions`,children:[t&&(0,C.jsx)(`button`,{type:`button`,className:`ms-unsaid-btn ms-unsaid-confirm`,onClick:e=>{e.stopPropagation(),t()},children:`Yes, that's it`}),n&&(0,C.jsx)(`button`,{type:`button`,className:`ms-unsaid-btn ms-unsaid-dismiss`,onClick:e=>{e.stopPropagation(),n()},children:`Not this`})]})]})}function ne(e){let t=(0,s.c)(4),{signal:n}=e,r;return t[0]!==n.content||t[1]!==n.id||t[2]!==n.kind?(r=(0,C.jsx)(`div`,{className:`ms-signal-chip`,"data-kind":n.kind,"aria-live":`polite`,children:n.content},n.id),t[0]=n.content,t[1]=n.id,t[2]=n.kind,t[3]=r):r=t[3],r}function re(e,t){let n=e.links.filter(e=>e.kind===`tensions`).length,r=e.atoms.filter(e=>e.kind===`question`).length,i=e.atoms.filter(e=>e.kind===`option`).length,a=e.atoms.length;return t&&n>0?n===1?`1 tension. ${t.a.label} vs ${t.b.label}.`:`${n} tensions. The real pull: ${t.a.label} vs ${t.b.label}.`:r>=3?`${r} open questions.`:i>=2?`${i} options. ${a} things on your mind.`:`${a} thought${a===1?``:`s`}. Here's what I heard.`}function A({center:e,atoms:t=[],links:n=[],clusters:s,unsaid:l,title:u,phase:d=`settled`,intent:f=`general`,isRevealing:p=!1,modelUnavailable:m=!1,currentSignal:h,onAction:g,onRemoveAtom:_,onConfirmUnsaid:v,onDismissUnsaid:y,liveTranscript:b,thoughtCount:x,delay:T=0,asBlock:A=!0}){let j=(0,o.useRef)(new Map),M=r(),N=d===`settled`,P=`${N}|${(s??[]).map(e=>`${e.id}:${e.atomIds.join(`,`)}`).join(`|`)}`,F=(0,o.useRef)(``),ie=P===F.current?j.current:void 0,{positions:I,centroidOf:ae,labels:L}=(0,o.useMemo)(()=>S(t,s,ie,!!l,N),[t,s,l,N]);j.current=I,F.current=P;let oe=!!g&&t.length>0,R=i({clamp:{min:.12,max:1.6},margin:20,insetBottom:oe?O:0}),{fitTo:z}=R,B=(0,o.useMemo)(()=>{let e=318,t=195.6;for(let n of I.values())e=Math.max(e,Math.abs(n.x-500)+150),t=Math.max(t,Math.abs(n.y-329)+78);for(let n of L)e=Math.max(e,Math.abs(n.x-500)+E),t=Math.max(t,Math.abs(n.y-329)+D);return l&&(e=Math.max(e,470),t=Math.max(t,379)),e+=24,t+=24,{x:500-e,y:329-t,w:2*e,h:2*t}},[I,L,l]);(0,o.useEffect)(()=>{z(B)},[B,z]);let V=[...n].sort((e,t)=>(e.kind===`tensions`)-+(t.kind===`tensions`)),H=(0,o.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),U=(0,o.useMemo)(()=>{let e=n.filter(e=>e.kind===`tensions`&&!e.provisional&&e.label);if(e.length===0)return null;let t=e=>H.get(e)?.weight??1,r=e.map(e=>({l:e,w:t(e.from)+t(e.to)})).sort((e,t)=>t.w-e.w||(e.l.from+e.l.to).localeCompare(t.l.from+t.l.to))[0],i=H.get(r.l.from),a=H.get(r.l.to);return!i||!a?null:{a:i,b:a,label:r.l.label}},[n,H]),W=(0,o.useMemo)(()=>t.filter(e=>(e.kind===`open_loop`||e.kind===`action`||e.kind===`question`)&&e.quote&&e.status!==`maybe`).map(e=>({id:e.id,label:e.label,quote:e.quote})),[t]),[G,K]=(0,o.useState)(null),[se,ce]=(0,o.useState)(()=>new Set),le=(0,o.useCallback)(e=>{ce(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),q=(0,o.useRef)(!1),J=(0,o.useRef)(!1),Y=(0,o.useRef)(d===`settled`);(0,o.useEffect)(()=>{d===`settled`&&(f===`planning`&&!J.current?(J.current=!0,K(`plan`)):U&&!q.current&&f!==`planning`&&(q.current=!0,K(`tension`)));let e=Y.current;Y.current=d===`settled`,e&&d!==`settled`&&(q.current=!1,J.current=!1,K(null))},[d,U,f]);let X=d===`listening`?`listening`:d===`pausing`?`thinking`:`idle`,ue=d===`settled`?{decision:`THE DECISION`,planning:`THE PLAN`,exploration:`THE QUESTION`,processing:`WHAT'S GOING ON`,general:`WHAT I HEARD`}[f]??`WHAT I HEARD`:`WHAT I'M HEARING`,de={decision:`Help me decide`,planning:`Build this plan`,exploration:`Take me deeper`,processing:`Help me understand`,general:`Answer this`}[f]??`Answer this`,Z=(0,o.useRef)(null),fe=e=>{!N||e.button!==0||e.target.closest(`.ms-card, .ms-hub, button`)||(Z.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId))},pe=e=>{let t=Z.current;t&&(R.pan(e.clientX-t.x,e.clientY-t.y),Z.current={x:e.clientX,y:e.clientY})},Q=e=>{Z.current&&(Z.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId))},$=(0,C.jsxs)(`div`,{className:`ms-canvas`,ref:R.viewportRef,onPointerDown:fe,onPointerMove:pe,onPointerUp:Q,onPointerCancel:Q,onWheel:e=>{N&&R.zoomAtClient(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)},"data-interactive":!0,"data-explorable":N?`true`:void 0,style:{"--ms-cam-scale":R.camera.scale},"data-phase":d,"data-revealing":p?`true`:void 0,"data-has-actions":g&&t.length>0?`true`:void 0,role:`region`,"aria-label":`Mindshape — the shape of your thought`,children:[(0,C.jsxs)(`div`,{className:`ms-world`,style:{transform:R.transform,"--ms-cam-scale":R.camera.scale},children:[L.map(e=>(0,C.jsx)(`div`,{className:`ms-cluster-label`,style:{left:`${e.x}px`,top:`${e.y}px`},"aria-hidden":`true`,children:e.label},e.id)),(0,C.jsxs)(`svg`,{className:`ms-svg`,viewBox:`0 0 ${c} 700`,"aria-hidden":`true`,children:[t.filter(e=>e.status===`stable`).map((e,t)=>{let n=I.get(e.id),r=ae.get(e.id);return!n||!r?null:(0,C.jsx)(`path`,{className:`ms-spoke`,d:`M ${r.x} ${r.y} L ${n.x} ${n.y}`,pathLength:1,style:{"--ms-spoke-i":t}},`spoke-${e.id}`)}),V.map((e,t)=>{let n=I.get(e.from),r=I.get(e.to);if(!n||!r)return null;let i=e.kind===`tensions`,a=w[H.get(e.from)?.kind??`fear`],{d:o,lx:s,ly:c}=k(n.x,n.y,r.x,r.y),l=i&&U&&e.from===U.a.id&&e.to===U.b.id;return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`path`,{className:i?`ms-thread`:`ms-link`,"data-kind":e.kind,"data-hero":l?`true`:void 0,d:o,pathLength:i?1:void 0,stroke:i?a:void 0,style:{animationDelay:`${.3+t*.12}s`}}),i&&e.label&&(0,C.jsx)(`text`,{className:`ms-thread-label`,x:s,y:c,textAnchor:`middle`,dominantBaseline:`middle`,children:e.label})]},`link-${e.from}-${e.to}-${e.kind}`)})]}),N&&e&&(0,C.jsx)(`div`,{className:`ms-hub`,style:{left:`500px`,top:`329px`},"aria-live":`polite`,children:(0,C.jsx)(`span`,{className:`ms-hub-text`,children:e})}),t.map((e,t)=>{let n=I.get(e.id);return n?(0,C.jsx)(ee,{atom:e,x:n.x,y:n.y,order:t,onRemove:_},e.id):null}),l&&(0,C.jsx)(te,{unsaid:l,onConfirm:v,onDismiss:y})]}),(0,C.jsxs)(`div`,{className:`ms-center`,children:[h&&d!==`settled`&&(0,C.jsx)(ne,{signal:h}),!N&&(0,C.jsx)(`div`,{className:`ms-center-pip-wrap`,ref:M,children:(0,C.jsx)(a,{state:X,emotion:`neutral`,gaze:`center`})}),(0,C.jsx)(`div`,{className:`ms-center-label`,"aria-hidden":`true`,children:ue}),e&&!N&&(0,C.jsx)(`div`,{className:`ms-center-question`,"aria-live":`polite`,children:e}),d===`settled`&&(t.length>0?(0,C.jsx)(`div`,{className:`ms-synthesis-line`,"aria-live":`polite`,children:re({atoms:t,links:n},U)}):m?(0,C.jsx)(`div`,{className:`ms-synthesis-line`,"aria-live":`polite`,children:`I couldn't reach the model just now — nothing you said was lost. Try again in a moment.`}):(0,C.jsx)(`div`,{className:`ms-synthesis-line`,"aria-live":`polite`,children:`Didn't catch enough to map yet — keep talking and I'll shape it.`})),x!==void 0&&x>=0&&d!==`settled`&&(0,C.jsxs)(`div`,{className:`ms-thought-count`,"aria-live":`polite`,children:[(0,C.jsx)(`span`,{className:`ms-mic-dot`,"aria-hidden":`true`}),(()=>{let e=Math.max(x,t.length);return e===0?`Listening…`:`${e} thought${e===1?``:`s`}`})()]}),b&&(0,C.jsx)(`div`,{className:`ms-live-text`,"aria-live":`polite`,"aria-label":`Currently hearing`,children:b})]}),d===`settled`&&U&&G===`tension`&&(0,C.jsxs)(`div`,{className:`ms-tension-callout`,role:`dialog`,"aria-label":`The tension`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-close`,"aria-label":`Dismiss`,onClick:()=>K(null),children:`×`}),(0,C.jsx)(`span`,{className:`ms-tension-eyebrow`,children:`THE TENSION`}),(0,C.jsxs)(`p`,{className:`ms-tension-body`,children:[`You keep coming back to `,(0,C.jsxs)(`strong`,{children:[`“`,U.a.label,`.”`]}),` But you also said`,` `,(0,C.jsxs)(`strong`,{children:[`“`,U.b.label,`.”`]}),` Those may not be the same reason.`]}),g&&(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-cta`,onClick:()=>g(`tell-apart`,{tension:{a:U.a.label,b:U.b.label}}),children:`Help me tell them apart →`})]}),G===`plan`&&(0,C.jsxs)(`div`,{className:`ms-plan`,role:`dialog`,"aria-label":`Turn into a plan`,children:[(0,C.jsxs)(`header`,{className:`ms-plan-head`,children:[(0,C.jsx)(`span`,{className:`ms-plan-title`,children:`The open loops, as steps you control`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-close`,"aria-label":`Close the plan`,onClick:()=>K(null),children:`×`})]}),W.length>0?(0,C.jsx)(`ol`,{className:`ms-plan-steps`,children:W.map(e=>{let t=se.has(e.id);return(0,C.jsxs)(`li`,{className:`ms-plan-step`,"data-done":t?`true`:void 0,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-plan-check`,role:`checkbox`,"aria-checked":t,"aria-label":`Mark “${e.label}” done`,onClick:()=>le(e.id),children:t&&(0,C.jsx)(`span`,{className:`ms-plan-check-mark`,"aria-hidden":`true`,children:`✓`})}),(0,C.jsxs)(`span`,{className:`ms-plan-step-body`,children:[(0,C.jsx)(`span`,{className:`ms-plan-step-label`,children:e.label}),(0,C.jsxs)(`span`,{className:`ms-plan-step-trace`,children:[`from “`,e.quote,`”`]})]})]},e.id)})}):(0,C.jsx)(`p`,{className:`ms-plan-empty`,children:`No open loops to turn into steps yet — keep talking and they’ll surface.`}),(0,C.jsxs)(`footer`,{className:`ms-plan-foot`,children:[(0,C.jsx)(`span`,{className:`ms-plan-note`,children:`Every step traces back to something you said — nothing invented.`}),g&&W.length>0&&(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn ms-action-primary`,onClick:()=>g(`commit-plan`),children:`Make it real →`})]})]}),d===`settled`&&G===`kept`&&(0,C.jsxs)(`div`,{className:`ms-kept`,role:`dialog`,"aria-label":`Kept this shape`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-tension-close`,"aria-label":`Close`,onClick:()=>K(null),children:`×`}),(0,C.jsx)(`span`,{className:`ms-kept-eyebrow`,children:`KEPT THIS SHAPE`}),(0,C.jsx)(`p`,{className:`ms-kept-body`,children:`This is the shape of what you were thinking. It’s yours to revisit.`}),g&&(0,C.jsxs)(`div`,{className:`ms-kept-actions`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-kept-btn`,onClick:()=>g(`answer`),children:`↻ Replay`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-kept-btn`,onClick:()=>g(`share`),children:`↗ Share`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-kept-btn`,onClick:()=>g(`present`),children:`▶ Present mode`})]}),(0,C.jsx)(`span`,{className:`ms-kept-memory`,children:`Nothing was saved to memory — Mavéa asks first before keeping anything personal.`})]}),g&&t.length>0&&(0,C.jsxs)(`div`,{className:`ms-actions`,role:`group`,"aria-label":`What to do with this map`,children:[(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn ms-action-primary`,onClick:()=>g(`answer`),children:de}),(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`+(G===`plan`?` is-active`:``),"aria-pressed":G===`plan`,onClick:()=>K(e=>e===`plan`?null:`plan`),children:`Turn into a plan`}),d===`settled`&&(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`+(G===`kept`?` is-active`:``),"aria-pressed":G===`kept`,onClick:()=>K(e=>e===`kept`?null:`kept`),children:`That’s it`}),d===`settled`&&(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`,onClick:()=>g(`add-more`),children:`Add more`}),(0,C.jsx)(`button`,{type:`button`,className:`ms-action-btn`,onClick:()=>g(`not-quite`),children:`Not quite`})]})]});return A?(0,C.jsxs)(`div`,{className:`card reveal`,style:{"--delay":`${T}ms`},children:[u&&(0,C.jsx)(`div`,{className:`card-eyebrow`,children:u}),$]}):$}export{A as t};
@@ -1 +1 @@
1
- import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r}from"./icons-gLFQTv74.js";import{n as i}from"./blockLabel-FogyzEQY.js";import{t as a}from"./useFocusTrap-CJmpNZv2.js";import{F as o,Y as s,m as c}from"./store-D16dGt7I.js";import{n as l,u}from"./useLiveConfig-CvOQTr0s.js";import{r as d}from"./format-BkvssSOr.js";import{t as f}from"./pin-IyE46GaQ.js";var ee=t(),p=e(),m=n(),h=[{v:`15min`,label:`15M`},{v:`hourly`,label:`1H`},{v:`6h`,label:`6H`},{v:`daily`,label:`DAILY`},{v:`manual`,label:`MANUAL`}],g={"15min":{text:`15 MIN`,tone:`fast`},hourly:{text:`HOURLY`,tone:`steady`},"6h":{text:`6 HOURS`,tone:`steady`},daily:{text:`DAILY`,tone:`calm`},manual:{text:`MANUAL`,tone:`calm`}};function _(e){let t=(0,ee.c)(45),{block:n,conversationTitle:_,question:y,onClose:b,onAdded:x}=e,[S,C]=(0,p.useState)(v),w;t[0]===n?w=t[1]:(w=i(n),t[0]=n,t[1]=w);let T=w,[E,D]=(0,p.useState)(S.length===0),O;t[2]!==_||t[3]!==T||t[4]!==y?(O=()=>d(y?.trim()||_||T),t[2]=_,t[3]=T,t[4]=y,t[5]=O):O=t[5];let[k,te]=(0,p.useState)(O),[A,j]=(0,p.useState)(`manual`),M=(0,p.useRef)(!1),N,P;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{let e=!0;return o().then(()=>{e&&C(e=>{if(e.length>0)return e;let t=c();return t.length>0&&!M.current&&D(!1),t})}),()=>{e=!1}},P=[],t[6]=N,t[7]=P):(N=t[6],P=t[7]),(0,p.useEffect)(N,P);let F=(0,p.useRef)(null),I;t[8]===b?I=t[9]:(I={onEscape:b},t[8]=b,t[9]=I),a(F,I);let L=(0,p.useRef)(null),R,z;t[10]===E?(R=t[11],z=t[12]):(R=()=>{E?L.current?.focus():F.current?.querySelector(`.pin-row`)?.focus()},z=[E],t[10]=E,t[11]=R,t[12]=z),(0,p.useEffect)(R,z);let B;t[13]!==n||t[14]!==x||t[15]!==b||t[16]!==y?(B=e=>{let t=f({block:n,question:y,target:e});t&&x?.(t.dashboardId,t.title),b()},t[13]=n,t[14]=x,t[15]=b,t[16]=y,t[17]=B):B=t[17];let V=B,H=s(A),U;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(U=u(l()),t[18]=U):U=t[18];let W=!!U.apiKey,G;t[19]===b?G=t[20]:(G=e=>{e.target===e.currentTarget&&b()},t[19]=b,t[20]=G);let K;t[21]===b?K=t[22]:(K=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),b())},t[21]=b,t[22]=K);let q=E?`New dashboard`:`Add to dashboard`,J;t[23]===q?J=t[24]:(J=(0,m.jsx)(`span`,{className:`pin-eyebrow`,children:q}),t[23]=q,t[24]=J);let Y;t[25]===T?Y=t[26]:(Y=(0,m.jsx)(`span`,{className:`pin-subject`,children:T}),t[25]=T,t[26]=Y);let X;t[27]!==J||t[28]!==Y?(X=(0,m.jsxs)(`div`,{className:`pin-head`,children:[J,Y]}),t[27]=J,t[28]=Y,t[29]=X):X=t[29];let Z;t[30]!==A||t[31]!==S||t[32]!==T||t[33]!==k||t[34]!==E||t[35]!==V||t[36]!==H?(Z=E?(0,m.jsxs)(`form`,{className:`pin-new-step`,onSubmit:e=>{e.preventDefault(),V({new:{title:k.trim()||T,cadence:A}})},children:[(0,m.jsxs)(`label`,{className:`pin-name-field`,children:[(0,m.jsx)(`span`,{className:`pin-plan-label`,children:`Name`}),(0,m.jsx)(`input`,{ref:L,className:`pin-name-input`,value:k,onChange:e=>{M.current=!0,te(e.target.value)},"aria-label":`Dashboard name`})]}),(0,m.jsxs)(`div`,{className:`pin-plan-cadence`,children:[(0,m.jsx)(`span`,{className:`pin-plan-label`,children:`Check cadence`}),(0,m.jsx)(`div`,{className:`pin-cadence-seg`,role:`group`,"aria-label":`Check cadence`,children:h.map(e=>(0,m.jsx)(`button`,{type:`button`,className:`pin-cadence-opt`+(e.v===A?` is-active`:``),"aria-pressed":e.v===A,onClick:()=>j(e.v),children:e.label},e.v))}),(0,m.jsx)(`p`,{className:`pin-plan-estimate`,children:H>0?W?`≈ ${H} searches/mo on your key, at this cadence.`:`≈ ${H} searches/mo once a key is connected in Live — parked until then.`:`No standing searches — this refreshes only when you ask.`})]}),(0,m.jsxs)(`div`,{className:`pin-plan-actions`,children:[S.length>0?(0,m.jsx)(`button`,{type:`button`,className:`pin-secondary`,onClick:()=>D(!1),children:`← Back`}):(0,m.jsx)(`span`,{}),(0,m.jsx)(`button`,{type:`submit`,className:`pin-plan-confirm`,children:`Create · first check queued`})]})]}):(0,m.jsxs)(`div`,{className:`pin-list`,role:`menu`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`pin-row pin-new`,role:`menuitem`,onClick:()=>D(!0),children:[(0,m.jsx)(`span`,{className:`pin-row-ic`,children:(0,m.jsx)(r.plus,{})}),(0,m.jsxs)(`span`,{className:`pin-row-text`,children:[(0,m.jsx)(`span`,{className:`pin-row-title`,children:`New dashboard`}),(0,m.jsx)(`span`,{className:`pin-row-sub`,children:`Start one with this card`})]})]}),S.map(e=>{let t=g[e.cadence.data];return(0,m.jsxs)(`button`,{type:`button`,className:`pin-row`,role:`menuitem`,onClick:()=>V(e.id),children:[(0,m.jsx)(`span`,{className:`pin-row-ic`,children:(0,m.jsx)(r.table,{})}),(0,m.jsxs)(`span`,{className:`pin-row-text`,children:[(0,m.jsx)(`span`,{className:`pin-row-title`,children:d(e.title)}),(0,m.jsxs)(`span`,{className:`pin-row-sub`,children:[e.widgets.length,` `,e.widgets.length===1?`card`:`cards`]})]}),(0,m.jsx)(`span`,{className:`pin-row-cad pin-row-cad--${t.tone}`,children:t.text})]},e.id)})]}),t[30]=A,t[31]=S,t[32]=T,t[33]=k,t[34]=E,t[35]=V,t[36]=H,t[37]=Z):Z=t[37];let Q;t[38]!==X||t[39]!==Z?(Q=(0,m.jsxs)(`div`,{className:`pin-sheet`,ref:F,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":`Add to a dashboard`,children:[X,Z]}),t[38]=X,t[39]=Z,t[40]=Q):Q=t[40];let $;return t[41]!==G||t[42]!==K||t[43]!==Q?($=(0,m.jsx)(`div`,{className:`pin-scrim`,onClick:G,role:`button`,tabIndex:0,"aria-label":`Close`,onKeyDown:K,children:Q}),t[41]=G,t[42]=K,t[43]=Q,t[44]=$):$=t[44],$}function v(){return c()}export{_ as PinToDashboard};
1
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r}from"./icons-gLFQTv74.js";import{n as i}from"./blockLabel-FogyzEQY.js";import{t as a}from"./useFocusTrap-CJmpNZv2.js";import{F as o,Y as s,m as c}from"./store-D16dGt7I.js";import{n as l,u}from"./useLiveConfig-CvOQTr0s.js";import{r as d}from"./format-BkvssSOr.js";import{t as f}from"./pin-Bic4-gim.js";var ee=t(),p=e(),m=n(),h=[{v:`15min`,label:`15M`},{v:`hourly`,label:`1H`},{v:`6h`,label:`6H`},{v:`daily`,label:`DAILY`},{v:`manual`,label:`MANUAL`}],g={"15min":{text:`15 MIN`,tone:`fast`},hourly:{text:`HOURLY`,tone:`steady`},"6h":{text:`6 HOURS`,tone:`steady`},daily:{text:`DAILY`,tone:`calm`},manual:{text:`MANUAL`,tone:`calm`}};function _(e){let t=(0,ee.c)(45),{block:n,conversationTitle:_,question:y,onClose:b,onAdded:x}=e,[S,C]=(0,p.useState)(v),w;t[0]===n?w=t[1]:(w=i(n),t[0]=n,t[1]=w);let T=w,[E,D]=(0,p.useState)(S.length===0),O;t[2]!==_||t[3]!==T||t[4]!==y?(O=()=>d(y?.trim()||_||T),t[2]=_,t[3]=T,t[4]=y,t[5]=O):O=t[5];let[k,te]=(0,p.useState)(O),[A,j]=(0,p.useState)(`manual`),M=(0,p.useRef)(!1),N,P;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{let e=!0;return o().then(()=>{e&&C(e=>{if(e.length>0)return e;let t=c();return t.length>0&&!M.current&&D(!1),t})}),()=>{e=!1}},P=[],t[6]=N,t[7]=P):(N=t[6],P=t[7]),(0,p.useEffect)(N,P);let F=(0,p.useRef)(null),I;t[8]===b?I=t[9]:(I={onEscape:b},t[8]=b,t[9]=I),a(F,I);let L=(0,p.useRef)(null),R,z;t[10]===E?(R=t[11],z=t[12]):(R=()=>{E?L.current?.focus():F.current?.querySelector(`.pin-row`)?.focus()},z=[E],t[10]=E,t[11]=R,t[12]=z),(0,p.useEffect)(R,z);let B;t[13]!==n||t[14]!==x||t[15]!==b||t[16]!==y?(B=e=>{let t=f({block:n,question:y,target:e});t&&x?.(t.dashboardId,t.title),b()},t[13]=n,t[14]=x,t[15]=b,t[16]=y,t[17]=B):B=t[17];let V=B,H=s(A),U;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(U=u(l()),t[18]=U):U=t[18];let W=!!U.apiKey,G;t[19]===b?G=t[20]:(G=e=>{e.target===e.currentTarget&&b()},t[19]=b,t[20]=G);let K;t[21]===b?K=t[22]:(K=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),b())},t[21]=b,t[22]=K);let q=E?`New dashboard`:`Add to dashboard`,J;t[23]===q?J=t[24]:(J=(0,m.jsx)(`span`,{className:`pin-eyebrow`,children:q}),t[23]=q,t[24]=J);let Y;t[25]===T?Y=t[26]:(Y=(0,m.jsx)(`span`,{className:`pin-subject`,children:T}),t[25]=T,t[26]=Y);let X;t[27]!==J||t[28]!==Y?(X=(0,m.jsxs)(`div`,{className:`pin-head`,children:[J,Y]}),t[27]=J,t[28]=Y,t[29]=X):X=t[29];let Z;t[30]!==A||t[31]!==S||t[32]!==T||t[33]!==k||t[34]!==E||t[35]!==V||t[36]!==H?(Z=E?(0,m.jsxs)(`form`,{className:`pin-new-step`,onSubmit:e=>{e.preventDefault(),V({new:{title:k.trim()||T,cadence:A}})},children:[(0,m.jsxs)(`label`,{className:`pin-name-field`,children:[(0,m.jsx)(`span`,{className:`pin-plan-label`,children:`Name`}),(0,m.jsx)(`input`,{ref:L,className:`pin-name-input`,value:k,onChange:e=>{M.current=!0,te(e.target.value)},"aria-label":`Dashboard name`})]}),(0,m.jsxs)(`div`,{className:`pin-plan-cadence`,children:[(0,m.jsx)(`span`,{className:`pin-plan-label`,children:`Check cadence`}),(0,m.jsx)(`div`,{className:`pin-cadence-seg`,role:`group`,"aria-label":`Check cadence`,children:h.map(e=>(0,m.jsx)(`button`,{type:`button`,className:`pin-cadence-opt`+(e.v===A?` is-active`:``),"aria-pressed":e.v===A,onClick:()=>j(e.v),children:e.label},e.v))}),(0,m.jsx)(`p`,{className:`pin-plan-estimate`,children:H>0?W?`≈ ${H} searches/mo on your key, at this cadence.`:`≈ ${H} searches/mo once a key is connected in Live — parked until then.`:`No standing searches — this refreshes only when you ask.`})]}),(0,m.jsxs)(`div`,{className:`pin-plan-actions`,children:[S.length>0?(0,m.jsx)(`button`,{type:`button`,className:`pin-secondary`,onClick:()=>D(!1),children:`← Back`}):(0,m.jsx)(`span`,{}),(0,m.jsx)(`button`,{type:`submit`,className:`pin-plan-confirm`,children:`Create · first check queued`})]})]}):(0,m.jsxs)(`div`,{className:`pin-list`,role:`menu`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`pin-row pin-new`,role:`menuitem`,onClick:()=>D(!0),children:[(0,m.jsx)(`span`,{className:`pin-row-ic`,children:(0,m.jsx)(r.plus,{})}),(0,m.jsxs)(`span`,{className:`pin-row-text`,children:[(0,m.jsx)(`span`,{className:`pin-row-title`,children:`New dashboard`}),(0,m.jsx)(`span`,{className:`pin-row-sub`,children:`Start one with this card`})]})]}),S.map(e=>{let t=g[e.cadence.data];return(0,m.jsxs)(`button`,{type:`button`,className:`pin-row`,role:`menuitem`,onClick:()=>V(e.id),children:[(0,m.jsx)(`span`,{className:`pin-row-ic`,children:(0,m.jsx)(r.table,{})}),(0,m.jsxs)(`span`,{className:`pin-row-text`,children:[(0,m.jsx)(`span`,{className:`pin-row-title`,children:d(e.title)}),(0,m.jsxs)(`span`,{className:`pin-row-sub`,children:[e.widgets.length,` `,e.widgets.length===1?`card`:`cards`]})]}),(0,m.jsx)(`span`,{className:`pin-row-cad pin-row-cad--${t.tone}`,children:t.text})]},e.id)})]}),t[30]=A,t[31]=S,t[32]=T,t[33]=k,t[34]=E,t[35]=V,t[36]=H,t[37]=Z):Z=t[37];let Q;t[38]!==X||t[39]!==Z?(Q=(0,m.jsxs)(`div`,{className:`pin-sheet`,ref:F,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":`Add to a dashboard`,children:[X,Z]}),t[38]=X,t[39]=Z,t[40]=Q):Q=t[40];let $;return t[41]!==G||t[42]!==K||t[43]!==Q?($=(0,m.jsx)(`div`,{className:`pin-scrim`,onClick:G,role:`button`,tabIndex:0,"aria-label":`Close`,onKeyDown:K,children:Q}),t[41]=G,t[42]=K,t[43]=Q,t[44]=$):$=t[44],$}function v(){return c()}export{_ as PinToDashboard};
@@ -1 +1 @@
1
- import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{S as r,X as i,Y as a,a as o,d as s,f as c}from"./store-D16dGt7I.js";import{l}from"./useDashboardLoop-SPlr1Mrm.js";import{i as u,n as d,r as f}from"./confirmAdd-CUFiPNWz.js";/* empty css *//* empty css */import{t as ee}from"./relate-ZHm-ZvaR.js";var p=e(),m=t();function h(e){return e*4}function g(e,t,n,r={}){let i=`template:${e.id}`,a=new Map,o=[];e.metrics.forEach((e,i)=>{if(r.metrics?.[i]===!1)return;let s=`m-${n}-${i}`,c=e.label(t);a.set(i,s),o.push({id:s,label:c,query:e.query(t),...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},lastValue:null,origin:`empty`})});let s=[];e.tripwires.forEach((e,i)=>{if(!(r.tripwires?.[i]??e.enabledByDefault))return;let o=a.get(e.metricIndex);if(!o)return;let c=e.label(t);s.push({id:`t-${n}-${i}`,label:c,metricId:o,comparator:e.comparator,threshold:e.threshold,...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},state:`AWAITING`})});let c=[],l=[];return e.widgets.forEach((e,s)=>{if(r.widgets?.[s]===!1)return;if(e.metricIndex!==void 0){let t=a.get(e.metricIndex);if(!t)return;let r=o.find(e=>e.id===t);c.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:h(e.span),id:`wblk-${n}-${s}`,num:String(c.length+1),props:{title:r.label,stat:`—`,conf:`inferred`,summary:r.sourceQuote.text}},span:e.span,metricId:t,fromSource:i});return}let u=e.refreshQuery?.(t),d=e.seedProps?.(t)??{};l.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:h(e.span),id:`wblk-${n}-${s}`,props:u?{title:u,...d}:d},span:e.span,fromSource:i,...u?{refreshQuery:u}:{}})}),{metrics:o,tripwires:s,widgets:[...c,...l]}}function te(e,t,n={}){let a=n.now??Date.now(),o=`template:${e.id}`,s=e.title(t),{metrics:c,tripwires:l,widgets:u}=g(e,t,a,n.toggles),d=l.length>0,f={id:`w-thesis`,block:{type:`thesis`,col:8,id:`w-thesis`,props:{reasoning:e.thesis(t)}},span:2,fromSource:o},ee={id:`w-align`,block:{type:`alignmentgauge`,col:4,id:`w-align`,props:{pct:null}},span:1,fromSource:o},p={id:`w-alerts`,block:{type:`standingalerts`,col:4,id:`w-alerts`,props:{alerts:[]}},span:1,fromSource:o},m={id:`w-sources`,block:{type:`sourceslineage`,col:8,id:`w-sources`,props:{rows:[]}},span:2,fromSource:o},h=n.cadence??e.cadence,te=c.some(e=>e.query.trim()!==``&&!e.blankKey)||u.some(e=>e.refreshQuery?.trim());return{id:r(),title:s,question:s,thesis:{text:e.thesis(t),saidAt:a},tripwires:l,metrics:c,sources:[{kind:`ORIGIN`,conversationId:o,title:e.label,contributed:`Started from the '${e.label}' template.`,at:a}],widgets:[...d?[f,ee]:[],...u,...d?[p]:[],m],cadence:h,smartTrigger:d,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:a,updatedAt:a,nextDataAt:i(h,a),nextAiAt:2**53-1,lastRefreshedAt:null,...te?{oneShotAt:a,oneShotLabel:`first check`}:{}}}function ne(e,t,n,r=Date.now()){let i=new Set(e.metrics.map(e=>l(e.label))),a=new Set(e.tripwires.map(e=>l(e.label))),o=g(t,n,r),s=o.metrics.filter(e=>!i.has(l(e.label))),u=new Set(s.map(e=>e.id)),d=o.tripwires.filter(e=>u.has(e.metricId)&&!a.has(l(e.label))),f=o.widgets.filter(e=>!e.metricId||u.has(e.metricId)),ee=s.length+d.length,p=[];s.length&&p.push(`${s.length} metric${s.length>1?`s`:``}`),d.length&&p.push(`${d.length} alert${d.length>1?`s`:``}`);let m={kind:`ADDED`,conversationId:`template:${t.id}`,title:t.label,contributed:p.length?`Added: ${p.join(` + `)}`:`Linked the '${t.label}' template.`,at:r};return c(e.id,{metrics:s,tripwires:d,widgets:f,source:m}),ee}var _={chart:{labels:[],series:[]},scoreboard:{games:[]},standings:{rows:[]},forecast:{days:[]},list:{items:[]},timeline:{events:[]}};function re(e){return{id:`plan`,label:`Track anything`,blurb:``,input:{key:`ask`,label:`Track`,placeholder:``},title:()=>e.title,thesis:()=>`Tracking ${e.title}.`,metrics:e.metrics.map(e=>({label:()=>e.label,query:()=>e.query,...e.unit?{unit:e.unit}:{}})),tripwires:[],widgets:[...e.metrics.map((e,t)=>({blockType:`insight`,span:1,metricIndex:t})),...e.widgets.map(e=>({blockType:e.blockType,span:e.span,refreshQuery:()=>e.query,seedProps:()=>({..._[e.blockType]??{}})}))],cadence:{data:e.cadence,ai:`manual`}}}var v=n(),ie={"15min":`checks every 15 minutes while open`,hourly:`checks hourly while open`,"6h":`checks every 6 hours while open`,daily:`checks daily while open`,manual:`refreshes only when you ask`};function ae(e,t){let n=[...e];return n[t]=!n[t],n}function oe(e){let t=(0,m.c)(102),{plan:n,ask:r,existing:i,onDone:c}=e,[l,h]=(0,p.useState)(n.title),g;t[0]===n.metrics?g=t[1]:(g=()=>n.metrics.map(le),t[0]=n.metrics,t[1]=g);let[_,oe]=(0,p.useState)(g),y;t[2]===n.widgets?y=t[3]:(y=()=>n.widgets.map(ce),t[2]=n.widgets,t[3]=y);let[b,de]=(0,p.useState)(y),[x,fe]=(0,p.useState)(null),[S,pe]=(0,p.useState)(`manual`),C;t[4]===_?C=t[5]:(C=_.filter(Boolean),t[4]=_,t[5]=C);let me=C.length,w;t[6]===b?w=t[7]:(w=b.filter(Boolean),t[6]=b,t[7]=w);let T=me+w.length,he=a(S),[E,ge]=(0,p.useState)(!1),[D,_e]=(0,p.useState)(null),ve=(0,p.useRef)(!0),O,k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>(ve.current=!0,()=>{ve.current=!1}),k=[],t[8]=O,t[9]=k):(O=t[8],k=t[9]),(0,p.useEffect)(O,k);let A;t[10]!==r||t[11]!==S||t[12]!==E||t[13]!==T||t[14]!==_||t[15]!==l||t[16]!==c||t[17]!==n||t[18]!==b?(A=async()=>{if(T===0||E)return;let e=re(n),t=[...n.metrics.map(se),...b],i=te(e,r.trim(),{toggles:{metrics:_,widgets:t},cadence:{data:S,ai:`manual`}});i.title=l.trim()||i.title,i.question=r.trim(),o(i),c(i.id),u(i.id,null)},t[10]=r,t[11]=S,t[12]=E,t[13]=T,t[14]=_,t[15]=l,t[16]=c,t[17]=n,t[18]=b,t[19]=A):A=t[19];let j=A,M;t[20]!==r||t[21]!==E||t[22]!==c||t[23]!==n?(M=async e=>{if(E)return;let t=d(e);ne(e,re(n),r.trim()),s(e.id),ge(!0),_e(null);let i=await u(e.id,t);if(ve.current){if(ge(!1),i!==`confirmed`){_e(f(i,!1));return}c(e.id)}},t[20]=r,t[21]=E,t[22]=c,t[23]=n,t[24]=M):M=t[24];let ye=M,N;t[25]!==r||t[26]!==j||t[27]!==i||t[28]!==n.title?(N=()=>{let e=ee(i,{text:`${n.title} ${r}`});if(e){fe(e);return}j()},t[25]=r,t[26]=j,t[27]=i,t[28]=n.title,t[29]=N):N=t[29];let P=N;if(x){let e;t[30]===x.title?e=t[31]:(e=(0,v.jsxs)(`p`,{className:`tpl-interstitial-text`,children:[`This looks related to your existing “`,x.title,`” dashboard — fold this in instead of creating a new one?`]}),t[30]=x.title,t[31]=e);let n;t[32]!==ye||t[33]!==x?(n=()=>void ye(x),t[32]=ye,t[33]=x,t[34]=n):n=t[34];let r=E?`Confirming live data…`:`Fold into “${x.title}”`,i;t[35]!==E||t[36]!==n||t[37]!==r?(i=(0,v.jsx)(`button`,{type:`button`,className:`tpl-fold-btn`,disabled:E,onClick:n,children:r}),t[35]=E,t[36]=n,t[37]=r,t[38]=i):i=t[38];let a;t[39]===j?a=t[40]:(a=()=>void j(),t[39]=j,t[40]=a);let o;t[41]!==E||t[42]!==a?(o=(0,v.jsx)(`button`,{type:`button`,className:`tpl-create-anyway`,disabled:E,onClick:a,children:`Create new anyway`}),t[41]=E,t[42]=a,t[43]=o):o=t[43];let s;t[44]!==i||t[45]!==o?(s=(0,v.jsxs)(`div`,{className:`tpl-interstitial-actions`,children:[i,o]}),t[44]=i,t[45]=o,t[46]=s):s=t[46];let c;t[47]===E?c=t[48]:(c=E&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:`Checking a live source before this joins your board — a search can take up to a minute. You can close this; the result lands in your check log either way.`}),t[47]=E,t[48]=c);let l;t[49]===D?l=t[50]:(l=D&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:D}),t[49]=D,t[50]=l);let u;return t[51]!==e||t[52]!==s||t[53]!==c||t[54]!==l?(u=(0,v.jsxs)(`div`,{className:`tpl-interstitial`,children:[e,s,c,l]}),t[51]=e,t[52]=s,t[53]=c,t[54]=l,t[55]=u):u=t[55],u}let F;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Dashboard name`}),t[56]=F):F=t[56];let I;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>h(e.target.value),t[57]=I):I=t[57];let L;t[58]===l?L=t[59]:(L=(0,v.jsxs)(`label`,{className:`tpl-field`,children:[F,(0,v.jsx)(`input`,{className:`xt-name`,value:l,onChange:I,"aria-label":`Dashboard name`})]}),t[58]=l,t[59]=L);let R;t[60]!==_||t[61]!==n.metrics?(R=n.metrics.length>0&&(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Numbers to watch`}),(0,v.jsx)(`div`,{className:`tpl-chips`,children:n.metrics.map((e,t)=>(0,v.jsx)(ue,{kind:`METRIC`,label:e.label,detail:e.query,on:_[t]??!0,onToggle:()=>oe(e=>ae(e,t))},`m${t}`))})]}),t[60]=_,t[61]=n.metrics,t[62]=R):R=t[62];let z;t[63]!==n.widgets||t[64]!==b?(z=n.widgets.length>0&&(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Live cards`}),(0,v.jsx)(`div`,{className:`tpl-chips`,children:n.widgets.map((e,t)=>(0,v.jsx)(ue,{kind:`CARD`,label:e.query,detail:e.blockType,on:b[t]??!0,onToggle:()=>de(e=>ae(e,t))},`w${t}`))})]}),t[63]=n.widgets,t[64]=b,t[65]=z):z=t[65];let B;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,v.jsx)(`span`,{className:`xt-section-label`,children:`How often`}),t[66]=B):B=t[66];let be=`tpl-chip xt-comp--goal${S===`manual`?``:` tpl-chip-off`}`,xe=S===`manual`,V,H;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>pe(`manual`),H=(0,v.jsx)(`span`,{className:`tpl-chip-label`,children:`Manual — only when you ask`}),t[67]=V,t[68]=H):(V=t[67],H=t[68]);let U;t[69]!==be||t[70]!==xe?(U=(0,v.jsx)(`button`,{type:`button`,className:be,"aria-pressed":xe,onClick:V,children:H}),t[69]=be,t[70]=xe,t[71]=U):U=t[71];let W;t[72]!==S||t[73]!==n.cadence?(W=n.cadence!==`manual`&&(0,v.jsx)(`button`,{type:`button`,className:`tpl-chip xt-comp--metric${S===n.cadence?``:` tpl-chip-off`}`,"aria-pressed":S===n.cadence,onClick:()=>pe(n.cadence),title:ie[n.cadence],children:(0,v.jsxs)(`span`,{className:`tpl-chip-label`,children:[`Suggested — `,ie[n.cadence]]})}),t[72]=S,t[73]=n.cadence,t[74]=W):W=t[74];let G;t[75]!==U||t[76]!==W?(G=(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[B,(0,v.jsxs)(`div`,{className:`tpl-chips`,children:[U,W]})]}),t[75]=U,t[76]=W,t[77]=G):G=t[77];let Se=he>0?`≈ ${he} searches/mo on your key, at this cadence.`:`No standing searches — this refreshes only when you ask.`,K;t[78]===Se?K=t[79]:(K=(0,v.jsx)(`p`,{className:`dash-plan-estimate`,children:Se}),t[78]=Se,t[79]=K);let Ce=ie[S],q;t[80]===Ce?q=t[81]:(q=(0,v.jsx)(`span`,{className:`tpl-cadence-note`,children:Ce}),t[80]=Ce,t[81]=q);let J=T===0||E,we=E?`Confirming live data…`:`Create dashboard →`,Y;t[82]!==P||t[83]!==J||t[84]!==we?(Y=(0,v.jsx)(`button`,{type:`button`,className:`tpl-create`,onClick:P,disabled:J,children:we}),t[82]=P,t[83]=J,t[84]=we,t[85]=Y):Y=t[85];let X;t[86]!==q||t[87]!==Y?(X=(0,v.jsxs)(`div`,{className:`xt-build-row`,children:[q,Y]}),t[86]=q,t[87]=Y,t[88]=X):X=t[88];let Z;t[89]===E?Z=t[90]:(Z=E&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:`Checking a live source before this joins your board — a search can take up to a minute. You can close this; the result lands in your check log either way.`}),t[89]=E,t[90]=Z);let Q;t[91]===D?Q=t[92]:(Q=D&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:D}),t[91]=D,t[92]=Q);let $;return t[93]!==L||t[94]!==R||t[95]!==z||t[96]!==G||t[97]!==K||t[98]!==X||t[99]!==Z||t[100]!==Q?($=(0,v.jsxs)(`div`,{className:`tpl-form`,children:[L,R,z,G,K,X,Z,Q]}),t[93]=L,t[94]=R,t[95]=z,t[96]=G,t[97]=K,t[98]=X,t[99]=Z,t[100]=Q,t[101]=$):$=t[101],$}function se(){return!0}function ce(){return!0}function le(){return!0}function ue(e){let t=(0,m.c)(14),{kind:n,label:r,detail:i,on:a,onToggle:o}=e,s=`tpl-chip xt-comp--${n===`METRIC`?`metric`:`goal`}${a?``:` tpl-chip-off`}`,c;t[0]===n?c=t[1]:(c=(0,v.jsx)(`span`,{className:`tpl-chip-kind`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,v.jsx)(`span`,{className:`tpl-chip-label`,children:r}),t[2]=r,t[3]=l);let u=a?`Included ✓`:`Removed ✕`,d;t[4]===u?d=t[5]:(d=(0,v.jsx)(`span`,{className:`tpl-chip-state`,children:u}),t[4]=u,t[5]=d);let f;return t[6]!==i||t[7]!==a||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==d?(f=(0,v.jsxs)(`button`,{type:`button`,className:s,onClick:o,"aria-pressed":a,title:i,children:[c,l,d]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d,t[13]=f):f=t[13],f}export{oe as PlanReview};
1
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{S as r,X as i,Y as a,a as o,d as s,f as c}from"./store-D16dGt7I.js";import{l}from"./useDashboardLoop-DEE_sLT0.js";import{i as u,n as d,r as f}from"./confirmAdd-D_hDIeaD.js";/* empty css *//* empty css */import{t as ee}from"./relate-BHJl3RaA.js";var p=e(),m=t();function h(e){return e*4}function g(e,t,n,r={}){let i=`template:${e.id}`,a=new Map,o=[];e.metrics.forEach((e,i)=>{if(r.metrics?.[i]===!1)return;let s=`m-${n}-${i}`,c=e.label(t);a.set(i,s),o.push({id:s,label:c,query:e.query(t),...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},lastValue:null,origin:`empty`})});let s=[];e.tripwires.forEach((e,i)=>{if(!(r.tripwires?.[i]??e.enabledByDefault))return;let o=a.get(e.metricIndex);if(!o)return;let c=e.label(t);s.push({id:`t-${n}-${i}`,label:c,metricId:o,comparator:e.comparator,threshold:e.threshold,...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},state:`AWAITING`})});let c=[],l=[];return e.widgets.forEach((e,s)=>{if(r.widgets?.[s]===!1)return;if(e.metricIndex!==void 0){let t=a.get(e.metricIndex);if(!t)return;let r=o.find(e=>e.id===t);c.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:h(e.span),id:`wblk-${n}-${s}`,num:String(c.length+1),props:{title:r.label,stat:`—`,conf:`inferred`,summary:r.sourceQuote.text}},span:e.span,metricId:t,fromSource:i});return}let u=e.refreshQuery?.(t),d=e.seedProps?.(t)??{};l.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:h(e.span),id:`wblk-${n}-${s}`,props:u?{title:u,...d}:d},span:e.span,fromSource:i,...u?{refreshQuery:u}:{}})}),{metrics:o,tripwires:s,widgets:[...c,...l]}}function te(e,t,n={}){let a=n.now??Date.now(),o=`template:${e.id}`,s=e.title(t),{metrics:c,tripwires:l,widgets:u}=g(e,t,a,n.toggles),d=l.length>0,f={id:`w-thesis`,block:{type:`thesis`,col:8,id:`w-thesis`,props:{reasoning:e.thesis(t)}},span:2,fromSource:o},ee={id:`w-align`,block:{type:`alignmentgauge`,col:4,id:`w-align`,props:{pct:null}},span:1,fromSource:o},p={id:`w-alerts`,block:{type:`standingalerts`,col:4,id:`w-alerts`,props:{alerts:[]}},span:1,fromSource:o},m={id:`w-sources`,block:{type:`sourceslineage`,col:8,id:`w-sources`,props:{rows:[]}},span:2,fromSource:o},h=n.cadence??e.cadence,te=c.some(e=>e.query.trim()!==``&&!e.blankKey)||u.some(e=>e.refreshQuery?.trim());return{id:r(),title:s,question:s,thesis:{text:e.thesis(t),saidAt:a},tripwires:l,metrics:c,sources:[{kind:`ORIGIN`,conversationId:o,title:e.label,contributed:`Started from the '${e.label}' template.`,at:a}],widgets:[...d?[f,ee]:[],...u,...d?[p]:[],m],cadence:h,smartTrigger:d,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:a,updatedAt:a,nextDataAt:i(h,a),nextAiAt:2**53-1,lastRefreshedAt:null,...te?{oneShotAt:a,oneShotLabel:`first check`}:{}}}function ne(e,t,n,r=Date.now()){let i=new Set(e.metrics.map(e=>l(e.label))),a=new Set(e.tripwires.map(e=>l(e.label))),o=g(t,n,r),s=o.metrics.filter(e=>!i.has(l(e.label))),u=new Set(s.map(e=>e.id)),d=o.tripwires.filter(e=>u.has(e.metricId)&&!a.has(l(e.label))),f=o.widgets.filter(e=>!e.metricId||u.has(e.metricId)),ee=s.length+d.length,p=[];s.length&&p.push(`${s.length} metric${s.length>1?`s`:``}`),d.length&&p.push(`${d.length} alert${d.length>1?`s`:``}`);let m={kind:`ADDED`,conversationId:`template:${t.id}`,title:t.label,contributed:p.length?`Added: ${p.join(` + `)}`:`Linked the '${t.label}' template.`,at:r};return c(e.id,{metrics:s,tripwires:d,widgets:f,source:m}),ee}var _={chart:{labels:[],series:[]},scoreboard:{games:[]},standings:{rows:[]},forecast:{days:[]},list:{items:[]},timeline:{events:[]}};function re(e){return{id:`plan`,label:`Track anything`,blurb:``,input:{key:`ask`,label:`Track`,placeholder:``},title:()=>e.title,thesis:()=>`Tracking ${e.title}.`,metrics:e.metrics.map(e=>({label:()=>e.label,query:()=>e.query,...e.unit?{unit:e.unit}:{}})),tripwires:[],widgets:[...e.metrics.map((e,t)=>({blockType:`insight`,span:1,metricIndex:t})),...e.widgets.map(e=>({blockType:e.blockType,span:e.span,refreshQuery:()=>e.query,seedProps:()=>({..._[e.blockType]??{}})}))],cadence:{data:e.cadence,ai:`manual`}}}var v=n(),ie={"15min":`checks every 15 minutes while open`,hourly:`checks hourly while open`,"6h":`checks every 6 hours while open`,daily:`checks daily while open`,manual:`refreshes only when you ask`};function ae(e,t){let n=[...e];return n[t]=!n[t],n}function oe(e){let t=(0,m.c)(102),{plan:n,ask:r,existing:i,onDone:c}=e,[l,h]=(0,p.useState)(n.title),g;t[0]===n.metrics?g=t[1]:(g=()=>n.metrics.map(le),t[0]=n.metrics,t[1]=g);let[_,oe]=(0,p.useState)(g),y;t[2]===n.widgets?y=t[3]:(y=()=>n.widgets.map(ce),t[2]=n.widgets,t[3]=y);let[b,de]=(0,p.useState)(y),[x,fe]=(0,p.useState)(null),[S,pe]=(0,p.useState)(`manual`),C;t[4]===_?C=t[5]:(C=_.filter(Boolean),t[4]=_,t[5]=C);let me=C.length,w;t[6]===b?w=t[7]:(w=b.filter(Boolean),t[6]=b,t[7]=w);let T=me+w.length,he=a(S),[E,ge]=(0,p.useState)(!1),[D,_e]=(0,p.useState)(null),ve=(0,p.useRef)(!0),O,k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>(ve.current=!0,()=>{ve.current=!1}),k=[],t[8]=O,t[9]=k):(O=t[8],k=t[9]),(0,p.useEffect)(O,k);let A;t[10]!==r||t[11]!==S||t[12]!==E||t[13]!==T||t[14]!==_||t[15]!==l||t[16]!==c||t[17]!==n||t[18]!==b?(A=async()=>{if(T===0||E)return;let e=re(n),t=[...n.metrics.map(se),...b],i=te(e,r.trim(),{toggles:{metrics:_,widgets:t},cadence:{data:S,ai:`manual`}});i.title=l.trim()||i.title,i.question=r.trim(),o(i),c(i.id),u(i.id,null)},t[10]=r,t[11]=S,t[12]=E,t[13]=T,t[14]=_,t[15]=l,t[16]=c,t[17]=n,t[18]=b,t[19]=A):A=t[19];let j=A,M;t[20]!==r||t[21]!==E||t[22]!==c||t[23]!==n?(M=async e=>{if(E)return;let t=d(e);ne(e,re(n),r.trim()),s(e.id),ge(!0),_e(null);let i=await u(e.id,t);if(ve.current){if(ge(!1),i!==`confirmed`){_e(f(i,!1));return}c(e.id)}},t[20]=r,t[21]=E,t[22]=c,t[23]=n,t[24]=M):M=t[24];let ye=M,N;t[25]!==r||t[26]!==j||t[27]!==i||t[28]!==n.title?(N=()=>{let e=ee(i,{text:`${n.title} ${r}`});if(e){fe(e);return}j()},t[25]=r,t[26]=j,t[27]=i,t[28]=n.title,t[29]=N):N=t[29];let P=N;if(x){let e;t[30]===x.title?e=t[31]:(e=(0,v.jsxs)(`p`,{className:`tpl-interstitial-text`,children:[`This looks related to your existing “`,x.title,`” dashboard — fold this in instead of creating a new one?`]}),t[30]=x.title,t[31]=e);let n;t[32]!==ye||t[33]!==x?(n=()=>void ye(x),t[32]=ye,t[33]=x,t[34]=n):n=t[34];let r=E?`Confirming live data…`:`Fold into “${x.title}”`,i;t[35]!==E||t[36]!==n||t[37]!==r?(i=(0,v.jsx)(`button`,{type:`button`,className:`tpl-fold-btn`,disabled:E,onClick:n,children:r}),t[35]=E,t[36]=n,t[37]=r,t[38]=i):i=t[38];let a;t[39]===j?a=t[40]:(a=()=>void j(),t[39]=j,t[40]=a);let o;t[41]!==E||t[42]!==a?(o=(0,v.jsx)(`button`,{type:`button`,className:`tpl-create-anyway`,disabled:E,onClick:a,children:`Create new anyway`}),t[41]=E,t[42]=a,t[43]=o):o=t[43];let s;t[44]!==i||t[45]!==o?(s=(0,v.jsxs)(`div`,{className:`tpl-interstitial-actions`,children:[i,o]}),t[44]=i,t[45]=o,t[46]=s):s=t[46];let c;t[47]===E?c=t[48]:(c=E&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:`Checking a live source before this joins your board — a search can take up to a minute. You can close this; the result lands in your check log either way.`}),t[47]=E,t[48]=c);let l;t[49]===D?l=t[50]:(l=D&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:D}),t[49]=D,t[50]=l);let u;return t[51]!==e||t[52]!==s||t[53]!==c||t[54]!==l?(u=(0,v.jsxs)(`div`,{className:`tpl-interstitial`,children:[e,s,c,l]}),t[51]=e,t[52]=s,t[53]=c,t[54]=l,t[55]=u):u=t[55],u}let F;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Dashboard name`}),t[56]=F):F=t[56];let I;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>h(e.target.value),t[57]=I):I=t[57];let L;t[58]===l?L=t[59]:(L=(0,v.jsxs)(`label`,{className:`tpl-field`,children:[F,(0,v.jsx)(`input`,{className:`xt-name`,value:l,onChange:I,"aria-label":`Dashboard name`})]}),t[58]=l,t[59]=L);let R;t[60]!==_||t[61]!==n.metrics?(R=n.metrics.length>0&&(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Numbers to watch`}),(0,v.jsx)(`div`,{className:`tpl-chips`,children:n.metrics.map((e,t)=>(0,v.jsx)(ue,{kind:`METRIC`,label:e.label,detail:e.query,on:_[t]??!0,onToggle:()=>oe(e=>ae(e,t))},`m${t}`))})]}),t[60]=_,t[61]=n.metrics,t[62]=R):R=t[62];let z;t[63]!==n.widgets||t[64]!==b?(z=n.widgets.length>0&&(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Live cards`}),(0,v.jsx)(`div`,{className:`tpl-chips`,children:n.widgets.map((e,t)=>(0,v.jsx)(ue,{kind:`CARD`,label:e.query,detail:e.blockType,on:b[t]??!0,onToggle:()=>de(e=>ae(e,t))},`w${t}`))})]}),t[63]=n.widgets,t[64]=b,t[65]=z):z=t[65];let B;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,v.jsx)(`span`,{className:`xt-section-label`,children:`How often`}),t[66]=B):B=t[66];let be=`tpl-chip xt-comp--goal${S===`manual`?``:` tpl-chip-off`}`,xe=S===`manual`,V,H;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>pe(`manual`),H=(0,v.jsx)(`span`,{className:`tpl-chip-label`,children:`Manual — only when you ask`}),t[67]=V,t[68]=H):(V=t[67],H=t[68]);let U;t[69]!==be||t[70]!==xe?(U=(0,v.jsx)(`button`,{type:`button`,className:be,"aria-pressed":xe,onClick:V,children:H}),t[69]=be,t[70]=xe,t[71]=U):U=t[71];let W;t[72]!==S||t[73]!==n.cadence?(W=n.cadence!==`manual`&&(0,v.jsx)(`button`,{type:`button`,className:`tpl-chip xt-comp--metric${S===n.cadence?``:` tpl-chip-off`}`,"aria-pressed":S===n.cadence,onClick:()=>pe(n.cadence),title:ie[n.cadence],children:(0,v.jsxs)(`span`,{className:`tpl-chip-label`,children:[`Suggested — `,ie[n.cadence]]})}),t[72]=S,t[73]=n.cadence,t[74]=W):W=t[74];let G;t[75]!==U||t[76]!==W?(G=(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[B,(0,v.jsxs)(`div`,{className:`tpl-chips`,children:[U,W]})]}),t[75]=U,t[76]=W,t[77]=G):G=t[77];let Se=he>0?`≈ ${he} searches/mo on your key, at this cadence.`:`No standing searches — this refreshes only when you ask.`,K;t[78]===Se?K=t[79]:(K=(0,v.jsx)(`p`,{className:`dash-plan-estimate`,children:Se}),t[78]=Se,t[79]=K);let Ce=ie[S],q;t[80]===Ce?q=t[81]:(q=(0,v.jsx)(`span`,{className:`tpl-cadence-note`,children:Ce}),t[80]=Ce,t[81]=q);let J=T===0||E,we=E?`Confirming live data…`:`Create dashboard →`,Y;t[82]!==P||t[83]!==J||t[84]!==we?(Y=(0,v.jsx)(`button`,{type:`button`,className:`tpl-create`,onClick:P,disabled:J,children:we}),t[82]=P,t[83]=J,t[84]=we,t[85]=Y):Y=t[85];let X;t[86]!==q||t[87]!==Y?(X=(0,v.jsxs)(`div`,{className:`xt-build-row`,children:[q,Y]}),t[86]=q,t[87]=Y,t[88]=X):X=t[88];let Z;t[89]===E?Z=t[90]:(Z=E&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:`Checking a live source before this joins your board — a search can take up to a minute. You can close this; the result lands in your check log either way.`}),t[89]=E,t[90]=Z);let Q;t[91]===D?Q=t[92]:(Q=D&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:D}),t[91]=D,t[92]=Q);let $;return t[93]!==L||t[94]!==R||t[95]!==z||t[96]!==G||t[97]!==K||t[98]!==X||t[99]!==Z||t[100]!==Q?($=(0,v.jsxs)(`div`,{className:`tpl-form`,children:[L,R,z,G,K,X,Z,Q]}),t[93]=L,t[94]=R,t[95]=z,t[96]=G,t[97]=K,t[98]=X,t[99]=Z,t[100]=Q,t[101]=$):$=t[101],$}function se(){return!0}function ce(){return!0}function le(){return!0}function ue(e){let t=(0,m.c)(14),{kind:n,label:r,detail:i,on:a,onToggle:o}=e,s=`tpl-chip xt-comp--${n===`METRIC`?`metric`:`goal`}${a?``:` tpl-chip-off`}`,c;t[0]===n?c=t[1]:(c=(0,v.jsx)(`span`,{className:`tpl-chip-kind`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,v.jsx)(`span`,{className:`tpl-chip-label`,children:r}),t[2]=r,t[3]=l);let u=a?`Included ✓`:`Removed ✕`,d;t[4]===u?d=t[5]:(d=(0,v.jsx)(`span`,{className:`tpl-chip-state`,children:u}),t[4]=u,t[5]=d);let f;return t[6]!==i||t[7]!==a||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==d?(f=(0,v.jsxs)(`button`,{type:`button`,className:s,onClick:o,"aria-pressed":a,title:i,children:[c,l,d]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d,t[13]=f):f=t[13],f}export{oe as PlanReview};
@@ -1 +1 @@
1
- import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{l as r}from"./index-CKRjGbeR.js";import{i,n as a,o}from"./notes-nfocTnUv.js";import{t as s}from"./registry-DLyrLfe-.js";var c=t(),l=e(),u=n(),d=10,f=5,p=1500,m=60,h=1.5;function g(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function _(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable:!1}var v=[{keys:`→ / Space / Page Down`,action:`Next slide`},{keys:`← / Page Up`,action:`Previous slide`},{keys:`Home / End`,action:`First / last slide`},{keys:`0–9, then Enter`,action:`Jump to a slide number`},{keys:`B`,action:`Blackout the screen`},{keys:`W`,action:`Whiteout the screen`},{keys:`F`,action:`Toggle fullscreen`},{keys:`O or G`,action:`Overview — every slide at once`},{keys:`S`,action:`Presenter notes`},{keys:`R`,action:`Reset the timer`},{keys:`X`,action:`Skip this slide for this run (restore it from the overview)`},{keys:`?`,action:`This help`},{keys:`Esc`,action:`Close the topmost panel — or end the show`}];function ee(e){let t=(0,c.c)(24),{slides:n,skipped:r,skin:a,selected:o,presentedIndex:s,onJump:l,onToggleSkip:d,onClose:f}=e,p;t[0]===f?p=t[1]:(p=(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-close`,onClick:f,"aria-label":`Close overview`,children:`×`}),t[0]=f,t[1]=p);let m;t[2]===r.size?m=t[3]:(m=r.size>0&&(0,u.jsxs)(`div`,{className:`preso-overview-skipnote`,children:[r.size,` slide`,r.size===1?``:`s`,` skipped this run`]}),t[2]=r.size,t[3]=m);let h;if(t[4]!==l||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==a||t[9]!==n){let e;t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==o||t[15]!==a||t[16]!==n.length?(e=(e,t)=>{let r=s(t),c=r<0;return(0,u.jsxs)(`div`,{className:`preso-overview-cell`+(!c&&r===o?` is-selected`:``)+(c?` is-skipped`:``),children:[(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!c&&r===o,className:`preso-overview-open`,"aria-label":c?`Slide ${t+1}, skipped — restore it`:`Go to slide ${t+1}`,onClick:()=>c?d(e.id):l(r),children:[(0,u.jsx)(`span`,{className:`preso-overview-thumb`,children:(0,u.jsx)(i,{slide:e,skin:a,ctx:{index:t,total:n.length}})}),(0,u.jsx)(`span`,{className:`preso-overview-num`,children:t+1})]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-skip`,"aria-label":c?`Restore slide ${t+1}`:`Skip slide ${t+1} this run`,title:c?`Restore`:`Skip for this run`,onClick:()=>d(e.id),children:c?`↩`:`×`})]},e.id)},t[11]=l,t[12]=d,t[13]=s,t[14]=o,t[15]=a,t[16]=n.length,t[17]=e):e=t[17],h=n.map(e),t[4]=l,t[5]=d,t[6]=s,t[7]=o,t[8]=a,t[9]=n,t[10]=h}else h=t[10];let g;t[18]===h?g=t[19]:(g=(0,u.jsx)(`div`,{className:`preso-overview-grid`,children:h}),t[18]=h,t[19]=g);let _;return t[20]!==p||t[21]!==m||t[22]!==g?(_=(0,u.jsxs)(`div`,{className:`preso-overview`,role:`listbox`,"aria-label":`All slides`,children:[p,m,g]}),t[20]=p,t[21]=m,t[22]=g,t[23]=_):_=t[23],_}function te(e){let t=(0,c.c)(6),{onClose:n}=e,r;t[0]===n?r=t[1]:(r=(0,u.jsx)(`button`,{type:`button`,className:`preso-help-close`,onClick:n,"aria-label":`Close help`,children:`×`}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,u.jsx)(`h2`,{className:`preso-help-title`,children:`Keyboard shortcuts`}),t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,u.jsx)(`dl`,{className:`preso-help-list`,children:v.map(y)}),t[3]=a):a=t[3];let o;return t[4]===r?o=t[5]:(o=(0,u.jsxs)(`div`,{className:`preso-help`,role:`dialog`,"aria-modal":`true`,"aria-label":`Keyboard shortcuts`,children:[r,i,a]}),t[4]=r,t[5]=o),o}function y(e){return(0,u.jsxs)(`div`,{className:`preso-help-row`,children:[(0,u.jsx)(`dt`,{children:e.keys}),(0,u.jsx)(`dd`,{children:e.action})]},e.keys)}function ne(e){let t=(0,c.c)(3),{mode:n,onDismiss:r}=e,i=`preso-curtain preso-curtain-${n}`,a;return t[0]!==r||t[1]!==i?(a=(0,u.jsx)(`div`,{className:i,role:`presentation`,onClick:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function b({spec:e,question:t,narration:n,skinId:c,autoAdvanceMs:v,onExit:y}){let[b]=(0,l.useState)(()=>Date.now()),x=(0,l.useMemo)(()=>o(e?[e]:[],b),[e,b]).slides,[S,re]=(0,l.useState)(new Set),C=(0,l.useMemo)(()=>x.filter(e=>!S.has(e.id)),[x,S]),w=(0,l.useCallback)(e=>{re(t=>{let n=new Set(t);return n.has(e)?n.delete(e):x.filter(e=>!t.has(e.id)).length>1&&n.add(e),n})},[x]),T=s[c],[E,D]=(0,l.useState)(0),[O,k]=(0,l.useState)(!1),[ie,ae]=(0,l.useState)(0),[A,j]=(0,l.useState)(null),[M,N]=(0,l.useState)(!1),[P,F]=(0,l.useState)(0),[I,L]=(0,l.useState)(!1),[R,z]=(0,l.useState)(``),B=(0,l.useRef)(null),V=(0,l.useRef)(null),H=(0,l.useRef)(null),U=C.length,W=(0,l.useCallback)(e=>Math.max(0,Math.min(U-1,e)),[U]),G=(0,l.useCallback)(()=>D(e=>W(e+1)),[W]),K=(0,l.useCallback)(()=>D(e=>W(e-1)),[W]),q=(0,l.useCallback)(()=>ae(0),[]),J=(0,l.useCallback)(()=>{let e=B.current;e&&(document.fullscreenElement===e?document.exitFullscreen().catch(()=>{}):e.requestFullscreen?.().catch(()=>{}))},[]);(0,l.useEffect)(()=>()=>{V.current!==null&&window.clearTimeout(V.current)},[]);let oe=(0,l.useCallback)(e=>{z(t=>t+e),V.current!==null&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>z(``),p)},[]),se=(0,l.useCallback)(()=>{V.current!==null&&(window.clearTimeout(V.current),V.current=null),R&&D(W(Number(R)-1)),z(``)},[R,W]);(0,l.useEffect)(()=>{let e=window.setInterval(()=>{r()||ae(e=>e+1)},1e3);return()=>window.clearInterval(e)},[]),(0,l.useEffect)(()=>{if(!v)return;let e=window.setInterval(()=>{r()||D(e=>e>=U-1?e:W(e+1))},v);return()=>window.clearInterval(e)},[v,U,W]),(0,l.useEffect)(()=>{B.current?.focus({preventScroll:!0})},[]),(0,l.useEffect)(()=>{let e=e=>{if(!_(e.target)){if(e.key===`Escape`){I?(e.preventDefault(),e.stopPropagation(),L(!1)):M?(e.preventDefault(),e.stopPropagation(),N(!1)):A?(e.preventDefault(),e.stopPropagation(),j(null)):O?(e.preventDefault(),e.stopPropagation(),k(!1)):y();return}if(I){e.key===`?`&&(e.preventDefault(),L(!1));return}if(M){if(e.key===`ArrowRight`){e.preventDefault(),F(e=>Math.min(U-1,e+1));return}if(e.key===`ArrowLeft`){e.preventDefault(),F(e=>Math.max(0,e-1));return}if(e.key===`ArrowDown`){e.preventDefault(),F(e=>Math.min(U-1,e+f));return}if(e.key===`ArrowUp`){e.preventDefault(),F(e=>Math.max(0,e-f));return}if(e.key===`Enter`){e.preventDefault(),D(P),N(!1);return}}if(R&&!/^[0-9]$/.test(e.key)&&e.key!==`Enter`&&(V.current!==null&&(window.clearTimeout(V.current),V.current=null),z(``)),e.key===`ArrowRight`||e.key===`PageDown`||e.key===` `)e.preventDefault(),j(null),G();else if(e.key===`ArrowLeft`||e.key===`PageUp`)e.preventDefault(),j(null),K();else if(e.key===`Home`)e.preventDefault(),j(null),D(0);else if(e.key===`End`)e.preventDefault(),j(null),D(U-1);else if(e.key===`s`||e.key===`S`)k(e=>!e);else if(e.key===`b`||e.key===`B`)j(e=>e===`black`?null:`black`);else if(e.key===`w`||e.key===`W`)j(e=>e===`white`?null:`white`);else if(e.key===`f`||e.key===`F`)J();else if(e.key===`o`||e.key===`O`||e.key===`g`||e.key===`G`)M?N(!1):(F(W(E)),N(!0));else if(e.key===`?`)L(e=>!e);else if(e.key===`x`||e.key===`X`){let e=C[W(E)];e&&w(e.id)}else e.key===`r`||e.key===`R`?q():e.key===`Enter`?R&&(e.preventDefault(),se()):/^[0-9]$/.test(e.key)&&(e.preventDefault(),oe(e.key))}};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[G,K,U,W,E,y,I,M,P,A,O,R,J,q,oe,se,C,w]);let Y=W(E),X=C[Y],Z=(0,l.useRef)(Y),ce=Y>=Z.current?`next`:`prev`,[Q,le]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(Z.current===Y)return;le(Z.current),Z.current=Y;let e=window.setTimeout(()=>le(null),380);return()=>window.clearTimeout(e)},[Y]);let ue=X?.notes??(X?.kind===`cover`?n||t||``:a(X)),$=C[Y+1],de=$?a($):`— end —`,fe=U?Math.round((Y+1)/U*100):0,pe=(0,l.useCallback)(e=>{(e.pointerType===`touch`||e.pointerType===`pen`)&&(e.target instanceof Element&&e.target.closest(`button`)||(H.current={x:e.clientX,y:e.clientY}))},[]),me=(0,l.useCallback)(e=>{let t=H.current;if(H.current=null,!t||e.pointerType!==`touch`&&e.pointerType!==`pen`)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.abs(n)<m||Math.abs(n)<Math.abs(r)*h||(j(null),n<0?G():K())},[G,K]),he=A?A===`black`?`Screen blacked out.`:`Screen whited out.`:U?`Slide ${Y+1} of ${U}: ${a(X)||X?.kind||``}`:``;return(0,u.jsxs)(`div`,{className:`preso-deck`,role:`region`,"aria-label":`Presentation`,tabIndex:-1,style:{background:`#0a0c11`},ref:B,children:[(0,u.jsx)(`div`,{className:`preso-sr`,"aria-live":`polite`,"aria-atomic":`true`,children:he}),(0,u.jsx)(`div`,{className:`preso-stage`,onPointerDown:pe,onPointerUp:me,children:(0,u.jsxs)(`div`,{className:`preso-skinframe`,style:{aspectRatio:`16 / 9`,width:`min(86vw, calc(84vh * 16 / 9))`,margin:`auto`,position:`relative`,borderRadius:12,overflow:`hidden`,border:`1px solid rgba(255,255,255,.08)`,boxShadow:`0 30px 90px rgba(0,0,0,.55)`},children:[Q!==null&&Q!==Y&&C[Q]&&(0,u.jsx)(`div`,{className:`preso-slide-ghost`,"aria-hidden":!0,children:(0,u.jsx)(i,{slide:C[Q],skin:T,ctx:{index:Q,total:U}})}),X&&(0,u.jsx)(`div`,{className:`preso-slide-anim preso-dir-${ce}`,children:(0,u.jsx)(i,{slide:X,skin:T,ctx:{index:Y,total:U}})},Y)]})}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-prev`,onClick:K,"aria-label":`Previous slide`,disabled:E===0}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-next`,onClick:G,"aria-label":`Next slide`,disabled:E>=U-1}),(0,u.jsxs)(`div`,{className:`preso-rail`,children:[R&&(0,u.jsxs)(`span`,{className:`preso-jumpchip`,role:`status`,children:[(0,u.jsx)(`span`,{"aria-hidden":!0,children:`→`}),` `,R]}),(0,u.jsxs)(`span`,{className:`preso-count`,children:[Y+1,` / `,U]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(0),"aria-label":`First slide`,disabled:Y===0,children:`⤒`}),U<=d&&(0,u.jsx)(`div`,{className:`preso-dots`,role:`presentation`,children:C.map((e,t)=>(0,u.jsx)(`button`,{type:`button`,className:`preso-dot`+(t===Y?` is-active`:``),onClick:()=>D(t),"aria-label":`Go to slide ${t+1}`,"aria-current":t===Y},t))}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(U-1),"aria-label":`Last slide`,disabled:Y>=U-1,children:`⤓`}),(0,u.jsx)(`button`,{type:`button`,className:`preso-notes-btn`+(O?` is-on`:``),onClick:()=>k(e=>!e),"aria-pressed":O,title:`Presenter notes (S)`,children:`Notes`})]}),O&&(0,u.jsxs)(`aside`,{className:`preso-presenter`,"aria-label":`Presenter notes`,children:[(0,u.jsxs)(`div`,{className:`preso-presenter-head`,children:[(0,u.jsx)(`button`,{type:`button`,className:`preso-timer`,onClick:q,title:`Reset timer (R)`,children:g(ie)}),(0,u.jsxs)(`span`,{className:`preso-presenter-pct`,children:[fe,`%`]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-presenter-close`,onClick:()=>k(!1),"aria-label":`Hide presenter notes`,children:`×`})]}),(0,u.jsx)(`div`,{className:`preso-presenter-progress`,"aria-hidden":!0,children:(0,u.jsx)(`span`,{style:{width:`${fe}%`}})}),(0,u.jsxs)(`p`,{className:`preso-presenter-slide`,children:[Y+1,`. `,a(X)||X?.kind]}),(0,u.jsx)(`p`,{className:`preso-presenter-notes`,children:ue||`No notes for this slide.`}),(0,u.jsxs)(`div`,{className:`preso-presenter-next`,children:[(0,u.jsx)(`span`,{className:`preso-presenter-next-label`,children:`Next`}),$?(0,u.jsx)(`div`,{className:`preso-presenter-thumb`,children:(0,u.jsx)(i,{slide:$,skin:T,ctx:{index:Y+1,total:U}})}):null,(0,u.jsx)(`span`,{className:`preso-presenter-next-text`,children:de})]})]}),A&&(0,u.jsx)(ne,{mode:A,onDismiss:()=>j(null)}),M&&(0,u.jsx)(ee,{slides:x,skipped:S,skin:T,selected:P,presentedIndex:e=>S.has(x[e].id)?-1:x.slice(0,e).filter(e=>!S.has(e.id)).length,onJump:e=>{D(e),N(!1)},onToggleSkip:w,onClose:()=>N(!1)}),I&&(0,u.jsx)(te,{onClose:()=>L(!1)})]})}export{b as PresentationDeck};
1
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{l as r}from"./index-BMeoXWPR.js";import{i,n as a,o}from"./notes-BDCTTA87.js";import{t as s}from"./registry-DLyrLfe-.js";var c=t(),l=e(),u=n(),d=10,f=5,p=1500,m=60,h=1.5;function g(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function _(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable:!1}var v=[{keys:`→ / Space / Page Down`,action:`Next slide`},{keys:`← / Page Up`,action:`Previous slide`},{keys:`Home / End`,action:`First / last slide`},{keys:`0–9, then Enter`,action:`Jump to a slide number`},{keys:`B`,action:`Blackout the screen`},{keys:`W`,action:`Whiteout the screen`},{keys:`F`,action:`Toggle fullscreen`},{keys:`O or G`,action:`Overview — every slide at once`},{keys:`S`,action:`Presenter notes`},{keys:`R`,action:`Reset the timer`},{keys:`X`,action:`Skip this slide for this run (restore it from the overview)`},{keys:`?`,action:`This help`},{keys:`Esc`,action:`Close the topmost panel — or end the show`}];function ee(e){let t=(0,c.c)(24),{slides:n,skipped:r,skin:a,selected:o,presentedIndex:s,onJump:l,onToggleSkip:d,onClose:f}=e,p;t[0]===f?p=t[1]:(p=(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-close`,onClick:f,"aria-label":`Close overview`,children:`×`}),t[0]=f,t[1]=p);let m;t[2]===r.size?m=t[3]:(m=r.size>0&&(0,u.jsxs)(`div`,{className:`preso-overview-skipnote`,children:[r.size,` slide`,r.size===1?``:`s`,` skipped this run`]}),t[2]=r.size,t[3]=m);let h;if(t[4]!==l||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==a||t[9]!==n){let e;t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==o||t[15]!==a||t[16]!==n.length?(e=(e,t)=>{let r=s(t),c=r<0;return(0,u.jsxs)(`div`,{className:`preso-overview-cell`+(!c&&r===o?` is-selected`:``)+(c?` is-skipped`:``),children:[(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!c&&r===o,className:`preso-overview-open`,"aria-label":c?`Slide ${t+1}, skipped — restore it`:`Go to slide ${t+1}`,onClick:()=>c?d(e.id):l(r),children:[(0,u.jsx)(`span`,{className:`preso-overview-thumb`,children:(0,u.jsx)(i,{slide:e,skin:a,ctx:{index:t,total:n.length}})}),(0,u.jsx)(`span`,{className:`preso-overview-num`,children:t+1})]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-skip`,"aria-label":c?`Restore slide ${t+1}`:`Skip slide ${t+1} this run`,title:c?`Restore`:`Skip for this run`,onClick:()=>d(e.id),children:c?`↩`:`×`})]},e.id)},t[11]=l,t[12]=d,t[13]=s,t[14]=o,t[15]=a,t[16]=n.length,t[17]=e):e=t[17],h=n.map(e),t[4]=l,t[5]=d,t[6]=s,t[7]=o,t[8]=a,t[9]=n,t[10]=h}else h=t[10];let g;t[18]===h?g=t[19]:(g=(0,u.jsx)(`div`,{className:`preso-overview-grid`,children:h}),t[18]=h,t[19]=g);let _;return t[20]!==p||t[21]!==m||t[22]!==g?(_=(0,u.jsxs)(`div`,{className:`preso-overview`,role:`listbox`,"aria-label":`All slides`,children:[p,m,g]}),t[20]=p,t[21]=m,t[22]=g,t[23]=_):_=t[23],_}function te(e){let t=(0,c.c)(6),{onClose:n}=e,r;t[0]===n?r=t[1]:(r=(0,u.jsx)(`button`,{type:`button`,className:`preso-help-close`,onClick:n,"aria-label":`Close help`,children:`×`}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,u.jsx)(`h2`,{className:`preso-help-title`,children:`Keyboard shortcuts`}),t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,u.jsx)(`dl`,{className:`preso-help-list`,children:v.map(y)}),t[3]=a):a=t[3];let o;return t[4]===r?o=t[5]:(o=(0,u.jsxs)(`div`,{className:`preso-help`,role:`dialog`,"aria-modal":`true`,"aria-label":`Keyboard shortcuts`,children:[r,i,a]}),t[4]=r,t[5]=o),o}function y(e){return(0,u.jsxs)(`div`,{className:`preso-help-row`,children:[(0,u.jsx)(`dt`,{children:e.keys}),(0,u.jsx)(`dd`,{children:e.action})]},e.keys)}function ne(e){let t=(0,c.c)(3),{mode:n,onDismiss:r}=e,i=`preso-curtain preso-curtain-${n}`,a;return t[0]!==r||t[1]!==i?(a=(0,u.jsx)(`div`,{className:i,role:`presentation`,onClick:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function b({spec:e,question:t,narration:n,skinId:c,autoAdvanceMs:v,onExit:y}){let[b]=(0,l.useState)(()=>Date.now()),x=(0,l.useMemo)(()=>o(e?[e]:[],b),[e,b]).slides,[S,re]=(0,l.useState)(new Set),C=(0,l.useMemo)(()=>x.filter(e=>!S.has(e.id)),[x,S]),w=(0,l.useCallback)(e=>{re(t=>{let n=new Set(t);return n.has(e)?n.delete(e):x.filter(e=>!t.has(e.id)).length>1&&n.add(e),n})},[x]),T=s[c],[E,D]=(0,l.useState)(0),[O,k]=(0,l.useState)(!1),[ie,ae]=(0,l.useState)(0),[A,j]=(0,l.useState)(null),[M,N]=(0,l.useState)(!1),[P,F]=(0,l.useState)(0),[I,L]=(0,l.useState)(!1),[R,z]=(0,l.useState)(``),B=(0,l.useRef)(null),V=(0,l.useRef)(null),H=(0,l.useRef)(null),U=C.length,W=(0,l.useCallback)(e=>Math.max(0,Math.min(U-1,e)),[U]),G=(0,l.useCallback)(()=>D(e=>W(e+1)),[W]),K=(0,l.useCallback)(()=>D(e=>W(e-1)),[W]),q=(0,l.useCallback)(()=>ae(0),[]),J=(0,l.useCallback)(()=>{let e=B.current;e&&(document.fullscreenElement===e?document.exitFullscreen().catch(()=>{}):e.requestFullscreen?.().catch(()=>{}))},[]);(0,l.useEffect)(()=>()=>{V.current!==null&&window.clearTimeout(V.current)},[]);let oe=(0,l.useCallback)(e=>{z(t=>t+e),V.current!==null&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>z(``),p)},[]),se=(0,l.useCallback)(()=>{V.current!==null&&(window.clearTimeout(V.current),V.current=null),R&&D(W(Number(R)-1)),z(``)},[R,W]);(0,l.useEffect)(()=>{let e=window.setInterval(()=>{r()||ae(e=>e+1)},1e3);return()=>window.clearInterval(e)},[]),(0,l.useEffect)(()=>{if(!v)return;let e=window.setInterval(()=>{r()||D(e=>e>=U-1?e:W(e+1))},v);return()=>window.clearInterval(e)},[v,U,W]),(0,l.useEffect)(()=>{B.current?.focus({preventScroll:!0})},[]),(0,l.useEffect)(()=>{let e=e=>{if(!_(e.target)){if(e.key===`Escape`){I?(e.preventDefault(),e.stopPropagation(),L(!1)):M?(e.preventDefault(),e.stopPropagation(),N(!1)):A?(e.preventDefault(),e.stopPropagation(),j(null)):O?(e.preventDefault(),e.stopPropagation(),k(!1)):y();return}if(I){e.key===`?`&&(e.preventDefault(),L(!1));return}if(M){if(e.key===`ArrowRight`){e.preventDefault(),F(e=>Math.min(U-1,e+1));return}if(e.key===`ArrowLeft`){e.preventDefault(),F(e=>Math.max(0,e-1));return}if(e.key===`ArrowDown`){e.preventDefault(),F(e=>Math.min(U-1,e+f));return}if(e.key===`ArrowUp`){e.preventDefault(),F(e=>Math.max(0,e-f));return}if(e.key===`Enter`){e.preventDefault(),D(P),N(!1);return}}if(R&&!/^[0-9]$/.test(e.key)&&e.key!==`Enter`&&(V.current!==null&&(window.clearTimeout(V.current),V.current=null),z(``)),e.key===`ArrowRight`||e.key===`PageDown`||e.key===` `)e.preventDefault(),j(null),G();else if(e.key===`ArrowLeft`||e.key===`PageUp`)e.preventDefault(),j(null),K();else if(e.key===`Home`)e.preventDefault(),j(null),D(0);else if(e.key===`End`)e.preventDefault(),j(null),D(U-1);else if(e.key===`s`||e.key===`S`)k(e=>!e);else if(e.key===`b`||e.key===`B`)j(e=>e===`black`?null:`black`);else if(e.key===`w`||e.key===`W`)j(e=>e===`white`?null:`white`);else if(e.key===`f`||e.key===`F`)J();else if(e.key===`o`||e.key===`O`||e.key===`g`||e.key===`G`)M?N(!1):(F(W(E)),N(!0));else if(e.key===`?`)L(e=>!e);else if(e.key===`x`||e.key===`X`){let e=C[W(E)];e&&w(e.id)}else e.key===`r`||e.key===`R`?q():e.key===`Enter`?R&&(e.preventDefault(),se()):/^[0-9]$/.test(e.key)&&(e.preventDefault(),oe(e.key))}};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[G,K,U,W,E,y,I,M,P,A,O,R,J,q,oe,se,C,w]);let Y=W(E),X=C[Y],Z=(0,l.useRef)(Y),ce=Y>=Z.current?`next`:`prev`,[Q,le]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(Z.current===Y)return;le(Z.current),Z.current=Y;let e=window.setTimeout(()=>le(null),380);return()=>window.clearTimeout(e)},[Y]);let ue=X?.notes??(X?.kind===`cover`?n||t||``:a(X)),$=C[Y+1],de=$?a($):`— end —`,fe=U?Math.round((Y+1)/U*100):0,pe=(0,l.useCallback)(e=>{(e.pointerType===`touch`||e.pointerType===`pen`)&&(e.target instanceof Element&&e.target.closest(`button`)||(H.current={x:e.clientX,y:e.clientY}))},[]),me=(0,l.useCallback)(e=>{let t=H.current;if(H.current=null,!t||e.pointerType!==`touch`&&e.pointerType!==`pen`)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.abs(n)<m||Math.abs(n)<Math.abs(r)*h||(j(null),n<0?G():K())},[G,K]),he=A?A===`black`?`Screen blacked out.`:`Screen whited out.`:U?`Slide ${Y+1} of ${U}: ${a(X)||X?.kind||``}`:``;return(0,u.jsxs)(`div`,{className:`preso-deck`,role:`region`,"aria-label":`Presentation`,tabIndex:-1,style:{background:`#0a0c11`},ref:B,children:[(0,u.jsx)(`div`,{className:`preso-sr`,"aria-live":`polite`,"aria-atomic":`true`,children:he}),(0,u.jsx)(`div`,{className:`preso-stage`,onPointerDown:pe,onPointerUp:me,children:(0,u.jsxs)(`div`,{className:`preso-skinframe`,style:{aspectRatio:`16 / 9`,width:`min(86vw, calc(84vh * 16 / 9))`,margin:`auto`,position:`relative`,borderRadius:12,overflow:`hidden`,border:`1px solid rgba(255,255,255,.08)`,boxShadow:`0 30px 90px rgba(0,0,0,.55)`},children:[Q!==null&&Q!==Y&&C[Q]&&(0,u.jsx)(`div`,{className:`preso-slide-ghost`,"aria-hidden":!0,children:(0,u.jsx)(i,{slide:C[Q],skin:T,ctx:{index:Q,total:U}})}),X&&(0,u.jsx)(`div`,{className:`preso-slide-anim preso-dir-${ce}`,children:(0,u.jsx)(i,{slide:X,skin:T,ctx:{index:Y,total:U}})},Y)]})}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-prev`,onClick:K,"aria-label":`Previous slide`,disabled:E===0}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-next`,onClick:G,"aria-label":`Next slide`,disabled:E>=U-1}),(0,u.jsxs)(`div`,{className:`preso-rail`,children:[R&&(0,u.jsxs)(`span`,{className:`preso-jumpchip`,role:`status`,children:[(0,u.jsx)(`span`,{"aria-hidden":!0,children:`→`}),` `,R]}),(0,u.jsxs)(`span`,{className:`preso-count`,children:[Y+1,` / `,U]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(0),"aria-label":`First slide`,disabled:Y===0,children:`⤒`}),U<=d&&(0,u.jsx)(`div`,{className:`preso-dots`,role:`presentation`,children:C.map((e,t)=>(0,u.jsx)(`button`,{type:`button`,className:`preso-dot`+(t===Y?` is-active`:``),onClick:()=>D(t),"aria-label":`Go to slide ${t+1}`,"aria-current":t===Y},t))}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(U-1),"aria-label":`Last slide`,disabled:Y>=U-1,children:`⤓`}),(0,u.jsx)(`button`,{type:`button`,className:`preso-notes-btn`+(O?` is-on`:``),onClick:()=>k(e=>!e),"aria-pressed":O,title:`Presenter notes (S)`,children:`Notes`})]}),O&&(0,u.jsxs)(`aside`,{className:`preso-presenter`,"aria-label":`Presenter notes`,children:[(0,u.jsxs)(`div`,{className:`preso-presenter-head`,children:[(0,u.jsx)(`button`,{type:`button`,className:`preso-timer`,onClick:q,title:`Reset timer (R)`,children:g(ie)}),(0,u.jsxs)(`span`,{className:`preso-presenter-pct`,children:[fe,`%`]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-presenter-close`,onClick:()=>k(!1),"aria-label":`Hide presenter notes`,children:`×`})]}),(0,u.jsx)(`div`,{className:`preso-presenter-progress`,"aria-hidden":!0,children:(0,u.jsx)(`span`,{style:{width:`${fe}%`}})}),(0,u.jsxs)(`p`,{className:`preso-presenter-slide`,children:[Y+1,`. `,a(X)||X?.kind]}),(0,u.jsx)(`p`,{className:`preso-presenter-notes`,children:ue||`No notes for this slide.`}),(0,u.jsxs)(`div`,{className:`preso-presenter-next`,children:[(0,u.jsx)(`span`,{className:`preso-presenter-next-label`,children:`Next`}),$?(0,u.jsx)(`div`,{className:`preso-presenter-thumb`,children:(0,u.jsx)(i,{slide:$,skin:T,ctx:{index:Y+1,total:U}})}):null,(0,u.jsx)(`span`,{className:`preso-presenter-next-text`,children:de})]})]}),A&&(0,u.jsx)(ne,{mode:A,onDismiss:()=>j(null)}),M&&(0,u.jsx)(ee,{slides:x,skipped:S,skin:T,selected:P,presentedIndex:e=>S.has(x[e].id)?-1:x.slice(0,e).filter(e=>!S.has(e.id)).length,onJump:e=>{D(e),N(!1)},onToggleSkip:w,onClose:()=>N(!1)}),I&&(0,u.jsx)(te,{onClose:()=>L(!1)})]})}export{b as PresentationDeck};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismWorkbench-BEaD7Arj.js","assets/compiler-runtime-qQQXpJgv.js","assets/rolldown-runtime-DkW27tQK.js","assets/react-BZJXY1be.js","assets/jsx-runtime-DeHZSEgm.js","assets/useLiveConfig-CvOQTr0s.js","assets/info-CiqHR5cs.js","assets/keyVault-Aw5Y2PjT.js","assets/providers-CPhoN8j0.js","assets/http-Bqk6nJiH.js","assets/blockTypes-DUDdP3pB.js","assets/attachments-BW-vki-E.js","assets/route-CMdTFx0P.js","assets/PrismOverlay-c8rcvt4V.js","assets/preload-helper-CiWYd9n-.js","assets/cachedImport-DW0gP14h.js","assets/preloadableLazy-MIX1ApBW.js","assets/lazyRetry-D50B1UMY.js","assets/index-CKRjGbeR.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/useFocusTrap-CJmpNZv2.js","assets/toast-BBNs2h3L.js","assets/sourceHost-BV3t2XDb.js","assets/penStrokes-CTC3AYiz.js","assets/gesture-BBS5nQEi.js","assets/types-CaO6xOn5.js","assets/cache-7UEbF3S6.js","assets/verbatim-DBTj9sPD.js","assets/officeDoc-GU6Cssjf.js","assets/csv-DAqzYXUs.js","assets/pen-UKrUHlDA.js","assets/streamParse-BX0bAppQ.js","assets/citation-BsSvaaer.js","assets/search-ZN7v_P5B.js","assets/PrismOverlay-5ZVXu4WL.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a,t as o}from"./preloadableLazy-MIX1ApBW.js";import{n as s,t as c}from"./theme-D5D55hZi.js";import{E as l}from"./index-CKRjGbeR.js";import{n as u}from"./icons-gLFQTv74.js";import{t as d}from"./FeatureUseNotice-BfnZH8Vt.js";import{t as ee}from"./homeTarget-CDc-r2mj.js";import{a as te,s as ne,t as re,u as ie}from"./attachments-BW-vki-E.js";/* empty css */var ae=t(),f=e(),p=n();r();var m=o(()=>i(()=>import(`./PrismWorkbench-BEaD7Arj.js`).then(e=>({default:e.PrismWorkbench})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))),h=m.Component,g={"too-large":`File is too large. Documents up to 40 MB, images up to 10 MB.`,unsupported:`Unsupported file type. Try a PDF, Word doc, spreadsheet, image, or text file.`};function _(){let e=(0,ae.c)(39),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=ee(),e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1],(0,f.useEffect)(ue,r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],e[2]=i):i=e[2];let[o,s]=(0,f.useState)(i),[c,_]=(0,f.useState)(null),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)(null),T=(0,f.useRef)(null),E;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=async e=>{if(!e||e.length===0)return;m.preload().catch(le),w(null);let t=Array.from(e).flatMap(e=>{let t=te(e);return t?(w(g[t]),[]):[e]});t.length>0&&s(e=>{let n=new Set(e.map(ce));return[...e,...t.filter(e=>!n.has(e.name))]}),T.current&&(T.current.value=``)},e[3]=E):E=e[3];let D=E,O;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{s(t=>t.filter(t=>t.name!==e))},e[4]=O):O=e[4];let de=O,k;e[5]!==y||e[6]!==o?(k=async()=>{if(o.length===0||y)return;b(!0),w(null),m.preload().catch(se);let e=await Promise.all(o.map(ie)),t=e.flatMap(oe);t.length===o.length?_(t):w(g[e.find(v)?.error??`unsupported`]),b(!1)},e[5]=y,e[6]=o,e[7]=k):k=e[7];let A=k,j;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{e.preventDefault(),S(!1),D(e.dataTransfer.files)},e[8]=j):j=e[8];let M=j,N;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{e.preventDefault(),S(!0)},e[9]=N):N=e[9];let P=N,F;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{e.currentTarget.contains(e.relatedTarget)||S(!1)},e[10]=F):F=e[10];let I=F;if(c){let t;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=()=>_(null),e[11]=t):t=e[11];let n;return e[12]===c?n=e[13]:(n=(0,p.jsx)(l,{label:`Prism workbench`,overlay:!0,children:(0,p.jsx)(h,{pdf:c,onClose:t})}),e[12]=c,e[13]=n),n}let L;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{window.location.hash=n.href},e[14]=L):L=e[14];let R;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,p.jsxs)(`header`,{className:`prism-app-header`,children:[(0,p.jsx)(`button`,{type:`button`,className:`prism-app-back`,onClick:L,"aria-label":`Back to ${n.label}`,title:`Back to ${n.label}`,children:(0,p.jsx)(u.chevL,{})}),(0,p.jsx)(`span`,{className:`prism-app-brand`,children:`Prism`})]}),e[15]=R):R=e[15];let z;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,p.jsxs)(`div`,{className:`prism-app-hero`,children:[(0,p.jsx)(`h1`,{className:`prism-app-title`,children:`Understand any document`}),(0,p.jsx)(`p`,{className:`prism-app-lede`,children:`Drop a PDF, Word doc, spreadsheet, or text file. Prism maps every claim, finding, and risk — every card cites its exact source.`}),(0,p.jsx)(d,{kind:`upload`})]}),e[16]=z):z=e[16];let B=`prism-dropzone${x?` prism-dropzone--over`:``}`,V;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>T.current?.click(),e[17]=V):V=e[17];let H,U;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{(e.key===`Enter`||e.key===` `)&&T.current?.click()},U=a(m.preload),e[18]=H,e[19]=U):(H=e[18],U=e[19]);let W,G;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,p.jsx)(`input`,{ref:T,type:`file`,accept:re,multiple:!0,className:`prism-dropzone-input`,onChange:e=>void D(e.target.files),"aria-hidden":`true`}),G=(0,p.jsx)(u.upload,{}),e[20]=W,e[21]=G):(W=e[20],G=e[21]);let K=x?`Drop to add`:o.length>0?`Drop more files or click to add`:`Drop files or click to browse`,q;e[22]===K?q=e[23]:(q=(0,p.jsx)(`span`,{className:`prism-dropzone-label`,children:K}),e[22]=K,e[23]=q);let J;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,p.jsx)(`span`,{className:`prism-dropzone-hint`,children:`PDF · Word · Excel · PowerPoint · Image · Text`}),e[24]=J):J=e[24];let Y;e[25]!==B||e[26]!==q?(Y=(0,p.jsxs)(`div`,{className:B,onDrop:M,onDragOver:P,onDragLeave:I,onClick:V,role:`button`,tabIndex:0,"aria-label":`Upload a document`,onKeyDown:H,...U,children:[W,G,q,J]}),e[25]=B,e[26]=q,e[27]=Y):Y=e[27];let X;e[28]===C?X=e[29]:(X=C&&(0,p.jsx)(`p`,{className:`prism-app-error`,role:`alert`,children:C}),e[28]=C,e[29]=X);let Z;e[30]!==A||e[31]!==y||e[32]!==o?(Z=o.length>0&&(0,p.jsxs)(`div`,{className:`prism-staged`,children:[(0,p.jsx)(`p`,{className:`prism-staged-label`,children:o.length===1?`1 document ready`:`${o.length} documents ready`}),(0,p.jsx)(`ul`,{className:`prism-staged-list`,children:o.map(e=>(0,p.jsxs)(`li`,{className:`prism-staged-item`,children:[(0,p.jsx)(u.doc,{}),(0,p.jsx)(`span`,{className:`prism-staged-name`,children:ne({name:e.name,mime:e.type,data:``,size:e.size})}),(0,p.jsx)(`button`,{type:`button`,className:`prism-staged-remove`,onClick:t=>{t.stopPropagation(),de(e.name)},"aria-label":`Remove ${e.name}`,children:(0,p.jsx)(u.x,{})})]},e.name))}),(0,p.jsxs)(`button`,{type:`button`,className:`prism-confirm-btn`,onClick:()=>void A(),disabled:y,...a(m.preload),children:[y?`Preparing documents…`:`Open in Prism`,(0,p.jsx)(u.chevR,{})]})]}),e[30]=A,e[31]=y,e[32]=o,e[33]=Z):Z=e[33];let Q;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,p.jsxs)(`ul`,{className:`prism-app-features`,children:[(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`strong`,{children:`Maps claims spatially`}),` — regions, findings, and risks laid out so you can see the whole shape at once.`]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`strong`,{children:`Every card cites its source`}),` — verbatim quote + page number, always. If Mavéa can't cite it, the card doesn't exist.`]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`strong`,{children:`Ask the whole document`}),` — highlight any claim and ask a follow-up; the answer lights up the exact lines it came from.`]})]}),e[34]=Q):Q=e[34];let $;return e[35]!==Y||e[36]!==X||e[37]!==Z?($=(0,p.jsxs)(`div`,{className:`prism-app`,children:[R,(0,p.jsxs)(`main`,{className:`prism-app-main`,children:[z,Y,X,Z,Q]})]}),e[35]=Y,e[36]=X,e[37]=Z,e[38]=$):$=e[38],$}function v(e){return e.error}function oe(e){return e.attachment?[e.attachment]:[]}function se(){}function ce(e){return e.name}function le(){}function ue(){return c(s())}export{_ as PrismApp};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismWorkbench-DK-1IY4A.js","assets/compiler-runtime-qQQXpJgv.js","assets/rolldown-runtime-DkW27tQK.js","assets/react-BZJXY1be.js","assets/jsx-runtime-DeHZSEgm.js","assets/useLiveConfig-CvOQTr0s.js","assets/info-CiqHR5cs.js","assets/keyVault-Aw5Y2PjT.js","assets/providers-CPhoN8j0.js","assets/http-Bqk6nJiH.js","assets/blockTypes-DUDdP3pB.js","assets/attachments-BW-vki-E.js","assets/route-CMdTFx0P.js","assets/PrismOverlay-L_lLIH_1.js","assets/preload-helper-CiWYd9n-.js","assets/cachedImport-DW0gP14h.js","assets/preloadableLazy-MIX1ApBW.js","assets/lazyRetry-D50B1UMY.js","assets/index-BMeoXWPR.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/useFocusTrap-CJmpNZv2.js","assets/toast-BBNs2h3L.js","assets/sourceHost-BV3t2XDb.js","assets/penStrokes-CTC3AYiz.js","assets/gesture-BBS5nQEi.js","assets/types-CaO6xOn5.js","assets/cache-7UEbF3S6.js","assets/verbatim-DBTj9sPD.js","assets/officeDoc-GU6Cssjf.js","assets/csv-DAqzYXUs.js","assets/pen-UKrUHlDA.js","assets/streamParse-BX0bAppQ.js","assets/citation-BsSvaaer.js","assets/search-ZN7v_P5B.js","assets/PrismOverlay-5ZVXu4WL.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a,t as o}from"./preloadableLazy-MIX1ApBW.js";import{n as s,t as c}from"./theme-D5D55hZi.js";import{E as l}from"./index-BMeoXWPR.js";import{n as u}from"./icons-gLFQTv74.js";import{t as d}from"./FeatureUseNotice-BNDajs0p.js";import{t as ee}from"./homeTarget-CDc-r2mj.js";import{a as te,s as ne,t as re,u as ie}from"./attachments-BW-vki-E.js";/* empty css */var ae=t(),f=e(),p=n();r();var m=o(()=>i(()=>import(`./PrismWorkbench-DK-1IY4A.js`).then(e=>({default:e.PrismWorkbench})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))),h=m.Component,g={"too-large":`File is too large. Documents up to 40 MB, images up to 10 MB.`,unsupported:`Unsupported file type. Try a PDF, Word doc, spreadsheet, image, or text file.`};function _(){let e=(0,ae.c)(39),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=ee(),e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1],(0,f.useEffect)(ue,r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],e[2]=i):i=e[2];let[o,s]=(0,f.useState)(i),[c,_]=(0,f.useState)(null),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)(null),T=(0,f.useRef)(null),E;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=async e=>{if(!e||e.length===0)return;m.preload().catch(le),w(null);let t=Array.from(e).flatMap(e=>{let t=te(e);return t?(w(g[t]),[]):[e]});t.length>0&&s(e=>{let n=new Set(e.map(ce));return[...e,...t.filter(e=>!n.has(e.name))]}),T.current&&(T.current.value=``)},e[3]=E):E=e[3];let D=E,O;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{s(t=>t.filter(t=>t.name!==e))},e[4]=O):O=e[4];let de=O,k;e[5]!==y||e[6]!==o?(k=async()=>{if(o.length===0||y)return;b(!0),w(null),m.preload().catch(se);let e=await Promise.all(o.map(ie)),t=e.flatMap(oe);t.length===o.length?_(t):w(g[e.find(v)?.error??`unsupported`]),b(!1)},e[5]=y,e[6]=o,e[7]=k):k=e[7];let A=k,j;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{e.preventDefault(),S(!1),D(e.dataTransfer.files)},e[8]=j):j=e[8];let M=j,N;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{e.preventDefault(),S(!0)},e[9]=N):N=e[9];let P=N,F;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{e.currentTarget.contains(e.relatedTarget)||S(!1)},e[10]=F):F=e[10];let I=F;if(c){let t;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=()=>_(null),e[11]=t):t=e[11];let n;return e[12]===c?n=e[13]:(n=(0,p.jsx)(l,{label:`Prism workbench`,overlay:!0,children:(0,p.jsx)(h,{pdf:c,onClose:t})}),e[12]=c,e[13]=n),n}let L;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{window.location.hash=n.href},e[14]=L):L=e[14];let R;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,p.jsxs)(`header`,{className:`prism-app-header`,children:[(0,p.jsx)(`button`,{type:`button`,className:`prism-app-back`,onClick:L,"aria-label":`Back to ${n.label}`,title:`Back to ${n.label}`,children:(0,p.jsx)(u.chevL,{})}),(0,p.jsx)(`span`,{className:`prism-app-brand`,children:`Prism`})]}),e[15]=R):R=e[15];let z;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,p.jsxs)(`div`,{className:`prism-app-hero`,children:[(0,p.jsx)(`h1`,{className:`prism-app-title`,children:`Understand any document`}),(0,p.jsx)(`p`,{className:`prism-app-lede`,children:`Drop a PDF, Word doc, spreadsheet, or text file. Prism maps every claim, finding, and risk — every card cites its exact source.`}),(0,p.jsx)(d,{kind:`upload`})]}),e[16]=z):z=e[16];let B=`prism-dropzone${x?` prism-dropzone--over`:``}`,V;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>T.current?.click(),e[17]=V):V=e[17];let H,U;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{(e.key===`Enter`||e.key===` `)&&T.current?.click()},U=a(m.preload),e[18]=H,e[19]=U):(H=e[18],U=e[19]);let W,G;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,p.jsx)(`input`,{ref:T,type:`file`,accept:re,multiple:!0,className:`prism-dropzone-input`,onChange:e=>void D(e.target.files),"aria-hidden":`true`}),G=(0,p.jsx)(u.upload,{}),e[20]=W,e[21]=G):(W=e[20],G=e[21]);let K=x?`Drop to add`:o.length>0?`Drop more files or click to add`:`Drop files or click to browse`,q;e[22]===K?q=e[23]:(q=(0,p.jsx)(`span`,{className:`prism-dropzone-label`,children:K}),e[22]=K,e[23]=q);let J;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,p.jsx)(`span`,{className:`prism-dropzone-hint`,children:`PDF · Word · Excel · PowerPoint · Image · Text`}),e[24]=J):J=e[24];let Y;e[25]!==B||e[26]!==q?(Y=(0,p.jsxs)(`div`,{className:B,onDrop:M,onDragOver:P,onDragLeave:I,onClick:V,role:`button`,tabIndex:0,"aria-label":`Upload a document`,onKeyDown:H,...U,children:[W,G,q,J]}),e[25]=B,e[26]=q,e[27]=Y):Y=e[27];let X;e[28]===C?X=e[29]:(X=C&&(0,p.jsx)(`p`,{className:`prism-app-error`,role:`alert`,children:C}),e[28]=C,e[29]=X);let Z;e[30]!==A||e[31]!==y||e[32]!==o?(Z=o.length>0&&(0,p.jsxs)(`div`,{className:`prism-staged`,children:[(0,p.jsx)(`p`,{className:`prism-staged-label`,children:o.length===1?`1 document ready`:`${o.length} documents ready`}),(0,p.jsx)(`ul`,{className:`prism-staged-list`,children:o.map(e=>(0,p.jsxs)(`li`,{className:`prism-staged-item`,children:[(0,p.jsx)(u.doc,{}),(0,p.jsx)(`span`,{className:`prism-staged-name`,children:ne({name:e.name,mime:e.type,data:``,size:e.size})}),(0,p.jsx)(`button`,{type:`button`,className:`prism-staged-remove`,onClick:t=>{t.stopPropagation(),de(e.name)},"aria-label":`Remove ${e.name}`,children:(0,p.jsx)(u.x,{})})]},e.name))}),(0,p.jsxs)(`button`,{type:`button`,className:`prism-confirm-btn`,onClick:()=>void A(),disabled:y,...a(m.preload),children:[y?`Preparing documents…`:`Open in Prism`,(0,p.jsx)(u.chevR,{})]})]}),e[30]=A,e[31]=y,e[32]=o,e[33]=Z):Z=e[33];let Q;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,p.jsxs)(`ul`,{className:`prism-app-features`,children:[(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`strong`,{children:`Maps claims spatially`}),` — regions, findings, and risks laid out so you can see the whole shape at once.`]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`strong`,{children:`Every card cites its source`}),` — verbatim quote + page number, always. If Mavéa can't cite it, the card doesn't exist.`]}),(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`strong`,{children:`Ask the whole document`}),` — highlight any claim and ask a follow-up; the answer lights up the exact lines it came from.`]})]}),e[34]=Q):Q=e[34];let $;return e[35]!==Y||e[36]!==X||e[37]!==Z?($=(0,p.jsxs)(`div`,{className:`prism-app`,children:[R,(0,p.jsxs)(`main`,{className:`prism-app-main`,children:[z,Y,X,Z,Q]})]}),e[35]=Y,e[36]=X,e[37]=Z,e[38]=$):$=e[38],$}function v(e){return e.error}function oe(e){return e.attachment?[e.attachment]:[]}function se(){}function ce(e){return e.name}function le(){}function ue(){return c(s())}export{_ as PrismApp};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/kokoro-B-rc224u.js","assets/rolldown-runtime-DkW27tQK.js","assets/index-CKRjGbeR.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/useInView-DsTvv7L_.js","assets/jsx-runtime-DeHZSEgm.js","assets/coreIcons-DDTChE1H.js","assets/preload-helper-CiWYd9n-.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/spokenText-Dy-GZvZV.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a}from"./nextFrame-12y0UrAd.js";import{s as o,t as s,u as c}from"./walkSync-BtO3jsqQ.js";var l=e(),u=t(),d=n(),f=4e3,p={open:`THE CASE`,tension:`TENSION`,verdict:`THE VERDICT`,context:`CONTEXT`,close:`IN CLOSING`};function m(){let e=(0,u.c)(2),[t,n]=(0,l.useState)(h),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,l.useEffect)(r,i),t}function h(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var g=`mavea-brief-audio`;function _(){try{let e=localStorage.getItem(g);return e===`on`||e!==`off`&&null}catch{return null}}function v(e){try{localStorage.setItem(g,e?`on`:`off`)}catch{}}function y({beats:e,onBeat:t,onExit:n,speak:r,cancelSpeak:i,audioDefault:u=!0}){let h=m(),[g,y]=(0,l.useState)(0),[b,x]=(0,l.useState)(!h),[S,C]=(0,l.useState)(()=>u?_()??!0:!1),w=(0,l.useRef)({onBeat:t,speak:r,cancelSpeak:i});w.current={onBeat:t,speak:r,cancelSpeak:i};let T=e[g],E=g>=e.length-1,D=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(T){if(w.current.onBeat(T),!S){D.current=null;return}w.current.cancelSpeak(),D.current=w.current.speak(T.spoken).catch(()=>null)}},[T,S]),(0,l.useEffect)(()=>{if(!b||h||!T||E)return;let t=!1,n=()=>{t||y(t=>Math.min(e.length-1,t+1))};if(!S){let e=setTimeout(n,T.dwellMs);return()=>{t=!0,clearTimeout(e)}}return(async()=>{let e=await a(D.current??Promise.resolve(null),f);t||(e?await c(e,T.dwellMs,s):await o(T.dwellMs),n())})(),()=>{t=!0}},[T,b,h,E,e.length,S]),(0,l.useEffect)(()=>{E&&x(!1)},[E]),(0,l.useEffect)(()=>()=>w.current.cancelSpeak(),[]);let O=(0,l.useCallback)(()=>y(e=>Math.max(0,e-1)),[]),k=(0,l.useCallback)(()=>y(t=>Math.min(e.length-1,t+1)),[e.length]),A=(0,l.useCallback)(()=>{E?(y(0),x(!0)):x(e=>!e)},[E]),j=(0,l.useCallback)(()=>{C(e=>(e&&w.current.cancelSpeak(),v(!e),!e))},[]),M=(0,l.useCallback)(e=>e.stopPropagation(),[]);return T?(0,d.jsxs)(`div`,{className:`prism-brief`,onPointerDown:M,onWheel:M,onClick:M,children:[(0,d.jsxs)(`div`,{className:`prism-brief-caption`,role:`status`,"aria-live":`polite`,children:[(0,d.jsx)(`span`,{className:`prism-brief-eyebrow`,"data-kind":T.kind,children:p[T.kind]}),(0,d.jsx)(`p`,{className:`prism-brief-line`,children:T.caption})]}),(0,d.jsxs)(`div`,{className:`prism-brief-bar`,children:[(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn`,onClick:O,disabled:g===0,"aria-label":`Previous beat`,children:`‹`}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn prism-brief-play`,onClick:A,"aria-label":E?`Replay`:b?`Pause`:`Play`,children:E?`↺`:b?`❙❙`:`▶`}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn`,onClick:k,disabled:E,"aria-label":`Next beat`,children:`›`}),(0,d.jsxs)(`span`,{className:`prism-brief-progress`,"aria-hidden":`true`,children:[g+1,` / `,e.length]}),(0,d.jsx)(`span`,{className:`prism-brief-spacer`}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn prism-brief-audio`+(S?` is-on`:``),onClick:j,"aria-pressed":S,"aria-label":S?`Mute narration`:`Play with audio`,title:S?`Mute narration`:`Play with audio`,children:(0,d.jsx)(`span`,{"aria-hidden":`true`,children:S?`🔊`:`🔇`})}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-exit`,onClick:n,"aria-label":`Exit the briefing`,children:`✕ Exit`})]})]}):(0,d.jsx)(d.Fragment,{})}r();function b({beats:e,onBeat:t,onExit:n,audioDefault:r}){return(0,d.jsx)(y,{beats:e,onBeat:t,onExit:n,audioDefault:r,speak:e=>i(()=>import(`./kokoro-B-rc224u.js`).then(e=>e.a).then(t=>t.speakKokoroLine(e,`mavea`),()=>null),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),cancelSpeak:()=>{i(()=>import(`./kokoro-B-rc224u.js`).then(e=>e.a).then(e=>e.cancelKokoro()),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))}})}export{b as PrismBriefingPlayer};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/kokoro-DcP-u0Tl.js","assets/rolldown-runtime-DkW27tQK.js","assets/index-BMeoXWPR.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/useInView-DsTvv7L_.js","assets/jsx-runtime-DeHZSEgm.js","assets/coreIcons-DDTChE1H.js","assets/preload-helper-CiWYd9n-.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/spokenText-Dy-GZvZV.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a}from"./nextFrame-12y0UrAd.js";import{s as o,t as s,u as c}from"./walkSync-CRhkAQFu.js";var l=e(),u=t(),d=n(),f=4e3,p={open:`THE CASE`,tension:`TENSION`,verdict:`THE VERDICT`,context:`CONTEXT`,close:`IN CLOSING`};function m(){let e=(0,u.c)(2),[t,n]=(0,l.useState)(h),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,l.useEffect)(r,i),t}function h(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var g=`mavea-brief-audio`;function _(){try{let e=localStorage.getItem(g);return e===`on`||e!==`off`&&null}catch{return null}}function v(e){try{localStorage.setItem(g,e?`on`:`off`)}catch{}}function y({beats:e,onBeat:t,onExit:n,speak:r,cancelSpeak:i,audioDefault:u=!0}){let h=m(),[g,y]=(0,l.useState)(0),[b,x]=(0,l.useState)(!h),[S,C]=(0,l.useState)(()=>u?_()??!0:!1),w=(0,l.useRef)({onBeat:t,speak:r,cancelSpeak:i});w.current={onBeat:t,speak:r,cancelSpeak:i};let T=e[g],E=g>=e.length-1,D=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(T){if(w.current.onBeat(T),!S){D.current=null;return}w.current.cancelSpeak(),D.current=w.current.speak(T.spoken).catch(()=>null)}},[T,S]),(0,l.useEffect)(()=>{if(!b||h||!T||E)return;let t=!1,n=()=>{t||y(t=>Math.min(e.length-1,t+1))};if(!S){let e=setTimeout(n,T.dwellMs);return()=>{t=!0,clearTimeout(e)}}return(async()=>{let e=await a(D.current??Promise.resolve(null),f);t||(e?await c(e,T.dwellMs,s):await o(T.dwellMs),n())})(),()=>{t=!0}},[T,b,h,E,e.length,S]),(0,l.useEffect)(()=>{E&&x(!1)},[E]),(0,l.useEffect)(()=>()=>w.current.cancelSpeak(),[]);let O=(0,l.useCallback)(()=>y(e=>Math.max(0,e-1)),[]),k=(0,l.useCallback)(()=>y(t=>Math.min(e.length-1,t+1)),[e.length]),A=(0,l.useCallback)(()=>{E?(y(0),x(!0)):x(e=>!e)},[E]),j=(0,l.useCallback)(()=>{C(e=>(e&&w.current.cancelSpeak(),v(!e),!e))},[]),M=(0,l.useCallback)(e=>e.stopPropagation(),[]);return T?(0,d.jsxs)(`div`,{className:`prism-brief`,onPointerDown:M,onWheel:M,onClick:M,children:[(0,d.jsxs)(`div`,{className:`prism-brief-caption`,role:`status`,"aria-live":`polite`,children:[(0,d.jsx)(`span`,{className:`prism-brief-eyebrow`,"data-kind":T.kind,children:p[T.kind]}),(0,d.jsx)(`p`,{className:`prism-brief-line`,children:T.caption})]}),(0,d.jsxs)(`div`,{className:`prism-brief-bar`,children:[(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn`,onClick:O,disabled:g===0,"aria-label":`Previous beat`,children:`‹`}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn prism-brief-play`,onClick:A,"aria-label":E?`Replay`:b?`Pause`:`Play`,children:E?`↺`:b?`❙❙`:`▶`}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn`,onClick:k,disabled:E,"aria-label":`Next beat`,children:`›`}),(0,d.jsxs)(`span`,{className:`prism-brief-progress`,"aria-hidden":`true`,children:[g+1,` / `,e.length]}),(0,d.jsx)(`span`,{className:`prism-brief-spacer`}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-btn prism-brief-audio`+(S?` is-on`:``),onClick:j,"aria-pressed":S,"aria-label":S?`Mute narration`:`Play with audio`,title:S?`Mute narration`:`Play with audio`,children:(0,d.jsx)(`span`,{"aria-hidden":`true`,children:S?`🔊`:`🔇`})}),(0,d.jsx)(`button`,{type:`button`,className:`prism-brief-exit`,onClick:n,"aria-label":`Exit the briefing`,children:`✕ Exit`})]})]}):(0,d.jsx)(d.Fragment,{})}r();function b({beats:e,onBeat:t,onExit:n,audioDefault:r}){return(0,d.jsx)(y,{beats:e,onBeat:t,onExit:n,audioDefault:r,speak:e=>i(()=>import(`./kokoro-DcP-u0Tl.js`).then(e=>e.a).then(t=>t.speakKokoroLine(e,`mavea`),()=>null),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),cancelSpeak:()=>{i(()=>import(`./kokoro-DcP-u0Tl.js`).then(e=>e.a).then(e=>e.cancelKokoro()),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))}})}export{b as PrismBriefingPlayer};