@mavea/mavea 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/.vite/manifest.json +298 -298
- package/dist/assets/{AnnotationLayer-qV6CIUZv.js → AnnotationLayer-8JABh1Dm.js} +0 -0
- package/dist/assets/{AppCommandPalette-BHaYBZ5e.js → AppCommandPalette-CgDUWU08.js} +1 -1
- package/dist/assets/{CheckLogRail-DkHIHL0E.js → CheckLogRail-DO7sbZwC.js} +1 -1
- package/dist/assets/{ConversationVideoStudio-C1sd4k53.js → ConversationVideoStudio-tpqQQnOs.js} +1 -1
- package/dist/assets/{CourseLessonReader-YCcNKEW7.js → CourseLessonReader-PFJn-4tj.js} +2 -2
- package/dist/assets/{CoursesApp-Dz6xjf4V.js → CoursesApp-5pnHYJR8.js} +1 -1
- package/dist/assets/{DashPresent-5SRScC2i.js → DashPresent-B6MP1i_4.js} +1 -1
- package/dist/assets/{DashboardDetail-DOfm8UCQ.js → DashboardDetail-DYFghZ4p.js} +1 -1
- package/dist/assets/{DashboardLoopGate-Cf0y_HQ7.js → DashboardLoopGate-C0blM1w9.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-C9R-z9-o.js +1 -0
- package/dist/assets/{DashboardsApp-_gbfdbX6.js → DashboardsApp-Dh_jh1dF.js} +2 -2
- package/dist/assets/{DeepZoomApp-BOLEl-kQ.js → DeepZoomApp-UEPtylG7.js} +1 -1
- package/dist/assets/{DelegatePanel-CHEB-OZl.js → DelegatePanel-DKWsRY9I.js} +1 -1
- package/dist/assets/{DemoGallery-DBqnu8TR.js → DemoGallery-CkuqAXje.js} +1 -1
- package/dist/assets/{DropSelect-DjbdVfIR.js → DropSelect-QcBm3N4D.js} +1 -1
- package/dist/assets/{ExportModal-CLobMv1F.js → ExportModal-Ya0VBbxa.js} +1 -1
- package/dist/assets/{ExtractionPreview-QZ2VHmsb.js → ExtractionPreview-BFrmqKDo.js} +1 -1
- package/dist/assets/{FeatureUseNotice-Dc8joBGM.js → FeatureUseNotice-Dc3GNBvy.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-DnWuBjYI.js → FlagshipCommandPalette-B1yHwI6V.js} +1 -1
- package/dist/assets/{FlagshipShowcase-3qQDOK6g.js → FlagshipShowcase-BHAlRDAE.js} +1 -1
- package/dist/assets/{FlashcardsApp-BQGM-Tr1.js → FlashcardsApp-DteNeHpz.js} +1 -1
- package/dist/assets/{GalleryApp-BWQ-J450.js → GalleryApp-DziLKFJZ.js} +1 -1
- package/dist/assets/{HonestByDesign-57LDf-gm.js → HonestByDesign-DZltb3Ss.js} +1 -1
- package/dist/assets/{HowItWorks-DMfPX3GK.js → HowItWorks-D-hgfN6a.js} +1 -1
- package/dist/assets/{LegalApp-CcO5Qq6R.js → LegalApp-ChzcKiY0.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-Be_fQbZ_.js → LegalMarkdownDocument-j6UHhPnp.js} +1 -1
- package/dist/assets/{LegalPageShell-B-HY1WG7.js → LegalPageShell-Wcsviye1.js} +1 -1
- package/dist/assets/{LibraryOverlay-BilW6q_z.js → LibraryOverlay-YHBrdVKo.js} +1 -1
- package/dist/assets/{LiveApp-DH3OxJFV.js → LiveApp-D6vkyhZb.js} +3 -3
- package/dist/assets/{LiveSettings-CuVMy7rZ.js → LiveSettings-C9cKOrSb.js} +1 -1
- package/dist/assets/{PinToDashboard-Cz5UJCmq.js → PinToDashboard-BCiWaSg8.js} +1 -1
- package/dist/assets/{PlanReview-CmUxzNqL.js → PlanReview-BIERfK1t.js} +1 -1
- package/dist/assets/{PresentationDeck-B_EI33Pp.js → PresentationDeck-BW_7qecK.js} +1 -1
- package/dist/assets/{PrismApp-DtLsPiQF.js → PrismApp-BY71jJvW.js} +2 -2
- package/dist/assets/{PrismBriefingPlayer-DzdtnFj4.js → PrismBriefingPlayer-DLAPs6eZ.js} +2 -2
- package/dist/assets/{PrismOverlay-D1cDZamt.js → PrismOverlay-DJDGPGxo.js} +3 -3
- package/dist/assets/{PrismWorkbench-BEIp4MiL.js → PrismWorkbench-DHLvpguj.js} +1 -1
- package/dist/assets/{PrivacyApp-B4DT2RUz.js → PrivacyApp-uMjq2z14.js} +1 -1
- package/dist/assets/{ReplayCard-Dx46HCBT.js → ReplayCard-F7U3LYAg.js} +2 -2
- package/dist/assets/{ReplayOverlay-CnJAxf0u.js → ReplayOverlay-BTldvkU7.js} +1 -1
- package/dist/assets/{RippleApp-D5j2VCt2.js → RippleApp-DZw8op-E.js} +2 -2
- package/dist/assets/{RippleOverlay-zcXAHPuJ.js → RippleOverlay-D7ItTvS-.js} +2 -2
- package/dist/assets/{SeeDontRead-Dqfzha0V.js → SeeDontRead-DmmtWAzn.js} +1 -1
- package/dist/assets/{ShareModal-DWxlrJSz.js → ShareModal-9jSn52Mw.js} +2 -2
- package/dist/assets/{ShipCourse-BavQppkt.js → ShipCourse-Up9gRR07.js} +1 -1
- package/dist/assets/{SignatureLoop-L8W2h62w.js → SignatureLoop-Cq790dMw.js} +1 -1
- package/dist/assets/{SynthesisApp-C2O6pFeM.js → SynthesisApp-4ZPLZgmJ.js} +2 -2
- package/dist/assets/{SynthesisOverlay-DLvwiSMv.js → SynthesisOverlay-iesJ0hEt.js} +1 -1
- package/dist/assets/{TermsApp-CxY1yorm.js → TermsApp-DL2hFKsv.js} +1 -1
- package/dist/assets/{TopicCanvas-LMI0zC7R.js → TopicCanvas-DozfZFto.js} +2 -2
- package/dist/assets/{TourPrism-CI-iJZil.js → TourPrism-kInUOv-M.js} +1 -1
- package/dist/assets/{TrackerTile-oz6IoG8m.js → TrackerTile-BryDo0sm.js} +2 -2
- package/dist/assets/{TwoSurfaces-Rnf-_WgY.js → TwoSurfaces-Cmj95ofx.js} +1 -1
- package/dist/assets/{WorldOverlay-BaQNNClA.js → WorldOverlay-yhxq328s.js} +1 -1
- package/dist/assets/{WowFeatures-C4efSbNV.js → WowFeatures-DDICbxl_.js} +1 -1
- package/dist/assets/{ZoomDeck-CBrr0yfy.js → ZoomDeck-CKOjYS9z.js} +1 -1
- package/dist/assets/canvas-vqIFVmtP.js +1 -0
- package/dist/assets/{capture-D8uPIcfj.js → capture-9OrAc1p2.js} +1 -1
- package/dist/assets/{confirmAdd-DzMO9jKV.js → confirmAdd-DkmbWaSk.js} +1 -1
- package/dist/assets/{dashboardEvents-DKl5rrTD.js → dashboardEvents-D-XVj666.js} +1 -1
- package/dist/assets/{generateBeats-DZHkvFvh.js → generateBeats-DtptFLlG.js} +1 -1
- package/dist/assets/{index-DmKgC_TJ.css → index-DrzNHwlO.css} +1 -1
- package/dist/assets/{index-Dk0QapqQ.js → index-zIa6h_8b.js} +3 -3
- package/dist/assets/{kokoro-P_fkcX-A.js → kokoro-B3oG_8sd.js} +1 -1
- package/dist/assets/{loader-DKJEcbPm.js → loader-DCA6Njbf.js} +2 -2
- package/dist/assets/{notes-B0-EE0FK.js → notes-B6eX5XWk.js} +1 -1
- package/dist/assets/{perfProbe-B9zJpjo9.js → perfProbe-CE7hsUEo.js} +1 -1
- package/dist/assets/{pin-CZAIlpXt.js → pin-BZuh1acO.js} +1 -1
- package/dist/assets/{portal-Dogggsub.js → portal-k_BMgWND.js} +1 -1
- package/dist/assets/{prewarm-B4ELBOxf.js → prewarm-uKxmzjjd.js} +1 -1
- package/dist/assets/{quietHours-CeBje_uU.js → quietHours-DI1ayIIq.js} +1 -1
- package/dist/assets/{registry-GeAC3ZD7.js → registry-1wlTAh5b.js} +1 -1
- package/dist/assets/{registry-CqhpLHM7.js → registry-B2QzCuWH.js} +1 -1
- package/dist/assets/{registry-CD1s3eQ-.js → registry-DtV2UjBx.js} +1 -1
- package/dist/assets/{registry-6MOD-I7p.js → registry-Dwbh-GWu.js} +1 -1
- package/dist/assets/{relate-BYdM5eiV.js → relate-UW-sUlJH.js} +1 -1
- package/dist/assets/{replay-TYXO0Brm.js → replay-B5TkHPri.js} +1 -1
- package/dist/assets/{useDashboardLoop-DDqCFJKY.js → useDashboardLoop-BoVNM-pT.js} +1 -1
- package/dist/assets/{useStudy-GwNcQWtv.js → useStudy-5CsF_L-s.js} +1 -1
- package/dist/assets/{walkSync-CPsd-xu7.js → walkSync-CT8kmbzY.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/DashboardLoopRuntime-CnN5VayH.js +0 -1
- package/dist/assets/canvas-Bsx3eSaS.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lens-ChFJD9il.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{a,i as o,s}from"./spokenText-C88IQJ0M.js";import{i as c,n as l,t as u}from"./loader-DKJEcbPm.js";import{t as d}from"./useFocusTrap-DBtkeyRy.js";import{r as f,t as p}from"./useSpatialCanvas-CfmZOXXP.js";import{i as m}from"./format-q0LwBjID.js";import{a as h,i as g,n as _,r as v}from"./scale-Bcgfo6Hp.js";import{t as y}from"./spreadLabels-CQ8hufvK.js";import{a as b,i as x,n as S,t as C}from"./display-CAb_PiGv.js";import{t as w}from"./types-C42I77wh.js";import{r as T,t as E}from"./sourceHost-BV3t2XDb.js";import{r as D}from"./stepDriver-DwjFet6U.js";import{c as O,l as k,o as A,u as j}from"./walkSync-CPsd-xu7.js";import{n as M}from"./emphasize-BqCIst-B.js";import{c as N,s as P,t as F}from"./validate-sGUCmPAs.js";import{n as I,s as L}from"./receipts-D7zveV-I.js";import{n as R,r as z}from"./value-Dx7DZob4.js";import{t as B}from"./types-DuEbJpIA.js";import{n as V,t as H}from"./engine-BiM6INsW.js";var U=e(),W=t(),G=n();function ee(e){return e.kind}var K=.33,te=.1,q=.005;function ne(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<=q)return`would barely change`;let a=r>0?`rise`:`fall`;return i>=K?`would ${a} meaningfully`:i>=te?`would ${a} somewhat`:`would ${a} slightly`}var re=.6;function ie(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>=re?`much ${r}`:n>=K?r:`slightly ${r}`}function ae(e){let t=[];for(let n of e?.points??[]){let e=P(n.t);e===null||!Number.isFinite(n.value)||t.push({t:e,v:n.value})}return t.sort((e,t)=>e.t-t.t)}function oe(e,t){let n=e.date?P(e.date.t):null;if(n!==null){let t=e.date?.until?P(e.date.until):null;return t!==null&&t>n?{start:n,end:t}:{start:n}}if(t.length===0)return null;let r=t[0].t,i=t[t.length-1].t;return i>r?{start:r,end:i}:{start:r}}function se(e){return e.filter(e=>e.from!==e.to)}function ce(e){return se(e).map((e,t)=>({id:e.id??`${e.from}->${e.to}#${t}`,from:e.from,to:e.to,sign:e.sign,...e.relation===void 0?{}:{kind:e.relation},...typeof e.weight==`number`?{weight:e.weight}:{},...e.provisional?{provisional:!0}:{}}))}function le(e){let t=[],n=(e,r,i=0)=>{if(i>1)return;let a=ae(e.series),o=e.unit??e.series?.unit,s=oe(e,a);t.push({id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...o===void 0?{}:{unit:o},...a.length>0?{series:a}:{},...s?{date:s}:{},...s&&e.date&&w(e.date.tier??`T0`)?{dateGrounded:!0}:{},...e.domain===void 0?{}:{domain:e.domain},...r===void 0?{}:{parentId:r}});for(let t of e.children??[])n(t,e.id,i+1)};for(let t of e.nodes)n(t);return{nodes:t,edges:ce(e.edges),outcomeId:e.outcomeId}}var ue={w:1090,h:650},de=1.4,fe=86*de;160*de;var pe=116*de,me=9/(11*de),J=e=>String(Math.round(e*100)/100),he=e=>e&&/^[a-z-]{1,24}$/.test(e)?` morph-edge--rel-${e}`:``,ge=525949.2*60*1e3,Y=e=>1970+e/ge,_e=e=>(e-1970)*ge,ve=6e4,ye=60*ve,be={minute:ve,hour:ye,day:24*ye,month:ge/12},xe=[{grain:`minute`,n:1},{grain:`minute`,n:5},{grain:`minute`,n:10},{grain:`minute`,n:15},{grain:`minute`,n:30},{grain:`hour`,n:1},{grain:`hour`,n:2},{grain:`hour`,n:3},{grain:`hour`,n:6},{grain:`hour`,n:12},{grain:`day`,n:1},{grain:`day`,n:2},{grain:`day`,n:5},{grain:`day`,n:10},{grain:`month`,n:1},{grain:`month`,n:2},{grain:`month`,n:3},{grain:`month`,n:6}],X=3,Se=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ce=64;function we(e){let t=new Date(0);return t.setUTCFullYear(Math.floor(e/12),(e%12+12)%12,1),t.setUTCHours(0,0,0,0),t.getTime()}function Te(e,t,n){if(t.grain===`month`){let r=new Date(e),i=Math.floor((r.getUTCFullYear()*12+r.getUTCMonth())/t.n)*t.n,a=we(i);return n&&a<e?we(i+t.n):a}let r=be[t.grain]*t.n,i=Math.floor(e/r)*r;return n&&i<e?i+r:i}function Ee(e,t){let n=new Date(e);if(!Number.isFinite(n.getTime()))return String(Math.round(Y(e)));let r=`${Se[n.getUTCMonth()]} ${n.getUTCFullYear()}`;if(t===`month`)return r;let i=`${n.getUTCDate()} ${r}`;if(t===`day`||n.getUTCHours()===0&&n.getUTCMinutes()===0)return i;let a=e=>String(e).padStart(2,`0`);return`${a(n.getUTCHours())}:${a(n.getUTCMinutes())}`}function De(e,t){if(t.grain!==`month`)return e+be[t.grain]*t.n;let n=new Date(e);return we(n.getUTCFullYear()*12+n.getUTCMonth()+t.n)}function Oe(e,t,n){let r=Te(_e(e),n,!1),i=Te(_e(t),n,!0),a=[];for(let e=r;e<=i&&a.length<Ce;e=De(e,n))a.push({year:Y(e),text:Ee(e,n.grain)});return{domain:[Y(r),Y(i)],ticks:a}}function ke(e,t,n){let r=Math.max(1,Math.round(v(t-e,n))),i=Math.floor(e/r)*r,a=Math.ceil(t/r)*r,o=[];for(let e=i;e<=a&&o.length<Ce;e+=r)o.push({year:e,text:String(e)});return{domain:[i,a],ticks:o}}function Ae(e,t,n=6){let[r,i]=e<t?[e,t]:[e-.5,t+.5];if(i-r>=X)return ke(r,i,n);let a=(i-r)*ge/n,o=xe[xe.length-1],s=1/0;for(let e of xe){let t=Math.abs(Math.log(be[e.grain]*e.n/a));t<s&&(s=t,o=e)}return Oe(r,i,o)}var je=8,Z=12,Me=16,Ne=6,Pe=12+Math.ceil(15.525*de);function Q(e,t,n,r=ue){let i=new Map;if(e.length===0)return{positions:i,band:null,bbox:t};let a=pe+Me,o=44*de+Ne,s=Math.max(t.w,r.w),c=Math.max(1,Math.floor((s-24+Me)/a)),l=Math.min(e.length,c),u=Math.ceil(e.length/c),d=l*pe+(l-1)*Me,f={id:`shelf`,x:t.x,y:t.y+t.h+je,w:Math.max(t.w,d+24),h:Pe+Ne+u*o-Ne+Z,className:`morph-shelf`,label:n};return e.forEach((e,t)=>{i.set(e.id,{x:f.x+Z+t%c*a,y:f.y+Pe+Ne+Math.floor(t/c)*o,w:116,h:44,face:`entry`,shelved:!0})}),{positions:i,band:f,bbox:{x:t.x,y:t.y,w:Math.max(t.w,f.w),h:f.y+f.h-t.y}}}var Fe=440,Ie=2,Le=1.25,$=320;function Re(e){if(!(e===void 0||!Number.isFinite(e))){if(e<.995)return`weaker`;if(e>1.005)return`stronger`}}function ze(){let e=(0,W.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(`marker`,{id:`mv-arrow`,className:`mv-marker mv-marker-up`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0.5 1 L9.5 5 L0.5 9 Z`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(`marker`,{id:`mv-arrow-damp`,className:`mv-marker mv-marker-down`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:17,markerHeight:17,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M8 0.6 L8 9.4`})}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`marker`,{id:`mv-arrow-open`,className:`mv-marker mv-marker-open`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M1 1.4 L9 5 L1 8.6 Z`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`marker`,{id:`mv-arrow-ring`,className:`mv-marker mv-marker-ring`,viewBox:`0 0 10 10`,refX:`7.4`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`circle`,{cx:`5`,cy:`5`,r:`3`})}),e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`defs`,{children:[t,n,r,i,(0,G.jsx)(`marker`,{id:`mv-dot`,className:`mv-marker mv-marker-dot`,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:9,markerHeight:9,orient:`auto`,children:(0,G.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2.6`})})]}),e[4]=a):a=e[4],a}function Be(e,t){let n=(0,W.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,He);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=Ve;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,U.useEffect)(r,i)}function Ve(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 He(e){return typeof e.getTotalLength==`function`?e.getTotalLength():null}function Ue(e){let t=(0,W.c)(33),{chrome:n,bbox:r,exiting:i,onSettle:a}=e,o=(0,U.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(Ge),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,G.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,G.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,G.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,G.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,G.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,G.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":e.draw?``:void 0},e.id)}function Ge(e){return(0,G.jsx)(`rect`,{className:`mv-band ${e.className}`,x:e.x,y:e.y,width:e.w,height:e.h,rx:12},e.id)}function Ke(e){if(e instanceof Element)return e.closest(`.mv-node`)?.dataset.id}var qe=(0,U.memo)(function(e){let t=(0,W.c)(49),{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,U.useRef)(null);Be(m,i.edgePaths);let{bbox:h}=i,g;if(t[0]!==r||t[1]!==n){let e=new Map(n.map(Ye));g=new Map;for(let t of r){let n=e.get(t.from);n!==void 0&&Number.isFinite(n)&&g.set(t.id,n)}t[0]=r,t[1]=n,t[2]=g}else g=t[2];let _=g,v;t[3]!==a||t[4]!==o?(v=a&&(0,G.jsx)(Ue,{chrome:a.layout.chrome,bbox:a.layout.bbox,exiting:!0,onSettle:()=>o(a.token)},a.token),t[3]=a,t[4]=o,t[5]=v):v=t[5];let y;t[6]!==h||t[7]!==i.chrome||t[8]!==i.rep?(y=(0,G.jsx)(Ue,{chrome:i.chrome,bbox:h},i.rep),t[6]=h,t[7]=i.chrome,t[8]=i.rep,t[9]=y):y=t[9];let b=h.w,x=h.h,S=`${h.x} ${h.y} ${h.w} ${h.h}`,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,G.jsx)(ze,{}),t[10]=C):C=t[10];let w;if(t[11]!==_||t[12]!==i.edgePaths||t[13]!==p||t[14]!==d){let e;t[16]!==_||t[17]!==p||t[18]!==d?(e=e=>(0,G.jsxs)(`g`,{className:`mv-edge-g`,"data-lit":p===e.id?``:void 0,"data-shift":Re(_.get(e.id)),style:_.has(e.id)?{"--mv-shift":_.get(e.id)}:void 0,onClick:d?()=>d(e.id):void 0,children:[d&&(0,G.jsx)(`path`,{className:`mv-edge-hit`,d:e.d,fill:`none`}),(0,G.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[16]=_,t[17]=p,t[18]=d,t[19]=e):e=t[19],w=i.edgePaths.map(e),t[11]=_,t[12]=i.edgePaths,t[13]=p,t[14]=d,t[15]=w}else w=t[15];let T;t[20]!==h.h||t[21]!==h.w||t[22]!==S||t[23]!==w?(T=(0,G.jsxs)(`svg`,{ref:m,className:`mv-edges`,width:b,height:x,viewBox:S,"aria-hidden":`true`,children:[C,w]}),t[20]=h.h,t[21]=h.w,t[22]=S,t[23]=w,t[24]=T):T=t[24];let E;if(t[25]!==s||t[26]!==h.x||t[27]!==h.y||t[28]!==i.positions||t[29]!==c||t[30]!==n||t[31]!==u||t[32]!==l||t[33]!==f){let e;t[35]!==s||t[36]!==h.x||t[37]!==h.y||t[38]!==i.positions||t[39]!==c||t[40]!==u||t[41]!==l||t[42]!==f?(e=(e,t)=>{let n=i.positions.get(e.id);if(!n)return null;let r={"--nx":`${n.x+n.w/2-h.x}px`,"--ny":`${n.y+n.h/2-h.y}px`,"--mv-i":t,...e.shift===void 0?{}:{"--mv-shift":e.shift}},a=u!==void 0&&!n.folded,o=l?.(e,`entry`);return(0,G.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":Re(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?0:void 0,onClick:a?()=>s(e):void 0,onKeyDown:a?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),u?.(e))}:void 0,children:[(0,G.jsxs)(`div`,{className:`mv-face mv-face-card`,children:[(0,G.jsx)(`span`,{className:`mv-label`,children:e.label}),(0,G.jsxs)(`span`,{className:`mv-card-foot`,children:[e.domain!==void 0&&(0,G.jsx)(`span`,{className:`mv-domain`,title:e.domain,"aria-label":e.domain}),e.value!==void 0&&(0,G.jsxs)(`span`,{className:`mv-value`,children:[e.value.toLocaleString(),e.unit??``]}),l?.(e,`card`),e.tier!==void 0&&(0,G.jsx)(`span`,{className:`mv-tier`,children:e.tier})]})]}),(0,G.jsx)(`div`,{className:`mv-face mv-face-entry`,children:(0,G.jsxs)(`span`,{className:`mv-label`,children:[o,o?` `:null,e.label]})}),(0,G.jsx)(`div`,{className:`mv-face mv-face-mark`,children:l?.(e,`mark`)})]},e.id)},t[35]=s,t[36]=h.x,t[37]=h.y,t[38]=i.positions,t[39]=c,t[40]=u,t[41]=l,t[42]=f,t[43]=e):e=t[43],E=n.map(e),t[25]=s,t[26]=h.x,t[27]=h.y,t[28]=i.positions,t[29]=c,t[30]=n,t[31]=u,t[32]=l,t[33]=f,t[34]=E}else E=t[34];let D;return t[44]!==v||t[45]!==y||t[46]!==T||t[47]!==E?(D=(0,G.jsxs)(G.Fragment,{children:[v,y,T,E]}),t[44]=v,t[45]=y,t[46]=T,t[47]=E,t[48]=D):D=t[48],D});function Je({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,U.useState)(!1),y=(0,U.useRef)(new Map),b=(0,U.useRef)(0),x=(0,U.useRef)(!1),S=(0,U.useRef)(!1),C=(0,U.useRef)(!1),w=(0,U.useRef)({x:0,y:0}),T=(0,U.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,U.useRef)(T);E.current=T,(0,U.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,Ke(e.target)),clearTimeout(t),t=setTimeout(()=>{x.current=!1},$);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,U.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,U.useRef)({dx:0,dy:0}),A=(0,U.useRef)(0),j=(0,U.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,U.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,U.useEffect)(()=>()=>cancelAnimationFrame(A.current),[]);let N=(0,U.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>Le||i<1/Le)&&(b.current=r,E.current(i,t,n,Ke(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)>Ie&&!C.current&&(C.current=!0,e.currentTarget.setPointerCapture(e.pointerId)),w.current={x:e.clientX,y:e.clientY},M(n,r)},[M]),P=(0,U.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,U.useCallback)(e=>{C.current||r?.(e)},[r]),I=(0,U.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,G.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,G.jsx)(`div`,{className:`mv-world`,style:R,"data-morphing":f?``:void 0,onTransitionEnd:I,children:(0,G.jsx)(qe,{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 Ye(e){return[e.id,e.shift]}function Xe(e,t){return e===`in`?`zoom-camera`:t?`ascend`:`zoom-camera`}var Ze=880,Qe=340,$e=468,et=56,tt=26,nt=16,rt=7,it=30*de;function at(e){let t=(e.series??[]).filter(e=>Number.isFinite(e.t)&&Number.isFinite(e.v)).map(e=>({t:Y(e.t),v:e.v})).sort((e,t)=>e.t-t.t);return t.length>0?{node:e,points:t}:null}var ot=e=>at(e)!==null;function st(e,t){let n=e*Math.max(et,(t-1)*it+30)+(e-1)*tt,r=Math.min($e,Math.max(Qe,n)),i=Math.max(it,Math.min(tt,r/(4*e)));return{h:(r-(e-1)*i)/e,gap:i}}function ct(e,t,n){let[r,i]=e===t?_(e,t,n):[e,t],a=v(i-r,n),o=[Math.floor(r/a)*a,Math.ceil(i/a)*a];return{domain:o,ticks:h(o[0]-a*1e-9,o[1],a)}}function lt(e){let t=1/0,n=-1/0,r=new Map;for(let i of e){let e=new Map;for(let a of i.nodes){let i=at(a);if(!i)continue;let o=a.unit??``,s=r.get(o);s||r.set(o,s={lo:1/0,hi:-1/0,marks:0}),e.set(o,(e.get(o)??0)+1);for(let e of i.points)t=Math.min(t,e.t),n=Math.max(n,e.t),s.lo=Math.min(s.lo,e.v),s.hi=Math.max(s.hi,e.v)}for(let[t,n]of e){let e=r.get(t);e.marks=Math.max(e.marks,n)}}if(t===1/0)return null;let i=1;for(let e of r.values())i=Math.max(i,e.marks);let{h:a,gap:o}=st(r.size,i),s=Math.max(2,Math.min(5,Math.round(a/60))),c=[],l=new Map;for(let[e,t]of r){let{domain:n,ticks:r}=ct(t.lo,t.hi,s);l.set(e,c.length),c.push({unit:e,domain:n,ticks:r,top:c.length*(a+o),h:a})}let u=Ae(t,n);return{x:u.domain,xTicks:u.ticks,bands:c,bandOf:l,height:c.length*a+(c.length-1)*o}}function ut(e,t){let n=new Map,r=new Map;for(let t of e){let e=r.get(t.band);e?e.push(t):r.set(t.band,[t])}for(let[e,i]of r){let{top:r,bottom:a}=t(e);i.sort((e,t)=>e.x-t.x||e.y-t.y||e.id.localeCompare(t.id));let o=[],s=()=>{if(o.length!==0){for(let[e,t]of y(o,{gap:it,top:r,bottom:a}))n.set(e,t);o=[]}};for(let e of i)o.length>0&&e.x-o[o.length-1].x>=it&&s(),o.push(e);s()}return n}function dt(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=at(n);e&&t?r.push(e):i.push(n)}let a=new Map,o={bands:[],paths:[],labels:[]},s=1/0,c=-1/0,l=56;if(r.length>0&&t){let e=g(t.x,[56,56+Ze]),n=t.bands.map(e=>g(e.domain,[56+e.top+e.h,56+e.top])),i=e=>t.bandOf.get(e.unit??``)??0;t.bands.forEach((e,r)=>{let i=n[r];for(let t of e.ticks)o.paths.push({id:`grid:${r}:${t}`,d:`M ${J(56)} ${J(i(t))} L ${J(56+Ze)} ${J(i(t))}`,className:`morph-gridline`}),o.labels.push({id:`ytick:${r}:${t}`,x:46,y:i(t)+4,text:String(t),className:`morph-axis-label`,anchor:`end`}),s=Math.min(s,46-String(t).length*rt);t.bands.length>1&&o.labels.push({id:`unit:${r}`,x:56,y:56+e.top-11,text:e.unit===``?`no unit`:e.unit,className:`morph-axis-label`,anchor:`start`})}),t.xTicks.forEach((n,r)=>{let i=e(n.year);o.labels.push({id:`xtick:${r}`,x:i,y:56+t.height+22,text:n.text,className:`morph-axis-label`,anchor:`middle`});let a=n.text.length*rt/2;s=Math.min(s,i-a),c=Math.max(c,i+a)}),s=Math.min(s,56),c=Math.max(c,56+Ze),l=Math.max(l,56+t.height+28);let u=[...r].sort((e,t)=>e.node.id.localeCompare(t.node.id)),d=u.map(t=>{let r=i(t.node),a=t.points[t.points.length-1];return{id:t.node.id,band:r,x:e(a.t),y:n[r](a.v)}}),f=ut(d,e=>({top:56+t.bands[e].top,bottom:56+t.bands[e].top+t.bands[e].h})),p=new Map,m=new Map;for(let e of d){let t=m.get(e.band);t?t.push(e):m.set(e.band,[e])}t.bands.forEach((e,t)=>{let n=m.get(t);if(n===void 0||n.length===0)return;let r=y(n.map(e=>({id:e.id,y:f.get(e.id)??e.y})),{gap:nt,top:56+e.top+6,bottom:56+e.top+e.h-6});for(let[e,t]of r)p.set(e,t)}),u.forEach((t,r)=>{let{x:i,y:s}=d[r],l=n[d[r].band],u=t.points.map((t,n)=>`${n===0?`M`:`L`} ${J(e(t.t))} ${J(l(t.v))}`).join(` `),m=t.node.id;o.paths.push({id:`series:${m}`,d:u,className:`morph-series`,draw:!0});let h=f.get(t.node.id)??s;Math.abs(h-s)>.01&&o.paths.push({id:`leader:${t.node.id}`,d:`M ${J(i)} ${J(s)} L ${J(i)} ${J(h)}`,className:`morph-tick`}),a.set(m,{x:i-15,y:h-15,w:30,h:30,face:`mark`});let g=i+15+8;o.labels.push({id:`label:${t.node.id}`,x:g,y:(p.get(t.node.id)??h)+4,text:t.node.label,className:`morph-series-label`,anchor:`start`}),c=Math.max(c,g+t.node.label.length*rt)})}let u=Q(i,s===1/0?{x:0,y:0,w:112,h:112}:{x:s-56,y:0,w:c-s+112,h:l+56},`${i.length} with nothing measured over time — the chart cannot plot these`,n);u.band&&o.bands.push(u.band);for(let[e,t]of u.positions)a.set(e,t);return{positions:a,edgePaths:[],chrome:o,bbox:u.bbox}}var ft=(e,t)=>({rep:`chart`,...dt(e,lt([e]),t?.viewport??ue)}),pt=new WeakMap;function mt(e,t){let n=new Set;for(let r of e)r.from===r.to||!t(r)||(n.add(r.from),n.add(r.to));return n}function ht(e){let t=pt.get(e);if(t)return t;let n=mt(e.edges,e=>typeof e.weight==`number`);return pt.set(e,n),n}var gt=340,_t=4,vt=fe+30,yt=3;function bt(e,t){return e.parentId===void 0&&ht(t).has(e.id)}var xt=(e,t)=>{let n=t?.viewport??ue,r=e.nodes.filter(e=>e.parentId===void 0),i=r.filter(t=>bt(t,e)),a=r.filter(t=>!bt(t,e)),o=e.nodes.filter(e=>e.parentId!==void 0),s=new Map,c={bands:[],paths:[],labels:[]},l=[],u=new Set(i.map(e=>e.id)),d=e.edges.filter(e=>e.from!==e.to&&typeof e.weight==`number`&&u.has(e.from)&&u.has(e.to)),f=i.reduce((e,t)=>Math.min(e,t.depth??0),1/0),p=new Map;for(let e of d)p.set(e.from,(p.get(e.from)??0)+(e.weight??0));let m=i.reduce((e,t)=>Math.max(e,Number.isFinite(f)?(t.depth??0)-f:0),0),h=e=>{let t=Number.isFinite(f)?(e.depth??0)-f:0;return m<=0?0:m<_t?t:Math.round(t/m*3)},g=new Map;for(let e of i){let t=h(e),n=g.get(t);n?n.push(e):g.set(t,[e])}for(let e of g.values())e.sort((e,t)=>(p.get(t.id)??0)-(p.get(e.id)??0)||e.id.localeCompare(t.id));let _=Math.max(1,...[...g.values()].map(e=>e.length));for(let[e,t]of g){let n=(_-t.length)*vt/2;t.forEach((t,r)=>{s.set(t.id,{x:56+e*gt,y:56+n+r*vt,w:200,h:64,face:`card`})})}for(let e of d){let t=s.get(e.from),n=s.get(e.to),r=t.x+t.w,i=t.y+t.h/2,a=n.x,o=n.y+n.h/2,c=(r+a)/2,u=Math.min(1,Math.max(0,e.weight??0));l.push({id:e.id,d:`M ${J(r)} ${J(i)} C ${J(c)} ${J(i)} ${J(c)} ${J(o)} ${J(a)} ${J(o)}`,className:`morph-edge morph-ribbon`+he(e.kind),width:yt+u*23})}for(let e of o){let t=(e.parentId===void 0?void 0:s.get(e.parentId))??{x:56,y:56};s.set(e.id,{x:t.x,y:t.y,w:200,h:64,face:`card`,folded:!0})}let v=Q(a,{x:0,y:0,w:112+(Math.max(1,...[...g.keys()].map(e=>e+1))-1)*gt+200,h:112+_*vt},`${a.length} with no measured share — the ribbons cannot size these`,n);for(let[e,t]of v.positions)s.set(e,t);return v.band&&c.bands.push(v.band),{rep:`flow`,positions:s,edgePaths:l,chrome:c,bbox:v.bbox}},St=200;function Ct(e,t=24){let n=e.length;if(n<2)return;let r=0;for(let t of e)r=Math.max(r,t.w,t.h);r=Math.max(r+t,1);let i=Array(n),a=new Map;for(let o=0;o<St;o++){a.clear();let o=[],s=[],c=[];for(let t=0;t<n;t++){let n=e[t],l=Math.floor((n.x+n.w/2)/r),u=Math.floor((n.y+n.h/2)/r),d=a.get(l);d===void 0&&(d=new Map,a.set(l,d));let f=d.get(u);f===void 0&&(f=c.length,d.set(u,f),o.push(l),s.push(u),c.push([])),c[f].push(t),i[t]=f}let l=c.map((e,t)=>{let n=[];for(let e=-1;e<=1;e++){let r=a.get(o[t]+e);if(r!==void 0)for(let e=-1;e<=1;e++){let i=r.get(s[t]+e);if(i!==void 0)for(let e of c[i])n.push(e)}}return n.sort((e,t)=>e-t)}),u=Array(c.length).fill(0),d=!1;for(let r=0;r<n;r++){let n=i[r],a=l[n],o=u[n];for(;o<a.length&&a[o]<=r;)o++;u[n]=o;let s=e[r];for(;o<a.length;o++){let n=a[o],i=e[n],c=i.x+i.w/2-(s.x+s.w/2),l=i.y+i.h/2-(s.y+s.h/2);c===0&&l===0&&(c=r-n,l=n-r);let u=(s.w+i.w)/2+t-Math.abs(c),f=(s.h+i.h)/2+t-Math.abs(l);if(!(u<=0||f<=0)){if(d=!0,u<=f){let e=u/2*(c<0?-1:1);s.x-=e,i.x+=e}else{let e=f/2*(l<0?-1:1);s.y-=e,i.y+=e}}}}if(!d)break}}var wt=300,Tt=fe+4,Et=4,Dt=fe+Et,Ot=wt-200,kt=200+Et,At=96,jt=30,Mt=20,Nt=18,Pt=15,Ft=2.5,It=1/1.4,Lt=1.7,Rt=2.6,zt={rows:1,reach:0};function Bt(e,t){let n=e.map(e=>t(e.id).rows).sort((e,t)=>t-e),r=e.map(e=>t(e.id).reach).sort((e,t)=>t-e),i=[0],a=0;for(let e of n)i.push(a+=e);return{size:e.length,rows:a,tallest:i,reaches:r}}function Vt(e,t){let n=[],r=[],i=[],a=[];for(let o of e){let e=Math.max(1,Math.min(o.size,Math.ceil(o.rows/t))),s=Math.ceil(o.size/e),c=Math.ceil(o.size/s);i.push(n.length),a.push(s);for(let e=0;e<c;e++)n.push(o.tallest[Math.min(s,o.size-e*s)]),r.push(200+(o.reaches[e]??0))}return{rows:n,widths:r,start:i,per:a}}function Ht(e,t){let n=[],r=[],i=[];for(let a=0;a<e.rows.length;a++){let o=Math.floor(a/t),s=a%t===0?0:n[a-1]+e.widths[a-1]+Ot;n.push(s),r[o]=Math.max(r[o]??1,e.rows[a]),i[o]=Math.max(i[o]??0,s+e.widths[a])}return{columnX:n,bandRows:r,bandW:i}}var Ut=12;function Wt(e,t){let n=n=>{let r=(t.h-(n-1)*At-112)/n,i=Math.max(2,Math.floor((r-64)/Tt)+1),a=Vt(e,i),o=Math.max(1,Math.ceil(a.rows.length/n)),{bandRows:s,bandW:c}=Ht(a,o),l=200;for(let e of c)l=Math.max(l,e);let u=(n-1)*At;for(let e=0;e<n;e++)u+=((s[e]??1)-1)*Tt+64;return{bands:n,rowCap:i,perBand:o,fit:Math.min(t.w/(l+112),t.h/(u+112)),aspect:l/u}},r=n(1);if(e.length<2||r.fit>=It)return r;let i=r;for(let e=2;e<=Ut;e++){let t=n(e);if(t.fit>=It&&t.aspect<=Ft)return t;if(t.fit>i.fit&&(i=t),t.perBand===1)break}return i}function Gt(e,t,n){let r=Wt(t,n),i=Vt(t,r.rowCap),{columnX:a,bandRows:o}=Ht(i,r.perBand),s=new Map,c=new Map;e.forEach((e,t)=>{s.set(e,i.start[t]),c.set(e,i.per[t])});let l=o.length>0?o:[1],u=[],d=[],f=[],p=0;for(let e of l){let t=(e-1)*Tt+64;u.push(p+t/2),d.push(t),p+=t,f.push(p+At/2),p+=At}return{perBand:r.perBand,columnRows:i.rows,columnX:a,startOf:s,splitOf:c,centreY:u,height:d,gutterY:f}}function Kt(e,t){let n=new Map,r=new Set;for(let t of e)typeof t.depth==`number`&&Number.isFinite(t.depth)?(n.set(t.id,t.depth),r.add(t.id)):n.set(t.id,0);let i=t.edges.filter(e=>e.from!==e.to&&n.has(e.from)&&n.has(e.to)),a=new Map,o=new Map(e.map(e=>[e.id,0]));for(let e of i){let t=a.get(e.from);t===void 0?a.set(e.from,[e.to]):t.push(e.to),o.set(e.to,o.get(e.to)+1)}let s=(e,t)=>r.has(e)?t:t+1,c=e.filter(e=>o.get(e.id)===0).map(e=>e.id),l=new Set;for(let e=0;e<c.length;e++){let t=c[e];l.add(t);let r=n.get(t);for(let e of a.get(t)??[]){let t=s(e,r);t>n.get(e)&&n.set(e,t);let i=o.get(e)-1;o.set(e,i),i===0&&c.push(e)}}if(l.size<e.length){let t=i.filter(e=>!l.has(e.to));for(let r=e.length;r>0;r--){let e=!1;for(let r of t){let t=s(r.to,n.get(r.from));t>n.get(r.to)&&(n.set(r.to,t),e=!0)}if(!e)break}}let u=t.outcomeId;if(u!==void 0&&n.has(u)&&!r.has(u)&&(a.get(u)?.length??0)===0){let e=-1/0;for(let t of n.values())t>e&&(e=t);n.set(u,e)}return n}function qt(e,t){let n=new Map(e.map(e=>[e.id,0])),r=new Map(e.map(e=>[e.id,0])),i=new Map,a=0;for(let o of e)for(let e of t.get(o.id)??[]){if(e===o.id||!n.has(e))continue;let t=i.get(e);t===void 0?i.set(e,[o.id]):t.push(o.id),r.set(o.id,r.get(o.id)+1),a++}if(a===0)return n;let o=e.filter(e=>r.get(e.id)===0).map(e=>e.id);for(let e=0;e<o.length;e++){let t=o[e],a=n.get(t);for(let e of i.get(t)??[]){a+1>n.get(e)&&n.set(e,a+1);let t=r.get(e)-1;r.set(e,t),t===0&&o.push(e)}}return n}function Jt(e,t){let n=new Map,r=new Set,i=[],a=new Set;for(let o of e){if(n.has(o.id))continue;i.length=0,a.clear();let e=o,s=0,c=!1;for(;;){let o=e.parentId===void 0?void 0:t.get(e.parentId);if(o===void 0){n.set(e.id,null);break}if(i.push(e),a.add(e.id),n.has(o.id)){c=r.has(o.id),s=n.get(o.id)??0;break}if(a.has(o.id)){c=!0;break}e=o}if(c)for(let e of i)n.set(e.id,null),r.add(e.id);else for(let e=i.length-1;e>=0;e--)n.set(i[e].id,++s)}return n}function Yt(e,t){let n=new Map(e.nodes.map(e=>[e.id,e])),r=Jt(e.nodes,n),i=e.nodes.filter(e=>r.get(e.id)===null),a=e.nodes.filter(e=>r.get(e.id)!==null).sort((e,t)=>r.get(e.id)-r.get(t.id)||e.id.localeCompare(t.id)),o=t?.expandedIds,s=t?.previous,c=new Map,l=Kt(i,e),u=new Set(i.map(e=>e.id)),d=new Set;for(let e of a){let t=e.parentId;o?.has(t)===!0&&(u.has(t)||d.has(t))&&d.add(e.id)}let f=new Map,p=e=>f.get(e)??zt;for(let e=a.length-1;e>=0;e--){let t=a[e];if(!d.has(t.id))continue;let n=p(t.id),r=f.get(t.parentId);f.set(t.parentId,{rows:(r?.rows??0)+n.rows,reach:Math.max(r?.reach??0,kt+n.reach)})}let m=new Map,h=new Map;for(let e of a){let t=h.get(e.parentId)??0;m.set(e.id,t),h.set(e.parentId,t+p(e.id).rows)}let g=new Map;for(let t of e.edges)!u.has(t.from)||!u.has(t.to)||(g.has(t.to)||g.set(t.to,[]),g.get(t.to).push(t.from));let _=new Map;for(let e of i){let t=l.get(e.id),n=_.get(t);n===void 0?_.set(t,[e]):n.push(e)}let v=[..._.keys()].sort((e,t)=>e-t),y=t?.viewport??ue,b=Gt(v,v.map(e=>Bt(_.get(e),p)),y),x=new Map;for(let e of v){let t=_.get(e),n=qt(t,g),r=t.map((e,t)=>{let r=(g.get(e.id)??[]).map(e=>c.get(e)?.y).filter(e=>e!==void 0);return{n:e,bary:r.length?r.reduce((e,t)=>e+t,0)/r.length:s?.get(e.id)?.y??t*Tt,rank:n.get(e.id)}});r.sort((e,t)=>e.rank-t.rank||e.bary-t.bary||e.n.id.localeCompare(t.n.id));let i=b.startOf.get(e),a=b.splitOf.get(e),o=[],l=[];r.forEach((e,t)=>{let n=Math.floor(t/a);o.push(l[n]??0),l[n]=(l[n]??0)+p(e.n.id).rows}),r.forEach((e,t)=>{let n=Math.floor(t/a),r=i+n,s=Math.floor(r/b.perBand),u=p(e.n.id).rows;x.set(e.n.id,s),c.set(e.n.id,{x:b.columnX[r],y:b.centreY[s]+(o[t]+(u-1)/2-(l[n]-1)/2)*Tt})})}for(let e of a){let t=e.parentId,n=c.get(t);if(x.set(e.id,x.get(t)??0),d.has(e.id)){let r=p(e.id).rows,i=h.get(t);c.set(e.id,{x:n.x+kt,y:n.y+(m.get(e.id)+(r-1)/2-(i-1)/2)*Dt})}else c.set(e.id,{x:n.x,y:n.y})}if(d.size>0){let e=[...i,...a.filter(e=>d.has(e.id))],t=e.map(e=>{let t=c.get(e.id);return{x:t.x-100,y:t.y-fe/2,w:200,h:fe}});Ct(t,Et),e.forEach((e,n)=>{c.set(e.id,{x:t[n].x+100,y:t[n].y+fe/2})});for(let e of a){if(d.has(e.id))continue;let t=c.get(e.parentId);c.set(e.id,{x:t.x,y:t.y})}}let S=1/0,C=1/0,w=-1/0,T=-1/0;for(let e of c.values())S=Math.min(S,e.x-100),C=Math.min(C,e.y-32),w=Math.max(w,e.x+100),T=Math.max(T,e.y+32);let E=c.size===0,D=E?0:56-S,O=E?0:56-C,k=new Map;for(let t of e.nodes){let e=c.get(t.id);k.set(t.id,{x:e.x+D-100,y:e.y+O-32,w:200,h:64,face:`card`,...r.get(t.id)!==null&&!d.has(t.id)?{folded:!0}:{}})}let A=e=>u.has(e)||d.has(e),j=E?56:w+D,M=e.edges.filter(e=>A(e.from)&&A(e.to)).map(e=>{let t=k.get(e.from),n=k.get(e.to),r=x.get(e.from)??0,i=x.get(e.to)??0,a=r===i?-1:Math.max(r,i)-1;return{e,from:t,to:n,gutter:a,vertical:a<0&&n.x<=t.x&&Math.abs(n.y-t.y)>1}}),N=new Map,P=new Map,F=new Map,I=(e,t)=>void e.set(t,(e.get(t)??0)+1);for(let e of M)e.gutter>=0&&I(N,e.gutter),!e.vertical&&(I(P,e.e.to),I(F,e.e.from));let L=new Map,R=new Map,z=new Map,B=(e,t,n)=>e.y+e.h/2+(n-(t-1)/2)*Math.min(Pt,e.h/(t+1)),V=[];for(let{e,from:t,to:n,gutter:r,vertical:i}of M){let a;if(i){let e=t.x+t.w/2,r=n.x+n.w/2,i=n.y>t.y,o=i?t.y+t.h:t.y,s=i?n.y:n.y+n.h,c=(o+s)/2;a=`M ${J(e)} ${J(o)} C ${J(e)} ${J(c)} ${J(r)} ${J(c)} ${J(r)} ${J(s)}`}else{let i=z.get(e.from)??0,o=R.get(e.to)??0;z.set(e.from,i+1),R.set(e.to,o+1);let s=t.x+t.w,c=B(t,F.get(e.from),i),l=n.x,u=B(n,P.get(e.to),o);if(r<0){let e=(s+l)/2;a=`M ${J(s)} ${J(c)} C ${J(e)} ${J(c)} ${J(e)} ${J(u)} ${J(l)} ${J(u)}`}else{let e=N.get(r),t=L.get(r)??0;L.set(r,t+1);let n=Math.min(Nt,(At-32)/Math.max(1,e)),i=b.gutterY[r]+O+(t-(e-1)/2)*n,o=j+jt,d=Math.min(l,56)-jt,f=(o+d)/2;a=`M ${J(s)} ${J(c)} C ${J(o)} ${J(c)} ${J(o)} ${J(i)} ${J(f)} ${J(i)} C ${J(d)} ${J(i)} ${J(d)} ${J(u)} ${J(l)} ${J(u)}`}}V.push({id:e.id,d:a,className:`morph-edge`+he(e.kind)+(e.sign===-1?` morph-edge--damp`:``)+(e.provisional?` morph-edge--provisional`:``)+(r<0?``:` morph-edge--wrap`),...typeof e.weight==`number`&&Number.isFinite(e.weight)?{width:Lt+Math.min(1,Math.max(0,e.weight))*Rt}:{}})}let H=E?{x:0,y:0,w:112,h:112}:{x:0,y:0,w:w-S+112,h:T-C+112};return{positions:k,edgePaths:V,chrome:{bands:E||b.centreY.length<2?[]:b.centreY.map((e,t)=>{let n=Math.max(H.y,e-b.height[t]/2+O-Mt),r=Math.min(H.y+H.h,e+b.height[t]/2+O+Mt);return{id:`reading-band:${t}`,x:56-Mt,y:n,w:j-56+40,h:Math.max(0,r-n),className:`morph-reading-band`}}),paths:[],labels:[]},bbox:H}}var Xt=(e,t)=>({rep:`graph`,...Yt(e,t)}),Zt=920,Qt=16,$t=44+Qt,en=12,tn=8,nn=12;function rn(e){if(!e.date||!Number.isFinite(e.date.start))return null;let t=Y(e.date.start),n=e.date.end;return{node:e,startYear:t,...n!==void 0&&Number.isFinite(n)&&n>e.date.start?{endYear:Y(n)}:{}}}var an=e=>rn(e)!==null;function on(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r.nodes){let r=rn(e);r&&(t=Math.min(t,r.startYear),n=Math.max(n,r.endYear??r.startYear))}return t===1/0?null:Ae(t,n,6)}function sn(e){let t=1;for(;t<e;)t*=2;let n=Array(t*2).fill(1/0),r=0;return(e,i)=>{let a=1;if(n[1]<=i)for(;a<t;)a=n[a*2]<=i?a*2:a*2+1;else a=t+r++;let o=a-t;for(n[a]=e;a>1;)a>>=1,n[a]=Math.min(n[a*2],n[a*2+1]);return o}}function cn(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=rn(n);e&&t?r.push(e):i.push(n)}r.sort((e,t)=>e.startYear-t.startYear||e.node.id.localeCompare(t.node.id));let a=new Map,o={bands:[],paths:[],labels:[]},s=[],c=1/0,l=-1/0,u=56;if(r.length>0&&t){let n=g(t.domain,[56,56+Zt]),i=sn(r.length);for(let e of r){let t=n(e.startYear),r=e.endYear===void 0?t:n(e.endYear),s=e.endYear===void 0?t-80:t,d=Math.min(s,t)-32,f=Math.max(s+160,r)+32,p=56+i(f+nn,d)*$t;a.set(e.node.id,{x:s,y:p,w:160,h:44,face:`entry`}),e.endYear!==void 0&&o.bands.push({id:`period:${e.node.id}`,x:t,y:p-6,w:Math.max(r-t,2),h:56,className:`morph-period`}),c=Math.min(c,d),l=Math.max(l,f),u=Math.max(u,p+44)}let d=u+Qt+en;o.paths.push({id:`axis`,d:`M ${J(56)} ${J(d)} L ${J(56+Zt)} ${J(d)}`,className:`morph-axis`}),t.ticks.forEach((e,t)=>{let r=n(e.year);o.paths.push({id:`tick:${t}`,d:`M ${J(r)} ${J(d)} L ${J(r)} ${J(d+tn)}`,className:`morph-tick`}),o.labels.push({id:`tick-label:${t}`,x:r,y:d+tn+16,text:e.text,className:`morph-axis-label`,anchor:`middle`}),c=Math.min(c,r-e.text.length*3.5),l=Math.max(l,r+e.text.length*3.5)}),c=Math.min(c,56),l=Math.max(l,56+Zt),u=d+tn+20;let f=new Set(r.map(e=>e.node.id));for(let t of e.edges){if(t.from===t.to||!f.has(t.from)||!f.has(t.to))continue;let e=a.get(t.from),n=a.get(t.to),r=e.x+e.w/2,i=n.x+n.w/2,o=e.y,c=n.y,l=Math.min(72,Math.max(20,Math.abs(i-r)*.2));s.push({id:t.id,d:`M ${J(r)} ${J(o)} C ${J(r)} ${J(o-l)} ${J(i)} ${J(c-l)} ${J(i)} ${J(c)}`,className:`morph-edge morph-edge--faint`+he(t.kind)})}}let d=Q(i,c===1/0?{x:0,y:0,w:112,h:112}:{x:c-56,y:0,w:l-c+112,h:u+56},`${i.length} with no date — the timeline cannot place these`,n);d.band&&o.bands.push(d.band);for(let[e,t]of d.positions)a.set(e,t);return{positions:a,edgePaths:s,chrome:o,bbox:d.bbox}}var ln=(e,t)=>({rep:`timeline`,...cn(e,on([e]),t?.viewport??ue)}),un={min:me,max:2.2},dn=56,fn=1300,pn=1300,mn=.7,hn=120,gn=120,_n=[`graph`,`flow`,`timeline`,`chart`],vn={graph:Xt,timeline:ln,chart:ft,flow:xt},yn={graph:`What caused what`,timeline:`The same causes, in time`,chart:`How much each one moved`,flow:`How much each one contributed`},bn={graph:()=>!0,timeline:an,chart:ot,flow:bt},xn=2,Sn=1/3;function Cn(e,t){let n=t.nodes.filter(e=>e.parentId===void 0);if(n.length===0)return!1;let r=n.filter(n=>bn[e](n,t)).length;return r>=Math.min(xn,n.length)&&r/n.length>=Sn}var wn=e=>({x:0,y:0,w:e.w,h:e.h}),Tn=(e,t,n)=>[t-e.x,n-e.y];function En(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]=Tn(e.bbox,i-hn,a-hn);return{x:c,y:l,w:o-i+240,h:s-a+240}}function Dn(e){let{world:t,onAscend:n,driverId:r,insetBottom:i}=e,[a,o]=(0,U.useState)(e.initialRep??`graph`),[s,c]=(0,U.useState)(()=>new Set),[l,u]=(0,U.useState)(null),d=p({clamp:un,margin:dn,...i===void 0?{}:{insetBottom:i}}),m=(0,U.useRef)(void 0),{viewport:h}=d,g=(0,U.useMemo)(()=>h?{w:Math.max(1,h.w-112),h:Math.max(1,h.h-112)}:void 0,[h]),_=(0,U.useMemo)(()=>vn[a](t,{expandedIds:s,previous:m.current,...g?{viewport:g}:{}}),[a,t,s,g]);(0,U.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,U.useRef)(a);v.current=a;let y=(0,U.useRef)(_);y.current=_;let b=(0,U.useRef)(d.camera);b.current=d.camera;let x=(0,U.useRef)(s);x.current=s;let S=(0,U.useRef)(n);S.current=n;let[C,w]=(0,U.useState)(null),{endFlight:T}=d,E=(0,U.useCallback)(()=>{w({layout:y.current,rep:v.current,expandedIds:x.current}),T()},[T]),O=(0,U.useRef)(0),k=(0,U.useRef)(void 0);(0,U.useEffect)(()=>()=>clearTimeout(k.current),[]);let A=(0,U.useCallback)(e=>{if(e===v.current)return;let t=++O.current;u({layout:y.current,token:t}),clearTimeout(k.current),k.current=setTimeout(()=>{t===O.current&&u(null)},fn),v.current=e,o(e)},[]),j=(0,U.useCallback)(e=>{e===O.current&&(clearTimeout(k.current),u(null))},[]),M=(0,U.useRef)(null),N=(0,U.useCallback)(e=>{let t=new Set(x.current);t.delete(e)||(t.add(e),M.current=e),c(t)},[]),P=(0,U.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}=d;(0,U.useEffect)(()=>{let e=M.current;if(M.current=null,e!==null){let t=En(_,e,P);if(t){F(t);return}}F(wn(_.bbox))},[_,P,F,I,L]);let R=(0,U.useMemo)(()=>new Map(t.nodes.map(e=>[e.id,e.parentId])),[t]),z=(0,U.useMemo)(()=>{let e=new Set;for(let t of R.values())t!==void 0&&e.add(t);return e},[R]),B=(0,U.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]),{zoomAtClient:V}=d,H=(0,U.useCallback)((e,t,n,r)=>{if(e>=1)return r!==void 0&&z.has(r)&&!x.current.has(r)?(N(r),`expand`):(V(e,t,n),`zoom`);let i=L.current?.getBoundingClientRect();if(Xe(`out`,!!i&&(i.width>0||i.height>0)&&f(b.current,wn(y.current.bbox),{w:i.width,h:i.height},dn,un))===`zoom-camera`)return V(e,t,n),`zoom`;let a=[...x.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 S.current?.(),`ascend`},[z,N,V,L,B]),W=(0,U.useCallback)(e=>{let t=y.current,n=e===null?void 0:t.positions.get(e);if(!n||n.folded){F(wn(t.bbox));return}let[r,i]=Tn(t.bbox,n.x-gn,n.y-gn);F({x:r,y:i,w:n.w+240,h:n.h+240})},[F]);(0,U.useEffect)(()=>{if(r!==void 0)return D(r,{count:_n.length,setIndex:e=>A(_n[Math.min(_n.length-1,Math.max(0,Math.trunc(e)))]),spokenFor:()=>void 0,captionFor:e=>{let t=_n[e];return t?yn[t]:void 0}})},[r,A]);let G=C?.layout!==_||d.flying;return(0,U.useEffect)(()=>{if(!G)return;let e=setTimeout(E,pn);return()=>clearTimeout(e)},[G,_,E]),{rep:a,setRep:A,layout:_,exiting:l,settleExit:j,expandedIds:s,toggleExpand:N,cam:d,morphing:G,settle:E,lod:d.camera.scale>=mn?`near`:`far`,pinch:H,focusNode:W}}function On({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,G.jsxs)(`label`,{className:`viz-ctl`,style:{"--ctl-c":s,"--ctl-pct":l+`%`},children:[(0,G.jsx)(`span`,{className:`viz-ctl-label`,children:e}),(0,G.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,G.jsx)(`span`,{className:`viz-ctl-val tab-num`,children:o?o(i):i.toLocaleString()})]})}var kn=`No cause is established yet, so there is nothing to push on.`;function An(e){let t=(0,W.c)(17),{levers:n,onSet:r,onReset:i}=e,a;t[0]===n?a=t[1]:(a=n.every(Mn),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.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,G.jsxs)(`div`,{className:`tr-levers-head`,children:[s,(0,G.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,G.jsx)(`p`,{className:`tr-levers-empty`,children:kn}),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,G.jsx)(On,{label:e.label,min:0,max:100,value:e.pct,onChange:t=>r(e.id,t),format:jn},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,G.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 jn(e){return`${e}%`}function Mn(e){return e.pct===100}var Nn=(0,U.memo)(An),Pn=(0,U.createContext)(null);function Fn(){return(0,U.useContext)(Pn)}function In(e){let t=(0,W.c)(19),{id:n,className:r}=e,i=Fn(),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,G.jsx)(`span`,{className:`${d} tr-num-qual`,"data-status":`structure`,children:e.resolution.raw});break bb0}a=`button`,o=d,s=ee(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=x(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,G.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,G.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 Ln=8,Rn=6;function zn(e,t,n){return Math.max(Ln,Math.min(e,n-t-Ln))}function Bn(e,t,n){if(!(e.width>0||e.height>0||e.left>0||e.top>0))return{left:zn((n.w-t.w)/2,t.w,n.w),top:zn((n.h-t.h)/2,t.h,n.h)};let r=e.bottom+Rn,i=e.top-Rn-t.h,a=r+t.h+Ln>n.h&&i>=Ln;return{left:zn(e.left,t.w,n.w),top:zn(a?i:r,t.h,n.h)}}var Vn=320,Hn=340,Un=8;function Wn(e){let t=(0,W.c)(64),{registry:n,valueId:r,anchorRect:i,trail:a,hinted:o,onMarkHinted:s,onDrill:c,onBack:l,onNavigate:u,onDismiss:f}=e,p=(0,U.useRef)(null),m;t[0]===f?m=t[1]:(m={onEscape:f},t[0]=f,t[1]=m),d(p,m);let[h]=(0,U.useState)(!o),g,_;t[2]===s?(g=t[3],_=t[4]):(g=()=>s(),_=[s],t[2]=s,t[3]=g,t[4]=_),(0,U.useEffect)(g,_);let v=(0,U.useRef)(!0),y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{v.current||p.current?.focus({preventScroll:!0}),v.current=!1},t[5]=y):y=t[5];let w;t[6]===r?w=t[7]:(w=[r],t[6]=r,t[7]=w),(0,U.useEffect)(y,w);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,U.useEffect)(D,O);let k=n.values,A,j,M,N,P,F,I,L,R,z,B,V,H,K;if(t[11]!==i||t[12]!==l||t[13]!==c||t[14]!==u||t[15]!==n.usedIn||t[16]!==n.values||t[17]!==a||t[18]!==r){V=Symbol.for(`react.early_return_sentinel`);bb0:{if(K=k.get(r),!K){V=null;break bb0}let e=ee(K),o=K.scope,s=n.usedIn.get(r)??[],d=K.kind===`grounded`?K.resolution.receipt:null,f=K.kind===`grounded`&&K.resolution.tier===`T1`,m=d?.url?T(d.url):null,h=d?d.host??(d.url?E(d.url):null):null,g=K.kind===`calculated`?K.calc.inputs:[],_=g.slice(0,Un),v=g.length-_.length,y;t[33]!==n.values||t[34]!==a?(y=a.length>0?n.values.get(a[a.length-1]):void 0,t[33]=n.values,t[34]=a,t[35]=y):y=t[35];let w=y,D;t[36]===i?D=t[37]:(D=Bn(i,{w:Vn,h:Hn},{w:window.innerWidth,h:window.innerHeight}),t[36]=i,t[37]=D);let{left:O,top:U}=D;H=p,A=`tr-card`,j=`dialog`,M=`false`,N=`Where ${K.label} came from`,P=-1,t[38]!==O||t[39]!==U?(F={left:O,top:U,width:Vn,maxHeight:Hn},t[38]=O,t[39]=U,t[40]=F):F=t[40];let W;t[41]!==l||t[42]!==w?(W=w&&(0,G.jsxs)(`button`,{type:`button`,className:`tr-back`,onClick:l,"aria-label":`Back to ${w.label}`,children:[`‹ back`,(0,G.jsxs)(`span`,{className:`tr-back-to`,children:[` to `,w.label]})]}),t[41]=l,t[42]=w,t[43]=W):W=t[43],I=(0,G.jsxs)(`header`,{className:`tr-head`,children:[W,(0,G.jsx)(`span`,{className:`tr-badge`,"data-status":e,children:C[e]}),(0,G.jsx)(`p`,{className:`tr-figure`,children:x(K)}),(0,G.jsx)(`p`,{className:`tr-label`,children:K.label})]}),L=d&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`SOURCE`}),d.quote&&(0,G.jsxs)(`blockquote`,{className:`tr-quote`,children:[`“`,d.quote,`”`]}),f?(0,G.jsx)(`p`,{className:`tr-host`,children:b(d)}):h&&(0,G.jsxs)(`p`,{className:`tr-host`,children:[m?(0,G.jsx)(`a`,{href:m,target:`_blank`,rel:`noreferrer noopener`,children:h}):h,d.date&&(0,G.jsxs)(`span`,{className:`tr-date`,children:[` · `,d.date]})]})]}),R=o&&(o.region||o.period||o.unit)&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`SCOPE`}),(0,G.jsx)(`p`,{className:`tr-chips`,children:[o.region,o.period,o.unit].filter(Kn).map(Gn)})]}),z=K.kind===`calculated`&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`CALCULATION`}),(0,G.jsx)(`p`,{className:`tr-formula`,children:S(K.calc.formula,e=>n.values.get(e)?.label)}),(0,G.jsx)(`ul`,{className:`tr-inputs`,children:_.map(e=>{let t=n.values.get(e);return(0,G.jsx)(`li`,{children:t?(0,G.jsxs)(`button`,{type:`button`,className:`tr-input`,onClick:()=>c(e),children:[(0,G.jsx)(`span`,{className:`tr-input-label`,children:t.label}),(0,G.jsx)(`span`,{className:`tr-input-val`,children:x(t)})]}):(0,G.jsx)(`span`,{className:`tr-input tr-input-missing`,children:e})},e)})}),v>0&&(0,G.jsxs)(`p`,{className:`tr-more`,children:[`…and `,v,` more`]}),K.calc.note&&(0,G.jsx)(`p`,{className:`tr-note`,children:K.calc.note})]}),B=s.length>0&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`USED IN`}),(0,G.jsx)(`ul`,{className:`tr-used`,children:s.map(e=>(0,G.jsx)(`li`,{children:u?(0,G.jsx)(`button`,{type:`button`,className:`tr-usedin`,onClick:()=>u(e),children:e.label}):(0,G.jsx)(`span`,{className:`tr-usedin tr-usedin-flat`,children:e.label})},`${e.surface}:${e.id}:${e.label}`))})]})}t[11]=i,t[12]=l,t[13]=c,t[14]=u,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]=K}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],K=t[32];if(V!==Symbol.for(`react.early_return_sentinel`))return V;let te;t[44]!==K.kind||t[45]!==K.resolution?(te=K.kind===`illustrative`&&(0,G.jsxs)(`p`,{className:`tr-caveat`,children:[`Illustrative — shows the shape, not a measured fact. `,K.resolution.illustrative]}),t[44]=K.kind,t[45]=K.resolution,t[46]=te):te=t[46];let q;t[47]===h?q=t[48]:(q=h&&(0,G.jsx)(`p`,{className:`tr-hint`,children:`Any figure like this one opens its own receipt.`}),t[47]=h,t[48]=q);let ne;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]!==te||t[61]!==q||t[62]!==H?(ne=(0,G.jsxs)(`div`,{ref:H,className:A,role:j,"aria-modal":M,"aria-label":N,tabIndex:P,style:F,children:[I,L,R,z,B,te,q]}),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]=te,t[61]=q,t[62]=H,t[63]=ne):ne=t[63],ne}function Gn(e){return(0,G.jsx)(`span`,{className:`tr-chip`,children:e},e)}function Kn(e){return!!e}function qn(e){let t=(0,W.c)(23),{registry:n,onNavigate:r,children:i,ref:a}=e,[o,s]=(0,U.useState)(null),[c,l]=(0,U.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,U.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,U.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(Jn)},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,G.jsx)(Wn,{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,G.jsxs)(Pn.Provider,{value:T,children:[i,E]}),t[19]=i,t[20]=E,t[21]=T,t[22]=D):D=t[22],D}function Jn(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 Yn=`Recomputed locally from the causes above — a model of what would happen, never an observation.`,Xn=`What was actually measured. This column never moves when a lever is pulled.`;function Zn(e,t){return(e>0?`+`:``)+m(e,t)}function Qn(e){return e!==null&&Number.isFinite(e)&&e>=0&&e<=1}function $n(e){return e.exactBase===null?`nothing measured stands behind this outcome`:`not every step is grounded, so the total stays unmeasured`}function er(e){let t=(0,W.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?m(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,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{className:`tr-chip tr-wi-chip`,title:Xn,children:`OBSERVED`}),t[4]=d):d=t[4];let f;t[5]!==n||t[6]!==c||t[7]!==o?(f=(0,G.jsxs)(`div`,{className:`tr-wi-col`,children:[d,c===null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}),(0,G.jsx)(`p`,{className:`tr-wi-note tr-wi-why`,children:o??$n(n)})]}):(0,G.jsx)(`p`,{className:`tr-wi-figure`,children:c})]}),t[5]=n,t[6]=c,t[7]=o,t[8]=f):f=t[8];let p;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?(p=a&&(0,G.jsxs)(`div`,{className:`tr-wi-col tr-wi-hypo`,"data-world":`hypothetical`,children:[(0,G.jsx)(`span`,{className:`tr-chip tr-wi-chip tr-wi-chip-hypo`,title:Yn,children:`HYPOTHETICAL (MODELED)`}),r.fullyGrounded&&l!==null&&r.exactDelta!==null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure`,children:m(l+r.exactDelta,i)}),(0,G.jsx)(`p`,{className:`tr-wi-delta`,children:Zn(r.exactDelta,i)}),Qn(r.explainedPct)&&(0,G.jsxs)(`p`,{className:`tr-wi-note`,children:[Math.round(r.explainedPct*100),`% explained`]})]}):r.relCur===null?(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-phrase`,children:ne(r.relBase??0,r.relCur)}),(0,G.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]=p):p=t[17];let h;return t[18]!==u||t[19]!==f||t[20]!==p?(h=(0,G.jsxs)(`div`,{className:`tr-wi`,"data-active":u,children:[f,p]}),t[18]=u,t[19]=f,t[20]=p,t[21]=h):h=t[21],h}var tr=(0,U.memo)(er);function nr(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 rr(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 ir(e){return{center:e.title,outcomeId:e.outcomeId,nodes:e.nodes.map(nr),edges:e.edges.map(rr),provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...e.provenance.notes?.length?{notes:e.provenance.notes}:{}}}}var ar=e=>`node:${e}`,or=(e,t)=>`node:${e}@${t}`;function sr(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=ar(e.id);l(R(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=or(e.id,t.t),a=R(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 se(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:ar(t),surface:`edge`,id:i,label:r})}}),{title:e.title,entities:r,relations:a,facts:i,trust:z(o,s),outcomeId:e.outcomeId,...n?{illustrative:n}:{}}}var cr=1100;function lr(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=O(t.say),o=n.speakLine?.(t.say)??null,s=o?await j(o):!1;if(n.isCancelled()){a(`cancelled`);return}n.apply(t,r),o&&s?await k(o,i,cr):await A(i)}a(n.isCancelled()?`cancelled`:`complete`)})()}function ur({beats:e,apply:t,speakLine:n}){let[r,i]=(0,U.useState)(-1),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(0),c=(0,U.useRef)(e);c.current=e;let l=(0,U.useRef)(t);l.current=t;let u=(0,U.useRef)(n);u.current=n;let d=(0,U.useCallback)(()=>{s.current+=1,o(!1)},[]),f=(0,U.useCallback)(e=>{let t=s.current+=1;o(!0),lr(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,U.useEffect)(()=>()=>void(s.current+=1),[]),(0,U.useEffect)(()=>{s.current+=1,o(!1),i(-1)},[e]);let p=(0,U.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,U.useCallback)(e=>{let t=c.current.length;t!==0&&f(Math.min(Math.max(e,0),t-1))},[f]),h=(0,U.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 dr(e){let t=(0,W.c)(28),{count:n,index:r,playing:i,caption:a,expanded:o,onToggle:s,onSeek:c}=e;if(n===0)return null;let l=Math.min(Math.max(r,-1),n-1),u=i?``:void 0,d=o?``:void 0,f=`${o?108:54}px`,p;t[0]===f?p=t[1]:(p={"--wo-transport-h":f},t[0]=f,t[1]=p);let m=p,h=i?`Pause the walkthrough`:`Walk me through it`,g=i?`❙❙`:`▶`,_;t[2]===g?_=t[3]:(_=(0,G.jsx)(`span`,{className:`wo-play-glyph`,"aria-hidden":`true`,children:g}),t[2]=g,t[3]=_);let v=i?`Pause`:`Walk me through it`,y;t[4]===v?y=t[5]:(y=(0,G.jsx)(`span`,{className:`wo-play-label`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==s||t[7]!==y||t[8]!==h||t[9]!==_?(b=(0,G.jsxs)(`button`,{type:`button`,className:`wo-play`,onClick:s,"aria-label":h,children:[_,y]}),t[6]=s,t[7]=y,t[8]=h,t[9]=_,t[10]=b):b=t[10];let x;t[11]!==l||t[12]!==n||t[13]!==o||t[14]!==c?(x=o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`wo-track`,role:`group`,"aria-label":`Walkthrough beats`,children:Array.from({length:n},(e,t)=>(0,G.jsx)(`button`,{type:`button`,className:`wo-tick`,"data-state":t<l?`past`:t===l?`now`:`ahead`,onClick:()=>c(t),"aria-label":`Beat ${t+1} of ${n}`,"aria-current":t===l?`step`:void 0},t))}),(0,G.jsxs)(`span`,{className:`wo-transport-count`,"aria-hidden":`true`,children:[l<0?n:l+1,`/`,n]})]}),t[11]=l,t[12]=n,t[13]=o,t[14]=c,t[15]=x):x=t[15];let S;t[16]!==b||t[17]!==x?(S=(0,G.jsxs)(`div`,{className:`wo-transport-row`,children:[b,x]}),t[16]=b,t[17]=x,t[18]=S):S=t[18];let C;t[19]!==a||t[20]!==o?(C=o&&(0,G.jsx)(`p`,{className:`wo-caption`,"aria-live":`polite`,children:a===null?``:M(a)}),t[19]=a,t[20]=o,t[21]=C):C=t[21];let w;return t[22]!==u||t[23]!==S||t[24]!==C||t[25]!==d||t[26]!==m?(w=(0,G.jsxs)(`div`,{className:`wo-transport`,"data-playing":u,"data-open":d,style:m,children:[S,C]}),t[22]=u,t[23]=S,t[24]=C,t[25]=d,t[26]=m,t[27]=w):w=t[27],w}var fr=170,pr={contributes:`fed by`,causes:`driven by`,dampens:`held back by`,enables:`made possible by`,correlates:`moving together with`},mr={1:`pushed up by`,[-1]:`pushed down by`};function hr(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 gr={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.`};function _r(e,t){let n=e.values.get(ar(t));if(!n||n.kind===`structure`)return null;let r=x(n);return n.kind===`illustrative`?{say:`Illustratively, about ${r}.`,shown:`Illustratively, about ${r}.`}:{say:`Measured at ${r}.`,shown:`Measured at ${r}.`}}function vr(e){return e.kind?e.kind===`dampens`||e.kind===`enables`||e.kind===`correlates`:e.sign===-1}function yr(e){return e.kind&&pr[e.kind]?pr[e.kind]:mr[e.sign??1]??`fed by`}function br(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 xr(e,t,n,r={}){let i=br(t);if(i.length<2)return[];let c=new Map(e.nodes.map(e=>[e.id,e])),l=new Map(t.nodes.map(e=>[e.id,e.label])),u=new Map(i.map((e,t)=>[e,t])),d=e=>t.edges.filter(t=>t.to===e&&u.has(t.from)&&(u.get(t.from)??0)<(u.get(e)??0)).sort((e,t)=>(t.weight??0)-(e.weight??0)||(e.id<t.id?-1:1))[0],f=[],p=i.at(-1)===e.outcomeId?i.length-1:i.length,m=p===1?`One cause, one outcome. Here is how it connects.`:`${p} causes, one outcome. Here is how they connect.`;f.push({nodeId:e.outcomeId,wide:!0,rep:`graph`,say:m,caption:m});let h=null;for(let[t,r]of i.entries()){let u=c.get(r),p=l.get(r)??r,m=d(r),g=r===e.outcomeId&&t===i.length-1,_=m?l.get(m.from)??m.from:null,v;v=g?m?`And it ends here: ${hr(p)}, ${yr(m)} ${m.from===h?`it`:hr(_??``)}.`:`And it ends here: ${hr(p)}.`:m?m.from===h?vr(m)?`Then ${hr(p)}, ${yr(m)} it.`:`Then ${hr(p)}.`:`${p}, ${yr(m)} ${hr(_??``)}.`:t===0?`It starts with ${hr(p)}.`:`Alongside it: ${p}.`,h=r;let y=[v],b=[v],x=_r(n,r);x&&(y.push(x.say),b.push(x.shown));let S=u?.detail;S&&(y.push(s(a(S),fr)),b.push(s(o(S),fr))),f.push({nodeId:r,...m?{edgeId:m.id}:{},say:y.join(` `),caption:b.join(` `)})}if(r.closeOn){let t=gr[r.closeOn];f.push({nodeId:e.outcomeId,wide:!0,rep:r.closeOn,say:t,caption:t})}return f}r();var Sr=[{rep:`graph`,label:`Graph`},{rep:`flow`,label:`Contribution`},{rep:`timeline`,label:`Over time`},{rep:`chart`,label:`As a chart`}],Cr={graph:`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.`,timeline:`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.`,chart:`Each mark is a cause plotted against its own measured history. Causes with nothing measured are held aside rather than drawn at zero.`,flow:`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.`},wr=`an illustrative world measures nothing, so there is no baseline`;function Tr(e,t){for(let n of e){if(n.id===t)return n.children;let e=n.children===void 0?void 0:Tr(n.children,t);if(e)return e}}function Er(e){let{value:t,...n}=e;return n}function Dr(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 Or(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 kr(e){let t=(0,W.c)(12),{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,G.jsx)(jr,{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=r??``,f=i===!0,p;return t[7]!==o||t[8]!==a||t[9]!==d||t[10]!==f?(p=(0,G.jsx)(Ar,{title:d,failed:f,onRetry:a,onClose:o}),t[7]=o,t[8]=a,t[9]=d,t[10]=f,t[11]=p):p=t[11],p}function Ar(e){let t=(0,W.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,G.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,G.jsxs)(`div`,{className:`wo-title`,children:[s,(0,G.jsx)(`h2`,{children:n})]}),t[1]=n,t[2]=c);let l;t[3]===a?l=t[4]:(l=a&&(0,G.jsx)(`div`,{className:`wo-head-actions`,children:(0,G.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:a,"aria-label":`Close`,children:`✕`})}),t[3]=a,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,G.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,G.jsx)(`div`,{className:`wo-shell`,role:`status`,"aria-live":`polite`,children:r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`wo-shell-line`,children:`This world didn’t come back.`}),(0,G.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,G.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:i,children:`Try again`})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`wo-shell-pulse`,"aria-hidden":`true`}),(0,G.jsx)(`p`,{className:`wo-shell-line`,children:`Building this world…`}),(0,G.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,G.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,G.jsx)(`section`,{className:`wo-scrim`,"aria-label":o,children:f}),t[14]=o,t[15]=f,t[16]=p):p=t[16],p}function jr({spec:e,view:t,onClose:n,onExpandNode:r,autoWalk:a,speakLine:o}){let[s,d]=(0,U.useState)(()=>new Map),[f,p]=(0,U.useState)(null),m=(0,U.useMemo)(()=>{if(s.size===0)return e;let t=e;for(let[e,n]of s)t=F(t,e,n);return t},[e,s]),h=m.provenance.illustrative===!0,g=(0,U.useMemo)(()=>le(m),[m]),_=(0,U.useMemo)(()=>sr(m,g),[m,g]),v=_.trust,y=(0,U.useMemo)(()=>ir(m),[m]),[b,x]=(0,U.useState)(()=>new Map),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(!1),E=(0,U.useMemo)(()=>[...b.values()].some(e=>e!==100),[b]),D=(0,U.useMemo)(()=>[...b].map(([e,t])=>({nodeId:e,pct:t/100})),[b]),O=(0,U.useMemo)(()=>H(y,[]),[y]),k=(0,U.useMemo)(()=>H(y,D),[y,D]),A=(0,U.useMemo)(()=>E?Dr(O,k):null,[E,O,k]),j=(0,U.useDeferredValue)(A),M=(0,U.useCallback)(e=>Cn(e,g),[g]),P=t&&M(t)?t:void 0,R=Dn({world:g,insetBottom:w?108:54,...P?{initialRep:P}:{}}),{rep:z,setRep:W,expandedIds:ee,toggleExpand:K}=R;(0,U.useEffect)(()=>{P&&W(P)},[P,W]);let te=(0,U.useMemo)(()=>{let e=g.nodes.map(e=>{let t=Er(e),n=j?.get(e.parentId??e.id),r=N(e.label);return{...t,label:r,...n===void 0?{}:{shift:n}}});return{...g,nodes:e}},[g,j]),q=(0,U.useMemo)(()=>{let e=new Map,t=n=>{e.set(n.id,n);for(let e of n.children??[])t(e)};for(let e of m.nodes)t(e);return e},[m]),ne=(0,U.useMemo)(()=>{let e=se(m.edges);return new Map(g.edges.map((t,n)=>[t.id,e[n]]))},[g,m]),re=(0,U.useMemo)(()=>new Set(g.nodes.map(e=>e.parentId).filter(e=>e!==void 0)),[g]),ae=(0,U.useRef)(null),oe=(0,U.useCallback)(()=>ae.current?.dismiss(),[]),ce=(0,U.useCallback)(e=>{(e.surface===`node`||e.surface===`edge`)&&C({kind:e.surface,id:e.id})},[]),[ue,de]=(0,U.useState)(void 0),fe=M(`timeline`)?`timeline`:void 0,[pe,me]=(0,U.useState)([]);(0,U.useEffect)(()=>{let e=globalThis.requestIdleCallback,t=()=>me(xr(m,g,v,fe?{closeOn:fe}:{}));if(typeof e==`function`){let n=e(t,{timeout:2e3});return()=>globalThis.cancelIdleCallback?.(n)}let n=setTimeout(t,1);return()=>clearTimeout(n)},[m,g,v,fe]);let{focusNode:J}=R,he=(0,U.useCallback)(e=>{e.rep&&W(e.rep),C({kind:`node`,id:e.nodeId}),de(e.edgeId),e.wide?J(null):e.rep||J(e.nodeId)},[J,W]),{index:ge,playing:Y,caption:_e,toggle:ve,seek:ye,reset:be}=ur((0,U.useMemo)(()=>({beats:pe,apply:he,...o?{speakLine:o}:{}}),[pe,he,o]));(0,U.useEffect)(()=>{T(Y||ge>=0)},[Y,ge]);let xe=(0,U.useRef)(!1);(0,U.useEffect)(()=>{!a||xe.current||pe.length===0||(xe.current=!0,ve())},[a,pe.length,ve]);let X=(0,U.useCallback)(()=>{be(),de(void 0)},[be]),Se=(0,U.useRef)(n);Se.current=n;let Ce=(0,U.useRef)(ve);Ce.current=ve;let we=(0,U.useRef)(X);we.current=X,(0,U.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){we.current(),Se.current?.();return}(e.key===` `||e.key===`Spacebar`)&&(e.target?.closest(`button, input, select, textarea, [contenteditable="true"]`)||(e.preventDefault(),Ce.current()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Te=(0,U.useCallback)(e=>{X(),C({kind:`node`,id:e.id})},[X]),Ee=(0,U.useCallback)(e=>{X(),C({kind:`edge`,id:e})},[X]),De=(0,U.useCallback)((e,t)=>{X(),x(n=>new Map(n).set(e,t))},[X]),Oe=(0,U.useCallback)(()=>{X(),x(new Map)},[X]),ke=(0,U.useCallback)(e=>g.nodes.find(t=>t.id===e)?.parentId===void 0,[g]),Ae=(0,U.useCallback)(e=>{!r||f!==null||(p(e),r(e,m).then(t=>{p(null);let n=t===null?void 0:Tr(t.nodes,e);n?.length&&(d(t=>new Map(t).set(e,n)),ke(e)?K(e):C({kind:`node`,id:e}))},()=>p(null)))},[r,ke,f,m,K]),je=(0,U.useCallback)((e,t)=>{if(t===`entry`&&z===`timeline`){let t=q.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,G.jsx)(`span`,{className:`wo-when`,"data-said":e.dateGrounded?``:void 0,children:a})}if(t!==`card`)return null;let n=ee.has(e.id),i=re.has(e.id),a=e.parentId===void 0,o=!i&&r!==void 0,s=i&&a,c=f===e.id;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(In,{id:ar(e.id),className:`wo-num`}),e.shift!==void 0&&ie(e.shift)!==null&&(0,G.jsx)(`span`,{className:`wo-shift`,"data-dir":e.shift<1?`down`:`up`,children:ie(e.shift)}),(s||o)&&(0,G.jsx)(`button`,{type:`button`,className:`wo-expand`,"aria-expanded":n,"aria-busy":c||void 0,disabled:c||o&&f!==null,"aria-label":`${s&&n?`Fold up`:`Break down`} ${e.label}`,onClick:t=>{t.stopPropagation(),s?K(e.id):Ae(e.id)},children:c?`breaking down…`:s&&n?`fold up`:`break down`})]})},[re,ee,K,r,f,Ae,q,z]),Z=q.get(m.outcomeId),Me=(0,U.useMemo)(()=>Or(O,O,Z?.value,h),[O,Z?.value,h]),Ne=(0,U.useMemo)(()=>Or(k,O,Z?.value,h),[k,O,Z?.value,h]),Pe=(0,U.useMemo)(()=>({causes:m.nodes.length,links:m.edges.length,sourced:m.nodes.filter(e=>e.receipt!==void 0).length}),[m]),Q=S?.kind===`node`?q.get(S.id):void 0,Fe=(0,U.useMemo)(()=>Q===void 0?[]:B(_,Q.id),[_,Q]),[Ie,Le]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(Q===void 0){Le(null);return}let e=!0;return(async()=>{let{hierarchyLens:t}=await i(async()=>{let{hierarchyLens:e}=await import(`./lens-ChFJD9il.js`);return{hierarchyLens:e}},__vite__mapDeps([0,1,2,3]));if(!e)return;let n=t.compile(_,Q.id);if(n===null){Le(null);return}await c(l([n.block]));let r=u(n.block.type);e&&r&&Le({plan:n,render:r})})(),()=>{e=!1}},[_,Q]);let $=S?.kind===`edge`?ne.get(S.id):void 0,Re=(0,U.useMemo)(()=>m.nodes.filter(e=>e.role===`root`).map(e=>({id:e.id,label:N(e.label),pct:b.get(e.id)??100})),[m.nodes,b]);return(0,G.jsx)(qn,{registry:v,onNavigate:ce,ref:ae,children:(0,G.jsx)(`section`,{className:`wo-scrim`,"aria-label":`Living answer: ${m.title}`,children:(0,G.jsxs)(`div`,{className:`wo-panel`,children:[(0,G.jsxs)(`header`,{className:`wo-head`,children:[(0,G.jsxs)(`div`,{className:`wo-title`,children:[(0,G.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),(0,G.jsx)(`h2`,{children:m.title})]}),(0,G.jsxs)(`div`,{className:`wo-head-actions`,children:[(0,G.jsx)(`div`,{className:`wo-views`,role:`group`,"aria-label":`View`,children:Sr.filter(e=>M(e.rep)).map(e=>(0,G.jsx)(`button`,{type:`button`,className:`wo-chip`,"aria-pressed":z===e.rep,onClick:()=>{X(),W(e.rep)},children:e.label},e.rep))}),(0,G.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:Oe,disabled:!E,children:`Reset`}),n&&(0,G.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:n,"aria-label":`Close`,children:`✕`})]})]}),h&&(0,G.jsx)(`div`,{className:`wo-banner wo-banner-illustrative`,children:`Illustrative model — shows the shape, not your numbers.`}),(0,G.jsx)(`p`,{className:`wo-legend`,children:Cr[z]}),(0,G.jsxs)(`div`,{className:`wo-body`,children:[(0,G.jsxs)(`div`,{className:`wo-stage`,onWheelCapture:oe,onPointerDownCapture:oe,children:[(0,G.jsx)(Je,{stage:R,world:te,renderFace:je,onNodeClick:Te,onEdgeClick:Ee,selectedId:S?.kind===`node`?S.id:void 0,litEdgeId:ue}),(0,G.jsx)(dr,{count:pe.length,index:ge,playing:Y,caption:_e,expanded:w,onToggle:ve,onSeek:ye})]}),(0,G.jsxs)(`aside`,{className:`wo-rail`,children:[(0,G.jsx)(Nn,{levers:Re,onSet:De,onReset:Oe}),(0,G.jsx)(tr,{baseline:Me,current:Ne,unit:Z?.unit,active:E,observedNote:h?wr:void 0}),(0,G.jsxs)(`div`,{className:`wo-detail`,children:[(0,G.jsx)(`span`,{className:`wo-rail-kicker`,children:`EVIDENCE`}),!S&&(0,G.jsxs)(`div`,{className:`wo-standing`,children:[(0,G.jsxs)(`dl`,{className:`wo-facts`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Causes`}),(0,G.jsx)(`dd`,{children:Pe.causes})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Links`}),(0,G.jsx)(`dd`,{children:Pe.links})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:h?`Illustrative`:`With a source`}),(0,G.jsx)(`dd`,{children:h?`every cause`:Pe.sourced})]})]}),Z&&(0,G.jsxs)(`p`,{className:`wo-standing-outcome`,children:[(0,G.jsx)(`span`,{className:`wo-standing-lead`,children:`It ends at`}),` `,Z.label,Z.detail?(0,G.jsx)(`span`,{className:`wo-standing-note`,children:Z.detail}):null]}),(0,G.jsx)(`p`,{className:`wo-hint`,children:`Tap a cause or a link to see what stands behind it.`})]}),Q&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h3`,{className:`wo-detail-title`,children:Q.label}),Q.detail&&(0,G.jsx)(`p`,{className:`wo-detail-note`,children:Q.detail}),(0,G.jsx)(`p`,{className:`wo-detail-figure`,children:(0,G.jsx)(In,{id:ar(Q.id)})}),Q.series&&(0,G.jsx)(`ul`,{className:`wo-series`,children:Q.series.points.map((e,t)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{className:`wo-series-t`,children:e.t}),(0,G.jsx)(In,{id:or(Q.id,e.t)})]},`${e.t}:${t}`))}),(Ie||Fe.length>0)&&(0,G.jsxs)(`div`,{className:`wo-parts`,children:[(0,G.jsx)(`span`,{className:`wo-rail-kicker`,children:`WHAT THIS IS MADE OF`}),Ie?Ie.render(Ie.plan.block.props,{delay:0}):(0,G.jsx)(`ul`,{className:`wo-part-list`,children:Fe.map(e=>(0,G.jsx)(`li`,{children:N(e.label)},e.id))})]})]}),$&&(0,G.jsx)(V,{relation:L($.relation),sign:$.sign,status:$.status??I($),receipts:$.receipts??($.receipt?[$.receipt]:[]),counter:$.counter,provisional:$.provisional})]})]})]})]})})})}export{kr 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{a,i as o,s}from"./spokenText-C88IQJ0M.js";import{i as c,n as l,t as u}from"./loader-DCA6Njbf.js";import{t as d}from"./useFocusTrap-DBtkeyRy.js";import{r as f,t as p}from"./useSpatialCanvas-CfmZOXXP.js";import{i as m}from"./format-q0LwBjID.js";import{a as h,i as g,n as _,r as v}from"./scale-Bcgfo6Hp.js";import{t as y}from"./spreadLabels-CQ8hufvK.js";import{a as b,i as x,n as S,t as C}from"./display-CAb_PiGv.js";import{t as w}from"./types-C42I77wh.js";import{r as T,t as E}from"./sourceHost-BV3t2XDb.js";import{r as D}from"./stepDriver-DwjFet6U.js";import{c as O,l as k,o as A,u as j}from"./walkSync-CT8kmbzY.js";import{n as M}from"./emphasize-BqCIst-B.js";import{c as N,s as P,t as F}from"./validate-sGUCmPAs.js";import{n as I,s as L}from"./receipts-D7zveV-I.js";import{n as R,r as z}from"./value-Dx7DZob4.js";import{t as B}from"./types-DuEbJpIA.js";import{n as V,t as H}from"./engine-BiM6INsW.js";var U=e(),W=t(),G=n();function ee(e){return e.kind}var K=.33,te=.1,q=.005;function ne(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<=q)return`would barely change`;let a=r>0?`rise`:`fall`;return i>=K?`would ${a} meaningfully`:i>=te?`would ${a} somewhat`:`would ${a} slightly`}var re=.6;function ie(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>=re?`much ${r}`:n>=K?r:`slightly ${r}`}function ae(e){let t=[];for(let n of e?.points??[]){let e=P(n.t);e===null||!Number.isFinite(n.value)||t.push({t:e,v:n.value})}return t.sort((e,t)=>e.t-t.t)}function oe(e,t){let n=e.date?P(e.date.t):null;if(n!==null){let t=e.date?.until?P(e.date.until):null;return t!==null&&t>n?{start:n,end:t}:{start:n}}if(t.length===0)return null;let r=t[0].t,i=t[t.length-1].t;return i>r?{start:r,end:i}:{start:r}}function se(e){return e.filter(e=>e.from!==e.to)}function ce(e){return se(e).map((e,t)=>({id:e.id??`${e.from}->${e.to}#${t}`,from:e.from,to:e.to,sign:e.sign,...e.relation===void 0?{}:{kind:e.relation},...typeof e.weight==`number`?{weight:e.weight}:{},...e.provisional?{provisional:!0}:{}}))}function le(e){let t=[],n=(e,r,i=0)=>{if(i>1)return;let a=ae(e.series),o=e.unit??e.series?.unit,s=oe(e,a);t.push({id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...o===void 0?{}:{unit:o},...a.length>0?{series:a}:{},...s?{date:s}:{},...s&&e.date&&w(e.date.tier??`T0`)?{dateGrounded:!0}:{},...e.domain===void 0?{}:{domain:e.domain},...r===void 0?{}:{parentId:r}});for(let t of e.children??[])n(t,e.id,i+1)};for(let t of e.nodes)n(t);return{nodes:t,edges:ce(e.edges),outcomeId:e.outcomeId}}var ue={w:1090,h:650},de=1.4,fe=86*de;160*de;var pe=116*de,me=9/(11*de),J=e=>String(Math.round(e*100)/100),he=e=>e&&/^[a-z-]{1,24}$/.test(e)?` morph-edge--rel-${e}`:``,ge=525949.2*60*1e3,Y=e=>1970+e/ge,_e=e=>(e-1970)*ge,ve=6e4,ye=60*ve,be={minute:ve,hour:ye,day:24*ye,month:ge/12},xe=[{grain:`minute`,n:1},{grain:`minute`,n:5},{grain:`minute`,n:10},{grain:`minute`,n:15},{grain:`minute`,n:30},{grain:`hour`,n:1},{grain:`hour`,n:2},{grain:`hour`,n:3},{grain:`hour`,n:6},{grain:`hour`,n:12},{grain:`day`,n:1},{grain:`day`,n:2},{grain:`day`,n:5},{grain:`day`,n:10},{grain:`month`,n:1},{grain:`month`,n:2},{grain:`month`,n:3},{grain:`month`,n:6}],X=3,Se=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ce=64;function we(e){let t=new Date(0);return t.setUTCFullYear(Math.floor(e/12),(e%12+12)%12,1),t.setUTCHours(0,0,0,0),t.getTime()}function Te(e,t,n){if(t.grain===`month`){let r=new Date(e),i=Math.floor((r.getUTCFullYear()*12+r.getUTCMonth())/t.n)*t.n,a=we(i);return n&&a<e?we(i+t.n):a}let r=be[t.grain]*t.n,i=Math.floor(e/r)*r;return n&&i<e?i+r:i}function Ee(e,t){let n=new Date(e);if(!Number.isFinite(n.getTime()))return String(Math.round(Y(e)));let r=`${Se[n.getUTCMonth()]} ${n.getUTCFullYear()}`;if(t===`month`)return r;let i=`${n.getUTCDate()} ${r}`;if(t===`day`||n.getUTCHours()===0&&n.getUTCMinutes()===0)return i;let a=e=>String(e).padStart(2,`0`);return`${a(n.getUTCHours())}:${a(n.getUTCMinutes())}`}function De(e,t){if(t.grain!==`month`)return e+be[t.grain]*t.n;let n=new Date(e);return we(n.getUTCFullYear()*12+n.getUTCMonth()+t.n)}function Oe(e,t,n){let r=Te(_e(e),n,!1),i=Te(_e(t),n,!0),a=[];for(let e=r;e<=i&&a.length<Ce;e=De(e,n))a.push({year:Y(e),text:Ee(e,n.grain)});return{domain:[Y(r),Y(i)],ticks:a}}function ke(e,t,n){let r=Math.max(1,Math.round(v(t-e,n))),i=Math.floor(e/r)*r,a=Math.ceil(t/r)*r,o=[];for(let e=i;e<=a&&o.length<Ce;e+=r)o.push({year:e,text:String(e)});return{domain:[i,a],ticks:o}}function Ae(e,t,n=6){let[r,i]=e<t?[e,t]:[e-.5,t+.5];if(i-r>=X)return ke(r,i,n);let a=(i-r)*ge/n,o=xe[xe.length-1],s=1/0;for(let e of xe){let t=Math.abs(Math.log(be[e.grain]*e.n/a));t<s&&(s=t,o=e)}return Oe(r,i,o)}var je=8,Z=12,Me=16,Ne=6,Pe=12+Math.ceil(15.525*de);function Q(e,t,n,r=ue){let i=new Map;if(e.length===0)return{positions:i,band:null,bbox:t};let a=pe+Me,o=44*de+Ne,s=Math.max(t.w,r.w),c=Math.max(1,Math.floor((s-24+Me)/a)),l=Math.min(e.length,c),u=Math.ceil(e.length/c),d=l*pe+(l-1)*Me,f={id:`shelf`,x:t.x,y:t.y+t.h+je,w:Math.max(t.w,d+24),h:Pe+Ne+u*o-Ne+Z,className:`morph-shelf`,label:n};return e.forEach((e,t)=>{i.set(e.id,{x:f.x+Z+t%c*a,y:f.y+Pe+Ne+Math.floor(t/c)*o,w:116,h:44,face:`entry`,shelved:!0})}),{positions:i,band:f,bbox:{x:t.x,y:t.y,w:Math.max(t.w,f.w),h:f.y+f.h-t.y}}}var Fe=440,Ie=2,Le=1.25,$=320;function Re(e){if(!(e===void 0||!Number.isFinite(e))){if(e<.995)return`weaker`;if(e>1.005)return`stronger`}}function ze(){let e=(0,W.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(`marker`,{id:`mv-arrow`,className:`mv-marker mv-marker-up`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0.5 1 L9.5 5 L0.5 9 Z`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(`marker`,{id:`mv-arrow-damp`,className:`mv-marker mv-marker-down`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:17,markerHeight:17,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M8 0.6 L8 9.4`})}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`marker`,{id:`mv-arrow-open`,className:`mv-marker mv-marker-open`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M1 1.4 L9 5 L1 8.6 Z`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`marker`,{id:`mv-arrow-ring`,className:`mv-marker mv-marker-ring`,viewBox:`0 0 10 10`,refX:`7.4`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`circle`,{cx:`5`,cy:`5`,r:`3`})}),e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`defs`,{children:[t,n,r,i,(0,G.jsx)(`marker`,{id:`mv-dot`,className:`mv-marker mv-marker-dot`,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:9,markerHeight:9,orient:`auto`,children:(0,G.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2.6`})})]}),e[4]=a):a=e[4],a}function Be(e,t){let n=(0,W.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,He);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=Ve;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,U.useEffect)(r,i)}function Ve(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 He(e){return typeof e.getTotalLength==`function`?e.getTotalLength():null}function Ue(e){let t=(0,W.c)(33),{chrome:n,bbox:r,exiting:i,onSettle:a}=e,o=(0,U.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(Ge),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,G.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,G.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,G.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,G.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,G.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,G.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":e.draw?``:void 0},e.id)}function Ge(e){return(0,G.jsx)(`rect`,{className:`mv-band ${e.className}`,x:e.x,y:e.y,width:e.w,height:e.h,rx:12},e.id)}function Ke(e){if(e instanceof Element)return e.closest(`.mv-node`)?.dataset.id}var qe=(0,U.memo)(function(e){let t=(0,W.c)(49),{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,U.useRef)(null);Be(m,i.edgePaths);let{bbox:h}=i,g;if(t[0]!==r||t[1]!==n){let e=new Map(n.map(Ye));g=new Map;for(let t of r){let n=e.get(t.from);n!==void 0&&Number.isFinite(n)&&g.set(t.id,n)}t[0]=r,t[1]=n,t[2]=g}else g=t[2];let _=g,v;t[3]!==a||t[4]!==o?(v=a&&(0,G.jsx)(Ue,{chrome:a.layout.chrome,bbox:a.layout.bbox,exiting:!0,onSettle:()=>o(a.token)},a.token),t[3]=a,t[4]=o,t[5]=v):v=t[5];let y;t[6]!==h||t[7]!==i.chrome||t[8]!==i.rep?(y=(0,G.jsx)(Ue,{chrome:i.chrome,bbox:h},i.rep),t[6]=h,t[7]=i.chrome,t[8]=i.rep,t[9]=y):y=t[9];let b=h.w,x=h.h,S=`${h.x} ${h.y} ${h.w} ${h.h}`,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,G.jsx)(ze,{}),t[10]=C):C=t[10];let w;if(t[11]!==_||t[12]!==i.edgePaths||t[13]!==p||t[14]!==d){let e;t[16]!==_||t[17]!==p||t[18]!==d?(e=e=>(0,G.jsxs)(`g`,{className:`mv-edge-g`,"data-lit":p===e.id?``:void 0,"data-shift":Re(_.get(e.id)),style:_.has(e.id)?{"--mv-shift":_.get(e.id)}:void 0,onClick:d?()=>d(e.id):void 0,children:[d&&(0,G.jsx)(`path`,{className:`mv-edge-hit`,d:e.d,fill:`none`}),(0,G.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[16]=_,t[17]=p,t[18]=d,t[19]=e):e=t[19],w=i.edgePaths.map(e),t[11]=_,t[12]=i.edgePaths,t[13]=p,t[14]=d,t[15]=w}else w=t[15];let T;t[20]!==h.h||t[21]!==h.w||t[22]!==S||t[23]!==w?(T=(0,G.jsxs)(`svg`,{ref:m,className:`mv-edges`,width:b,height:x,viewBox:S,"aria-hidden":`true`,children:[C,w]}),t[20]=h.h,t[21]=h.w,t[22]=S,t[23]=w,t[24]=T):T=t[24];let E;if(t[25]!==s||t[26]!==h.x||t[27]!==h.y||t[28]!==i.positions||t[29]!==c||t[30]!==n||t[31]!==u||t[32]!==l||t[33]!==f){let e;t[35]!==s||t[36]!==h.x||t[37]!==h.y||t[38]!==i.positions||t[39]!==c||t[40]!==u||t[41]!==l||t[42]!==f?(e=(e,t)=>{let n=i.positions.get(e.id);if(!n)return null;let r={"--nx":`${n.x+n.w/2-h.x}px`,"--ny":`${n.y+n.h/2-h.y}px`,"--mv-i":t,...e.shift===void 0?{}:{"--mv-shift":e.shift}},a=u!==void 0&&!n.folded,o=l?.(e,`entry`);return(0,G.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":Re(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?0:void 0,onClick:a?()=>s(e):void 0,onKeyDown:a?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),u?.(e))}:void 0,children:[(0,G.jsxs)(`div`,{className:`mv-face mv-face-card`,children:[(0,G.jsx)(`span`,{className:`mv-label`,children:e.label}),(0,G.jsxs)(`span`,{className:`mv-card-foot`,children:[e.domain!==void 0&&(0,G.jsx)(`span`,{className:`mv-domain`,title:e.domain,"aria-label":e.domain}),e.value!==void 0&&(0,G.jsxs)(`span`,{className:`mv-value`,children:[e.value.toLocaleString(),e.unit??``]}),l?.(e,`card`),e.tier!==void 0&&(0,G.jsx)(`span`,{className:`mv-tier`,children:e.tier})]})]}),(0,G.jsx)(`div`,{className:`mv-face mv-face-entry`,children:(0,G.jsxs)(`span`,{className:`mv-label`,children:[o,o?` `:null,e.label]})}),(0,G.jsx)(`div`,{className:`mv-face mv-face-mark`,children:l?.(e,`mark`)})]},e.id)},t[35]=s,t[36]=h.x,t[37]=h.y,t[38]=i.positions,t[39]=c,t[40]=u,t[41]=l,t[42]=f,t[43]=e):e=t[43],E=n.map(e),t[25]=s,t[26]=h.x,t[27]=h.y,t[28]=i.positions,t[29]=c,t[30]=n,t[31]=u,t[32]=l,t[33]=f,t[34]=E}else E=t[34];let D;return t[44]!==v||t[45]!==y||t[46]!==T||t[47]!==E?(D=(0,G.jsxs)(G.Fragment,{children:[v,y,T,E]}),t[44]=v,t[45]=y,t[46]=T,t[47]=E,t[48]=D):D=t[48],D});function Je({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,U.useState)(!1),y=(0,U.useRef)(new Map),b=(0,U.useRef)(0),x=(0,U.useRef)(!1),S=(0,U.useRef)(!1),C=(0,U.useRef)(!1),w=(0,U.useRef)({x:0,y:0}),T=(0,U.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,U.useRef)(T);E.current=T,(0,U.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,Ke(e.target)),clearTimeout(t),t=setTimeout(()=>{x.current=!1},$);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,U.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,U.useRef)({dx:0,dy:0}),A=(0,U.useRef)(0),j=(0,U.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,U.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,U.useEffect)(()=>()=>cancelAnimationFrame(A.current),[]);let N=(0,U.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>Le||i<1/Le)&&(b.current=r,E.current(i,t,n,Ke(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)>Ie&&!C.current&&(C.current=!0,e.currentTarget.setPointerCapture(e.pointerId)),w.current={x:e.clientX,y:e.clientY},M(n,r)},[M]),P=(0,U.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,U.useCallback)(e=>{C.current||r?.(e)},[r]),I=(0,U.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,G.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,G.jsx)(`div`,{className:`mv-world`,style:R,"data-morphing":f?``:void 0,onTransitionEnd:I,children:(0,G.jsx)(qe,{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 Ye(e){return[e.id,e.shift]}function Xe(e,t){return e===`in`?`zoom-camera`:t?`ascend`:`zoom-camera`}var Ze=880,Qe=340,$e=468,et=56,tt=26,nt=16,rt=7,it=30*de;function at(e){let t=(e.series??[]).filter(e=>Number.isFinite(e.t)&&Number.isFinite(e.v)).map(e=>({t:Y(e.t),v:e.v})).sort((e,t)=>e.t-t.t);return t.length>0?{node:e,points:t}:null}var ot=e=>at(e)!==null;function st(e,t){let n=e*Math.max(et,(t-1)*it+30)+(e-1)*tt,r=Math.min($e,Math.max(Qe,n)),i=Math.max(it,Math.min(tt,r/(4*e)));return{h:(r-(e-1)*i)/e,gap:i}}function ct(e,t,n){let[r,i]=e===t?_(e,t,n):[e,t],a=v(i-r,n),o=[Math.floor(r/a)*a,Math.ceil(i/a)*a];return{domain:o,ticks:h(o[0]-a*1e-9,o[1],a)}}function lt(e){let t=1/0,n=-1/0,r=new Map;for(let i of e){let e=new Map;for(let a of i.nodes){let i=at(a);if(!i)continue;let o=a.unit??``,s=r.get(o);s||r.set(o,s={lo:1/0,hi:-1/0,marks:0}),e.set(o,(e.get(o)??0)+1);for(let e of i.points)t=Math.min(t,e.t),n=Math.max(n,e.t),s.lo=Math.min(s.lo,e.v),s.hi=Math.max(s.hi,e.v)}for(let[t,n]of e){let e=r.get(t);e.marks=Math.max(e.marks,n)}}if(t===1/0)return null;let i=1;for(let e of r.values())i=Math.max(i,e.marks);let{h:a,gap:o}=st(r.size,i),s=Math.max(2,Math.min(5,Math.round(a/60))),c=[],l=new Map;for(let[e,t]of r){let{domain:n,ticks:r}=ct(t.lo,t.hi,s);l.set(e,c.length),c.push({unit:e,domain:n,ticks:r,top:c.length*(a+o),h:a})}let u=Ae(t,n);return{x:u.domain,xTicks:u.ticks,bands:c,bandOf:l,height:c.length*a+(c.length-1)*o}}function ut(e,t){let n=new Map,r=new Map;for(let t of e){let e=r.get(t.band);e?e.push(t):r.set(t.band,[t])}for(let[e,i]of r){let{top:r,bottom:a}=t(e);i.sort((e,t)=>e.x-t.x||e.y-t.y||e.id.localeCompare(t.id));let o=[],s=()=>{if(o.length!==0){for(let[e,t]of y(o,{gap:it,top:r,bottom:a}))n.set(e,t);o=[]}};for(let e of i)o.length>0&&e.x-o[o.length-1].x>=it&&s(),o.push(e);s()}return n}function dt(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=at(n);e&&t?r.push(e):i.push(n)}let a=new Map,o={bands:[],paths:[],labels:[]},s=1/0,c=-1/0,l=56;if(r.length>0&&t){let e=g(t.x,[56,56+Ze]),n=t.bands.map(e=>g(e.domain,[56+e.top+e.h,56+e.top])),i=e=>t.bandOf.get(e.unit??``)??0;t.bands.forEach((e,r)=>{let i=n[r];for(let t of e.ticks)o.paths.push({id:`grid:${r}:${t}`,d:`M ${J(56)} ${J(i(t))} L ${J(56+Ze)} ${J(i(t))}`,className:`morph-gridline`}),o.labels.push({id:`ytick:${r}:${t}`,x:46,y:i(t)+4,text:String(t),className:`morph-axis-label`,anchor:`end`}),s=Math.min(s,46-String(t).length*rt);t.bands.length>1&&o.labels.push({id:`unit:${r}`,x:56,y:56+e.top-11,text:e.unit===``?`no unit`:e.unit,className:`morph-axis-label`,anchor:`start`})}),t.xTicks.forEach((n,r)=>{let i=e(n.year);o.labels.push({id:`xtick:${r}`,x:i,y:56+t.height+22,text:n.text,className:`morph-axis-label`,anchor:`middle`});let a=n.text.length*rt/2;s=Math.min(s,i-a),c=Math.max(c,i+a)}),s=Math.min(s,56),c=Math.max(c,56+Ze),l=Math.max(l,56+t.height+28);let u=[...r].sort((e,t)=>e.node.id.localeCompare(t.node.id)),d=u.map(t=>{let r=i(t.node),a=t.points[t.points.length-1];return{id:t.node.id,band:r,x:e(a.t),y:n[r](a.v)}}),f=ut(d,e=>({top:56+t.bands[e].top,bottom:56+t.bands[e].top+t.bands[e].h})),p=new Map,m=new Map;for(let e of d){let t=m.get(e.band);t?t.push(e):m.set(e.band,[e])}t.bands.forEach((e,t)=>{let n=m.get(t);if(n===void 0||n.length===0)return;let r=y(n.map(e=>({id:e.id,y:f.get(e.id)??e.y})),{gap:nt,top:56+e.top+6,bottom:56+e.top+e.h-6});for(let[e,t]of r)p.set(e,t)}),u.forEach((t,r)=>{let{x:i,y:s}=d[r],l=n[d[r].band],u=t.points.map((t,n)=>`${n===0?`M`:`L`} ${J(e(t.t))} ${J(l(t.v))}`).join(` `),m=t.node.id;o.paths.push({id:`series:${m}`,d:u,className:`morph-series`,draw:!0});let h=f.get(t.node.id)??s;Math.abs(h-s)>.01&&o.paths.push({id:`leader:${t.node.id}`,d:`M ${J(i)} ${J(s)} L ${J(i)} ${J(h)}`,className:`morph-tick`}),a.set(m,{x:i-15,y:h-15,w:30,h:30,face:`mark`});let g=i+15+8;o.labels.push({id:`label:${t.node.id}`,x:g,y:(p.get(t.node.id)??h)+4,text:t.node.label,className:`morph-series-label`,anchor:`start`}),c=Math.max(c,g+t.node.label.length*rt)})}let u=Q(i,s===1/0?{x:0,y:0,w:112,h:112}:{x:s-56,y:0,w:c-s+112,h:l+56},`${i.length} with nothing measured over time — the chart cannot plot these`,n);u.band&&o.bands.push(u.band);for(let[e,t]of u.positions)a.set(e,t);return{positions:a,edgePaths:[],chrome:o,bbox:u.bbox}}var ft=(e,t)=>({rep:`chart`,...dt(e,lt([e]),t?.viewport??ue)}),pt=new WeakMap;function mt(e,t){let n=new Set;for(let r of e)r.from===r.to||!t(r)||(n.add(r.from),n.add(r.to));return n}function ht(e){let t=pt.get(e);if(t)return t;let n=mt(e.edges,e=>typeof e.weight==`number`);return pt.set(e,n),n}var gt=340,_t=4,vt=fe+30,yt=3;function bt(e,t){return e.parentId===void 0&&ht(t).has(e.id)}var xt=(e,t)=>{let n=t?.viewport??ue,r=e.nodes.filter(e=>e.parentId===void 0),i=r.filter(t=>bt(t,e)),a=r.filter(t=>!bt(t,e)),o=e.nodes.filter(e=>e.parentId!==void 0),s=new Map,c={bands:[],paths:[],labels:[]},l=[],u=new Set(i.map(e=>e.id)),d=e.edges.filter(e=>e.from!==e.to&&typeof e.weight==`number`&&u.has(e.from)&&u.has(e.to)),f=i.reduce((e,t)=>Math.min(e,t.depth??0),1/0),p=new Map;for(let e of d)p.set(e.from,(p.get(e.from)??0)+(e.weight??0));let m=i.reduce((e,t)=>Math.max(e,Number.isFinite(f)?(t.depth??0)-f:0),0),h=e=>{let t=Number.isFinite(f)?(e.depth??0)-f:0;return m<=0?0:m<_t?t:Math.round(t/m*3)},g=new Map;for(let e of i){let t=h(e),n=g.get(t);n?n.push(e):g.set(t,[e])}for(let e of g.values())e.sort((e,t)=>(p.get(t.id)??0)-(p.get(e.id)??0)||e.id.localeCompare(t.id));let _=Math.max(1,...[...g.values()].map(e=>e.length));for(let[e,t]of g){let n=(_-t.length)*vt/2;t.forEach((t,r)=>{s.set(t.id,{x:56+e*gt,y:56+n+r*vt,w:200,h:64,face:`card`})})}for(let e of d){let t=s.get(e.from),n=s.get(e.to),r=t.x+t.w,i=t.y+t.h/2,a=n.x,o=n.y+n.h/2,c=(r+a)/2,u=Math.min(1,Math.max(0,e.weight??0));l.push({id:e.id,d:`M ${J(r)} ${J(i)} C ${J(c)} ${J(i)} ${J(c)} ${J(o)} ${J(a)} ${J(o)}`,className:`morph-edge morph-ribbon`+he(e.kind),width:yt+u*23})}for(let e of o){let t=(e.parentId===void 0?void 0:s.get(e.parentId))??{x:56,y:56};s.set(e.id,{x:t.x,y:t.y,w:200,h:64,face:`card`,folded:!0})}let v=Q(a,{x:0,y:0,w:112+(Math.max(1,...[...g.keys()].map(e=>e+1))-1)*gt+200,h:112+_*vt},`${a.length} with no measured share — the ribbons cannot size these`,n);for(let[e,t]of v.positions)s.set(e,t);return v.band&&c.bands.push(v.band),{rep:`flow`,positions:s,edgePaths:l,chrome:c,bbox:v.bbox}},St=200;function Ct(e,t=24){let n=e.length;if(n<2)return;let r=0;for(let t of e)r=Math.max(r,t.w,t.h);r=Math.max(r+t,1);let i=Array(n),a=new Map;for(let o=0;o<St;o++){a.clear();let o=[],s=[],c=[];for(let t=0;t<n;t++){let n=e[t],l=Math.floor((n.x+n.w/2)/r),u=Math.floor((n.y+n.h/2)/r),d=a.get(l);d===void 0&&(d=new Map,a.set(l,d));let f=d.get(u);f===void 0&&(f=c.length,d.set(u,f),o.push(l),s.push(u),c.push([])),c[f].push(t),i[t]=f}let l=c.map((e,t)=>{let n=[];for(let e=-1;e<=1;e++){let r=a.get(o[t]+e);if(r!==void 0)for(let e=-1;e<=1;e++){let i=r.get(s[t]+e);if(i!==void 0)for(let e of c[i])n.push(e)}}return n.sort((e,t)=>e-t)}),u=Array(c.length).fill(0),d=!1;for(let r=0;r<n;r++){let n=i[r],a=l[n],o=u[n];for(;o<a.length&&a[o]<=r;)o++;u[n]=o;let s=e[r];for(;o<a.length;o++){let n=a[o],i=e[n],c=i.x+i.w/2-(s.x+s.w/2),l=i.y+i.h/2-(s.y+s.h/2);c===0&&l===0&&(c=r-n,l=n-r);let u=(s.w+i.w)/2+t-Math.abs(c),f=(s.h+i.h)/2+t-Math.abs(l);if(!(u<=0||f<=0)){if(d=!0,u<=f){let e=u/2*(c<0?-1:1);s.x-=e,i.x+=e}else{let e=f/2*(l<0?-1:1);s.y-=e,i.y+=e}}}}if(!d)break}}var wt=300,Tt=fe+4,Et=4,Dt=fe+Et,Ot=wt-200,kt=200+Et,At=96,jt=30,Mt=20,Nt=18,Pt=15,Ft=2.5,It=1/1.4,Lt=1.7,Rt=2.6,zt={rows:1,reach:0};function Bt(e,t){let n=e.map(e=>t(e.id).rows).sort((e,t)=>t-e),r=e.map(e=>t(e.id).reach).sort((e,t)=>t-e),i=[0],a=0;for(let e of n)i.push(a+=e);return{size:e.length,rows:a,tallest:i,reaches:r}}function Vt(e,t){let n=[],r=[],i=[],a=[];for(let o of e){let e=Math.max(1,Math.min(o.size,Math.ceil(o.rows/t))),s=Math.ceil(o.size/e),c=Math.ceil(o.size/s);i.push(n.length),a.push(s);for(let e=0;e<c;e++)n.push(o.tallest[Math.min(s,o.size-e*s)]),r.push(200+(o.reaches[e]??0))}return{rows:n,widths:r,start:i,per:a}}function Ht(e,t){let n=[],r=[],i=[];for(let a=0;a<e.rows.length;a++){let o=Math.floor(a/t),s=a%t===0?0:n[a-1]+e.widths[a-1]+Ot;n.push(s),r[o]=Math.max(r[o]??1,e.rows[a]),i[o]=Math.max(i[o]??0,s+e.widths[a])}return{columnX:n,bandRows:r,bandW:i}}var Ut=12;function Wt(e,t){let n=n=>{let r=(t.h-(n-1)*At-112)/n,i=Math.max(2,Math.floor((r-64)/Tt)+1),a=Vt(e,i),o=Math.max(1,Math.ceil(a.rows.length/n)),{bandRows:s,bandW:c}=Ht(a,o),l=200;for(let e of c)l=Math.max(l,e);let u=(n-1)*At;for(let e=0;e<n;e++)u+=((s[e]??1)-1)*Tt+64;return{bands:n,rowCap:i,perBand:o,fit:Math.min(t.w/(l+112),t.h/(u+112)),aspect:l/u}},r=n(1);if(e.length<2||r.fit>=It)return r;let i=r;for(let e=2;e<=Ut;e++){let t=n(e);if(t.fit>=It&&t.aspect<=Ft)return t;if(t.fit>i.fit&&(i=t),t.perBand===1)break}return i}function Gt(e,t,n){let r=Wt(t,n),i=Vt(t,r.rowCap),{columnX:a,bandRows:o}=Ht(i,r.perBand),s=new Map,c=new Map;e.forEach((e,t)=>{s.set(e,i.start[t]),c.set(e,i.per[t])});let l=o.length>0?o:[1],u=[],d=[],f=[],p=0;for(let e of l){let t=(e-1)*Tt+64;u.push(p+t/2),d.push(t),p+=t,f.push(p+At/2),p+=At}return{perBand:r.perBand,columnRows:i.rows,columnX:a,startOf:s,splitOf:c,centreY:u,height:d,gutterY:f}}function Kt(e,t){let n=new Map,r=new Set;for(let t of e)typeof t.depth==`number`&&Number.isFinite(t.depth)?(n.set(t.id,t.depth),r.add(t.id)):n.set(t.id,0);let i=t.edges.filter(e=>e.from!==e.to&&n.has(e.from)&&n.has(e.to)),a=new Map,o=new Map(e.map(e=>[e.id,0]));for(let e of i){let t=a.get(e.from);t===void 0?a.set(e.from,[e.to]):t.push(e.to),o.set(e.to,o.get(e.to)+1)}let s=(e,t)=>r.has(e)?t:t+1,c=e.filter(e=>o.get(e.id)===0).map(e=>e.id),l=new Set;for(let e=0;e<c.length;e++){let t=c[e];l.add(t);let r=n.get(t);for(let e of a.get(t)??[]){let t=s(e,r);t>n.get(e)&&n.set(e,t);let i=o.get(e)-1;o.set(e,i),i===0&&c.push(e)}}if(l.size<e.length){let t=i.filter(e=>!l.has(e.to));for(let r=e.length;r>0;r--){let e=!1;for(let r of t){let t=s(r.to,n.get(r.from));t>n.get(r.to)&&(n.set(r.to,t),e=!0)}if(!e)break}}let u=t.outcomeId;if(u!==void 0&&n.has(u)&&!r.has(u)&&(a.get(u)?.length??0)===0){let e=-1/0;for(let t of n.values())t>e&&(e=t);n.set(u,e)}return n}function qt(e,t){let n=new Map(e.map(e=>[e.id,0])),r=new Map(e.map(e=>[e.id,0])),i=new Map,a=0;for(let o of e)for(let e of t.get(o.id)??[]){if(e===o.id||!n.has(e))continue;let t=i.get(e);t===void 0?i.set(e,[o.id]):t.push(o.id),r.set(o.id,r.get(o.id)+1),a++}if(a===0)return n;let o=e.filter(e=>r.get(e.id)===0).map(e=>e.id);for(let e=0;e<o.length;e++){let t=o[e],a=n.get(t);for(let e of i.get(t)??[]){a+1>n.get(e)&&n.set(e,a+1);let t=r.get(e)-1;r.set(e,t),t===0&&o.push(e)}}return n}function Jt(e,t){let n=new Map,r=new Set,i=[],a=new Set;for(let o of e){if(n.has(o.id))continue;i.length=0,a.clear();let e=o,s=0,c=!1;for(;;){let o=e.parentId===void 0?void 0:t.get(e.parentId);if(o===void 0){n.set(e.id,null);break}if(i.push(e),a.add(e.id),n.has(o.id)){c=r.has(o.id),s=n.get(o.id)??0;break}if(a.has(o.id)){c=!0;break}e=o}if(c)for(let e of i)n.set(e.id,null),r.add(e.id);else for(let e=i.length-1;e>=0;e--)n.set(i[e].id,++s)}return n}function Yt(e,t){let n=new Map(e.nodes.map(e=>[e.id,e])),r=Jt(e.nodes,n),i=e.nodes.filter(e=>r.get(e.id)===null),a=e.nodes.filter(e=>r.get(e.id)!==null).sort((e,t)=>r.get(e.id)-r.get(t.id)||e.id.localeCompare(t.id)),o=t?.expandedIds,s=t?.previous,c=new Map,l=Kt(i,e),u=new Set(i.map(e=>e.id)),d=new Set;for(let e of a){let t=e.parentId;o?.has(t)===!0&&(u.has(t)||d.has(t))&&d.add(e.id)}let f=new Map,p=e=>f.get(e)??zt;for(let e=a.length-1;e>=0;e--){let t=a[e];if(!d.has(t.id))continue;let n=p(t.id),r=f.get(t.parentId);f.set(t.parentId,{rows:(r?.rows??0)+n.rows,reach:Math.max(r?.reach??0,kt+n.reach)})}let m=new Map,h=new Map;for(let e of a){let t=h.get(e.parentId)??0;m.set(e.id,t),h.set(e.parentId,t+p(e.id).rows)}let g=new Map;for(let t of e.edges)!u.has(t.from)||!u.has(t.to)||(g.has(t.to)||g.set(t.to,[]),g.get(t.to).push(t.from));let _=new Map;for(let e of i){let t=l.get(e.id),n=_.get(t);n===void 0?_.set(t,[e]):n.push(e)}let v=[..._.keys()].sort((e,t)=>e-t),y=t?.viewport??ue,b=Gt(v,v.map(e=>Bt(_.get(e),p)),y),x=new Map;for(let e of v){let t=_.get(e),n=qt(t,g),r=t.map((e,t)=>{let r=(g.get(e.id)??[]).map(e=>c.get(e)?.y).filter(e=>e!==void 0);return{n:e,bary:r.length?r.reduce((e,t)=>e+t,0)/r.length:s?.get(e.id)?.y??t*Tt,rank:n.get(e.id)}});r.sort((e,t)=>e.rank-t.rank||e.bary-t.bary||e.n.id.localeCompare(t.n.id));let i=b.startOf.get(e),a=b.splitOf.get(e),o=[],l=[];r.forEach((e,t)=>{let n=Math.floor(t/a);o.push(l[n]??0),l[n]=(l[n]??0)+p(e.n.id).rows}),r.forEach((e,t)=>{let n=Math.floor(t/a),r=i+n,s=Math.floor(r/b.perBand),u=p(e.n.id).rows;x.set(e.n.id,s),c.set(e.n.id,{x:b.columnX[r],y:b.centreY[s]+(o[t]+(u-1)/2-(l[n]-1)/2)*Tt})})}for(let e of a){let t=e.parentId,n=c.get(t);if(x.set(e.id,x.get(t)??0),d.has(e.id)){let r=p(e.id).rows,i=h.get(t);c.set(e.id,{x:n.x+kt,y:n.y+(m.get(e.id)+(r-1)/2-(i-1)/2)*Dt})}else c.set(e.id,{x:n.x,y:n.y})}if(d.size>0){let e=[...i,...a.filter(e=>d.has(e.id))],t=e.map(e=>{let t=c.get(e.id);return{x:t.x-100,y:t.y-fe/2,w:200,h:fe}});Ct(t,Et),e.forEach((e,n)=>{c.set(e.id,{x:t[n].x+100,y:t[n].y+fe/2})});for(let e of a){if(d.has(e.id))continue;let t=c.get(e.parentId);c.set(e.id,{x:t.x,y:t.y})}}let S=1/0,C=1/0,w=-1/0,T=-1/0;for(let e of c.values())S=Math.min(S,e.x-100),C=Math.min(C,e.y-32),w=Math.max(w,e.x+100),T=Math.max(T,e.y+32);let E=c.size===0,D=E?0:56-S,O=E?0:56-C,k=new Map;for(let t of e.nodes){let e=c.get(t.id);k.set(t.id,{x:e.x+D-100,y:e.y+O-32,w:200,h:64,face:`card`,...r.get(t.id)!==null&&!d.has(t.id)?{folded:!0}:{}})}let A=e=>u.has(e)||d.has(e),j=E?56:w+D,M=e.edges.filter(e=>A(e.from)&&A(e.to)).map(e=>{let t=k.get(e.from),n=k.get(e.to),r=x.get(e.from)??0,i=x.get(e.to)??0,a=r===i?-1:Math.max(r,i)-1;return{e,from:t,to:n,gutter:a,vertical:a<0&&n.x<=t.x&&Math.abs(n.y-t.y)>1}}),N=new Map,P=new Map,F=new Map,I=(e,t)=>void e.set(t,(e.get(t)??0)+1);for(let e of M)e.gutter>=0&&I(N,e.gutter),!e.vertical&&(I(P,e.e.to),I(F,e.e.from));let L=new Map,R=new Map,z=new Map,B=(e,t,n)=>e.y+e.h/2+(n-(t-1)/2)*Math.min(Pt,e.h/(t+1)),V=[];for(let{e,from:t,to:n,gutter:r,vertical:i}of M){let a;if(i){let e=t.x+t.w/2,r=n.x+n.w/2,i=n.y>t.y,o=i?t.y+t.h:t.y,s=i?n.y:n.y+n.h,c=(o+s)/2;a=`M ${J(e)} ${J(o)} C ${J(e)} ${J(c)} ${J(r)} ${J(c)} ${J(r)} ${J(s)}`}else{let i=z.get(e.from)??0,o=R.get(e.to)??0;z.set(e.from,i+1),R.set(e.to,o+1);let s=t.x+t.w,c=B(t,F.get(e.from),i),l=n.x,u=B(n,P.get(e.to),o);if(r<0){let e=(s+l)/2;a=`M ${J(s)} ${J(c)} C ${J(e)} ${J(c)} ${J(e)} ${J(u)} ${J(l)} ${J(u)}`}else{let e=N.get(r),t=L.get(r)??0;L.set(r,t+1);let n=Math.min(Nt,(At-32)/Math.max(1,e)),i=b.gutterY[r]+O+(t-(e-1)/2)*n,o=j+jt,d=Math.min(l,56)-jt,f=(o+d)/2;a=`M ${J(s)} ${J(c)} C ${J(o)} ${J(c)} ${J(o)} ${J(i)} ${J(f)} ${J(i)} C ${J(d)} ${J(i)} ${J(d)} ${J(u)} ${J(l)} ${J(u)}`}}V.push({id:e.id,d:a,className:`morph-edge`+he(e.kind)+(e.sign===-1?` morph-edge--damp`:``)+(e.provisional?` morph-edge--provisional`:``)+(r<0?``:` morph-edge--wrap`),...typeof e.weight==`number`&&Number.isFinite(e.weight)?{width:Lt+Math.min(1,Math.max(0,e.weight))*Rt}:{}})}let H=E?{x:0,y:0,w:112,h:112}:{x:0,y:0,w:w-S+112,h:T-C+112};return{positions:k,edgePaths:V,chrome:{bands:E||b.centreY.length<2?[]:b.centreY.map((e,t)=>{let n=Math.max(H.y,e-b.height[t]/2+O-Mt),r=Math.min(H.y+H.h,e+b.height[t]/2+O+Mt);return{id:`reading-band:${t}`,x:56-Mt,y:n,w:j-56+40,h:Math.max(0,r-n),className:`morph-reading-band`}}),paths:[],labels:[]},bbox:H}}var Xt=(e,t)=>({rep:`graph`,...Yt(e,t)}),Zt=920,Qt=16,$t=44+Qt,en=12,tn=8,nn=12;function rn(e){if(!e.date||!Number.isFinite(e.date.start))return null;let t=Y(e.date.start),n=e.date.end;return{node:e,startYear:t,...n!==void 0&&Number.isFinite(n)&&n>e.date.start?{endYear:Y(n)}:{}}}var an=e=>rn(e)!==null;function on(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r.nodes){let r=rn(e);r&&(t=Math.min(t,r.startYear),n=Math.max(n,r.endYear??r.startYear))}return t===1/0?null:Ae(t,n,6)}function sn(e){let t=1;for(;t<e;)t*=2;let n=Array(t*2).fill(1/0),r=0;return(e,i)=>{let a=1;if(n[1]<=i)for(;a<t;)a=n[a*2]<=i?a*2:a*2+1;else a=t+r++;let o=a-t;for(n[a]=e;a>1;)a>>=1,n[a]=Math.min(n[a*2],n[a*2+1]);return o}}function cn(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=rn(n);e&&t?r.push(e):i.push(n)}r.sort((e,t)=>e.startYear-t.startYear||e.node.id.localeCompare(t.node.id));let a=new Map,o={bands:[],paths:[],labels:[]},s=[],c=1/0,l=-1/0,u=56;if(r.length>0&&t){let n=g(t.domain,[56,56+Zt]),i=sn(r.length);for(let e of r){let t=n(e.startYear),r=e.endYear===void 0?t:n(e.endYear),s=e.endYear===void 0?t-80:t,d=Math.min(s,t)-32,f=Math.max(s+160,r)+32,p=56+i(f+nn,d)*$t;a.set(e.node.id,{x:s,y:p,w:160,h:44,face:`entry`}),e.endYear!==void 0&&o.bands.push({id:`period:${e.node.id}`,x:t,y:p-6,w:Math.max(r-t,2),h:56,className:`morph-period`}),c=Math.min(c,d),l=Math.max(l,f),u=Math.max(u,p+44)}let d=u+Qt+en;o.paths.push({id:`axis`,d:`M ${J(56)} ${J(d)} L ${J(56+Zt)} ${J(d)}`,className:`morph-axis`}),t.ticks.forEach((e,t)=>{let r=n(e.year);o.paths.push({id:`tick:${t}`,d:`M ${J(r)} ${J(d)} L ${J(r)} ${J(d+tn)}`,className:`morph-tick`}),o.labels.push({id:`tick-label:${t}`,x:r,y:d+tn+16,text:e.text,className:`morph-axis-label`,anchor:`middle`}),c=Math.min(c,r-e.text.length*3.5),l=Math.max(l,r+e.text.length*3.5)}),c=Math.min(c,56),l=Math.max(l,56+Zt),u=d+tn+20;let f=new Set(r.map(e=>e.node.id));for(let t of e.edges){if(t.from===t.to||!f.has(t.from)||!f.has(t.to))continue;let e=a.get(t.from),n=a.get(t.to),r=e.x+e.w/2,i=n.x+n.w/2,o=e.y,c=n.y,l=Math.min(72,Math.max(20,Math.abs(i-r)*.2));s.push({id:t.id,d:`M ${J(r)} ${J(o)} C ${J(r)} ${J(o-l)} ${J(i)} ${J(c-l)} ${J(i)} ${J(c)}`,className:`morph-edge morph-edge--faint`+he(t.kind)})}}let d=Q(i,c===1/0?{x:0,y:0,w:112,h:112}:{x:c-56,y:0,w:l-c+112,h:u+56},`${i.length} with no date — the timeline cannot place these`,n);d.band&&o.bands.push(d.band);for(let[e,t]of d.positions)a.set(e,t);return{positions:a,edgePaths:s,chrome:o,bbox:d.bbox}}var ln=(e,t)=>({rep:`timeline`,...cn(e,on([e]),t?.viewport??ue)}),un={min:me,max:2.2},dn=56,fn=1300,pn=1300,mn=.7,hn=120,gn=120,_n=[`graph`,`flow`,`timeline`,`chart`],vn={graph:Xt,timeline:ln,chart:ft,flow:xt},yn={graph:`What caused what`,timeline:`The same causes, in time`,chart:`How much each one moved`,flow:`How much each one contributed`},bn={graph:()=>!0,timeline:an,chart:ot,flow:bt},xn=2,Sn=1/3;function Cn(e,t){let n=t.nodes.filter(e=>e.parentId===void 0);if(n.length===0)return!1;let r=n.filter(n=>bn[e](n,t)).length;return r>=Math.min(xn,n.length)&&r/n.length>=Sn}var wn=e=>({x:0,y:0,w:e.w,h:e.h}),Tn=(e,t,n)=>[t-e.x,n-e.y];function En(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]=Tn(e.bbox,i-hn,a-hn);return{x:c,y:l,w:o-i+240,h:s-a+240}}function Dn(e){let{world:t,onAscend:n,driverId:r,insetBottom:i}=e,[a,o]=(0,U.useState)(e.initialRep??`graph`),[s,c]=(0,U.useState)(()=>new Set),[l,u]=(0,U.useState)(null),d=p({clamp:un,margin:dn,...i===void 0?{}:{insetBottom:i}}),m=(0,U.useRef)(void 0),{viewport:h}=d,g=(0,U.useMemo)(()=>h?{w:Math.max(1,h.w-112),h:Math.max(1,h.h-112)}:void 0,[h]),_=(0,U.useMemo)(()=>vn[a](t,{expandedIds:s,previous:m.current,...g?{viewport:g}:{}}),[a,t,s,g]);(0,U.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,U.useRef)(a);v.current=a;let y=(0,U.useRef)(_);y.current=_;let b=(0,U.useRef)(d.camera);b.current=d.camera;let x=(0,U.useRef)(s);x.current=s;let S=(0,U.useRef)(n);S.current=n;let[C,w]=(0,U.useState)(null),{endFlight:T}=d,E=(0,U.useCallback)(()=>{w({layout:y.current,rep:v.current,expandedIds:x.current}),T()},[T]),O=(0,U.useRef)(0),k=(0,U.useRef)(void 0);(0,U.useEffect)(()=>()=>clearTimeout(k.current),[]);let A=(0,U.useCallback)(e=>{if(e===v.current)return;let t=++O.current;u({layout:y.current,token:t}),clearTimeout(k.current),k.current=setTimeout(()=>{t===O.current&&u(null)},fn),v.current=e,o(e)},[]),j=(0,U.useCallback)(e=>{e===O.current&&(clearTimeout(k.current),u(null))},[]),M=(0,U.useRef)(null),N=(0,U.useCallback)(e=>{let t=new Set(x.current);t.delete(e)||(t.add(e),M.current=e),c(t)},[]),P=(0,U.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}=d;(0,U.useEffect)(()=>{let e=M.current;if(M.current=null,e!==null){let t=En(_,e,P);if(t){F(t);return}}F(wn(_.bbox))},[_,P,F,I,L]);let R=(0,U.useMemo)(()=>new Map(t.nodes.map(e=>[e.id,e.parentId])),[t]),z=(0,U.useMemo)(()=>{let e=new Set;for(let t of R.values())t!==void 0&&e.add(t);return e},[R]),B=(0,U.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]),{zoomAtClient:V}=d,H=(0,U.useCallback)((e,t,n,r)=>{if(e>=1)return r!==void 0&&z.has(r)&&!x.current.has(r)?(N(r),`expand`):(V(e,t,n),`zoom`);let i=L.current?.getBoundingClientRect();if(Xe(`out`,!!i&&(i.width>0||i.height>0)&&f(b.current,wn(y.current.bbox),{w:i.width,h:i.height},dn,un))===`zoom-camera`)return V(e,t,n),`zoom`;let a=[...x.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 S.current?.(),`ascend`},[z,N,V,L,B]),W=(0,U.useCallback)(e=>{let t=y.current,n=e===null?void 0:t.positions.get(e);if(!n||n.folded){F(wn(t.bbox));return}let[r,i]=Tn(t.bbox,n.x-gn,n.y-gn);F({x:r,y:i,w:n.w+240,h:n.h+240})},[F]);(0,U.useEffect)(()=>{if(r!==void 0)return D(r,{count:_n.length,setIndex:e=>A(_n[Math.min(_n.length-1,Math.max(0,Math.trunc(e)))]),spokenFor:()=>void 0,captionFor:e=>{let t=_n[e];return t?yn[t]:void 0}})},[r,A]);let G=C?.layout!==_||d.flying;return(0,U.useEffect)(()=>{if(!G)return;let e=setTimeout(E,pn);return()=>clearTimeout(e)},[G,_,E]),{rep:a,setRep:A,layout:_,exiting:l,settleExit:j,expandedIds:s,toggleExpand:N,cam:d,morphing:G,settle:E,lod:d.camera.scale>=mn?`near`:`far`,pinch:H,focusNode:W}}function On({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,G.jsxs)(`label`,{className:`viz-ctl`,style:{"--ctl-c":s,"--ctl-pct":l+`%`},children:[(0,G.jsx)(`span`,{className:`viz-ctl-label`,children:e}),(0,G.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,G.jsx)(`span`,{className:`viz-ctl-val tab-num`,children:o?o(i):i.toLocaleString()})]})}var kn=`No cause is established yet, so there is nothing to push on.`;function An(e){let t=(0,W.c)(17),{levers:n,onSet:r,onReset:i}=e,a;t[0]===n?a=t[1]:(a=n.every(Mn),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.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,G.jsxs)(`div`,{className:`tr-levers-head`,children:[s,(0,G.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,G.jsx)(`p`,{className:`tr-levers-empty`,children:kn}),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,G.jsx)(On,{label:e.label,min:0,max:100,value:e.pct,onChange:t=>r(e.id,t),format:jn},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,G.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 jn(e){return`${e}%`}function Mn(e){return e.pct===100}var Nn=(0,U.memo)(An),Pn=(0,U.createContext)(null);function Fn(){return(0,U.useContext)(Pn)}function In(e){let t=(0,W.c)(19),{id:n,className:r}=e,i=Fn(),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,G.jsx)(`span`,{className:`${d} tr-num-qual`,"data-status":`structure`,children:e.resolution.raw});break bb0}a=`button`,o=d,s=ee(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=x(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,G.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,G.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 Ln=8,Rn=6;function zn(e,t,n){return Math.max(Ln,Math.min(e,n-t-Ln))}function Bn(e,t,n){if(!(e.width>0||e.height>0||e.left>0||e.top>0))return{left:zn((n.w-t.w)/2,t.w,n.w),top:zn((n.h-t.h)/2,t.h,n.h)};let r=e.bottom+Rn,i=e.top-Rn-t.h,a=r+t.h+Ln>n.h&&i>=Ln;return{left:zn(e.left,t.w,n.w),top:zn(a?i:r,t.h,n.h)}}var Vn=320,Hn=340,Un=8;function Wn(e){let t=(0,W.c)(64),{registry:n,valueId:r,anchorRect:i,trail:a,hinted:o,onMarkHinted:s,onDrill:c,onBack:l,onNavigate:u,onDismiss:f}=e,p=(0,U.useRef)(null),m;t[0]===f?m=t[1]:(m={onEscape:f},t[0]=f,t[1]=m),d(p,m);let[h]=(0,U.useState)(!o),g,_;t[2]===s?(g=t[3],_=t[4]):(g=()=>s(),_=[s],t[2]=s,t[3]=g,t[4]=_),(0,U.useEffect)(g,_);let v=(0,U.useRef)(!0),y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{v.current||p.current?.focus({preventScroll:!0}),v.current=!1},t[5]=y):y=t[5];let w;t[6]===r?w=t[7]:(w=[r],t[6]=r,t[7]=w),(0,U.useEffect)(y,w);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,U.useEffect)(D,O);let k=n.values,A,j,M,N,P,F,I,L,R,z,B,V,H,K;if(t[11]!==i||t[12]!==l||t[13]!==c||t[14]!==u||t[15]!==n.usedIn||t[16]!==n.values||t[17]!==a||t[18]!==r){V=Symbol.for(`react.early_return_sentinel`);bb0:{if(K=k.get(r),!K){V=null;break bb0}let e=ee(K),o=K.scope,s=n.usedIn.get(r)??[],d=K.kind===`grounded`?K.resolution.receipt:null,f=K.kind===`grounded`&&K.resolution.tier===`T1`,m=d?.url?T(d.url):null,h=d?d.host??(d.url?E(d.url):null):null,g=K.kind===`calculated`?K.calc.inputs:[],_=g.slice(0,Un),v=g.length-_.length,y;t[33]!==n.values||t[34]!==a?(y=a.length>0?n.values.get(a[a.length-1]):void 0,t[33]=n.values,t[34]=a,t[35]=y):y=t[35];let w=y,D;t[36]===i?D=t[37]:(D=Bn(i,{w:Vn,h:Hn},{w:window.innerWidth,h:window.innerHeight}),t[36]=i,t[37]=D);let{left:O,top:U}=D;H=p,A=`tr-card`,j=`dialog`,M=`false`,N=`Where ${K.label} came from`,P=-1,t[38]!==O||t[39]!==U?(F={left:O,top:U,width:Vn,maxHeight:Hn},t[38]=O,t[39]=U,t[40]=F):F=t[40];let W;t[41]!==l||t[42]!==w?(W=w&&(0,G.jsxs)(`button`,{type:`button`,className:`tr-back`,onClick:l,"aria-label":`Back to ${w.label}`,children:[`‹ back`,(0,G.jsxs)(`span`,{className:`tr-back-to`,children:[` to `,w.label]})]}),t[41]=l,t[42]=w,t[43]=W):W=t[43],I=(0,G.jsxs)(`header`,{className:`tr-head`,children:[W,(0,G.jsx)(`span`,{className:`tr-badge`,"data-status":e,children:C[e]}),(0,G.jsx)(`p`,{className:`tr-figure`,children:x(K)}),(0,G.jsx)(`p`,{className:`tr-label`,children:K.label})]}),L=d&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`SOURCE`}),d.quote&&(0,G.jsxs)(`blockquote`,{className:`tr-quote`,children:[`“`,d.quote,`”`]}),f?(0,G.jsx)(`p`,{className:`tr-host`,children:b(d)}):h&&(0,G.jsxs)(`p`,{className:`tr-host`,children:[m?(0,G.jsx)(`a`,{href:m,target:`_blank`,rel:`noreferrer noopener`,children:h}):h,d.date&&(0,G.jsxs)(`span`,{className:`tr-date`,children:[` · `,d.date]})]})]}),R=o&&(o.region||o.period||o.unit)&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`SCOPE`}),(0,G.jsx)(`p`,{className:`tr-chips`,children:[o.region,o.period,o.unit].filter(Kn).map(Gn)})]}),z=K.kind===`calculated`&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`CALCULATION`}),(0,G.jsx)(`p`,{className:`tr-formula`,children:S(K.calc.formula,e=>n.values.get(e)?.label)}),(0,G.jsx)(`ul`,{className:`tr-inputs`,children:_.map(e=>{let t=n.values.get(e);return(0,G.jsx)(`li`,{children:t?(0,G.jsxs)(`button`,{type:`button`,className:`tr-input`,onClick:()=>c(e),children:[(0,G.jsx)(`span`,{className:`tr-input-label`,children:t.label}),(0,G.jsx)(`span`,{className:`tr-input-val`,children:x(t)})]}):(0,G.jsx)(`span`,{className:`tr-input tr-input-missing`,children:e})},e)})}),v>0&&(0,G.jsxs)(`p`,{className:`tr-more`,children:[`…and `,v,` more`]}),K.calc.note&&(0,G.jsx)(`p`,{className:`tr-note`,children:K.calc.note})]}),B=s.length>0&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`USED IN`}),(0,G.jsx)(`ul`,{className:`tr-used`,children:s.map(e=>(0,G.jsx)(`li`,{children:u?(0,G.jsx)(`button`,{type:`button`,className:`tr-usedin`,onClick:()=>u(e),children:e.label}):(0,G.jsx)(`span`,{className:`tr-usedin tr-usedin-flat`,children:e.label})},`${e.surface}:${e.id}:${e.label}`))})]})}t[11]=i,t[12]=l,t[13]=c,t[14]=u,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]=K}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],K=t[32];if(V!==Symbol.for(`react.early_return_sentinel`))return V;let te;t[44]!==K.kind||t[45]!==K.resolution?(te=K.kind===`illustrative`&&(0,G.jsxs)(`p`,{className:`tr-caveat`,children:[`Illustrative — shows the shape, not a measured fact. `,K.resolution.illustrative]}),t[44]=K.kind,t[45]=K.resolution,t[46]=te):te=t[46];let q;t[47]===h?q=t[48]:(q=h&&(0,G.jsx)(`p`,{className:`tr-hint`,children:`Any figure like this one opens its own receipt.`}),t[47]=h,t[48]=q);let ne;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]!==te||t[61]!==q||t[62]!==H?(ne=(0,G.jsxs)(`div`,{ref:H,className:A,role:j,"aria-modal":M,"aria-label":N,tabIndex:P,style:F,children:[I,L,R,z,B,te,q]}),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]=te,t[61]=q,t[62]=H,t[63]=ne):ne=t[63],ne}function Gn(e){return(0,G.jsx)(`span`,{className:`tr-chip`,children:e},e)}function Kn(e){return!!e}function qn(e){let t=(0,W.c)(23),{registry:n,onNavigate:r,children:i,ref:a}=e,[o,s]=(0,U.useState)(null),[c,l]=(0,U.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,U.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,U.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(Jn)},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,G.jsx)(Wn,{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,G.jsxs)(Pn.Provider,{value:T,children:[i,E]}),t[19]=i,t[20]=E,t[21]=T,t[22]=D):D=t[22],D}function Jn(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 Yn=`Recomputed locally from the causes above — a model of what would happen, never an observation.`,Xn=`What was actually measured. This column never moves when a lever is pulled.`;function Zn(e,t){return(e>0?`+`:``)+m(e,t)}function Qn(e){return e!==null&&Number.isFinite(e)&&e>=0&&e<=1}function $n(e){return e.exactBase===null?`nothing measured stands behind this outcome`:`not every step is grounded, so the total stays unmeasured`}function er(e){let t=(0,W.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?m(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,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{className:`tr-chip tr-wi-chip`,title:Xn,children:`OBSERVED`}),t[4]=d):d=t[4];let f;t[5]!==n||t[6]!==c||t[7]!==o?(f=(0,G.jsxs)(`div`,{className:`tr-wi-col`,children:[d,c===null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}),(0,G.jsx)(`p`,{className:`tr-wi-note tr-wi-why`,children:o??$n(n)})]}):(0,G.jsx)(`p`,{className:`tr-wi-figure`,children:c})]}),t[5]=n,t[6]=c,t[7]=o,t[8]=f):f=t[8];let p;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?(p=a&&(0,G.jsxs)(`div`,{className:`tr-wi-col tr-wi-hypo`,"data-world":`hypothetical`,children:[(0,G.jsx)(`span`,{className:`tr-chip tr-wi-chip tr-wi-chip-hypo`,title:Yn,children:`HYPOTHETICAL (MODELED)`}),r.fullyGrounded&&l!==null&&r.exactDelta!==null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure`,children:m(l+r.exactDelta,i)}),(0,G.jsx)(`p`,{className:`tr-wi-delta`,children:Zn(r.exactDelta,i)}),Qn(r.explainedPct)&&(0,G.jsxs)(`p`,{className:`tr-wi-note`,children:[Math.round(r.explainedPct*100),`% explained`]})]}):r.relCur===null?(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-phrase`,children:ne(r.relBase??0,r.relCur)}),(0,G.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]=p):p=t[17];let h;return t[18]!==u||t[19]!==f||t[20]!==p?(h=(0,G.jsxs)(`div`,{className:`tr-wi`,"data-active":u,children:[f,p]}),t[18]=u,t[19]=f,t[20]=p,t[21]=h):h=t[21],h}var tr=(0,U.memo)(er);function nr(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 rr(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 ir(e){return{center:e.title,outcomeId:e.outcomeId,nodes:e.nodes.map(nr),edges:e.edges.map(rr),provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...e.provenance.notes?.length?{notes:e.provenance.notes}:{}}}}var ar=e=>`node:${e}`,or=(e,t)=>`node:${e}@${t}`;function sr(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=ar(e.id);l(R(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=or(e.id,t.t),a=R(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 se(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:ar(t),surface:`edge`,id:i,label:r})}}),{title:e.title,entities:r,relations:a,facts:i,trust:z(o,s),outcomeId:e.outcomeId,...n?{illustrative:n}:{}}}var cr=1100;function lr(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=O(t.say),o=n.speakLine?.(t.say)??null,s=o?await j(o):!1;if(n.isCancelled()){a(`cancelled`);return}n.apply(t,r),o&&s?await k(o,i,cr):await A(i)}a(n.isCancelled()?`cancelled`:`complete`)})()}function ur({beats:e,apply:t,speakLine:n}){let[r,i]=(0,U.useState)(-1),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(0),c=(0,U.useRef)(e);c.current=e;let l=(0,U.useRef)(t);l.current=t;let u=(0,U.useRef)(n);u.current=n;let d=(0,U.useCallback)(()=>{s.current+=1,o(!1)},[]),f=(0,U.useCallback)(e=>{let t=s.current+=1;o(!0),lr(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,U.useEffect)(()=>()=>void(s.current+=1),[]),(0,U.useEffect)(()=>{s.current+=1,o(!1),i(-1)},[e]);let p=(0,U.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,U.useCallback)(e=>{let t=c.current.length;t!==0&&f(Math.min(Math.max(e,0),t-1))},[f]),h=(0,U.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 dr(e){let t=(0,W.c)(28),{count:n,index:r,playing:i,caption:a,expanded:o,onToggle:s,onSeek:c}=e;if(n===0)return null;let l=Math.min(Math.max(r,-1),n-1),u=i?``:void 0,d=o?``:void 0,f=`${o?108:54}px`,p;t[0]===f?p=t[1]:(p={"--wo-transport-h":f},t[0]=f,t[1]=p);let m=p,h=i?`Pause the walkthrough`:`Walk me through it`,g=i?`❙❙`:`▶`,_;t[2]===g?_=t[3]:(_=(0,G.jsx)(`span`,{className:`wo-play-glyph`,"aria-hidden":`true`,children:g}),t[2]=g,t[3]=_);let v=i?`Pause`:`Walk me through it`,y;t[4]===v?y=t[5]:(y=(0,G.jsx)(`span`,{className:`wo-play-label`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==s||t[7]!==y||t[8]!==h||t[9]!==_?(b=(0,G.jsxs)(`button`,{type:`button`,className:`wo-play`,onClick:s,"aria-label":h,children:[_,y]}),t[6]=s,t[7]=y,t[8]=h,t[9]=_,t[10]=b):b=t[10];let x;t[11]!==l||t[12]!==n||t[13]!==o||t[14]!==c?(x=o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`wo-track`,role:`group`,"aria-label":`Walkthrough beats`,children:Array.from({length:n},(e,t)=>(0,G.jsx)(`button`,{type:`button`,className:`wo-tick`,"data-state":t<l?`past`:t===l?`now`:`ahead`,onClick:()=>c(t),"aria-label":`Beat ${t+1} of ${n}`,"aria-current":t===l?`step`:void 0},t))}),(0,G.jsxs)(`span`,{className:`wo-transport-count`,"aria-hidden":`true`,children:[l<0?n:l+1,`/`,n]})]}),t[11]=l,t[12]=n,t[13]=o,t[14]=c,t[15]=x):x=t[15];let S;t[16]!==b||t[17]!==x?(S=(0,G.jsxs)(`div`,{className:`wo-transport-row`,children:[b,x]}),t[16]=b,t[17]=x,t[18]=S):S=t[18];let C;t[19]!==a||t[20]!==o?(C=o&&(0,G.jsx)(`p`,{className:`wo-caption`,"aria-live":`polite`,children:a===null?``:M(a)}),t[19]=a,t[20]=o,t[21]=C):C=t[21];let w;return t[22]!==u||t[23]!==S||t[24]!==C||t[25]!==d||t[26]!==m?(w=(0,G.jsxs)(`div`,{className:`wo-transport`,"data-playing":u,"data-open":d,style:m,children:[S,C]}),t[22]=u,t[23]=S,t[24]=C,t[25]=d,t[26]=m,t[27]=w):w=t[27],w}var fr=170,pr={contributes:`fed by`,causes:`driven by`,dampens:`held back by`,enables:`made possible by`,correlates:`moving together with`},mr={1:`pushed up by`,[-1]:`pushed down by`};function hr(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 gr={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.`};function _r(e,t){let n=e.values.get(ar(t));if(!n||n.kind===`structure`)return null;let r=x(n);return n.kind===`illustrative`?{say:`Illustratively, about ${r}.`,shown:`Illustratively, about ${r}.`}:{say:`Measured at ${r}.`,shown:`Measured at ${r}.`}}function vr(e){return e.kind?e.kind===`dampens`||e.kind===`enables`||e.kind===`correlates`:e.sign===-1}function yr(e){return e.kind&&pr[e.kind]?pr[e.kind]:mr[e.sign??1]??`fed by`}function br(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 xr(e,t,n,r={}){let i=br(t);if(i.length<2)return[];let c=new Map(e.nodes.map(e=>[e.id,e])),l=new Map(t.nodes.map(e=>[e.id,e.label])),u=new Map(i.map((e,t)=>[e,t])),d=e=>t.edges.filter(t=>t.to===e&&u.has(t.from)&&(u.get(t.from)??0)<(u.get(e)??0)).sort((e,t)=>(t.weight??0)-(e.weight??0)||(e.id<t.id?-1:1))[0],f=[],p=i.at(-1)===e.outcomeId?i.length-1:i.length,m=p===1?`One cause, one outcome. Here is how it connects.`:`${p} causes, one outcome. Here is how they connect.`;f.push({nodeId:e.outcomeId,wide:!0,rep:`graph`,say:m,caption:m});let h=null;for(let[t,r]of i.entries()){let u=c.get(r),p=l.get(r)??r,m=d(r),g=r===e.outcomeId&&t===i.length-1,_=m?l.get(m.from)??m.from:null,v;v=g?m?`And it ends here: ${hr(p)}, ${yr(m)} ${m.from===h?`it`:hr(_??``)}.`:`And it ends here: ${hr(p)}.`:m?m.from===h?vr(m)?`Then ${hr(p)}, ${yr(m)} it.`:`Then ${hr(p)}.`:`${p}, ${yr(m)} ${hr(_??``)}.`:t===0?`It starts with ${hr(p)}.`:`Alongside it: ${p}.`,h=r;let y=[v],b=[v],x=_r(n,r);x&&(y.push(x.say),b.push(x.shown));let S=u?.detail;S&&(y.push(s(a(S),fr)),b.push(s(o(S),fr))),f.push({nodeId:r,...m?{edgeId:m.id}:{},say:y.join(` `),caption:b.join(` `)})}if(r.closeOn){let t=gr[r.closeOn];f.push({nodeId:e.outcomeId,wide:!0,rep:r.closeOn,say:t,caption:t})}return f}r();var Sr=[{rep:`graph`,label:`Graph`},{rep:`flow`,label:`Contribution`},{rep:`timeline`,label:`Over time`},{rep:`chart`,label:`As a chart`}],Cr={graph:`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.`,timeline:`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.`,chart:`Each mark is a cause plotted against its own measured history. Causes with nothing measured are held aside rather than drawn at zero.`,flow:`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.`},wr=`an illustrative world measures nothing, so there is no baseline`;function Tr(e,t){for(let n of e){if(n.id===t)return n.children;let e=n.children===void 0?void 0:Tr(n.children,t);if(e)return e}}function Er(e){let{value:t,...n}=e;return n}function Dr(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 Or(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 kr(e){let t=(0,W.c)(12),{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,G.jsx)(jr,{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=r??``,f=i===!0,p;return t[7]!==o||t[8]!==a||t[9]!==d||t[10]!==f?(p=(0,G.jsx)(Ar,{title:d,failed:f,onRetry:a,onClose:o}),t[7]=o,t[8]=a,t[9]=d,t[10]=f,t[11]=p):p=t[11],p}function Ar(e){let t=(0,W.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,G.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,G.jsxs)(`div`,{className:`wo-title`,children:[s,(0,G.jsx)(`h2`,{children:n})]}),t[1]=n,t[2]=c);let l;t[3]===a?l=t[4]:(l=a&&(0,G.jsx)(`div`,{className:`wo-head-actions`,children:(0,G.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:a,"aria-label":`Close`,children:`✕`})}),t[3]=a,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,G.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,G.jsx)(`div`,{className:`wo-shell`,role:`status`,"aria-live":`polite`,children:r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`wo-shell-line`,children:`This world didn’t come back.`}),(0,G.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,G.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:i,children:`Try again`})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`wo-shell-pulse`,"aria-hidden":`true`}),(0,G.jsx)(`p`,{className:`wo-shell-line`,children:`Building this world…`}),(0,G.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,G.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,G.jsx)(`section`,{className:`wo-scrim`,"aria-label":o,children:f}),t[14]=o,t[15]=f,t[16]=p):p=t[16],p}function jr({spec:e,view:t,onClose:n,onExpandNode:r,autoWalk:a,speakLine:o}){let[s,d]=(0,U.useState)(()=>new Map),[f,p]=(0,U.useState)(null),m=(0,U.useMemo)(()=>{if(s.size===0)return e;let t=e;for(let[e,n]of s)t=F(t,e,n);return t},[e,s]),h=m.provenance.illustrative===!0,g=(0,U.useMemo)(()=>le(m),[m]),_=(0,U.useMemo)(()=>sr(m,g),[m,g]),v=_.trust,y=(0,U.useMemo)(()=>ir(m),[m]),[b,x]=(0,U.useState)(()=>new Map),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(!1),E=(0,U.useMemo)(()=>[...b.values()].some(e=>e!==100),[b]),D=(0,U.useMemo)(()=>[...b].map(([e,t])=>({nodeId:e,pct:t/100})),[b]),O=(0,U.useMemo)(()=>H(y,[]),[y]),k=(0,U.useMemo)(()=>H(y,D),[y,D]),A=(0,U.useMemo)(()=>E?Dr(O,k):null,[E,O,k]),j=(0,U.useDeferredValue)(A),M=(0,U.useCallback)(e=>Cn(e,g),[g]),P=t&&M(t)?t:void 0,R=Dn({world:g,insetBottom:w?108:54,...P?{initialRep:P}:{}}),{rep:z,setRep:W,expandedIds:ee,toggleExpand:K}=R;(0,U.useEffect)(()=>{P&&W(P)},[P,W]);let te=(0,U.useMemo)(()=>{let e=g.nodes.map(e=>{let t=Er(e),n=j?.get(e.parentId??e.id),r=N(e.label);return{...t,label:r,...n===void 0?{}:{shift:n}}});return{...g,nodes:e}},[g,j]),q=(0,U.useMemo)(()=>{let e=new Map,t=n=>{e.set(n.id,n);for(let e of n.children??[])t(e)};for(let e of m.nodes)t(e);return e},[m]),ne=(0,U.useMemo)(()=>{let e=se(m.edges);return new Map(g.edges.map((t,n)=>[t.id,e[n]]))},[g,m]),re=(0,U.useMemo)(()=>new Set(g.nodes.map(e=>e.parentId).filter(e=>e!==void 0)),[g]),ae=(0,U.useRef)(null),oe=(0,U.useCallback)(()=>ae.current?.dismiss(),[]),ce=(0,U.useCallback)(e=>{(e.surface===`node`||e.surface===`edge`)&&C({kind:e.surface,id:e.id})},[]),[ue,de]=(0,U.useState)(void 0),fe=M(`timeline`)?`timeline`:void 0,[pe,me]=(0,U.useState)([]);(0,U.useEffect)(()=>{let e=globalThis.requestIdleCallback,t=()=>me(xr(m,g,v,fe?{closeOn:fe}:{}));if(typeof e==`function`){let n=e(t,{timeout:2e3});return()=>globalThis.cancelIdleCallback?.(n)}let n=setTimeout(t,1);return()=>clearTimeout(n)},[m,g,v,fe]);let{focusNode:J}=R,he=(0,U.useCallback)(e=>{e.rep&&W(e.rep),C({kind:`node`,id:e.nodeId}),de(e.edgeId),e.wide?J(null):e.rep||J(e.nodeId)},[J,W]),{index:ge,playing:Y,caption:_e,toggle:ve,seek:ye,reset:be}=ur((0,U.useMemo)(()=>({beats:pe,apply:he,...o?{speakLine:o}:{}}),[pe,he,o]));(0,U.useEffect)(()=>{T(Y||ge>=0)},[Y,ge]);let xe=(0,U.useRef)(!1);(0,U.useEffect)(()=>{!a||xe.current||pe.length===0||(xe.current=!0,ve())},[a,pe.length,ve]);let X=(0,U.useCallback)(()=>{be(),de(void 0)},[be]),Se=(0,U.useRef)(n);Se.current=n;let Ce=(0,U.useRef)(ve);Ce.current=ve;let we=(0,U.useRef)(X);we.current=X,(0,U.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){we.current(),Se.current?.();return}(e.key===` `||e.key===`Spacebar`)&&(e.target?.closest(`button, input, select, textarea, [contenteditable="true"]`)||(e.preventDefault(),Ce.current()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Te=(0,U.useCallback)(e=>{X(),C({kind:`node`,id:e.id})},[X]),Ee=(0,U.useCallback)(e=>{X(),C({kind:`edge`,id:e})},[X]),De=(0,U.useCallback)((e,t)=>{X(),x(n=>new Map(n).set(e,t))},[X]),Oe=(0,U.useCallback)(()=>{X(),x(new Map)},[X]),ke=(0,U.useCallback)(e=>g.nodes.find(t=>t.id===e)?.parentId===void 0,[g]),Ae=(0,U.useCallback)(e=>{!r||f!==null||(p(e),r(e,m).then(t=>{p(null);let n=t===null?void 0:Tr(t.nodes,e);n?.length&&(d(t=>new Map(t).set(e,n)),ke(e)?K(e):C({kind:`node`,id:e}))},()=>p(null)))},[r,ke,f,m,K]),je=(0,U.useCallback)((e,t)=>{if(t===`entry`&&z===`timeline`){let t=q.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,G.jsx)(`span`,{className:`wo-when`,"data-said":e.dateGrounded?``:void 0,children:a})}if(t!==`card`)return null;let n=ee.has(e.id),i=re.has(e.id),a=e.parentId===void 0,o=!i&&r!==void 0,s=i&&a,c=f===e.id;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(In,{id:ar(e.id),className:`wo-num`}),e.shift!==void 0&&ie(e.shift)!==null&&(0,G.jsx)(`span`,{className:`wo-shift`,"data-dir":e.shift<1?`down`:`up`,children:ie(e.shift)}),(s||o)&&(0,G.jsx)(`button`,{type:`button`,className:`wo-expand`,"aria-expanded":n,"aria-busy":c||void 0,disabled:c||o&&f!==null,"aria-label":`${s&&n?`Fold up`:`Break down`} ${e.label}`,onClick:t=>{t.stopPropagation(),s?K(e.id):Ae(e.id)},children:c?`breaking down…`:s&&n?`fold up`:`break down`})]})},[re,ee,K,r,f,Ae,q,z]),Z=q.get(m.outcomeId),Me=(0,U.useMemo)(()=>Or(O,O,Z?.value,h),[O,Z?.value,h]),Ne=(0,U.useMemo)(()=>Or(k,O,Z?.value,h),[k,O,Z?.value,h]),Pe=(0,U.useMemo)(()=>({causes:m.nodes.length,links:m.edges.length,sourced:m.nodes.filter(e=>e.receipt!==void 0).length}),[m]),Q=S?.kind===`node`?q.get(S.id):void 0,Fe=(0,U.useMemo)(()=>Q===void 0?[]:B(_,Q.id),[_,Q]),[Ie,Le]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(Q===void 0){Le(null);return}let e=!0;return(async()=>{let{hierarchyLens:t}=await i(async()=>{let{hierarchyLens:e}=await import(`./lens-ChFJD9il.js`);return{hierarchyLens:e}},__vite__mapDeps([0,1,2,3]));if(!e)return;let n=t.compile(_,Q.id);if(n===null){Le(null);return}await c(l([n.block]));let r=u(n.block.type);e&&r&&Le({plan:n,render:r})})(),()=>{e=!1}},[_,Q]);let $=S?.kind===`edge`?ne.get(S.id):void 0,Re=(0,U.useMemo)(()=>m.nodes.filter(e=>e.role===`root`).map(e=>({id:e.id,label:N(e.label),pct:b.get(e.id)??100})),[m.nodes,b]);return(0,G.jsx)(qn,{registry:v,onNavigate:ce,ref:ae,children:(0,G.jsx)(`section`,{className:`wo-scrim`,"aria-label":`Living answer: ${m.title}`,children:(0,G.jsxs)(`div`,{className:`wo-panel`,children:[(0,G.jsxs)(`header`,{className:`wo-head`,children:[(0,G.jsxs)(`div`,{className:`wo-title`,children:[(0,G.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),(0,G.jsx)(`h2`,{children:m.title})]}),(0,G.jsxs)(`div`,{className:`wo-head-actions`,children:[(0,G.jsx)(`div`,{className:`wo-views`,role:`group`,"aria-label":`View`,children:Sr.filter(e=>M(e.rep)).map(e=>(0,G.jsx)(`button`,{type:`button`,className:`wo-chip`,"aria-pressed":z===e.rep,onClick:()=>{X(),W(e.rep)},children:e.label},e.rep))}),(0,G.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:Oe,disabled:!E,children:`Reset`}),n&&(0,G.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:n,"aria-label":`Close`,children:`✕`})]})]}),h&&(0,G.jsx)(`div`,{className:`wo-banner wo-banner-illustrative`,children:`Illustrative model — shows the shape, not your numbers.`}),(0,G.jsx)(`p`,{className:`wo-legend`,children:Cr[z]}),(0,G.jsxs)(`div`,{className:`wo-body`,children:[(0,G.jsxs)(`div`,{className:`wo-stage`,onWheelCapture:oe,onPointerDownCapture:oe,children:[(0,G.jsx)(Je,{stage:R,world:te,renderFace:je,onNodeClick:Te,onEdgeClick:Ee,selectedId:S?.kind===`node`?S.id:void 0,litEdgeId:ue}),(0,G.jsx)(dr,{count:pe.length,index:ge,playing:Y,caption:_e,expanded:w,onToggle:ve,onSeek:ye})]}),(0,G.jsxs)(`aside`,{className:`wo-rail`,children:[(0,G.jsx)(Nn,{levers:Re,onSet:De,onReset:Oe}),(0,G.jsx)(tr,{baseline:Me,current:Ne,unit:Z?.unit,active:E,observedNote:h?wr:void 0}),(0,G.jsxs)(`div`,{className:`wo-detail`,children:[(0,G.jsx)(`span`,{className:`wo-rail-kicker`,children:`EVIDENCE`}),!S&&(0,G.jsxs)(`div`,{className:`wo-standing`,children:[(0,G.jsxs)(`dl`,{className:`wo-facts`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Causes`}),(0,G.jsx)(`dd`,{children:Pe.causes})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Links`}),(0,G.jsx)(`dd`,{children:Pe.links})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:h?`Illustrative`:`With a source`}),(0,G.jsx)(`dd`,{children:h?`every cause`:Pe.sourced})]})]}),Z&&(0,G.jsxs)(`p`,{className:`wo-standing-outcome`,children:[(0,G.jsx)(`span`,{className:`wo-standing-lead`,children:`It ends at`}),` `,Z.label,Z.detail?(0,G.jsx)(`span`,{className:`wo-standing-note`,children:Z.detail}):null]}),(0,G.jsx)(`p`,{className:`wo-hint`,children:`Tap a cause or a link to see what stands behind it.`})]}),Q&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h3`,{className:`wo-detail-title`,children:Q.label}),Q.detail&&(0,G.jsx)(`p`,{className:`wo-detail-note`,children:Q.detail}),(0,G.jsx)(`p`,{className:`wo-detail-figure`,children:(0,G.jsx)(In,{id:ar(Q.id)})}),Q.series&&(0,G.jsx)(`ul`,{className:`wo-series`,children:Q.series.points.map((e,t)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{className:`wo-series-t`,children:e.t}),(0,G.jsx)(In,{id:or(Q.id,e.t)})]},`${e.t}:${t}`))}),(Ie||Fe.length>0)&&(0,G.jsxs)(`div`,{className:`wo-parts`,children:[(0,G.jsx)(`span`,{className:`wo-rail-kicker`,children:`WHAT THIS IS MADE OF`}),Ie?Ie.render(Ie.plan.block.props,{delay:0}):(0,G.jsx)(`ul`,{className:`wo-part-list`,children:Fe.map(e=>(0,G.jsx)(`li`,{children:N(e.label)},e.id))})]})]}),$&&(0,G.jsx)(V,{relation:L($.relation),sign:$.sign,status:$.status??I($),receipts:$.receipts??($.receipt?[$.receipt]:[]),counter:$.counter,provisional:$.provisional})]})]})]})]})})})}export{kr as WorldOverlay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{tt as n}from"./index-Dk0QapqQ.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`})]})]})]})}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{tt as n}from"./index-zIa6h_8b.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`})]})]})]})}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-DBtkeyRy.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-DBtkeyRy.js";import{t as a}from"./portal-k_BMgWND.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./ReplayCard-F7U3LYAg.js";import"./TopicCanvas-DozfZFto.js";import"./CanvasSkeleton-CRGWlafo.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{h as n,u as r}from"./index-Dk0QapqQ.js";import{C as i,i as a,m as o}from"./kokoro-P_fkcX-A.js";var s=24e3,c=.15,l=.18,u=240,d=.008,f=.89,p=6;async function m(e,t){let n=i(e).trim().slice(0,u);if(!n)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:n,voice:a(`mavea`),response_format:`pcm`,speed:1}),signal:t});if(e.ok)return o(new Uint8Array(await e.arrayBuffer()),null).samples}catch{if(t?.aborted)return new Float32Array}return new Float32Array}async function h(e,t){let n=e.slides,i=n.map(e=>Math.max(800,Math.round(e.durationMs))),a=r(),o=n.map(e=>e.voiceover.trim()),u=o.find(Boolean);if(!a||typeof OfflineAudioContext>`u`)return{buffer:null,timings:i,missing:o.filter(Boolean).length,...u?{firstMissingLine:u}:{}};let h=await Promise.all(n.map(e=>m(e.voiceover,t))),g=o.filter(Boolean).length,_=h.filter(e=>e.length>0).length,v=Math.max(0,g-_),y=o.find((e,t)=>e&&h[t].length===0);if(_===0)return{buffer:null,timings:i,missing:v,...y?{firstMissingLine:y}:{}};let b=n.map((e,t)=>{let n=h[t].length/s*1e3;return Math.round(n>0?Math.max(i[t],n+l*1e3):i[t])}),x=0;for(let e of h)for(let t=0;t<e.length;t++)x=Math.max(x,Math.abs(e[t]));let S=x>0?Math.min(p,f/x):1,C=a.sampleRate,w=.65+b.reduce((e,t)=>e+t/1e3,0),T=new OfflineAudioContext(1,Math.ceil(w*C),C),E=T.createGain();E.gain.value=S,E.connect(T.destination);let D=c;return b.forEach((e,t)=>{let n=h[t];if(n.length){let e=T.createBuffer(1,n.length,s);e.getChannelData(0).set(n);let t=T.createBufferSource();t.buffer=e;let r=T.createGain(),i=n.length/s,a=Math.min(d,i/2);r.gain.setValueAtTime(0,D),r.gain.linearRampToValueAtTime(1,D+a),r.gain.setValueAtTime(1,D+i-a),r.gain.linearRampToValueAtTime(0,D+i),t.connect(r).connect(E),t.start(D)}D+=e/1e3}),{buffer:await T.startRendering(),timings:b,missing:v,...y?{firstMissingLine:y}:{}}}function g(e){let t=r();if(!t||typeof t.createMediaStreamDestination!=`function`)return null;let n=t.createMediaStreamDestination(),i=t.createBufferSource();i.buffer=e,i.connect(n);let a=!1;return{stream:n.stream,start(){a||(a=!0,t.state!==`running`&&t.resume().catch(()=>{}),i.start())},stop(){try{i.stop()}catch{}try{i.disconnect()}catch{}}}}function _(e,t,n){return t+Math.max(0,n-e)}function v(e,t){return!Number.isFinite(t)||t<=0||e>=t?null:Math.max(0,e)}function y(e){let t=r();if(!t)return null;let n=t.createGain();n.connect(t.destination);let i=null,a=0,o=0,s=!1,c=()=>{try{i?.stop(),i?.disconnect()}catch{}i=null},l=r=>{c(),i=t.createBufferSource(),i.buffer=e,i.connect(n),i.start(0,r),a=r,o=t.currentTime,s=!1};return{play(){t.state!==`running`&&t.resume().catch(()=>{}),l(0)},setMuted(e){n.gain.value=+!e},pause(){s||!i||(a=Math.min(e.duration,_(o,a,t.currentTime)),c(),s=!0)},resume(){if(!s)return;s=!1;let n=v(a,e.duration);n!==null&&(t.state!==`running`&&t.resume().catch(()=>{}),l(n))},stop(){c();try{n.disconnect()}catch{}}}}var b=`opus`,x=[{container:`mp4`,mimeType:`video/mp4`,video:`av1`,audio:b},{container:`webm`,mimeType:`video/webm`,video:`vp9`,audio:b},{container:`webm`,mimeType:`video/webm`,video:`vp8`,audio:b}],S=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`];async function C(e,t){if(t.audio&&!await e.canEncodeAudio(b,{numberOfChannels:t.audio.numberOfChannels,sampleRate:t.audio.sampleRate,bitrate:t.audioBitrate??192e3}).catch(()=>!1))return null;for(let n of x)if(await e.canEncodeVideo(n.video,{width:t.width,height:t.height,bitrate:t.videoBitrate}).catch(()=>!1))return n;return null}function w(){return typeof MediaRecorder>`u`||typeof MediaRecorder.isTypeSupported!=`function`?null:S.find(e=>MediaRecorder.isTypeSupported(e))??null}var T=201326592,E=864e5,D=256,O=32,k=/^mavea-video-(\d{13})-[a-z0-9]+[.](?:webm|mp4)$/,A=new WeakSet;async function j(e,t=Date.now()){let n=0,r=0;try{let i=e.entries();try{for(;n<D;){let a=await i.next();if(a.done)break;n+=1;let[o,s]=a.value;if(r>=O||s.kind!==`file`)continue;let c=k.exec(o);if(!c)continue;let l=Number(c[1]);if(!(!Number.isSafeInteger(l)||t-l<E))try{await e.removeEntry(o),r+=1}catch{}}}finally{await i.return?.()}}catch{}return r}function M(e){A.has(e)||(A.add(e),j(e))}async function N(e=`webm`){if(typeof navigator>`u`)return null;let t=navigator.storage;if(!t?.getDirectory)return null;try{let n=await t.getDirectory();M(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 P(e,t=`webm`){let n=await N(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 F(){let e=await N();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>T){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 I={balanced:{fps:24,bitrate:6e6},high:{fps:24,bitrate:7e6},ultra:{fps:24,bitrate:8e6}};function L(e,t=n()){let r=I[e],i=t===`lite`?{fps:12,bitrate:6e6}:{fps:24,bitrate:8e6};return{fps:Math.min(r.fps,i.fps),bitrate:Math.min(r.bitrate,i.bitrate)}}function R(e){let{fps:t,bitrate:n}=L(e);return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function z(){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 B(){try{return await t(()=>import(`./dist-DRo0JOkC.js`),[])}catch{return null}}var V={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}};function H(){if(typeof document>`u`)return!1;let e=w()!==null,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function U(e){let t=L(e.quality??`high`),n=e.fps??t.fps,r=e.bitrate??t.bitrate,i=e.background??`#05070c`,{w:a,h:o}=e.dims??V[e.aspect],s=await B();if(!s)throw Error(`rasterizer-unavailable`);let c=e.el.clientWidth||a,l=Math.min(3,Math.max(1,a/c)),u=0,d=0,f=document.createElement(`canvas`);f.width=a,f.height=o;let p=f.getContext(`2d`,{alpha:!1});p.fillStyle=i,p.fillRect(0,0,a,o);let m=document.createElement(`canvas`);m.width=Math.round(a/2),m.height=Math.round(o/2);let h=m.getContext(`2d`),_=!1,v=()=>{h&&(h.drawImage(f,0,0,m.width,m.height),_=!0)},y=()=>new Blob([],{type:`image/png`}),b=async()=>(!_&&u>0&&v(),_?await new Promise(e=>m.toBlob(e,`image/png`))??y():y()),x=async()=>{let t;try{t=await s.domToCanvas(e.el,{scale:l,backgroundColor:i})}catch{d++;return}if(!t.width||!t.height){d++;return}d=0,u++;let n=Math.max(a/t.width,o/t.height),r=t.width*n,c=t.height*n;p.fillStyle=i,p.fillRect(0,0,a,o),p.drawImage(t,(a-r)/2,(o-c)/2,r,c)},S=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await z():null,T=S?await C(S,{width:a,height:o,videoBitrate:r,audio:e.audioBuffer}):null;if(T&&S){let t=await P(S.StreamTarget,T.container),i=t?null:new S.BufferTarget,a=new S.Output({format:T.container===`mp4`?new S.Mp4OutputFormat:new S.WebMOutputFormat,target:t?.target??i}),o=new S.CanvasSource(f,{codec:T.video,bitrate:r});a.addVideoTrack(o);let s=null;if(e.audioBuffer){let t=new S.AudioBufferSource({codec:T.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=!0,l=!0,p=performance.now(),h=0,g=1e3/n,y=e.maxDurationMs??1/0;(async()=>{for(;c;){let e=performance.now();if(await x(),!c)break;let t=l?0:(performance.now()-p)/1e3;l=!1;try{await o.add(t,Math.max(1/n,t-h))}catch{break}if(h=t,t*1e3>=y)break;!_&&t>1.2&&u>2&&d===0&&v();let r=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,g-r)))}})();let C=()=>{c=!1,f.width=f.height=0,m.width=m.height=0};return{async stop(){c=!1;let n=await b();o.close(),await a.finalize();let r=t?await t.finish():null;return C(),{blob:r?.blob??new Blob([i?.buffer??new ArrayBuffer(0)],{type:T.mimeType}),type:T.mimeType,poster:n,hasAudio:!!e.audioBuffer,durationMs:Math.round(performance.now()-p),dispose:r?.dispose}},cancel(){c=!1,a.cancel?.(),t?.discard(),C()}}}let E=f.captureStream(n),D=new MediaStream(E.getVideoTracks()),O=e.audioBuffer?g(e.audioBuffer):null,k=O?.stream.getAudioTracks()[0]??null;k&&D.addTrack(k);let A=w();if(!A)throw f.width=f.height=0,m.width=m.height=0,Error(`open-codec-unavailable`);let j=new MediaRecorder(D,{mimeType:A,videoBitsPerSecond:r}),M=await F();j.ondataavailable=e=>M.write(e.data);let N=new Promise(e=>{j.addEventListener(`stop`,()=>e(),{once:!0})}),I=()=>{try{j.state!==`inactive`&&j.stop()}catch{}};j.start(1e3),O?.start();let R=!0,H=performance.now(),U=e.maxDurationMs??1/0,W=1e3/n;(async()=>{for(;R;){let e=performance.now();await x();let t=performance.now()-H;if(t>=U){I();break}!_&&t>1200&&u>2&&d===0&&v();let n=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,W-n)))}})();let G=()=>{R=!1;for(let e of D.getTracks())e.stop();O?.stop(),f.width=f.height=0,m.width=m.height=0};return{async stop(){R=!1;let e=await b();I(),await N;try{let t=await M.finish(),n=Math.round(performance.now()-H);return G(),{blob:t.blob,type:A,poster:e,hasAudio:!!k,durationMs:n,dispose:t.dispose}}catch(e){throw await M.discard(),G(),e}},cancel(){R=!1,I(),M.discard(),G()}}}export{w as a,m as c,U as i,H as n,y as o,R as r,h as s,L as t};
|
|
2
|
+
import{n as e,t}from"./preload-helper-CiWYd9n-.js";import{h as n,u as r}from"./index-zIa6h_8b.js";import{C as i,i as a,m as o}from"./kokoro-B3oG_8sd.js";var s=24e3,c=.15,l=.18,u=240,d=.008,f=.89,p=6;async function m(e,t){let n=i(e).trim().slice(0,u);if(!n)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:n,voice:a(`mavea`),response_format:`pcm`,speed:1}),signal:t});if(e.ok)return o(new Uint8Array(await e.arrayBuffer()),null).samples}catch{if(t?.aborted)return new Float32Array}return new Float32Array}async function h(e,t){let n=e.slides,i=n.map(e=>Math.max(800,Math.round(e.durationMs))),a=r(),o=n.map(e=>e.voiceover.trim()),u=o.find(Boolean);if(!a||typeof OfflineAudioContext>`u`)return{buffer:null,timings:i,missing:o.filter(Boolean).length,...u?{firstMissingLine:u}:{}};let h=await Promise.all(n.map(e=>m(e.voiceover,t))),g=o.filter(Boolean).length,_=h.filter(e=>e.length>0).length,v=Math.max(0,g-_),y=o.find((e,t)=>e&&h[t].length===0);if(_===0)return{buffer:null,timings:i,missing:v,...y?{firstMissingLine:y}:{}};let b=n.map((e,t)=>{let n=h[t].length/s*1e3;return Math.round(n>0?Math.max(i[t],n+l*1e3):i[t])}),x=0;for(let e of h)for(let t=0;t<e.length;t++)x=Math.max(x,Math.abs(e[t]));let S=x>0?Math.min(p,f/x):1,C=a.sampleRate,w=.65+b.reduce((e,t)=>e+t/1e3,0),T=new OfflineAudioContext(1,Math.ceil(w*C),C),E=T.createGain();E.gain.value=S,E.connect(T.destination);let D=c;return b.forEach((e,t)=>{let n=h[t];if(n.length){let e=T.createBuffer(1,n.length,s);e.getChannelData(0).set(n);let t=T.createBufferSource();t.buffer=e;let r=T.createGain(),i=n.length/s,a=Math.min(d,i/2);r.gain.setValueAtTime(0,D),r.gain.linearRampToValueAtTime(1,D+a),r.gain.setValueAtTime(1,D+i-a),r.gain.linearRampToValueAtTime(0,D+i),t.connect(r).connect(E),t.start(D)}D+=e/1e3}),{buffer:await T.startRendering(),timings:b,missing:v,...y?{firstMissingLine:y}:{}}}function g(e){let t=r();if(!t||typeof t.createMediaStreamDestination!=`function`)return null;let n=t.createMediaStreamDestination(),i=t.createBufferSource();i.buffer=e,i.connect(n);let a=!1;return{stream:n.stream,start(){a||(a=!0,t.state!==`running`&&t.resume().catch(()=>{}),i.start())},stop(){try{i.stop()}catch{}try{i.disconnect()}catch{}}}}function _(e,t,n){return t+Math.max(0,n-e)}function v(e,t){return!Number.isFinite(t)||t<=0||e>=t?null:Math.max(0,e)}function y(e){let t=r();if(!t)return null;let n=t.createGain();n.connect(t.destination);let i=null,a=0,o=0,s=!1,c=()=>{try{i?.stop(),i?.disconnect()}catch{}i=null},l=r=>{c(),i=t.createBufferSource(),i.buffer=e,i.connect(n),i.start(0,r),a=r,o=t.currentTime,s=!1};return{play(){t.state!==`running`&&t.resume().catch(()=>{}),l(0)},setMuted(e){n.gain.value=+!e},pause(){s||!i||(a=Math.min(e.duration,_(o,a,t.currentTime)),c(),s=!0)},resume(){if(!s)return;s=!1;let n=v(a,e.duration);n!==null&&(t.state!==`running`&&t.resume().catch(()=>{}),l(n))},stop(){c();try{n.disconnect()}catch{}}}}var b=`opus`,x=[{container:`mp4`,mimeType:`video/mp4`,video:`av1`,audio:b},{container:`webm`,mimeType:`video/webm`,video:`vp9`,audio:b},{container:`webm`,mimeType:`video/webm`,video:`vp8`,audio:b}],S=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`];async function C(e,t){if(t.audio&&!await e.canEncodeAudio(b,{numberOfChannels:t.audio.numberOfChannels,sampleRate:t.audio.sampleRate,bitrate:t.audioBitrate??192e3}).catch(()=>!1))return null;for(let n of x)if(await e.canEncodeVideo(n.video,{width:t.width,height:t.height,bitrate:t.videoBitrate}).catch(()=>!1))return n;return null}function w(){return typeof MediaRecorder>`u`||typeof MediaRecorder.isTypeSupported!=`function`?null:S.find(e=>MediaRecorder.isTypeSupported(e))??null}var T=201326592,E=864e5,D=256,O=32,k=/^mavea-video-(\d{13})-[a-z0-9]+[.](?:webm|mp4)$/,A=new WeakSet;async function j(e,t=Date.now()){let n=0,r=0;try{let i=e.entries();try{for(;n<D;){let a=await i.next();if(a.done)break;n+=1;let[o,s]=a.value;if(r>=O||s.kind!==`file`)continue;let c=k.exec(o);if(!c)continue;let l=Number(c[1]);if(!(!Number.isSafeInteger(l)||t-l<E))try{await e.removeEntry(o),r+=1}catch{}}}finally{await i.return?.()}}catch{}return r}function M(e){A.has(e)||(A.add(e),j(e))}async function N(e=`webm`){if(typeof navigator>`u`)return null;let t=navigator.storage;if(!t?.getDirectory)return null;try{let n=await t.getDirectory();M(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 P(e,t=`webm`){let n=await N(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 F(){let e=await N();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>T){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 I={balanced:{fps:24,bitrate:6e6},high:{fps:24,bitrate:7e6},ultra:{fps:24,bitrate:8e6}};function L(e,t=n()){let r=I[e],i=t===`lite`?{fps:12,bitrate:6e6}:{fps:24,bitrate:8e6};return{fps:Math.min(r.fps,i.fps),bitrate:Math.min(r.bitrate,i.bitrate)}}function R(e){let{fps:t,bitrate:n}=L(e);return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function z(){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 B(){try{return await t(()=>import(`./dist-DRo0JOkC.js`),[])}catch{return null}}var V={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}};function H(){if(typeof document>`u`)return!1;let e=w()!==null,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function U(e){let t=L(e.quality??`high`),n=e.fps??t.fps,r=e.bitrate??t.bitrate,i=e.background??`#05070c`,{w:a,h:o}=e.dims??V[e.aspect],s=await B();if(!s)throw Error(`rasterizer-unavailable`);let c=e.el.clientWidth||a,l=Math.min(3,Math.max(1,a/c)),u=0,d=0,f=document.createElement(`canvas`);f.width=a,f.height=o;let p=f.getContext(`2d`,{alpha:!1});p.fillStyle=i,p.fillRect(0,0,a,o);let m=document.createElement(`canvas`);m.width=Math.round(a/2),m.height=Math.round(o/2);let h=m.getContext(`2d`),_=!1,v=()=>{h&&(h.drawImage(f,0,0,m.width,m.height),_=!0)},y=()=>new Blob([],{type:`image/png`}),b=async()=>(!_&&u>0&&v(),_?await new Promise(e=>m.toBlob(e,`image/png`))??y():y()),x=async()=>{let t;try{t=await s.domToCanvas(e.el,{scale:l,backgroundColor:i})}catch{d++;return}if(!t.width||!t.height){d++;return}d=0,u++;let n=Math.max(a/t.width,o/t.height),r=t.width*n,c=t.height*n;p.fillStyle=i,p.fillRect(0,0,a,o),p.drawImage(t,(a-r)/2,(o-c)/2,r,c)},S=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await z():null,T=S?await C(S,{width:a,height:o,videoBitrate:r,audio:e.audioBuffer}):null;if(T&&S){let t=await P(S.StreamTarget,T.container),i=t?null:new S.BufferTarget,a=new S.Output({format:T.container===`mp4`?new S.Mp4OutputFormat:new S.WebMOutputFormat,target:t?.target??i}),o=new S.CanvasSource(f,{codec:T.video,bitrate:r});a.addVideoTrack(o);let s=null;if(e.audioBuffer){let t=new S.AudioBufferSource({codec:T.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=!0,l=!0,p=performance.now(),h=0,g=1e3/n,y=e.maxDurationMs??1/0;(async()=>{for(;c;){let e=performance.now();if(await x(),!c)break;let t=l?0:(performance.now()-p)/1e3;l=!1;try{await o.add(t,Math.max(1/n,t-h))}catch{break}if(h=t,t*1e3>=y)break;!_&&t>1.2&&u>2&&d===0&&v();let r=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,g-r)))}})();let C=()=>{c=!1,f.width=f.height=0,m.width=m.height=0};return{async stop(){c=!1;let n=await b();o.close(),await a.finalize();let r=t?await t.finish():null;return C(),{blob:r?.blob??new Blob([i?.buffer??new ArrayBuffer(0)],{type:T.mimeType}),type:T.mimeType,poster:n,hasAudio:!!e.audioBuffer,durationMs:Math.round(performance.now()-p),dispose:r?.dispose}},cancel(){c=!1,a.cancel?.(),t?.discard(),C()}}}let E=f.captureStream(n),D=new MediaStream(E.getVideoTracks()),O=e.audioBuffer?g(e.audioBuffer):null,k=O?.stream.getAudioTracks()[0]??null;k&&D.addTrack(k);let A=w();if(!A)throw f.width=f.height=0,m.width=m.height=0,Error(`open-codec-unavailable`);let j=new MediaRecorder(D,{mimeType:A,videoBitsPerSecond:r}),M=await F();j.ondataavailable=e=>M.write(e.data);let N=new Promise(e=>{j.addEventListener(`stop`,()=>e(),{once:!0})}),I=()=>{try{j.state!==`inactive`&&j.stop()}catch{}};j.start(1e3),O?.start();let R=!0,H=performance.now(),U=e.maxDurationMs??1/0,W=1e3/n;(async()=>{for(;R;){let e=performance.now();await x();let t=performance.now()-H;if(t>=U){I();break}!_&&t>1200&&u>2&&d===0&&v();let n=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,W-n)))}})();let G=()=>{R=!1;for(let e of D.getTracks())e.stop();O?.stop(),f.width=f.height=0,m.width=m.height=0};return{async stop(){R=!1;let e=await b();I(),await N;try{let t=await M.finish(),n=Math.round(performance.now()-H);return G(),{blob:t.blob,type:A,poster:e,hasAudio:!!k,durationMs:n,dispose:t.dispose}}catch(e){throw await M.discard(),G(),e}},cancel(){R=!1,I(),M.discard(),G()}}}export{w as a,m as c,U as i,H as n,y as o,R as r,h as s,L as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,M as t,p as n,y as r}from"./store-CsjDEADX.js";import{n as i}from"./ledger-Cv0LBflx.js";import{i as a}from"./format-g3dP8OI3.js";import{n as o}from"./useDashboardLoop-
|
|
1
|
+
import{I as e,M as t,p as n,y as r}from"./store-CsjDEADX.js";import{n as i}from"./ledger-Cv0LBflx.js";import{i as a}from"./format-g3dP8OI3.js";import{n as o}from"./useDashboardLoop-BoVNM-pT.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-C88IQJ0M.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-C88IQJ0M.js";import{O as r,k as i}from"./kokoro-B3oG_8sd.js";import{n as a,t as o}from"./contentVault-xfUwSJ3i.js";import{J as s,j as c}from"./store-CsjDEADX.js";import{n as l,s as u}from"./ledger-Cv0LBflx.js";import{a as d,i as f}from"./format-g3dP8OI3.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 +1 @@
|
|
|
1
|
-
import{c as e}from"./walkSync-
|
|
1
|
+
import{c as e}from"./walkSync-CT8kmbzY.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};
|