@mavea/mavea 2.1.0 → 2.1.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.
- package/CHANGELOG.md +13 -0
- package/README.md +1 -7
- package/TERMS.md +9 -3
- package/dist/.vite/manifest.json +337 -337
- package/dist/assets/{AnnotationLayer-Bh1yiSAK.js → AnnotationLayer-0YQgrjN3.js} +1 -1
- package/dist/assets/{AppCommandPalette-DS4sLY_K.js → AppCommandPalette-CeNtZzhG.js} +1 -1
- package/dist/assets/{CheckLogRail-onH7DaxW.js → CheckLogRail-CPKGKw7i.js} +1 -1
- package/dist/assets/{ConversationVideoStudio-adb7legp.js → ConversationVideoStudio-BLU1b2u_.js} +1 -1
- package/dist/assets/{CourseLessonReader-CkzViEij.js → CourseLessonReader-Ci4BguIU.js} +2 -2
- package/dist/assets/{CoursesApp-B0HFM8Al.js → CoursesApp-CErXxpH-.js} +2 -2
- package/dist/assets/{DashPresent-BdOJ7F9D.js → DashPresent-w5oqKZpo.js} +1 -1
- package/dist/assets/{DashboardDetail-Chrpi1Yk.js → DashboardDetail-Dej7CPf7.js} +2 -2
- package/dist/assets/{DashboardLoopGate-B01Hpm7O.js → DashboardLoopGate-DzJol3Os.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-CX63-Gn4.js +1 -0
- package/dist/assets/{DashboardsApp--jjj-GVX.js → DashboardsApp-BQtz_4UA.js} +2 -2
- package/dist/assets/{DeepZoomApp-BpQbKTjc.js → DeepZoomApp-STtNq9C3.js} +1 -1
- package/dist/assets/{DelegatePanel-e4y0CJsn.js → DelegatePanel-C2_s1eW9.js} +1 -1
- package/dist/assets/{DemoGallery-DF1ShRG4.js → DemoGallery-CXoaPF9b.js} +1 -1
- package/dist/assets/{DropSelect-D3Q9Su_x.js → DropSelect-rrPFJVkl.js} +1 -1
- package/dist/assets/{ExportModal-DkmyBpeN.js → ExportModal-BS3He6V7.js} +1 -1
- package/dist/assets/{ExtractionPreview-C6F1q3qG.js → ExtractionPreview-CQ73RXM8.js} +1 -1
- package/dist/assets/{FeatureUseNotice-CCI4mM39.js → FeatureUseNotice-lFcApjaS.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-BkjvGrKT.js → FlagshipCommandPalette-D6gjWvTe.js} +1 -1
- package/dist/assets/{FlagshipShowcase-Dx2noFrP.js → FlagshipShowcase-mZDqHQtE.js} +1 -1
- package/dist/assets/{FlashcardsApp-C1TeLlkY.js → FlashcardsApp-C8gRaBO8.js} +1 -1
- package/dist/assets/{GalleryApp-7oBldBKU.js → GalleryApp-ChsuVZqR.js} +1 -1
- package/dist/assets/{HonestByDesign-DlRrxgrO.js → HonestByDesign-Czur9n6R.js} +1 -1
- package/dist/assets/{HowItWorks-BM2yn2dq.js → HowItWorks-CA9WdZQ6.js} +1 -1
- package/dist/assets/{LegalApp-DPfTD0jz.js → LegalApp-BCnZfHNq.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-DJgwmK1q.js → LegalMarkdownDocument-CNsihJ1F.js} +1 -1
- package/dist/assets/{LegalPageShell-DuIwSVSJ.js → LegalPageShell-8HHhJAPo.js} +1 -1
- package/dist/assets/{LibraryOverlay-DsLhiJzF.js → LibraryOverlay-CGDPmvnX.js} +1 -1
- package/dist/assets/{LiveApp-DNYYimuo.js → LiveApp-CnTYFYf1.js} +4 -4
- package/dist/assets/{LiveSettings-CDHQnEtF.js → LiveSettings-Bx7Uu6Fl.js} +1 -1
- package/dist/assets/{MindMapViewerDrawer-C3BgiubE.js → MindMapViewerDrawer-CBLaSq-i.js} +1 -1
- package/dist/assets/{MindShape-DVlgSR1B.js → MindShape-QuVL_EXi.js} +1 -1
- package/dist/assets/{PinToDashboard-Dd_egidB.js → PinToDashboard-CddhBx85.js} +1 -1
- package/dist/assets/{PlanReview-wOsBpofo.js → PlanReview-DCPDkqLj.js} +1 -1
- package/dist/assets/{PresentationDeck-BSMzp5T9.js → PresentationDeck-DV8AeOrh.js} +1 -1
- package/dist/assets/{PrismApp-DbbDNVpy.js → PrismApp-BHcClSEQ.js} +2 -2
- package/dist/assets/{PrismBriefingPlayer-B1_ziOwl.js → PrismBriefingPlayer-CDkaBWup.js} +2 -2
- package/dist/assets/{PrismOverlay-DLxvsh9l.js → PrismOverlay-DRWAI9Mh.js} +3 -3
- package/dist/assets/{PrismWorkbench-ZlhI7Mhw.js → PrismWorkbench-B2uSg63W.js} +1 -1
- package/dist/assets/{PrivacyApp-Ki_5bM9Z.js → PrivacyApp-CoFgfPwJ.js} +1 -1
- package/dist/assets/{ReplayCard-WKBKeSKc.js → ReplayCard-CLlaKpWg.js} +2 -2
- package/dist/assets/{ReplayOverlay-PFSJv540.js → ReplayOverlay-W3KwhRaQ.js} +1 -1
- package/dist/assets/{RippleApp-DqVyZYKV.js → RippleApp-CEJvJl-c.js} +2 -2
- package/dist/assets/{RippleOverlay-4McJCSV8.js → RippleOverlay-DHnHEYoS.js} +2 -2
- package/dist/assets/{SeeDontRead-gARjJuF7.js → SeeDontRead-tA-fTWQW.js} +1 -1
- package/dist/assets/{ShareModal-C5HVVMtQ.js → ShareModal-Ys5NYDZR.js} +2 -2
- package/dist/assets/{ShipCourse-BUm4TKUk.js → ShipCourse-C3pjBELa.js} +1 -1
- package/dist/assets/{SignatureLoop-CYspJuij.js → SignatureLoop-BNjDbepH.js} +1 -1
- package/dist/assets/{SynthesisApp-BNhF9aJ2.js → SynthesisApp-BCsFms4h.js} +2 -2
- package/dist/assets/{SynthesisOverlay-Bvwdc8uQ.js → SynthesisOverlay-iqXO09rf.js} +1 -1
- package/dist/assets/{TemplatePicker-DBa4lkpf.js → TemplatePicker-PWw_xyWb.js} +1 -1
- package/dist/assets/{TermsApp-BvwDtgIz.js → TermsApp-B1D2SwN7.js} +10 -4
- package/dist/assets/{TopicCanvas-Cwc6-K3q.js → TopicCanvas-xwDjwqxn.js} +2 -2
- package/dist/assets/{TourPrism-CCjys3-x.js → TourPrism-Do4evVOo.js} +1 -1
- package/dist/assets/{TrackerTile-B4j5qtop.js → TrackerTile-Dp7fvG4P.js} +2 -2
- package/dist/assets/{TwoSurfaces-fGm1MJrD.js → TwoSurfaces-CZA6zuue.js} +1 -1
- package/dist/assets/{WorldOverlay-JOp1rLyU.js → WorldOverlay-EwAFBDvq.js} +1 -1
- package/dist/assets/{WowFeatures-D5dJvp9W.js → WowFeatures-DRKs2UGb.js} +1 -1
- package/dist/assets/{ZoomDeck-DYmkT0TA.js → ZoomDeck-qJqKFxkc.js} +1 -1
- package/dist/assets/{audioTrack-BJ2D_nuy.js → audioTrack-myyVq6Sp.js} +1 -1
- package/dist/assets/canvas-OSBUSYbY.js +1 -0
- package/dist/assets/{capture-Y6Qm8zCN.js → capture-MMxmbgt1.js} +1 -1
- package/dist/assets/{confirmAdd-D-TTCQ31.js → confirmAdd-VLwpBNf_.js} +1 -1
- package/dist/assets/{dashboardEvents-MzCzak6K.js → dashboardEvents-CiE91_oj.js} +1 -1
- package/dist/assets/{effort-BftNJCCV.js → effort-CQY4uJMS.js} +1 -1
- package/dist/assets/{generateBeats-Dqtfd8HC.js → generateBeats-Ci99Isyk.js} +1 -1
- package/dist/assets/{generateLive-B7nlaqz8.js → generateLive-DzBVo6Yg.js} +1 -1
- package/dist/assets/{index-Db-FgYxX.js → index-yJfYsjAB.js} +3 -3
- package/dist/assets/{kokoro-yB7iU_JU.js → kokoro-DogSQaQB.js} +1 -1
- package/dist/assets/{loader-Ciz6XbG-.js → loader-BPVv7hEn.js} +2 -2
- package/dist/assets/{notes-CEloxKQ3.js → notes-C-RNIoXo.js} +1 -1
- package/dist/assets/{perfProbe-DrOeB7yd.js → perfProbe-q5Gt55We.js} +1 -1
- package/dist/assets/{pin-C5_s4Ju5.js → pin-BReqt-Wx.js} +1 -1
- package/dist/assets/{portal-TqJbr2rR.js → portal-XWyi6FIz.js} +1 -1
- package/dist/assets/{prewarm-Bt5X_9CM.js → prewarm-DOqg5zPk.js} +1 -1
- package/dist/assets/{quietHours-LtXDl4-v.js → quietHours-kEvnJP2S.js} +1 -1
- package/dist/assets/{registry-BHDUu15I.js → registry-B7zPuTCI.js} +1 -1
- package/dist/assets/{registry-CfIJ9dJS.js → registry-BB0UFcJi.js} +1 -1
- package/dist/assets/{registry-BwlvYVHq.js → registry-BvtWVDCw.js} +1 -1
- package/dist/assets/{registry-BPLbZIVz.js → registry-CQ0bMOV_.js} +1 -1
- package/dist/assets/{registry-BxkAuBx8.js → registry-CnDAxBcl.js} +1 -1
- package/dist/assets/{registry-B_wlsfxh.js → registry-DTNUXJuV.js} +1 -1
- package/dist/assets/{relate-CCma73G9.js → relate-CsRMEWBw.js} +1 -1
- package/dist/assets/{replay-dMDmsTaD.js → replay-BlrkSDMO.js} +1 -1
- package/dist/assets/{useDashboardLoop-Cnxmf7wU.js → useDashboardLoop-CA3LNVME.js} +1 -1
- package/dist/assets/{walkSync-D6leFb_u.js → walkSync-BfK0U5vB.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/legal/TERMS.md +9 -3
- package/package.json +1 -1
- package/dist/assets/DashboardLoopRuntime-BcdZtIgH.js +0 -1
- package/dist/assets/canvas-CYrbzF43.js +0 -1
- package/docs/media/go-hub.jpg +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{ot as n}from"./index-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{ot as n}from"./index-yJfYsjAB.js";import{r}from"./info-CiqHR5cs.js";var i=e(),a=t(),o=[`No sign-up`,`No install`,`Key-free tour`,`Keys session-only`];function s(e){let t=(0,i.c)(16),{onEnterLive:s}=e,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,a.jsxs)(n,{eyebrow:`Yours in seconds`,children:[`No account. `,(0,a.jsx)(`em`,{children:`Your engine.`})]}),t[0]=u):u=t[0];let d,f,p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,a.jsx)(`div`,{className:`fl-surface-tag insight`,children:`Instant · no sign-up`}),f=(0,a.jsx)(`div`,{className:`fl-surface-title`,children:`Nothing to sign up for`}),p=(0,a.jsx)(`p`,{className:`fl-surface-body`,children:`No account, no waitlist, no install. The tour and demos run key-free; Live starts the moment you paste a key.`}),t[1]=d,t[2]=f,t[3]=p):(d=t[1],f=t[2],p=t[3]);let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,a.jsx)(`div`,{className:`fl-surface-chips`,children:o.map(l)}),t[4]=m):m=t[4];let h;t[5]===s?h=t[6]:(h=(0,a.jsxs)(`div`,{className:`fl-surface`,children:[d,f,p,m,(0,a.jsx)(`button`,{type:`button`,className:`fl-ghost-btn`,onClick:()=>s(),children:`Open Mavéa →`})]}),t[5]=s,t[6]=h);let g,_,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,a.jsx)(`div`,{className:`fl-surface-tag live`,children:`Live · your model`}),_=(0,a.jsx)(`div`,{className:`fl-surface-title`,children:`Bring your own keys`}),v=(0,a.jsx)(`p`,{className:`fl-surface-body`,children:`Anthropic, OpenAI, Gemini, Grok, OpenRouter. Same beautiful canvas, your engine.`}),t[7]=g,t[8]=_,t[9]=v):(g=t[7],_=t[8],v=t[9]);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,a.jsx)(`div`,{className:`fl-surface-chips`,children:r.map(c)}),t[10]=y):y=t[10];let b;t[11]===s?b=t[12]:(b=(0,a.jsxs)(`div`,{className:`fl-surface live`,children:[g,_,v,y,(0,a.jsx)(`button`,{type:`button`,className:`fl-ghost-btn live`,onClick:()=>s(),children:`Open Live →`})]}),t[11]=s,t[12]=b);let x;return t[13]!==b||t[14]!==h?(x=(0,a.jsxs)(a.Fragment,{children:[u,(0,a.jsxs)(`div`,{className:`fl-surfaces`,children:[h,b]})]}),t[13]=b,t[14]=h,t[15]=x):x=t[15],x}function c(e){return(0,a.jsx)(`span`,{className:`fl-surface-chip fl-model-chip`,children:e.label},e.id)}function l(e){return(0,a.jsx)(`span`,{className:`fl-surface-chip`,children:e},e)}export{s as TwoSurfaces};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lens-DyGK7Owa.js","assets/display-CAb_PiGv.js","assets/facts-BUGuVUIc.js","assets/types-DuEbJpIA.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{i as a,n as o,t as s}from"./loader-Ciz6XbG-.js";import{t as c}from"./useFocusTrap-CJmpNZv2.js";import{r as l,t as u}from"./useSpatialCanvas-CfmZOXXP.js";import{i as d}from"./format-q0LwBjID.js";import{i as f,n as p}from"./openWorld-B4VY6xO7.js";import{a as m,i as h,n as g,t as _}from"./display-CAb_PiGv.js";import{t as v}from"./sentenceCase-CLDiNB0f.js";import{r as y,t as b}from"./sourceHost-BV3t2XDb.js";import{r as x}from"./stepDriver-DwjFet6U.js";import{a as S,i as C,s as w}from"./spokenText-Dy-GZvZV.js";import{d as T,l as E,s as D,u as O}from"./walkSync-D6leFb_u.js";import{n as k}from"./emphasize-BqCIst-B.js";import{c as A,s as j,t as M}from"./validate-MQG0EcTD.js";import{n as N,s as P}from"./receipts-D7zveV-I.js";import{n as F,r as I}from"./value-Dx7DZob4.js";import{t as L}from"./types-DuEbJpIA.js";import{a as R,c as z,d as B,f as V,i as H,l as U,n as W,o as G,r as ee,s as K,t as te,u as ne}from"./offers-eBNj_lSP.js";import{n as re,t as ie}from"./engine-BiM6INsW.js";var q=e(),J=t(),Y=n();function ae(e){return e.kind}var oe=.33,se=.1,ce=.005;function le(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return`would barely change`;let n=Math.abs(e)>1e-9?Math.abs(e):1,r=(t-e)/n,i=Math.abs(r);if(i<=ce)return`would barely change`;let a=r>0?`rise`:`fall`;return i>=oe?`would ${a} meaningfully`:i>=se?`would ${a} somewhat`:`would ${a} slightly`}var ue=.6;function de(e){if(!Number.isFinite(e))return null;let t=e-1,n=Math.abs(t);if(n<=.005)return null;let r=t>0?`stronger`:`weaker`;return n>=ue?`much ${r}`:n>=oe?r:`slightly ${r}`}var fe=440,pe=2,me=1.25,he=320;function ge(e){if(!(e===void 0||!Number.isFinite(e))){if(e<.995)return`weaker`;if(e>1.005)return`stronger`}}var _e=[{id:`mv-arrow`,cls:`mv-marker-up`,refX:9,size:13,shape:(0,Y.jsx)(`path`,{d:`M0.5 1 L9.5 5 L0.5 9 Z`})},{id:`mv-arrow-damp`,cls:`mv-marker-down`,refX:8,size:17,shape:(0,Y.jsx)(`path`,{d:`M8 0.6 L8 9.4`})},{id:`mv-arrow-open`,cls:`mv-marker-open`,refX:9,size:13,shape:(0,Y.jsx)(`path`,{d:`M1 1.4 L9 5 L1 8.6 Z`})},{id:`mv-arrow-ring`,cls:`mv-marker-ring`,refX:7.4,size:13,shape:(0,Y.jsx)(`circle`,{cx:`5`,cy:`5`,r:`3`})},{id:`mv-dot`,cls:`mv-marker-dot`,refX:5,size:9,shape:(0,Y.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2.6`})}];function ve(){let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`defs`,{children:_e.flatMap(ye)}),e[0]=t):t=e[0],t}function ye(e){return[!1,!0].map(t=>(0,Y.jsx)(`marker`,{id:t?`${e.id}-soft`:e.id,className:`mv-marker ${e.cls}${t?` mv-marker-soft`:``}`,viewBox:`0 0 10 10`,refX:e.refX,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:e.size,markerHeight:e.size,orient:`auto`,children:e.shape},t?`${e.id}-soft`:e.id))}function be(e,t){let n=(0,J.c)(5),r;n[0]===e.current?r=n[1]:(r=()=>{let t=e.current;if(!t||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)return;let n=t.querySelectorAll(`[data-draw]:not(.m-draw-path):not([data-drawn])`),r=Array.from(n,Se);n.forEach((e,t)=>{let n=r[t];n!==null&&(e.style.setProperty(`--path-len`,`${n}px`),e.style.setProperty(`--delay`,`${fe}ms`),e.classList.add(`m-draw-path`))});let i=xe;return t.addEventListener(`animationend`,i),()=>t.removeEventListener(`animationend`,i)},n[0]=e.current,n[1]=r);let i;n[2]!==t||n[3]!==e?(i=[e,t],n[2]=t,n[3]=e,n[4]=i):i=n[4],(0,q.useEffect)(r,i)}function xe(e){if(e.animationName!==`mavea-draw`)return;let t=e.target;t.classList.remove(`m-draw-path`),t.style.removeProperty(`--path-len`),t.style.removeProperty(`--delay`),t.dataset.drawn=``}function Se(e){return typeof e.getTotalLength==`function`?e.getTotalLength():null}function Ce(e){let t=(0,J.c)(33),{chrome:n,bbox:r,exiting:i,onSettle:a}=e,o=(0,q.useRef)(null);be(o,n.paths);let s=i?``:void 0,c=i?!0:void 0,l=r.w,u=r.h,d=`${r.x} ${r.y} ${r.w} ${r.h}`,f;t[0]===n.bands?f=t[1]:(f=n.bands.map(Te),t[0]=n.bands,t[1]=f);let p;t[2]===n.paths?p=t[3]:(p=n.paths.map(we),t[2]=n.paths,t[3]=p);let m;t[4]!==r.h||t[5]!==r.w||t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,Y.jsxs)(`svg`,{ref:o,className:`mv-chrome-svg`,width:l,height:u,viewBox:d,"aria-hidden":`true`,children:[f,p]}),t[4]=r.h,t[5]=r.w,t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;if(t[10]!==r.x||t[11]!==r.y||t[12]!==n.bands){let e;t[14]!==r.x||t[15]!==r.y?(e=e=>e.label===void 0?null:(0,Y.jsx)(`div`,{className:`mv-shelf-label`,style:{left:e.x-r.x+12,top:e.y-r.y+12},children:e.label},`${e.id}:label`),t[14]=r.x,t[15]=r.y,t[16]=e):e=t[16],h=n.bands.map(e),t[10]=r.x,t[11]=r.y,t[12]=n.bands,t[13]=h}else h=t[13];let g;if(t[17]!==r.x||t[18]!==r.y||t[19]!==n.labels){let e;t[21]!==r.x||t[22]!==r.y?(e=e=>(0,Y.jsx)(`div`,{className:`mv-chrome-label ${e.className}`,"data-anchor":e.anchor??`start`,style:{left:e.x-r.x,top:e.y-r.y},children:e.text},e.id),t[21]=r.x,t[22]=r.y,t[23]=e):e=t[23],g=n.labels.map(e),t[17]=r.x,t[18]=r.y,t[19]=n.labels,t[20]=g}else g=t[20];let _;t[24]!==g||t[25]!==h?(_=(0,Y.jsxs)(`div`,{className:`mv-chrome-labels`,children:[h,g]}),t[24]=g,t[25]=h,t[26]=_):_=t[26];let v;return t[27]!==a||t[28]!==s||t[29]!==_||t[30]!==c||t[31]!==m?(v=(0,Y.jsxs)(`div`,{className:`mv-chrome`,"data-exiting":s,onTransitionEnd:a,"aria-hidden":c,children:[m,_]}),t[27]=a,t[28]=s,t[29]=_,t[30]=c,t[31]=m,t[32]=v):v=t[32],v}function we(e){return(0,Y.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":e.draw?``:void 0},e.id)}function Te(e){return(0,Y.jsx)(`rect`,{className:`mv-band ${e.className}`,x:e.x,y:e.y,width:e.w,height:e.h,rx:12},e.id)}function Ee(e){if(e instanceof Element)return e.closest(`.mv-node`)?.dataset.id}var De=60;function Oe(e){return[...e.positions.entries()].filter(([,e])=>e.folded!==!0).sort(([e,t],[n,r])=>{let i=Number(t.shelved===!0)-Number(r.shelved===!0);if(i!==0)return i;let a=Math.round(t.y/De)-Math.round(r.y/De);return a===0?t.x-r.x||e.localeCompare(n):a}).map(([e])=>e)}var ke=(0,q.memo)(function(e){let t=(0,J.c)(65),{nodes:n,edges:r,layout:i,exiting:a,settleExit:o,activate:s,lod:c,renderFace:l,onNodeClick:u,onEdgeClick:d,selectedId:f,litEdgeId:p}=e,m=(0,q.useRef)(null);be(m,i.edgePaths);let h;t[0]===i?h=t[1]:(h=Oe(i),t[0]=i,t[1]=h);let g=h,[_,v]=(0,q.useState)(null),y;t[2]!==_||t[3]!==g?(y=_!==null&&g.includes(_)?_:g[0]??null,t[2]=_,t[3]=g,t[4]=y):y=t[4];let b=y,x;t[5]!==g||t[6]!==b?(x=e=>{if(g.length===0)return;let t=b===null?0:g.indexOf(b),n=e===`first`?0:e===`last`?g.length-1:Math.min(g.length-1,Math.max(0,t+e)),r=g[n];v(r),document.querySelector(`.mv-node[data-id="${CSS.escape(r)}"]`)?.focus()},t[5]=g,t[6]=b,t[7]=x):x=t[7];let S=x,C;if(t[8]!==r){C=new Map;for(let e of r)e.label!==void 0&&C.set(e.id,e.label);t[8]=r,t[9]=C}else C=t[9];let w=C,{bbox:T}=i,E;if(t[10]!==r||t[11]!==n){let e=new Map(n.map(je));E=new Map;for(let t of r){let n=e.get(t.from);n!==void 0&&Number.isFinite(n)&&E.set(t.id,n)}t[10]=r,t[11]=n,t[12]=E}else E=t[12];let D=E,O;t[13]!==a||t[14]!==o?(O=a&&(0,Y.jsx)(Ce,{chrome:a.layout.chrome,bbox:a.layout.bbox,exiting:!0,onSettle:()=>o(a.token)},a.token),t[13]=a,t[14]=o,t[15]=O):O=t[15];let k;t[16]!==T||t[17]!==i.chrome||t[18]!==i.rep?(k=(0,Y.jsx)(Ce,{chrome:i.chrome,bbox:T},i.rep),t[16]=T,t[17]=i.chrome,t[18]=i.rep,t[19]=k):k=t[19];let A=T.w,j=T.h,M=`${T.x} ${T.y} ${T.w} ${T.h}`,N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Y.jsx)(ve,{}),t[20]=N):N=t[20];let P;if(t[21]!==w||t[22]!==D||t[23]!==i.edgePaths||t[24]!==p||t[25]!==d){let e;t[27]!==w||t[28]!==D||t[29]!==p||t[30]!==d?(e=e=>(0,Y.jsxs)(`g`,{className:`mv-edge-g`,"data-lit":p===e.id?``:void 0,"data-shift":ge(D.get(e.id)),style:D.has(e.id)?{"--mv-shift":D.get(e.id)}:void 0,onClick:d?()=>d(e.id):void 0,children:[w.has(e.id)&&(0,Y.jsx)(`title`,{children:w.get(e.id)}),d&&(0,Y.jsx)(`path`,{className:`mv-edge-hit`,d:e.d,fill:`none`}),(0,Y.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":``,style:e.width===void 0?void 0:{"--mv-edge-w":e.width}})]},e.id),t[27]=w,t[28]=D,t[29]=p,t[30]=d,t[31]=e):e=t[31],P=i.edgePaths.map(e),t[21]=w,t[22]=D,t[23]=i.edgePaths,t[24]=p,t[25]=d,t[26]=P}else P=t[26];let F;t[32]!==T.h||t[33]!==T.w||t[34]!==P||t[35]!==M?(F=(0,Y.jsxs)(`svg`,{ref:m,className:`mv-edges`,width:A,height:j,viewBox:M,"aria-hidden":`true`,children:[N,P]}),t[32]=T.h,t[33]=T.w,t[34]=P,t[35]=M,t[36]=F):F=t[36];let I;if(t[37]!==s||t[38]!==T.x||t[39]!==T.y||t[40]!==i.positions||t[41]!==c||t[42]!==S||t[43]!==n||t[44]!==u||t[45]!==l||t[46]!==b||t[47]!==f){let e;t[49]!==s||t[50]!==T.x||t[51]!==T.y||t[52]!==i.positions||t[53]!==c||t[54]!==S||t[55]!==u||t[56]!==l||t[57]!==b||t[58]!==f?(e=(e,t)=>{let n=i.positions.get(e.id);if(!n)return null;let r={"--nx":`${n.x+n.w/2-T.x}px`,"--ny":`${n.y+n.h/2-T.y}px`,"--mv-i":e.depth??t,...e.shift===void 0?{}:{"--mv-shift":e.shift}},a=u!==void 0&&!n.folded,o=n.folded?void 0:l,d=l?.(e,`entry`);return(0,Y.jsxs)(`div`,{className:`mv-node`,"data-id":e.id,"data-role":e.role,"data-tier":e.tier,"data-domain":e.domain,"data-series":e.series?.length?``:void 0,"data-face":n.face,"data-shelved":n.shelved?``:void 0,"data-folded":n.folded?``:void 0,"data-shift":ge(e.shift),"data-selected":f===e.id?``:void 0,"data-lod":c,style:r,"aria-hidden":n.folded?!0:void 0,role:a?`button`:void 0,tabIndex:a?e.id===b?0:-1:void 0,onFocus:a?()=>v(e.id):void 0,onClick:a?()=>s(e):void 0,onKeyDown:a?t=>{if(t.key===`Enter`||t.key===` `){t.preventDefault(),u?.(e);return}let n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:`first`,End:`last`}[t.key];n!==void 0&&(t.preventDefault(),S(n))}:void 0,children:[(0,Y.jsxs)(`div`,{className:`mv-face mv-face-card`,"aria-hidden":n.face!==`card`||void 0,children:[(0,Y.jsx)(`span`,{className:`mv-label`,children:e.label}),(0,Y.jsxs)(`span`,{className:`mv-card-foot`,children:[e.domain!==void 0&&(0,Y.jsx)(`span`,{className:`mv-domain`,title:e.domain,"aria-label":e.domain}),e.value!==void 0&&(0,Y.jsxs)(`span`,{className:`mv-value`,children:[e.value.toLocaleString(),e.unit??``]}),o?.(e,`card`),e.tier!==void 0&&(0,Y.jsx)(`span`,{className:`mv-tier`,children:e.tier})]})]}),(0,Y.jsx)(`div`,{className:`mv-face mv-face-entry`,"aria-hidden":n.face!==`entry`||void 0,children:(0,Y.jsxs)(`span`,{className:`mv-label`,children:[d,d?` `:null,e.label]})}),(0,Y.jsx)(`div`,{className:`mv-face mv-face-mark`,"aria-hidden":n.face!==`mark`||void 0,children:o?.(e,`mark`)})]},e.id)},t[49]=s,t[50]=T.x,t[51]=T.y,t[52]=i.positions,t[53]=c,t[54]=S,t[55]=u,t[56]=l,t[57]=b,t[58]=f,t[59]=e):e=t[59],I=n.map(e),t[37]=s,t[38]=T.x,t[39]=T.y,t[40]=i.positions,t[41]=c,t[42]=S,t[43]=n,t[44]=u,t[45]=l,t[46]=b,t[47]=f,t[48]=I}else I=t[48];let L;return t[60]!==F||t[61]!==I||t[62]!==O||t[63]!==k?(L=(0,Y.jsxs)(Y.Fragment,{children:[O,k,F,I]}),t[60]=F,t[61]=I,t[62]=O,t[63]=k,t[64]=L):L=t[64],L});function Ae({stage:e,world:t,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o}){let{cam:s,layout:c,exiting:l,lod:u,settleExit:d,morphing:f,settle:p}=e,{viewportRef:m,zoomAtClient:h,pan:g}=s,[_,v]=(0,q.useState)(!1),y=(0,q.useRef)(new Map),b=(0,q.useRef)(0),x=(0,q.useRef)(!1),S=(0,q.useRef)(!1),C=(0,q.useRef)(!1),w=(0,q.useRef)({x:0,y:0}),T=(0,q.useCallback)((t,n,r,i)=>{if(x.current){h(t,n,r);return}e.pinch(t,n,r,i)!==`zoom`&&(x.current=!0)},[e,h]),E=(0,q.useRef)(T);E.current=T,(0,q.useEffect)(()=>{let e=m.current;if(!e)return;let t,n=e=>{if(e.preventDefault(),p(),e.ctrlKey){E.current(Math.exp(-e.deltaY/100),e.clientX,e.clientY,Ee(e.target)),clearTimeout(t),t=setTimeout(()=>{x.current=!1},he);return}h(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{clearTimeout(t),e.removeEventListener(`wheel`,n)}},[m,h,p]);let D=()=>{let[e,t]=[...y.current.values()];return{x:(e.x+t.x)/2,y:(e.y+t.y)/2,d:Math.hypot(e.x-t.x,e.y-t.y)}},O=(0,q.useCallback)(e=>{if(p(),y.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),y.current.size>=2){e.currentTarget.setPointerCapture(e.pointerId),S.current=!1,v(!1),b.current=0;return}S.current=!0,C.current=!1,v(!0),w.current={x:e.clientX,y:e.clientY}},[p]),k=(0,q.useRef)({dx:0,dy:0}),A=(0,q.useRef)(0),j=(0,q.useCallback)(()=>{A.current!==0&&(cancelAnimationFrame(A.current),A.current=0);let{dx:e,dy:t}=k.current;(e!==0||t!==0)&&(k.current={dx:0,dy:0},g(e,t))},[g]),M=(0,q.useCallback)((e,t)=>{k.current.dx+=e,k.current.dy+=t,A.current===0&&(A.current=requestAnimationFrame(()=>{A.current=0;let e=k.current;k.current={dx:0,dy:0},(e.dx!==0||e.dy!==0)&&g(e.dx,e.dy)}))},[g]);(0,q.useEffect)(()=>()=>cancelAnimationFrame(A.current),[]);let N=(0,q.useCallback)(e=>{let t=y.current;if(!t.has(e.pointerId))return;if(t.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.size>=2){let{x:t,y:n,d:r}=D();if(b.current===0){b.current=r;return}let i=r/b.current;(i>me||i<1/me)&&(b.current=r,E.current(i,t,n,Ee(e.target)));return}if(!S.current)return;let n=e.clientX-w.current.x,r=e.clientY-w.current.y;Math.abs(n)+Math.abs(r)>pe&&!C.current&&(C.current=!0,e.currentTarget.setPointerCapture(e.pointerId)),w.current={x:e.clientX,y:e.clientY},M(n,r)},[M]),P=(0,q.useCallback)(e=>{j(),y.current.delete(e.pointerId),y.current.size<2&&(b.current=0,x.current=!1),y.current.size===0&&(S.current=!1,v(!1)),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},[j]),F=(0,q.useCallback)(e=>{C.current||r?.(e)},[r]),I=(0,q.useCallback)(e=>{e.propertyName===`transform`&&p()},[p]),{bbox:L}=c,R={transform:s.transform,width:L.w,height:L.h,"--mv-cam-scale":s.camera.scale};return(0,Y.jsx)(`div`,{className:`mv-viewport`,ref:m,"data-panning":_?`true`:void 0,style:{"--mv-cam-scale":s.camera.scale},onPointerDown:O,onPointerMove:N,onPointerUp:P,onPointerCancel:P,children:(0,Y.jsx)(`div`,{className:`mv-world`,style:R,"data-morphing":f?``:void 0,onTransitionEnd:I,children:(0,Y.jsx)(ke,{nodes:t.nodes,edges:t.edges,layout:c,exiting:l,settleExit:d,activate:F,lod:u,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o})})})}function je(e){return[e.id,e.shift]}function Me(e,t){return e===`in`?`zoom-camera`:t?`ascend`:`zoom-camera`}var Ne={graph:{chip:`Graph`,caption:`What caused what`,legend:`Left to right is what led to what. Colour is the direction of the push; thickness is how much of the outcome the link explains.`},flow:{chip:`Contribution`,caption:`How much each one contributed`,legend:`Ribbon thickness is how much of the outcome that link was MEASURED to explain. A cause whose links carry no measured share is held aside rather than drawn thin, which would read as a finding nobody made.`},timeline:{chip:`Over time`,caption:`The same causes, in time`,legend:`Left to right is WHEN, read against the axis below; a bar is how long a cause lasted. Height only keeps entries from overlapping — it means nothing.`},spheres:{chip:`Spheres`,caption:`What kinds of force`,legend:`Each lane is a sphere the causes belong to. A link that CHANGES lane is a handoff between kinds of force and is drawn at full weight; one that stays inside a lane goes faint. A cause the answer put in no single sphere is held aside rather than filed under one it does not belong to.`},chart:{chip:`As a chart`,caption:`How much each one moved`,legend:`Each mark is a cause plotted against its own measured history. Causes with nothing measured are held aside rather than drawn at zero.`}},Pe={min:ne,max:2.2},Fe=56,Ie=1300,Le=1300,X=.7,Re=120,ze=120,Be={graph:K,timeline:R,chart:U,flow:z,spheres:G},Ve=e=>({x:0,y:0,w:e.w,h:e.h}),He=(e,t,n)=>[t-e.x,n-e.y];function Ue(e,t,n){let r=e.positions.get(t);if(!r)return null;let i=r.x,a=r.y,o=r.x+r.w,s=r.y+r.h;for(let r of n.get(t)??[]){let t=e.positions.get(r);!t||t.folded||(i=Math.min(i,t.x),a=Math.min(a,t.y),o=Math.max(o,t.x+t.w),s=Math.max(s,t.y+t.h))}let[c,l]=He(e.bbox,i-Re,a-Re);return{x:c,y:l,w:o-i+240,h:s-a+240}}function We(e){let{world:t,onAscend:n,driverId:r,insetBottom:i}=e,[a,o]=(0,q.useState)(e.initialRep??`graph`),[s,c]=(0,q.useState)(()=>new Set),[d,f]=(0,q.useState)(null),p=u({clamp:Pe,margin:Fe,...i===void 0?{}:{insetBottom:i}}),m=(0,q.useRef)(void 0),{viewport:h}=p,g=(0,q.useMemo)(()=>h?{w:Math.max(1,h.w-112),h:Math.max(1,h.h-112)}:void 0,[h]),_=(0,q.useMemo)(()=>Be[a](t,{expandedIds:s,previous:m.current,...g?{viewport:g}:{}}),[a,t,s,g]);(0,q.useEffect)(()=>{let e=new Map;for(let[t,n]of _.positions)e.set(t,{x:n.x,y:n.y});m.current=e},[_]);let v=(0,q.useRef)(a);v.current=a;let y=(0,q.useRef)(_);y.current=_;let b=(0,q.useRef)(p.camera);b.current=p.camera;let S=(0,q.useRef)(s);S.current=s;let C=(0,q.useRef)(n);C.current=n;let[w,T]=(0,q.useState)(null),{endFlight:E}=p,D=(0,q.useCallback)(()=>{T({layout:y.current,rep:v.current,expandedIds:S.current}),E()},[E]),O=(0,q.useRef)(0),k=(0,q.useRef)(void 0);(0,q.useEffect)(()=>()=>clearTimeout(k.current),[]);let A=(0,q.useCallback)(e=>{if(e===v.current)return;let t=++O.current;f({layout:y.current,token:t}),clearTimeout(k.current),k.current=setTimeout(()=>{t===O.current&&f(null)},Ie),v.current=e,o(e)},[]),j=(0,q.useCallback)(e=>{e===O.current&&(clearTimeout(k.current),f(null))},[]),M=(0,q.useRef)(null),N=(0,q.useCallback)(e=>{let t=new Set(S.current);t.delete(e)||(t.add(e),U.current(e)&&(M.current=e)),c(t)},[]),P=(0,q.useMemo)(()=>{let e=new Map;for(let n of t.nodes){if(n.parentId===void 0)continue;let t=e.get(n.parentId);t?t.push(n.id):e.set(n.parentId,[n.id])}return e},[t]),{fitTo:F,setCamera:I,viewportRef:L}=p;(0,q.useEffect)(()=>{let e=M.current;if(M.current=null,e!==null){let t=Ue(_,e,P);if(t){F(t);return}}F(Ve(_.bbox))},[_,P,F,I,L]);let R=(0,q.useMemo)(()=>new Map(t.nodes.map(e=>[e.id,e.parentId])),[t]),z=(0,q.useMemo)(()=>{let e=new Set;for(let t of R.values())t!==void 0&&e.add(t);return e},[R]),B=(0,q.useCallback)(e=>{let t=0,n=e,r=new Set;for(;n!==void 0&&!r.has(n);)r.add(n),n=R.get(n),n!==void 0&&(t+=1);return t},[R]),V=a===`graph`,H=(0,q.useCallback)(e=>{if(!V)return!1;let t=_.positions.get(e);return t===void 0||t.folded===!0||t.shelved===!0?!1:B(e)+1<=2},[V,_,B]),U=(0,q.useRef)(H);U.current=H;let{zoomAtClient:W}=p,G=(0,q.useCallback)((e,t,n,r)=>{if(e>=1)return r!==void 0&&z.has(r)&&!S.current.has(r)&&U.current(r)?(N(r),`expand`):(W(e,t,n),`zoom`);let i=L.current?.getBoundingClientRect();if(Me(`out`,!!i&&(i.width>0||i.height>0)&&l(b.current,Ve(y.current.bbox),{w:i.width,h:i.height},Fe,Pe))===`zoom-camera`)return W(e,t,n),`zoom`;let a=[...S.current];if(a.length>0){let e=a[0],t=B(e);for(let n of a){let r=B(n);r>t&&(e=n,t=r)}return N(e),`collapse`}return C.current?.(),`ascend`},[z,N,W,L,B]),ee=(0,q.useCallback)(e=>{let t=y.current,n=e===null?void 0:t.positions.get(e);if(!n||n.folded){F(Ve(t.bbox));return}let[r,i]=He(t.bbox,n.x-ze,n.y-ze);F({x:r,y:i,w:n.w+240,h:n.h+240})},[F]);(0,q.useEffect)(()=>{if(r!==void 0)return x(r,{count:te.length,setIndex:e=>A(te[Math.min(te.length-1,Math.max(0,Math.trunc(e)))]),spokenFor:()=>void 0,captionFor:e=>{let t=te[e];return t?Ne[t].caption:void 0}})},[r,A]);let K=w?.layout!==_||p.flying;return(0,q.useEffect)(()=>{if(!K)return;let e=setTimeout(D,Le);return()=>clearTimeout(e)},[K,_,D]),{rep:a,setRep:A,layout:_,exiting:d,settleExit:j,expandedIds:s,toggleExpand:N,expandable:z,unfoldsOnStage:H,cam:p,morphing:K,settle:D,lod:p.camera.scale>=X?`near`:`far`,pinch:G,focusNode:ee}}function Ge({label:e,min:t,max:n,step:r=1,value:i,onChange:a,format:o,color:s=`var(--presence)`}){let c=n-t||1,l=(i-t)/c*100;return(0,Y.jsxs)(`label`,{className:`viz-ctl`,style:{"--ctl-c":s,"--ctl-pct":l+`%`},children:[(0,Y.jsx)(`span`,{className:`viz-ctl-label`,children:e}),(0,Y.jsx)(`input`,{type:`range`,className:`viz-ctl-range`,min:t,max:n,step:r,value:i,"aria-label":e,onChange:e=>a(Number(e.target.value))}),(0,Y.jsx)(`span`,{className:`viz-ctl-val tab-num`,children:o?o(i):i.toLocaleString()})]})}var Ke=`No cause is established yet, so there is nothing to push on.`;function qe(e){let t=(0,J.c)(17),{levers:n,onSet:r,onReset:i}=e,a;t[0]===n?a=t[1]:(a=n.every(Je),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`WHAT IF`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==o?(c=(0,Y.jsxs)(`div`,{className:`tr-levers-head`,children:[s,(0,Y.jsx)(`button`,{type:`button`,className:`tr-reset`,onClick:i,disabled:o,children:`Reset`})]}),t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n.length?l=t[7]:(l=n.length===0&&(0,Y.jsx)(`p`,{className:`tr-levers-empty`,children:Ke}),t[6]=n.length,t[7]=l);let u;if(t[8]!==n||t[9]!==r){let e;t[11]===r?e=t[12]:(e=e=>(0,Y.jsx)(Ge,{label:e.label,min:0,max:100,value:e.pct,onChange:t=>r(e.id,t),format:Z},e.id),t[11]=r,t[12]=e),u=n.map(e),t[8]=n,t[9]=r,t[10]=u}else u=t[10];let d;return t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Y.jsxs)(`div`,{className:`tr-levers`,children:[c,l,u]}),t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function Z(e){return`${e}%`}function Je(e){return e.pct===100}var Ye=(0,q.memo)(qe),Xe=(0,q.createContext)(null);function Ze(){return(0,q.useContext)(Xe)}function Qe(e){let t=(0,J.c)(19),{id:n,className:r}=e,i=Ze(),a,o,s,c,l,u;if(t[0]!==r||t[1]!==n||t[2]!==i){u=Symbol.for(`react.early_return_sentinel`);bb0:{let e=i?.registry.values.get(n);if(!e){u=null;break bb0}let d=`tr-num`+(r?` ${r}`:``);if(e.kind===`structure`){u=(0,Y.jsx)(`span`,{className:`${d} tr-num-qual`,"data-status":`structure`,children:e.resolution.raw});break bb0}a=`button`,o=d,s=ae(e),t[9]!==n||t[10]!==i?(c=e=>i?.open(n,e.currentTarget),t[9]=n,t[10]=i,t[11]=c):c=t[11],l=h(e)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsx)(`span`,{className:`tr-sr`,children:`, source available`}),t[12]=d):d=t[12];let f;return t[13]!==a||t[14]!==o||t[15]!==s||t[16]!==c||t[17]!==l?(f=(0,Y.jsxs)(`button`,{type:a,className:o,"data-status":s,onClick:c,children:[l,d]}),t[13]=a,t[14]=o,t[15]=s,t[16]=c,t[17]=l,t[18]=f):f=t[18],f}var Q=8,$e=6;function et(e,t,n){return Math.max(Q,Math.min(e,n-t-Q))}function tt(e,t,n){if(!(e.width>0||e.height>0||e.left>0||e.top>0))return{left:et((n.w-t.w)/2,t.w,n.w),top:et((n.h-t.h)/2,t.h,n.h)};let r=e.bottom+$e,i=e.top-$e-t.h,a=r+t.h+Q>n.h&&i>=Q;return{left:et(e.left,t.w,n.w),top:et(a?i:r,t.h,n.h)}}var $=320,nt=340,rt=8;function it(e){let t=(0,J.c)(64),{registry:n,valueId:r,anchorRect:i,trail:a,hinted:o,onMarkHinted:s,onDrill:l,onBack:u,onNavigate:d,onDismiss:f}=e,p=(0,q.useRef)(null),v;t[0]===f?v=t[1]:(v={onEscape:f},t[0]=f,t[1]=v),c(p,v);let[x]=(0,q.useState)(!o),S,C;t[2]===s?(S=t[3],C=t[4]):(S=()=>s(),C=[s],t[2]=s,t[3]=S,t[4]=C),(0,q.useEffect)(S,C);let w=(0,q.useRef)(!0),T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{w.current||p.current?.focus({preventScroll:!0}),w.current=!1},t[5]=T):T=t[5];let E;t[6]===r?E=t[7]:(E=[r],t[6]=r,t[7]=E),(0,q.useEffect)(T,E);let D,O;t[8]===f?(D=t[9],O=t[10]):(D=()=>{let e=e=>{let t=p.current;t&&e.target instanceof Node&&!t.contains(e.target)&&f()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},O=[f],t[8]=f,t[9]=D,t[10]=O),(0,q.useEffect)(D,O);let k=n.values,A,j,M,N,P,F,I,L,R,z,B,V,H,U;if(t[11]!==i||t[12]!==u||t[13]!==l||t[14]!==d||t[15]!==n.usedIn||t[16]!==n.values||t[17]!==a||t[18]!==r){V=Symbol.for(`react.early_return_sentinel`);bb0:{if(U=k.get(r),!U){V=null;break bb0}let e=ae(U),o=U.scope,s=n.usedIn.get(r)??[],c=U.kind===`grounded`?U.resolution.receipt:null,f=U.kind===`grounded`&&U.resolution.tier===`T1`,v=c?.url?y(c.url):null,x=c?c.host??(c.url?b(c.url):null):null,S=U.kind===`calculated`?U.calc.inputs:[],C=S.slice(0,rt),w=S.length-C.length,T;t[33]!==n.values||t[34]!==a?(T=a.length>0?n.values.get(a[a.length-1]):void 0,t[33]=n.values,t[34]=a,t[35]=T):T=t[35];let E=T,D;t[36]===i?D=t[37]:(D=tt(i,{w:$,h:nt},{w:window.innerWidth,h:window.innerHeight}),t[36]=i,t[37]=D);let{left:O,top:W}=D;H=p,A=`tr-card`,j=`dialog`,M=`false`,N=`Where ${U.label} came from`,P=-1,t[38]!==O||t[39]!==W?(F={left:O,top:W,width:$,maxHeight:nt},t[38]=O,t[39]=W,t[40]=F):F=t[40];let G;t[41]!==u||t[42]!==E?(G=E&&(0,Y.jsxs)(`button`,{type:`button`,className:`tr-back`,onClick:u,"aria-label":`Back to ${E.label}`,children:[`‹ back`,(0,Y.jsxs)(`span`,{className:`tr-back-to`,children:[` to `,E.label]})]}),t[41]=u,t[42]=E,t[43]=G):G=t[43],I=(0,Y.jsxs)(`header`,{className:`tr-head`,children:[G,(0,Y.jsx)(`span`,{className:`tr-badge`,"data-status":e,children:_[e]}),(0,Y.jsx)(`p`,{className:`tr-figure`,children:h(U)}),(0,Y.jsx)(`p`,{className:`tr-label`,children:U.label})]}),L=c&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`SOURCE`}),c.quote&&(0,Y.jsxs)(`blockquote`,{className:`tr-quote`,children:[`“`,c.quote,`”`]}),f?(0,Y.jsx)(`p`,{className:`tr-host`,children:m(c)}):x&&(0,Y.jsxs)(`p`,{className:`tr-host`,children:[v?(0,Y.jsx)(`a`,{href:v,target:`_blank`,rel:`noreferrer noopener`,children:x}):x,c.date&&(0,Y.jsxs)(`span`,{className:`tr-date`,children:[` · `,c.date]})]})]}),R=o&&(o.region||o.period||o.unit)&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`SCOPE`}),(0,Y.jsx)(`p`,{className:`tr-chips`,children:[o.region,o.period,o.unit].filter(ot).map(at)})]}),z=U.kind===`calculated`&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`CALCULATION`}),(0,Y.jsx)(`p`,{className:`tr-formula`,children:g(U.calc.formula,e=>n.values.get(e)?.label)}),(0,Y.jsx)(`ul`,{className:`tr-inputs`,children:C.map(e=>{let t=n.values.get(e);return(0,Y.jsx)(`li`,{children:t?(0,Y.jsxs)(`button`,{type:`button`,className:`tr-input`,onClick:()=>l(e),children:[(0,Y.jsx)(`span`,{className:`tr-input-label`,children:t.label}),(0,Y.jsx)(`span`,{className:`tr-input-val`,children:h(t)})]}):(0,Y.jsx)(`span`,{className:`tr-input tr-input-missing`,children:e})},e)})}),w>0&&(0,Y.jsxs)(`p`,{className:`tr-more`,children:[`…and `,w,` more`]}),U.calc.note&&(0,Y.jsx)(`p`,{className:`tr-note`,children:U.calc.note})]}),B=s.length>0&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`USED IN`}),(0,Y.jsx)(`ul`,{className:`tr-used`,children:s.map(e=>(0,Y.jsx)(`li`,{children:d?(0,Y.jsx)(`button`,{type:`button`,className:`tr-usedin`,onClick:()=>d(e),children:e.label}):(0,Y.jsx)(`span`,{className:`tr-usedin tr-usedin-flat`,children:e.label})},`${e.surface}:${e.id}:${e.label}`))})]})}t[11]=i,t[12]=u,t[13]=l,t[14]=d,t[15]=n.usedIn,t[16]=n.values,t[17]=a,t[18]=r,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P,t[24]=F,t[25]=I,t[26]=L,t[27]=R,t[28]=z,t[29]=B,t[30]=V,t[31]=H,t[32]=U}else A=t[19],j=t[20],M=t[21],N=t[22],P=t[23],F=t[24],I=t[25],L=t[26],R=t[27],z=t[28],B=t[29],V=t[30],H=t[31],U=t[32];if(V!==Symbol.for(`react.early_return_sentinel`))return V;let W;t[44]!==U.kind||t[45]!==U.resolution?(W=U.kind===`illustrative`&&(0,Y.jsxs)(`p`,{className:`tr-caveat`,children:[`Illustrative — shows the shape, not a measured fact. `,U.resolution.illustrative]}),t[44]=U.kind,t[45]=U.resolution,t[46]=W):W=t[46];let G;t[47]===x?G=t[48]:(G=x&&(0,Y.jsx)(`p`,{className:`tr-hint`,children:`Any figure like this one opens its own receipt.`}),t[47]=x,t[48]=G);let ee;return t[49]!==A||t[50]!==j||t[51]!==M||t[52]!==N||t[53]!==P||t[54]!==F||t[55]!==I||t[56]!==L||t[57]!==R||t[58]!==z||t[59]!==B||t[60]!==W||t[61]!==G||t[62]!==H?(ee=(0,Y.jsxs)(`div`,{ref:H,className:A,role:j,"aria-modal":M,"aria-label":N,tabIndex:P,style:F,children:[I,L,R,z,B,W,G]}),t[49]=A,t[50]=j,t[51]=M,t[52]=N,t[53]=P,t[54]=F,t[55]=I,t[56]=L,t[57]=R,t[58]=z,t[59]=B,t[60]=W,t[61]=G,t[62]=H,t[63]=ee):ee=t[63],ee}function at(e){return(0,Y.jsx)(`span`,{className:`tr-chip`,children:e},e)}function ot(e){return!!e}function st(e){let t=(0,J.c)(23),{registry:n,onNavigate:r,children:i,ref:a}=e,[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(null),t[0]=u):u=t[0];let d;t[1]===n?d=t[2]:(d=[n],t[1]=n,t[2]=d),(0,q.useEffect)(u,d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>s(null),t[3]=f):f=t[3];let p=f,m,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>({dismiss:p}),h=[p],t[4]=m,t[5]=h):(m=t[4],h=t[5]),(0,q.useImperativeHandle)(a,m,h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(e,t)=>{t.focus(),s({valueId:e,anchorRect:t.getBoundingClientRect(),trail:[]})},t[6]=g):g=t[6];let _=g,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>l(!0),t[7]=v):v=t[7];let y=v,b;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{s(t=>t&&{valueId:e,anchorRect:t.anchorRect,trail:[...t.trail,t.valueId]})},t[8]=b):b=t[8];let x=b,S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(ct)},t[9]=S):S=t[9];let C=S,w;t[10]!==c||t[11]!==r||t[12]!==n?(w={registry:n,open:_,onNavigate:r,hinted:c,markHinted:y},t[10]=c,t[11]=r,t[12]=n,t[13]=w):w=t[13];let T=w,E;t[14]!==o||t[15]!==c||t[16]!==r||t[17]!==n?(E=o&&(0,Y.jsx)(it,{registry:n,valueId:o.valueId,anchorRect:o.anchorRect,trail:o.trail,hinted:c,onMarkHinted:y,onDrill:x,onBack:C,onNavigate:r,onDismiss:p}),t[14]=o,t[15]=c,t[16]=r,t[17]=n,t[18]=E):E=t[18];let D;return t[19]!==i||t[20]!==E||t[21]!==T?(D=(0,Y.jsxs)(Xe.Provider,{value:T,children:[i,E]}),t[19]=i,t[20]=E,t[21]=T,t[22]=D):D=t[22],D}function ct(e){let t=e?.trail[e.trail.length-1];return!e||t===void 0?e:{valueId:t,anchorRect:e.anchorRect,trail:e.trail.slice(0,-1)}}var lt=`Recomputed locally from the causes above — a model of what would happen, never an observation.`,ut=`What was actually measured. This column never moves when a lever is pulled.`;function dt(e,t){return(e>0?`+`:``)+d(e,t)}function ft(e){return e!==null&&Number.isFinite(e)&&e>=0&&e<=1}function pt(e){return e.exactBase===null?`nothing measured stands behind this outcome`:`not every step is grounded, so the total stays unmeasured`}function mt(e){let t=(0,J.c)(22),{baseline:n,current:r,unit:i,active:a,observedNote:o}=e,s;t[0]!==n.exactBase||t[1]!==n.fullyGrounded||t[2]!==i?(s=n.fullyGrounded&&n.exactBase!==null?d(n.exactBase,i):null,t[0]=n.exactBase,t[1]=n.fullyGrounded,t[2]=i,t[3]=s):s=t[3];let c=s,l=r.exactBase??n.exactBase,u=a?`1`:void 0,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(`span`,{className:`tr-chip tr-wi-chip`,title:ut,children:`OBSERVED`}),t[4]=f):f=t[4];let p;t[5]!==n||t[6]!==c||t[7]!==o?(p=(0,Y.jsxs)(`div`,{className:`tr-wi-col`,children:[f,c===null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}),(0,Y.jsx)(`p`,{className:`tr-wi-note tr-wi-why`,children:o??pt(n)})]}):(0,Y.jsx)(`p`,{className:`tr-wi-figure`,children:c})]}),t[5]=n,t[6]=c,t[7]=o,t[8]=p):p=t[8];let m;t[9]!==a||t[10]!==l||t[11]!==r.exactDelta||t[12]!==r.explainedPct||t[13]!==r.fullyGrounded||t[14]!==r.relBase||t[15]!==r.relCur||t[16]!==i?(m=a&&(0,Y.jsxs)(`div`,{className:`tr-wi-col tr-wi-hypo`,"data-world":`hypothetical`,children:[(0,Y.jsx)(`span`,{className:`tr-chip tr-wi-chip tr-wi-chip-hypo`,title:lt,children:`HYPOTHETICAL (MODELED)`}),r.fullyGrounded&&l!==null&&r.exactDelta!==null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`tr-wi-figure`,children:d(l+r.exactDelta,i)}),(0,Y.jsx)(`p`,{className:`tr-wi-delta`,children:dt(r.exactDelta,i)}),ft(r.explainedPct)&&(0,Y.jsxs)(`p`,{className:`tr-wi-note`,children:[Math.round(r.explainedPct*100),`% explained`]})]}):r.relCur===null?(0,Y.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`tr-wi-figure tr-wi-phrase`,children:le(r.relBase??0,r.relCur)}),(0,Y.jsx)(`p`,{className:`tr-wi-note`,children:`relative, not measured`})]})]}),t[9]=a,t[10]=l,t[11]=r.exactDelta,t[12]=r.explainedPct,t[13]=r.fullyGrounded,t[14]=r.relBase,t[15]=r.relCur,t[16]=i,t[17]=m):m=t[17];let h;return t[18]!==u||t[19]!==p||t[20]!==m?(h=(0,Y.jsxs)(`div`,{className:`tr-wi`,"data-active":u,children:[p,m]}),t[18]=u,t[19]=p,t[20]=m,t[21]=h):h=t[21],h}var ht=(0,q.memo)(mt);function gt(e){return{id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...e.unit?{unit:e.unit}:{},...e.receipt?{receipt:e.receipt}:{}}}function _t(e){let t=e.receipts?.[0]??e.receipt;return{from:e.from,to:e.to,sign:e.sign,tier:e.tier,...e.verb?{verb:e.verb}:{},...e.weight===void 0?{}:{weight:e.weight},...t&&!e.provisional?{receipt:t}:{},...e.provisional?{provisional:!0}:{}}}function vt(e){return{center:e.title,outcomeId:e.outcomeId,nodes:e.nodes.map(gt),edges:e.edges.map(_t),provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...e.provenance.notes?.length?{notes:e.provenance.notes}:{}}}}var yt=e=>`node:${e}`,bt=(e,t)=>`node:${e}@${t}`;function xt(e,t){let n=e.provenance.illustrative===!0,r=[],i=[],a=[],o=new Map,s=[],c=new Map,l=(e,t,n)=>{!e||o.has(e.id)||(o.set(e.id,e),s.push(t),i.push(n))},u=(e,t)=>{c.set(e.id,e.label),r.push({id:e.id,label:e.label,role:e.role,...e.detail===void 0?{}:{detail:e.detail},...e.domain===void 0?{}:{domain:e.domain},...t===void 0?{}:{parentId:t}});let i=e.series,a=e.unit??i?.unit,o=t=>({valueId:t,surface:`node`,id:e.id,label:e.label});if(e.value!==void 0){let t=yt(e.id);l(F(t,e.label,e.value,e.tier,a,e.receipt,n),o(t),{valueId:t,entityId:e.id})}if(i)for(let t of i.points){let r=bt(e.id,t.t),a=F(r,`${e.label} · ${t.t}`,t.value,i.tier,i.unit,t.receipt??i.receipt,n,t.t);l(a,o(r),{valueId:r,entityId:e.id,at:t.t})}for(let t of e.children??[])u(t,e.id)};for(let t of e.nodes)u(t);return B(e.edges).forEach((e,n)=>{let r=`${c.get(e.from)??e.from} ${e.verb??`→`} ${c.get(e.to)??e.to}`,i=t.edges[n]?.id;if(i!==void 0){a.push({id:i,from:e.from,to:e.to,...e.relation===void 0?{}:{kind:e.relation},...e.sign===void 0?{}:{sign:e.sign},...e.weight===void 0?{}:{weight:e.weight}});for(let t of[e.from,e.to])s.push({valueId:yt(t),surface:`edge`,id:i,label:r})}}),{title:e.title,entities:r,relations:a,facts:i,trust:I(o,s),outcomeId:e.outcomeId,...n?{illustrative:n}:{}}}var St=1100;function Ct(e,t,n,r){let i=!1,a=e=>{i||(i=!0,r(e))};(async()=>{for(let r=Math.max(0,t);r<e.length;r++){let t=e[r];if(!t)continue;if(n.isCancelled()){a(`cancelled`);return}let i=E(t.say),o=n.speakLine?.(t.say)??null,s=o?await T(o):!1;if(n.isCancelled()){a(`cancelled`);return}n.apply(t,r),o&&s?await O(o,i,St):await D(i)}a(n.isCancelled()?`cancelled`:`complete`)})()}function wt({beats:e,apply:t,speakLine:n}){let[r,i]=(0,q.useState)(-1),[a,o]=(0,q.useState)(!1),s=(0,q.useRef)(0),c=(0,q.useRef)(e);c.current=e;let l=(0,q.useRef)(t);l.current=t;let u=(0,q.useRef)(n);u.current=n;let d=(0,q.useCallback)(()=>{s.current+=1,o(!1)},[]),f=(0,q.useCallback)(e=>{let t=s.current+=1;o(!0),Ct(c.current,e,{speakLine:e=>u.current?.(e)??null,apply:(e,t)=>{i(t),l.current(e,t)},isCancelled:()=>s.current!==t},()=>{s.current===t&&o(!1)})},[]);(0,q.useEffect)(()=>()=>void(s.current+=1),[]),(0,q.useEffect)(()=>{s.current+=1,o(!1),i(-1)},[e]);let p=(0,q.useCallback)(()=>{if(a){d();return}let e=c.current.length;e!==0&&f(r>=0&&r<e-1?r:0)},[a,r,f,d]),m=(0,q.useCallback)(e=>{let t=c.current.length;t!==0&&f(Math.min(Math.max(e,0),t-1))},[f]),h=(0,q.useCallback)(()=>{d(),i(-1)},[d]);return{index:r,playing:a,caption:r>=0?e[r]?.caption??null:null,toggle:p,seek:m,reset:h}}function Tt(e){let t=(0,J.c)(33),{count:n,index:r,playing:i,caption:a,expanded:o,onToggle:s,onSeek:c,inviting:l}=e;if(n===0)return null;let u=Math.min(Math.max(r,-1),n-1),d=i?``:void 0,f=o?``:void 0,p=`${o?108:54}px`,m;t[0]===p?m=t[1]:(m={"--wo-transport-h":p},t[0]=p,t[1]=m);let h=m,g=l&&!i?``:void 0,_=i?`Pause the walkthrough`:`Walk me through it`,v=i?`❙❙`:`▶`,y;t[2]===v?y=t[3]:(y=(0,Y.jsx)(`span`,{className:`wo-play-glyph`,"aria-hidden":`true`,children:v}),t[2]=v,t[3]=y);let b=i?`Pause`:`Walk me through it`,x;t[4]===b?x=t[5]:(x=(0,Y.jsx)(`span`,{className:`wo-play-label`,children:b}),t[4]=b,t[5]=x);let S;t[6]!==s||t[7]!==x||t[8]!==g||t[9]!==_||t[10]!==y?(S=(0,Y.jsxs)(`button`,{type:`button`,className:`wo-play`,"data-inviting":g,onClick:s,"aria-label":_,children:[y,x]}),t[6]=s,t[7]=x,t[8]=g,t[9]=_,t[10]=y,t[11]=S):S=t[11];let C;t[12]!==l||t[13]!==i?(C=l&&!i&&(0,Y.jsx)(`span`,{className:`wo-play-aside`,children:`or press any cause`}),t[12]=l,t[13]=i,t[14]=C):C=t[14];let w;t[15]!==u||t[16]!==n||t[17]!==o||t[18]!==c?(w=o&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`wo-track`,role:`group`,"aria-label":`Walkthrough beats`,children:Array.from({length:n},(e,t)=>(0,Y.jsx)(`button`,{type:`button`,className:`wo-tick`,"data-state":t<u?`past`:t===u?`now`:`ahead`,onClick:()=>c(t),"aria-label":`Beat ${t+1} of ${n}`,"aria-current":t===u?`step`:void 0},t))}),(0,Y.jsxs)(`span`,{className:`wo-transport-count`,"aria-hidden":`true`,children:[u<0?n:u+1,`/`,n]})]}),t[15]=u,t[16]=n,t[17]=o,t[18]=c,t[19]=w):w=t[19];let T;t[20]!==S||t[21]!==C||t[22]!==w?(T=(0,Y.jsxs)(`div`,{className:`wo-transport-row`,children:[S,C,w]}),t[20]=S,t[21]=C,t[22]=w,t[23]=T):T=t[23];let E;t[24]!==a||t[25]!==o?(E=o&&(0,Y.jsx)(`p`,{className:`wo-caption`,"aria-live":`polite`,children:a===null?``:k(a)}),t[24]=a,t[25]=o,t[26]=E):E=t[26];let D;return t[27]!==d||t[28]!==T||t[29]!==E||t[30]!==f||t[31]!==h?(D=(0,Y.jsxs)(`div`,{className:`wo-transport`,"data-playing":d,"data-open":f,style:h,children:[T,E]}),t[27]=d,t[28]=T,t[29]=E,t[30]=f,t[31]=h,t[32]=D):D=t[32],D}var Et=170,Dt={contributes:`fed by`,causes:`driven by`,dampens:`held back by`,enables:`made possible by`,correlates:`moving together with`},Ot={1:`pushed up by`,[-1]:`pushed down by`};function kt(e){let t=e.split(` `,1)[0]??``;return t.length===0||/[A-Z]/.test(t.slice(1))?e:e[0].toLowerCase()+e.slice(1)}var At={graph:`And that is how the causes fit together.`,timeline:`And here are the same causes, in time.`,chart:`And here is what each one actually measured.`,flow:`And here is how much each one contributed.`,spheres:`And here are the kinds of force it is made of.`};function jt(e,t){let n=e.values.get(yt(t));if(!n||n.kind===`structure`)return null;let r=h(n);return n.kind===`illustrative`?{say:`Illustratively, about ${r}.`,shown:`Illustratively, about ${r}.`}:{say:`Measured at ${r}.`,shown:`Measured at ${r}.`}}function Mt(e){return e.kind?e.kind===`dampens`||e.kind===`enables`||e.kind===`correlates`:e.sign===-1}function Nt(e){return e.kind&&Dt[e.kind]?Dt[e.kind]:Ot[e.sign??1]??`fed by`}function Pt(e){let t=e.nodes.filter(e=>e.parentId===void 0),n=new Set(t.map(e=>e.id)),r=e.edges.filter(e=>n.has(e.from)&&n.has(e.to)),i=new Map(t.map(e=>[e.id,e.depth??0])),a=new Map;for(let e of r)a.set(e.from,(a.get(e.from)??0)+(e.weight??0));let o=new Map(t.map(e=>[e.id,0]));for(let e of r)o.set(e.to,(o.get(e.to)??0)+1);let s=(e,t)=>(i.get(e)??0)-(i.get(t)??0)||(a.get(t)??0)-(a.get(e)??0)||(e<t?-1:+(e>t)),c=t.filter(e=>o.get(e.id)===0).map(e=>e.id),l=[],u=new Set;for(;c.length>0;){c.sort(s);let e=c.shift();if(!(e===void 0||u.has(e))){u.add(e),l.push(e);for(let t of r){if(t.from!==e)continue;let n=(o.get(t.to)??0)-1;o.set(t.to,n),n<=0&&!u.has(t.to)&&c.push(t.to)}}}for(let e of t.map(e=>e.id).sort(s))u.has(e)||l.push(e);return l}function Ft(e,t,n,r={}){let i=Pt(t);if(i.length<2)return[];let a=new Map(e.nodes.map(e=>[e.id,e])),o=new Map(t.nodes.map(e=>[e.id,e.label])),s=new Map(i.map((e,t)=>[e,t])),c=e=>t.edges.filter(t=>t.to===e&&s.has(t.from)&&(s.get(t.from)??0)<(s.get(e)??0)).sort((e,t)=>(t.weight??0)-(e.weight??0)||(e.id<t.id?-1:1))[0],l=[],u=i.at(-1)===e.outcomeId?i.length-1:i.length,d=u===1?`One cause, one outcome. Here is how it connects.`:`${u} causes, one outcome. Here is how they connect.`;l.push({nodeId:e.outcomeId,wide:!0,rep:`graph`,say:d,caption:d});let f=null;for(let[t,r]of i.entries()){let s=a.get(r),u=o.get(r)??r,d=c(r),p=r===e.outcomeId&&t===i.length-1,m=d?o.get(d.from)??d.from:null,h;h=p?d?`And it ends here: ${kt(u)}, ${Nt(d)} ${d.from===f?`it`:kt(m??``)}.`:`And it ends here: ${kt(u)}.`:d?d.from===f?Mt(d)?`Then ${kt(u)}, ${Nt(d)} it.`:`Then ${kt(u)}.`:`${u}, ${Nt(d)} ${kt(m??``)}.`:t===0?`It starts with ${kt(u)}.`:`Alongside it: ${u}.`,f=r;let g=[h],_=[h],v=jt(n,r);v&&(g.push(v.say),_.push(v.shown));let y=s?.detail;y&&(g.push(w(S(y),Et)),_.push(w(C(y),Et))),l.push({nodeId:r,...d?{edgeId:d.id}:{},say:g.join(` `),caption:_.join(` `)})}if(r.closeOn){let t=At[r.closeOn];l.push({nodeId:e.outcomeId,wide:!0,rep:r.closeOn,say:t,caption:t})}return l}var It={economy:`var(--domain-economy)`,policy:`var(--domain-policy)`,technology:`var(--domain-technology)`,science:`var(--domain-science)`,environment:`var(--domain-environment)`,society:`var(--domain-society)`,health:`var(--domain-health)`,conflict:`var(--domain-conflict)`},Lt=.5;function Rt(e){let t=e.nodes.filter(e=>e.parentId===void 0);if(t.length===0)return null;let n=new Map;for(let e of t)e.domain!==void 0&&n.set(e.domain,(n.get(e.domain)??0)+1);if([...n.values()].reduce((e,t)=>e+t,0)/t.length<Lt)return null;let r=[...n.entries()].sort((e,t)=>t[1]-e[1]||(e[0]<t[0]?-1:1)).map(([e])=>It[e]).filter(e=>e!==void 0);return r.length===0?null:{air1:r[0],air2:r[1]??r[0]}}r();var zt=5,Bt=`wo-stage`,Vt=`an illustrative living answer measures nothing, so there is no baseline`;function Ht(e){if(e.length<2)return null;let t=e.reduce((e,t)=>Math.min(e,t.v),1/0),n=e.reduce((e,t)=>Math.max(e,t.v),-1/0)-t,r=e.length-1;return e.map((e,i)=>{let a=i/r*100,o=n===0?10:18-(e.v-t)/n*16;return`${i===0?`M`:`L`} ${Math.round(a*10)/10} ${Math.round(o*10)/10}`}).join(` `)}function Ut(e,t){return Wt(e,t)?.length??0}function Wt(e,t){for(let n of e){if(n.id===t)return n.children;let e=n.children===void 0?void 0:Wt(n.children,t);if(e)return e}}function Gt(e){let{value:t,...n}=e;return n}function Kt(e,t){let n=new Map;for(let[r,i]of e.relativeByNode){let e=t.relativeByNode.get(r)??0;i>0&&n.set(r,e/i)}return n}function qt(e,t,n,r){return{exactBase:n??null,exactDelta:e.outcomeDelta,explainedPct:e.explainedPct,fullyGrounded:e.fullyGrounded&&!r,relBase:t.relativeOutcome,relCur:e.relativeOutcome}}function Jt(e){let t=(0,J.c)(14),{spec:n,question:r,failed:i,onRetry:a,onClose:o,view:s,onExpandNode:c,autoWalk:l,speakLine:u}=e;if(n){let e;return t[0]!==l||t[1]!==o||t[2]!==c||t[3]!==u||t[4]!==n||t[5]!==s?(e=(0,Y.jsx)(Xt,{spec:n,view:s,onClose:o,onExpandNode:c,autoWalk:l,speakLine:u}),t[0]=l,t[1]=o,t[2]=c,t[3]=u,t[4]=n,t[5]=s,t[6]=e):e=t[6],e}let d;t[7]===r?d=t[8]:(d=r?v(r):``,t[7]=r,t[8]=d);let f=i===!0,p;return t[9]!==o||t[10]!==a||t[11]!==d||t[12]!==f?(p=(0,Y.jsx)(Yt,{title:d,failed:f,onRetry:a,onClose:o}),t[9]=o,t[10]=a,t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function Yt(e){let t=(0,J.c)(17),{title:n,failed:r,onRetry:i,onClose:a}=e,o=`Living answer: ${n}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=(0,Y.jsxs)(`div`,{className:`wo-title`,children:[s,(0,Y.jsx)(`h2`,{children:n})]}),t[1]=n,t[2]=c);let l;t[3]===a?l=t[4]:(l=a&&(0,Y.jsx)(`div`,{className:`wo-head-actions`,children:(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:a,"aria-label":`Back to the answer`,children:`← Back to the answer`})}),t[3]=a,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,Y.jsxs)(`header`,{className:`wo-head`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]!==r||t[9]!==i?(d=(0,Y.jsx)(`div`,{className:`wo-shell`,role:`status`,"aria-live":`polite`,children:r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`wo-shell-line`,children:`This living answer didn’t come back.`}),(0,Y.jsx)(`p`,{className:`wo-shell-note`,children:`Nothing was built, and Mavéa won’t stand in a causal web it can’t source. The answer behind this card is untouched.`}),i&&(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:i,children:`Try again`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`wo-shell-ground`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:`wo-shell-pulse`,"aria-hidden":`true`}),(0,Y.jsx)(`p`,{className:`wo-shell-line`,children:`Building your living answer…`}),(0,Y.jsx)(`p`,{className:`wo-shell-note`,children:`One model call, grounded in what this answer already found. Once it is built it is kept — re-opening it, and replaying this turn, costs nothing.`})]})}),t[8]=r,t[9]=i,t[10]=d):d=t[10];let f;t[11]!==u||t[12]!==d?(f=(0,Y.jsxs)(`div`,{className:`wo-panel`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==o||t[15]!==f?(p=(0,Y.jsx)(`section`,{className:`wo-scrim`,"aria-label":o,children:f}),t[14]=o,t[15]=f,t[16]=p):p=t[16],p}function Xt({spec:e,view:t,onClose:n,onExpandNode:r,autoWalk:c,speakLine:l}){let[u,d]=(0,q.useState)(()=>p(e.title));(0,q.useEffect)(()=>{f(e.title,u)},[e.title,u]);let[m,h]=(0,q.useState)(null),g=(0,q.useMemo)(()=>{if(u.size===0)return e;let t=e;for(let[e,n]of u)t=M(t,e,n);return t},[e,u]),_=g.provenance.illustrative===!0,y=(0,q.useMemo)(()=>V(g),[g]),b=(0,q.useMemo)(()=>xt(g,y),[g,y]),x=b.trust,S=(0,q.useMemo)(()=>vt(g),[g]),[C,w]=(0,q.useState)(()=>new Map),[T,E]=(0,q.useState)(null),[D,O]=(0,q.useState)(!1),k=(0,q.useMemo)(()=>[...C.values()].some(e=>e!==100),[C]),F=(0,q.useMemo)(()=>[...C].map(([e,t])=>({nodeId:e,pct:t/100})),[C]),I=(0,q.useMemo)(()=>ie(S,[]),[S]),R=(0,q.useMemo)(()=>ie(S,F),[S,F]),z=(0,q.useMemo)(()=>k?Kt(I,R):null,[k,I,R]),U=(0,q.useDeferredValue)(z),G=(0,q.useCallback)(e=>H(e,y),[y]),K=(0,q.useMemo)(()=>ee(y),[y]),te=(0,q.useMemo)(()=>{let e=g.nodes[0]?.tier;return e!==void 0&&g.nodes.every(t=>t.tier===e)?``:void 0},[g]),ne=(0,q.useMemo)(()=>Rt(y),[y]),J=t&&G(t)?t:void 0,ae=We({world:y,insetBottom:D?108:54,initialRep:J??W(y)}),{rep:oe,setRep:se,expandedIds:ce,toggleExpand:le,unfoldsOnStage:ue}=ae;(0,q.useEffect)(()=>{J&&se(J)},[J,se]);let fe=(0,q.useMemo)(()=>{let e=new Map(y.nodes.map(e=>[e.id,e.parentId])),t=new Map;for(let n of y.nodes){let r=n.id,i=new Set([r]),a=e.get(r);for(;a!==void 0&&!i.has(a);)i.add(a),r=a,a=e.get(r);t.set(n.id,r)}return t},[y]),pe=(0,q.useMemo)(()=>{let e=y.nodes.map(e=>{let t=Gt(e),n=U?.get(fe.get(e.id)??e.id),r=A(e.label);return{...t,label:r,...n===void 0?{}:{shift:n}}});return{...y,nodes:e}},[y,U,fe]),me=(0,q.useMemo)(()=>{let e=new Map,t=n=>{e.set(n.id,n);for(let e of n.children??[])t(e)};for(let e of g.nodes)t(e);return e},[g]),he=(0,q.useMemo)(()=>{let e=B(g.edges);return new Map(y.edges.map((t,n)=>[t.id,e[n]]))},[y,g]),ge=(0,q.useRef)(null),_e=(0,q.useCallback)(()=>ge.current?.dismiss(),[]),ve=(0,q.useCallback)(e=>{(e.surface===`node`||e.surface===`edge`)&&E({kind:e.surface,id:e.id})},[]),[ye,be]=(0,q.useState)(void 0),xe=K.find(e=>e!==`graph`),[Se,Ce]=(0,q.useState)([]);(0,q.useEffect)(()=>{let e=globalThis.requestIdleCallback,t=()=>Ce(Ft(g,y,x,xe?{closeOn:xe}:{}));if(typeof e==`function`){let n=e(t,{timeout:2e3});return()=>globalThis.cancelIdleCallback?.(n)}let n=setTimeout(t,1);return()=>clearTimeout(n)},[g,y,x,xe]);let{focusNode:we}=ae,Te=(0,q.useCallback)(e=>{e.rep&&se(e.rep),E({kind:`node`,id:e.nodeId}),be(e.edgeId),e.wide?we(null):e.rep||we(e.nodeId)},[we,se]),{index:Ee,playing:De,caption:Oe,toggle:ke,seek:je,reset:Me}=wt((0,q.useMemo)(()=>({beats:Se,apply:Te,...l?{speakLine:l}:{}}),[Se,Te,l]));(0,q.useEffect)(()=>{O(De||Ee>=0)},[De,Ee]);let Pe=(0,q.useRef)(!1);(0,q.useEffect)(()=>{typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||!c||Pe.current||Se.length===0||(Pe.current=!0,ke())},[c,Se.length,ke]);let[Fe,Ie]=(0,q.useState)(!0),Le=(0,q.useCallback)(()=>Ie(!1),[]),X=(0,q.useCallback)(()=>{Me(),be(void 0)},[Me]),Re=(0,q.useRef)(n);Re.current=n;let ze=(0,q.useRef)(ke);ze.current=ke;let Be=(0,q.useRef)(X);Be.current=X,(0,q.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){Be.current(),Re.current?.();return}(e.key===` `||e.key===`Spacebar`)&&(e.target?.closest(`button, input, select, textarea, [contenteditable="true"]`)||(e.preventDefault(),ze.current()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Ve=(0,q.useCallback)(e=>{X(),E({kind:`node`,id:e.id})},[X]),He=(0,q.useCallback)(e=>{X(),E({kind:`edge`,id:e})},[X]),Ue=(0,q.useCallback)((e,t)=>{X(),w(n=>new Map(n).set(e,t))},[X]),Ge=(0,q.useCallback)(()=>{X(),w(new Map)},[X]),Ke=(0,q.useCallback)(e=>{!r||m!==null||(h(e),r(e,g).then(t=>{h(null);let n=t===null?void 0:Wt(t.nodes,e);n?.length&&(d(t=>new Map(t).set(e,n)),ue(e)?le(e):E({kind:`node`,id:e}))},()=>h(null)))},[r,ue,m,g,le]),qe=(0,q.useCallback)((e,t)=>{if(t===`entry`&&oe===`timeline`){let t=me.get(e.id),n=t?.date,r=t?.series?.points,i=n?.until!==void 0||(r?.length??0)>1,a=n?.t??r?.[0]?.t;return i||!a?null:(0,Y.jsx)(`span`,{className:`wo-when`,"data-said":e.dateGrounded?``:void 0,children:a})}if(t!==`card`)return null;let n=ce.has(e.id),i=Ut(g.nodes,e.id),a=i>0,o=Ht(e.series??[]),s=me.get(e.id),c=s?.value===void 0?s?.date:void 0,l=c===void 0||j(c.t)===null?null:c.until!==void 0&&j(c.until)!==null?`${c.t}–${c.until}`:c.t,u=a&&ue(e.id),d=!a&&r!==void 0,f=m===e.id,p=a&&!u?i:0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Qe,{id:yt(e.id),className:`wo-num`}),e.shift!==void 0&&de(e.shift)!==null&&(0,Y.jsx)(`span`,{className:`wo-shift`,"data-dir":e.shift<1?`down`:`up`,children:de(e.shift)}),o!==null&&(0,Y.jsx)(`svg`,{className:`wo-trace`,viewBox:`0 0 100 20`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,Y.jsx)(`path`,{d:o,fill:`none`})}),l!==null&&(0,Y.jsx)(`span`,{className:`wo-when`,"data-said":e.dateGrounded?``:void 0,children:l}),p>0&&(0,Y.jsx)(`span`,{className:`wo-parts-count`,children:`${p} part${p===1?``:`s`}`}),(u||d)&&(0,Y.jsx)(`button`,{type:`button`,className:`wo-expand`,"aria-expanded":u?n:void 0,"aria-busy":f||void 0,disabled:f||d&&m!==null,"aria-label":`${u&&n?`Close`:`Break down`} ${e.label}`,onClick:t=>{t.stopPropagation(),u?le(e.id):Ke(e.id)},children:f?`breaking down…`:u&&n?`close`:`break down`})]})},[ue,g,me,ce,le,r,m,Ke,oe]),Z=me.get(g.outcomeId),Je=(0,q.useMemo)(()=>qt(I,I,Z?.value,_),[I,Z?.value,_]),Xe=(0,q.useMemo)(()=>qt(R,I,Z?.value,_),[R,I,Z?.value,_]),Ze=(0,q.useMemo)(()=>({causes:g.nodes.length,links:g.edges.length,sourced:g.nodes.filter(e=>e.receipt!==void 0).length}),[g]),Q=T?.kind===`node`?me.get(T.id):void 0,$e=(0,q.useMemo)(()=>Q===void 0?[]:L(b,Q.id),[b,Q]),[et,tt]=(0,q.useState)(null);(0,q.useEffect)(()=>{if(Q===void 0){tt(null);return}let e=!0;return(async()=>{let{hierarchyLens:t}=await i(async()=>{let{hierarchyLens:e}=await import(`./lens-DyGK7Owa.js`);return{hierarchyLens:e}},__vite__mapDeps([0,1,2,3]));if(!e)return;let n=t.compile(b,Q.id);if(n===null){tt(null);return}await a(o([n.block]));let r=s(n.block.type);e&&r&&tt({plan:n,render:r})})(),()=>{e=!1}},[b,Q]);let $=T?.kind===`edge`?he.get(T.id):void 0,nt=(0,q.useMemo)(()=>g.nodes.filter(e=>e.role===`root`).map(e=>({id:e.id,label:A(e.label),pct:C.get(e.id)??100})),[g.nodes,C]);return(0,Y.jsx)(st,{registry:x,onNavigate:ve,ref:ge,children:(0,Y.jsx)(`section`,{className:`wo-scrim`,"aria-label":`Living answer: ${v(g.title)}`,onPointerDownCapture:Le,onKeyDownCapture:Le,children:(0,Y.jsxs)(`div`,{className:`wo-panel`,children:[(0,Y.jsxs)(`header`,{className:`wo-head`,children:[(0,Y.jsxs)(`div`,{className:`wo-title`,children:[(0,Y.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),(0,Y.jsx)(`h2`,{children:v(g.title)})]}),(0,Y.jsxs)(`div`,{className:`wo-head-actions`,children:[K.length===1?(0,Y.jsx)(`span`,{className:`wo-chip wo-chip-sole`,children:Ne[K[0]].chip}):(0,Y.jsx)(`div`,{className:`wo-views`,role:`tablist`,"aria-label":`View`,children:K.slice(0,zt).map((e,t,n)=>(0,Y.jsx)(`button`,{type:`button`,id:`wo-tab-${e}`,className:`wo-chip`,role:`tab`,"aria-selected":oe===e,"aria-controls":Bt,tabIndex:oe===e?0:-1,onKeyDown:e=>{let r=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(r===0)return;e.preventDefault();let i=n[(t+r+n.length)%n.length];X(),se(i),document.getElementById(`wo-tab-${i}`)?.focus()},onClick:()=>{X(),se(e)},children:Ne[e].chip},e))}),(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:Ge,disabled:!k,children:`Reset`}),n&&(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:n,"aria-label":`Back to the answer`,children:`← Back to the answer`})]})]}),_&&(0,Y.jsx)(`div`,{className:`wo-banner wo-banner-illustrative`,children:`Illustrative model — shows the shape, not your numbers.`}),(0,Y.jsxs)(`p`,{className:`wo-legend`,"aria-live":`polite`,children:[(0,Y.jsxs)(`span`,{className:`wo-legend-view`,children:[Ne[oe].caption,`.`]}),` `,Ne[oe].legend]}),(0,Y.jsxs)(`div`,{className:`wo-body`,children:[(0,Y.jsxs)(`div`,{className:`wo-stage`,id:Bt,role:K.length>1?`tabpanel`:void 0,"aria-labelledby":K.length>1?`wo-tab-${oe}`:void 0,"data-uniform-tier":te,"data-illustrative":_?``:void 0,onWheelCapture:_e,onPointerDownCapture:_e,style:ne===null?void 0:{"--wo-air-1":ne.air1,"--wo-air-2":ne.air2},children:[(0,Y.jsx)(Ae,{stage:ae,world:pe,renderFace:qe,onNodeClick:Ve,onEdgeClick:He,selectedId:T?.kind===`node`?T.id:void 0,litEdgeId:ye}),(0,Y.jsx)(Tt,{count:Se.length,index:Ee,playing:De,caption:Oe,expanded:D,onToggle:ke,onSeek:je,inviting:Fe})]}),(0,Y.jsxs)(`aside`,{className:`wo-rail`,children:[(0,Y.jsx)(Ye,{levers:nt,onSet:Ue,onReset:Ge}),(0,Y.jsx)(ht,{baseline:Je,current:Xe,unit:Z?.unit,active:k,observedNote:_?Vt:void 0}),(0,Y.jsxs)(`div`,{className:`wo-detail`,children:[(0,Y.jsx)(`span`,{className:`wo-rail-kicker`,children:`EVIDENCE`}),!T&&(0,Y.jsxs)(`div`,{className:`wo-standing`,children:[(0,Y.jsxs)(`p`,{className:`wo-invite`,children:[`Press `,(0,Y.jsx)(`strong`,{children:`Walk me through it`}),` and Mavéa takes you cause by cause — free, and as often as you like.`]}),(0,Y.jsx)(`p`,{className:`wo-hint`,children:`Or tap any cause or link to see what stands behind it.`}),(0,Y.jsxs)(`dl`,{className:`wo-facts`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{children:`Causes`}),(0,Y.jsx)(`dd`,{children:Ze.causes})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{children:`Links`}),(0,Y.jsx)(`dd`,{children:Ze.links})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{children:_?`Illustrative`:`With a source`}),(0,Y.jsx)(`dd`,{children:_?`every cause`:Ze.sourced})]})]}),Z&&(0,Y.jsxs)(`p`,{className:`wo-standing-outcome`,children:[(0,Y.jsx)(`span`,{className:`wo-standing-lead`,children:`It ends at`}),` `,Z.label,Z.detail?(0,Y.jsx)(`span`,{className:`wo-standing-note`,children:Z.detail}):null]}),(0,Y.jsx)(`p`,{className:`wo-hint`,children:`Turn a root cause down and the rest of the web re-weights — nothing is re-computed by a model, and no projected number is invented.`})]}),Q&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`h3`,{className:`wo-detail-title`,children:Q.label}),Q.detail&&(0,Y.jsx)(`p`,{className:`wo-detail-note`,children:Q.detail}),(0,Y.jsx)(`p`,{className:`wo-detail-figure`,children:(0,Y.jsx)(Qe,{id:yt(Q.id)})}),Q.series&&(0,Y.jsx)(`ul`,{className:`wo-series`,children:Q.series.points.map((e,t)=>(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`span`,{className:`wo-series-t`,children:e.t}),(0,Y.jsx)(Qe,{id:bt(Q.id,e.t)})]},`${e.t}:${t}`))}),(et||$e.length>0)&&(0,Y.jsxs)(`div`,{className:`wo-parts`,children:[(0,Y.jsx)(`span`,{className:`wo-rail-kicker`,children:`WHAT THIS IS MADE OF`}),et?et.render(et.plan.block.props,{delay:0}):(0,Y.jsx)(`ul`,{className:`wo-part-list`,children:$e.map(e=>(0,Y.jsx)(`li`,{children:A(e.label)},e.id))})]})]}),$&&(0,Y.jsx)(re,{relation:P($.relation),sign:$.sign,status:$.status??N($),receipts:$.receipts??($.receipt?[$.receipt]:[]),counter:$.counter,provisional:$.provisional})]})]})]})]})})})}export{Jt as WorldOverlay};
|
|
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{i as a,n as o,t as s}from"./loader-BPVv7hEn.js";import{t as c}from"./useFocusTrap-CJmpNZv2.js";import{r as l,t as u}from"./useSpatialCanvas-CfmZOXXP.js";import{i as d}from"./format-q0LwBjID.js";import{i as f,n as p}from"./openWorld-B4VY6xO7.js";import{a as m,i as h,n as g,t as _}from"./display-CAb_PiGv.js";import{t as v}from"./sentenceCase-CLDiNB0f.js";import{r as y,t as b}from"./sourceHost-BV3t2XDb.js";import{r as x}from"./stepDriver-DwjFet6U.js";import{a as S,i as C,s as w}from"./spokenText-Dy-GZvZV.js";import{d as T,l as E,s as D,u as O}from"./walkSync-BfK0U5vB.js";import{n as k}from"./emphasize-BqCIst-B.js";import{c as A,s as j,t as M}from"./validate-MQG0EcTD.js";import{n as N,s as P}from"./receipts-D7zveV-I.js";import{n as F,r as I}from"./value-Dx7DZob4.js";import{t as L}from"./types-DuEbJpIA.js";import{a as R,c as z,d as B,f as V,i as H,l as U,n as W,o as G,r as ee,s as K,t as te,u as ne}from"./offers-eBNj_lSP.js";import{n as re,t as ie}from"./engine-BiM6INsW.js";var q=e(),J=t(),Y=n();function ae(e){return e.kind}var oe=.33,se=.1,ce=.005;function le(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return`would barely change`;let n=Math.abs(e)>1e-9?Math.abs(e):1,r=(t-e)/n,i=Math.abs(r);if(i<=ce)return`would barely change`;let a=r>0?`rise`:`fall`;return i>=oe?`would ${a} meaningfully`:i>=se?`would ${a} somewhat`:`would ${a} slightly`}var ue=.6;function de(e){if(!Number.isFinite(e))return null;let t=e-1,n=Math.abs(t);if(n<=.005)return null;let r=t>0?`stronger`:`weaker`;return n>=ue?`much ${r}`:n>=oe?r:`slightly ${r}`}var fe=440,pe=2,me=1.25,he=320;function ge(e){if(!(e===void 0||!Number.isFinite(e))){if(e<.995)return`weaker`;if(e>1.005)return`stronger`}}var _e=[{id:`mv-arrow`,cls:`mv-marker-up`,refX:9,size:13,shape:(0,Y.jsx)(`path`,{d:`M0.5 1 L9.5 5 L0.5 9 Z`})},{id:`mv-arrow-damp`,cls:`mv-marker-down`,refX:8,size:17,shape:(0,Y.jsx)(`path`,{d:`M8 0.6 L8 9.4`})},{id:`mv-arrow-open`,cls:`mv-marker-open`,refX:9,size:13,shape:(0,Y.jsx)(`path`,{d:`M1 1.4 L9 5 L1 8.6 Z`})},{id:`mv-arrow-ring`,cls:`mv-marker-ring`,refX:7.4,size:13,shape:(0,Y.jsx)(`circle`,{cx:`5`,cy:`5`,r:`3`})},{id:`mv-dot`,cls:`mv-marker-dot`,refX:5,size:9,shape:(0,Y.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2.6`})}];function ve(){let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`defs`,{children:_e.flatMap(ye)}),e[0]=t):t=e[0],t}function ye(e){return[!1,!0].map(t=>(0,Y.jsx)(`marker`,{id:t?`${e.id}-soft`:e.id,className:`mv-marker ${e.cls}${t?` mv-marker-soft`:``}`,viewBox:`0 0 10 10`,refX:e.refX,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:e.size,markerHeight:e.size,orient:`auto`,children:e.shape},t?`${e.id}-soft`:e.id))}function be(e,t){let n=(0,J.c)(5),r;n[0]===e.current?r=n[1]:(r=()=>{let t=e.current;if(!t||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)return;let n=t.querySelectorAll(`[data-draw]:not(.m-draw-path):not([data-drawn])`),r=Array.from(n,Se);n.forEach((e,t)=>{let n=r[t];n!==null&&(e.style.setProperty(`--path-len`,`${n}px`),e.style.setProperty(`--delay`,`${fe}ms`),e.classList.add(`m-draw-path`))});let i=xe;return t.addEventListener(`animationend`,i),()=>t.removeEventListener(`animationend`,i)},n[0]=e.current,n[1]=r);let i;n[2]!==t||n[3]!==e?(i=[e,t],n[2]=t,n[3]=e,n[4]=i):i=n[4],(0,q.useEffect)(r,i)}function xe(e){if(e.animationName!==`mavea-draw`)return;let t=e.target;t.classList.remove(`m-draw-path`),t.style.removeProperty(`--path-len`),t.style.removeProperty(`--delay`),t.dataset.drawn=``}function Se(e){return typeof e.getTotalLength==`function`?e.getTotalLength():null}function Ce(e){let t=(0,J.c)(33),{chrome:n,bbox:r,exiting:i,onSettle:a}=e,o=(0,q.useRef)(null);be(o,n.paths);let s=i?``:void 0,c=i?!0:void 0,l=r.w,u=r.h,d=`${r.x} ${r.y} ${r.w} ${r.h}`,f;t[0]===n.bands?f=t[1]:(f=n.bands.map(Te),t[0]=n.bands,t[1]=f);let p;t[2]===n.paths?p=t[3]:(p=n.paths.map(we),t[2]=n.paths,t[3]=p);let m;t[4]!==r.h||t[5]!==r.w||t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,Y.jsxs)(`svg`,{ref:o,className:`mv-chrome-svg`,width:l,height:u,viewBox:d,"aria-hidden":`true`,children:[f,p]}),t[4]=r.h,t[5]=r.w,t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;if(t[10]!==r.x||t[11]!==r.y||t[12]!==n.bands){let e;t[14]!==r.x||t[15]!==r.y?(e=e=>e.label===void 0?null:(0,Y.jsx)(`div`,{className:`mv-shelf-label`,style:{left:e.x-r.x+12,top:e.y-r.y+12},children:e.label},`${e.id}:label`),t[14]=r.x,t[15]=r.y,t[16]=e):e=t[16],h=n.bands.map(e),t[10]=r.x,t[11]=r.y,t[12]=n.bands,t[13]=h}else h=t[13];let g;if(t[17]!==r.x||t[18]!==r.y||t[19]!==n.labels){let e;t[21]!==r.x||t[22]!==r.y?(e=e=>(0,Y.jsx)(`div`,{className:`mv-chrome-label ${e.className}`,"data-anchor":e.anchor??`start`,style:{left:e.x-r.x,top:e.y-r.y},children:e.text},e.id),t[21]=r.x,t[22]=r.y,t[23]=e):e=t[23],g=n.labels.map(e),t[17]=r.x,t[18]=r.y,t[19]=n.labels,t[20]=g}else g=t[20];let _;t[24]!==g||t[25]!==h?(_=(0,Y.jsxs)(`div`,{className:`mv-chrome-labels`,children:[h,g]}),t[24]=g,t[25]=h,t[26]=_):_=t[26];let v;return t[27]!==a||t[28]!==s||t[29]!==_||t[30]!==c||t[31]!==m?(v=(0,Y.jsxs)(`div`,{className:`mv-chrome`,"data-exiting":s,onTransitionEnd:a,"aria-hidden":c,children:[m,_]}),t[27]=a,t[28]=s,t[29]=_,t[30]=c,t[31]=m,t[32]=v):v=t[32],v}function we(e){return(0,Y.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":e.draw?``:void 0},e.id)}function Te(e){return(0,Y.jsx)(`rect`,{className:`mv-band ${e.className}`,x:e.x,y:e.y,width:e.w,height:e.h,rx:12},e.id)}function Ee(e){if(e instanceof Element)return e.closest(`.mv-node`)?.dataset.id}var De=60;function Oe(e){return[...e.positions.entries()].filter(([,e])=>e.folded!==!0).sort(([e,t],[n,r])=>{let i=Number(t.shelved===!0)-Number(r.shelved===!0);if(i!==0)return i;let a=Math.round(t.y/De)-Math.round(r.y/De);return a===0?t.x-r.x||e.localeCompare(n):a}).map(([e])=>e)}var ke=(0,q.memo)(function(e){let t=(0,J.c)(65),{nodes:n,edges:r,layout:i,exiting:a,settleExit:o,activate:s,lod:c,renderFace:l,onNodeClick:u,onEdgeClick:d,selectedId:f,litEdgeId:p}=e,m=(0,q.useRef)(null);be(m,i.edgePaths);let h;t[0]===i?h=t[1]:(h=Oe(i),t[0]=i,t[1]=h);let g=h,[_,v]=(0,q.useState)(null),y;t[2]!==_||t[3]!==g?(y=_!==null&&g.includes(_)?_:g[0]??null,t[2]=_,t[3]=g,t[4]=y):y=t[4];let b=y,x;t[5]!==g||t[6]!==b?(x=e=>{if(g.length===0)return;let t=b===null?0:g.indexOf(b),n=e===`first`?0:e===`last`?g.length-1:Math.min(g.length-1,Math.max(0,t+e)),r=g[n];v(r),document.querySelector(`.mv-node[data-id="${CSS.escape(r)}"]`)?.focus()},t[5]=g,t[6]=b,t[7]=x):x=t[7];let S=x,C;if(t[8]!==r){C=new Map;for(let e of r)e.label!==void 0&&C.set(e.id,e.label);t[8]=r,t[9]=C}else C=t[9];let w=C,{bbox:T}=i,E;if(t[10]!==r||t[11]!==n){let e=new Map(n.map(je));E=new Map;for(let t of r){let n=e.get(t.from);n!==void 0&&Number.isFinite(n)&&E.set(t.id,n)}t[10]=r,t[11]=n,t[12]=E}else E=t[12];let D=E,O;t[13]!==a||t[14]!==o?(O=a&&(0,Y.jsx)(Ce,{chrome:a.layout.chrome,bbox:a.layout.bbox,exiting:!0,onSettle:()=>o(a.token)},a.token),t[13]=a,t[14]=o,t[15]=O):O=t[15];let k;t[16]!==T||t[17]!==i.chrome||t[18]!==i.rep?(k=(0,Y.jsx)(Ce,{chrome:i.chrome,bbox:T},i.rep),t[16]=T,t[17]=i.chrome,t[18]=i.rep,t[19]=k):k=t[19];let A=T.w,j=T.h,M=`${T.x} ${T.y} ${T.w} ${T.h}`,N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Y.jsx)(ve,{}),t[20]=N):N=t[20];let P;if(t[21]!==w||t[22]!==D||t[23]!==i.edgePaths||t[24]!==p||t[25]!==d){let e;t[27]!==w||t[28]!==D||t[29]!==p||t[30]!==d?(e=e=>(0,Y.jsxs)(`g`,{className:`mv-edge-g`,"data-lit":p===e.id?``:void 0,"data-shift":ge(D.get(e.id)),style:D.has(e.id)?{"--mv-shift":D.get(e.id)}:void 0,onClick:d?()=>d(e.id):void 0,children:[w.has(e.id)&&(0,Y.jsx)(`title`,{children:w.get(e.id)}),d&&(0,Y.jsx)(`path`,{className:`mv-edge-hit`,d:e.d,fill:`none`}),(0,Y.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":``,style:e.width===void 0?void 0:{"--mv-edge-w":e.width}})]},e.id),t[27]=w,t[28]=D,t[29]=p,t[30]=d,t[31]=e):e=t[31],P=i.edgePaths.map(e),t[21]=w,t[22]=D,t[23]=i.edgePaths,t[24]=p,t[25]=d,t[26]=P}else P=t[26];let F;t[32]!==T.h||t[33]!==T.w||t[34]!==P||t[35]!==M?(F=(0,Y.jsxs)(`svg`,{ref:m,className:`mv-edges`,width:A,height:j,viewBox:M,"aria-hidden":`true`,children:[N,P]}),t[32]=T.h,t[33]=T.w,t[34]=P,t[35]=M,t[36]=F):F=t[36];let I;if(t[37]!==s||t[38]!==T.x||t[39]!==T.y||t[40]!==i.positions||t[41]!==c||t[42]!==S||t[43]!==n||t[44]!==u||t[45]!==l||t[46]!==b||t[47]!==f){let e;t[49]!==s||t[50]!==T.x||t[51]!==T.y||t[52]!==i.positions||t[53]!==c||t[54]!==S||t[55]!==u||t[56]!==l||t[57]!==b||t[58]!==f?(e=(e,t)=>{let n=i.positions.get(e.id);if(!n)return null;let r={"--nx":`${n.x+n.w/2-T.x}px`,"--ny":`${n.y+n.h/2-T.y}px`,"--mv-i":e.depth??t,...e.shift===void 0?{}:{"--mv-shift":e.shift}},a=u!==void 0&&!n.folded,o=n.folded?void 0:l,d=l?.(e,`entry`);return(0,Y.jsxs)(`div`,{className:`mv-node`,"data-id":e.id,"data-role":e.role,"data-tier":e.tier,"data-domain":e.domain,"data-series":e.series?.length?``:void 0,"data-face":n.face,"data-shelved":n.shelved?``:void 0,"data-folded":n.folded?``:void 0,"data-shift":ge(e.shift),"data-selected":f===e.id?``:void 0,"data-lod":c,style:r,"aria-hidden":n.folded?!0:void 0,role:a?`button`:void 0,tabIndex:a?e.id===b?0:-1:void 0,onFocus:a?()=>v(e.id):void 0,onClick:a?()=>s(e):void 0,onKeyDown:a?t=>{if(t.key===`Enter`||t.key===` `){t.preventDefault(),u?.(e);return}let n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:`first`,End:`last`}[t.key];n!==void 0&&(t.preventDefault(),S(n))}:void 0,children:[(0,Y.jsxs)(`div`,{className:`mv-face mv-face-card`,"aria-hidden":n.face!==`card`||void 0,children:[(0,Y.jsx)(`span`,{className:`mv-label`,children:e.label}),(0,Y.jsxs)(`span`,{className:`mv-card-foot`,children:[e.domain!==void 0&&(0,Y.jsx)(`span`,{className:`mv-domain`,title:e.domain,"aria-label":e.domain}),e.value!==void 0&&(0,Y.jsxs)(`span`,{className:`mv-value`,children:[e.value.toLocaleString(),e.unit??``]}),o?.(e,`card`),e.tier!==void 0&&(0,Y.jsx)(`span`,{className:`mv-tier`,children:e.tier})]})]}),(0,Y.jsx)(`div`,{className:`mv-face mv-face-entry`,"aria-hidden":n.face!==`entry`||void 0,children:(0,Y.jsxs)(`span`,{className:`mv-label`,children:[d,d?` `:null,e.label]})}),(0,Y.jsx)(`div`,{className:`mv-face mv-face-mark`,"aria-hidden":n.face!==`mark`||void 0,children:o?.(e,`mark`)})]},e.id)},t[49]=s,t[50]=T.x,t[51]=T.y,t[52]=i.positions,t[53]=c,t[54]=S,t[55]=u,t[56]=l,t[57]=b,t[58]=f,t[59]=e):e=t[59],I=n.map(e),t[37]=s,t[38]=T.x,t[39]=T.y,t[40]=i.positions,t[41]=c,t[42]=S,t[43]=n,t[44]=u,t[45]=l,t[46]=b,t[47]=f,t[48]=I}else I=t[48];let L;return t[60]!==F||t[61]!==I||t[62]!==O||t[63]!==k?(L=(0,Y.jsxs)(Y.Fragment,{children:[O,k,F,I]}),t[60]=F,t[61]=I,t[62]=O,t[63]=k,t[64]=L):L=t[64],L});function Ae({stage:e,world:t,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o}){let{cam:s,layout:c,exiting:l,lod:u,settleExit:d,morphing:f,settle:p}=e,{viewportRef:m,zoomAtClient:h,pan:g}=s,[_,v]=(0,q.useState)(!1),y=(0,q.useRef)(new Map),b=(0,q.useRef)(0),x=(0,q.useRef)(!1),S=(0,q.useRef)(!1),C=(0,q.useRef)(!1),w=(0,q.useRef)({x:0,y:0}),T=(0,q.useCallback)((t,n,r,i)=>{if(x.current){h(t,n,r);return}e.pinch(t,n,r,i)!==`zoom`&&(x.current=!0)},[e,h]),E=(0,q.useRef)(T);E.current=T,(0,q.useEffect)(()=>{let e=m.current;if(!e)return;let t,n=e=>{if(e.preventDefault(),p(),e.ctrlKey){E.current(Math.exp(-e.deltaY/100),e.clientX,e.clientY,Ee(e.target)),clearTimeout(t),t=setTimeout(()=>{x.current=!1},he);return}h(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{clearTimeout(t),e.removeEventListener(`wheel`,n)}},[m,h,p]);let D=()=>{let[e,t]=[...y.current.values()];return{x:(e.x+t.x)/2,y:(e.y+t.y)/2,d:Math.hypot(e.x-t.x,e.y-t.y)}},O=(0,q.useCallback)(e=>{if(p(),y.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),y.current.size>=2){e.currentTarget.setPointerCapture(e.pointerId),S.current=!1,v(!1),b.current=0;return}S.current=!0,C.current=!1,v(!0),w.current={x:e.clientX,y:e.clientY}},[p]),k=(0,q.useRef)({dx:0,dy:0}),A=(0,q.useRef)(0),j=(0,q.useCallback)(()=>{A.current!==0&&(cancelAnimationFrame(A.current),A.current=0);let{dx:e,dy:t}=k.current;(e!==0||t!==0)&&(k.current={dx:0,dy:0},g(e,t))},[g]),M=(0,q.useCallback)((e,t)=>{k.current.dx+=e,k.current.dy+=t,A.current===0&&(A.current=requestAnimationFrame(()=>{A.current=0;let e=k.current;k.current={dx:0,dy:0},(e.dx!==0||e.dy!==0)&&g(e.dx,e.dy)}))},[g]);(0,q.useEffect)(()=>()=>cancelAnimationFrame(A.current),[]);let N=(0,q.useCallback)(e=>{let t=y.current;if(!t.has(e.pointerId))return;if(t.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.size>=2){let{x:t,y:n,d:r}=D();if(b.current===0){b.current=r;return}let i=r/b.current;(i>me||i<1/me)&&(b.current=r,E.current(i,t,n,Ee(e.target)));return}if(!S.current)return;let n=e.clientX-w.current.x,r=e.clientY-w.current.y;Math.abs(n)+Math.abs(r)>pe&&!C.current&&(C.current=!0,e.currentTarget.setPointerCapture(e.pointerId)),w.current={x:e.clientX,y:e.clientY},M(n,r)},[M]),P=(0,q.useCallback)(e=>{j(),y.current.delete(e.pointerId),y.current.size<2&&(b.current=0,x.current=!1),y.current.size===0&&(S.current=!1,v(!1)),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},[j]),F=(0,q.useCallback)(e=>{C.current||r?.(e)},[r]),I=(0,q.useCallback)(e=>{e.propertyName===`transform`&&p()},[p]),{bbox:L}=c,R={transform:s.transform,width:L.w,height:L.h,"--mv-cam-scale":s.camera.scale};return(0,Y.jsx)(`div`,{className:`mv-viewport`,ref:m,"data-panning":_?`true`:void 0,style:{"--mv-cam-scale":s.camera.scale},onPointerDown:O,onPointerMove:N,onPointerUp:P,onPointerCancel:P,children:(0,Y.jsx)(`div`,{className:`mv-world`,style:R,"data-morphing":f?``:void 0,onTransitionEnd:I,children:(0,Y.jsx)(ke,{nodes:t.nodes,edges:t.edges,layout:c,exiting:l,settleExit:d,activate:F,lod:u,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o})})})}function je(e){return[e.id,e.shift]}function Me(e,t){return e===`in`?`zoom-camera`:t?`ascend`:`zoom-camera`}var Ne={graph:{chip:`Graph`,caption:`What caused what`,legend:`Left to right is what led to what. Colour is the direction of the push; thickness is how much of the outcome the link explains.`},flow:{chip:`Contribution`,caption:`How much each one contributed`,legend:`Ribbon thickness is how much of the outcome that link was MEASURED to explain. A cause whose links carry no measured share is held aside rather than drawn thin, which would read as a finding nobody made.`},timeline:{chip:`Over time`,caption:`The same causes, in time`,legend:`Left to right is WHEN, read against the axis below; a bar is how long a cause lasted. Height only keeps entries from overlapping — it means nothing.`},spheres:{chip:`Spheres`,caption:`What kinds of force`,legend:`Each lane is a sphere the causes belong to. A link that CHANGES lane is a handoff between kinds of force and is drawn at full weight; one that stays inside a lane goes faint. A cause the answer put in no single sphere is held aside rather than filed under one it does not belong to.`},chart:{chip:`As a chart`,caption:`How much each one moved`,legend:`Each mark is a cause plotted against its own measured history. Causes with nothing measured are held aside rather than drawn at zero.`}},Pe={min:ne,max:2.2},Fe=56,Ie=1300,Le=1300,X=.7,Re=120,ze=120,Be={graph:K,timeline:R,chart:U,flow:z,spheres:G},Ve=e=>({x:0,y:0,w:e.w,h:e.h}),He=(e,t,n)=>[t-e.x,n-e.y];function Ue(e,t,n){let r=e.positions.get(t);if(!r)return null;let i=r.x,a=r.y,o=r.x+r.w,s=r.y+r.h;for(let r of n.get(t)??[]){let t=e.positions.get(r);!t||t.folded||(i=Math.min(i,t.x),a=Math.min(a,t.y),o=Math.max(o,t.x+t.w),s=Math.max(s,t.y+t.h))}let[c,l]=He(e.bbox,i-Re,a-Re);return{x:c,y:l,w:o-i+240,h:s-a+240}}function We(e){let{world:t,onAscend:n,driverId:r,insetBottom:i}=e,[a,o]=(0,q.useState)(e.initialRep??`graph`),[s,c]=(0,q.useState)(()=>new Set),[d,f]=(0,q.useState)(null),p=u({clamp:Pe,margin:Fe,...i===void 0?{}:{insetBottom:i}}),m=(0,q.useRef)(void 0),{viewport:h}=p,g=(0,q.useMemo)(()=>h?{w:Math.max(1,h.w-112),h:Math.max(1,h.h-112)}:void 0,[h]),_=(0,q.useMemo)(()=>Be[a](t,{expandedIds:s,previous:m.current,...g?{viewport:g}:{}}),[a,t,s,g]);(0,q.useEffect)(()=>{let e=new Map;for(let[t,n]of _.positions)e.set(t,{x:n.x,y:n.y});m.current=e},[_]);let v=(0,q.useRef)(a);v.current=a;let y=(0,q.useRef)(_);y.current=_;let b=(0,q.useRef)(p.camera);b.current=p.camera;let S=(0,q.useRef)(s);S.current=s;let C=(0,q.useRef)(n);C.current=n;let[w,T]=(0,q.useState)(null),{endFlight:E}=p,D=(0,q.useCallback)(()=>{T({layout:y.current,rep:v.current,expandedIds:S.current}),E()},[E]),O=(0,q.useRef)(0),k=(0,q.useRef)(void 0);(0,q.useEffect)(()=>()=>clearTimeout(k.current),[]);let A=(0,q.useCallback)(e=>{if(e===v.current)return;let t=++O.current;f({layout:y.current,token:t}),clearTimeout(k.current),k.current=setTimeout(()=>{t===O.current&&f(null)},Ie),v.current=e,o(e)},[]),j=(0,q.useCallback)(e=>{e===O.current&&(clearTimeout(k.current),f(null))},[]),M=(0,q.useRef)(null),N=(0,q.useCallback)(e=>{let t=new Set(S.current);t.delete(e)||(t.add(e),U.current(e)&&(M.current=e)),c(t)},[]),P=(0,q.useMemo)(()=>{let e=new Map;for(let n of t.nodes){if(n.parentId===void 0)continue;let t=e.get(n.parentId);t?t.push(n.id):e.set(n.parentId,[n.id])}return e},[t]),{fitTo:F,setCamera:I,viewportRef:L}=p;(0,q.useEffect)(()=>{let e=M.current;if(M.current=null,e!==null){let t=Ue(_,e,P);if(t){F(t);return}}F(Ve(_.bbox))},[_,P,F,I,L]);let R=(0,q.useMemo)(()=>new Map(t.nodes.map(e=>[e.id,e.parentId])),[t]),z=(0,q.useMemo)(()=>{let e=new Set;for(let t of R.values())t!==void 0&&e.add(t);return e},[R]),B=(0,q.useCallback)(e=>{let t=0,n=e,r=new Set;for(;n!==void 0&&!r.has(n);)r.add(n),n=R.get(n),n!==void 0&&(t+=1);return t},[R]),V=a===`graph`,H=(0,q.useCallback)(e=>{if(!V)return!1;let t=_.positions.get(e);return t===void 0||t.folded===!0||t.shelved===!0?!1:B(e)+1<=2},[V,_,B]),U=(0,q.useRef)(H);U.current=H;let{zoomAtClient:W}=p,G=(0,q.useCallback)((e,t,n,r)=>{if(e>=1)return r!==void 0&&z.has(r)&&!S.current.has(r)&&U.current(r)?(N(r),`expand`):(W(e,t,n),`zoom`);let i=L.current?.getBoundingClientRect();if(Me(`out`,!!i&&(i.width>0||i.height>0)&&l(b.current,Ve(y.current.bbox),{w:i.width,h:i.height},Fe,Pe))===`zoom-camera`)return W(e,t,n),`zoom`;let a=[...S.current];if(a.length>0){let e=a[0],t=B(e);for(let n of a){let r=B(n);r>t&&(e=n,t=r)}return N(e),`collapse`}return C.current?.(),`ascend`},[z,N,W,L,B]),ee=(0,q.useCallback)(e=>{let t=y.current,n=e===null?void 0:t.positions.get(e);if(!n||n.folded){F(Ve(t.bbox));return}let[r,i]=He(t.bbox,n.x-ze,n.y-ze);F({x:r,y:i,w:n.w+240,h:n.h+240})},[F]);(0,q.useEffect)(()=>{if(r!==void 0)return x(r,{count:te.length,setIndex:e=>A(te[Math.min(te.length-1,Math.max(0,Math.trunc(e)))]),spokenFor:()=>void 0,captionFor:e=>{let t=te[e];return t?Ne[t].caption:void 0}})},[r,A]);let K=w?.layout!==_||p.flying;return(0,q.useEffect)(()=>{if(!K)return;let e=setTimeout(D,Le);return()=>clearTimeout(e)},[K,_,D]),{rep:a,setRep:A,layout:_,exiting:d,settleExit:j,expandedIds:s,toggleExpand:N,expandable:z,unfoldsOnStage:H,cam:p,morphing:K,settle:D,lod:p.camera.scale>=X?`near`:`far`,pinch:G,focusNode:ee}}function Ge({label:e,min:t,max:n,step:r=1,value:i,onChange:a,format:o,color:s=`var(--presence)`}){let c=n-t||1,l=(i-t)/c*100;return(0,Y.jsxs)(`label`,{className:`viz-ctl`,style:{"--ctl-c":s,"--ctl-pct":l+`%`},children:[(0,Y.jsx)(`span`,{className:`viz-ctl-label`,children:e}),(0,Y.jsx)(`input`,{type:`range`,className:`viz-ctl-range`,min:t,max:n,step:r,value:i,"aria-label":e,onChange:e=>a(Number(e.target.value))}),(0,Y.jsx)(`span`,{className:`viz-ctl-val tab-num`,children:o?o(i):i.toLocaleString()})]})}var Ke=`No cause is established yet, so there is nothing to push on.`;function qe(e){let t=(0,J.c)(17),{levers:n,onSet:r,onReset:i}=e,a;t[0]===n?a=t[1]:(a=n.every(Je),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`WHAT IF`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==o?(c=(0,Y.jsxs)(`div`,{className:`tr-levers-head`,children:[s,(0,Y.jsx)(`button`,{type:`button`,className:`tr-reset`,onClick:i,disabled:o,children:`Reset`})]}),t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n.length?l=t[7]:(l=n.length===0&&(0,Y.jsx)(`p`,{className:`tr-levers-empty`,children:Ke}),t[6]=n.length,t[7]=l);let u;if(t[8]!==n||t[9]!==r){let e;t[11]===r?e=t[12]:(e=e=>(0,Y.jsx)(Ge,{label:e.label,min:0,max:100,value:e.pct,onChange:t=>r(e.id,t),format:Z},e.id),t[11]=r,t[12]=e),u=n.map(e),t[8]=n,t[9]=r,t[10]=u}else u=t[10];let d;return t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Y.jsxs)(`div`,{className:`tr-levers`,children:[c,l,u]}),t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function Z(e){return`${e}%`}function Je(e){return e.pct===100}var Ye=(0,q.memo)(qe),Xe=(0,q.createContext)(null);function Ze(){return(0,q.useContext)(Xe)}function Qe(e){let t=(0,J.c)(19),{id:n,className:r}=e,i=Ze(),a,o,s,c,l,u;if(t[0]!==r||t[1]!==n||t[2]!==i){u=Symbol.for(`react.early_return_sentinel`);bb0:{let e=i?.registry.values.get(n);if(!e){u=null;break bb0}let d=`tr-num`+(r?` ${r}`:``);if(e.kind===`structure`){u=(0,Y.jsx)(`span`,{className:`${d} tr-num-qual`,"data-status":`structure`,children:e.resolution.raw});break bb0}a=`button`,o=d,s=ae(e),t[9]!==n||t[10]!==i?(c=e=>i?.open(n,e.currentTarget),t[9]=n,t[10]=i,t[11]=c):c=t[11],l=h(e)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsx)(`span`,{className:`tr-sr`,children:`, source available`}),t[12]=d):d=t[12];let f;return t[13]!==a||t[14]!==o||t[15]!==s||t[16]!==c||t[17]!==l?(f=(0,Y.jsxs)(`button`,{type:a,className:o,"data-status":s,onClick:c,children:[l,d]}),t[13]=a,t[14]=o,t[15]=s,t[16]=c,t[17]=l,t[18]=f):f=t[18],f}var Q=8,$e=6;function et(e,t,n){return Math.max(Q,Math.min(e,n-t-Q))}function tt(e,t,n){if(!(e.width>0||e.height>0||e.left>0||e.top>0))return{left:et((n.w-t.w)/2,t.w,n.w),top:et((n.h-t.h)/2,t.h,n.h)};let r=e.bottom+$e,i=e.top-$e-t.h,a=r+t.h+Q>n.h&&i>=Q;return{left:et(e.left,t.w,n.w),top:et(a?i:r,t.h,n.h)}}var $=320,nt=340,rt=8;function it(e){let t=(0,J.c)(64),{registry:n,valueId:r,anchorRect:i,trail:a,hinted:o,onMarkHinted:s,onDrill:l,onBack:u,onNavigate:d,onDismiss:f}=e,p=(0,q.useRef)(null),v;t[0]===f?v=t[1]:(v={onEscape:f},t[0]=f,t[1]=v),c(p,v);let[x]=(0,q.useState)(!o),S,C;t[2]===s?(S=t[3],C=t[4]):(S=()=>s(),C=[s],t[2]=s,t[3]=S,t[4]=C),(0,q.useEffect)(S,C);let w=(0,q.useRef)(!0),T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{w.current||p.current?.focus({preventScroll:!0}),w.current=!1},t[5]=T):T=t[5];let E;t[6]===r?E=t[7]:(E=[r],t[6]=r,t[7]=E),(0,q.useEffect)(T,E);let D,O;t[8]===f?(D=t[9],O=t[10]):(D=()=>{let e=e=>{let t=p.current;t&&e.target instanceof Node&&!t.contains(e.target)&&f()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},O=[f],t[8]=f,t[9]=D,t[10]=O),(0,q.useEffect)(D,O);let k=n.values,A,j,M,N,P,F,I,L,R,z,B,V,H,U;if(t[11]!==i||t[12]!==u||t[13]!==l||t[14]!==d||t[15]!==n.usedIn||t[16]!==n.values||t[17]!==a||t[18]!==r){V=Symbol.for(`react.early_return_sentinel`);bb0:{if(U=k.get(r),!U){V=null;break bb0}let e=ae(U),o=U.scope,s=n.usedIn.get(r)??[],c=U.kind===`grounded`?U.resolution.receipt:null,f=U.kind===`grounded`&&U.resolution.tier===`T1`,v=c?.url?y(c.url):null,x=c?c.host??(c.url?b(c.url):null):null,S=U.kind===`calculated`?U.calc.inputs:[],C=S.slice(0,rt),w=S.length-C.length,T;t[33]!==n.values||t[34]!==a?(T=a.length>0?n.values.get(a[a.length-1]):void 0,t[33]=n.values,t[34]=a,t[35]=T):T=t[35];let E=T,D;t[36]===i?D=t[37]:(D=tt(i,{w:$,h:nt},{w:window.innerWidth,h:window.innerHeight}),t[36]=i,t[37]=D);let{left:O,top:W}=D;H=p,A=`tr-card`,j=`dialog`,M=`false`,N=`Where ${U.label} came from`,P=-1,t[38]!==O||t[39]!==W?(F={left:O,top:W,width:$,maxHeight:nt},t[38]=O,t[39]=W,t[40]=F):F=t[40];let G;t[41]!==u||t[42]!==E?(G=E&&(0,Y.jsxs)(`button`,{type:`button`,className:`tr-back`,onClick:u,"aria-label":`Back to ${E.label}`,children:[`‹ back`,(0,Y.jsxs)(`span`,{className:`tr-back-to`,children:[` to `,E.label]})]}),t[41]=u,t[42]=E,t[43]=G):G=t[43],I=(0,Y.jsxs)(`header`,{className:`tr-head`,children:[G,(0,Y.jsx)(`span`,{className:`tr-badge`,"data-status":e,children:_[e]}),(0,Y.jsx)(`p`,{className:`tr-figure`,children:h(U)}),(0,Y.jsx)(`p`,{className:`tr-label`,children:U.label})]}),L=c&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`SOURCE`}),c.quote&&(0,Y.jsxs)(`blockquote`,{className:`tr-quote`,children:[`“`,c.quote,`”`]}),f?(0,Y.jsx)(`p`,{className:`tr-host`,children:m(c)}):x&&(0,Y.jsxs)(`p`,{className:`tr-host`,children:[v?(0,Y.jsx)(`a`,{href:v,target:`_blank`,rel:`noreferrer noopener`,children:x}):x,c.date&&(0,Y.jsxs)(`span`,{className:`tr-date`,children:[` · `,c.date]})]})]}),R=o&&(o.region||o.period||o.unit)&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`SCOPE`}),(0,Y.jsx)(`p`,{className:`tr-chips`,children:[o.region,o.period,o.unit].filter(ot).map(at)})]}),z=U.kind===`calculated`&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`CALCULATION`}),(0,Y.jsx)(`p`,{className:`tr-formula`,children:g(U.calc.formula,e=>n.values.get(e)?.label)}),(0,Y.jsx)(`ul`,{className:`tr-inputs`,children:C.map(e=>{let t=n.values.get(e);return(0,Y.jsx)(`li`,{children:t?(0,Y.jsxs)(`button`,{type:`button`,className:`tr-input`,onClick:()=>l(e),children:[(0,Y.jsx)(`span`,{className:`tr-input-label`,children:t.label}),(0,Y.jsx)(`span`,{className:`tr-input-val`,children:h(t)})]}):(0,Y.jsx)(`span`,{className:`tr-input tr-input-missing`,children:e})},e)})}),w>0&&(0,Y.jsxs)(`p`,{className:`tr-more`,children:[`…and `,w,` more`]}),U.calc.note&&(0,Y.jsx)(`p`,{className:`tr-note`,children:U.calc.note})]}),B=s.length>0&&(0,Y.jsxs)(`section`,{className:`tr-sec`,children:[(0,Y.jsx)(`h3`,{className:`tr-sec-title`,children:`USED IN`}),(0,Y.jsx)(`ul`,{className:`tr-used`,children:s.map(e=>(0,Y.jsx)(`li`,{children:d?(0,Y.jsx)(`button`,{type:`button`,className:`tr-usedin`,onClick:()=>d(e),children:e.label}):(0,Y.jsx)(`span`,{className:`tr-usedin tr-usedin-flat`,children:e.label})},`${e.surface}:${e.id}:${e.label}`))})]})}t[11]=i,t[12]=u,t[13]=l,t[14]=d,t[15]=n.usedIn,t[16]=n.values,t[17]=a,t[18]=r,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P,t[24]=F,t[25]=I,t[26]=L,t[27]=R,t[28]=z,t[29]=B,t[30]=V,t[31]=H,t[32]=U}else A=t[19],j=t[20],M=t[21],N=t[22],P=t[23],F=t[24],I=t[25],L=t[26],R=t[27],z=t[28],B=t[29],V=t[30],H=t[31],U=t[32];if(V!==Symbol.for(`react.early_return_sentinel`))return V;let W;t[44]!==U.kind||t[45]!==U.resolution?(W=U.kind===`illustrative`&&(0,Y.jsxs)(`p`,{className:`tr-caveat`,children:[`Illustrative — shows the shape, not a measured fact. `,U.resolution.illustrative]}),t[44]=U.kind,t[45]=U.resolution,t[46]=W):W=t[46];let G;t[47]===x?G=t[48]:(G=x&&(0,Y.jsx)(`p`,{className:`tr-hint`,children:`Any figure like this one opens its own receipt.`}),t[47]=x,t[48]=G);let ee;return t[49]!==A||t[50]!==j||t[51]!==M||t[52]!==N||t[53]!==P||t[54]!==F||t[55]!==I||t[56]!==L||t[57]!==R||t[58]!==z||t[59]!==B||t[60]!==W||t[61]!==G||t[62]!==H?(ee=(0,Y.jsxs)(`div`,{ref:H,className:A,role:j,"aria-modal":M,"aria-label":N,tabIndex:P,style:F,children:[I,L,R,z,B,W,G]}),t[49]=A,t[50]=j,t[51]=M,t[52]=N,t[53]=P,t[54]=F,t[55]=I,t[56]=L,t[57]=R,t[58]=z,t[59]=B,t[60]=W,t[61]=G,t[62]=H,t[63]=ee):ee=t[63],ee}function at(e){return(0,Y.jsx)(`span`,{className:`tr-chip`,children:e},e)}function ot(e){return!!e}function st(e){let t=(0,J.c)(23),{registry:n,onNavigate:r,children:i,ref:a}=e,[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(null),t[0]=u):u=t[0];let d;t[1]===n?d=t[2]:(d=[n],t[1]=n,t[2]=d),(0,q.useEffect)(u,d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>s(null),t[3]=f):f=t[3];let p=f,m,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>({dismiss:p}),h=[p],t[4]=m,t[5]=h):(m=t[4],h=t[5]),(0,q.useImperativeHandle)(a,m,h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(e,t)=>{t.focus(),s({valueId:e,anchorRect:t.getBoundingClientRect(),trail:[]})},t[6]=g):g=t[6];let _=g,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>l(!0),t[7]=v):v=t[7];let y=v,b;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{s(t=>t&&{valueId:e,anchorRect:t.anchorRect,trail:[...t.trail,t.valueId]})},t[8]=b):b=t[8];let x=b,S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(ct)},t[9]=S):S=t[9];let C=S,w;t[10]!==c||t[11]!==r||t[12]!==n?(w={registry:n,open:_,onNavigate:r,hinted:c,markHinted:y},t[10]=c,t[11]=r,t[12]=n,t[13]=w):w=t[13];let T=w,E;t[14]!==o||t[15]!==c||t[16]!==r||t[17]!==n?(E=o&&(0,Y.jsx)(it,{registry:n,valueId:o.valueId,anchorRect:o.anchorRect,trail:o.trail,hinted:c,onMarkHinted:y,onDrill:x,onBack:C,onNavigate:r,onDismiss:p}),t[14]=o,t[15]=c,t[16]=r,t[17]=n,t[18]=E):E=t[18];let D;return t[19]!==i||t[20]!==E||t[21]!==T?(D=(0,Y.jsxs)(Xe.Provider,{value:T,children:[i,E]}),t[19]=i,t[20]=E,t[21]=T,t[22]=D):D=t[22],D}function ct(e){let t=e?.trail[e.trail.length-1];return!e||t===void 0?e:{valueId:t,anchorRect:e.anchorRect,trail:e.trail.slice(0,-1)}}var lt=`Recomputed locally from the causes above — a model of what would happen, never an observation.`,ut=`What was actually measured. This column never moves when a lever is pulled.`;function dt(e,t){return(e>0?`+`:``)+d(e,t)}function ft(e){return e!==null&&Number.isFinite(e)&&e>=0&&e<=1}function pt(e){return e.exactBase===null?`nothing measured stands behind this outcome`:`not every step is grounded, so the total stays unmeasured`}function mt(e){let t=(0,J.c)(22),{baseline:n,current:r,unit:i,active:a,observedNote:o}=e,s;t[0]!==n.exactBase||t[1]!==n.fullyGrounded||t[2]!==i?(s=n.fullyGrounded&&n.exactBase!==null?d(n.exactBase,i):null,t[0]=n.exactBase,t[1]=n.fullyGrounded,t[2]=i,t[3]=s):s=t[3];let c=s,l=r.exactBase??n.exactBase,u=a?`1`:void 0,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(`span`,{className:`tr-chip tr-wi-chip`,title:ut,children:`OBSERVED`}),t[4]=f):f=t[4];let p;t[5]!==n||t[6]!==c||t[7]!==o?(p=(0,Y.jsxs)(`div`,{className:`tr-wi-col`,children:[f,c===null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}),(0,Y.jsx)(`p`,{className:`tr-wi-note tr-wi-why`,children:o??pt(n)})]}):(0,Y.jsx)(`p`,{className:`tr-wi-figure`,children:c})]}),t[5]=n,t[6]=c,t[7]=o,t[8]=p):p=t[8];let m;t[9]!==a||t[10]!==l||t[11]!==r.exactDelta||t[12]!==r.explainedPct||t[13]!==r.fullyGrounded||t[14]!==r.relBase||t[15]!==r.relCur||t[16]!==i?(m=a&&(0,Y.jsxs)(`div`,{className:`tr-wi-col tr-wi-hypo`,"data-world":`hypothetical`,children:[(0,Y.jsx)(`span`,{className:`tr-chip tr-wi-chip tr-wi-chip-hypo`,title:lt,children:`HYPOTHETICAL (MODELED)`}),r.fullyGrounded&&l!==null&&r.exactDelta!==null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`tr-wi-figure`,children:d(l+r.exactDelta,i)}),(0,Y.jsx)(`p`,{className:`tr-wi-delta`,children:dt(r.exactDelta,i)}),ft(r.explainedPct)&&(0,Y.jsxs)(`p`,{className:`tr-wi-note`,children:[Math.round(r.explainedPct*100),`% explained`]})]}):r.relCur===null?(0,Y.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`tr-wi-figure tr-wi-phrase`,children:le(r.relBase??0,r.relCur)}),(0,Y.jsx)(`p`,{className:`tr-wi-note`,children:`relative, not measured`})]})]}),t[9]=a,t[10]=l,t[11]=r.exactDelta,t[12]=r.explainedPct,t[13]=r.fullyGrounded,t[14]=r.relBase,t[15]=r.relCur,t[16]=i,t[17]=m):m=t[17];let h;return t[18]!==u||t[19]!==p||t[20]!==m?(h=(0,Y.jsxs)(`div`,{className:`tr-wi`,"data-active":u,children:[p,m]}),t[18]=u,t[19]=p,t[20]=m,t[21]=h):h=t[21],h}var ht=(0,q.memo)(mt);function gt(e){return{id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...e.unit?{unit:e.unit}:{},...e.receipt?{receipt:e.receipt}:{}}}function _t(e){let t=e.receipts?.[0]??e.receipt;return{from:e.from,to:e.to,sign:e.sign,tier:e.tier,...e.verb?{verb:e.verb}:{},...e.weight===void 0?{}:{weight:e.weight},...t&&!e.provisional?{receipt:t}:{},...e.provisional?{provisional:!0}:{}}}function vt(e){return{center:e.title,outcomeId:e.outcomeId,nodes:e.nodes.map(gt),edges:e.edges.map(_t),provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...e.provenance.notes?.length?{notes:e.provenance.notes}:{}}}}var yt=e=>`node:${e}`,bt=(e,t)=>`node:${e}@${t}`;function xt(e,t){let n=e.provenance.illustrative===!0,r=[],i=[],a=[],o=new Map,s=[],c=new Map,l=(e,t,n)=>{!e||o.has(e.id)||(o.set(e.id,e),s.push(t),i.push(n))},u=(e,t)=>{c.set(e.id,e.label),r.push({id:e.id,label:e.label,role:e.role,...e.detail===void 0?{}:{detail:e.detail},...e.domain===void 0?{}:{domain:e.domain},...t===void 0?{}:{parentId:t}});let i=e.series,a=e.unit??i?.unit,o=t=>({valueId:t,surface:`node`,id:e.id,label:e.label});if(e.value!==void 0){let t=yt(e.id);l(F(t,e.label,e.value,e.tier,a,e.receipt,n),o(t),{valueId:t,entityId:e.id})}if(i)for(let t of i.points){let r=bt(e.id,t.t),a=F(r,`${e.label} · ${t.t}`,t.value,i.tier,i.unit,t.receipt??i.receipt,n,t.t);l(a,o(r),{valueId:r,entityId:e.id,at:t.t})}for(let t of e.children??[])u(t,e.id)};for(let t of e.nodes)u(t);return B(e.edges).forEach((e,n)=>{let r=`${c.get(e.from)??e.from} ${e.verb??`→`} ${c.get(e.to)??e.to}`,i=t.edges[n]?.id;if(i!==void 0){a.push({id:i,from:e.from,to:e.to,...e.relation===void 0?{}:{kind:e.relation},...e.sign===void 0?{}:{sign:e.sign},...e.weight===void 0?{}:{weight:e.weight}});for(let t of[e.from,e.to])s.push({valueId:yt(t),surface:`edge`,id:i,label:r})}}),{title:e.title,entities:r,relations:a,facts:i,trust:I(o,s),outcomeId:e.outcomeId,...n?{illustrative:n}:{}}}var St=1100;function Ct(e,t,n,r){let i=!1,a=e=>{i||(i=!0,r(e))};(async()=>{for(let r=Math.max(0,t);r<e.length;r++){let t=e[r];if(!t)continue;if(n.isCancelled()){a(`cancelled`);return}let i=E(t.say),o=n.speakLine?.(t.say)??null,s=o?await T(o):!1;if(n.isCancelled()){a(`cancelled`);return}n.apply(t,r),o&&s?await O(o,i,St):await D(i)}a(n.isCancelled()?`cancelled`:`complete`)})()}function wt({beats:e,apply:t,speakLine:n}){let[r,i]=(0,q.useState)(-1),[a,o]=(0,q.useState)(!1),s=(0,q.useRef)(0),c=(0,q.useRef)(e);c.current=e;let l=(0,q.useRef)(t);l.current=t;let u=(0,q.useRef)(n);u.current=n;let d=(0,q.useCallback)(()=>{s.current+=1,o(!1)},[]),f=(0,q.useCallback)(e=>{let t=s.current+=1;o(!0),Ct(c.current,e,{speakLine:e=>u.current?.(e)??null,apply:(e,t)=>{i(t),l.current(e,t)},isCancelled:()=>s.current!==t},()=>{s.current===t&&o(!1)})},[]);(0,q.useEffect)(()=>()=>void(s.current+=1),[]),(0,q.useEffect)(()=>{s.current+=1,o(!1),i(-1)},[e]);let p=(0,q.useCallback)(()=>{if(a){d();return}let e=c.current.length;e!==0&&f(r>=0&&r<e-1?r:0)},[a,r,f,d]),m=(0,q.useCallback)(e=>{let t=c.current.length;t!==0&&f(Math.min(Math.max(e,0),t-1))},[f]),h=(0,q.useCallback)(()=>{d(),i(-1)},[d]);return{index:r,playing:a,caption:r>=0?e[r]?.caption??null:null,toggle:p,seek:m,reset:h}}function Tt(e){let t=(0,J.c)(33),{count:n,index:r,playing:i,caption:a,expanded:o,onToggle:s,onSeek:c,inviting:l}=e;if(n===0)return null;let u=Math.min(Math.max(r,-1),n-1),d=i?``:void 0,f=o?``:void 0,p=`${o?108:54}px`,m;t[0]===p?m=t[1]:(m={"--wo-transport-h":p},t[0]=p,t[1]=m);let h=m,g=l&&!i?``:void 0,_=i?`Pause the walkthrough`:`Walk me through it`,v=i?`❙❙`:`▶`,y;t[2]===v?y=t[3]:(y=(0,Y.jsx)(`span`,{className:`wo-play-glyph`,"aria-hidden":`true`,children:v}),t[2]=v,t[3]=y);let b=i?`Pause`:`Walk me through it`,x;t[4]===b?x=t[5]:(x=(0,Y.jsx)(`span`,{className:`wo-play-label`,children:b}),t[4]=b,t[5]=x);let S;t[6]!==s||t[7]!==x||t[8]!==g||t[9]!==_||t[10]!==y?(S=(0,Y.jsxs)(`button`,{type:`button`,className:`wo-play`,"data-inviting":g,onClick:s,"aria-label":_,children:[y,x]}),t[6]=s,t[7]=x,t[8]=g,t[9]=_,t[10]=y,t[11]=S):S=t[11];let C;t[12]!==l||t[13]!==i?(C=l&&!i&&(0,Y.jsx)(`span`,{className:`wo-play-aside`,children:`or press any cause`}),t[12]=l,t[13]=i,t[14]=C):C=t[14];let w;t[15]!==u||t[16]!==n||t[17]!==o||t[18]!==c?(w=o&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`wo-track`,role:`group`,"aria-label":`Walkthrough beats`,children:Array.from({length:n},(e,t)=>(0,Y.jsx)(`button`,{type:`button`,className:`wo-tick`,"data-state":t<u?`past`:t===u?`now`:`ahead`,onClick:()=>c(t),"aria-label":`Beat ${t+1} of ${n}`,"aria-current":t===u?`step`:void 0},t))}),(0,Y.jsxs)(`span`,{className:`wo-transport-count`,"aria-hidden":`true`,children:[u<0?n:u+1,`/`,n]})]}),t[15]=u,t[16]=n,t[17]=o,t[18]=c,t[19]=w):w=t[19];let T;t[20]!==S||t[21]!==C||t[22]!==w?(T=(0,Y.jsxs)(`div`,{className:`wo-transport-row`,children:[S,C,w]}),t[20]=S,t[21]=C,t[22]=w,t[23]=T):T=t[23];let E;t[24]!==a||t[25]!==o?(E=o&&(0,Y.jsx)(`p`,{className:`wo-caption`,"aria-live":`polite`,children:a===null?``:k(a)}),t[24]=a,t[25]=o,t[26]=E):E=t[26];let D;return t[27]!==d||t[28]!==T||t[29]!==E||t[30]!==f||t[31]!==h?(D=(0,Y.jsxs)(`div`,{className:`wo-transport`,"data-playing":d,"data-open":f,style:h,children:[T,E]}),t[27]=d,t[28]=T,t[29]=E,t[30]=f,t[31]=h,t[32]=D):D=t[32],D}var Et=170,Dt={contributes:`fed by`,causes:`driven by`,dampens:`held back by`,enables:`made possible by`,correlates:`moving together with`},Ot={1:`pushed up by`,[-1]:`pushed down by`};function kt(e){let t=e.split(` `,1)[0]??``;return t.length===0||/[A-Z]/.test(t.slice(1))?e:e[0].toLowerCase()+e.slice(1)}var At={graph:`And that is how the causes fit together.`,timeline:`And here are the same causes, in time.`,chart:`And here is what each one actually measured.`,flow:`And here is how much each one contributed.`,spheres:`And here are the kinds of force it is made of.`};function jt(e,t){let n=e.values.get(yt(t));if(!n||n.kind===`structure`)return null;let r=h(n);return n.kind===`illustrative`?{say:`Illustratively, about ${r}.`,shown:`Illustratively, about ${r}.`}:{say:`Measured at ${r}.`,shown:`Measured at ${r}.`}}function Mt(e){return e.kind?e.kind===`dampens`||e.kind===`enables`||e.kind===`correlates`:e.sign===-1}function Nt(e){return e.kind&&Dt[e.kind]?Dt[e.kind]:Ot[e.sign??1]??`fed by`}function Pt(e){let t=e.nodes.filter(e=>e.parentId===void 0),n=new Set(t.map(e=>e.id)),r=e.edges.filter(e=>n.has(e.from)&&n.has(e.to)),i=new Map(t.map(e=>[e.id,e.depth??0])),a=new Map;for(let e of r)a.set(e.from,(a.get(e.from)??0)+(e.weight??0));let o=new Map(t.map(e=>[e.id,0]));for(let e of r)o.set(e.to,(o.get(e.to)??0)+1);let s=(e,t)=>(i.get(e)??0)-(i.get(t)??0)||(a.get(t)??0)-(a.get(e)??0)||(e<t?-1:+(e>t)),c=t.filter(e=>o.get(e.id)===0).map(e=>e.id),l=[],u=new Set;for(;c.length>0;){c.sort(s);let e=c.shift();if(!(e===void 0||u.has(e))){u.add(e),l.push(e);for(let t of r){if(t.from!==e)continue;let n=(o.get(t.to)??0)-1;o.set(t.to,n),n<=0&&!u.has(t.to)&&c.push(t.to)}}}for(let e of t.map(e=>e.id).sort(s))u.has(e)||l.push(e);return l}function Ft(e,t,n,r={}){let i=Pt(t);if(i.length<2)return[];let a=new Map(e.nodes.map(e=>[e.id,e])),o=new Map(t.nodes.map(e=>[e.id,e.label])),s=new Map(i.map((e,t)=>[e,t])),c=e=>t.edges.filter(t=>t.to===e&&s.has(t.from)&&(s.get(t.from)??0)<(s.get(e)??0)).sort((e,t)=>(t.weight??0)-(e.weight??0)||(e.id<t.id?-1:1))[0],l=[],u=i.at(-1)===e.outcomeId?i.length-1:i.length,d=u===1?`One cause, one outcome. Here is how it connects.`:`${u} causes, one outcome. Here is how they connect.`;l.push({nodeId:e.outcomeId,wide:!0,rep:`graph`,say:d,caption:d});let f=null;for(let[t,r]of i.entries()){let s=a.get(r),u=o.get(r)??r,d=c(r),p=r===e.outcomeId&&t===i.length-1,m=d?o.get(d.from)??d.from:null,h;h=p?d?`And it ends here: ${kt(u)}, ${Nt(d)} ${d.from===f?`it`:kt(m??``)}.`:`And it ends here: ${kt(u)}.`:d?d.from===f?Mt(d)?`Then ${kt(u)}, ${Nt(d)} it.`:`Then ${kt(u)}.`:`${u}, ${Nt(d)} ${kt(m??``)}.`:t===0?`It starts with ${kt(u)}.`:`Alongside it: ${u}.`,f=r;let g=[h],_=[h],v=jt(n,r);v&&(g.push(v.say),_.push(v.shown));let y=s?.detail;y&&(g.push(w(S(y),Et)),_.push(w(C(y),Et))),l.push({nodeId:r,...d?{edgeId:d.id}:{},say:g.join(` `),caption:_.join(` `)})}if(r.closeOn){let t=At[r.closeOn];l.push({nodeId:e.outcomeId,wide:!0,rep:r.closeOn,say:t,caption:t})}return l}var It={economy:`var(--domain-economy)`,policy:`var(--domain-policy)`,technology:`var(--domain-technology)`,science:`var(--domain-science)`,environment:`var(--domain-environment)`,society:`var(--domain-society)`,health:`var(--domain-health)`,conflict:`var(--domain-conflict)`},Lt=.5;function Rt(e){let t=e.nodes.filter(e=>e.parentId===void 0);if(t.length===0)return null;let n=new Map;for(let e of t)e.domain!==void 0&&n.set(e.domain,(n.get(e.domain)??0)+1);if([...n.values()].reduce((e,t)=>e+t,0)/t.length<Lt)return null;let r=[...n.entries()].sort((e,t)=>t[1]-e[1]||(e[0]<t[0]?-1:1)).map(([e])=>It[e]).filter(e=>e!==void 0);return r.length===0?null:{air1:r[0],air2:r[1]??r[0]}}r();var zt=5,Bt=`wo-stage`,Vt=`an illustrative living answer measures nothing, so there is no baseline`;function Ht(e){if(e.length<2)return null;let t=e.reduce((e,t)=>Math.min(e,t.v),1/0),n=e.reduce((e,t)=>Math.max(e,t.v),-1/0)-t,r=e.length-1;return e.map((e,i)=>{let a=i/r*100,o=n===0?10:18-(e.v-t)/n*16;return`${i===0?`M`:`L`} ${Math.round(a*10)/10} ${Math.round(o*10)/10}`}).join(` `)}function Ut(e,t){return Wt(e,t)?.length??0}function Wt(e,t){for(let n of e){if(n.id===t)return n.children;let e=n.children===void 0?void 0:Wt(n.children,t);if(e)return e}}function Gt(e){let{value:t,...n}=e;return n}function Kt(e,t){let n=new Map;for(let[r,i]of e.relativeByNode){let e=t.relativeByNode.get(r)??0;i>0&&n.set(r,e/i)}return n}function qt(e,t,n,r){return{exactBase:n??null,exactDelta:e.outcomeDelta,explainedPct:e.explainedPct,fullyGrounded:e.fullyGrounded&&!r,relBase:t.relativeOutcome,relCur:e.relativeOutcome}}function Jt(e){let t=(0,J.c)(14),{spec:n,question:r,failed:i,onRetry:a,onClose:o,view:s,onExpandNode:c,autoWalk:l,speakLine:u}=e;if(n){let e;return t[0]!==l||t[1]!==o||t[2]!==c||t[3]!==u||t[4]!==n||t[5]!==s?(e=(0,Y.jsx)(Xt,{spec:n,view:s,onClose:o,onExpandNode:c,autoWalk:l,speakLine:u}),t[0]=l,t[1]=o,t[2]=c,t[3]=u,t[4]=n,t[5]=s,t[6]=e):e=t[6],e}let d;t[7]===r?d=t[8]:(d=r?v(r):``,t[7]=r,t[8]=d);let f=i===!0,p;return t[9]!==o||t[10]!==a||t[11]!==d||t[12]!==f?(p=(0,Y.jsx)(Yt,{title:d,failed:f,onRetry:a,onClose:o}),t[9]=o,t[10]=a,t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function Yt(e){let t=(0,J.c)(17),{title:n,failed:r,onRetry:i,onClose:a}=e,o=`Living answer: ${n}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=(0,Y.jsxs)(`div`,{className:`wo-title`,children:[s,(0,Y.jsx)(`h2`,{children:n})]}),t[1]=n,t[2]=c);let l;t[3]===a?l=t[4]:(l=a&&(0,Y.jsx)(`div`,{className:`wo-head-actions`,children:(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:a,"aria-label":`Back to the answer`,children:`← Back to the answer`})}),t[3]=a,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,Y.jsxs)(`header`,{className:`wo-head`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]!==r||t[9]!==i?(d=(0,Y.jsx)(`div`,{className:`wo-shell`,role:`status`,"aria-live":`polite`,children:r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`wo-shell-line`,children:`This living answer didn’t come back.`}),(0,Y.jsx)(`p`,{className:`wo-shell-note`,children:`Nothing was built, and Mavéa won’t stand in a causal web it can’t source. The answer behind this card is untouched.`}),i&&(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:i,children:`Try again`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`wo-shell-ground`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:`wo-shell-pulse`,"aria-hidden":`true`}),(0,Y.jsx)(`p`,{className:`wo-shell-line`,children:`Building your living answer…`}),(0,Y.jsx)(`p`,{className:`wo-shell-note`,children:`One model call, grounded in what this answer already found. Once it is built it is kept — re-opening it, and replaying this turn, costs nothing.`})]})}),t[8]=r,t[9]=i,t[10]=d):d=t[10];let f;t[11]!==u||t[12]!==d?(f=(0,Y.jsxs)(`div`,{className:`wo-panel`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==o||t[15]!==f?(p=(0,Y.jsx)(`section`,{className:`wo-scrim`,"aria-label":o,children:f}),t[14]=o,t[15]=f,t[16]=p):p=t[16],p}function Xt({spec:e,view:t,onClose:n,onExpandNode:r,autoWalk:c,speakLine:l}){let[u,d]=(0,q.useState)(()=>p(e.title));(0,q.useEffect)(()=>{f(e.title,u)},[e.title,u]);let[m,h]=(0,q.useState)(null),g=(0,q.useMemo)(()=>{if(u.size===0)return e;let t=e;for(let[e,n]of u)t=M(t,e,n);return t},[e,u]),_=g.provenance.illustrative===!0,y=(0,q.useMemo)(()=>V(g),[g]),b=(0,q.useMemo)(()=>xt(g,y),[g,y]),x=b.trust,S=(0,q.useMemo)(()=>vt(g),[g]),[C,w]=(0,q.useState)(()=>new Map),[T,E]=(0,q.useState)(null),[D,O]=(0,q.useState)(!1),k=(0,q.useMemo)(()=>[...C.values()].some(e=>e!==100),[C]),F=(0,q.useMemo)(()=>[...C].map(([e,t])=>({nodeId:e,pct:t/100})),[C]),I=(0,q.useMemo)(()=>ie(S,[]),[S]),R=(0,q.useMemo)(()=>ie(S,F),[S,F]),z=(0,q.useMemo)(()=>k?Kt(I,R):null,[k,I,R]),U=(0,q.useDeferredValue)(z),G=(0,q.useCallback)(e=>H(e,y),[y]),K=(0,q.useMemo)(()=>ee(y),[y]),te=(0,q.useMemo)(()=>{let e=g.nodes[0]?.tier;return e!==void 0&&g.nodes.every(t=>t.tier===e)?``:void 0},[g]),ne=(0,q.useMemo)(()=>Rt(y),[y]),J=t&&G(t)?t:void 0,ae=We({world:y,insetBottom:D?108:54,initialRep:J??W(y)}),{rep:oe,setRep:se,expandedIds:ce,toggleExpand:le,unfoldsOnStage:ue}=ae;(0,q.useEffect)(()=>{J&&se(J)},[J,se]);let fe=(0,q.useMemo)(()=>{let e=new Map(y.nodes.map(e=>[e.id,e.parentId])),t=new Map;for(let n of y.nodes){let r=n.id,i=new Set([r]),a=e.get(r);for(;a!==void 0&&!i.has(a);)i.add(a),r=a,a=e.get(r);t.set(n.id,r)}return t},[y]),pe=(0,q.useMemo)(()=>{let e=y.nodes.map(e=>{let t=Gt(e),n=U?.get(fe.get(e.id)??e.id),r=A(e.label);return{...t,label:r,...n===void 0?{}:{shift:n}}});return{...y,nodes:e}},[y,U,fe]),me=(0,q.useMemo)(()=>{let e=new Map,t=n=>{e.set(n.id,n);for(let e of n.children??[])t(e)};for(let e of g.nodes)t(e);return e},[g]),he=(0,q.useMemo)(()=>{let e=B(g.edges);return new Map(y.edges.map((t,n)=>[t.id,e[n]]))},[y,g]),ge=(0,q.useRef)(null),_e=(0,q.useCallback)(()=>ge.current?.dismiss(),[]),ve=(0,q.useCallback)(e=>{(e.surface===`node`||e.surface===`edge`)&&E({kind:e.surface,id:e.id})},[]),[ye,be]=(0,q.useState)(void 0),xe=K.find(e=>e!==`graph`),[Se,Ce]=(0,q.useState)([]);(0,q.useEffect)(()=>{let e=globalThis.requestIdleCallback,t=()=>Ce(Ft(g,y,x,xe?{closeOn:xe}:{}));if(typeof e==`function`){let n=e(t,{timeout:2e3});return()=>globalThis.cancelIdleCallback?.(n)}let n=setTimeout(t,1);return()=>clearTimeout(n)},[g,y,x,xe]);let{focusNode:we}=ae,Te=(0,q.useCallback)(e=>{e.rep&&se(e.rep),E({kind:`node`,id:e.nodeId}),be(e.edgeId),e.wide?we(null):e.rep||we(e.nodeId)},[we,se]),{index:Ee,playing:De,caption:Oe,toggle:ke,seek:je,reset:Me}=wt((0,q.useMemo)(()=>({beats:Se,apply:Te,...l?{speakLine:l}:{}}),[Se,Te,l]));(0,q.useEffect)(()=>{O(De||Ee>=0)},[De,Ee]);let Pe=(0,q.useRef)(!1);(0,q.useEffect)(()=>{typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||!c||Pe.current||Se.length===0||(Pe.current=!0,ke())},[c,Se.length,ke]);let[Fe,Ie]=(0,q.useState)(!0),Le=(0,q.useCallback)(()=>Ie(!1),[]),X=(0,q.useCallback)(()=>{Me(),be(void 0)},[Me]),Re=(0,q.useRef)(n);Re.current=n;let ze=(0,q.useRef)(ke);ze.current=ke;let Be=(0,q.useRef)(X);Be.current=X,(0,q.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){Be.current(),Re.current?.();return}(e.key===` `||e.key===`Spacebar`)&&(e.target?.closest(`button, input, select, textarea, [contenteditable="true"]`)||(e.preventDefault(),ze.current()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Ve=(0,q.useCallback)(e=>{X(),E({kind:`node`,id:e.id})},[X]),He=(0,q.useCallback)(e=>{X(),E({kind:`edge`,id:e})},[X]),Ue=(0,q.useCallback)((e,t)=>{X(),w(n=>new Map(n).set(e,t))},[X]),Ge=(0,q.useCallback)(()=>{X(),w(new Map)},[X]),Ke=(0,q.useCallback)(e=>{!r||m!==null||(h(e),r(e,g).then(t=>{h(null);let n=t===null?void 0:Wt(t.nodes,e);n?.length&&(d(t=>new Map(t).set(e,n)),ue(e)?le(e):E({kind:`node`,id:e}))},()=>h(null)))},[r,ue,m,g,le]),qe=(0,q.useCallback)((e,t)=>{if(t===`entry`&&oe===`timeline`){let t=me.get(e.id),n=t?.date,r=t?.series?.points,i=n?.until!==void 0||(r?.length??0)>1,a=n?.t??r?.[0]?.t;return i||!a?null:(0,Y.jsx)(`span`,{className:`wo-when`,"data-said":e.dateGrounded?``:void 0,children:a})}if(t!==`card`)return null;let n=ce.has(e.id),i=Ut(g.nodes,e.id),a=i>0,o=Ht(e.series??[]),s=me.get(e.id),c=s?.value===void 0?s?.date:void 0,l=c===void 0||j(c.t)===null?null:c.until!==void 0&&j(c.until)!==null?`${c.t}–${c.until}`:c.t,u=a&&ue(e.id),d=!a&&r!==void 0,f=m===e.id,p=a&&!u?i:0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Qe,{id:yt(e.id),className:`wo-num`}),e.shift!==void 0&&de(e.shift)!==null&&(0,Y.jsx)(`span`,{className:`wo-shift`,"data-dir":e.shift<1?`down`:`up`,children:de(e.shift)}),o!==null&&(0,Y.jsx)(`svg`,{className:`wo-trace`,viewBox:`0 0 100 20`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,Y.jsx)(`path`,{d:o,fill:`none`})}),l!==null&&(0,Y.jsx)(`span`,{className:`wo-when`,"data-said":e.dateGrounded?``:void 0,children:l}),p>0&&(0,Y.jsx)(`span`,{className:`wo-parts-count`,children:`${p} part${p===1?``:`s`}`}),(u||d)&&(0,Y.jsx)(`button`,{type:`button`,className:`wo-expand`,"aria-expanded":u?n:void 0,"aria-busy":f||void 0,disabled:f||d&&m!==null,"aria-label":`${u&&n?`Close`:`Break down`} ${e.label}`,onClick:t=>{t.stopPropagation(),u?le(e.id):Ke(e.id)},children:f?`breaking down…`:u&&n?`close`:`break down`})]})},[ue,g,me,ce,le,r,m,Ke,oe]),Z=me.get(g.outcomeId),Je=(0,q.useMemo)(()=>qt(I,I,Z?.value,_),[I,Z?.value,_]),Xe=(0,q.useMemo)(()=>qt(R,I,Z?.value,_),[R,I,Z?.value,_]),Ze=(0,q.useMemo)(()=>({causes:g.nodes.length,links:g.edges.length,sourced:g.nodes.filter(e=>e.receipt!==void 0).length}),[g]),Q=T?.kind===`node`?me.get(T.id):void 0,$e=(0,q.useMemo)(()=>Q===void 0?[]:L(b,Q.id),[b,Q]),[et,tt]=(0,q.useState)(null);(0,q.useEffect)(()=>{if(Q===void 0){tt(null);return}let e=!0;return(async()=>{let{hierarchyLens:t}=await i(async()=>{let{hierarchyLens:e}=await import(`./lens-DyGK7Owa.js`);return{hierarchyLens:e}},__vite__mapDeps([0,1,2,3]));if(!e)return;let n=t.compile(b,Q.id);if(n===null){tt(null);return}await a(o([n.block]));let r=s(n.block.type);e&&r&&tt({plan:n,render:r})})(),()=>{e=!1}},[b,Q]);let $=T?.kind===`edge`?he.get(T.id):void 0,nt=(0,q.useMemo)(()=>g.nodes.filter(e=>e.role===`root`).map(e=>({id:e.id,label:A(e.label),pct:C.get(e.id)??100})),[g.nodes,C]);return(0,Y.jsx)(st,{registry:x,onNavigate:ve,ref:ge,children:(0,Y.jsx)(`section`,{className:`wo-scrim`,"aria-label":`Living answer: ${v(g.title)}`,onPointerDownCapture:Le,onKeyDownCapture:Le,children:(0,Y.jsxs)(`div`,{className:`wo-panel`,children:[(0,Y.jsxs)(`header`,{className:`wo-head`,children:[(0,Y.jsxs)(`div`,{className:`wo-title`,children:[(0,Y.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),(0,Y.jsx)(`h2`,{children:v(g.title)})]}),(0,Y.jsxs)(`div`,{className:`wo-head-actions`,children:[K.length===1?(0,Y.jsx)(`span`,{className:`wo-chip wo-chip-sole`,children:Ne[K[0]].chip}):(0,Y.jsx)(`div`,{className:`wo-views`,role:`tablist`,"aria-label":`View`,children:K.slice(0,zt).map((e,t,n)=>(0,Y.jsx)(`button`,{type:`button`,id:`wo-tab-${e}`,className:`wo-chip`,role:`tab`,"aria-selected":oe===e,"aria-controls":Bt,tabIndex:oe===e?0:-1,onKeyDown:e=>{let r=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(r===0)return;e.preventDefault();let i=n[(t+r+n.length)%n.length];X(),se(i),document.getElementById(`wo-tab-${i}`)?.focus()},onClick:()=>{X(),se(e)},children:Ne[e].chip},e))}),(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:Ge,disabled:!k,children:`Reset`}),n&&(0,Y.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:n,"aria-label":`Back to the answer`,children:`← Back to the answer`})]})]}),_&&(0,Y.jsx)(`div`,{className:`wo-banner wo-banner-illustrative`,children:`Illustrative model — shows the shape, not your numbers.`}),(0,Y.jsxs)(`p`,{className:`wo-legend`,"aria-live":`polite`,children:[(0,Y.jsxs)(`span`,{className:`wo-legend-view`,children:[Ne[oe].caption,`.`]}),` `,Ne[oe].legend]}),(0,Y.jsxs)(`div`,{className:`wo-body`,children:[(0,Y.jsxs)(`div`,{className:`wo-stage`,id:Bt,role:K.length>1?`tabpanel`:void 0,"aria-labelledby":K.length>1?`wo-tab-${oe}`:void 0,"data-uniform-tier":te,"data-illustrative":_?``:void 0,onWheelCapture:_e,onPointerDownCapture:_e,style:ne===null?void 0:{"--wo-air-1":ne.air1,"--wo-air-2":ne.air2},children:[(0,Y.jsx)(Ae,{stage:ae,world:pe,renderFace:qe,onNodeClick:Ve,onEdgeClick:He,selectedId:T?.kind===`node`?T.id:void 0,litEdgeId:ye}),(0,Y.jsx)(Tt,{count:Se.length,index:Ee,playing:De,caption:Oe,expanded:D,onToggle:ke,onSeek:je,inviting:Fe})]}),(0,Y.jsxs)(`aside`,{className:`wo-rail`,children:[(0,Y.jsx)(Ye,{levers:nt,onSet:Ue,onReset:Ge}),(0,Y.jsx)(ht,{baseline:Je,current:Xe,unit:Z?.unit,active:k,observedNote:_?Vt:void 0}),(0,Y.jsxs)(`div`,{className:`wo-detail`,children:[(0,Y.jsx)(`span`,{className:`wo-rail-kicker`,children:`EVIDENCE`}),!T&&(0,Y.jsxs)(`div`,{className:`wo-standing`,children:[(0,Y.jsxs)(`p`,{className:`wo-invite`,children:[`Press `,(0,Y.jsx)(`strong`,{children:`Walk me through it`}),` and Mavéa takes you cause by cause — free, and as often as you like.`]}),(0,Y.jsx)(`p`,{className:`wo-hint`,children:`Or tap any cause or link to see what stands behind it.`}),(0,Y.jsxs)(`dl`,{className:`wo-facts`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{children:`Causes`}),(0,Y.jsx)(`dd`,{children:Ze.causes})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{children:`Links`}),(0,Y.jsx)(`dd`,{children:Ze.links})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{children:_?`Illustrative`:`With a source`}),(0,Y.jsx)(`dd`,{children:_?`every cause`:Ze.sourced})]})]}),Z&&(0,Y.jsxs)(`p`,{className:`wo-standing-outcome`,children:[(0,Y.jsx)(`span`,{className:`wo-standing-lead`,children:`It ends at`}),` `,Z.label,Z.detail?(0,Y.jsx)(`span`,{className:`wo-standing-note`,children:Z.detail}):null]}),(0,Y.jsx)(`p`,{className:`wo-hint`,children:`Turn a root cause down and the rest of the web re-weights — nothing is re-computed by a model, and no projected number is invented.`})]}),Q&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`h3`,{className:`wo-detail-title`,children:Q.label}),Q.detail&&(0,Y.jsx)(`p`,{className:`wo-detail-note`,children:Q.detail}),(0,Y.jsx)(`p`,{className:`wo-detail-figure`,children:(0,Y.jsx)(Qe,{id:yt(Q.id)})}),Q.series&&(0,Y.jsx)(`ul`,{className:`wo-series`,children:Q.series.points.map((e,t)=>(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`span`,{className:`wo-series-t`,children:e.t}),(0,Y.jsx)(Qe,{id:bt(Q.id,e.t)})]},`${e.t}:${t}`))}),(et||$e.length>0)&&(0,Y.jsxs)(`div`,{className:`wo-parts`,children:[(0,Y.jsx)(`span`,{className:`wo-rail-kicker`,children:`WHAT THIS IS MADE OF`}),et?et.render(et.plan.block.props,{delay:0}):(0,Y.jsx)(`ul`,{className:`wo-part-list`,children:$e.map(e=>(0,Y.jsx)(`li`,{children:A(e.label)},e.id))})]})]}),$&&(0,Y.jsx)(re,{relation:P($.relation),sign:$.sign,status:$.status??N($),receipts:$.receipts??($.receipt?[$.receipt]:[]),counter:$.counter,provisional:$.provisional})]})]})]})]})})})}export{Jt as WorldOverlay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{ot as n}from"./index-Db-FgYxX.js";import{t as r}from"./Orb-D8lhTdmY.js";var i=e(),a=t();function o(e){let t=(0,i.c)(17),{reverse:n,eyebrow:r,eyebrowTone:o,title:s,body:c,visual:l}=e,u=`fl-panel`+(n?` reverse`:``),d=`fl-panel-eyebrow tone-`+o,f;t[0]!==r||t[1]!==d?(f=(0,a.jsx)(`div`,{className:d,children:r}),t[0]=r,t[1]=d,t[2]=f):f=t[2];let p;t[3]===s?p=t[4]:(p=(0,a.jsx)(`h3`,{className:`fl-panel-title`,children:s}),t[3]=s,t[4]=p);let m;t[5]===c?m=t[6]:(m=(0,a.jsx)(`p`,{className:`fl-panel-body`,children:c}),t[5]=c,t[6]=m);let h;t[7]!==f||t[8]!==p||t[9]!==m?(h=(0,a.jsxs)(`div`,{className:`fl-panel-copy`,children:[f,p,m]}),t[7]=f,t[8]=p,t[9]=m,t[10]=h):h=t[10];let g;t[11]===l?g=t[12]:(g=(0,a.jsx)(`div`,{className:`fl-panel-visual`,children:l}),t[11]=l,t[12]=g);let _;return t[13]!==u||t[14]!==h||t[15]!==g?(_=(0,a.jsxs)(`div`,{className:u,children:[h,g]}),t[13]=u,t[14]=h,t[15]=g,t[16]=_):_=t[16],_}var s=[`46%`,`52%`,`50%`,`58%`,`74%`,`100%`],c=[[24,72],[98,98],[173,116],[247,98],[322,66],[396,36]],l=[`Q1`,`Q2`,`Q3`,`Q4`,`Q5`,`Q6`];function u(){let e=(0,i.c)(12),t,n,r,o,s,u,m,h,g;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)){let i=c.map(p).join(` `);u=`fl-card fl-pen`,m=(0,a.jsxs)(`div`,{className:`fl-pen-head`,children:[(0,a.jsx)(`span`,{className:`fl-ink-label`,children:`Revenue · the road back`}),(0,a.jsxs)(`span`,{className:`fl-pen-value`,children:[`$4.2M`,(0,a.jsx)(`i`,{className:`fl-pen-delta`,children:`▲ recovering`})]})]}),t=`fl-pen-plot`,n=`0 0 420 184`,r=`true`,o=(0,a.jsx)(`defs`,{children:(0,a.jsxs)(`linearGradient`,{id:`fl-pen-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,a.jsx)(`stop`,{offset:`0`,className:`fl-pen-fill-top`}),(0,a.jsx)(`stop`,{offset:`1`,className:`fl-pen-fill-bot`})]})}),s=(0,a.jsxs)(`g`,{className:`fl-pen-grid`,children:[(0,a.jsx)(`line`,{x1:`24`,y1:`48`,x2:`396`,y2:`48`}),(0,a.jsx)(`line`,{x1:`24`,y1:`84`,x2:`396`,y2:`84`}),(0,a.jsx)(`line`,{x1:`24`,y1:`120`,x2:`396`,y2:`120`}),(0,a.jsx)(`line`,{x1:`24`,y1:`150`,x2:`396`,y2:`150`,className:`base`})]}),h=(0,a.jsx)(`path`,{className:`fl-pen-area`,d:`M${i.replace(/ /g,` L`)} L396,150 L24,150 Z`}),g=(0,a.jsx)(`polyline`,{className:`fl-pen-line`,points:i}),e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=s,e[5]=u,e[6]=m,e[7]=h,e[8]=g}else t=e[0],n=e[1],r=e[2],o=e[3],s=e[4],u=e[5],m=e[6],h=e[7],g=e[8];let _;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,a.jsx)(`g`,{className:`fl-pen-dots`,children:c.map(f)}),e[9]=_):_=e[9];let v;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,a.jsxs)(`svg`,{className:t,viewBox:n,"aria-hidden":r,children:[o,s,h,g,_,(0,a.jsx)(`g`,{className:`fl-pen-axis`,children:l.map(d)}),(0,a.jsx)(`path`,{className:`fl-pen-trend`,pathLength:1,d:`M166,126 C232,122 300,86 384,44 M384,44 l-13,1 m13,-1 l-3,12`}),(0,a.jsx)(`path`,{className:`fl-pen-star`,pathLength:1,d:`M396,18 L399,26 L407,26 L401,32 L403,40 L396,35 L389,40 L391,32 L385,26 L393,26 Z`})]}),e[10]=v):v=e[10];let y;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,a.jsxs)(`div`,{className:u,children:[m,v,(0,a.jsxs)(`div`,{className:`fl-pen-options`,children:[(0,a.jsxs)(`span`,{className:`fl-pen-chip`,children:[`Cut marketing`,(0,a.jsx)(`svg`,{viewBox:`0 0 120 26`,preserveAspectRatio:`none`,"aria-hidden":`true`,className:`fl-pen-strike`,children:(0,a.jsx)(`path`,{pathLength:1,d:`M5,15 C34,10 74,18 115,10`})})]}),(0,a.jsx)(`span`,{className:`fl-pen-chip kept`,children:`Raise prices ✓`})]})]}),e[11]=y):y=e[11],y}function d(e,t){return(0,a.jsx)(`text`,{x:c[t][0],y:`172`,children:e},e)}function f(e,t){let[n,r]=e;return(0,a.jsx)(`circle`,{cx:n,cy:r,r:`3.2`},t)}function p(e){let[t,n]=e;return`${t},${n}`}var m=[{id:`bars`,d:`M6,26 V14 M14,26 V6 M22,26 V18`,label:`chart`},{id:`line`,d:`M4,24 L11,14 L18,18 L26,6`,label:`trend`},{id:`donut`,d:`M14,4 A10,10 0 1 1 4,14`,label:`share`},{id:`pin`,d:`M14,4 a8,8 0 0 1 8,8 c0,6 -8,14 -8,14 s-8,-8 -8,-14 a8,8 0 0 1 8,-8`,label:`map`},{id:`steps`,d:`M4,24 H12 V16 H20 V8 H26`,label:`timeline`},{id:`net`,d:`M6,22 L14,8 L24,20 M6,22 L24,20`,label:`network`},{id:`gauge`,d:`M4,22 A11,11 0 0 1 26,22 M15,22 L21,12`,label:`gauge`},{id:`rows`,d:`M5,8 H25 M5,15 H25 M5,22 H17`,label:`table`}];function h(){return(0,a.jsx)(`div`,{className:`fl-card fl-instruments`,children:m.map((e,t)=>(0,a.jsxs)(`span`,{className:`fl-instrument`,style:{"--in-i":String(t)},children:[(0,a.jsx)(`svg`,{viewBox:`0 0 30 30`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:e.d})}),e.label]},e.id))})}function g(){let e=(0,i.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(`div`,{className:`fl-ink-label`,children:`Revenue · last 6 quarters`}),e[0]=t):t=e[0];let n,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,a.jsx)(`div`,{className:`fl-ink-bars`,children:s.map(_)}),r=(0,a.jsx)(`span`,{className:`fl-hl-sweep`}),e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,a.jsxs)(`div`,{className:`fl-card fl-ink`,children:[t,(0,a.jsxs)(`div`,{className:`fl-ink-plot`,children:[n,r,(0,a.jsxs)(`span`,{className:`fl-hl-chip`,children:[(0,a.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:`M3 21l3.2-.9L18 8.3l-2.3-2.3L4 17.6 3 21z M14.7 7l2.3 2.3`})}),`Ask about this`]})]})]}),e[3]=o):o=e[3],o}function _(e,t){return(0,a.jsx)(`div`,{className:`fl-ink-barcol`,children:(0,a.jsx)(`div`,{className:`fl-ink-bar`+(e===`100%`?` peak`:``),style:{height:e}})},t)}function v(){return(0,a.jsxs)(`div`,{className:`fl-card fl-ghostwrap`,children:[(0,a.jsxs)(`div`,{className:`fl-ghost-said`,children:[(0,a.jsx)(`span`,{className:`fl-wave`,"aria-hidden":`true`,children:Array.from({length:12},(e,t)=>(0,a.jsx)(`i`,{style:{"--i":String(t)}},t))}),(0,a.jsxs)(`span`,{className:`fl-ghost-words`,children:[`“…and how does that compare to last year, and`,(0,a.jsx)(`span`,{className:`fl-caret`}),`”`]})]}),(0,a.jsxs)(`div`,{className:`fl-ghost-cards`,children:[(0,a.jsxs)(`div`,{className:`fl-ghost`,children:[(0,a.jsx)(`div`,{className:`fl-ghost-tag`,children:`Forming…`}),(0,a.jsxs)(`div`,{className:`fl-ghost-bars`,children:[(0,a.jsx)(`i`,{style:{height:`50%`}}),(0,a.jsx)(`i`,{style:{height:`80%`}}),(0,a.jsx)(`i`,{style:{height:`65%`}})]})]}),(0,a.jsxs)(`div`,{className:`fl-ghost delay`,children:[(0,a.jsx)(`div`,{className:`fl-ghost-tag`,children:`Forming…`}),(0,a.jsx)(`svg`,{viewBox:`0 0 120 50`,"aria-hidden":`true`,children:(0,a.jsx)(`polyline`,{points:`0,42 24,30 48,34 72,18 96,22 120,8`})})]})]})]})}var y=[{label:`Runway: 14mo`,meta:`4×`,x:92,y:52,tone:`blue`},{label:`Hiring freeze`,meta:`a worry`,x:86,y:200,tone:`amber`},{label:`Ship velocity`,meta:`slowing`,x:300,y:204,tone:`amber`},{label:`Churn signal`,meta:`watch`,x:300,y:50,tone:`pink`},{label:`Pricing`,meta:`your idea`,x:206,y:226,tone:`green`}],b=[[0,3],[3,2],[1,4],[4,2],[0,1]];function x(){let e=(0,i.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(`svg`,{className:`fl-mindmap-links`,viewBox:`0 0 420 264`,"aria-hidden":`true`,children:b.map(C)}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,a.jsxs)(`div`,{className:`fl-card fl-mindmap`,children:[t,(0,a.jsx)(`div`,{className:`fl-mindmap-hub`,children:(0,a.jsx)(r,{size:46})}),y.map(S)]}),e[1]=n):n=e[1],n}function S(e){return(0,a.jsxs)(`div`,{className:`fl-node tone-`+e.tone,style:{left:`${e.x/420*100}%`,top:`${e.y/264*100}%`},children:[(0,a.jsx)(`div`,{className:`fl-node-label`,children:e.label}),(0,a.jsx)(`div`,{className:`fl-node-meta`,children:e.meta})]},e.label)}function C(e,t){let[n,r]=e,i=y[n],o=y[r],s=(i.x+o.x)/2,c=(i.y+o.y)/2-20;return(0,a.jsx)(`path`,{d:`M${i.x},${i.y} Q${s},${c} ${o.x},${o.y}`},t)}var w=[{icon:`⌨`,label:`Type it`},{icon:`🎙`,label:`Say it`},{icon:`▦`,label:`Drag a card`}];function T(){let e=(0,i.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(`span`,{className:`fl-blank-num good`,children:`$2.1M`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,a.jsxs)(`span`,{className:`fl-blank-hole`,children:[`your burn / mo`,(0,a.jsx)(`span`,{className:`fl-caret`})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,a.jsxs)(`div`,{className:`fl-blank-sentence`,children:[`With `,t,` in the bank and a burn of`,` `,n,`, your runway is `,(0,a.jsx)(`span`,{className:`fl-blank-pending`,children:`— months`}),`.`]}),e[2]=r):r=e[2];let o;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,a.jsxs)(`div`,{className:`fl-card fl-blank`,children:[r,(0,a.jsx)(`div`,{className:`fl-blank-options`,"aria-hidden":`true`,children:w.map(E)})]}),e[3]=o):o=e[3],o}function E(e){return(0,a.jsxs)(`span`,{className:`fl-blank-btn`,children:[(0,a.jsx)(`span`,{className:`fl-blank-icon`,children:e.icon}),e.label]},e.label)}var D=[`“ARR climbed to $15.1M — up 21%.”`,`“The trend held steady all quarter.”`,`“North America still leads, at 54%.”`];function O(){return(0,a.jsxs)(`div`,{className:`fl-card fl-walk`,children:[(0,a.jsx)(`div`,{className:`fl-ink-label`,children:`Q3 revenue · read to you`}),(0,a.jsxs)(`div`,{className:`fl-walk-stage`,children:[(0,a.jsxs)(`div`,{className:`fl-walk-presenter`,children:[(0,a.jsx)(r,{size:44,className:`fl-walk-orb`}),(0,a.jsxs)(`div`,{className:`fl-walk-say`,children:[(0,a.jsx)(`span`,{className:`fl-wave`,"aria-hidden":`true`,children:Array.from({length:8},(e,t)=>(0,a.jsx)(`i`,{style:{"--i":String(t)}},t))}),(0,a.jsx)(`span`,{className:`fl-walk-caps`,children:D.map((e,t)=>(0,a.jsx)(`span`,{className:`fl-walk-line l${t+1}`,children:e},e))})]})]}),(0,a.jsxs)(`div`,{className:`fl-walk-items`,children:[(0,a.jsxs)(`div`,{className:`fl-walk-item`,children:[(0,a.jsx)(`span`,{className:`fl-walk-k`,children:`ARR`}),(0,a.jsx)(`span`,{className:`fl-walk-v`,children:`$15.1M`}),(0,a.jsx)(`span`,{className:`fl-walk-up`,children:`▲ 21%`})]}),(0,a.jsx)(`div`,{className:`fl-walk-item`,children:(0,a.jsx)(`svg`,{className:`fl-walk-spark`,viewBox:`0 0 120 26`,"aria-hidden":`true`,children:(0,a.jsx)(`polyline`,{points:`2,20 22,17 42,19 62,11 82,13 100,6 118,3`})})}),(0,a.jsxs)(`div`,{className:`fl-walk-item`,children:[(0,a.jsx)(`span`,{className:`fl-walk-k`,children:`N. America`}),(0,a.jsx)(`span`,{className:`fl-walk-v`,children:`54%`})]}),(0,a.jsx)(`span`,{className:`fl-walk-spot`,"aria-hidden":`true`})]})]}),(0,a.jsx)(`div`,{className:`fl-seen-note`,children:`Illustrative numbers`})]})}function k(){let e=(0,i.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsxs)(n,{eyebrow:`Things a chat window can’t do`,children:[`It’s a `,(0,a.jsx)(`em`,{children:`friend at the whiteboard.`})]}),e[0]=t):t=e[0];let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,a.jsx)(o,{eyebrow:`Highlight is the interface`,eyebrowTone:`presence`,title:`Highlight the answer to ask.`,body:`Drag across a bar, a row, a figure — the highlight grabs exactly what’s under it, and your next question is grounded on that piece, not the whole answer.`,visual:(0,a.jsx)(g,{})}),e[1]=r):r=e[1];let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,a.jsx)(o,{reverse:!0,eyebrow:`And the pen is in its hand`,eyebrowTone:`amber`,title:`It draws on its own answers.`,body:`A trend arrow along the recovery, a star on the number that matters, a strike through the option it rules out — the whiteboard marks a good teacher leaves.`,visual:(0,a.jsx)(u,{})}),e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,a.jsx)(o,{eyebrow:`It answers while you talk`,eyebrowTone:`blue`,title:`The answer forms mid-sentence.`,body:`Dashed “ghost” cards sketch the answer taking shape behind your words — and reshape live as your question turns. You see it thinking with you, not after you.`,visual:(0,a.jsx)(v,{})}),e[3]=c):c=e[3];let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,a.jsx)(o,{reverse:!0,eyebrow:`Watch it map your thinking`,eyebrowTone:`green`,title:`Ramble. Get a map of your mind.`,body:`Themes emerge from what you actually said — never fixed buckets — with the tensions between them drawn in. A minute of talking becomes a structure you can see.`,visual:(0,a.jsx)(x,{})}),e[4]=l):l=e[4];let d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,a.jsx)(o,{eyebrow:`The Blank Space`,eyebrowTone:`pink`,title:`It won’t guess. It leaves a space.`,body:`When an answer needs a number only you have, Mavéa leaves a glowing hole to fill — type it, say it, or drag a card in. Uncertainty, made honest and interactive.`,visual:(0,a.jsx)(T,{})}),e[5]=d):d=e[5];let f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,a.jsx)(o,{reverse:!0,eyebrow:`One canvas, many instruments`,eyebrowTone:`presence`,title:`The answer picks its shape.`,body:`Charts, maps, timelines, networks, tables — hundreds of visual instruments on one canvas, and each answer reaches for the ones that fit.`,visual:(0,a.jsx)(h,{})}),e[6]=f):f=e[6];let p;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,a.jsxs)(a.Fragment,{children:[t,(0,a.jsxs)(`div`,{className:`fl-panels`,children:[r,s,c,l,d,f,(0,a.jsx)(o,{eyebrow:`It reads the answer to you`,eyebrowTone:`presence`,title:`It points, and talks you through.`,body:`Mavéa doesn’t drop a wall of cards and leave. It spotlights each part and speaks to it — walking you through the answer a piece at a time, the way a friend at the whiteboard would.`,visual:(0,a.jsx)(O,{})})]})]}),e[7]=p):p=e[7],p}export{k as WowFeatures};
|
|
1
|
+
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{ot as n}from"./index-yJfYsjAB.js";import{t as r}from"./Orb-D8lhTdmY.js";var i=e(),a=t();function o(e){let t=(0,i.c)(17),{reverse:n,eyebrow:r,eyebrowTone:o,title:s,body:c,visual:l}=e,u=`fl-panel`+(n?` reverse`:``),d=`fl-panel-eyebrow tone-`+o,f;t[0]!==r||t[1]!==d?(f=(0,a.jsx)(`div`,{className:d,children:r}),t[0]=r,t[1]=d,t[2]=f):f=t[2];let p;t[3]===s?p=t[4]:(p=(0,a.jsx)(`h3`,{className:`fl-panel-title`,children:s}),t[3]=s,t[4]=p);let m;t[5]===c?m=t[6]:(m=(0,a.jsx)(`p`,{className:`fl-panel-body`,children:c}),t[5]=c,t[6]=m);let h;t[7]!==f||t[8]!==p||t[9]!==m?(h=(0,a.jsxs)(`div`,{className:`fl-panel-copy`,children:[f,p,m]}),t[7]=f,t[8]=p,t[9]=m,t[10]=h):h=t[10];let g;t[11]===l?g=t[12]:(g=(0,a.jsx)(`div`,{className:`fl-panel-visual`,children:l}),t[11]=l,t[12]=g);let _;return t[13]!==u||t[14]!==h||t[15]!==g?(_=(0,a.jsxs)(`div`,{className:u,children:[h,g]}),t[13]=u,t[14]=h,t[15]=g,t[16]=_):_=t[16],_}var s=[`46%`,`52%`,`50%`,`58%`,`74%`,`100%`],c=[[24,72],[98,98],[173,116],[247,98],[322,66],[396,36]],l=[`Q1`,`Q2`,`Q3`,`Q4`,`Q5`,`Q6`];function u(){let e=(0,i.c)(12),t,n,r,o,s,u,m,h,g;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)){let i=c.map(p).join(` `);u=`fl-card fl-pen`,m=(0,a.jsxs)(`div`,{className:`fl-pen-head`,children:[(0,a.jsx)(`span`,{className:`fl-ink-label`,children:`Revenue · the road back`}),(0,a.jsxs)(`span`,{className:`fl-pen-value`,children:[`$4.2M`,(0,a.jsx)(`i`,{className:`fl-pen-delta`,children:`▲ recovering`})]})]}),t=`fl-pen-plot`,n=`0 0 420 184`,r=`true`,o=(0,a.jsx)(`defs`,{children:(0,a.jsxs)(`linearGradient`,{id:`fl-pen-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,a.jsx)(`stop`,{offset:`0`,className:`fl-pen-fill-top`}),(0,a.jsx)(`stop`,{offset:`1`,className:`fl-pen-fill-bot`})]})}),s=(0,a.jsxs)(`g`,{className:`fl-pen-grid`,children:[(0,a.jsx)(`line`,{x1:`24`,y1:`48`,x2:`396`,y2:`48`}),(0,a.jsx)(`line`,{x1:`24`,y1:`84`,x2:`396`,y2:`84`}),(0,a.jsx)(`line`,{x1:`24`,y1:`120`,x2:`396`,y2:`120`}),(0,a.jsx)(`line`,{x1:`24`,y1:`150`,x2:`396`,y2:`150`,className:`base`})]}),h=(0,a.jsx)(`path`,{className:`fl-pen-area`,d:`M${i.replace(/ /g,` L`)} L396,150 L24,150 Z`}),g=(0,a.jsx)(`polyline`,{className:`fl-pen-line`,points:i}),e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=s,e[5]=u,e[6]=m,e[7]=h,e[8]=g}else t=e[0],n=e[1],r=e[2],o=e[3],s=e[4],u=e[5],m=e[6],h=e[7],g=e[8];let _;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,a.jsx)(`g`,{className:`fl-pen-dots`,children:c.map(f)}),e[9]=_):_=e[9];let v;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,a.jsxs)(`svg`,{className:t,viewBox:n,"aria-hidden":r,children:[o,s,h,g,_,(0,a.jsx)(`g`,{className:`fl-pen-axis`,children:l.map(d)}),(0,a.jsx)(`path`,{className:`fl-pen-trend`,pathLength:1,d:`M166,126 C232,122 300,86 384,44 M384,44 l-13,1 m13,-1 l-3,12`}),(0,a.jsx)(`path`,{className:`fl-pen-star`,pathLength:1,d:`M396,18 L399,26 L407,26 L401,32 L403,40 L396,35 L389,40 L391,32 L385,26 L393,26 Z`})]}),e[10]=v):v=e[10];let y;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,a.jsxs)(`div`,{className:u,children:[m,v,(0,a.jsxs)(`div`,{className:`fl-pen-options`,children:[(0,a.jsxs)(`span`,{className:`fl-pen-chip`,children:[`Cut marketing`,(0,a.jsx)(`svg`,{viewBox:`0 0 120 26`,preserveAspectRatio:`none`,"aria-hidden":`true`,className:`fl-pen-strike`,children:(0,a.jsx)(`path`,{pathLength:1,d:`M5,15 C34,10 74,18 115,10`})})]}),(0,a.jsx)(`span`,{className:`fl-pen-chip kept`,children:`Raise prices ✓`})]})]}),e[11]=y):y=e[11],y}function d(e,t){return(0,a.jsx)(`text`,{x:c[t][0],y:`172`,children:e},e)}function f(e,t){let[n,r]=e;return(0,a.jsx)(`circle`,{cx:n,cy:r,r:`3.2`},t)}function p(e){let[t,n]=e;return`${t},${n}`}var m=[{id:`bars`,d:`M6,26 V14 M14,26 V6 M22,26 V18`,label:`chart`},{id:`line`,d:`M4,24 L11,14 L18,18 L26,6`,label:`trend`},{id:`donut`,d:`M14,4 A10,10 0 1 1 4,14`,label:`share`},{id:`pin`,d:`M14,4 a8,8 0 0 1 8,8 c0,6 -8,14 -8,14 s-8,-8 -8,-14 a8,8 0 0 1 8,-8`,label:`map`},{id:`steps`,d:`M4,24 H12 V16 H20 V8 H26`,label:`timeline`},{id:`net`,d:`M6,22 L14,8 L24,20 M6,22 L24,20`,label:`network`},{id:`gauge`,d:`M4,22 A11,11 0 0 1 26,22 M15,22 L21,12`,label:`gauge`},{id:`rows`,d:`M5,8 H25 M5,15 H25 M5,22 H17`,label:`table`}];function h(){return(0,a.jsx)(`div`,{className:`fl-card fl-instruments`,children:m.map((e,t)=>(0,a.jsxs)(`span`,{className:`fl-instrument`,style:{"--in-i":String(t)},children:[(0,a.jsx)(`svg`,{viewBox:`0 0 30 30`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:e.d})}),e.label]},e.id))})}function g(){let e=(0,i.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(`div`,{className:`fl-ink-label`,children:`Revenue · last 6 quarters`}),e[0]=t):t=e[0];let n,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,a.jsx)(`div`,{className:`fl-ink-bars`,children:s.map(_)}),r=(0,a.jsx)(`span`,{className:`fl-hl-sweep`}),e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,a.jsxs)(`div`,{className:`fl-card fl-ink`,children:[t,(0,a.jsxs)(`div`,{className:`fl-ink-plot`,children:[n,r,(0,a.jsxs)(`span`,{className:`fl-hl-chip`,children:[(0,a.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:`M3 21l3.2-.9L18 8.3l-2.3-2.3L4 17.6 3 21z M14.7 7l2.3 2.3`})}),`Ask about this`]})]})]}),e[3]=o):o=e[3],o}function _(e,t){return(0,a.jsx)(`div`,{className:`fl-ink-barcol`,children:(0,a.jsx)(`div`,{className:`fl-ink-bar`+(e===`100%`?` peak`:``),style:{height:e}})},t)}function v(){return(0,a.jsxs)(`div`,{className:`fl-card fl-ghostwrap`,children:[(0,a.jsxs)(`div`,{className:`fl-ghost-said`,children:[(0,a.jsx)(`span`,{className:`fl-wave`,"aria-hidden":`true`,children:Array.from({length:12},(e,t)=>(0,a.jsx)(`i`,{style:{"--i":String(t)}},t))}),(0,a.jsxs)(`span`,{className:`fl-ghost-words`,children:[`“…and how does that compare to last year, and`,(0,a.jsx)(`span`,{className:`fl-caret`}),`”`]})]}),(0,a.jsxs)(`div`,{className:`fl-ghost-cards`,children:[(0,a.jsxs)(`div`,{className:`fl-ghost`,children:[(0,a.jsx)(`div`,{className:`fl-ghost-tag`,children:`Forming…`}),(0,a.jsxs)(`div`,{className:`fl-ghost-bars`,children:[(0,a.jsx)(`i`,{style:{height:`50%`}}),(0,a.jsx)(`i`,{style:{height:`80%`}}),(0,a.jsx)(`i`,{style:{height:`65%`}})]})]}),(0,a.jsxs)(`div`,{className:`fl-ghost delay`,children:[(0,a.jsx)(`div`,{className:`fl-ghost-tag`,children:`Forming…`}),(0,a.jsx)(`svg`,{viewBox:`0 0 120 50`,"aria-hidden":`true`,children:(0,a.jsx)(`polyline`,{points:`0,42 24,30 48,34 72,18 96,22 120,8`})})]})]})]})}var y=[{label:`Runway: 14mo`,meta:`4×`,x:92,y:52,tone:`blue`},{label:`Hiring freeze`,meta:`a worry`,x:86,y:200,tone:`amber`},{label:`Ship velocity`,meta:`slowing`,x:300,y:204,tone:`amber`},{label:`Churn signal`,meta:`watch`,x:300,y:50,tone:`pink`},{label:`Pricing`,meta:`your idea`,x:206,y:226,tone:`green`}],b=[[0,3],[3,2],[1,4],[4,2],[0,1]];function x(){let e=(0,i.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(`svg`,{className:`fl-mindmap-links`,viewBox:`0 0 420 264`,"aria-hidden":`true`,children:b.map(C)}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,a.jsxs)(`div`,{className:`fl-card fl-mindmap`,children:[t,(0,a.jsx)(`div`,{className:`fl-mindmap-hub`,children:(0,a.jsx)(r,{size:46})}),y.map(S)]}),e[1]=n):n=e[1],n}function S(e){return(0,a.jsxs)(`div`,{className:`fl-node tone-`+e.tone,style:{left:`${e.x/420*100}%`,top:`${e.y/264*100}%`},children:[(0,a.jsx)(`div`,{className:`fl-node-label`,children:e.label}),(0,a.jsx)(`div`,{className:`fl-node-meta`,children:e.meta})]},e.label)}function C(e,t){let[n,r]=e,i=y[n],o=y[r],s=(i.x+o.x)/2,c=(i.y+o.y)/2-20;return(0,a.jsx)(`path`,{d:`M${i.x},${i.y} Q${s},${c} ${o.x},${o.y}`},t)}var w=[{icon:`⌨`,label:`Type it`},{icon:`🎙`,label:`Say it`},{icon:`▦`,label:`Drag a card`}];function T(){let e=(0,i.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(`span`,{className:`fl-blank-num good`,children:`$2.1M`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,a.jsxs)(`span`,{className:`fl-blank-hole`,children:[`your burn / mo`,(0,a.jsx)(`span`,{className:`fl-caret`})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,a.jsxs)(`div`,{className:`fl-blank-sentence`,children:[`With `,t,` in the bank and a burn of`,` `,n,`, your runway is `,(0,a.jsx)(`span`,{className:`fl-blank-pending`,children:`— months`}),`.`]}),e[2]=r):r=e[2];let o;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,a.jsxs)(`div`,{className:`fl-card fl-blank`,children:[r,(0,a.jsx)(`div`,{className:`fl-blank-options`,"aria-hidden":`true`,children:w.map(E)})]}),e[3]=o):o=e[3],o}function E(e){return(0,a.jsxs)(`span`,{className:`fl-blank-btn`,children:[(0,a.jsx)(`span`,{className:`fl-blank-icon`,children:e.icon}),e.label]},e.label)}var D=[`“ARR climbed to $15.1M — up 21%.”`,`“The trend held steady all quarter.”`,`“North America still leads, at 54%.”`];function O(){return(0,a.jsxs)(`div`,{className:`fl-card fl-walk`,children:[(0,a.jsx)(`div`,{className:`fl-ink-label`,children:`Q3 revenue · read to you`}),(0,a.jsxs)(`div`,{className:`fl-walk-stage`,children:[(0,a.jsxs)(`div`,{className:`fl-walk-presenter`,children:[(0,a.jsx)(r,{size:44,className:`fl-walk-orb`}),(0,a.jsxs)(`div`,{className:`fl-walk-say`,children:[(0,a.jsx)(`span`,{className:`fl-wave`,"aria-hidden":`true`,children:Array.from({length:8},(e,t)=>(0,a.jsx)(`i`,{style:{"--i":String(t)}},t))}),(0,a.jsx)(`span`,{className:`fl-walk-caps`,children:D.map((e,t)=>(0,a.jsx)(`span`,{className:`fl-walk-line l${t+1}`,children:e},e))})]})]}),(0,a.jsxs)(`div`,{className:`fl-walk-items`,children:[(0,a.jsxs)(`div`,{className:`fl-walk-item`,children:[(0,a.jsx)(`span`,{className:`fl-walk-k`,children:`ARR`}),(0,a.jsx)(`span`,{className:`fl-walk-v`,children:`$15.1M`}),(0,a.jsx)(`span`,{className:`fl-walk-up`,children:`▲ 21%`})]}),(0,a.jsx)(`div`,{className:`fl-walk-item`,children:(0,a.jsx)(`svg`,{className:`fl-walk-spark`,viewBox:`0 0 120 26`,"aria-hidden":`true`,children:(0,a.jsx)(`polyline`,{points:`2,20 22,17 42,19 62,11 82,13 100,6 118,3`})})}),(0,a.jsxs)(`div`,{className:`fl-walk-item`,children:[(0,a.jsx)(`span`,{className:`fl-walk-k`,children:`N. America`}),(0,a.jsx)(`span`,{className:`fl-walk-v`,children:`54%`})]}),(0,a.jsx)(`span`,{className:`fl-walk-spot`,"aria-hidden":`true`})]})]}),(0,a.jsx)(`div`,{className:`fl-seen-note`,children:`Illustrative numbers`})]})}function k(){let e=(0,i.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsxs)(n,{eyebrow:`Things a chat window can’t do`,children:[`It’s a `,(0,a.jsx)(`em`,{children:`friend at the whiteboard.`})]}),e[0]=t):t=e[0];let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,a.jsx)(o,{eyebrow:`Highlight is the interface`,eyebrowTone:`presence`,title:`Highlight the answer to ask.`,body:`Drag across a bar, a row, a figure — the highlight grabs exactly what’s under it, and your next question is grounded on that piece, not the whole answer.`,visual:(0,a.jsx)(g,{})}),e[1]=r):r=e[1];let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,a.jsx)(o,{reverse:!0,eyebrow:`And the pen is in its hand`,eyebrowTone:`amber`,title:`It draws on its own answers.`,body:`A trend arrow along the recovery, a star on the number that matters, a strike through the option it rules out — the whiteboard marks a good teacher leaves.`,visual:(0,a.jsx)(u,{})}),e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,a.jsx)(o,{eyebrow:`It answers while you talk`,eyebrowTone:`blue`,title:`The answer forms mid-sentence.`,body:`Dashed “ghost” cards sketch the answer taking shape behind your words — and reshape live as your question turns. You see it thinking with you, not after you.`,visual:(0,a.jsx)(v,{})}),e[3]=c):c=e[3];let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,a.jsx)(o,{reverse:!0,eyebrow:`Watch it map your thinking`,eyebrowTone:`green`,title:`Ramble. Get a map of your mind.`,body:`Themes emerge from what you actually said — never fixed buckets — with the tensions between them drawn in. A minute of talking becomes a structure you can see.`,visual:(0,a.jsx)(x,{})}),e[4]=l):l=e[4];let d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,a.jsx)(o,{eyebrow:`The Blank Space`,eyebrowTone:`pink`,title:`It won’t guess. It leaves a space.`,body:`When an answer needs a number only you have, Mavéa leaves a glowing hole to fill — type it, say it, or drag a card in. Uncertainty, made honest and interactive.`,visual:(0,a.jsx)(T,{})}),e[5]=d):d=e[5];let f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,a.jsx)(o,{reverse:!0,eyebrow:`One canvas, many instruments`,eyebrowTone:`presence`,title:`The answer picks its shape.`,body:`Charts, maps, timelines, networks, tables — hundreds of visual instruments on one canvas, and each answer reaches for the ones that fit.`,visual:(0,a.jsx)(h,{})}),e[6]=f):f=e[6];let p;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,a.jsxs)(a.Fragment,{children:[t,(0,a.jsxs)(`div`,{className:`fl-panels`,children:[r,s,c,l,d,f,(0,a.jsx)(o,{eyebrow:`It reads the answer to you`,eyebrowTone:`presence`,title:`It points, and talks you through.`,body:`Mavéa doesn’t drop a wall of cards and leave. It spotlights each part and speaks to it — walking you through the answer a piece at a time, the way a friend at the whiteboard would.`,visual:(0,a.jsx)(O,{})})]})]}),e[7]=p):p=e[7],p}export{k as WowFeatures};
|
|
@@ -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{t as i}from"./useFocusTrap-CJmpNZv2.js";import{t as a}from"./portal-
|
|
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{t as i}from"./useFocusTrap-CJmpNZv2.js";import{t as a}from"./portal-XWyi6FIz.js";import{t as o}from"./useZoomGesture-CN0p0lHL.js";var s=e(),c=t(),l=n();function u(e){let t=(0,c.c)(52),{model:n,level:u,onLevel:d,onJump:f,onClose:p}=e,m=(0,s.useRef)(null);i(m);let h;t[0]!==u||t[1]!==p||t[2]!==d?(h=e=>{e===`out`?d(`breath`):u===`breath`?d(`chapters`):p()},t[0]=u,t[1]=p,t[2]=d,t[3]=h):h=t[3],o(m,h);let g,_;t[4]!==u||t[5]!==p||t[6]!==d?(g=()=>{let e=e=>{e.key===`Escape`?(e.preventDefault(),p()):e.key===`ArrowRight`?(e.preventDefault(),u===`chapters`&&d(`breath`)):e.key===`ArrowLeft`&&(e.preventDefault(),u===`breath`?d(`chapters`):p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},_=[u,p,d],t[4]=u,t[5]=p,t[6]=d,t[7]=g,t[8]=_):(g=t[7],_=t[8]),(0,s.useEffect)(g,_);let v;t[9]===p?v=t[10]:(v=e=>{e.target===e.currentTarget&&p()},t[9]=p,t[10]=v);let y=v,b;t[11]===y?b=t[12]:(b=e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),y(e))},t[11]=y,t[12]=b);let x=`zoom-deck level-`+u,S;t[13]===p?S=t[14]:(S=(0,l.jsx)(`button`,{type:`button`,className:`zoom-level`,onClick:p,children:`Canvas`}),t[13]=p,t[14]=S);let C=`zoom-level`+(u===`chapters`?` active`:``),w=u===`chapters`,T;t[15]===d?T=t[16]:(T=()=>d(`chapters`),t[15]=d,t[16]=T);let E;t[17]!==T||t[18]!==C||t[19]!==w?(E=(0,l.jsx)(`button`,{type:`button`,className:C,"aria-pressed":w,onClick:T,children:`Chapters`}),t[17]=T,t[18]=C,t[19]=w,t[20]=E):E=t[20];let D=`zoom-level`+(u===`breath`?` active`:``),O=u===`breath`,k;t[21]===d?k=t[22]:(k=()=>d(`breath`),t[21]=d,t[22]=k);let A;t[23]!==D||t[24]!==O||t[25]!==k?(A=(0,l.jsx)(`button`,{type:`button`,className:D,"aria-pressed":O,onClick:k,children:`One breath`}),t[23]=D,t[24]=O,t[25]=k,t[26]=A):A=t[26];let j;t[27]!==E||t[28]!==A||t[29]!==S?(j=(0,l.jsxs)(`div`,{className:`zoom-levelbar`,role:`group`,"aria-label":`Zoom level`,children:[S,E,A]}),t[27]=E,t[28]=A,t[29]=S,t[30]=j):j=t[30];let M;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,l.jsx)(r.x,{}),t[31]=M):M=t[31];let N;t[32]===p?N=t[33]:(N=(0,l.jsx)(`button`,{type:`button`,className:`zoom-close`,onClick:p,"aria-label":`Close zoom`,title:`Close`,children:M}),t[32]=p,t[33]=N);let P;t[34]!==j||t[35]!==N?(P=(0,l.jsxs)(`header`,{className:`zoom-toolbar`,children:[j,N]}),t[34]=j,t[35]=N,t[36]=P):P=t[36];let F;t[37]!==u||t[38]!==n.heading||t[39]!==n.meta||t[40]!==n.rows||t[41]!==f||t[42]!==d?(F=u===`breath`?(0,l.jsxs)(`div`,{className:`zoom-breath`,children:[(0,l.jsxs)(`p`,{className:`zoom-breath-line`,children:[n.heading.replace(/, so far\.$/,``),`: `,n.rows.map((e,t)=>(0,l.jsxs)(`button`,{type:`button`,className:`zoom-breath-topic`,onClick:()=>d(`chapters`),children:[e.title,t<n.rows.length-1?` · `:``]},e.frameIndex))]}),(0,l.jsxs)(`p`,{className:`zoom-meta`,children:[n.meta,` · one breath`]})]}):(0,l.jsxs)(`div`,{className:`zoom-chapters`,children:[(0,l.jsxs)(`header`,{className:`zoom-head`,children:[(0,l.jsx)(`span`,{className:`zoom-title`,children:n.heading}),(0,l.jsx)(`span`,{className:`zoom-meta`,children:n.meta})]}),(0,l.jsx)(`ul`,{className:`zoom-rows`,children:n.rows.map(e=>(0,l.jsx)(`li`,{children:(0,l.jsxs)(`button`,{type:`button`,className:`zoom-row`,onClick:()=>f(e.frameIndex),children:[(0,l.jsxs)(`span`,{className:`zoom-row-title`,children:[e.title,(0,l.jsx)(`span`,{className:`zoom-row-clock`,children:e.clock})]}),(0,l.jsx)(`span`,{className:`zoom-row-line`,children:e.line}),e.corrected&&(0,l.jsx)(`span`,{className:`zoom-row-corrected`,children:e.corrected})]})},e.frameIndex))})]}),t[37]=u,t[38]=n.heading,t[39]=n.meta,t[40]=n.rows,t[41]=f,t[42]=d,t[43]=F):F=t[43];let I;t[44]!==P||t[45]!==F||t[46]!==x?(I=(0,l.jsxs)(`div`,{ref:m,className:x,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation zoomed out`,tabIndex:-1,children:[P,F]}),t[44]=P,t[45]=F,t[46]=x,t[47]=I):I=t[47];let L;return t[48]!==y||t[49]!==I||t[50]!==b?(L=(0,l.jsx)(a,{children:(0,l.jsx)(`div`,{className:`zoom-scrim`,role:`button`,tabIndex:0,"aria-label":`Close`,onClick:y,onKeyDown:b,children:I})}),t[48]=y,t[49]=I,t[50]=b,t[51]=L):L=t[51],L}export{u as ZoomDeck};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{F as t}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{F as t}from"./index-yJfYsjAB.js";import{C as n,i as r,m as i}from"./kokoro-DogSQaQB.js";async function a(e,t,n){let r=Array(e.length),i=0,a=!1,o=async()=>{for(;!a;){let t=i++;if(t>=e.length)return;try{r[t]=await n(e[t],t)}catch(e){throw a=!0,e}}},s=Math.max(1,Math.min(t,e.length));return await Promise.all(Array.from({length:s},o)),r}var o=e({renderReelAudio:()=>h,synthesizeVoiceLine:()=>m}),s=24e3,c=.15,l=.18,u=240,d=.008,f=.89,p=6;async function m(e,t){let a=n(e).trim().slice(0,u);if(!a)return new Float32Array;for(let e=0;e<2;e++)try{let e=await fetch(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:a,voice:r(`mavea`),response_format:`pcm`,speed:1}),signal:t});if(e.ok)return i(new Uint8Array(await e.arrayBuffer()),null).samples}catch{if(t?.aborted)return new Float32Array}return new Float32Array}async function h(e,n,r){let i=e.slides,o=i.map(e=>Math.max(800,Math.round(e.durationMs))),u=t(),h=i.map(e=>e.voiceover.trim()),g=h.find(Boolean);if(u===null||typeof OfflineAudioContext>`u`)return{buffer:null,timings:o,missing:h.filter(Boolean).length,...g?{firstMissingLine:g}:{}};let _=0,v=await a(i,2,async e=>{let t=await m(e.voiceover,n);return r?.(++_,i.length),t}),y=h.filter(Boolean).length,b=v.filter(e=>e.length>0).length,x=Math.max(0,y-b),S=h.find((e,t)=>e&&v[t].length===0);if(b===0)return{buffer:null,timings:o,missing:x,...S?{firstMissingLine:S}:{}};let C=i.map((e,t)=>{let n=v[t].length/s*1e3;return Math.round(n>0?Math.max(o[t],n+l*1e3):o[t])}),w=0;for(let e of v)for(let t=0;t<e.length;t++)w=Math.max(w,Math.abs(e[t]));let T=w>0?Math.min(p,f/w):1,E=.65+C.reduce((e,t)=>e+t/1e3,0),D=new OfflineAudioContext(1,Math.ceil(E*u),u),O=D.createGain();O.gain.value=T,O.connect(D.destination);let k=c;return C.forEach((e,t)=>{let n=v[t];if(n.length){let e=D.createBuffer(1,n.length,s);e.getChannelData(0).set(n);let t=D.createBufferSource();t.buffer=e;let r=D.createGain(),i=n.length/s,a=Math.min(d,i/2);r.gain.setValueAtTime(0,k),r.gain.linearRampToValueAtTime(1,k+a),r.gain.setValueAtTime(1,k+i-a),r.gain.linearRampToValueAtTime(0,k+i),t.connect(r).connect(O),t.start(k)}k+=e/1e3}),{buffer:await D.startRendering(),timings:C,missing:x,...S?{firstMissingLine:S}:{}}}export{m as n,a as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./TopicCanvas-xwDjwqxn.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-DG1n-LFe.js","assets/rolldown-runtime-DkW27tQK.js","assets/__vite-browser-external-gfE6fZcA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,t}from"./preload-helper-CiWYd9n-.js";import{N as n,f as r}from"./index-Db-FgYxX.js";function i(e){let t=n();if(!t)return null;let{ctx:r,release:i}=t;if(typeof r.createMediaStreamDestination!=`function`)return i(),null;let a=r.createMediaStreamDestination(),o=r.createBufferSource();o.buffer=e,o.connect(a);let s=!1;return{stream:a.stream,start(){s||(s=!0,r.state!==`running`&&r.resume().catch(()=>{}),o.start())},stop(){try{o.stop()}catch{}try{o.disconnect()}catch{}i()}}}function a(e,t,n){return t+Math.max(0,n-e)}function o(e,t){return!Number.isFinite(t)||t<=0||e>=t?null:Math.max(0,e)}function s(e){let t=n();if(!t)return null;let{ctx:r,release:i}=t,s=r.createGain();s.connect(r.destination);let c=null,l=0,u=0,d=!1,f=()=>{try{c?.stop(),c?.disconnect()}catch{}c=null},p=t=>{f(),c=r.createBufferSource(),c.buffer=e,c.connect(s),c.start(0,t),l=t,u=r.currentTime,d=!1};return{play(){r.state!==`running`&&r.resume().catch(()=>{}),p(0)},setMuted(e){s.gain.value=+!e},pause(){d||!c||(l=Math.min(e.duration,a(u,l,r.currentTime)),f(),d=!0)},resume(){if(!d)return;d=!1;let t=o(l,e.duration);t!==null&&(r.state!==`running`&&r.resume().catch(()=>{}),p(t))},stop(){f();try{s.disconnect()}catch{}i()}}}var c=`opus`,l=[{container:`mp4`,mimeType:`video/mp4`,video:`av1`,audio:c},{container:`webm`,mimeType:`video/webm`,video:`vp9`,audio:c},{container:`webm`,mimeType:`video/webm`,video:`vp8`,audio:c}],u=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`];async function d(e,t){if(t.audio&&!await e.canEncodeAudio(c,{numberOfChannels:t.audio.numberOfChannels,sampleRate:t.audio.sampleRate,bitrate:t.audioBitrate??192e3}).catch(()=>!1))return null;for(let n of l)if(await e.canEncodeVideo(n.video,{width:t.width,height:t.height,bitrate:t.videoBitrate}).catch(()=>!1))return n;return null}function f(){return typeof MediaRecorder>`u`||typeof MediaRecorder.isTypeSupported!=`function`?null:u.find(e=>MediaRecorder.isTypeSupported(e))??null}function p(e,{fps:t,capS:n}){let r=null,i=!0;return{realtime:!1,accepting:()=>i,async end(a){if(r===null||!i)return;let o=r;r=null;try{await e.add(o,Math.max(1/t,Math.min(a,n)-o))}catch{i=!1}},begin(e){i&&(r=e)},finish(){if(i){i=!1;try{e.close()}catch{}}}}}function ee(){return{realtime:!0,accepting:()=>!0,async end(){},begin(){},finish(){}}}function m(e){let t=e.effect?.getComputedTiming();return t?.progress!==null&&t?.progress!==void 0}function h(e){let t=e.effect;return!t||!(`target`in t)?null:t.target}function te(e){let t=new WeakMap,n=[];return{refresh(r){n=e.getAnimations({subtree:!0}).map(e=>{if(!t.has(e)){t.set(e,r);try{e.pause()}catch{}}return{animation:e,target:h(e)}})},seek(e){for(let{animation:r}of n)try{r.currentTime=e-(t.get(r)??0)}catch{}},activeInside(e){return n.some(({animation:t,target:n})=>n!==null&&e.contains(n)&&m(t))},activeOutside(e){return n.some(({animation:t,target:n})=>!(e&&n&&e.contains(n))&&m(t))},release(){for(let{animation:e}of n)try{e.play()}catch{}n=[]}}}var g=201326592,_=864e5,v=256,y=32,b=/^mavea-video-(\d{13})-[a-z0-9]+[.](?:webm|mp4)$/,x=new WeakSet;async function S(e,t=Date.now()){let n=0,r=0;try{let i=e.entries();try{for(;n<v;){let a=await i.next();if(a.done)break;n+=1;let[o,s]=a.value;if(r>=y||s.kind!==`file`)continue;let c=b.exec(o);if(!c)continue;let l=Number(c[1]);if(!(!Number.isSafeInteger(l)||t-l<_))try{await e.removeEntry(o),r+=1}catch{}}}finally{await i.return?.()}}catch{}return r}function C(e){x.has(e)||(x.add(e),S(e))}async function w(e=`webm`){if(typeof navigator>`u`)return null;let t=navigator.storage;if(!t?.getDirectory)return null;try{let n=await t.getDirectory();C(n);let r=`mavea-video-${Date.now()}-${Math.random().toString(36).slice(2)}.${e}`,i=await n.getFileHandle(r,{create:!0});return{handle:i,name:r,root:n,writable:await i.createWritable()}}catch{return null}}async function ne(e,t=`webm`){let n=await w(t);return n?{target:new e(n.writable,{chunked:!0,chunkSize:4194304}),async finish(){return{blob:await n.handle.getFile(),dispose:()=>n.root.removeEntry(n.name).catch(()=>{})}},async discard(){await n.writable.abort().catch(()=>{}),await n.root.removeEntry(n.name).catch(()=>{})}}:null}async function re(){let e=await w();if(e){let t=!1,n=null,r=Promise.resolve();return{write(i){t||!i.size||(r=r.then(()=>e.writable.write(i)).catch(e=>{n=e instanceof Error?e:Error(`temporary-video-write-failed`)}))},async finish(){if(await r,n)throw n;return await e.writable.close(),{blob:await e.handle.getFile(),dispose:()=>e.root.removeEntry(e.name).catch(()=>{})}},async discard(){t=!0,await r.catch(()=>{}),await e.writable.abort().catch(()=>{}),await e.root.removeEntry(e.name).catch(()=>{})}}}let t=[],n=0,r=null,i=!1;return{write(e){if(!(i||!e.size||r)){if(n+=e.size,n>g){r=Error(`temporary-video-storage-unavailable`),t.length=0;return}t.push(e)}},async finish(){if(r)throw r;return{blob:new Blob(t,{type:`video/webm`})}},async discard(){i=!0,t.length=0}}}e();var T={balanced:{fps:15,bitrate:6e6},high:{fps:24,bitrate:7e6},ultra:{fps:24,bitrate:8e6}};function E(e,t=r()){let n=T[e],i=t===`lite`?{fps:12,bitrate:6e6}:{fps:24,bitrate:8e6};return{fps:Math.min(n.fps,i.fps),bitrate:Math.min(n.bitrate,i.bitrate)}}function D(e){let{fps:t,bitrate:n}=E(e);return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function ie(){try{let{Output:e,Mp4OutputFormat:n,WebMOutputFormat:r,BufferTarget:i,StreamTarget:a,CanvasSource:o,AudioBufferSource:s,canEncodeVideo:c,canEncodeAudio:l}=await t(async()=>{let{Output:e,Mp4OutputFormat:t,WebMOutputFormat:n,BufferTarget:r,StreamTarget:i,CanvasSource:a,AudioBufferSource:o,canEncodeVideo:s,canEncodeAudio:c}=await import(`./src-DG1n-LFe.js`);return{Output:e,Mp4OutputFormat:t,WebMOutputFormat:n,BufferTarget:r,StreamTarget:i,CanvasSource:a,AudioBufferSource:o,canEncodeVideo:s,canEncodeAudio:c}},__vite__mapDeps([0,1,2]));return{Output:e,Mp4OutputFormat:n,WebMOutputFormat:r,BufferTarget:i,StreamTarget:a,CanvasSource:o,AudioBufferSource:s,canEncodeVideo:c,canEncodeAudio:l}}catch{return null}}async function ae(){try{return await t(()=>import(`./dist-DRo0JOkC.js`),[])}catch{return null}}var oe={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}},se=12,ce=400,le=500;function ue(e,t){let n=performance.now(),r=0,i=0,a=()=>{n=performance.now(),r++},o=new MutationObserver(e=>{n=performance.now();for(let n of e)t&&(n.target===t||t.contains(n.target))?i++:r++});return o.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),e.addEventListener(`load`,a,!0),e.addEventListener(`scroll`,a,!0),{still(){return performance.now()-n<ce||typeof e.getAnimations!=`function`||e.querySelector(`canvas, video`)?!1:e.getAnimations({subtree:!0}).every(e=>e.playState!==`running`)},changes:()=>r,layerChanges:()=>i,hasLiveMedia:()=>!!e.querySelector(`canvas, video`),dispose(){o.disconnect(),e.removeEventListener(`load`,a,!0),e.removeEventListener(`scroll`,a,!0)}}}function O(){if(typeof document>`u`)return!1;let e=f()!==null,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function k(e){let t=E(e.quality??`high`),n=e.fps??t.fps,r=e.bitrate??t.bitrate,a=e.background??`#05070c`,{w:o,h:s}=e.dims??oe[e.aspect],c=e.maxDurationMs??1/0,l=c/1e3,u=await ae();if(!u)throw Error(`rasterizer-unavailable`);let m=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await ie():null,h=m?await d(m,{width:o,height:s,videoBitrate:r,audio:e.audioBuffer}):null,g=!!(h&&m),_=!!e.cues&&Number.isFinite(c)&&g&&typeof e.el.getAnimations==`function`,v=e.el.clientWidth||o,y=Math.min(3,Math.max(1,o/v)),b=_&&e.liveLayer?e.el.querySelector(e.liveLayer.selector):null,x=b instanceof HTMLElement?b:null,S=x?e.liveLayer?.bleed??0:0,C=x?.getBoundingClientRect(),w=C?{w:Math.ceil(C.width+S*2),h:Math.ceil(C.height+S*2)}:null,T=x?document.createElement(`canvas`):null;T&&(T.width=o,T.height=s);let D=T?.getContext(`2d`,{alpha:!1})??null,ce=!!(x&&w&&D),O,k=null;try{O=await u.createContext(e.el,{scale:y,backgroundColor:a,filter:ce?e=>e!==x:void 0}),ce&&x&&w&&(k=await u.createContext(x,{scale:y,backgroundColor:null,width:w.w,height:w.h,style:{padding:`${S}px`}}))}catch{throw Error(`rasterizer-unavailable`)}let A=x&&k&&T&&D?{el:x,context:k,canvas:T,ctx:D}:null,j=0,M=0,N=null,de=()=>{M++,M>=se&&!N&&(N=Error(`rasterizer-failed`))},P=ue(e.el,A?.el??null),F=()=>{P.dispose(),u.destroyContext(O),k&&u.destroyContext(k)},I=document.createElement(`canvas`);I.width=o,I.height=s;let L=I.getContext(`2d`,{alpha:!1});L.fillStyle=a,L.fillRect(0,0,o,s);let R=document.createElement(`canvas`);R.width=Math.round(o/2),R.height=Math.round(s/2);let fe=R.getContext(`2d`),z=!1,B=()=>{fe&&(fe.drawImage(I,0,0,R.width,R.height),z=!0)},pe=()=>new Blob([],{type:`image/png`}),me=async()=>(!z&&j>0&&B(),z?await new Promise(e=>R.toBlob(e,`image/png`))??pe():pe()),V=async e=>{let t;try{t=await u.domToCanvas(e)}catch{return de(),null}return!t.width||!t.height?(de(),null):(M=0,t)},he=0,ge=()=>{if(j++,!e.onFrame)return;let t=performance.now();t-he<le||(he=t,e.onFrame(I))},H={scale:1,offsetX:0,offsetY:0},_e=(e,t)=>{let n=Math.max(o/t.width,s/t.height),r=t.width*n,i=t.height*n;H={scale:n,offsetX:(o-r)/2,offsetY:(s-i)/2},e.fillStyle=a,e.fillRect(0,0,o,s),e.drawImage(t,H.offsetX,H.offsetY,r,i)},U=async()=>{let e=await V(O);return e?(_e(L,e),ge(),!0):!1},W={x:0,y:0,w:w?.w??0,h:w?.h??0},ve=()=>{if(!A)return;let t=e.el.getBoundingClientRect(),n=A.el.getBoundingClientRect();W={...W,x:n.left-t.left-S,y:n.top-t.top-S}};ve();let ye=async(e,t)=>{if(!A)return U();let n=e?await V(O):null;if(e&&!n)return!1;let r=t?await V(A.context):null;if(t&&!r)return!1;n&&_e(A.ctx,n);let i=H.scale*y,a=Math.round(H.offsetX+W.x*i),o=Math.round(H.offsetY+W.y*i),s=Math.round(W.w*i),c=Math.round(W.h*i);return n?L.drawImage(A.canvas,0,0):L.drawImage(A.canvas,a,o,s,c,a,o,s,c),r&&L.drawImage(r,a,o,s,c),ge(),!0},G=0,K=null,q=()=>K===null?G:performance.now()-K,J=!0,Y=0,be=e.cues??[],xe=async e=>{let t=!1;for(;Y<be.length&&be[Y].atMs<=e;)await be[Y].apply(),Y++,t=!0;return t},Se=async t=>{let r=te(e.el),i=-1,a=-1,o=-1,s=!1,c=!1;try{for(let u=0;J&&t.accepting()&&!N;u++){let d=u/n;if(d>=l)break;let f=d*1e3;if(e.gate&&await e.gate(),!J)break;let p=await xe(f);p&&ve(),(p||P.changes()+P.layerChanges()!==i)&&(r.refresh(f),i=P.changes()+P.layerChanges()),r.seek(f);let ee=P.changes(),m=P.layerChanges(),h=ee!==a,te=m!==o,g=r.activeOutside(A?.el??null),_=A?r.activeInside(A.el):!1,v=P.hasLiveMedia(),y=u===0||h||g||s||v,b=!!A&&(y||te||_||c);if(s=g,c=_,y||b){await t.end(d);let e=A?await ye(y,b):await U();if(!J||!t.accepting()||N)break;e&&(a=ee,o=m),t.begin(d)}G=Math.min((u+1)/n,l)*1e3,!z&&d>1.2&&j>2&&M===0&&B(),await new Promise(e=>setTimeout(e,0))}}finally{r.release()}},Ce=async t=>{let r=performance.now();K=r;let i=!0;for(;J&&t.accepting()&&!N;){let a=performance.now();if(e.gate&&await e.gate(),!J)break;if(await xe(performance.now()-r),i||!P.still()){if(await t.end((performance.now()-r)/1e3),await U(),!J||!t.accepting()||N)break;t.begin(i?0:(performance.now()-r)/1e3),i=!1}let o=performance.now()-r;if(G=o,o>=c)break;!z&&o>1200&&j>2&&M===0&&B();let s=performance.now()-a;await new Promise(e=>setTimeout(e,Math.max(0,1e3/n-s)))}},we=e=>_&&!e.realtime?Se(e):Ce(e);if(h&&m){let t=await ne(m.StreamTarget,h.container),i=t?null:new m.BufferTarget,a=new m.Output({format:h.container===`mp4`?new m.Mp4OutputFormat:new m.WebMOutputFormat,target:t?.target??i}),o=new m.CanvasSource(I,{codec:h.video,bitrate:r});a.addVideoTrack(o);let s=null;if(e.audioBuffer){let t=new m.AudioBufferSource({codec:h.audio,bitrate:192e3});a.addAudioTrack(t);let n=e.audioBuffer;s=async()=>{try{await t.add(n),t.close()}catch{}}}await a.start(),s?.();let c=p(o,{fps:n,capS:l}),u=we(c);u.catch(()=>{});let d=()=>{J=!1,F(),I.width=I.height=0,R.width=R.height=0,A&&(A.canvas.width=A.canvas.height=0)};return{done:()=>u,async stop(){if(J=!1,N||j===0)throw a.cancel?.(),t?.discard(),d(),N??Error(`rasterizer-failed`);await c.end(q()/1e3);let n=await me();c.finish(),await a.finalize();let r=t?await t.finish():null;return d(),{blob:r?.blob??new Blob([i?.buffer??new ArrayBuffer(0)],{type:h.mimeType}),type:h.mimeType,poster:n,hasAudio:!!e.audioBuffer,durationMs:Math.round(q()),dispose:r?.dispose}},cancel(){J=!1,a.cancel?.(),t?.discard(),d()}}}let Te=I.captureStream(n),Ee=new MediaStream(Te.getVideoTracks()),De=e.audioBuffer?i(e.audioBuffer):null,Oe=De?.stream.getAudioTracks()[0]??null;Oe&&Ee.addTrack(Oe);let ke=f();if(!ke)throw F(),I.width=I.height=0,R.width=R.height=0,Error(`open-codec-unavailable`);let X=new MediaRecorder(Ee,{mimeType:ke,videoBitsPerSecond:r}),Z=await re();X.ondataavailable=e=>Z.write(e.data);let Ae=new Promise(e=>{X.addEventListener(`stop`,()=>e(),{once:!0})}),Q=()=>{try{X.state!==`inactive`&&X.stop()}catch{}};X.start(1e3),De?.start();let je=we(ee()).finally(()=>{(N||G>=c)&&Q()});je.catch(()=>{});let $=()=>{J=!1,F();for(let e of Ee.getTracks())e.stop();De?.stop(),I.width=I.height=0,R.width=R.height=0,A&&(A.canvas.width=A.canvas.height=0)};return{done:()=>je,async stop(){if(J=!1,N||j===0)throw Q(),Z.discard(),$(),N??Error(`rasterizer-failed`);let e=await me();Q(),await Ae;try{let t=await Z.finish(),n=Math.round(q());return $(),{blob:t.blob,type:ke,poster:e,hasAudio:!!Oe,durationMs:n,dispose:t.dispose}}catch(e){throw await Z.discard(),$(),e}},cancel(){J=!1,Q(),Z.discard(),$()}}}export{f as a,k as i,O as n,s as o,D as r,E as t};
|
|
2
|
+
import{n as e,t}from"./preload-helper-CiWYd9n-.js";import{N as n,f as r}from"./index-yJfYsjAB.js";function i(e){let t=n();if(!t)return null;let{ctx:r,release:i}=t;if(typeof r.createMediaStreamDestination!=`function`)return i(),null;let a=r.createMediaStreamDestination(),o=r.createBufferSource();o.buffer=e,o.connect(a);let s=!1;return{stream:a.stream,start(){s||(s=!0,r.state!==`running`&&r.resume().catch(()=>{}),o.start())},stop(){try{o.stop()}catch{}try{o.disconnect()}catch{}i()}}}function a(e,t,n){return t+Math.max(0,n-e)}function o(e,t){return!Number.isFinite(t)||t<=0||e>=t?null:Math.max(0,e)}function s(e){let t=n();if(!t)return null;let{ctx:r,release:i}=t,s=r.createGain();s.connect(r.destination);let c=null,l=0,u=0,d=!1,f=()=>{try{c?.stop(),c?.disconnect()}catch{}c=null},p=t=>{f(),c=r.createBufferSource(),c.buffer=e,c.connect(s),c.start(0,t),l=t,u=r.currentTime,d=!1};return{play(){r.state!==`running`&&r.resume().catch(()=>{}),p(0)},setMuted(e){s.gain.value=+!e},pause(){d||!c||(l=Math.min(e.duration,a(u,l,r.currentTime)),f(),d=!0)},resume(){if(!d)return;d=!1;let t=o(l,e.duration);t!==null&&(r.state!==`running`&&r.resume().catch(()=>{}),p(t))},stop(){f();try{s.disconnect()}catch{}i()}}}var c=`opus`,l=[{container:`mp4`,mimeType:`video/mp4`,video:`av1`,audio:c},{container:`webm`,mimeType:`video/webm`,video:`vp9`,audio:c},{container:`webm`,mimeType:`video/webm`,video:`vp8`,audio:c}],u=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`];async function d(e,t){if(t.audio&&!await e.canEncodeAudio(c,{numberOfChannels:t.audio.numberOfChannels,sampleRate:t.audio.sampleRate,bitrate:t.audioBitrate??192e3}).catch(()=>!1))return null;for(let n of l)if(await e.canEncodeVideo(n.video,{width:t.width,height:t.height,bitrate:t.videoBitrate}).catch(()=>!1))return n;return null}function f(){return typeof MediaRecorder>`u`||typeof MediaRecorder.isTypeSupported!=`function`?null:u.find(e=>MediaRecorder.isTypeSupported(e))??null}function p(e,{fps:t,capS:n}){let r=null,i=!0;return{realtime:!1,accepting:()=>i,async end(a){if(r===null||!i)return;let o=r;r=null;try{await e.add(o,Math.max(1/t,Math.min(a,n)-o))}catch{i=!1}},begin(e){i&&(r=e)},finish(){if(i){i=!1;try{e.close()}catch{}}}}}function ee(){return{realtime:!0,accepting:()=>!0,async end(){},begin(){},finish(){}}}function m(e){let t=e.effect?.getComputedTiming();return t?.progress!==null&&t?.progress!==void 0}function h(e){let t=e.effect;return!t||!(`target`in t)?null:t.target}function te(e){let t=new WeakMap,n=[];return{refresh(r){n=e.getAnimations({subtree:!0}).map(e=>{if(!t.has(e)){t.set(e,r);try{e.pause()}catch{}}return{animation:e,target:h(e)}})},seek(e){for(let{animation:r}of n)try{r.currentTime=e-(t.get(r)??0)}catch{}},activeInside(e){return n.some(({animation:t,target:n})=>n!==null&&e.contains(n)&&m(t))},activeOutside(e){return n.some(({animation:t,target:n})=>!(e&&n&&e.contains(n))&&m(t))},release(){for(let{animation:e}of n)try{e.play()}catch{}n=[]}}}var g=201326592,_=864e5,v=256,y=32,b=/^mavea-video-(\d{13})-[a-z0-9]+[.](?:webm|mp4)$/,x=new WeakSet;async function S(e,t=Date.now()){let n=0,r=0;try{let i=e.entries();try{for(;n<v;){let a=await i.next();if(a.done)break;n+=1;let[o,s]=a.value;if(r>=y||s.kind!==`file`)continue;let c=b.exec(o);if(!c)continue;let l=Number(c[1]);if(!(!Number.isSafeInteger(l)||t-l<_))try{await e.removeEntry(o),r+=1}catch{}}}finally{await i.return?.()}}catch{}return r}function C(e){x.has(e)||(x.add(e),S(e))}async function w(e=`webm`){if(typeof navigator>`u`)return null;let t=navigator.storage;if(!t?.getDirectory)return null;try{let n=await t.getDirectory();C(n);let r=`mavea-video-${Date.now()}-${Math.random().toString(36).slice(2)}.${e}`,i=await n.getFileHandle(r,{create:!0});return{handle:i,name:r,root:n,writable:await i.createWritable()}}catch{return null}}async function ne(e,t=`webm`){let n=await w(t);return n?{target:new e(n.writable,{chunked:!0,chunkSize:4194304}),async finish(){return{blob:await n.handle.getFile(),dispose:()=>n.root.removeEntry(n.name).catch(()=>{})}},async discard(){await n.writable.abort().catch(()=>{}),await n.root.removeEntry(n.name).catch(()=>{})}}:null}async function re(){let e=await w();if(e){let t=!1,n=null,r=Promise.resolve();return{write(i){t||!i.size||(r=r.then(()=>e.writable.write(i)).catch(e=>{n=e instanceof Error?e:Error(`temporary-video-write-failed`)}))},async finish(){if(await r,n)throw n;return await e.writable.close(),{blob:await e.handle.getFile(),dispose:()=>e.root.removeEntry(e.name).catch(()=>{})}},async discard(){t=!0,await r.catch(()=>{}),await e.writable.abort().catch(()=>{}),await e.root.removeEntry(e.name).catch(()=>{})}}}let t=[],n=0,r=null,i=!1;return{write(e){if(!(i||!e.size||r)){if(n+=e.size,n>g){r=Error(`temporary-video-storage-unavailable`),t.length=0;return}t.push(e)}},async finish(){if(r)throw r;return{blob:new Blob(t,{type:`video/webm`})}},async discard(){i=!0,t.length=0}}}e();var T={balanced:{fps:15,bitrate:6e6},high:{fps:24,bitrate:7e6},ultra:{fps:24,bitrate:8e6}};function E(e,t=r()){let n=T[e],i=t===`lite`?{fps:12,bitrate:6e6}:{fps:24,bitrate:8e6};return{fps:Math.min(n.fps,i.fps),bitrate:Math.min(n.bitrate,i.bitrate)}}function D(e){let{fps:t,bitrate:n}=E(e);return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function ie(){try{let{Output:e,Mp4OutputFormat:n,WebMOutputFormat:r,BufferTarget:i,StreamTarget:a,CanvasSource:o,AudioBufferSource:s,canEncodeVideo:c,canEncodeAudio:l}=await t(async()=>{let{Output:e,Mp4OutputFormat:t,WebMOutputFormat:n,BufferTarget:r,StreamTarget:i,CanvasSource:a,AudioBufferSource:o,canEncodeVideo:s,canEncodeAudio:c}=await import(`./src-DG1n-LFe.js`);return{Output:e,Mp4OutputFormat:t,WebMOutputFormat:n,BufferTarget:r,StreamTarget:i,CanvasSource:a,AudioBufferSource:o,canEncodeVideo:s,canEncodeAudio:c}},__vite__mapDeps([0,1,2]));return{Output:e,Mp4OutputFormat:n,WebMOutputFormat:r,BufferTarget:i,StreamTarget:a,CanvasSource:o,AudioBufferSource:s,canEncodeVideo:c,canEncodeAudio:l}}catch{return null}}async function ae(){try{return await t(()=>import(`./dist-DRo0JOkC.js`),[])}catch{return null}}var oe={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}},se=12,ce=400,le=500;function ue(e,t){let n=performance.now(),r=0,i=0,a=()=>{n=performance.now(),r++},o=new MutationObserver(e=>{n=performance.now();for(let n of e)t&&(n.target===t||t.contains(n.target))?i++:r++});return o.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),e.addEventListener(`load`,a,!0),e.addEventListener(`scroll`,a,!0),{still(){return performance.now()-n<ce||typeof e.getAnimations!=`function`||e.querySelector(`canvas, video`)?!1:e.getAnimations({subtree:!0}).every(e=>e.playState!==`running`)},changes:()=>r,layerChanges:()=>i,hasLiveMedia:()=>!!e.querySelector(`canvas, video`),dispose(){o.disconnect(),e.removeEventListener(`load`,a,!0),e.removeEventListener(`scroll`,a,!0)}}}function O(){if(typeof document>`u`)return!1;let e=f()!==null,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function k(e){let t=E(e.quality??`high`),n=e.fps??t.fps,r=e.bitrate??t.bitrate,a=e.background??`#05070c`,{w:o,h:s}=e.dims??oe[e.aspect],c=e.maxDurationMs??1/0,l=c/1e3,u=await ae();if(!u)throw Error(`rasterizer-unavailable`);let m=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await ie():null,h=m?await d(m,{width:o,height:s,videoBitrate:r,audio:e.audioBuffer}):null,g=!!(h&&m),_=!!e.cues&&Number.isFinite(c)&&g&&typeof e.el.getAnimations==`function`,v=e.el.clientWidth||o,y=Math.min(3,Math.max(1,o/v)),b=_&&e.liveLayer?e.el.querySelector(e.liveLayer.selector):null,x=b instanceof HTMLElement?b:null,S=x?e.liveLayer?.bleed??0:0,C=x?.getBoundingClientRect(),w=C?{w:Math.ceil(C.width+S*2),h:Math.ceil(C.height+S*2)}:null,T=x?document.createElement(`canvas`):null;T&&(T.width=o,T.height=s);let D=T?.getContext(`2d`,{alpha:!1})??null,ce=!!(x&&w&&D),O,k=null;try{O=await u.createContext(e.el,{scale:y,backgroundColor:a,filter:ce?e=>e!==x:void 0}),ce&&x&&w&&(k=await u.createContext(x,{scale:y,backgroundColor:null,width:w.w,height:w.h,style:{padding:`${S}px`}}))}catch{throw Error(`rasterizer-unavailable`)}let A=x&&k&&T&&D?{el:x,context:k,canvas:T,ctx:D}:null,j=0,M=0,N=null,de=()=>{M++,M>=se&&!N&&(N=Error(`rasterizer-failed`))},P=ue(e.el,A?.el??null),F=()=>{P.dispose(),u.destroyContext(O),k&&u.destroyContext(k)},I=document.createElement(`canvas`);I.width=o,I.height=s;let L=I.getContext(`2d`,{alpha:!1});L.fillStyle=a,L.fillRect(0,0,o,s);let R=document.createElement(`canvas`);R.width=Math.round(o/2),R.height=Math.round(s/2);let fe=R.getContext(`2d`),z=!1,B=()=>{fe&&(fe.drawImage(I,0,0,R.width,R.height),z=!0)},pe=()=>new Blob([],{type:`image/png`}),me=async()=>(!z&&j>0&&B(),z?await new Promise(e=>R.toBlob(e,`image/png`))??pe():pe()),V=async e=>{let t;try{t=await u.domToCanvas(e)}catch{return de(),null}return!t.width||!t.height?(de(),null):(M=0,t)},he=0,ge=()=>{if(j++,!e.onFrame)return;let t=performance.now();t-he<le||(he=t,e.onFrame(I))},H={scale:1,offsetX:0,offsetY:0},_e=(e,t)=>{let n=Math.max(o/t.width,s/t.height),r=t.width*n,i=t.height*n;H={scale:n,offsetX:(o-r)/2,offsetY:(s-i)/2},e.fillStyle=a,e.fillRect(0,0,o,s),e.drawImage(t,H.offsetX,H.offsetY,r,i)},U=async()=>{let e=await V(O);return e?(_e(L,e),ge(),!0):!1},W={x:0,y:0,w:w?.w??0,h:w?.h??0},ve=()=>{if(!A)return;let t=e.el.getBoundingClientRect(),n=A.el.getBoundingClientRect();W={...W,x:n.left-t.left-S,y:n.top-t.top-S}};ve();let ye=async(e,t)=>{if(!A)return U();let n=e?await V(O):null;if(e&&!n)return!1;let r=t?await V(A.context):null;if(t&&!r)return!1;n&&_e(A.ctx,n);let i=H.scale*y,a=Math.round(H.offsetX+W.x*i),o=Math.round(H.offsetY+W.y*i),s=Math.round(W.w*i),c=Math.round(W.h*i);return n?L.drawImage(A.canvas,0,0):L.drawImage(A.canvas,a,o,s,c,a,o,s,c),r&&L.drawImage(r,a,o,s,c),ge(),!0},G=0,K=null,q=()=>K===null?G:performance.now()-K,J=!0,Y=0,be=e.cues??[],xe=async e=>{let t=!1;for(;Y<be.length&&be[Y].atMs<=e;)await be[Y].apply(),Y++,t=!0;return t},Se=async t=>{let r=te(e.el),i=-1,a=-1,o=-1,s=!1,c=!1;try{for(let u=0;J&&t.accepting()&&!N;u++){let d=u/n;if(d>=l)break;let f=d*1e3;if(e.gate&&await e.gate(),!J)break;let p=await xe(f);p&&ve(),(p||P.changes()+P.layerChanges()!==i)&&(r.refresh(f),i=P.changes()+P.layerChanges()),r.seek(f);let ee=P.changes(),m=P.layerChanges(),h=ee!==a,te=m!==o,g=r.activeOutside(A?.el??null),_=A?r.activeInside(A.el):!1,v=P.hasLiveMedia(),y=u===0||h||g||s||v,b=!!A&&(y||te||_||c);if(s=g,c=_,y||b){await t.end(d);let e=A?await ye(y,b):await U();if(!J||!t.accepting()||N)break;e&&(a=ee,o=m),t.begin(d)}G=Math.min((u+1)/n,l)*1e3,!z&&d>1.2&&j>2&&M===0&&B(),await new Promise(e=>setTimeout(e,0))}}finally{r.release()}},Ce=async t=>{let r=performance.now();K=r;let i=!0;for(;J&&t.accepting()&&!N;){let a=performance.now();if(e.gate&&await e.gate(),!J)break;if(await xe(performance.now()-r),i||!P.still()){if(await t.end((performance.now()-r)/1e3),await U(),!J||!t.accepting()||N)break;t.begin(i?0:(performance.now()-r)/1e3),i=!1}let o=performance.now()-r;if(G=o,o>=c)break;!z&&o>1200&&j>2&&M===0&&B();let s=performance.now()-a;await new Promise(e=>setTimeout(e,Math.max(0,1e3/n-s)))}},we=e=>_&&!e.realtime?Se(e):Ce(e);if(h&&m){let t=await ne(m.StreamTarget,h.container),i=t?null:new m.BufferTarget,a=new m.Output({format:h.container===`mp4`?new m.Mp4OutputFormat:new m.WebMOutputFormat,target:t?.target??i}),o=new m.CanvasSource(I,{codec:h.video,bitrate:r});a.addVideoTrack(o);let s=null;if(e.audioBuffer){let t=new m.AudioBufferSource({codec:h.audio,bitrate:192e3});a.addAudioTrack(t);let n=e.audioBuffer;s=async()=>{try{await t.add(n),t.close()}catch{}}}await a.start(),s?.();let c=p(o,{fps:n,capS:l}),u=we(c);u.catch(()=>{});let d=()=>{J=!1,F(),I.width=I.height=0,R.width=R.height=0,A&&(A.canvas.width=A.canvas.height=0)};return{done:()=>u,async stop(){if(J=!1,N||j===0)throw a.cancel?.(),t?.discard(),d(),N??Error(`rasterizer-failed`);await c.end(q()/1e3);let n=await me();c.finish(),await a.finalize();let r=t?await t.finish():null;return d(),{blob:r?.blob??new Blob([i?.buffer??new ArrayBuffer(0)],{type:h.mimeType}),type:h.mimeType,poster:n,hasAudio:!!e.audioBuffer,durationMs:Math.round(q()),dispose:r?.dispose}},cancel(){J=!1,a.cancel?.(),t?.discard(),d()}}}let Te=I.captureStream(n),Ee=new MediaStream(Te.getVideoTracks()),De=e.audioBuffer?i(e.audioBuffer):null,Oe=De?.stream.getAudioTracks()[0]??null;Oe&&Ee.addTrack(Oe);let ke=f();if(!ke)throw F(),I.width=I.height=0,R.width=R.height=0,Error(`open-codec-unavailable`);let X=new MediaRecorder(Ee,{mimeType:ke,videoBitsPerSecond:r}),Z=await re();X.ondataavailable=e=>Z.write(e.data);let Ae=new Promise(e=>{X.addEventListener(`stop`,()=>e(),{once:!0})}),Q=()=>{try{X.state!==`inactive`&&X.stop()}catch{}};X.start(1e3),De?.start();let je=we(ee()).finally(()=>{(N||G>=c)&&Q()});je.catch(()=>{});let $=()=>{J=!1,F();for(let e of Ee.getTracks())e.stop();De?.stop(),I.width=I.height=0,R.width=R.height=0,A&&(A.canvas.width=A.canvas.height=0)};return{done:()=>je,async stop(){if(J=!1,N||j===0)throw Q(),Z.discard(),$(),N??Error(`rasterizer-failed`);let e=await me();Q(),await Ae;try{let t=await Z.finish(),n=Math.round(q());return $(),{blob:t.blob,type:ke,poster:e,hasAudio:!!Oe,durationMs:n,dispose:t.dispose}}catch(e){throw await Z.discard(),$(),e}},cancel(){J=!1,Q(),Z.discard(),$()}}}export{f as a,k as i,O as n,s as o,D as r,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,M as t,p as n,y as r}from"./store-D16dGt7I.js";import{n as i}from"./ledger-DHS2di3l.js";import{i as a}from"./format-BkvssSOr.js";import{n as o}from"./useDashboardLoop-
|
|
1
|
+
import{I as e,M as t,p as n,y as r}from"./store-D16dGt7I.js";import{n as i}from"./ledger-DHS2di3l.js";import{i as a}from"./format-BkvssSOr.js";import{n as o}from"./useDashboardLoop-CA3LNVME.js";var s=`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.`;function c(e,t=!1){return e===`no-model`?t?`Saved, but nothing can be checked until a model is connected — connect one in Live and this starts filling in.`:`Connect a model with an API key first — a tile only joins the board once a real search has confirmed it returns real data.`:t?`Saved, but no live source could confirm it yet — nothing is shown until real data lands. It keeps trying; you can also reword what to track.`:`Couldn't confirm this with a live source, so it wasn't added — a tile only joins the board once a real search returns real data. Try again in a moment, or reword what to track.`}var l=e=>`${e.conversationId}@${e.at}`;function u(e){return{metrics:new Set(e.metrics.map(e=>e.id)),widgets:new Set(e.widgets.map(e=>e.id)),tripwires:new Set(e.tripwires.map(e=>e.id)),sources:new Set(e.sources.map(l))}}function d(e,r){let i=n(e);i&&t(e,{metrics:i.metrics.filter(e=>r.metrics.has(e.id)),widgets:i.widgets.filter(e=>r.widgets.has(e.id)),tripwires:i.tripwires.filter(e=>r.tripwires.has(e.id)),sources:i.sources.filter(e=>r.sources.has(l(e)))})}var f=1500,p=45e3,m=2,h=1e4,g=e=>new Promise(t=>setTimeout(t,e));function _(e,t){return!(n(e)?.metrics??[]).filter(e=>!(t?.metrics.has(e.id)??!1)).some(e=>e.query.trim()!==``&&!e.blankKey&&e.lastValue==null)}var v={unverified:`no live source could confirm it returns real data`,"no-model":`no model was connected to check it with`,failed:`the model could not be reached to check it`};function y(t,n,a,o,s=Date.now()){let c=e(o);n===null?c&&r(t,c,s):d(t,n);let l=v[o];return i({kind:`alert`,text:n===null?`“${a}” is waiting on its first check — ${l}.`:`The addition to “${a}” was rolled back — ${l}.`,dashboardIds:[t],searches:0}),o}async function b(e,t){let r=n(e);if(!r)return`failed`;if(!a(r))return`confirmed`;let i=r.title,s=Date.now(),c=async()=>{let t=await o(e);for(let r=0;t===`busy`&&r<p;r+=f){if(await g(f),(n(e)?.lastRefreshedAt??0)>=s)return`landed`;t=await o(e)}return t},l=await c();for(let e=0;e<m&&l===`failed`;e++)await g(h),l=await c();return(l===`done`||l===`landed`)&&_(e,t)?`confirmed`:l===`landed`?y(e,t,i,`unverified`):y(e,t,i,l===`no-model`||l===`failed`?l:`unverified`)}export{b as i,u as n,c as r,s as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{a as t,i as n}from"./spokenText-Dy-GZvZV.js";import{O as r,k as i}from"./kokoro-
|
|
1
|
+
import{t as e}from"./react-BZJXY1be.js";import{a as t,i as n}from"./spokenText-Dy-GZvZV.js";import{O as r,k as i}from"./kokoro-DogSQaQB.js";import{n as a,t as o}from"./contentVault-XKWjF2FB.js";import{J as s,j as c}from"./store-D16dGt7I.js";import{n as l,s as u}from"./ledger-DHS2di3l.js";import{a as d,i as f}from"./format-BkvssSOr.js";var p=14,m=2,h=12096e5,g={"15min":()=>`hourly`,hourly:e=>e===0?`daily`:`6h`};function _(e){switch(e){case`15min`:return`every 15 min`;case`hourly`:return`hourly`;case`6h`:return`every 6 hours`;case`daily`:return`daily`;case`manual`:return`manual`}}function v(e,t,n){if(!f(e))return null;let r=g[e.cadence.data];if(!r||t<p||n>m)return null;let i=r(n),a=s[e.cadence.data],o=s[i];if(!Number.isFinite(a)||!Number.isFinite(o)||o<=a)return null;let c=Math.round(t*(1-a/o)*(30/7));return c<=0?null:{dashboardId:e.id,to:i,savesPerMonth:c,checks7d:t,opens7d:n}}function y(e,t,n){let r=n-h;return e.some(e=>e.kind===`savings`&&e.at>=r&&e.suggestion?.dashboardId===t)}function b(e,t,n,r,i,a=3){let o=[];for(let s of e){if(o.length>=a)break;if(y(t,s.id,i))continue;let e=v(s,n(s.id),r(s.id));e&&o.push(e)}return o}function x(e,t){let n=t.opens7d===1?`1 time`:`${t.opens7d} times`;return`You check ${e.title} ${_(e.cadence.data)} but only opened it ${n} this week. Dropping to ${_(t.to)} would save about ${t.savesPerMonth} searches a month.`}function S(e){return{action:`set-cadence`,dashboardId:e.dashboardId,to:e.to,savesPerMonth:e.savesPerMonth,state:`open`}}function C(e,t){let n=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.dashboardId);t&&l({kind:`savings`,text:x(t,e),dashboardIds:[e.dashboardId],searches:0,suggestion:S(e)})}}function ee(e,t,n,r=Date.now()){c(t,{data:n},r),u(e,`applied`),l({kind:`savings`,text:`Applied — cadence dropped to ${_(n)}.`,dashboardIds:[t],searches:0})}function w(e){u(e,`dismissed`)}var T=`mavea-dash-optimizer-date`;function E(e){return new Date(e).toISOString().slice(0,10)}function D(e){try{return typeof localStorage>`u`?!1:localStorage.getItem(T)===E(e)}catch{return!1}}function O(e){try{typeof localStorage<`u`&&localStorage.setItem(T,E(e))}catch{}}function k(e,t,n,r,i=Date.now()){D(i)||(O(i),C(e,b(e,t,n,r,i)))}var A=e(),j=`mavea-dash-briefing-v1`,M=j,N=`mavea-dash-briefing-date`;function P(e){return new Date(e).toISOString().slice(0,10)}function F(e){return!!e&&typeof e==`object`}function I(e){return!F(e)||typeof e.dashboardId!=`string`||!e.dashboardId||typeof e.label!=`string`||typeof e.value!=`string`?null:{dashboardId:e.dashboardId,label:e.label,value:e.value}}function L(e){if(!F(e)||typeof e.date!=`string`||typeof e.text!=`string`||!e.text)return null;let t=typeof e.at==`number`&&Number.isFinite(e.at)?e.at:0,n=Array.isArray(e.chips)?e.chips.map(I).filter(e=>e!==null):[];return{date:e.date,at:t,text:e.text,...typeof e.spoken==`string`&&e.spoken?{spoken:e.spoken}:{},chips:n}}var R;async function z(e){try{if(typeof localStorage>`u`)return;localStorage.setItem(j,await a(e))}catch{}}function te(){try{if(typeof localStorage>`u`)return null;let e=localStorage.getItem(j);if(!e)return null;let t=L(JSON.parse(e));return t&&z(t),t}catch{return null}}async function B(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(j);if(!e)return;try{JSON.parse(e);return}catch{}let t=L(await o(e));R=t,typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(M,{detail:t}))}catch{}}B();function V(){return R??=te(),R}function H(e){R=e,z(e);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(M,{detail:e}))}catch{}}function U(e){return window.addEventListener(M,e),()=>window.removeEventListener(M,e)}function W(){return(0,A.useSyncExternalStore)(U,V,G)}function G(){return null}function K(){try{return typeof localStorage>`u`?null:localStorage.getItem(N)}catch{return null}}function q(e){try{typeof localStorage<`u`&&localStorage.setItem(N,e)}catch{}}function J(e){return K()!==P(e)}function Y(e){q(P(e))}function X(e,t){let n=[];for(let r of e){if(t.has(r.id))continue;let e=d(r);!e||e.value===`—`||n.push(`- ${r.title}: ${e.label} is ${e.value}`)}return n.join(`
|
|
2
2
|
`)}function Z(e){let t=[];for(let n of e){let e=d(n);!e||e.value===`—`||t.push({dashboardId:n.id,label:e.label,value:e.value})}return t}function Q(e,r,i){let a=n(e),o=t(e),s={date:P(i),at:i,text:a,...o&&o!==a?{spoken:o}:{},chips:Z(r)};return H(s),Y(i),s}function ne(e,t){i(r(t||e),`mavea`)}var $=`mavea-dashboard-tripwire-toast`;function re(e){try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent($,{detail:e}))}catch{}}function ie(e){let t=t=>e(t.detail);return window.addEventListener($,t),()=>window.removeEventListener($,t)}export{Q as a,ee as c,X as i,w as l,ie as n,ne as o,J as r,W as s,re as t,k as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as e}from"./index-
|
|
1
|
+
import{f as e}from"./index-yJfYsjAB.js";import{s as t}from"./spokenText-Dy-GZvZV.js";import{n}from"./number-zqlPMliA.js";import{d as r,h as i,v as a,y as o}from"./attachments-BW-vki-E.js";import{t as s}from"./providers-CPhoN8j0.js";import{r as c}from"./speed-BOytg6bC.js";import{i as l,n as u,r as d,t as f}from"./cache-7UEbF3S6.js";import{a as p,d as m,i as h,l as g,o as _,r as v,u as y}from"./validate-MQG0EcTD.js";import{a as ee,c as b,i as x,l as te,n as ne,o as re,r as ie,s as S}from"./officeDoc-GU6Cssjf.js";import{n as ae,r as oe,t as C}from"./csv-DAqzYXUs.js";import"./search-ZN7v_P5B.js";var w=null,T=!1,E=!1,D=0,se=3e5,O;function k(){clearTimeout(O),O=setTimeout(()=>{A.size?k():M()},se)}function ce(){if(typeof navigator<`u`){let e=navigator;if(e.connection?.saveData||typeof e.deviceMemory==`number`&&e.deviceMemory>0&&e.deviceMemory<=4)return!0}return typeof document<`u`&&e()===`lite`}var A=new Map;function j(){if(!(w||E)&&!ce()){if(typeof Worker>`u`){E=!0;return}try{w=new Worker(new URL(`/assets/worker-D7eK-Ya8.js`,``+import.meta.url),{type:`module`}),w.onmessage=e=>{let t=e.data;if(t.type===`ready`)T=!0,k();else if(t.type===`error`)E=!0,M();else if(t.type===`result`){let e=A.get(t.id);A.delete(t.id),e?.kind===`fit`&&e.resolve(t.fits)}else if(t.type===`embedded`){let e=A.get(t.id);A.delete(t.id),e?.kind===`embed`&&e.resolve(t.vec.length?t.vec:null)}},w.onerror=()=>{E=!0,M()},w.postMessage({type:`init`,base:fe,modelId:de})}catch{E=!0}}}function M(){clearTimeout(O),O=void 0;for(let e of A.values())e.resolve(null);A.clear();try{w?.terminate()}catch{}w=null,T=!1}function le(e,t=80){if(j(),!T||!w)return Promise.resolve(null);let n=++D;return new Promise(r=>{let i=setTimeout(()=>{A.delete(n),r(null)},t);A.set(n,{kind:`fit`,resolve:e=>{clearTimeout(i),r(e?new Map(e):null)}}),w.postMessage({type:`fit`,id:n,query:e}),k()})}function ue(e,t=80){if(j(),!T||!w)return Promise.resolve(null);let n=++D;return new Promise(r=>{let i=setTimeout(()=>{A.delete(n),r(null)},t);A.set(n,{kind:`embed`,resolve:e=>{clearTimeout(i),r(e)}}),w.postMessage({type:`embed`,id:n,text:e}),k()})}var de=`minishlab/potion-base-8M`,fe=`/semantic/`,pe=/\b(poems?|haikus?|limericks?|sonnets?|ballads?|rhymes?|riddles?|puns?|jokes?|knock[- ]?knock|tongue[- ]?twisters?|lullab(?:y|ies)|raps?)\b/i,me=/\b(write|compose|make(?:\s+me|\s+up)?|tell(?:\s+me)?\s+(?:a|an)|sing|invent|create|generate|come up with)\b[^.?!]{0,40}\b(story|stories|song|lyrics?|tale|fable|fiction|script|screenplay|verse|jingle)\b/i;function he(e){let t=e.toLowerCase();return pe.test(t)||me.test(t)}var N=e=>!he(e),P=`HARD HONESTY RULES:
|
|
2
2
|
- A node "value", a series point, or an edge "weight" (a 0..1 share of the outcome it explains) may ONLY be given when you can quote it VERBATIM from SOURCES — put that exact sentence in "quote" and set "tier":"T2" (or "T1" if it came from the user's own attached data). The weights of the edges INTO the outcome should sum to ≤ 1.
|
|
3
3
|
- If a cause, link, or figure comes from general knowledge with NO source sentence, set "tier":"T0" and OMIT value/weight/series/quote. Never invent a number, a percentage, or a citation.
|
|
4
4
|
- If SOURCES carries no quotable sentence, this world is an ILLUSTRATIVE explanation from general knowledge. Say so with "provenance":{"illustrative":true}, and give a node a "value"/"unit" or a "series" ONLY where the figure is genuinely well known — textbook, round, the kind a specialist would recognise — and mark those "tier":"T3" with NO "quote". Never a citation, never a made-up precision, and never a "weight": how much of an outcome one link explains is a measurement, and there is nothing here to measure it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./walkSync-
|
|
1
|
+
import{l as e}from"./walkSync-BfK0U5vB.js";var t=1700;function n(e){let t=e.props;if(!t||typeof t!=`object`)return``;let n=t;for(let e of[`title`,`eyebrow`,`headline`,`head`,`label`,`name`,`query`]){let t=n[e];if(typeof t==`string`&&t.trim())return t.trim()}return``}function r(e,t){let r=new Set(e.map(e=>e.id).filter(e=>!!e));if(t&&t.length){let e=new Set,n=[];for(let i of t)if(!(!i||!r.has(i.spot)||e.has(i.spot))&&(e.add(i.spot),n.push({spot:i.spot,say:i.say}),n.length>=r.size))break;if(n.length)return n}return e.filter(e=>!!e.id).map(e=>({spot:e.id,say:n(e)}))}function i(n,i={}){let a=r(n,i.tour);if(!a.length)return[];let o=i.startId?Math.max(0,a.findIndex(e=>e.spot===i.startId)):0,s=a.slice(o),c=i.maxStops?s.slice(0,Math.max(1,i.maxStops)):s,l=i.dwellMs??t,u=c.map((t,n)=>{let r=n===0?i.opener??t.say??``:t.say??``,a={spot:t.spot,pstate:`showing`,gaze:`right`};return r&&(a.caption=r),{set:a,ms:e(r,l)}});return u.push({set:{spot:null,pstate:`idle`,status:null}}),u}function a(e){return e.hasModelTour?!0:e.blockCount>=5||e.mode!==`replace`||e.teach}export{a as n,i as t};
|