@mavea/mavea 1.0.16 → 1.0.17
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/dist/.vite/manifest.json +589 -567
- package/dist/assets/{AppCommandPalette-Dzl_DbDd.js → AppCommandPalette-B3E1gTd4.js} +1 -1
- package/dist/assets/{BlockEmpty-B5Q0hgDJ.js → BlockEmpty-DQkdduUE.js} +1 -1
- package/dist/assets/{BriefingPlayer-Dy7JCGm-.js → BriefingPlayer-CRKTlKa3.js} +1 -1
- package/dist/assets/{CanvasSkeleton-CJwPWnFG.js → CanvasSkeleton-cQ6KF-6z.js} +2 -2
- package/dist/assets/{CheckLogRail-DNtXlkcR.js → CheckLogRail-C6nouD1Y.js} +1 -1
- package/dist/assets/{CodeOutput-Bg64AyKu.js → CodeOutput-H8TQzjqL.js} +1 -1
- package/dist/assets/{CommandPalette-mO1FEvlx.js → CommandPalette-CSvgbXxg.js} +1 -1
- package/dist/assets/CourseLessonReader-1KDKwxIj.js +2 -0
- package/dist/assets/{CourseRail-CRcB319H.js → CourseRail-BijCpApU.js} +1 -1
- package/dist/assets/CoursesApp-BWkdYL07.js +2 -0
- package/dist/assets/{CrossExamPanel-Deywo95y.js → CrossExamPanel-Cn7b5y7B.js} +1 -1
- package/dist/assets/{DashPresent-BEm1tGse.js → DashPresent-B025i7iJ.js} +1 -1
- package/dist/assets/DashboardDetail-CZLnxgp0.js +2 -0
- package/dist/assets/DashboardLoopRuntime-7MpMUcMg.js +1 -0
- package/dist/assets/{DashboardOverview-DrdqBgds.js → DashboardOverview-COyleu7v.js} +1 -1
- package/dist/assets/{DashboardSettings-CBhzLW0P.js → DashboardSettings-DUfUqbsp.js} +1 -1
- package/dist/assets/DashboardsApp-6xMz2qCP.js +2 -0
- package/dist/assets/{DeepZoomApp-Chz6laKc.js → DeepZoomApp-CQaTT2Uh.js} +1 -1
- package/dist/assets/{DelegatePanel-DmtTY_lE.js → DelegatePanel-D4OrMa2D.js} +1 -1
- package/dist/assets/{DemoGallery-zw3d7ap9.js → DemoGallery-Bt92vKqc.js} +1 -1
- package/dist/assets/{DropSelect-Bo2Oyi-2.js → DropSelect-Q310fTbf.js} +1 -1
- package/dist/assets/{ExportModal-DICXavg9.js → ExportModal-D0zXlC8w.js} +2 -2
- package/dist/assets/ExtractionPreview-0SZYynDs.js +18 -0
- package/dist/assets/{FlagshipCTA-B-7nH43r.js → FlagshipCTA-D845jkdt.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-DgTL_Kjj.js → FlagshipCommandPalette-DHMnyG7j.js} +1 -1
- package/dist/assets/{FlagshipShowcase-CbAC2s4X.js → FlagshipShowcase-BuR3PZvU.js} +1 -1
- package/dist/assets/{FlashcardsApp-CatYcaJJ.js → FlashcardsApp-BzWb4cRP.js} +1 -1
- package/dist/assets/{ForecastPanel-BOG361kr.js → ForecastPanel-lTnux0EB.js} +1 -1
- package/dist/assets/GalleryApp-D0NGZ1_t.js +1 -0
- package/dist/assets/{HonestByDesign-hCxc0A7b.js → HonestByDesign-CCOt31nx.js} +1 -1
- package/dist/assets/{HowItWorks-BlbQcUxx.js → HowItWorks-auW5XXCZ.js} +1 -1
- package/dist/assets/{LegalApp-sCZjJYWx.js → LegalApp-DXDomKFv.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-Bk3U7ChN.js → LegalMarkdownDocument-DBjLz9Yf.js} +1 -1
- package/dist/assets/{LegalPageShell-BsgRV7aL.js → LegalPageShell-BG5UUk-9.js} +1 -1
- package/dist/assets/{LeverPanel-CP32QcIf.js → LeverPanel-CvYnTLjh.js} +1 -1
- package/dist/assets/{Library-CJTnp1pC.js → Library-Cl1gE9Qg.js} +1 -1
- package/dist/assets/{LibraryOverlay-geQRGAzG.js → LibraryOverlay-CX4cJLqD.js} +1 -1
- package/dist/assets/LiveApp-CDckMWYX.js +61 -0
- package/dist/assets/LiveSettings-DgfIXanM.js +6 -0
- package/dist/assets/{MindMapViewerDrawer-7HLErRQF.js → MindMapViewerDrawer-ClU9wgSH.js} +1 -1
- package/dist/assets/{MindShape-Bhu4yoIj.js → MindShape-yF19n9qq.js} +1 -1
- package/dist/assets/{PinToDashboard-Cj8S9XKC.js → PinToDashboard-CpIDAcIU.js} +1 -1
- package/dist/assets/PlanReview-CPcqOxjp.js +1 -0
- package/dist/assets/{Presence-DDxb6yE5.js → Presence-CHGZ1JRp.js} +1 -1
- package/dist/assets/{PresentationDeck-B6AHRYEA.js → PresentationDeck-CrtiWjiM.js} +1 -1
- package/dist/assets/PrismApp-D7RbekoX.js +2 -0
- package/dist/assets/{PrismAskController-DUvOTeW9.js → PrismAskController-D6_7Epdb.js} +1 -1
- package/dist/assets/PrismBriefingPlayer-Dq5_KRU3.js +2 -0
- package/dist/assets/PrismOverlay-CduGpA8D.js +131 -0
- package/dist/assets/{PrivacyApp-CatB3OpJ.js → PrivacyApp-rhzy-5HG.js} +1 -1
- package/dist/assets/{Recap-DkKrrqi5.js → Recap-BPg2xEPo.js} +1 -1
- package/dist/assets/{ReelJelly-DCD4bG10.js → ReelJelly-LWeMsFpj.js} +1 -1
- package/dist/assets/ReplayCard-C3dGQfxG.js +2 -0
- package/dist/assets/{ReplayOverlay-DbJX08Kr.js → ReplayOverlay-C9W603B5.js} +1 -1
- package/dist/assets/{RewindOverlay-Bop4a63b.js → RewindOverlay-BIWmxQlx.js} +1 -1
- package/dist/assets/RippleApp-C9-KFvkn.js +2 -0
- package/dist/assets/{RippleAskController-CK4iSwT0.js → RippleAskController-DEKz-6Vn.js} +1 -1
- package/dist/assets/RippleOverlay-CfXvnUHE.js +6 -0
- package/dist/assets/{SeeDontRead-CGGKmvBV.js → SeeDontRead-DrG1qBxJ.js} +1 -1
- package/dist/assets/{ShareModal-D4En6Y3L.js → ShareModal-eJ6sdMpf.js} +1 -1
- package/dist/assets/{ShipCascade-k_GWrcau.js → ShipCascade-BP8qL0yM.js} +1 -1
- package/dist/assets/{ShipCourse-BQOY4MyI.js → ShipCourse-BoqW58VU.js} +1 -1
- package/dist/assets/{ShipHotspots-vLRK0w_b.js → ShipHotspots-_9XPhZg2.js} +1 -1
- package/dist/assets/{ShipIncident-BWxerYtX.js → ShipIncident-Xod2gbjc.js} +1 -1
- package/dist/assets/{ShipMigration-OgAGEbjm.js → ShipMigration-BdkaiJ9D.js} +1 -1
- package/dist/assets/{ShipOnboarding-B_2IEq3N.js → ShipOnboarding-CblWatXR.js} +1 -1
- package/dist/assets/{ShipRead--gGqg2SE.js → ShipRead-BBn7xkOF.js} +1 -1
- package/dist/assets/{ShipRollout-B_U2P8Yw.js → ShipRollout-i5BY3YnP.js} +1 -1
- package/dist/assets/{ShipSuggestions-D9coTmgw.js → ShipSuggestions-liytLgC-.js} +1 -1
- package/dist/assets/{ShipWorkspace-BmdcHZXa.js → ShipWorkspace-C3VQwGn1.js} +1 -1
- package/dist/assets/{SignatureLoop-KA6Cf93g.js → SignatureLoop-Ba7plTb5.js} +1 -1
- package/dist/assets/{SynthesisApp-BCBhCJhx.js → SynthesisApp-Ch0tWRBS.js} +2 -2
- package/dist/assets/{SynthesisOverlay-BuGIeaKq.js → SynthesisOverlay-DMZndCzV.js} +1 -1
- package/dist/assets/{TermsApp-CleIlDtR.js → TermsApp-Dk2jpxq-.js} +1 -1
- package/dist/assets/{TopicCanvas-BRu3xVL8.js → TopicCanvas-DX0Z1ZHv.js} +2 -2
- package/dist/assets/{TourPrism-zbVLe2ag.js → TourPrism-6fWPMU4Z.js} +1 -1
- package/dist/assets/{TrackerTile-D9Wa3CSq.js → TrackerTile-BboQpBGy.js} +2 -2
- package/dist/assets/{TwoSurfaces-TyWXgAdq.js → TwoSurfaces-Cabk1rES.js} +1 -1
- package/dist/assets/{UnderstoodPanel-BS9OhgLJ.js → UnderstoodPanel-B6jfiKx1.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-B-KJhCjr.js → WhyMachineOverlay-BRNibJSf.js} +1 -1
- package/dist/assets/{WowFeatures-Bv1-PmXF.js → WowFeatures-C7f4qzIf.js} +1 -1
- package/dist/assets/{ZoomDeck-C2Q6xbgX.js → ZoomDeck-BtlVyhwv.js} +1 -1
- package/dist/assets/{alternateFinishes-BG6svkXG.js → alternateFinishes-CVUX4x0C.js} +1 -1
- package/dist/assets/{annotationAuto-BpBsjbDQ.js → annotationAuto-BjWqgseH.js} +1 -1
- package/dist/assets/{annotationReel-yzysA-Gr.js → annotationReel-B5A2RZkx.js} +1 -1
- package/dist/assets/{backup-BdeBr3wq.js → backup-d46KwktS.js} +1 -1
- package/dist/assets/cachedImport-DW0gP14h.js +1 -0
- package/dist/assets/canvas-BuMP6u6i.js +1 -0
- package/dist/assets/{catalog-DF7YTNju.js → catalog-Bv0dWU_C.js} +1 -1
- package/dist/assets/confirmAdd-CWWtX1VN.js +1 -0
- package/dist/assets/{dashboardEvents-C_XvGVLJ.js → dashboardEvents-Be4sftHN.js} +1 -1
- package/dist/assets/{dist-CBEt6Q8V.js → dist-DIKAXwpM.js} +1 -1
- package/dist/assets/{fit-B1LJWvMO.js → fit-CuHWhwsj.js} +1 -1
- package/dist/assets/{generateLive-ChhSWKbq.js → generateLive-CMbGT3eM.js} +1 -1
- package/dist/assets/index-Dbr1j8Fe.js +22 -0
- package/dist/assets/{jspdf.es.min-DutJi91O.js → jspdf.es.min-ydC1TxUW.js} +1 -1
- package/dist/assets/{kokoro-kGWf7M0e.js → kokoro-DsmNzulR.js} +1 -1
- package/dist/assets/{lib-C7zXL8h0.js → lib-B6qSkBPa.js} +1 -1
- package/dist/assets/{liveSchema-DCL21WdS.js → liveSchema-B1MGdSkK.js} +1 -1
- package/dist/assets/{motion-dfA87zbb.js → motion-luJxBPnj.js} +1 -1
- package/dist/assets/notes-3WQ6b0Mi.js +1 -0
- package/dist/assets/{pdf-DFYCstCC.js → pdf-RyoPCIGN.js} +1 -1
- package/dist/assets/{perfProbe-CCSPF3EA.js → perfProbe-Xs39DqMh.js} +1 -1
- package/dist/assets/{pin-D5_Ebl_s.js → pin-Cj-LMfpK.js} +1 -1
- package/dist/assets/{portal-BndazODr.js → portal-zyqZwnb1.js} +1 -1
- package/dist/assets/{pptxgen.es-CwCkoJdp.js → pptxgen.es-CveAizg8.js} +1 -1
- package/dist/assets/{prewarm--KODwuMi.js → prewarm-K5WcvrNh.js} +1 -1
- package/dist/assets/{quietHours-DVPplPtM.js → quietHours-BklvMqsV.js} +1 -1
- package/dist/assets/{registry-DQIm_hbI.js → registry-1h9idbfk.js} +1 -1
- package/dist/assets/{registry-Dphh5ADP.js → registry-2zthbrHC.js} +1 -1
- package/dist/assets/{registry-D7rspCZr.js → registry-4O5l9cd5.js} +1 -1
- package/dist/assets/{registry-WJE8Z0T1.js → registry-BRB85vr4.js} +1 -1
- package/dist/assets/registry-BdMZ_4cm.js +2 -0
- package/dist/assets/{registry-Ba9xMFO4.js → registry-Bnp_yh8G.js} +2 -2
- package/dist/assets/{registry-BlB0FYf0.js → registry-C1IrZBk8.js} +1 -1
- package/dist/assets/{registry-B3V5-8v0.js → registry-C5DK98Hl.js} +1 -1
- package/dist/assets/{registry-0E1uKPCI.js → registry-CK0-re_Q.js} +1 -1
- package/dist/assets/{registry-DrNMbrA_.js → registry-COrl_Heq.js} +1 -1
- package/dist/assets/{registry-wJhGGVuP.js → registry-CQUQlrSx.js} +1 -1
- package/dist/assets/{registry-COxprhRN.js → registry-CXa3qXl3.js} +1 -1
- package/dist/assets/{registry-CWkBxxsI.js → registry-C_baBbqq.js} +1 -1
- package/dist/assets/{registry-CIa1EU-G.js → registry-CjY5POtx.js} +1 -1
- package/dist/assets/{registry-C30HGS2G.js → registry-CoBAqOlY.js} +1 -1
- package/dist/assets/{registry-Dvv84L9K.js → registry-DJj-o3MQ.js} +1 -1
- package/dist/assets/{registry-DNzF-nvu.js → registry-DfCCnIfu.js} +1 -1
- package/dist/assets/{registry-D-qEhm1d.js → registry-DfgFkD3J.js} +1 -1
- package/dist/assets/{registry-M3VgAiQv.js → registry-Dhlx1mF4.js} +1 -1
- package/dist/assets/{registry-nG70-amx.js → registry-DnEh7nbX.js} +1 -1
- package/dist/assets/{registry-hsSlT6pi.js → registry-VD94nLXO.js} +1 -1
- package/dist/assets/{registry-BH6FfyZk.js → registry-mFD4P5dI.js} +1 -1
- package/dist/assets/registry-sDzDmht4.js +1 -0
- package/dist/assets/{relate-DxAi8xpo.js → relate-CEND9Qlk.js} +1 -1
- package/dist/assets/{shikiHighlight-B_TEagaE.js → shikiHighlight-SCFIB43b.js} +1 -1
- package/dist/assets/useDashboardLoop-C8Mcbcto.js +5 -0
- package/dist/assets/{useLiveConfig-Lm0cYTcu.js → useLiveConfig-BW1WkpTc.js} +1 -1
- package/dist/assets/{useSpatialCanvas-D_C8VoCy.js → useSpatialCanvas-C5TNlpeK.js} +1 -1
- package/dist/assets/{useSpotlightWalk-CCQT0-_g.js → useSpotlightWalk-dA3IdI-1.js} +1 -1
- package/dist/assets/{useSrsCards-BKCPBPYw.js → useSrsCards-C7Xni9C0.js} +1 -1
- package/dist/assets/{useStudy-Diy4ITBm.js → useStudy-DHRIx8p-.js} +1 -1
- package/dist/assets/{useZoomGesture-B82XnSfi.js → useZoomGesture-BsPXvLw2.js} +1 -1
- package/dist/index.html +2 -1
- package/package.json +1 -1
- package/dist/assets/CourseLessonReader-CKfvBMtL.js +0 -2
- package/dist/assets/CoursesApp-BbCGxAav.js +0 -2
- package/dist/assets/DashboardDetail-tK6FpgtH.js +0 -2
- package/dist/assets/DashboardLoopRuntime-Cis4WMqk.js +0 -1
- package/dist/assets/DashboardsApp-Dc43FBIi.js +0 -2
- package/dist/assets/ExtractionPreview-C636AVw-.js +0 -18
- package/dist/assets/GalleryApp-uW6b1Y0d.js +0 -1
- package/dist/assets/LiveApp-C0BN0o3_.js +0 -61
- package/dist/assets/LiveSettings-CzSXXMoo.js +0 -6
- package/dist/assets/PlanReview-3NxZD9wt.js +0 -1
- package/dist/assets/PrismApp-BlPpWxao.js +0 -2
- package/dist/assets/PrismBriefingPlayer-Bmo9tOGX.js +0 -2
- package/dist/assets/PrismOverlay-9Q_14eEO.js +0 -131
- package/dist/assets/ReplayCard-Bz69tOST.js +0 -2
- package/dist/assets/RippleApp-u3hCfb5b.js +0 -2
- package/dist/assets/RippleOverlay-BM_B9JEc.js +0 -6
- package/dist/assets/canvas-Ep2Kfupo.js +0 -1
- package/dist/assets/index-C7H7A1rW.js +0 -22
- package/dist/assets/notes-DblI4Ko_.js +0 -1
- package/dist/assets/registry-B51MhOLx.js +0 -2
- package/dist/assets/registry-Pr5IKqro.js +0 -1
- package/dist/assets/useDashboardLoop-DzbRz-V9.js +0 -5
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/backup-BdeBr3wq.js","assets/useStudy-Diy4ITBm.js","assets/index-C7H7A1rW.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/contentVault-DzTYWcbD.js","assets/keyVault-DEsNh9FR.js","assets/store-DrBDvqXF.js","assets/queue-J4h7E3uc.js","assets/store-DXmC_fP2.js","assets/queue-DHeyJ32F.css","assets/useLiveConfig-Lm0cYTcu.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/store-Dn23_Ymr.js","assets/store-BMRQiV1z.js","assets/shapes-Cw7tCHIp.js","assets/store-DoJn3lBF.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{J as n,a as r,ft as i,g as a,ht as o,p as s,q as c,v as l,y as u}from"./index-C7H7A1rW.js";import{n as d}from"./icons-CHVz6kv_.js";import{t as f}from"./useFocusTrap-DbfG6zbM.js";import{a as p,b as m,c as h,h as g,l as _,o as v,s as y,u as b}from"./kokoro-kGWf7M0e.js";import{t as x}from"./FeatureUseNotice-CoK5HkbR.js";import{t as S}from"./providers-wzm7E8Pa.js";import{i as C,r as w}from"./info-CiqHR5cs.js";import{t as T}from"./time-BHTmJR1s.js";import{n as E,t as D,u as ee}from"./useStudy-Diy4ITBm.js";import{i as te,l as ne,n as re,o as O,s as k,t as ie,u as ae}from"./useLiveConfig-Lm0cYTcu.js";import{C as oe,b as se,v as ce,y as A}from"./shapes-Cw7tCHIp.js";import{n as le}from"./store-DoJn3lBF.js";import{a as ue,d as de,f as fe,l as pe,n as me,p as he,r as ge,s as _e,u as ve}from"./quietHours-DVPplPtM.js";import{t as ye}from"./DropSelect-Bo2Oyi-2.js";import{g as be}from"./store-DXmC_fP2.js";var j=o(),M=e(),N=t(),P={display:`flex`,flexDirection:`column`,gap:4,fontSize:13,background:`var(--surface-default)`,border:`1px solid var(--line)`,borderRadius:8,padding:`7px 10px`},F={flex:`0 0 auto`,background:`transparent`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,lineHeight:1,padding:0};function xe(e){let t=(0,j.c)(40),{node:n,ago:r}=e,[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(n.body),c=(0,M.useRef)(null),l,u;t[0]===i?(l=t[1],u=t[2]):(l=()=>{i&&c.current?.focus()},u=[i],t[0]=i,t[1]=l,t[2]=u),(0,M.useEffect)(l,u);let d;t[3]!==o||t[4]!==n.body||t[5]!==n.id?(d=()=>{let e=o.trim();e&&e!==n.body&&A(n.id,e),a(!1)},t[3]=o,t[4]=n.body,t[5]=n.id,t[6]=d):d=t[6];let f=d,p;t[7]===n.body?p=t[8]:(p=()=>{s(n.body),a(!1)},t[7]=n.body,t[8]=p);let m=p,h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h={display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},g={fontFamily:`var(--font-data, inherit)`,fontSize:10.5,fontWeight:600,color:`var(--presence)`,letterSpacing:`0.02em`},t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===n.concept?_=t[12]:(_=(0,N.jsx)(`span`,{style:g,children:n.concept}),t[11]=n.concept,t[12]=_);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v={fontSize:10.5,color:`var(--text-muted)`,whiteSpace:`nowrap`},t[13]=v):v=t[13];let y;t[14]===r?y=t[15]:(y=(0,N.jsx)(`span`,{style:v,children:r}),t[14]=r,t[15]=y);let b;t[16]!==i||t[17]!==n.concept?(b=!i&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>a(!0),title:`Edit this fact`,"aria-label":`Edit: ${n.concept}`,style:{...F,fontSize:12},children:`Edit`}),t[16]=i,t[17]=n.concept,t[18]=b):b=t[18];let x;t[19]===n.id?x=t[20]:(x=()=>ce(n.id),t[19]=n.id,t[20]=x);let S=`Forget: ${n.concept}`,C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C={...F,fontSize:16},t[21]=C):C=t[21];let w;t[22]!==x||t[23]!==S?(w=(0,N.jsx)(`button`,{type:`button`,onClick:x,title:`Forget this concept`,"aria-label":S,style:C,children:`×`}),t[22]=x,t[23]=S,t[24]=w):w=t[24];let T;t[25]!==b||t[26]!==w||t[27]!==_||t[28]!==y?(T=(0,N.jsxs)(`div`,{style:h,children:[_,y,b,w]}),t[25]=b,t[26]=w,t[27]=_,t[28]=y,t[29]=T):T=t[29];let E;t[30]!==m||t[31]!==o||t[32]!==i||t[33]!==n.body||t[34]!==n.concept||t[35]!==f?(E=i?(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`textarea`,{ref:c,value:o,onChange:e=>s(e.target.value),rows:3,"aria-label":`Edit memory: ${n.concept}`,style:{font:`inherit`,fontSize:13,lineHeight:1.4,color:`var(--text-primary)`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:6,padding:`6px 8px`,resize:`vertical`,width:`100%`,boxSizing:`border-box`}}),(0,N.jsxs)(`div`,{style:{display:`flex`,gap:8,justifyContent:`flex-end`},children:[(0,N.jsx)(`button`,{type:`button`,onClick:m,style:{...F,fontSize:12},children:`Cancel`}),(0,N.jsx)(`button`,{type:`button`,onClick:f,disabled:!o.trim(),style:{...F,fontSize:12,color:`var(--presence)`,fontWeight:600},children:`Save`})]})]}):(0,N.jsx)(`span`,{style:{color:`var(--text-primary)`,lineHeight:1.4},children:n.body}),t[30]=m,t[31]=o,t[32]=i,t[33]=n.body,t[34]=n.concept,t[35]=f,t[36]=E):E=t[36];let D;return t[37]!==T||t[38]!==E?(D=(0,N.jsxs)(`li`,{style:P,children:[T,E]}),t[37]=T,t[38]=E,t[39]=D):D=t[39],D}function I(e){let t=e.concept.indexOf(`.`);return t<0?e.concept:e.concept.slice(0,t)}function Se(e){return{profile:`About you`,preferences:`Preferences`,topics:`Topics`,threads:`Open threads`,projects:`Projects`,work:`Work`,life:`Life`}[e]??e.slice(0,1).toUpperCase()+e.slice(1)}function Ce(e){let t=new Map;for(let n of e){let e=I(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.keys()].sort((e,t)=>e===`profile`?-1:t===`profile`?1:e.localeCompare(t)).map(e=>({namespace:e,nodes:t.get(e).slice().sort((e,t)=>t.updatedAt-e.updatedAt)}))}function L(e){if(!e)return``;try{return new Date(e).toISOString().split(`T`)[0]}catch{return``}}function R(e){let t=L(e.updatedAt);return`${t?`---\nconcept: ${e.concept}\nupdated: ${t}\n---`:`---\nconcept: ${e.concept}\n---`}\n\n${e.body}`}function z(e){return e.length?[...e].sort((e,t)=>e.concept===`profile`?-1:t.concept===`profile`?1:e.concept.localeCompare(t.concept)).map(R).join(`
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`):``}function we(e){let t=z(e);if(t)try{let e=new Blob([t],{type:`text/markdown;charset=utf-8`}),n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=`mavea-memory.md`,r.click(),URL.revokeObjectURL(n)}catch{}}var B=420,V=300,H=6,U=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-soft)`,`var(--insight-soft)`,`var(--warning-soft)`],W={profile:U[0],preferences:U[3],topics:U[1],threads:U[4],projects:U[2]};function Te(e){return W[e]??U[Ee(e)%U.length]}function Ee(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return Math.abs(t)}function De(e){let t=[],n=new Set,r=(e,t)=>[e,t].sort().join(`\0`),i=e.filter(e=>e.updatedAt>0).sort((e,t)=>e.updatedAt-t.updatedAt);for(let e=0;e<i.length;e++)for(let a=e+1;a<i.length&&i[a].updatedAt-i[e].updatedAt<200;a++){let o=r(i[e].concept,i[a].concept);n.has(o)||(n.add(o),t.push({a:i[e].concept,b:i[a].concept,cooccurred:!0}))}let a=new Set(e.map(e=>e.concept));for(let i of e){let e=i.concept.split(`.`)[0];if(e!==i.concept&&a.has(e)){let a=r(i.concept,e);n.has(a)||(n.add(a),t.push({a:i.concept,b:e,cooccurred:!1}))}}return t}function G(e,t){let n=[...e].sort((e,t)=>e.concept.localeCompare(t.concept)),r=new Map;n.forEach((e,t)=>{let i=t/Math.max(1,n.length)*Math.PI*2,a=Math.min(B,V)*.3;r.set(e.concept,{x:B/2+Math.cos(i)*a,y:V/2+Math.sin(i)*a,vx:0,vy:0})});let i=[...r.values()],a=.82;for(let e=0;e<80;e++){let o=1-e/80,s=.08*Math.sqrt(B*V/Math.max(1,n.length));for(let e=0;e<i.length;e++){let t=i[e];for(let n=e+1;n<i.length;n++){let e=i[n],r=e.x-t.x||.01,a=e.y-t.y||.01,c=Math.hypot(r,a)||.01,l=s*s/c*1.5;t.vx-=r/c*l*o,t.vy-=a/c*l*o,e.vx+=r/c*l*o,e.vy+=a/c*l*o}}for(let e of t){let t=r.get(e.a),n=r.get(e.b);if(!t||!n)continue;let i=n.x-t.x,a=n.y-t.y,s=Math.hypot(i,a)||.01,c=(s-(e.cooccurred?85:120))*.05*o;t.vx+=i/s*c,t.vy+=a/s*c,n.vx-=i/s*c,n.vy-=a/s*c}for(let e of r.values())e.vx+=(B/2-e.x)*.006*o,e.vy+=(V/2-e.y)*.006*o;let c=0;for(let e of i){let t=Math.abs(e.vx)+Math.abs(e.vy);t>c&&(c=t),e.x=Math.max(20,Math.min(B-20,e.x+e.vx)),e.y=Math.max(20,Math.min(V-20,e.y+e.vy)),e.vx*=a,e.vy*=a}if(c<.4)break}let o=new Map;for(let[e,t]of r)o.set(e,{x:t.x,y:t.y});return o}function Oe(e){let t=(0,j.c)(39),{nodes:n}=e,[r,i]=(0,M.useState)(null),[a,o]=(0,M.useState)(null),s;t[0]===n?s=t[1]:(s=De(n),t[0]=n,t[1]=s);let c=s,l;t[2]!==c||t[3]!==n?(l=G(n,c),t[2]=c,t[3]=n,t[4]=l):l=t[4];let u=l,d;t[5]===c?d=t[6]:(d=c.filter(ke),t[5]=c,t[6]=d);let f=d.length,p;t[7]!==a||t[8]!==n?(p=a?n.find(e=>e.concept===a):null,t[7]=a,t[8]=n,t[9]=p):p=t[9];let m=p;if(n.length===0){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,N.jsx)(`div`,{className:`mg-empty`,children:`Your knowledge graph appears here as you talk — start a conversation to add concepts.`}),t[10]=e):e=t[10],e}let h;if(t[11]!==c||t[12]!==r||t[13]!==u){let e;t[15]!==r||t[16]!==u?(e=(e,t)=>{let n=u.get(e.a),i=u.get(e.b);if(!n||!i)return null;let a=r===e.a||r===e.b,o=e.cooccurred?.55:.2;return(0,N.jsx)(`line`,{x1:n.x,y1:n.y,x2:i.x,y2:i.y,className:`mg-edge`+(e.cooccurred?` mg-edge--strong`:``),style:{opacity:r?a?o+.3:.05:o}},t)},t[15]=r,t[16]=u,t[17]=e):e=t[17],h=c.map(e),t[11]=c,t[12]=r,t[13]=u,t[14]=h}else h=t[14];let g;if(t[18]!==a||t[19]!==r||t[20]!==n||t[21]!==u){let e;t[23]!==a||t[24]!==r||t[25]!==u?(e=e=>{let t=u.get(e.concept);if(!t)return null;let n=Te(I(e)),s=Math.max(7,Math.min(18,7+e.body.length/400*11)),c=r===e.concept,l=a===e.concept,d=e.concept.split(`.`).pop()??e.concept,f=oe(e.source),p=e.kind===`procedural`,m=l?1:f?.82:.42,h=p||l||!f?n:`none`,g=p?2:l?1.5:+!f;return(0,N.jsxs)(`g`,{className:`mg-node`,transform:`translate(${t.x},${t.y})`,onMouseEnter:()=>i(e.concept),onMouseLeave:()=>i(null),onClick:()=>o(l?null:e.concept),style:{opacity:r&&!c?.3:1},children:[(0,N.jsx)(`title`,{children:`${e.concept} · ${f?`confirmed`:`unconfirmed`}${p?` · lesson`:``}`}),c&&(0,N.jsx)(`circle`,{r:s+5,fill:n,style:{opacity:.15},"aria-hidden":`true`}),(0,N.jsx)(`circle`,{r:s,fill:n,style:{opacity:m},stroke:h,strokeWidth:g,strokeDasharray:f?void 0:`3 2`,strokeOpacity:.5}),(0,N.jsx)(`text`,{className:`mg-label`,y:s+13,textAnchor:`middle`,style:{fill:n,opacity:c||l?1:.65},children:d})]},e.concept)},t[23]=a,t[24]=r,t[25]=u,t[26]=e):e=t[26],g=n.map(e),t[18]=a,t[19]=r,t[20]=n,t[21]=u,t[22]=g}else g=t[22];let _;t[27]!==h||t[28]!==g?(_=(0,N.jsxs)(`svg`,{className:`mg-svg`,viewBox:`0 0 ${B} ${V}`,width:`100%`,height:`auto`,"aria-label":`Memory concept graph`,children:[h,g]}),t[27]=h,t[28]=g,t[29]=_):_=t[29];let v;t[30]===m?v=t[31]:(v=m&&(0,N.jsxs)(`div`,{className:`mg-detail`,onClick:()=>o(null),title:`Click to close`,role:`button`,tabIndex:0,onKeyDown:e=>e.key===`Enter`&&o(null),children:[(0,N.jsx)(`span`,{className:`mg-detail-concept`,children:m.concept}),(0,N.jsx)(`p`,{className:`mg-detail-body`,children:m.body})]}),t[30]=m,t[31]=v);let y;t[32]!==n.length||t[33]!==f?(y=n.length<H?(0,N.jsxs)(`div`,{className:`mg-warmup`,children:[(0,N.jsx)(`div`,{className:`mg-warmup-track`,children:(0,N.jsx)(`div`,{className:`mg-warmup-fill`,style:{width:`${n.length/H*100}%`}})}),(0,N.jsxs)(`span`,{className:`mg-warmup-label`,children:[H-n.length,` more`,` `,H-n.length===1?`concept`:`concepts`,` until your map fills in`]})]}):(0,N.jsxs)(`p`,{className:`mg-foot`,children:[f,` connection`,f===1?``:`s`,` across `,n.length,` `,`concepts`]}),t[32]=n.length,t[33]=f,t[34]=y):y=t[34];let b;return t[35]!==_||t[36]!==v||t[37]!==y?(b=(0,N.jsxs)(`div`,{className:`mg-wrap`,children:[_,v,y]}),t[35]=_,t[36]=v,t[37]=y,t[38]=b):b=t[38],b}function ke(e){return e.cooccurred}n();function Ae({children:e,label:t=`More options`,defaultOpen:n=!1}){let[r,i]=(0,M.useState)(n);return(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,N.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,style:{display:`flex`,alignItems:`center`,gap:6,alignSelf:`flex-start`,padding:`4px 2px`,border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12,fontWeight:600,letterSpacing:`0.02em`},children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,transition:`transform 150ms ease`,transform:r?`rotate(90deg)`:`none`,fontSize:10},children:`▶`}),t]}),r&&(0,N.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12,paddingLeft:10,borderLeft:`2px solid var(--line)`},children:e})]})}function je(e){return{padding:`5px 14px`,borderRadius:8,border:`1px solid ${e?`var(--presence)`:`var(--line)`}`,background:e?`color-mix(in oklab, var(--presence) 12%, var(--surface-elevated))`:`var(--surface-default)`,color:e?`var(--presence)`:`var(--text-secondary)`,cursor:`pointer`,font:`inherit`,fontSize:12,fontWeight:e?600:400}}var Me={background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:16,padding:16,display:`flex`,flexDirection:`column`,gap:12,width:`min(460px, calc(100vw - 32px))`,boxShadow:`var(--shadow-modal)`},K={fontSize:12,color:`var(--text-muted)`,textTransform:`uppercase`,letterSpacing:`0.06em`},q={background:`var(--surface-default)`,border:`1px solid var(--line)`,borderRadius:10,padding:`9px 11px`,color:`var(--text-primary)`,font:`inherit`,width:`100%`};function Ne(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Pe(e){let t=_(e);if(t){p(`mavea`,t.kokoro);try{localStorage.setItem(y,e)}catch{}}}function J(e){let t=(0,j.c)(25),{label:n,on:r,onToggle:i,note:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={display:`flex`,alignItems:`flex-start`,gap:10},t[0]=o):o=t[0];let s=r?`var(--presence)`:`var(--track)`,c;t[1]===s?c=t[2]:(c={flex:`0 0 auto`,width:38,height:22,borderRadius:999,border:`1px solid var(--line-strong)`,background:s,position:`relative`,cursor:`pointer`,transition:`background 140ms ease`,marginTop:1},t[1]=s,t[2]=c);let l=r?18:2,u=r?`#fff`:`var(--text-muted)`,d;t[3]!==l||t[4]!==u?(d=(0,N.jsx)(`span`,{style:{position:`absolute`,top:2,left:l,width:16,height:16,borderRadius:`50%`,background:u,transition:`left 140ms ease, background 140ms ease`}}),t[3]=l,t[4]=u,t[5]=d):d=t[5];let f;t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==c||t[10]!==d?(f=(0,N.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":n,onClick:i,style:c,children:d}),t[6]=n,t[7]=r,t[8]=i,t[9]=c,t[10]=d,t[11]=f):f=t[11];let p,m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p={display:`flex`,flexDirection:`column`,gap:2},m={fontSize:13},t[12]=p,t[13]=m):(p=t[12],m=t[13]);let h;t[14]===n?h=t[15]:(h=(0,N.jsx)(`span`,{style:m,children:n}),t[14]=n,t[15]=h);let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g={fontSize:12,color:`var(--text-muted)`},t[16]=g):g=t[16];let _;t[17]===a?_=t[18]:(_=(0,N.jsx)(`span`,{style:g,children:a}),t[17]=a,t[18]=_);let v;t[19]!==h||t[20]!==_?(v=(0,N.jsxs)(`div`,{style:p,children:[h,_]}),t[19]=h,t[20]=_,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==f?(y=(0,N.jsxs)(`div`,{style:o,children:[f,v]}),t[22]=v,t[23]=f,t[24]=y):y=t[24],y}function Y(e){let t=(0,j.c)(11),{value:n,options:r,onPick:i,label:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={display:`flex`,gap:4,padding:3,borderRadius:10,background:`var(--track)`,border:`1px solid var(--line)`},t[0]=o):o=t[0];let s;if(t[1]!==i||t[2]!==r||t[3]!==n){let e;t[5]!==i||t[6]!==n?(e=e=>{let t=e.value===n;return(0,N.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>i(e.value),style:{flex:1,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:1,padding:`6px 8px`,borderRadius:8,border:`none`,cursor:`pointer`,background:t?`var(--surface-elevated)`:`transparent`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.12)`:`none`,color:`inherit`,font:`inherit`},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:t?600:400},children:e.label}),e.badge&&(0,N.jsx)(`span`,{style:{fontSize:10.5,color:`var(--text-muted)`},children:e.badge})]},e.value)},t[5]=i,t[6]=n,t[7]=e):e=t[7],s=r.map(e),t[1]=i,t[2]=r,t[3]=n,t[4]=s}else s=t[4];let c;return t[8]!==a||t[9]!==s?(c=(0,N.jsx)(`div`,{role:`radiogroup`,"aria-label":a,style:o,children:s}),t[8]=a,t[9]=s,t[10]=c):c=t[10],c}function X({onClose:e,initialTab:t,initialAdvancedYouOpen:n}){let[o]=ae(),{style:p,newPerDay:oe}=E(),ce=D(),A=C(o.provider),j=o.models[o.provider]??``,P=j||A.defaultModel,F=o.keys[o.provider]??``,I=S(o.provider).capabilities,L=ve(),R=(0,M.useMemo)(()=>Math.max(1,Math.round(JSON.stringify(L).length/1024)),[L]),z=he(),[B,V]=(0,M.useState)(me),[H,U]=(0,M.useState)(`list`),[W,Te]=(0,M.useState)(t??`model`),[Ee,De]=(0,M.useState)(!1),[G,ke]=(0,M.useState)(null),[X,Fe]=(0,M.useState)(!1),Ie=(0,M.useRef)(0),Le=(0,M.useRef)(null),[Re,ze]=(0,M.useState)(null),Be=(0,M.useRef)(null),[Ve,Z]=(0,M.useState)(null),[He,Q]=(0,M.useState)(null),Ue=(0,M.useRef)(null);f(Ue,{onEscape:e});function We(){let e=ie(),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`mavea-live-v2.json`,r.click(),URL.revokeObjectURL(n)}function Ge(e){let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{try{te(n.result),ze(null)}catch(e){ze(e instanceof Error?e.message:`Import failed.`)}},n.readAsText(t),e.target.value=``}async function Ke(){Q(null),Z(null);try{let{downloadBackup:e}=await c(async()=>{let{downloadBackup:e}=await import(`./backup-BdeBr3wq.js`);return{downloadBackup:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));e(),Z(`Backup downloaded.`)}catch{Q(`Couldn’t build the backup — please try again.`)}}function qe(e){let t=e.target.files?.[0];if(!t)return;if(Q(null),Z(null),t.size>25e6){Q(`That file is too large to be a Mavéa backup.`),e.target.value=``;return}let n=new FileReader;n.onload=()=>{(async()=>{try{let{importBackup:e}=await c(async()=>{let{importBackup:e}=await import(`./backup-BdeBr3wq.js`);return{importBackup:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),t=e(n.result),r=[[t.dashboards,`dashboard`],[t.memory,`memory`],[t.flashcards,`card`],[t.library,`saved canvas`,`saved canvases`],[t.atlas,`map record`],[t.courses,`course`]].filter(([e])=>e>0).map(([e,t,n])=>`${e} ${e===1?t:n??`${t}s`}`);Z(r.length?`Merged ${r.join(`, `)}.`:`Nothing new to merge from that file.`)}catch(e){Q(e instanceof Error?e.message:`Import failed.`)}})()},n.readAsText(t),e.target.value=``}let[Je,Ye]=(0,M.useState)(()=>Ne(y,v)),[Xe,Ze]=(0,M.useState)(()=>m()),Qe=(0,M.useCallback)(e=>{Ze(e),g(e),b()},[]),[$e,et]=(0,M.useState)(()=>a()),tt=(0,M.useCallback)(e=>{et(e),u(e),s(l())},[]),$=(0,M.useCallback)(async()=>{let e=++Ie.current;Fe(!0);let{checkLiveReady:t}=await c(async()=>{let{checkLiveReady:e}=await import(`./shapes-Cw7tCHIp.js`).then(e=>e.s);return{checkLiveReady:e}},__vite__mapDeps([20,3,15,16,17,8,9])),n=await t(ne(re()),{tts:!1});e===Ie.current&&(ke({llm:n.llm,model:n.model,statusCode:n.statusCode}),Fe(!1))},[]);(0,M.useEffect)(()=>{let e=setTimeout(()=>void $(),400);return()=>clearTimeout(e)},[o.provider,P,F,$]);let nt=X?`var(--text-muted)`:G?.llm&&G?.model?`var(--insight)`:`var(--warning)`,rt=X?`Checking…`:G?.llm&&G?.model?`Ready`:G?.llm?`Reachable — model not found`:A.needsKey&&!F?`Add your API key`:G?.statusCode===401||G?.statusCode===400?`Invalid API key`:G?.statusCode===403?`Key lacks permission`:G?.statusCode===404?`Model not found`:G?.statusCode===void 0?`Not reachable`:`Error ${G.statusCode}`;return(0,N.jsxs)(`div`,{ref:Ue,style:Me,role:`dialog`,"aria-modal":`true`,"aria-label":`Mavéa settings`,children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,N.jsxs)(`span`,{style:{fontWeight:700,fontSize:15,display:`flex`,alignItems:`center`,gap:8},children:[(0,N.jsx)(d.sparkle,{style:{width:16,height:16,flex:`0 0 auto`,color:`var(--presence)`}}),`Settings`]}),e&&(0,N.jsx)(`button`,{onClick:e,title:`Close`,"aria-label":`Close settings`,style:{display:`inline-grid`,placeItems:`center`,width:28,height:28,padding:0,border:`none`,borderRadius:6,background:`transparent`,color:`var(--text-secondary)`,cursor:`pointer`,flexShrink:0},children:(0,N.jsx)(d.x,{style:{width:16,height:16}})})]}),(0,N.jsx)(`div`,{className:`ls-tabs`,role:`tablist`,"aria-label":`Settings sections`,children:[`model`,`settings`,`you`,`data`].map(e=>(0,N.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":W===e,className:`ls-tab${W===e?` active`:``}`,onClick:()=>Te(e),children:e===`model`?`Model`:e===`settings`?`Settings`:e===`you`?`You`:`Your data`},e))}),(0,N.jsxs)(`div`,{className:`ls-body`,children:[W===`model`&&(0,N.jsxs)(`div`,{className:`settings-model-connect`,children:[(0,N.jsx)(`div`,{className:`settings-provider-picker`,style:{display:`flex`,flexWrap:`wrap`,gap:8},"aria-label":`Model providers`,children:w.map(e=>{let t=e.id===o.provider;return(0,N.jsx)(`button`,{onClick:()=>O({provider:e.id}),style:{...q,width:`auto`,cursor:`pointer`,borderColor:t?`var(--presence)`:`var(--line)`,boxShadow:t?`0 0 0 1px var(--presence)`:`none`,opacity:t?1:.7},"aria-pressed":t,children:e.label},e.id)})}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:K,children:`Model`}),(0,N.jsx)(fe,{provider:o.provider,value:j,onChange:e=>k(o.provider,`model`,e)},o.provider)]}),A.needsKey&&(0,N.jsxs)(`label`,{className:`settings-api-key-field`,style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,N.jsx)(`span`,{style:K,children:`API key`}),!o.rememberKey&&(0,N.jsx)(`span`,{className:`settings-session-only`,"aria-label":`Key is not saved to disk`,children:`session only`})]}),(0,N.jsx)(`input`,{style:q,type:`password`,value:F,onChange:e=>k(o.provider,`key`,e.target.value),placeholder:o.provider===`anthropic`?`sk-ant-…`:`paste your key`,spellCheck:!1,autoComplete:`off`}),(0,N.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:[`Kept in memory unless Remember is on — sent through this deployment to`,` `,A.label.split(` · `)[1]??A.label,` when used.`]})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13},children:[(0,N.jsx)(`span`,{style:{width:8,height:8,borderRadius:8,background:nt,flex:`0 0 auto`},"aria-hidden":!0}),(0,N.jsx)(`span`,{children:rt}),(0,N.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`·`}),(0,N.jsx)(`span`,{style:{color:`var(--text-muted)`},children:A.hint}),(0,N.jsx)(`button`,{onClick:()=>void $(),style:{marginLeft:`auto`,background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`4px 10px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},title:`Re-check readiness`,children:`Recheck`})]}),A.needsKey&&(0,N.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13},children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:o.rememberKey,onChange:e=>O({rememberKey:e.target.checked})}),(0,N.jsx)(`span`,{children:`Remember key on this device`}),(0,N.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:12},children:o.rememberKey?`encrypted in this browser — trusted devices only`:`kept in memory only — cleared on reload`})]}),(0,N.jsx)(de,{}),(0,N.jsxs)(`div`,{className:`settings-transfer-row`,children:[(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:We,children:`Export settings`}),(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:()=>Le.current?.click(),children:`Import settings`}),(0,N.jsx)(`input`,{ref:Le,type:`file`,accept:`application/json,.json`,style:{display:`none`},"aria-hidden":`true`,onChange:Ge}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`API and search keys are never included.`}),Re&&(0,N.jsx)(`span`,{className:`settings-import-error`,role:`alert`,children:Re})]})]}),W===`settings`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ee,{}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Web search`}),(0,N.jsx)(Y,{value:o.searchMode,options:[{value:`off`,label:`Off`},{value:`realtime`,label:`Real-time`}],onPick:e=>O({searchMode:e})}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:o.searchMode===`off`?`Answers from the model's own knowledge — no web calls.`:I.nativeWebSearch?`Grounds fresh asks in live results with citations when a question needs it.`:`This model has no built-in search, so Real-time won't ground anything right now. The four direct providers support it; on OpenRouter it depends on the selected model. Pick a search-capable model or leave this off.`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Explanation level`}),(0,N.jsx)(Y,{value:o.explainLevel,options:[{value:`simple`,label:`Simple`,badge:`like I'm 5`},{value:`standard`,label:`Standard`,badge:`default`},{value:`deep`,label:`In-depth`,badge:`full rigor`}],onPick:e=>O({explainLevel:e})}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`How answers are written: Simple uses shorter sentences, everyday analogies, and fewer, more-labelled visuals; In-depth goes further — mechanisms, numbers, edge cases. You can also just say "explain it simpler" or "go deeper". (How long Mavéa thinks is Thinking time, below.)`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Thinking time`}),(0,N.jsx)(Y,{value:o.quality,options:[{value:`fast`,label:`Fast`,badge:`snappiest`},{value:`balanced`,label:`Balanced`,badge:`default`},{value:`thorough`,label:`Thorough`,badge:`thinks longer`}],onPick:e=>O({quality:e})}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`How long Mavéa reasons before answering — speed versus care on hard questions. (How the answer is written is Explanation level, above.)`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Visual richness`}),(0,N.jsx)(Y,{value:$e,options:[{value:`auto`,label:`Auto`,badge:`recommended`},{value:`full`,label:`Full`},{value:`lite`,label:`Lite`,badge:`older machines`}],onPick:e=>tt(e)}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Auto matches the effects to your machine. Lite calms the animated face and drops the glass blur so Mavéa stays smooth on older or lower-powered computers.`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Voice`}),(0,N.jsx)(Y,{value:Xe,options:[{value:`auto`,label:`Auto`,badge:`recommended`},{value:`kokoro`,label:`Natural`,badge:`needs Docker`},{value:`browser`,label:`System`,badge:`older machines`}],onPick:e=>Qe(e)}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Natural is Kokoro, the voice Mavéa is built around — it needs the Docker container and a machine that can keep up with it. System is your computer’s own voice: plainer, but it costs nothing and stays in step on older hardware. Without either, lines appear as captions.`})]}),(0,N.jsxs)(Ae,{children:[(0,N.jsx)(J,{label:`Pen mode`,on:o.annotationsEnabled,onToggle:()=>{let e=!o.annotationsEnabled;O({annotationsEnabled:e,teachMode:e})},note:`Mavéa draws on the canvas as it speaks — circling numbers, striking out misconceptions, annotating every walkthrough stop. Muted walks also write margin notes beside the cards, so you keep the marked-up answer. Off: the pen stays quiet entirely.`}),o.searchMode!==`off`&&(0,N.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-muted)`,display:`flex`,gap:6},children:[(0,N.jsx)(d.globe,{style:{width:14,height:14,flex:`0 0 auto`,marginTop:1}}),`You'll see "Searching…" whenever a search actually runs.`]}),(0,N.jsx)(J,{label:`Keep a library`,on:o.libraryEnabled,onToggle:()=>O({libraryEnabled:!o.libraryEnabled}),note:`Saves the canvases you generate on this device so you can pick any one back up from the welcome screen. On by default; turn it off or clear the library any time.`}),o.libraryEnabled&&z.length>0&&(0,N.jsx)(`div`,{style:{marginLeft:48},children:(0,N.jsxs)(`button`,{type:`button`,onClick:()=>le(),style:{background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`3px 9px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},children:[`Clear library (`,z.length,`)`]})})]})]}),W===`you`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(x,{kind:`stored-data`,from:`live`}),(0,N.jsx)(J,{label:`Remember me`,on:o.memoryEnabled,onToggle:()=>O({memoryEnabled:!o.memoryEnabled}),note:`Stored facts stay on this device. While Memory is enabled, relevant facts are included in future requests to your selected model provider. You can inspect, edit, export, or forget each stored fact below.`}),o.memoryEnabled&&(0,N.jsxs)(`div`,{style:{marginLeft:48,display:`flex`,flexDirection:`column`,gap:8},children:[L.length===0?(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Nothing remembered yet — Mavéa will build a concept wiki as you talk.`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,N.jsx)(`div`,{style:{display:`flex`,gap:2,padding:2,borderRadius:8,background:`var(--track)`,border:`1px solid var(--line)`,alignSelf:`flex-start`},children:[`list`,`graph`].map(e=>(0,N.jsx)(`button`,{type:`button`,onClick:()=>U(e),style:{padding:`4px 12px`,borderRadius:6,border:`none`,background:H===e?`var(--surface-elevated)`:`transparent`,boxShadow:H===e?`0 1px 2px rgba(0,0,0,0.1)`:`none`,color:H===e?`var(--text-primary)`:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12,fontWeight:H===e?600:400},children:e===`list`?`Concepts`:`Graph`},e))}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>se(),style:{background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`3px 9px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},children:`Forget all`})]}),H===`graph`?(0,N.jsx)(Oe,{nodes:L}):(0,N.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,maxHeight:280,overflowY:`auto`},children:Ce(L).map(({namespace:e,nodes:t})=>(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontFamily:`var(--font-data, inherit)`,fontSize:10,letterSpacing:`0.14em`,textTransform:`uppercase`,color:`var(--text-muted)`,margin:`2px 2px 0`},children:Se(e)}),(0,N.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:6},children:t.map(e=>(0,N.jsx)(xe,{node:e,ago:T(e.updatedAt)},e.id))})]},e))}),(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,N.jsxs)(`span`,{style:{fontSize:11.5,color:`var(--text-muted)`},children:[L.length,` `,L.length===1?`concept`:`concepts`,` · `,R,` KB on this device`]}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>we(L),style:{background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`3px 9px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},children:`Export memory`})]})]}),(0,N.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-muted)`,display:`flex`,gap:6},children:[(0,N.jsx)(d.sparkle,{style:{width:14,height:14,flex:`0 0 auto`,marginTop:1}}),`Stored on this device, and sent to ${A.label.split(` · `)[1]??A.label} inside each prompt to personalize answers — the same path as your questions.`]})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,N.jsx)(`span`,{style:K,children:`Voice`}),(0,N.jsx)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4,flex:1},children:[(0,N.jsx)(`span`,{style:{fontSize:11,color:`var(--text-muted)`},children:`Mavéa`}),(0,N.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,N.jsx)(`div`,{style:{flex:1},children:(0,N.jsx)(ye,{ariaLabel:`Mavéa's voice`,value:Je,onChange:e=>{Ye(e),Pe(e);let t=_(e);t&&pe(t)},options:h.map(e=>({value:e.id,label:e.label,note:e.tone}))})}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>{let e=_(Je);e&&pe(e)},style:{...q,width:`auto`,padding:`6px 10px`,cursor:`pointer`,fontSize:11},title:`Preview voice`,"aria-label":`Preview Mavéa's voice`,children:`▶`})]})]})}),(0,N.jsx)(_e,{})]}),ce.total>0&&(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Flashcards`}),(0,N.jsx)(Y,{label:`Flashcards`,value:p,options:[{value:`collection`,label:`Just save them`},{value:`spaced`,label:`Help me remember`}],onPick:e=>be(e)}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:p===`collection`?`A plain pile you flip through when you feel like it. No dates, no counts, nothing waiting for you.`:`Each card comes back just before you'd forget it. New ones join ${oe} a day, so a big pile never lands at once.`})]}),(0,N.jsxs)(Ae,{defaultOpen:n,children:[(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-muted)`},children:[`Hold to talk key `,(0,N.jsx)(`span`,{style:{opacity:.6},children:`(tap mode only)`})]}),(0,N.jsx)(`div`,{style:{display:`flex`,gap:6},children:[{key:`Alt`,label:`Alt`},{key:`Control`,label:`Ctrl`},{key:`Shift`,label:`Shift`}].map(({key:e,label:t})=>{let n=(o.pttKey||`Alt`)===e;return(0,N.jsx)(`button`,{type:`button`,onClick:()=>O({pttKey:e}),style:je(n),"aria-pressed":n,title:`Hold ${t} to talk (shows as ${ue(e,o.pttSide)} in the hint)`,children:t},e)})}),(0,N.jsx)(`div`,{style:{display:`flex`,gap:6},children:[{side:`any`,label:`Either side`},{side:`left`,label:`Left`},{side:`right`,label:`Right`}].map(({side:e,label:t})=>{let n=(o.pttSide||`any`)===e;return(0,N.jsx)(`button`,{type:`button`,onClick:()=>O({pttSide:e}),style:je(n),"aria-pressed":n,title:e===`any`?`Either side of the key talks`:`Only the ${t.toLowerCase()} key talks`,children:t},e)})})]}),(0,N.jsx)(J,{label:`Morning brief`,on:o.morningBrief,onToggle:()=>O({morningBrief:!o.morningBrief}),note:`On the first open of the day, Mavéa opens with a quick read on the things you track.`}),(0,N.jsx)(J,{label:`Save flashcards automatically`,on:o.autoSaveFlashcards,onToggle:()=>O({autoSaveFlashcards:!o.autoSaveFlashcards}),note:`When an answer already contains flashcards, keep them without asking. Off by default — the usual way is tapping “Cards” on the answer you want. Every save shows a pill with Undo, so it's never silent.`}),(0,N.jsx)(J,{label:`Quiet hours`,on:B,onToggle:()=>{ge(!B),V(!B)},note:`10 PM – 6 AM: the screen dims and the voice drops to a murmur — won't wake anyone.`})]})]}),W===`data`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(x,{kind:`stored-data`,from:`live`}),(0,N.jsxs)(`p`,{style:{fontSize:13,lineHeight:1.5,color:`var(--text-secondary)`,margin:0},children:[`Export a backup, or import one you saved.`,` `,(0,N.jsx)(`strong`,{children:`Stored only in this browser.`}),` Because your data is encrypted to this exact browser, copying it to incognito, another port, or another computer won’t work — export a backup here and import it there.`]}),(0,N.jsxs)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12,lineHeight:1.6,color:`var(--text-muted)`},children:[(0,N.jsx)(`li`,{children:`Includes your dashboards, memory, flashcards, saved canvases, map, and courses.`}),(0,N.jsxs)(`li`,{children:[`Your API keys are `,(0,N.jsx)(`strong`,{children:`never included`}),` — you’ll re-enter them on a new device.`]}),(0,N.jsxs)(`li`,{children:[`Importing `,(0,N.jsx)(`strong`,{children:`merges`}),` — it adds and updates, and never erases what’s already here.`]}),(0,N.jsx)(`li`,{children:`The file is plain, unencrypted JSON: keep it somewhere safe, import only files you trust.`})]}),(0,N.jsxs)(`div`,{className:`settings-transfer-row`,children:[(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:()=>void Ke(),children:`Export all my data`}),(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:()=>Be.current?.click(),children:`Import a backup`}),(0,N.jsx)(`input`,{ref:Be,type:`file`,accept:`application/json,.json`,style:{display:`none`},"aria-hidden":`true`,onChange:qe}),Ve&&(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},role:`status`,children:Ve}),He&&(0,N.jsx)(`span`,{className:`settings-import-error`,role:`alert`,children:He})]})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:`6px 12px`,paddingTop:14,borderTop:`1px solid var(--line-soft)`,color:`var(--text-muted)`,fontSize:10.5},children:[(0,N.jsx)(`a`,{href:`#/terms?from=live`,style:{color:`inherit`},children:`Terms`}),(0,N.jsx)(`a`,{href:`#/privacy?from=live`,style:{color:`inherit`},children:`Privacy`}),(0,N.jsx)(`a`,{href:`#/legal?from=live`,style:{color:`inherit`},children:`Important information`}),(0,N.jsx)(`a`,{href:i(`LICENSE.txt`),target:`_blank`,rel:`noreferrer noopener`,style:{color:`inherit`},children:`License`}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>{r(),De(!0)},style:{marginLeft:`auto`,padding:0,border:0,color:`inherit`,background:`transparent`,font:`inherit`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`},children:Ee?`Review will appear next visit`:`Review acknowledgement again`})]})]})]})}export{X as LiveSettings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-C7H7A1rW.js";import{D as r,H as i,V as a,b as o,p as s,y as c}from"./useStudy-Diy4ITBm.js";import{l,n as u}from"./useDashboardLoop-DzbRz-V9.js";/* empty css */import"./DashboardsApp-Dc43FBIi.js";import{t as d}from"./relate-DxAi8xpo.js";var f=e(),p=n();function m(e){return e*4}function h(e,t,n,r={}){let i=`template:${e.id}`,a=new Map,o=[];e.metrics.forEach((e,i)=>{if(r.metrics?.[i]===!1)return;let s=`m-${n}-${i}`,c=e.label(t);a.set(i,s),o.push({id:s,label:c,query:e.query(t),...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},lastValue:null,origin:`empty`})});let s=[];e.tripwires.forEach((e,i)=>{if(!(r.tripwires?.[i]??e.enabledByDefault))return;let o=a.get(e.metricIndex);if(!o)return;let c=e.label(t);s.push({id:`t-${n}-${i}`,label:c,metricId:o,comparator:e.comparator,threshold:e.threshold,...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},state:`AWAITING`})});let c=[],l=[];return e.widgets.forEach((e,s)=>{if(r.widgets?.[s]===!1)return;if(e.metricIndex!==void 0){let t=a.get(e.metricIndex);if(!t)return;let r=o.find(e=>e.id===t);c.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:m(e.span),id:`wblk-${n}-${s}`,num:String(c.length+1),props:{title:r.label,stat:`—`,conf:`inferred`,summary:r.sourceQuote.text}},span:e.span,metricId:t,fromSource:i});return}let u=e.refreshQuery?.(t),d=e.seedProps?.(t)??{};l.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:m(e.span),id:`wblk-${n}-${s}`,props:u?{title:u,...d}:d},span:e.span,fromSource:i,...u?{refreshQuery:u}:{}})}),{metrics:o,tripwires:s,widgets:[...c,...l]}}function g(e,t,n={}){let a=n.now??Date.now(),o=`template:${e.id}`,s=e.title(t),{metrics:c,tripwires:l,widgets:u}=h(e,t,a,n.toggles),d=l.length>0,f={id:`w-thesis`,block:{type:`thesis`,col:8,id:`w-thesis`,props:{reasoning:e.thesis(t)}},span:2,fromSource:o},p={id:`w-align`,block:{type:`alignmentgauge`,col:4,id:`w-align`,props:{pct:null}},span:1,fromSource:o},m={id:`w-alerts`,block:{type:`standingalerts`,col:4,id:`w-alerts`,props:{alerts:[]}},span:1,fromSource:o},g={id:`w-sources`,block:{type:`sourceslineage`,col:8,id:`w-sources`,props:{rows:[]}},span:2,fromSource:o},_=n.cadence??e.cadence,v=c.some(e=>e.query.trim()!==``&&!e.blankKey)||u.some(e=>e.refreshQuery?.trim());return{id:r(),title:s,question:s,thesis:{text:e.thesis(t),saidAt:a},tripwires:l,metrics:c,sources:[{kind:`ORIGIN`,conversationId:o,title:e.label,contributed:`Started from the '${e.label}' template.`,at:a}],widgets:[...d?[f,p]:[],...u,...d?[m]:[],g],cadence:_,smartTrigger:d,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:a,updatedAt:a,nextDataAt:i(_,a),nextAiAt:2**53-1,lastRefreshedAt:null,...v?{oneShotAt:a,oneShotLabel:`first check`}:{}}}function _(e,t,n,r=Date.now()){let i=new Set(e.metrics.map(e=>l(e.label))),a=new Set(e.tripwires.map(e=>l(e.label))),s=h(t,n,r),c=s.metrics.filter(e=>!i.has(l(e.label))),u=new Set(c.map(e=>e.id)),d=s.tripwires.filter(e=>u.has(e.metricId)&&!a.has(l(e.label))),f=s.widgets.filter(e=>!e.metricId||u.has(e.metricId)),p=c.length+d.length,m=[];c.length&&m.push(`${c.length} metric${c.length>1?`s`:``}`),d.length&&m.push(`${d.length} alert${d.length>1?`s`:``}`);let g={kind:`ADDED`,conversationId:`template:${t.id}`,title:t.label,contributed:m.length?`Added: ${m.join(` + `)}`:`Linked the '${t.label}' template.`,at:r};return o(e.id,{metrics:c,tripwires:d,widgets:f,source:g}),p}var v={chart:{labels:[],series:[]},scoreboard:{games:[]},standings:{rows:[]},forecast:{days:[]},list:{items:[]},timeline:{events:[]}};function ee(e){return{id:`plan`,label:`Track anything`,blurb:``,input:{key:`ask`,label:`Track`,placeholder:``},title:()=>e.title,thesis:()=>`Tracking ${e.title}.`,metrics:e.metrics.map(e=>({label:()=>e.label,query:()=>e.query,...e.unit?{unit:e.unit}:{}})),tripwires:[],widgets:[...e.metrics.map((e,t)=>({blockType:`insight`,span:1,metricIndex:t})),...e.widgets.map(e=>({blockType:e.blockType,span:e.span,refreshQuery:()=>e.query,seedProps:()=>({...v[e.blockType]??{}})}))],cadence:{data:e.cadence,ai:`manual`}}}var y=t(),b={"15min":`checks every 15 minutes while open`,hourly:`checks hourly while open`,"6h":`checks every 6 hours while open`,daily:`checks daily while open`,manual:`refreshes only when you ask`};function te(e,t){let n=[...e];return n[t]=!n[t],n}function ne(e){let t=(0,p.c)(81),{plan:n,ask:r,existing:i,onDone:o}=e,[l,m]=(0,f.useState)(n.title),h;t[0]===n.metrics?h=t[1]:(h=()=>n.metrics.map(ae),t[0]=n.metrics,t[1]=h);let[v,ne]=(0,f.useState)(h),x;t[2]===n.widgets?x=t[3]:(x=()=>n.widgets.map(ie),t[2]=n.widgets,t[3]=x);let[S,se]=(0,f.useState)(x),[C,ce]=(0,f.useState)(null),[w,le]=(0,f.useState)(`manual`),T;t[4]===v?T=t[5]:(T=v.filter(Boolean),t[4]=v,t[5]=T);let ue=T.length,E;t[6]===S?E=t[7]:(E=S.filter(Boolean),t[6]=S,t[7]=E);let D=ue+E.length,de=a(w),O;t[8]!==r||t[9]!==w||t[10]!==D||t[11]!==v||t[12]!==l||t[13]!==o||t[14]!==n||t[15]!==S?(O=()=>{if(D===0)return;let e=ee(n),t=[...n.metrics.map(re),...S],i=g(e,r.trim(),{toggles:{metrics:v,widgets:t},cadence:{data:w,ai:`manual`}});i.title=l.trim()||i.title,i.question=r.trim(),s(i),u(i.id),o(i.id)},t[8]=r,t[9]=w,t[10]=D,t[11]=v,t[12]=l,t[13]=o,t[14]=n,t[15]=S,t[16]=O):O=t[16];let k=O,A;t[17]!==r||t[18]!==o||t[19]!==n?(A=e=>{_(e,ee(n),r.trim()),c(e.id),u(e.id),o(e.id)},t[17]=r,t[18]=o,t[19]=n,t[20]=A):A=t[20];let j=A,M;t[21]!==r||t[22]!==k||t[23]!==i||t[24]!==n.title?(M=()=>{let e=d(i,{text:`${n.title} ${r}`});if(e){ce(e);return}k()},t[21]=r,t[22]=k,t[23]=i,t[24]=n.title,t[25]=M):M=t[25];let fe=M;if(C){let e;t[26]===C.title?e=t[27]:(e=(0,y.jsxs)(`p`,{className:`tpl-interstitial-text`,children:[`This looks related to your existing “`,C.title,`” dashboard — fold this in instead of creating a new one?`]}),t[26]=C.title,t[27]=e);let n;t[28]!==j||t[29]!==C?(n=()=>j(C),t[28]=j,t[29]=C,t[30]=n):n=t[30];let r;t[31]!==C.title||t[32]!==n?(r=(0,y.jsxs)(`button`,{type:`button`,className:`tpl-fold-btn`,onClick:n,children:[`Fold into “`,C.title,`”`]}),t[31]=C.title,t[32]=n,t[33]=r):r=t[33];let i;t[34]===k?i=t[35]:(i=(0,y.jsx)(`button`,{type:`button`,className:`tpl-create-anyway`,onClick:k,children:`Create new anyway`}),t[34]=k,t[35]=i);let a;t[36]!==r||t[37]!==i?(a=(0,y.jsxs)(`div`,{className:`tpl-interstitial-actions`,children:[r,i]}),t[36]=r,t[37]=i,t[38]=a):a=t[38];let o;return t[39]!==a||t[40]!==e?(o=(0,y.jsxs)(`div`,{className:`tpl-interstitial`,children:[e,a]}),t[39]=a,t[40]=e,t[41]=o):o=t[41],o}let N;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Dashboard name`}),t[42]=N):N=t[42];let P;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>m(e.target.value),t[43]=P):P=t[43];let F;t[44]===l?F=t[45]:(F=(0,y.jsxs)(`label`,{className:`tpl-field`,children:[N,(0,y.jsx)(`input`,{className:`xt-name`,value:l,onChange:P,"aria-label":`Dashboard name`})]}),t[44]=l,t[45]=F);let I;t[46]!==v||t[47]!==n.metrics?(I=n.metrics.length>0&&(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Numbers to watch`}),(0,y.jsx)(`div`,{className:`tpl-chips`,children:n.metrics.map((e,t)=>(0,y.jsx)(oe,{kind:`METRIC`,label:e.label,detail:e.query,on:v[t]??!0,onToggle:()=>ne(e=>te(e,t))},`m${t}`))})]}),t[46]=v,t[47]=n.metrics,t[48]=I):I=t[48];let L;t[49]!==n.widgets||t[50]!==S?(L=n.widgets.length>0&&(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Live cards`}),(0,y.jsx)(`div`,{className:`tpl-chips`,children:n.widgets.map((e,t)=>(0,y.jsx)(oe,{kind:`CARD`,label:e.query,detail:e.blockType,on:S[t]??!0,onToggle:()=>se(e=>te(e,t))},`w${t}`))})]}),t[49]=n.widgets,t[50]=S,t[51]=L):L=t[51];let R;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,y.jsx)(`span`,{className:`xt-section-label`,children:`How often`}),t[52]=R):R=t[52];let z=`tpl-chip xt-comp--goal${w===`manual`?``:` tpl-chip-off`}`,B=w===`manual`,V,H;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>le(`manual`),H=(0,y.jsx)(`span`,{className:`tpl-chip-label`,children:`Manual — only when you ask`}),t[53]=V,t[54]=H):(V=t[53],H=t[54]);let U;t[55]!==z||t[56]!==B?(U=(0,y.jsx)(`button`,{type:`button`,className:z,"aria-pressed":B,onClick:V,children:H}),t[55]=z,t[56]=B,t[57]=U):U=t[57];let W;t[58]!==w||t[59]!==n.cadence?(W=n.cadence!==`manual`&&(0,y.jsx)(`button`,{type:`button`,className:`tpl-chip xt-comp--metric${w===n.cadence?``:` tpl-chip-off`}`,"aria-pressed":w===n.cadence,onClick:()=>le(n.cadence),title:b[n.cadence],children:(0,y.jsxs)(`span`,{className:`tpl-chip-label`,children:[`Suggested — `,b[n.cadence]]})}),t[58]=w,t[59]=n.cadence,t[60]=W):W=t[60];let G;t[61]!==U||t[62]!==W?(G=(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[R,(0,y.jsxs)(`div`,{className:`tpl-chips`,children:[U,W]})]}),t[61]=U,t[62]=W,t[63]=G):G=t[63];let K=de>0?`≈ ${de} searches/mo on your key, at this cadence.`:`No standing searches — this refreshes only when you ask.`,q;t[64]===K?q=t[65]:(q=(0,y.jsx)(`p`,{className:`dash-plan-estimate`,children:K}),t[64]=K,t[65]=q);let J=b[w],Y;t[66]===J?Y=t[67]:(Y=(0,y.jsx)(`span`,{className:`tpl-cadence-note`,children:J}),t[66]=J,t[67]=Y);let X=D===0,Z;t[68]!==fe||t[69]!==X?(Z=(0,y.jsx)(`button`,{type:`button`,className:`tpl-create`,onClick:fe,disabled:X,children:`Create dashboard →`}),t[68]=fe,t[69]=X,t[70]=Z):Z=t[70];let Q;t[71]!==Y||t[72]!==Z?(Q=(0,y.jsxs)(`div`,{className:`xt-build-row`,children:[Y,Z]}),t[71]=Y,t[72]=Z,t[73]=Q):Q=t[73];let $;return t[74]!==F||t[75]!==I||t[76]!==L||t[77]!==G||t[78]!==q||t[79]!==Q?($=(0,y.jsxs)(`div`,{className:`tpl-form`,children:[F,I,L,G,q,Q]}),t[74]=F,t[75]=I,t[76]=L,t[77]=G,t[78]=q,t[79]=Q,t[80]=$):$=t[80],$}function re(){return!0}function ie(){return!0}function ae(){return!0}function oe(e){let t=(0,p.c)(14),{kind:n,label:r,detail:i,on:a,onToggle:o}=e,s=`tpl-chip xt-comp--${n===`METRIC`?`metric`:`goal`}${a?``:` tpl-chip-off`}`,c;t[0]===n?c=t[1]:(c=(0,y.jsx)(`span`,{className:`tpl-chip-kind`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,y.jsx)(`span`,{className:`tpl-chip-label`,children:r}),t[2]=r,t[3]=l);let u=a?`Included ✓`:`Removed ✕`,d;t[4]===u?d=t[5]:(d=(0,y.jsx)(`span`,{className:`tpl-chip-state`,children:u}),t[4]=u,t[5]=d);let f;return t[6]!==i||t[7]!==a||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==d?(f=(0,y.jsxs)(`button`,{type:`button`,className:s,onClick:o,"aria-pressed":a,title:i,children:[c,l,d]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d,t[13]=f):f=t[13],f}export{ne as PlanReview};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismOverlay-9Q_14eEO.js","assets/index-C7H7A1rW.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/sourceHost-BV3t2XDb.js","assets/toast-BBNs2h3L.js","assets/penStrokes-DlHnO9xE.js","assets/gesture-Bouqjr3g.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/officeDoc-B6nEhNp4.js","assets/search-Be63DJkp.js","assets/streamParse-DRgMHWye.js","assets/useFocusTrap-DbfG6zbM.js","assets/PrismOverlay-BTfAicBt.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,M as a,N as o,ht as s,k as ee,q as c}from"./index-C7H7A1rW.js";import{n as l}from"./icons-CHVz6kv_.js";import{t as te}from"./FeatureUseNotice-CoK5HkbR.js";import{c as ne,i as re,p as ie,u as ae}from"./providers-wzm7E8Pa.js";import{t as oe}from"./homeTarget-BcZYH3DY.js";import{l as se,n as ce}from"./useLiveConfig-Lm0cYTcu.js";/* empty css */var u=s(),d=e(),f=t();r();var p=n(()=>c(()=>import(`./PrismOverlay-9Q_14eEO.js`).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),le=p.Component,m={"too-large":`File is too large. Documents up to 40 MB, images up to 10 MB.`,unsupported:`Unsupported file type. Try a PDF, Word doc, spreadsheet, image, or text file.`};function h(){let e=(0,u.c)(40),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=oe(),e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1],(0,d.useEffect)(de,r);let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],e[2]=a):a=e[2];let[o,s]=(0,d.useState)(a),[c,h]=(0,d.useState)(null),[b,x]=(0,d.useState)(!1),[S,C]=(0,d.useState)(!1),[w,T]=(0,d.useState)(null),E=(0,d.useRef)(null),D;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=se(ce()),e[3]=D):D=e[3];let fe=D,O;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(O=async e=>{if(!e||e.length===0)return;p.preload().catch(y),T(null);let t=Array.from(e).flatMap(e=>{let t=ne(e);return t?(T(m[t]),[]):[e]});t.length>0&&s(e=>{let n=new Set(e.map(v));return[...e,...t.filter(e=>!n.has(e.name))]}),E.current&&(E.current.value=``)},e[4]=O):O=e[4];let k=O,A;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{s(t=>t.filter(t=>t.name!==e))},e[5]=A):A=e[5];let pe=A,j;e[6]!==b||e[7]!==o?(j=async()=>{if(o.length===0||b)return;x(!0),T(null),p.preload().catch(_);let e=await Promise.all(o.map(ie)),t=e.flatMap(g);t.length===o.length?h(t):T(m[e.find(ue)?.error??`unsupported`]),x(!1)},e[6]=b,e[7]=o,e[8]=j):j=e[8];let M=j,N;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{e.preventDefault(),C(!1),k(e.dataTransfer.files)},e[9]=N):N=e[9];let P=N,F;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{e.preventDefault(),C(!0)},e[10]=F):F=e[10];let me=F,I;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{e.currentTarget.contains(e.relatedTarget)||C(!1)},e[11]=I):I=e[11];let he=I;if(c){let t;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=()=>h(null),e[12]=t):t=e[12];let n;return e[13]===c?n=e[14]:(n=(0,f.jsx)(ee,{label:`Prism workbench`,overlay:!0,children:(0,f.jsx)(le,{pdf:c,cfg:fe,onClose:t})}),e[13]=c,e[14]=n),n}let L;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{window.location.hash=n.href},e[15]=L):L=e[15];let R;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,f.jsxs)(`header`,{className:`prism-app-header`,children:[(0,f.jsx)(`button`,{type:`button`,className:`prism-app-back`,onClick:L,"aria-label":`Back to ${n.label}`,title:`Back to ${n.label}`,children:(0,f.jsx)(l.chevL,{})}),(0,f.jsx)(`span`,{className:`prism-app-brand`,children:`Prism`})]}),e[16]=R):R=e[16];let z;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,f.jsxs)(`div`,{className:`prism-app-hero`,children:[(0,f.jsx)(`h1`,{className:`prism-app-title`,children:`Understand any document`}),(0,f.jsx)(`p`,{className:`prism-app-lede`,children:`Drop a PDF, Word doc, spreadsheet, or text file. Prism maps every claim, finding, and risk — every card cites its exact source.`}),(0,f.jsx)(te,{kind:`upload`})]}),e[17]=z):z=e[17];let B=`prism-dropzone${S?` prism-dropzone--over`:``}`,V;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>E.current?.click(),e[18]=V):V=e[18];let H,U;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{(e.key===`Enter`||e.key===` `)&&E.current?.click()},U=i(p.preload),e[19]=H,e[20]=U):(H=e[19],U=e[20]);let W,G;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,f.jsx)(`input`,{ref:E,type:`file`,accept:re,multiple:!0,className:`prism-dropzone-input`,onChange:e=>void k(e.target.files),"aria-hidden":`true`}),G=(0,f.jsx)(l.upload,{}),e[21]=W,e[22]=G):(W=e[21],G=e[22]);let K=S?`Drop to add`:o.length>0?`Drop more files or click to add`:`Drop files or click to browse`,q;e[23]===K?q=e[24]:(q=(0,f.jsx)(`span`,{className:`prism-dropzone-label`,children:K}),e[23]=K,e[24]=q);let J;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,f.jsx)(`span`,{className:`prism-dropzone-hint`,children:`PDF · Word · Excel · PowerPoint · Image · Text`}),e[25]=J):J=e[25];let Y;e[26]!==B||e[27]!==q?(Y=(0,f.jsxs)(`div`,{className:B,onDrop:P,onDragOver:me,onDragLeave:he,onClick:V,role:`button`,tabIndex:0,"aria-label":`Upload a document`,onKeyDown:H,...U,children:[W,G,q,J]}),e[26]=B,e[27]=q,e[28]=Y):Y=e[28];let X;e[29]===w?X=e[30]:(X=w&&(0,f.jsx)(`p`,{className:`prism-app-error`,role:`alert`,children:w}),e[29]=w,e[30]=X);let Z;e[31]!==M||e[32]!==b||e[33]!==o?(Z=o.length>0&&(0,f.jsxs)(`div`,{className:`prism-staged`,children:[(0,f.jsx)(`p`,{className:`prism-staged-label`,children:o.length===1?`1 document ready`:`${o.length} documents ready`}),(0,f.jsx)(`ul`,{className:`prism-staged-list`,children:o.map(e=>(0,f.jsxs)(`li`,{className:`prism-staged-item`,children:[(0,f.jsx)(l.doc,{}),(0,f.jsx)(`span`,{className:`prism-staged-name`,children:ae({name:e.name,mime:e.type,data:``,size:e.size})}),(0,f.jsx)(`button`,{type:`button`,className:`prism-staged-remove`,onClick:t=>{t.stopPropagation(),pe(e.name)},"aria-label":`Remove ${e.name}`,children:(0,f.jsx)(l.x,{})})]},e.name))}),(0,f.jsxs)(`button`,{type:`button`,className:`prism-confirm-btn`,onClick:()=>void M(),disabled:b,...i(p.preload),children:[b?`Preparing documents…`:`Open in Prism`,(0,f.jsx)(l.chevR,{})]})]}),e[31]=M,e[32]=b,e[33]=o,e[34]=Z):Z=e[34];let Q;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,f.jsxs)(`ul`,{className:`prism-app-features`,children:[(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Maps claims spatially`}),` — regions, findings, and risks laid out so you can see the whole shape at once.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Every card cites its source`}),` — verbatim quote + page number, always. If Mavéa can't cite it, the card doesn't exist.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Ask the whole document`}),` — highlight any claim and ask a follow-up; the answer lights up the exact lines it came from.`]})]}),e[35]=Q):Q=e[35];let $;return e[36]!==Y||e[37]!==X||e[38]!==Z?($=(0,f.jsxs)(`div`,{className:`prism-app`,children:[R,(0,f.jsxs)(`main`,{className:`prism-app-main`,children:[z,Y,X,Z,Q]})]}),e[36]=Y,e[37]=X,e[38]=Z,e[39]=$):$=e[39],$}function ue(e){return e.error}function g(e){return e.attachment?[e.attachment]:[]}function _(){}function v(e){return e.name}function y(){}function de(){return a(o())}export{h as PrismApp};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/kokoro-kGWf7M0e.js","assets/chunk-BVpWp9h4.js","assets/index-C7H7A1rW.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./jsx-runtime-DaSxXjOY.js";import{J as t,q as n}from"./index-C7H7A1rW.js";import{t as r}from"./BriefingPlayer-Dy7JCGm-.js";var i=e();t();function a({beats:e,onBeat:t,onExit:a}){return(0,i.jsx)(r,{beats:e,onBeat:t,onExit:a,speak:e=>{n(()=>import(`./kokoro-kGWf7M0e.js`).then(e=>e.i).then(t=>t.speakKokoroResult(e,`mavea`)),__vite__mapDeps([0,1,2,3,4,5,6,7]))},cancelSpeak:()=>{n(()=>import(`./kokoro-kGWf7M0e.js`).then(e=>e.i).then(e=>e.cancelKokoro()),__vite__mapDeps([0,1,2,3,4,5,6,7]))}})}export{a as PrismBriefingPlayer};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-DFYCstCC.js","assets/index-C7H7A1rW.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShareModal-D4En6Y3L.js","assets/ReelJelly-DCD4bG10.js","assets/geometry-DXAbnb0J.js","assets/registry-B51MhOLx.js","assets/fit-B1LJWvMO.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-kGWf7M0e.js","assets/ShareModal-PobtP7AJ.css","assets/annotationAuto-BpBsjbDQ.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/BriefingPlayer-Dy7JCGm-.js","assets/BriefingPlayer-TpFZB77N.css","assets/annotationReel-yzysA-Gr.js","assets/PrismAskController-DUvOTeW9.js","assets/sourceHost-BV3t2XDb.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/search-Be63DJkp.js","assets/PrismAskController-DBoxQSJR.css","assets/PrismBriefingPlayer-Bmo9tOGX.js","assets/CrossExamPanel-Deywo95y.js","assets/CrossExamPanel-CZ0ShGma.css","assets/ForecastPanel-BOG361kr.js","assets/ForecastPanel-Da2ZBUrE.css","assets/LeverPanel-CP32QcIf.js","assets/dag-C3Xx8pOD.js","assets/LeverPanel-DhpJY76O.css","assets/WhyMachineOverlay-B-KJhCjr.js","assets/useSpatialCanvas-D_C8VoCy.js","assets/WhyMachineOverlay-BZk3PVTl.css","assets/run-BYP2YlZT.js","assets/extractNumbers-CuhagRkd.js","assets/streamParse-DRgMHWye.js","assets/run-DSVvshaB.js","assets/run-Dc2ZJz6n.js","assets/model-BE0UHu1w.js","assets/explode-WBykfhqW.js","assets/json-B0N3XRZU.js","assets/cache-BumECILO.js","assets/speed-DwPw9KSv.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,ht as a,k as o,mt as s,q as c}from"./index-C7H7A1rW.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{t as u}from"./toast-BBNs2h3L.js";import{r as d}from"./sourceHost-BV3t2XDb.js";import{t as f}from"./penStrokes-DlHnO9xE.js";import{S as p,b as m,d as h,h as g,m as _,o as v,s as y,t as b,v as x,x as S,y as C}from"./providers-wzm7E8Pa.js";import{n as w}from"./streamParse-DRgMHWye.js";import{t as T}from"./search-Be63DJkp.js";import{a as E,i as D,t as O}from"./verbatim-CBMzUDlf.js";import{t as k}from"./officeDoc-B6nEhNp4.js";import{t as A}from"./citation-BcvmjKS8.js";var j=e(),M=a();function ee(e,t=220){return`DOCUMENT OUTLINE — a thin slice of every page:\n${e.map((e,n)=>`[page ${n+1}] ${e.slice(0,t).replace(/\s+/g,` `).trim()}`).join(`
|
|
3
|
-
`)}`}function N(e,t,n){let r=[];try{let n=typeof e==`object`?e:JSON.parse(String(e).match(/\{[\s\S]*\}/)?.[0]??`{}`);Array.isArray(n.pages)&&(r=n.pages.map(e=>Number(e)).filter(e=>Number.isInteger(e)&&e>=1&&e<=t))}catch{}let i=[...new Set(r)].sort((e,t)=>e-t).slice(0,n);if(i.length>0)return i;let a=Math.max(1,Math.floor(t/Math.max(1,n))),o=[];for(let e=1;e<=t&&o.length<n;e+=a)o.push(e);return o}function te(e,t,n,r){return`DOCUMENT TEXT (cite "page" by these markers):\n${t.map(t=>{let i=r?.[t-1];return`${i?`[page ${t} — "${i}"]`:`[page ${t}]`}\n${(e[t-1]??``).slice(0,n)}`}).join(`
|
|
4
|
-
|
|
5
|
-
`)}`}function P(e,t){let n=[];for(let r of e){let e=O(r.quote,t,r.page);if(e>0){n.push({...r,page:e});continue}let i=[...new Set([r.page,...t.map((e,t)=>t+1)])].filter(e=>e>=1&&e<=t.length);for(let e of i){let i=E(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var F=null,I=0,L=new Map;function R(){if(typeof Worker>`u`)return null;if(F)return F;try{return F=new Worker(new URL(`/assets/prismGround.worker-CIvKqxm2.js`,``+import.meta.url),{type:`module`}),F.onmessage=e=>{let t=e.data,n=L.get(t.id);n&&(L.delete(t.id),t.ok?n.resolve(t.claims??[]):n.reject(Error(t.error??`Grounding failed`)))},F.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of L.values())t.reject(e);L.clear(),F?.terminate(),F=null},F}catch{return F=null,null}}async function z(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...P(e.slice(r,r+16),t)),r+16<e.length&&await new Promise(e=>setTimeout(e,0));return n}async function ne(e,t){let n=R();if(!n)return z(e,t);let r=I+=1;try{return await new Promise((i,a)=>{L.set(r,{resolve:i,reject:a}),n.postMessage({id:r,candidates:e,pages:t})})}catch{return z(e,t)}}r();var re=null;function B(){return re||(re=c(()=>import(`./pdf-DFYCstCC.js`).then(e=>{let t=e.default??e;return t?.GlobalWorkerOptions&&(t.GlobalWorkerOptions.workerSrc=new URL(`/assets/pdf.worker.min-yatZIOMy.mjs`,``+import.meta.url).href),t}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>null),re)}function ie(e){if(typeof e?.str!=`string`||e.str.trim()===``)return null;let t=e.transform??[1,0,0,1,0,0],n=Math.hypot(t[2],t[3])||(typeof e.height==`number`?e.height:0)||10;return{it:e,left:t[4],y:t[5],w:typeof e.width==`number`?e.width:0,h:n}}function V(e){e.sort((e,t)=>t.y-e.y||e.left-t.left);let t=[],n=[],r=0,i=0;for(let a of e)n.length>0&&Math.abs(a.y-r)>Math.max(i,a.h)*.5&&(t.push(n),n=[]),n.length===0&&(r=a.y,i=a.h),n.push(a);n.length>0&&t.push(n);let a=[];for(let e of t){e.sort((e,t)=>e.left-t.left);for(let t of e)a.push(t.it)}return a}function ae(e){let t=e.map(ie).filter(e=>e!==null);if(t.length<2)return t.map(e=>e.it);let n=Math.min(...t.map(e=>e.left)),r=Math.max(...t.map(e=>e.left+e.w)),i=Math.max(...t.map(e=>e.y)),a=Math.min(...t.map(e=>e.y)),o=r-n||1,s=i-a||1,c=null,l=t.filter(e=>e.y<i-.1*s&&e.y>a+.04*s);if(l.length>6)for(let e of[.5,.48,.52,.46,.54]){let r=n+e*o,i=l.filter(e=>e.left<r-2&&e.left+e.w>r+2).length,a=t.filter(e=>e.left+e.w/2<r).length,s=t.length-a;if(i<=Math.max(2,l.length*.02)&&a>t.length*.2&&s>t.length*.2){c=r;break}}if(c===null)return V(t);let u=c;return[...V(t.filter(e=>e.left+e.w/2<u)),...V(t.filter(e=>e.left+e.w/2>=u))]}async function H(e){let t=await B();if(!t?.getDocument)return null;try{let n=await v(e),r=await t.getDocument({data:n.slice()}).promise,i=[];for(let e=1;e<=r.numPages;e+=1){let t=await r.getPage(e),n=ae((await t.getTextContent()).items).map(e=>typeof e.str==`string`?e.str:``).join(` `);i.push(n),t.cleanup?.()}return await r.destroy?.(),i}catch{return null}}function U(){return Math.min(2,Math.max(1,typeof window<`u`&&window.devicePixelRatio||1))}function oe(e){return Math.max(600,Math.min(1900,Math.round((Number.isFinite(e)&&e>0?e:1200)*1.15)))}var W=e=>e.file??e.bytes??e.data,se=null,G=null,K=null,q=0;async function ce(e,t){let n=W(e);for(;K&&K.key!==n;)await K.promise.catch(()=>{});if(se===n&&G)return G;if(K&&K.key===n)return K.promise;let r=q,i=(async()=>{if(G)try{await G.destroy?.()}catch{}let i=y(e)??await v(e),a=await t.getDocument({data:i.slice()}).promise;if(r!==q){try{await a.destroy?.()}catch{}throw Error(`render doc superseded`)}return G=a,se=n,a})(),a={key:n,promise:i};K=a;try{return await i}finally{K===a&&(K=null)}}async function le(){q+=1,K=null;let e=G;G=null,se=null;try{await e?.destroy?.()}catch{}}function J(e){return Array.from(e.normalize(`NFKC`)).map(e=>e===``?``:`‘’‛`.includes(e)?`'`:`“”`.includes(e)?`"`:/[‐-―]/.test(e)?`-`:/\s/.test(e)?` `:e.toLowerCase())}async function ue(e,t,n,r=720,i=!1,a=[]){let o=await B();if(!o?.getDocument)return null;let s=null;try{let c=await ce(e,o);if(t<1||t>c.numPages)return null;s=await c.getPage(t);let l=s.getViewport({scale:1}),u=U(),d=r/l.width*u,f=s.getViewport({scale:d}),p=document.createElement(`canvas`);p.width=Math.ceil(f.width),p.height=Math.ceil(f.height);let m=p.getContext(`2d`);if(!m)return null;await s.render({canvasContext:m,viewport:f}).promise;let h=await s.getTextContent(),g=de(h,n,f,o),_=a.map(e=>de(h,e,f,o)),v=null;if(i||me(n))try{v=ve(await s.getOperatorList(),h,g,f,o)}catch{v=null}return{canvas:p,rects:g,figure:v,alsoRects:_}}catch{return null}finally{s?.cleanup?.()}}function de(e,t,n,r){let i=D(t);if(!i)return[];let a=[];for(let t of ae(e.items)){if(typeof t.str!=`string`)continue;let e=fe(t,n,r);if(!e)continue;let i=J(t.str),o=i.filter(e=>e.length>0).length||1,s=e.w/o,c=0;for(let t of i)t!==``&&(a.push({ch:t,rect:{x:e.x+s*c,y:e.y,w:s,h:e.h}}),c+=1);a.push({ch:` `,rect:{x:e.x+e.w,y:e.y,w:0,h:e.h}})}let o=[];for(let e=0;e<a.length;e+=1){let t=a[e];if(t.ch===`-`){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t>e+1){e=t-1;continue}}if(t.ch===` `){let t=o[o.length-1];if(t&&`$€£¥`.includes(t.ch)){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t<a.length&&/[\d(]/.test(a[t].ch))continue}if(t&&t.ch===` `)continue}o.push(t)}let s=o.map(e=>e.ch).join(``).indexOf(i);return s<0?[]:pe(o.slice(s,s+i.length).filter(e=>e.rect.w>0).map(e=>e.rect))}function fe(e,t,n){try{let r=n.Util.transform(t.transform,e.transform),i=r[4],a=r[5],o=(e.width||0)*t.scale,s=Math.hypot(r[2],r[3])||10,c=s*1.15;return o<=0?null:{x:i,y:a-s,w:o,h:c}}catch{return null}}function pe(e){if(e.length===0)return e;let t=[...e].sort((e,t)=>e.y-t.y||e.x-t.x),n=[];for(let e of t){let t=n[n.length-1];if(t&&Math.abs(t.y-e.y)<t.h*.6&&e.x<=t.x+t.w+t.h){let n=Math.max(t.x+t.w,e.x+e.w);t.x=Math.min(t.x,e.x),t.w=n-t.x,t.y=Math.min(t.y,e.y),t.h=Math.max(t.h,e.h)}else n.push({...e})}return n}function me(e){return/\b(fig(?:ure|\.)?|table|chart|diagram|graph|plot|schematic|illustration)\b/i.test(e)}function he(e,t,n){let r=n.OPS??{},i=e.fnArray??[],a=e.argsArray??[],o=t.transform,s=[],c=[];for(let e=0;e<i.length;e+=1){let l=i[e];if(l===r.save)s.push(o);else if(l===r.restore)o=s.pop()??t.transform;else if(l===r.transform)o=n.Util.transform(o,a[e]);else if(l===r.paintImageXObject||l===r.paintInlineImage||l===r.paintImageMaskXObject||l===r.paintJpegXObject){let e=o,t=[e[4],e[0]+e[4],e[2]+e[4],e[0]+e[2]+e[4]],n=[e[5],e[1]+e[5],e[3]+e[5],e[1]+e[3]+e[5]],r=Math.min(...t),i=Math.min(...n),a=Math.max(...t)-r,s=Math.max(...n)-i;a>8&&s>8&&c.push({x:r,y:i,w:a,h:s})}}return c}function ge(e,t,n){let r=[];for(let i of e.items){if(typeof i.str!=`string`||i.str.trim()===``)continue;let e=fe(i,t,n);e&&r.push(e)}return pe(r)}function _e(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function ve(e,t,n,r,i){let a=he(e,r,i);if(a.length===0||n.length===0)return null;let o=ye(n),s=o.x+o.w/2,c=null,l=1/0;for(let e of a){let t=e.x+e.w/2,n=Math.abs(t-s);if(n>Math.max(e.w,o.w))continue;let r=be(e,o)+n*.5;r<l&&(l=r,c=e)}if(!c)return null;let u=ge(t,r,i).filter(e=>!_e(e,o)),d=xe(c,u,o);return!d||d.w<10||d.h<10?null:d}function ye(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}function be(e,t){return e.y+e.h<t.y?t.y-(e.y+e.h):t.y+t.h<e.y?e.y-(t.y+t.h):0}function xe(e,t,n){let r=e.y,i=e.y+e.h,a=n.y+n.h/2;for(let n of t){let t=n.y+n.h/2;Math.min(e.x+e.w,n.x+n.w)-Math.max(e.x,n.x)<e.w*.3||(t<a&&n.y+n.h>e.y&&t<e.y+e.h/2&&(r=Math.max(r,n.y+n.h)),t>a&&n.y<i&&(i=Math.min(i,n.y)))}return i-r<10?null:{x:e.x,y:r,w:e.w,h:i-r}}var Se=/\.(csv|tsv|tab)$/i,Ce=/\.(md|markdown)$/i,we=/\.(json|jsonl|ndjson)$/i,Te=/\.(ya?ml|toml|xml|js|ts|jsx|tsx|py|rb|go|rs|java|c|h|cpp|cs|sh|sql|css|html?)$/i,Ee=40,De=1600;function Oe(e){let t=e.replace(/\r\n?/g,`
|
|
6
|
-
`).split(`
|
|
7
|
-
`);if(t.length&&t[t.length-1]===``&&t.pop(),t.length===0)return[];let n=t[0],r=t.slice(1);if(r.length===0)return[n];let i=[];for(let e=0;e<r.length;e+=Ee)i.push([n,...r.slice(e,e+Ee)].join(`
|
|
8
|
-
`));return i}function ke(e){let t=e.replace(/\r\n?/g,`
|
|
9
|
-
`).split(`
|
|
10
|
-
`),n=[],r=[];for(let e of t)/^#{1,6}\s/.test(e)&&r.some(e=>e.trim())?(n.push(r.join(`
|
|
11
|
-
`).trim()),r=[e]):r.push(e);r.some(e=>e.trim())&&n.push(r.join(`
|
|
12
|
-
`).trim());let i=n.filter(e=>e.length>0);return i.length>1?i:Ae(e)}function Ae(e){let t=e.replace(/\r\n?/g,`
|
|
13
|
-
`).trim();if(!t)return[];let n=t.split(/\n\s*\n/).map(e=>e.trim()).filter(Boolean);if(n.length===0)return[t];let r=[],i=``;for(let e of n)i&&i.length+e.length>De?(r.push(i),i=e):i=i?`${i}\n\n${e}`:e;return i&&r.push(i),r}function je(e){let t=e.replace(/\r\n?/g,`
|
|
14
|
-
`).trim();if(!t)return[];if(t.length<=De*1.5)return[t];let n=t.split(`
|
|
15
|
-
`),r=[],i=``;for(let e of n)i&&i.length+e.length>De?(r.push(i),i=e):i=i?`${i}\n${e}`:e;return i&&r.push(i),r}function Me(e,t,n){if(!n.trim())return null;let r;return r=Se.test(e)||t===`text/csv`?Oe(n):Ce.test(e)?ke(n):we.test(e)||t===`application/json`||Te.test(e)?je(n):Ae(n),r.length>0?r:null}function Ne(e,t,n){return Me(e,t,new TextDecoder(`utf-8`).decode(n))}var Pe=null,Fe=0,Ie=new Map;function Le(){if(typeof Worker>`u`)return null;if(Pe)return Pe;try{return Pe=new Worker(new URL(`/assets/prismExtract.worker-Cws9K1NG.js`,``+import.meta.url),{type:`module`}),Pe.onmessage=e=>{let t=e.data,n=Ie.get(t.id);n&&(Ie.delete(t.id),t.bytes&&(n.attachment.bytes=t.bytes),t.ok?n.resolve(t.result??null):n.reject(Error(t.error??`Document extraction failed`)))},Pe.onerror=()=>{let e=Error(`Document extraction worker failed`);for(let t of Ie.values())t.reject(e);Ie.clear(),Pe?.terminate(),Pe=null},Pe}catch{return Pe=null,null}}function Re(e,t){let n=Le();if(!n)return null;let r=Fe+=1,i=t.bytes,a={id:r,kind:e,name:t.name,mime:t.mime,...t.file?{file:t.file}:{},...i?{bytes:i,returnBytes:!0}:{},...!t.file&&!i?{data:t.data}:{}},o=i?[i]:[];return i&&(t.bytes=void 0),new Promise((e,s)=>{Ie.set(r,{attachment:t,resolve:e,reject:s});try{n.postMessage(a,o)}catch(e){Ie.delete(r),i&&i.byteLength>0&&(t.bytes=i),s(e instanceof Error?e:Error(`Could not start document extraction`))}})}function ze(){return new Promise(e=>setTimeout(e,0))}async function Be(e,t){await ze();let n=await v(t);return await ze(),e===`office`?k(t.name,n):Ne(t.name,t.mime,n)}async function Ve(e){let t=Re(`office`,e);try{return t?await t:await Be(`office`,e)}catch{return await Be(`office`,e)}}async function He(e){let t=Re(`text`,e);try{return t?await t:await Be(`text`,e)}catch{return await Be(`text`,e)}}var Ue=[`forecast`,`stat`,`finding`,`risk`,`definition`,`method`,`diagram`];function We(e){let t=String(e??``).toLowerCase();return Ue.includes(t)?t:`finding`}var Ge=[`load-bearing`,`supporting`,`context`];function Ke(e){let t=String(e??``).toLowerCase().trim();return Ge.includes(t)?t:`supporting`}var qe=30,Je=40,Ye=2e3,Xe=220,Ze=700,Qe=`You are given a THIN slice of every page of a long document. Pick the pages that carry the most important, quotable content — the thesis, key findings, definitions, decisive data, and the conclusions — and skip filler (title/cover pages, tables of contents, reference lists, boilerplate). Return STRICT JSON only, no prose: {"pages":[<1-based page numbers>]}. Choose at most ${Je} pages, in reading order.`;async function $e(e,t,n){try{return N((await b(t.provider).generate({system:`You pick the most important pages of a document and return strict JSON only.`,history:[],user:`${Qe}\n\n${ee(e,Xe)}`,attachments:[],maxTokens:Ze,temperature:0,format:null,...n?{signal:n}:{}},t)).raw,e.length,Je)}catch{return N(`{}`,e.length,Je)}}var et=`You are mapping a document for a spatial "explode" view — a map of its key claims.
|
|
16
|
-
|
|
17
|
-
Return ONLY a JSON object (no prose, no markdown fences) of this exact shape:
|
|
18
|
-
{
|
|
19
|
-
"regions": ["Section A", "Section B", ...],
|
|
20
|
-
"claims": [
|
|
21
|
-
{
|
|
22
|
-
"quote": "a phrase copied VERBATIM from the document (about 6-160 characters, appearing word-for-word in the text)",
|
|
23
|
-
"page": 3,
|
|
24
|
-
"kind": "forecast|stat|finding|risk|definition|method|diagram",
|
|
25
|
-
"title": "a 3-7 word headline for the claim",
|
|
26
|
-
"ask": "a short follow-up question about this claim",
|
|
27
|
-
"role": "load-bearing|supporting|context",
|
|
28
|
-
"region": "which of regions[] this claim belongs to",
|
|
29
|
-
"contradictsPage": 27
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
Rules:
|
|
35
|
-
- Each claim "quote" MUST be copied character-for-character, and "page" MUST be the page it appears on.
|
|
36
|
-
When a "DOCUMENT TEXT" section is given below, copy every quote from THERE — not from the rendered
|
|
37
|
-
look of the page — exactly as it appears, including how "$", digits, commas, units, and the spacing
|
|
38
|
-
between them are written. That text is what your quote is verified against; a number retyped from the
|
|
39
|
-
visual layout won't match. Quotes are checked verbatim — anything not found is dropped, so no
|
|
40
|
-
paraphrasing, no "[...]", no rounding ("$7,438" not "$7.4 billion"). Quote a single CONTIGUOUS run of
|
|
41
|
-
the text: a table row reads label-then-number (e.g. "Total net revenue $ 10,253"), so quote it that
|
|
42
|
-
way — never stitch words from across the table.
|
|
43
|
-
- "regions" are the document's own sections/themes (3-6 of them). Every claim's "region" must be one.
|
|
44
|
-
- "role" marks how central the claim is to the document's case: "load-bearing" for the thesis, the
|
|
45
|
-
headline number, or the assertion the whole conclusion rests on; "supporting" for real evidence and
|
|
46
|
-
findings; "context" for definitions, background, or method detail. Mark only a FEW (about 2-4) as
|
|
47
|
-
"load-bearing" — these are what the reader sees first, so reserve it for the claims that truly carry
|
|
48
|
-
the argument.
|
|
49
|
-
- Include "contradictsPage" ONLY when this claim genuinely conflicts with a claim on that other page.
|
|
50
|
-
- For a DATA TABLE (a financial statement, a results table), do NOT just emit one "diagram" claim of
|
|
51
|
-
the table's title — the title alone ("Selected Corporate Data Table") is not analysis. Pull the KEY
|
|
52
|
-
FIGURES out of the table as separate "stat" claims: the headline totals, each major line item or
|
|
53
|
-
segment, and any growth rate or margin. Quote each figure's row from the DOCUMENT TEXT (e.g. "Total
|
|
54
|
-
net revenue $ 10,253", "Data Center Segment $ 5,775"). The specific numbers ARE the point.
|
|
55
|
-
- Reserve kind "diagram" for a genuine CHART, FIGURE, or DIAGRAM (something visual — not a number
|
|
56
|
-
table), using its caption as the verbatim quote (e.g. "Figure 2: Partitioning and replication of keys").
|
|
57
|
-
- Cover the WHOLE document — spread claims across ALL of its pages and sections, not just the first page
|
|
58
|
-
or the opening summary. Later sections, financial statements, and data tables matter as much as the
|
|
59
|
-
intro; pull the key figures from each major section, citing the page each is really on.
|
|
60
|
-
- Aim for 12-24 of the document's most important claims — and MORE for a long or data-dense document (a
|
|
61
|
-
financial report with multiple statements, a deck, a long paper): take the key figures from each major
|
|
62
|
-
section, as "stat" claims, and spread them across the regions.`,tt=`${et}
|
|
63
|
-
|
|
64
|
-
This document is a slide deck exported as IMAGES — each attached image is one slide, in order. Read
|
|
65
|
-
the text visible ON each slide. Every claim "quote" must be a phrase you can actually see on a slide,
|
|
66
|
-
transcribed exactly, and "page" must be that slide's number (the 1-based order of the attached
|
|
67
|
-
images). Skip purely decorative slides. Treat each slide as its own "region" when no clearer section
|
|
68
|
-
emerges from the content.`;function nt(e,t){let n=Math.max(1400,Math.min(2600,Math.round(34e3/Math.max(1,e.length))));return`DOCUMENT TEXT (cite "page" by these markers):\n${e.map((e,r)=>{let i=t?.[r];return`${i?`[page ${r+1} — "${i}"]`:`[page ${r+1}]`}\n${e.slice(0,n)}`}).join(`
|
|
69
|
-
|
|
70
|
-
`)}`}function rt(e){if(typeof e==`object`)return e;let t=String(e),n=t.indexOf(`{`);if(n<0)return null;let r=0,i=!1,a=!1;for(let e=n;e<t.length;e+=1){let o=t[e];if(i){a?a=!1:o===`\\`?a=!0:o===`"`&&(i=!1);continue}if(o===`"`)i=!0;else if(o===`{`)r+=1;else if(o===`}`&&(--r,r===0))try{return JSON.parse(t.slice(n,e+1))}catch{return null}}return null}function it(e){return typeof e==`string`?e:``}function at(e){if(!e||typeof e!=`object`)return null;let t=e,n=Number(t.x),r=Number(t.y),i=Number(t.w),a=Number(t.h);if(![n,r,i,a].every(Number.isFinite)||i<=0||a<=0)return null;let o=Math.max(0,Math.min(1e3,n)),s=Math.max(0,Math.min(1e3,r)),c=Math.max(1,Math.min(1e3-o,i)),l=Math.max(1,Math.min(1e3-s,a));return c>=985&&l>=985?null:{x:o,y:s,w:c,h:l}}function ot(e){let t=rt(e);if(!t||typeof t!=`object`)return[];let n=t,r=Array.isArray(n.claims)?n.claims:[],i=[];for(let e of r){if(!e||typeof e!=`object`)continue;let t=e,n=it(t.quote),r=Number(t.page);!n||!Number.isInteger(r)||i.push({quote:n,page:r,kind:it(t.kind)||void 0,title:it(t.title)||void 0,ask:it(t.ask)||void 0,role:it(t.role)||void 0,region:it(t.region)||void 0,...Number.isInteger(Number(t.contradictsPage))?{contradictsPage:Number(t.contradictsPage)}:{},...at(t.box)?{box:at(t.box)}:{}})}return i}function st(e){let t=e.replace(/\.pdf$/i,``).trim();return t.length>28?t.slice(0,27).trimEnd()+`…`:t||`Document`}function Y(e){let t=new Set,n=[];for(let r of e)t.has(r.region)||(t.add(r.region),n.push(r.region));return n}function ct(e){let t=new Map,n=(e,t)=>`${e}:${t}`;for(let r of e){let e=n(r.source,r.page),i=t.get(e)??[];i.push(r),t.set(e,i)}let r=[],i=new Set;for(let a of e){let e=a.contradictsPage;if(!e)continue;let o=t.get(n(a.source,e));if(!o?.length)continue;let s=o.find(e=>e.id!==a.id);if(!s)continue;let c=[a.id,s.id].sort().join(`|`);i.has(c)||(i.add(c),r.push({a:a.id,b:s.id,relation:`contradicts`}))}return r}function lt(e){let t=String(e);return t===`agrees`?`agrees`:t===`in-tension`?`in-tension`:`contradicts`}function X(e,t){return[e,t].sort().join(`|`)}async function ut(e,t,n,r,i){let a=x(e),o=!a&&!C(e)&&S(e),s,c,l,u,d;if(i)s=i;else if(a){let t=await Ve(e);s=t.pages,c=t.reason,d=t.pageLabels,(!t.pages||t.pages.length===0)&&t.images&&t.images.length>0&&(l=t.images.slice(0,qe),u=l.map((t,n)=>({name:`${e.name} — slide ${n+1}`,mime:t.mime,data:t.data,size:0})))}else s=o?await He(e):await H(e)??null;let f=!s&&!!u,p=s?s.reduce((e,t)=>e+t.length,0):0,m=C(e)&&!!s&&p>Math.max(400,s.length*60),g=a||o||m,_=b(t.provider);if(!f&&(!s||s.length===0))return{fileName:e.name,pages:[],claims:[],proposed:0,error:a||o?`Couldn't read this document's text${c?` — ${c}`:``}.`:`Couldn't open this PDF — it may be corrupt, password-protected, or not a PDF.`};if(C(e)&&!f&&p===0&&!_.capabilities.vision)return{fileName:e.name,pages:s??[],claims:[],proposed:0,error:`This PDF has no selectable text — it looks like a scan. Connect a model that reads documents (Anthropic or Gemini) to read it.`};let v=g&&s&&s.length>Je?await $e(s,t,r):null;if(r?.aborted)return{fileName:e.name,pages:s??[],claims:[],proposed:0,...d?{pageLabels:d}:{}};let y=f?u?.length??1:Math.min(s?.length??1,Je),w=Math.min(8192,Math.max(4096,3e3+y*240)),T=f?u:g?[]:[e],E=await Promise.all(T.map(h)),D=await _.generate({system:`You extract grounded, verbatim-quoted claims from a document and return strict JSON only.`,history:[],user:f?tt:v?`${et}\n\n${te(s,v,Ye,d)}`:`${et}\n\n${nt(s,d)}`,attachments:E,maxTokens:w,temperature:0,format:null,...r?{signal:r}:{}},t).then(e=>({ok:!0,raw:e.raw})).catch(e=>({ok:!1,error:e instanceof Error?e.message:`request failed`}));if(!D.ok)return{fileName:e.name,pages:s??[],claims:[],proposed:0,error:D.error,...d?{pageLabels:d}:{}};let O=ot(D.raw),k=f?dt(O,u.length):s,A=await ne(O,k);if(typeof process<`u`&&{}.SNAP_DEBUG)for(let e of O)A.some(t=>t.title===e.title&&t.kind===e.kind)||console.log(` DROPPED p${e.page}: ${JSON.stringify((e.quote??``).slice(0,130))}`);let j=A.map((e,t)=>({id:`d${n}c${t}`,quote:e.quote,page:e.page,kind:We(e.kind),title:e.title?.trim()||e.quote.slice(0,40),ask:e.ask?.trim()||`What does this mean?`,role:Ke(e.role),region:e.region?.trim()||`Document`,source:n,...e.contradictsPage?{contradictsPage:e.contradictsPage}:{},...f&&e.box?{box:e.box}:{}}));return{fileName:e.name,pages:k,claims:j,proposed:O.length,...l?{slideImages:l}:{},...d?{pageLabels:d}:{}}}function dt(e,t){let n=Array.from({length:t},()=>``);for(let r of e){let e=typeof r.page==`number`?r.page:0;e>=1&&e<=t&&typeof r.quote==`string`&&(n[e-1]+=(n[e-1]?`
|
|
71
|
-
`:``)+r.quote)}return n}async function ft(e,t,n,r){let i=Array.isArray(e)?e:[e],a=r?Array.isArray(r[0])?r:[r]:i.map(()=>void 0),o=await Promise.all(i.map((e,r)=>ut(e,t,r,n,a[r]))),s=o.find(e=>e.error&&e.proposed===0),c=o.flatMap(e=>e.claims),l=o.reduce((e,t)=>e+t.proposed,0);if(c.length===0)return{spec:null,proposed:l,error:s?.error??(l===0?`No claims could be mapped from this document.`:`No claims were grounded in the page text.`)};let u=ct(c),d=i.length>1;if(!d){let e=await Z(c,t,u,n);u.push(...e)}if(d&&o.filter(e=>e.claims.length>0).length>1){let e=await ht(c,t,n);u.push(...e)}let f=o.map(e=>({fileName:e.fileName,pageCount:e.pages.length,...e.slideImages?{slideImages:e.slideImages}:{},...e.pageLabels?{pageLabels:e.pageLabels}:{}})),p=c.map(({contradictsPage:e,...t})=>t);if(d)for(let e of p)e.region=`${st(f[e.source]?.fileName??`Doc ${e.source+1}`)} · ${e.region}`;return{spec:{documents:f,fileName:f[0]?.fileName??`document.pdf`,pageCount:f.reduce((e,t)=>e+t.pageCount,0),claims:p,regions:Y(p),threads:u},proposed:l,corpus:o.map(e=>e.pages)}}function pt(e){return`These are grounded claims pulled from MULTIPLE documents (doc 0, doc 1, …). Find pairs of
|
|
72
|
-
claims FROM DIFFERENT DOCUMENTS that relate, and classify each pair.
|
|
73
|
-
|
|
74
|
-
Claims:
|
|
75
|
-
${e.map(e=>`${e.id} (doc ${e.source}, p.${e.page}): "${e.quote}"`).join(`
|
|
76
|
-
`)}
|
|
77
|
-
|
|
78
|
-
Return ONLY JSON (no prose):
|
|
79
|
-
{ "pairs": [ { "a": "<claim id>", "b": "<claim id>", "relation": "agrees|contradicts|in-tension" } ] }
|
|
80
|
-
|
|
81
|
-
Rules:
|
|
82
|
-
- a and b MUST be ids from the list above, and MUST come from different documents.
|
|
83
|
-
- "agrees": the two claims make the same point. "contradicts": they directly conflict.
|
|
84
|
-
"in-tension": related but pulling different ways.
|
|
85
|
-
- Only include pairs with a real, defensible relationship. Quality over quantity (aim for the
|
|
86
|
-
strongest 3-8 pairs). If nothing relates across documents, return { "pairs": [] }.`}function mt(e){return`These are grounded claims pulled from one or more documents. Find pairs of claims FROM THE
|
|
87
|
-
SAME DOCUMENT that relate, and classify each pair.
|
|
88
|
-
|
|
89
|
-
Claims:
|
|
90
|
-
${e.map(e=>`${e.id} (doc ${e.source}, p.${e.page}, ${e.kind}): "${e.quote}"`).join(`
|
|
91
|
-
`)}
|
|
92
|
-
|
|
93
|
-
Return ONLY JSON (no prose):
|
|
94
|
-
{ "pairs": [ { "a": "<claim id>", "b": "<claim id>", "relation": "contradicts|in-tension|agrees" } ] }
|
|
95
|
-
|
|
96
|
-
Rules:
|
|
97
|
-
- a and b MUST be ids from the list above, and MUST come from the same document.
|
|
98
|
-
- Contradictions can be on the SAME PAGE. Do not skip a pair just because both claims cite p.3.
|
|
99
|
-
- "contradicts": the claims directly conflict or one claim undercuts the other.
|
|
100
|
-
"in-tension": related but pulling different ways. "agrees": the two claims make the same point.
|
|
101
|
-
- Only include defensible relationships visible from the quoted claims. Quality over quantity (aim for
|
|
102
|
-
the strongest 1-8 pairs). If nothing relates, return { "pairs": [] }.`}async function Z(e,t,n,r){if(e.length<2)return[];let i=new Map(e.map(e=>[e.id,e])),a;try{a=(await b(t.provider).generate({system:`You compare grounded claims within documents and return strict JSON only.`,history:[],user:mt(e),maxTokens:1024,temperature:0,format:null,...r?{signal:r}:{}},t)).raw}catch{return[]}let o=rt(a),s=o&&typeof o==`object`&&Array.isArray(o.pairs)?o.pairs:[],c=[],l=new Set(n.map(e=>X(e.a,e.b)));for(let e of s){if(!e||typeof e!=`object`)continue;let t=e,n=i.get(String(t.a)),r=i.get(String(t.b));if(!n||!r||n.id===r.id||n.source!==r.source)continue;let a=X(n.id,r.id);l.has(a)||(l.add(a),c.push({a:n.id,b:r.id,relation:lt(t.relation)}))}return c}async function ht(e,t,n){let r=new Map(e.map(e=>[e.id,e])),i;try{i=(await b(t.provider).generate({system:`You compare claims across documents and return strict JSON only.`,history:[],user:pt(e),maxTokens:1024,temperature:0,format:null,...n?{signal:n}:{}},t)).raw}catch{return[]}let a=rt(i),o=a&&typeof a==`object`&&Array.isArray(a.pairs)?a.pairs:[],s=[],c=new Set;for(let e of o){if(!e||typeof e!=`object`)continue;let t=e,n=r.get(String(t.a)),i=r.get(String(t.b));if(!n||!i||n.id===i.id||n.source===i.source)continue;let a=lt(String(t.relation)),o=X(n.id,i.id);c.has(o)||(c.add(o),s.push({a:n.id,b:i.id,relation:a,crossDoc:!0}))}return s}var gt=900;function _t(e){let t=(0,M.c)(13),[n,r]=(0,j.useState)(`idle`),[i,a]=(0,j.useState)(null),[o,s]=(0,j.useState)(null),[c,l]=(0,j.useState)(0),[u,d]=(0,j.useState)(null),f=(0,j.useRef)(null),p=(0,j.useRef)(null),m=(0,j.useRef)(0),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{f.current?.abort(),f.current=null,p.current!==null&&(clearTimeout(p.current),p.current=null)},t[0]=h):h=t[0];let g=h,_,v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>g,v=[g],t[1]=_,t[2]=v):(_=t[1],v=t[2]),(0,j.useEffect)(_,v);let y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{g(),m.current+=1,r(`idle`),a(null),s(null),l(0),d(null)},t[3]=y):y=t[3];let b=y,x;t[4]===e?x=t[5]:(x=t=>{if(!e){d(`Connect a model that reads documents (Anthropic or Gemini) to explode one.`),r(`error`);return}g();let n=m.current+=1,i=new AbortController;f.current=i,a(null),s(null),l(0),d(null),r(`igniting`),p.current=setTimeout(()=>{m.current===n&&r(vt)},gt),ft(t,e,i.signal).then(e=>{m.current===n&&(l(e.proposed),e.spec?(a(e.spec),s(e.corpus??null),r(`settled`)):(d(e.error??`This document could not be mapped.`),r(`error`)))}).catch(e=>{m.current===n&&(i.signal.aborted||(d(e instanceof Error?e.message:`Mapping failed.`),r(`error`)))})},t[4]=e,t[5]=x);let S=x,C;return t[6]!==o||t[7]!==u||t[8]!==S||t[9]!==n||t[10]!==c||t[11]!==i?(C={phase:n,spec:i,corpus:o,proposed:c,error:u,explode:S,reset:b},t[6]=o,t[7]=u,t[8]=S,t[9]=n,t[10]=c,t[11]=i,t[12]=C):C=t[12],C}function vt(e){return e===`igniting`?`blooming`:e}var yt=.15,bt=4;function xt(e,t,n,r){let i=(0,M.c)(29),a;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={x:0,y:0,scale:1},i[0]=a):a=i[0];let[o,s]=(0,j.useState)(a),[c,l]=(0,j.useState)(!1),u=(0,j.useRef)(null),d=(0,j.useRef)(!1),f=(0,j.useRef)(`auto`),p=(0,j.useRef)(null),m;i[1]!==r||i[2]!==e||i[3]!==n||i[4]!==t?(m=()=>{let i=e.current;if(!i)return;f.current=`auto`;let a=r&&r.w>0&&r.h>0?r:{x:0,y:0,w:t,h:n},o=i.clientWidth-64,c=i.clientHeight-64;if(o<=0||c<=0)return;let l=Math.max(yt,Math.min(bt,1.35,Math.min(o/a.w,c/a.h))),u=a.x+a.w/2,d=a.y+a.h/2;s({x:i.clientWidth/2-u*l,y:i.clientHeight/2-d*l,scale:l})},i[1]=r,i[2]=e,i[3]=n,i[4]=t,i[5]=m):m=i[5];let h=m,g;i[6]===e?g=i[7]:(g=(t,n)=>{let r=e.current;if(!r)return;let i=r.clientWidth-96,a=r.clientHeight-96;if(i<=0||a<=0||t.w<=0||t.h<=0)return;f.current=`framed`,p.current={bbox:t,opts:n};let o=n?.maxScale??1.4,c=Math.max(yt,Math.min(bt,o,Math.min(i/t.w,a/t.h))),l=t.x+t.w/2,u=t.y+t.h/2;s({x:r.clientWidth/2-l*c,y:r.clientHeight/2-u*c,scale:c})},i[6]=e,i[7]=g);let _=g,v,y;i[8]!==h||i[9]!==_||i[10]!==e?(v=()=>{let t=e.current;if(!t||(h(),typeof ResizeObserver>`u`))return;let n=new ResizeObserver(()=>{f.current===`auto`?h():f.current===`framed`&&p.current&&_(p.current.bbox,p.current.opts)});return n.observe(t),()=>n.disconnect()},y=[e,h,_],i[8]=h,i[9]=_,i[10]=e,i[11]=v,i[12]=y):(v=i[11],y=i[12]),(0,j.useEffect)(v,y);let b;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t,n)=>{f.current=`user`,s(r=>{let i=Math.max(yt,Math.min(bt,r.scale*e));if(i===r.scale)return r;let a=(t-r.x)/r.scale,o=(n-r.y)/r.scale;return{x:t-a*i,y:n-o*i,scale:i}})},i[13]=b):b=i[13];let x=b,S;i[14]===e?S=i[15]:(S=t=>{let n=e.current;x(t,n?n.clientWidth/2:0,n?n.clientHeight/2:0)},i[14]=e,i[15]=S);let C=S,w;i[16]===e?w=i[17]:(w=t=>{let n=e.current;if(!n)return;t.preventDefault();let r=n.getBoundingClientRect();x(t.deltaY<0?1.12:.8928571428571428,t.clientX-r.left,t.clientY-r.top)},i[16]=e,i[17]=w);let T=w,E;i[18]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e.button===0&&(u.current={id:e.pointerId,x:e.clientX,y:e.clientY,moved:!1},d.current=!1)},i[18]=E):E=i[18];let D=E,O;i[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{let t=u.current;if(!t||e.pointerId!==t.id)return;let n=e.clientX-t.x,r=e.clientY-t.y;if(!(!t.moved&&Math.hypot(n,r)<4)){if(!t.moved){t.moved=!0,l(!0);try{e.currentTarget.setPointerCapture(t.id)}catch{}}t.x=e.clientX,t.y=e.clientY,d.current=!0,f.current=`user`,s(e=>({...e,x:e.x+n,y:e.y+r}))}},i[19]=O):O=i[19];let k=O,A;i[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{let t=u.current;if(!t||e.pointerId!==t.id)return;let n=t.moved;if(n)try{e.currentTarget.releasePointerCapture(t.id)}catch{}u.current=null,l(!1),n&&requestAnimationFrame(()=>d.current=!1)},i[20]=A):A=i[20];let ee=A,N=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,te;return i[21]!==o||i[22]!==h||i[23]!==_||i[24]!==T||i[25]!==c||i[26]!==N||i[27]!==C?(te={camera:o,transform:N,panning:c,fit:h,frame:_,zoomBy:C,onWheel:T,onPointerDown:D,onPointerMove:k,onPointerUp:ee,movedRef:d},i[21]=o,i[22]=h,i[23]=_,i[24]=T,i[25]=c,i[26]=N,i[27]=C,i[28]=te):te=i[28],te}var St=1360,Ct=2.39996322;function wt(e){let t=St/820,n=e*240*136,r=Math.max(St*820,n/.22),i=Math.sqrt(r/t);return{w:Math.round(i*t),h:Math.round(i)}}function Tt(e,t,n){let{w:r,h:i}=n?{w:n.width,h:n.height}:wt(e.claims.length),a=e=>n?.claims.has(e)??!1,o=Math.max(1,e.regions.length),s=Math.min(r,i)*.34,c=e.regions.map((e,a)=>{let c=n?.regions.get(e),l=a/o*Math.PI*2-Math.PI/2;return{name:e,color:t[a%t.length],cx:c?c.cx:r/2+Math.cos(l)*s,cy:c?c.cy:i/2+Math.sin(l)*s*.82}}),l=new Map(c.map(e=>[e.name,e])),u=new Map;for(let t of e.claims){let e=u.get(t.region)??[];e.push(t),u.set(t.region,e)}let d=[];for(let[e,t]of u){let r=l.get(e)??c[0];t.forEach((e,t)=>{let i=n?.claims.get(e.id);if(i){d.push({...e,x:i.x,y:i.y});return}let a=30+56*Math.sqrt(t),o=t*Ct;d.push({...e,x:r.cx+Math.cos(o)*a,y:r.cy+Math.sin(o)*a*.92})})}let f=e=>{e.x=Math.min(r-120,Math.max(120,e.x)),e.y=Math.min(i-92,Math.max(92,e.y))},p=e=>({hw:Math.max(70,e.name.length*7+24)/2,hh:26}),m=e=>!a(e.id),h=e=>Math.floor(e/214),g=e=>Math.floor(e/110),_=2**26,v=(e,t)=>e*_+t,y=()=>{let e=new Map,t=d.map(e=>v(h(e.x),g(e.y)));for(let n=0;n<d.length;n+=1){let r=e.get(t[n]);r?r.push(n):e.set(t[n],[n])}let n=n=>{let r=v(h(d[n].x),g(d[n].y));if(r===t[n])return;let i=e.get(t[n]);i&&i.splice(i.indexOf(n),1),t[n]=r;let a=e.get(r);a?a.push(n):e.set(r,[n])},r=(t,n)=>{let r=d[t],i=m(r),a=h(r.x),o=g(r.y),s=-1;for(let t=-1;t<=1;t+=1)for(let c=-1;c<=1;c+=1){let l=e.get(v(a+t,o+c));if(l)for(let e=0;e<l.length;e+=1){let t=l[e];if(t<=n||s>=0&&t>s)continue;let a=d[t];if(!i&&!m(a))continue;let o=214-Math.abs(a.x-r.x),c=110-Math.abs(a.y-r.y);o>0&&c>0&&(s=t)}}return s};for(let e=0;e<600;e+=1){let e=!1;for(let t=0;t<d.length;t+=1){let i=d[t],a=m(i),o=t;for(let s=r(t,o);s>=0;s=r(t,o)){o=s;let r=d[s],c=m(r),l=r.x-i.x,u=r.y-i.y,p=214-Math.abs(l),h=110-Math.abs(u),g=a?c?.5:1:0,_=c?a?.5:1:0;if(p<h){let e=(p+1)*(l<0?-1:1);i.x-=e*g,r.x+=e*_}else{let e=(h+1)*(u<0?-1:1);i.y-=e*g,r.y+=e*_}a&&f(i),c&&f(r),n(t),n(s),e=!0}}for(let t of c){let{hw:r,hh:i}=p(t);for(let a=0;a<d.length;a+=1){let o=d[a];if(!m(o))continue;let s=o.x-t.cx,c=o.y-t.cy,l=200/2+r+14-Math.abs(s),u=96/2+i+14-Math.abs(c);l>0&&u>0&&(l<u?o.x+=(l/2+.5)*(s<0?-1:1):o.y+=(u/2+.5)*(c<0?-1:1),f(o),n(a),e=!0)}}if(!e)break}for(let e of d)m(e)&&f(e)};if(n){let e=(e,t,n)=>{if(e<120||e>r-120||t<92||t>i-92)return!1;for(let r of n)if(Math.abs(e-r.x)<214&&Math.abs(t-r.y)<110)return!1;for(let n of c){let{hw:r,hh:i}=p(n);if(Math.abs(e-n.cx)<200/2+r+14&&Math.abs(t-n.cy)<96/2+i+14)return!1}return!0},t=d.filter(e=>a(e.id));for(let n of d){if(a(n.id))continue;let r=l.get(n.region)??c[0];for(let i=0;i<4e3;i+=1){let a=20+22*Math.sqrt(i),o=i*Ct,s=r.cx+Math.cos(o)*a,c=r.cy+Math.sin(o)*a*.92;if(e(s,c,t)){n.x=s,n.y=c;break}}t.push(n)}}y();for(let e of c){if(n?.regions.has(e.name))continue;let t=d.filter(t=>t.region===e.name);if(t.length===0)continue;let i=1/0,a=0;for(let e of t)e.y<i&&(i=e.y),a+=e.x;e.cx=Math.min(r-80,Math.max(80,a/t.length)),e.cy=Math.max(28,i-74)}y();let b=[],x=[];for(let e of c){let t=d.filter(t=>t.region===e.name);if(t.length===0)continue;x.push(t[0]);let n=t.slice(1),r=t[0];for(;n.length>0;){let e=0,t=1/0;for(let i=0;i<n.length;i+=1){let a=(n[i].x-r.x)**2+(n[i].y-r.y)**2;a<t&&(t=a,e=i)}let i=n.splice(e,1)[0];b.push({a:r.id,b:i.id}),r=i}}for(let e=1;e<x.length;e+=1)b.push({a:x[e-1].id,b:x[e].id});return{regions:c,claims:d,links:b,width:r,height:i}}function Et(e,t,n){let r=Tt({claims:e.claims,regions:e.themes.map(e=>e.id)},t,n),i=new Map(r.claims.map(e=>[e.id,{x:e.x,y:e.y}])),a=new Map(r.regions.map(e=>[e.name,e])),o=e.contradictions.map(e=>{let t=i.get(e.a),n=i.get(e.b),a=t&&n?(t.x+n.x)/2:t?.x??n?.x??r.width/2,o=t&&n?(t.y+n.y)/2:t?.y??n?.y??r.height/2;return{...e,x:a,y:o}}),s=e.consensus.map(e=>{let t=e.memberClaimIds.map(e=>i.get(e)).filter(e=>!!e);if(t.length===0)return{...e,x:r.width/2,y:r.height/2,r:200};let n=t.reduce((e,t)=>e+t.x,0)/t.length,a=t.reduce((e,t)=>e+t.y,0)/t.length,o=Math.max(...t.map(e=>Math.hypot(e.x-n,e.y-a)))+200*.7;return{...e,x:n,y:a,r:o}}),c=new Map,l=e.gaps.map((e,t)=>{let n=e.theme?a.get(e.theme):void 0,i=c.get(e.theme)??0;if(c.set(e.theme,i+1),n){let t=r.claims.filter(t=>t.region===e.theme),a=t.length?Math.max(...t.map(e=>e.y)):n.cy;return{...e,x:n.cx,y:a+96+24+i*114}}return{...e,x:r.width*(.2+.6*(t%4/3)),y:r.height-60-i*114}});return{...r,contradictions:o,gaps:l,consensus:s,contentBox:Dt(r,o,l,s)}}function Dt(e,t,n,r){let i=[],a=[],o=(e,t,n,r)=>{i.push(e-n,e+n),a.push(t-r,t+r)};for(let t of e.claims)o(t.x,t.y,200/2,96/2);for(let e of[...t,...n])o(e.x,e.y,200/2,96/2);for(let e of r)o(e.x,e.y,e.r,e.r);for(let t of e.regions)o(t.cx,t.cy,90,22);if(i.length===0)return{x:0,y:0,w:e.width,h:e.height};let s=Math.min(...i),c=Math.min(...a);return{x:s,y:c,w:Math.max(1,Math.max(...i)-s),h:Math.max(1,Math.max(...a)-c)}}var Ot=null,kt=0,At=new Map;function jt(){if(typeof Worker>`u`)return null;if(Ot)return Ot;try{return Ot=new Worker(new URL(`/assets/prismLayout.worker-CZO2CY7B.js`,``+import.meta.url),{type:`module`}),Ot.onmessage=e=>{let t=e.data,n=At.get(t.id);n&&(At.delete(t.id),t.ok&&t.result?n.resolve(t.result):n.reject(Error(t.error??`Layout failed`)))},Ot.onerror=()=>{let e=Error(`Layout worker failed`);for(let t of At.values())t.reject(e);At.clear(),Ot?.terminate(),Ot=null},Ot}catch{return Ot=null,null}}function Mt(e){let t=jt();if(!t)return null;let n=kt+=1;return new Promise((r,i)=>{At.set(n,{resolve:r,reject:i}),t.postMessage({...e,id:n,palette:[...e.palette]})})}async function Nt(e,t){try{return await(Mt({kind:`prism`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(Tt(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(Tt(e,t)),0))}}async function Pt(e,t){try{return await(Mt({kind:`corpus`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(Et(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(Et(e,t)),0))}}var Q=t();function Ft(e){let t=(0,M.c)(23),{page:n,pageCount:r,onPageChange:i}=e;if(r<=1)return null;let a=n<=1,o;t[0]!==i||t[1]!==n?(o=()=>i(n-1),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-nav-btn`,disabled:a,onClick:o,"aria-label":`Previous page`,children:`‹`}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=(0,Q.jsx)(`strong`,{children:n}),t[6]=n,t[7]=c);let l;t[8]===r?l=t[9]:(l=(0,Q.jsxs)(`span`,{className:`prism-page-nav-of`,children:[` / `,r]}),t[8]=r,t[9]=l);let u;t[10]!==c||t[11]!==l?(u=(0,Q.jsxs)(`span`,{className:`prism-page-nav-at`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12];let d=n>=r,f;t[13]!==i||t[14]!==n?(f=()=>i(n+1),t[13]=i,t[14]=n,t[15]=f):f=t[15];let p;t[16]!==d||t[17]!==f?(p=(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-nav-btn`,disabled:d,onClick:f,"aria-label":`Next page`,children:`›`}),t[16]=d,t[17]=f,t[18]=p):p=t[18];let m;return t[19]!==s||t[20]!==u||t[21]!==p?(m=(0,Q.jsxs)(`div`,{className:`prism-page-nav`,role:`group`,"aria-label":`Page through the document`,children:[s,u,p]}),t[19]=s,t[20]=u,t[21]=p,t[22]=m):m=t[22],m}var It=4;function Lt(e,t){let n=(0,M.c)(4),r,i;n[0]!==t||n[1]!==e?(r=()=>{let n=e.current;if(!n||!t)return;let r=!1,i=!1,a=-1,o=0,s=0,c=0,l=0,u=()=>n.scrollWidth>n.clientWidth+1||n.scrollHeight>n.clientHeight+1,d=e=>{e.button!==0||!u()||e.target?.closest(`button, a, input, textarea, select, [role="button"]`)||(r=!0,i=!1,a=e.pointerId,o=e.clientX,s=e.clientY,c=n.scrollLeft,l=n.scrollTop)},f=e=>{if(!r||e.pointerId!==a)return;let t=e.clientX-o,u=e.clientY-s;if(!i){if(Math.hypot(t,u)<It)return;i=!0,n.classList.add(`is-panning`);try{n.setPointerCapture(a)}catch{}}e.preventDefault(),n.scrollLeft=c-t,n.scrollTop=l-u},p=e=>{if(e.pointerId===a){if(r=!1,i){i=!1,n.classList.remove(`is-panning`);try{n.releasePointerCapture(a)}catch{}}a=-1}};return n.addEventListener(`pointerdown`,d),n.addEventListener(`pointermove`,f),n.addEventListener(`pointerup`,p),n.addEventListener(`pointercancel`,p),()=>{n.removeEventListener(`pointerdown`,d),n.removeEventListener(`pointermove`,f),n.removeEventListener(`pointerup`,p),n.removeEventListener(`pointercancel`,p),n.classList.remove(`is-panning`)}},i=[e,t],n[0]=t,n[1]=e,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,j.useEffect)(r,i)}function Rt({ariaLabel:e,kindLabel:t,color:n,page:r,pageLabel:i,title:a,docName:o,pageCount:s,onPageChange:c,zoom:l,zoomVariant:u=`fit`,onClose:d,closeLabel:f,connections:p,onNavigate:m,footer:h,scrollRef:g,panBody:_=!1,children:v}){return Lt(g,_),(0,Q.jsxs)(`aside`,{className:`prism-page`,"aria-label":e,children:[(0,Q.jsxs)(`header`,{className:`prism-page-head`,children:[(0,Q.jsxs)(`span`,{className:`prism-page-tag`,style:{color:n},children:[t,` · `,i??`SOURCE p.${r}`]}),(0,Q.jsx)(`span`,{className:`prism-page-title`,children:o?`${o} — ${a}`:a}),s&&c&&(0,Q.jsx)(Ft,{page:r,pageCount:s,onPageChange:c}),l&&(0,Q.jsxs)(`div`,{className:`prism-page-zoom`,"aria-label":`Zoom the page`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:l.zoomOut,"aria-label":`Zoom out`,children:`−`}),(0,Q.jsx)(`button`,{type:`button`,onClick:l.zoomIn,"aria-label":`Zoom in`,children:`+`}),u===`fit`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,onClick:l.fitWidth,"aria-label":`Fit width`,title:`Fit width`,children:`↔`}),(0,Q.jsx)(`button`,{type:`button`,onClick:l.fitScreen,"aria-label":`Fit whole page`,title:`Fit page`,children:`⤢`})]})]}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-close`,onClick:d,"aria-label":f,children:`✕`})]}),(0,Q.jsx)(`div`,{className:`prism-page-scroll`+(_?` is-pannable`:``),ref:g,children:v}),p&&p.length>0&&m&&(0,Q.jsxs)(`nav`,{className:`prism-page-conns`,"aria-label":`Connected claims`,children:[(0,Q.jsxs)(`span`,{className:`prism-page-conns-label`,children:[`Connected (`,p.length,`)`]}),(0,Q.jsx)(`div`,{className:`prism-page-conns-list`,children:p.map(e=>(0,Q.jsxs)(`button`,{type:`button`,className:`prism-page-conn`,onClick:()=>m(e.id),title:`Go to “${e.title}”`,children:[e.title,` →`]},e.id))})]}),(0,Q.jsx)(`footer`,{className:`prism-page-foot`,children:h})]})}function $(e,t,n,r,i,a){let o=[];if(e.length>0&&r?.trim()){let t=e[0];o.push({y:t.y,anchorY:t.y+t.h/2,anchorX:t.x+t.w,color:n,text:r.trim()})}t.forEach((e,t)=>{let n=i?.[t];if(e.length>0&&n?.note?.trim()){let t=e[0];o.push({y:t.y,anchorY:t.y+t.h/2,anchorX:t.x+t.w,color:n.color,text:n.note.trim()})}}),o.sort((e,t)=>e.y-t.y);let s=86/(a||1);for(let e=1;e<o.length;e++)o[e].y<o[e-1].y+s&&(o[e].y=o[e-1].y+s);return o}function zt({geometry:e,zoom:t,color:n,quote:r,also:i,isFigure:a,penOn:o,penColor:s,penAccent:c,seed:l}){let{dims:u,rects:d,alsoRects:p,figure:m}=e,h=o===!0&&r.trim().length>0&&u.w>0,g=(0,j.useMemo)(()=>{if(!h)return[];let e=f(d,m??void 0,a??!1,u.w,u.h,l,c),t=p.flatMap((e,t)=>e.length?f(e,void 0,!1,u.w,u.h,`${l}:also${t}`):[]);return[...e,...t]},[h,d,p,m,a,u.w,u.h,l,c]);return(0,Q.jsxs)(Q.Fragment,{children:[(d.length>0||m)&&(0,Q.jsxs)(`div`,{className:`prism-page-marks`,style:{transform:`scale(${t})`,transformOrigin:`0 0`},"aria-hidden":`true`,children:[m&&(0,Q.jsx)(`span`,{className:`prism-page-figure`,style:{left:m.x,top:m.y,width:m.w,height:m.h,borderColor:`color-mix(in oklab, ${n} 70%, transparent)`,boxShadow:`0 0 0 3px color-mix(in oklab, ${n} 20%, transparent)`}}),p.map((e,t)=>e.map((e,r)=>(0,Q.jsx)(`span`,{className:`prism-page-mark`,style:{left:e.x,top:e.y,width:e.w,height:e.h,background:`color-mix(in oklab, ${i?.[t]?.color??n} 18%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${i?.[t]?.color??n} 35%, transparent)`}},`a${t}-${r}`))),d.map((e,t)=>(0,Q.jsx)(`span`,{className:`prism-page-mark`,style:{left:e.x,top:e.y,width:e.w,height:e.h,background:`color-mix(in oklab, ${n} 32%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${n} 55%, transparent)`}},t))]}),o&&g.length>0&&(0,Q.jsx)(`svg`,{className:`prism-pen`,width:u.w,height:u.h,viewBox:`0 0 ${u.w} ${u.h}`,style:{transform:`scale(${t})`,transformOrigin:`0 0`,color:s},"aria-hidden":`true`,children:g.map((e,t)=>(0,Q.jsxs)(`g`,{style:{"--ink-delay":`${t*450}ms`},children:[(0,Q.jsx)(`path`,{className:`prism-pen-halo`,d:e.d,pathLength:1,fill:e.fill?`currentColor`:`none`}),(0,Q.jsx)(`path`,{className:`prism-pen-stroke`,d:e.d,pathLength:1,fill:e.fill?`currentColor`:`none`}),e.head&&(0,Q.jsx)(`path`,{className:`prism-pen-head`,d:e.head,pathLength:1,fill:`none`}),e.label&&(0,Q.jsx)(`text`,{className:`prism-pen-glyph`,x:e.label.x,y:e.label.y,textAnchor:e.label.anchor,fontSize:e.label.size??26,children:e.label.text})]},t))},l)]})}function Bt({entries:e,dims:t,zoom:n,seed:r}){if(e.length===0)return null;let i=t.w*n,a=t.w+210/(n||1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`svg`,{className:`prism-note-arrows`,width:a,height:t.h,viewBox:`0 0 ${a} ${t.h}`,style:{transform:`scale(${n})`,transformOrigin:`0 0`},"aria-hidden":`true`,children:e.map((e,r)=>{let i=t.w+12/(n||1),a=e.y+14/(n||1),o=(e.anchorX+i)/2,s=`M ${i} ${a} C ${o} ${a}, ${o} ${e.anchorY}, ${e.anchorX+6} ${e.anchorY}`,c=`M ${e.anchorX+14} ${e.anchorY-6} L ${e.anchorX+5} ${e.anchorY} L ${e.anchorX+15} ${e.anchorY+5}`;return(0,Q.jsxs)(`g`,{style:{"--ink-delay":`${400+r*500}ms`,color:e.color},children:[(0,Q.jsx)(`path`,{className:`prism-note-arrow`,d:s,pathLength:1,fill:`none`}),(0,Q.jsx)(`path`,{className:`prism-note-arrow-head`,d:c,pathLength:1,fill:`none`})]},r)})},`na-`+r),(0,Q.jsx)(`div`,{className:`prism-margin`,style:{width:190,left:i+24},children:e.map((e,t)=>(0,Q.jsx)(`div`,{className:`prism-margin-note`,style:{top:e.y*n,"--note-c":e.color,"--ink-delay":`${400+t*500}ms`},children:e.text},t))})]})}function Vt(e,t,n){let r=(0,j.useRef)(n);r.current=n;let[i,a]=(0,j.useState)({w:0,h:0}),o=(0,j.useRef)(i),[s,c]=(0,j.useState)(1),l=(0,j.useRef)(`width`),u=(0,j.useRef)(!1),d=(0,j.useRef)(!1),f=(0,j.useCallback)(()=>{l.current=`width`;let t=e.current,n=o.current;if(!t||n.w===0)return;let i=r.current?.padding??32,a=r.current?.gutterReserve??0,s=t.clientWidth-i-a;s>0&&c(s/n.w)},[e]),p=(0,j.useCallback)(()=>{l.current=`screen`;let t=e.current,n=o.current;if(!t||n.w===0||n.h===0)return;let i=r.current?.padding??32,a=r.current?.gutterReserve??0,s=t.clientWidth-i-a,u=t.clientHeight-i;s>0&&u>0&&c(Math.min(s/n.w,u/n.h))},[e]),m=(0,j.useCallback)(()=>{l.current=`manual`,c(e=>Math.min(4,e*1.25))},[]),h=(0,j.useCallback)(()=>{l.current=`manual`,c(e=>Math.max(.2,e/1.25))},[]),g=(0,j.useCallback)((e=!1)=>{l.current=`width`,u.current=!0,d.current=e,c(1)},[]),_=(0,j.useCallback)(e=>{let t=o.current;if(o.current=e,a(e),u.current){u.current=!1,f();return}if(l.current===`manual`){t.w>0&&c(n=>n*(t.w/e.w));return}l.current===`screen`?p():f()},[f,p]),v=(0,j.useRef)(null);return(0,j.useLayoutEffect)(()=>{let n=e.current;if(!n||!t||typeof ResizeObserver>`u`)return;let a=i.w/U(),o=new ResizeObserver(()=>{l.current===`width`?f():l.current===`screen`&&p();let e=r.current?.onSettledGrow;if(!e)return;let t=oe(n.clientWidth)*U(),o=n.clientWidth>a*1.1&&t>i.w,s=d.current&&n.clientWidth>0&&t!==i.w;if(o||s){d.current=!1,v.current&&clearTimeout(v.current);let t=n.clientWidth;v.current=setTimeout(()=>e(t),350)}});return o.observe(n),()=>{o.disconnect(),v.current&&clearTimeout(v.current)}},[t,i.w,f,p,e]),{zoom:s,fitMode:l.current,dims:i,fitWidth:f,fitScreen:p,zoomIn:m,zoomOut:h,setDims:_,resetForNewContent:g}}function Ht({pdf:e,source:t,page:n,quote:r,color:i,also:a,note:o,penOn:s,penColor:c,penAccent:l,onAnnotated:u,kindLabel:d,title:f,isFigure:p,docName:m,connections:h,onNavigate:g,onClose:_,pageCount:v,onPageChange:y}){let b=(0,j.useRef)(null),x=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),S=(0,j.useRef)(null),C=(0,j.useRef)(null),[w,T]=(0,j.useState)(`loading`),[E,D]=(0,j.useState)([]),[O,k]=(0,j.useState)([]),[A,M]=(0,j.useState)(null),[ee,N]=(0,j.useState)(0),te=Vt(S,w===`ready`,{gutterReserve:x?218:0,onSettledGrow:(0,j.useCallback)(()=>N(e=>e+1),[])}),{zoom:P,dims:F,setDims:I,resetForNewContent:L}=te,R=(a??[]).map(e=>e.quote).join(`\0`),z=(0,j.useRef)(null);(0,j.useEffect)(()=>{let t=!1,i=z.current,a=!i||i.pdf!==e||i.page!==n||i.quote!==r||i.isFigure!==p||i.alsoKey!==R;z.current={pdf:e,page:n,quote:r,isFigure:p,alsoKey:R};let o=S.current?.clientWidth??0,s=oe(o);a&&(T(`loading`),D([]),k([]),M(null),L(o===0));let c=R?R.split(`\0`):[];return(async()=>{let i=await ue(e,n,r,s,p,c);return i||t?i:(await new Promise(e=>window.setTimeout(e,120)),t?null:ue(e,n,r,s,p,c))})().then(e=>{if(t)return;let n=b.current;if(!e||!n){a&&T(`failed`);return}if(e.canvas.classList.add(`prism-page-canvas`),n.replaceChildren(e.canvas),C.current=e.canvas,D(e.rects),k(e.alsoRects??[]),M(e.figure??null),I({w:e.canvas.width,h:e.canvas.height}),a){T(`ready`);let t=e.figure??e.rects[0];if(t){let e=n.closest(`.prism-page-scroll`);try{e?.scrollTo?.({top:Math.max(0,t.y-120),behavior:`smooth`})}catch{}}}}),()=>{t=!0}},[e,n,r,p,R,ee,L,I]);let ne=F.w*P,re=F.h*P,B=`${t}:${n}:${r}`,ie=(0,j.useMemo)(()=>F.w===0?[]:$(E,O,i,o,a,P),[F.w,E,O,o,a,i,P]);(0,j.useEffect)(()=>{if(!s||w!==`ready`||!r.trim()||!u)return;let e=C.current,t=``;try{e&&(t=e.toDataURL(`image/jpeg`,.72))}catch{}u({pageImage:t,imgW:F.w,imgH:F.h,rects:E.map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),figure:A?{x:A.x,y:A.y,w:A.w,h:A.h}:void 0,isFigure:p??!1,seed:B})},[s,w,r,u,F,E,A,p,B]);let V={dims:F,rects:E,alsoRects:O,figure:A};return(0,Q.jsxs)(Rt,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,title:f,docName:m?.replace(/\.pdf$/i,``),pageCount:v,onPageChange:y,zoom:w===`ready`?te:void 0,onClose:_,closeLabel:`Close source page`,connections:h,onNavigate:g,scrollRef:S,panBody:!0,footer:r.trim()?w===`ready`&&A?`The outlined figure and the highlighted caption are what this claim cites.`:w===`ready`&&E.length===0?`Quote grounded on this page — highlight unavailable for this layout.`:`The highlighted text is the claim’s verbatim quote, on its real page.`:`Reading the document — the full page, exactly as it appears in the file.`,children:[w===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Rendering page `,n,`…`]}),w===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-fallback`,role:`status`,children:[(0,Q.jsxs)(`span`,{className:`prism-page-fallback-kicker`,children:[`Source excerpt · page `,n]}),(0,Q.jsx)(`strong`,{children:`Page preview unavailable`}),r.trim()?(0,Q.jsxs)(`blockquote`,{children:[`“`,r.trim(),`”`]}):(0,Q.jsx)(`p`,{children:`The original file is still attached. Try another page or reopen the document.`}),(0,Q.jsx)(`span`,{className:`prism-page-fallback-note`,children:r.trim()?`Verbatim text grounded to page ${n}. Try another page or reopen the document.`:`The page could not be rasterized in this browser.`})]}),(0,Q.jsxs)(`div`,{className:`prism-page-unit`,style:{width:ne?ne+(ie.length>0?218:0):void 0,display:w===`ready`?void 0:`none`},children:[(0,Q.jsxs)(`div`,{className:`prism-page-frame`,style:{width:ne||void 0,height:re||void 0},children:[(0,Q.jsx)(`div`,{className:`prism-page-holder`,ref:b}),w===`ready`&&(0,Q.jsx)(zt,{geometry:V,zoom:P,color:i,quote:r,also:a,isFigure:p,penOn:s,penColor:c,penAccent:l,seed:B})]}),w===`ready`&&(0,Q.jsx)(Bt,{entries:ie,dims:F,zoom:P,seed:B})]})]})}function Ut(e){let t=(0,M.c)(36),{image:n,page:r,quote:i,color:a,kindLabel:o,title:s,docName:c,connections:l,onNavigate:u,onClose:d,pageCount:f,onPageChange:p}=e,m=(0,j.useRef)(null),h=(0,j.useRef)(null),[g,_]=(0,j.useState)(`loading`),v=Vt(m,g===`ready`),{zoom:y,dims:b,setDims:x,resetForNewContent:S}=v,C;t[0]===x?C=t[1]:(C=e=>{x({w:e.naturalWidth,h:e.naturalHeight}),_(`ready`)},t[0]=x,t[1]=C);let w=C,T=n?`${n.mime}:${n.data}`:void 0,E;t[2]!==w||t[3]!==S?(E=()=>{_(`loading`),S();let e=h.current;e&&e.complete&&e.naturalWidth>0&&w(e)},t[2]=w,t[3]=S,t[4]=E):E=t[4];let D;t[5]!==w||t[6]!==S||t[7]!==T?(D=[T,S,w],t[5]=w,t[6]=S,t[7]=T,t[8]=D):D=t[8],(0,j.useEffect)(E,D);let O=b.w*y,k=b.h*y,A=`Source slide ${r}`,ee=`SLIDE ${r}`,N;t[9]===c?N=t[10]:(N=c?.replace(/\.(pptx|docx|xlsx)$/i,``),t[9]=c,t[10]=N);let te=g===`ready`?v:void 0,P=i.trim()?`This slide is an image — the quote above is the exact text Mavéa read on it.`:`Reading the document — the full slide, exactly as it appears in the file.`,F;t[11]!==a||t[12]!==k||t[13]!==O||t[14]!==n||t[15]!==w||t[16]!==r||t[17]!==i||t[18]!==g?(F=n?(0,Q.jsxs)(`figure`,{className:`prism-slide-figure`,children:[(0,Q.jsx)(`div`,{className:`prism-slide-stage`,style:{width:O||void 0,height:k||void 0,display:g===`ready`?void 0:`none`},children:(0,Q.jsx)(`img`,{ref:h,className:`prism-slide-img`,src:`data:${n.mime};base64,${n.data}`,alt:`Slide ${r}`,onLoad:e=>w(e.currentTarget),onError:()=>_(`failed`)})}),g===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Rendering slide `,r,`…`]}),g===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t load this slide image. The quote is still grounded on slide `,r,`.`]}),g===`ready`&&i.trim()&&(0,Q.jsxs)(`figcaption`,{className:`prism-slide-quote`,style:{borderColor:a},children:[(0,Q.jsx)(`span`,{className:`prism-slide-quote-label`,style:{color:a},children:`Mavéa read this on the slide`}),`“`,i,`”`]})]}):(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Slide `,r,` image unavailable.`]}),t[11]=a,t[12]=k,t[13]=O,t[14]=n,t[15]=w,t[16]=r,t[17]=i,t[18]=g,t[19]=F):F=t[19];let I;return t[20]!==a||t[21]!==l||t[22]!==o||t[23]!==d||t[24]!==u||t[25]!==p||t[26]!==r||t[27]!==f||t[28]!==A||t[29]!==ee||t[30]!==N||t[31]!==te||t[32]!==P||t[33]!==F||t[34]!==s?(I=(0,Q.jsx)(Rt,{ariaLabel:A,kindLabel:o,color:a,page:r,pageLabel:ee,title:s,docName:N,pageCount:f,onPageChange:p,zoom:te,onClose:d,closeLabel:`Close source slide`,connections:l,onNavigate:u,scrollRef:m,panBody:!0,footer:P,children:F}),t[20]=a,t[21]=l,t[22]=o,t[23]=d,t[24]=u,t[25]=p,t[26]=r,t[27]=f,t[28]=A,t[29]=ee,t[30]=N,t[31]=te,t[32]=P,t[33]=F,t[34]=s,t[35]=I):I=t[35],I}function Wt(e){let t=[],n=``;for(let r=0;r<e.length;r+=1){let i=D(e[r]);for(let e=0;e<i.length;e+=1)n+=i[e],t.push(r);/\s/.test(e[r])&&n.at(-1)!==` `&&(n+=` `,t.push(r))}return{norm:n,map:t}}function Gt(e,t,n){let r=D(e);if(!r)return null;let i=t.indexOf(r);return i<0?null:[n[i],n[Math.min(i+r.length-1,n.length-1)]+1]}function Kt(e,t,n){if(!e)return[];let{norm:r,map:i}=Wt(e),a=[],o=[{anchor:`primary`,quote:t},...(n??[]).map((e,t)=>({anchor:`also-${t}`,quote:e.quote}))];for(let e of o){if(!e.quote.trim())continue;let t=Gt(e.quote,r,i);if(!t)continue;let[n,o]=t;a.some(e=>n<e.end&&e.start<o)||a.push({anchor:e.anchor,start:n,end:o})}a.sort((e,t)=>e.start-t.start);let s=[],c=0;for(let t of a)t.start>c&&s.push({text:e.slice(c,t.start)}),s.push({text:e.slice(t.start,t.end),anchor:t.anchor}),c=t.end;return c<e.length&&s.push({text:e.slice(c)}),s}var qt={dims:{w:0,h:0},rects:[],alsoRects:[]};function Jt(e,t,n){let r=e.getBoundingClientRect();return{x:(r.left-t.left)/n,y:(r.top-t.top)/n,w:r.width/n,h:r.height/n}}function Yt(e,t,n){let[r,i]=(0,j.useState)(qt);return(0,j.useEffect)(()=>{let n=e.current;if(!n){i(qt);return}let r=()=>{let e=n.getBoundingClientRect();if(e.width===0&&e.height===0)return;let r=Array.from(n.querySelectorAll(`[data-prism-anchor="primary"]`)).map(n=>Jt(n,e,t)),a=[];n.querySelectorAll(`[data-prism-anchor^="also-"]`).forEach(n=>{let r=n.getAttribute(`data-prism-anchor`)??``,i=Number(r.slice(5));!Number.isInteger(i)||i<0||(a[i]??=[]).push(Jt(n,e,t))});for(let e=0;e<a.length;e+=1)a[e]??=[];i({dims:{w:e.width/t,h:e.height/t},rects:r,alsoRects:a})};if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(n),()=>a.disconnect()},[e,t,...n]),r}var Xt=680,Zt=14;function Qt(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function $t(e){let t=(0,M.c)(84),{doc:n,source:r,page:i,quote:a,color:o,also:s,note:c,penOn:l,penColor:u,penAccent:d,onAnnotated:f,kindLabel:p,title:m,docName:h,connections:g,onNavigate:_,onClose:v,pageCount:y,onPageChange:b}=e,[S,C]=(0,j.useState)(null),[w,T]=(0,j.useState)(`loading`),E,D;t[0]===n?(E=t[1],D=t[2]):(E=()=>{let e=!1;return T(`loading`),(x(n)?Ve(n).then(nn):He(n)).then(t=>{if(!e){if(!t||t.length===0){T(`failed`);return}C(t),T(`ready`)}}),()=>{e=!0}},D=[n],t[0]=n,t[1]=E,t[2]=D),(0,j.useEffect)(E,D);let O=S?.[i-1]??``,k;t[3]!==s||t[4]!==O||t[5]!==a?(k=Kt(O,a,s),t[3]=s,t[4]=O,t[5]=a,t[6]=k):k=t[6];let A=k,ee=A.some(tn),N=(0,j.useRef)(null),te=(0,j.useRef)(null),P=!!c?.trim()||(s??[]).some(en),F=P?218:0,I;t[7]===F?I=t[8]:(I={gutterReserve:F},t[7]=F,t[8]=I);let L=Vt(N,w===`ready`,I),{zoom:R,resetForNewContent:z}=L,ne=(0,j.useRef)(null),re,B;t[9]!==n||t[10]!==i||t[11]!==z?(re=()=>{let e=ne.current;ne.current={doc:n,page:i},(!e||e.doc!==n||e.page!==i)&&z()},B=[n,i,z],t[9]=n,t[10]=i,t[11]=z,t[12]=re,t[13]=B):(re=t[12],B=t[13]),(0,j.useEffect)(re,B);let ie;t[14]===A?ie=t[15]:(ie=[A],t[14]=A,t[15]=ie);let V=Yt(te,R,ie),ae;t[16]!==V.alsoRects||t[17]!==V.dims||t[18]!==V.rects?(ae={dims:V.dims,rects:V.rects,alsoRects:V.alsoRects},t[16]=V.alsoRects,t[17]=V.dims,t[18]=V.rects,t[19]=ae):ae=t[19];let H=ae,U;t[20]!==s||t[21]!==o||t[22]!==V.alsoRects||t[23]!==V.dims.w||t[24]!==V.rects||t[25]!==c||t[26]!==R?(U=V.dims.w===0?[]:$(V.rects,V.alsoRects,o,c,s,R),t[20]=s,t[21]=o,t[22]=V.alsoRects,t[23]=V.dims.w,t[24]=V.rects,t[25]=c,t[26]=R,t[27]=U):U=t[27];let oe=U,W=`${r}:${i}:${a}`,se;t[28]!==V.dims.h||t[29]!==V.dims.w||t[30]!==V.rects||t[31]!==f||t[32]!==l||t[33]!==a||t[34]!==W||t[35]!==w?(se=()=>{!l||w!==`ready`||!a.trim()||!f||V.dims.w===0||f({pageImage:``,imgW:Math.max(1,Math.round(V.dims.w)),imgH:Math.max(1,Math.round(V.dims.h)),rects:V.rects,isFigure:!1,seed:W})},t[28]=V.dims.h,t[29]=V.dims.w,t[30]=V.rects,t[31]=f,t[32]=l,t[33]=a,t[34]=W,t[35]=w,t[36]=se):se=t[36];let G;t[37]!==V||t[38]!==f||t[39]!==l||t[40]!==a||t[41]!==W||t[42]!==w?(G=[l,w,a,f,V,W],t[37]=V,t[38]=f,t[39]=l,t[40]=a,t[41]=W,t[42]=w,t[43]=G):G=t[43],(0,j.useEffect)(se,G);let K=P?218:0,q=`Source page ${i}`,ce;t[44]===h?ce=t[45]:(ce=h?.replace(/\.docx$/i,``),t[44]=h,t[45]=ce);let le=w===`ready`?L:void 0,J=a.trim()?w===`ready`&&ee?`The highlighted text is the claim’s verbatim quote, on its real page.`:`Quote grounded on this page.`:`Reading the document — the full page, exactly as it appears in the file.`,ue;t[46]!==i||t[47]!==w?(ue=w===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,i,`…`]}),t[46]=i,t[47]=w,t[48]=ue):ue=t[48];let de;t[49]!==i||t[50]!==w?(de=w===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this page. The quote is still grounded on page `,i,`.`]}),t[49]=i,t[50]=w,t[51]=de):de=t[51];let fe;t[52]!==s||t[53]!==o||t[54]!==V.dims||t[55]!==K||t[56]!==oe||t[57]!==d||t[58]!==u||t[59]!==l||t[60]!==a||t[61]!==W||t[62]!==A||t[63]!==w||t[64]!==H||t[65]!==R?(fe=w===`ready`&&(0,Q.jsxs)(`div`,{className:`prism-doc-unit`,style:{maxWidth:Xt+K},children:[(0,Q.jsxs)(`div`,{className:`prism-doc-sheet prism-doc-text`,ref:te,style:{width:K?`calc(100% - ${K}px)`:`100%`,maxWidth:Xt,fontSize:`${Zt*R}px`},children:[A.map((e,t)=>e.anchor?(0,Q.jsx)(`mark`,{"data-prism-anchor":e.anchor,className:`prism-office-mark`,style:{background:`color-mix(in oklab, ${Qt(e.anchor,o,s)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${Qt(e.anchor,o,s)} 55%, transparent)`},children:e.text},t):(0,Q.jsx)(j.Fragment,{children:e.text},t)),(0,Q.jsx)(zt,{geometry:H,zoom:R,color:o,quote:a,also:s,penOn:l,penColor:u,penAccent:d,seed:W})]}),(0,Q.jsx)(Bt,{entries:oe,dims:V.dims,zoom:R,seed:W})]}),t[52]=s,t[53]=o,t[54]=V.dims,t[55]=K,t[56]=oe,t[57]=d,t[58]=u,t[59]=l,t[60]=a,t[61]=W,t[62]=A,t[63]=w,t[64]=H,t[65]=R,t[66]=fe):fe=t[66];let pe;return t[67]!==o||t[68]!==g||t[69]!==p||t[70]!==v||t[71]!==_||t[72]!==b||t[73]!==i||t[74]!==y||t[75]!==q||t[76]!==ce||t[77]!==le||t[78]!==J||t[79]!==ue||t[80]!==de||t[81]!==fe||t[82]!==m?(pe=(0,Q.jsxs)(Rt,{ariaLabel:q,kindLabel:p,color:o,page:i,title:m,docName:ce,pageCount:y,onPageChange:b,zoom:le,zoomVariant:`scale`,onClose:v,closeLabel:`Close source page`,connections:g,onNavigate:_,scrollRef:N,footer:J,children:[ue,de,fe]}),t[67]=o,t[68]=g,t[69]=p,t[70]=v,t[71]=_,t[72]=b,t[73]=i,t[74]=y,t[75]=q,t[76]=ce,t[77]=le,t[78]=J,t[79]=ue,t[80]=de,t[81]=fe,t[82]=m,t[83]=pe):pe=t[83],pe}function en(e){return!!e.note?.trim()}function tn(e){return e.anchor===`primary`}function nn(e){return e.pages}var rn=960,an=540,on={w:rn,h:an},sn=[];function cn(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function ln(e,t,n,r){return e.map((e,i)=>e.anchor?(0,Q.jsx)(`mark`,{"data-prism-anchor":e.anchor,className:`prism-office-mark`,style:{background:`color-mix(in oklab, ${cn(e.anchor,t,n)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${cn(e.anchor,t,n)} 55%, transparent)`},children:e.text},`${r}-${i}`):(0,Q.jsx)(j.Fragment,{children:e.text},`${r}-${i}`))}function un(e){return e>70?30:e>40?34:40}function dn(e){return e<=4?22:e<=7?19:e<=11?16:14}function fn(e){return e<=220?20:e<=500?17:e<=900?15:13}function pn(e){let t=(0,M.c)(115),{doc:n,source:r,page:i,quote:a,color:o,also:s,note:c,penOn:l,penColor:u,penAccent:d,onAnnotated:f,kindLabel:p,title:m,docName:h,connections:g,onNavigate:_,onClose:v,pageCount:y,onPageChange:b}=e,[x,S]=(0,j.useState)(null),[C,w]=(0,j.useState)(void 0),[T,E]=(0,j.useState)(`loading`),D,O;t[0]===n?(D=t[1],O=t[2]):(D=()=>{let e=!1;return E(`loading`),Ve(n).then(t=>{if(!e){if(!t.pages||t.pages.length===0){E(`failed`);return}S(t.pages),w(t.slideOutlines),E(`ready`)}}),()=>{e=!0}},O=[n],t[0]=n,t[1]=D,t[2]=O),(0,j.useEffect)(D,O);let k=(0,j.useRef)(null),A=(0,j.useRef)(null),ee=c?.trim()||(s??[]).some(yn)?218:0,N;t[3]===ee?N=t[4]:(N={gutterReserve:ee},t[3]=ee,t[4]=N);let te=Vt(k,T===`ready`,N),{zoom:P,dims:F,setDims:I,resetForNewContent:L,fitScreen:R}=te,z;t[5]!==R||t[6]!==L||t[7]!==I?(z=()=>{L((k.current?.clientWidth??0)===0),I(on),R()},t[5]=R,t[6]=L,t[7]=I,t[8]=z):z=t[8];let ne;t[9]!==n||t[10]!==R||t[11]!==i||t[12]!==L||t[13]!==I?(ne=[n,i,L,I,R],t[9]=n,t[10]=R,t[11]=i,t[12]=L,t[13]=I,t[14]=ne):ne=t[14],(0,j.useEffect)(z,ne);let re=x?.[i-1]??``,B=C?.[i-1],ie;t[15]===B?ie=t[16]:(ie=!!B&&(!!B.title?.trim()||B.body.some(vn)),t[15]=B,t[16]=ie);let V=ie,ae;t[17]!==V||t[18]!==B?.title?(ae=V?B?.title?.trim():void 0,t[17]=V,t[18]=B?.title,t[19]=ae):ae=t[19];let H=ae,U=V?B?.body??sn:sn,oe;t[20]!==s||t[21]!==H||t[22]!==a?(oe=H?Kt(H,a,s):[],t[20]=s,t[21]=H,t[22]=a,t[23]=oe):oe=t[23];let W=oe,se;if(t[24]!==s||t[25]!==U||t[26]!==a){let e;t[28]!==s||t[29]!==a?(e=e=>Kt(e,a,s),t[28]=s,t[29]=a,t[30]=e):e=t[30],se=U.map(e),t[24]=s,t[25]=U,t[26]=a,t[27]=se}else se=t[27];let G=se,K;t[31]!==s||t[32]!==V||t[33]!==re||t[34]!==a?(K=V?[]:Kt(re,a,s),t[31]=s,t[32]=V,t[33]=re,t[34]=a,t[35]=K):K=t[35];let q=K,ce=V?W.some(_n)||G.some(hn):q.some(mn),le;t[36]!==G||t[37]!==q||t[38]!==W?(le=[W,G,q],t[36]=G,t[37]=q,t[38]=W,t[39]=le):le=t[39];let J=Yt(A,P,le),ue;t[40]!==F||t[41]!==J.alsoRects||t[42]!==J.rects?(ue={dims:F,rects:J.rects,alsoRects:J.alsoRects},t[40]=F,t[41]=J.alsoRects,t[42]=J.rects,t[43]=ue):ue=t[43];let de=ue,fe;t[44]!==s||t[45]!==o||t[46]!==F.w||t[47]!==J.alsoRects||t[48]!==J.rects||t[49]!==c||t[50]!==P?(fe=F.w===0?[]:$(J.rects,J.alsoRects,o,c,s,P),t[44]=s,t[45]=o,t[46]=F.w,t[47]=J.alsoRects,t[48]=J.rects,t[49]=c,t[50]=P,t[51]=fe):fe=t[51];let pe=fe,me=`${r}:${i}:${a}`,he;t[52]!==J.dims||t[53]!==J.rects||t[54]!==f||t[55]!==l||t[56]!==a||t[57]!==me||t[58]!==T?(he=()=>{!l||T!==`ready`||!a.trim()||!f||J.dims.w===0||f({pageImage:``,imgW:rn,imgH:an,rects:J.rects,isFigure:!1,seed:me})},t[52]=J.dims,t[53]=J.rects,t[54]=f,t[55]=l,t[56]=a,t[57]=me,t[58]=T,t[59]=he):he=t[59];let ge;t[60]!==J||t[61]!==f||t[62]!==l||t[63]!==a||t[64]!==me||t[65]!==T?(ge=[l,T,a,f,J,me],t[60]=J,t[61]=f,t[62]=l,t[63]=a,t[64]=me,t[65]=T,t[66]=ge):ge=t[66],(0,j.useEffect)(he,ge);let _e=F.w*P,ve=F.h*P,ye=`Source slide ${i}`,be=`SLIDE ${i}`,xe;t[67]===h?xe=t[68]:(xe=h?.replace(/\.pptx$/i,``),t[67]=h,t[68]=xe);let Se=T===`ready`?te:void 0,Ce=a.trim()?T===`ready`&&ce?`The highlighted text is the claim’s verbatim quote, on its real slide.`:`Quote grounded on this slide.`:`Reading the deck — the full slide, exactly as it appears in the file.`,we;t[69]!==i||t[70]!==T?(we=T===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading slide `,i,`…`]}),t[69]=i,t[70]=T,t[71]=we):we=t[71];let Te;t[72]!==i||t[73]!==T?(Te=T===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this slide. The quote is still grounded on slide `,i,`.`]}),t[72]=i,t[73]=T,t[74]=Te):Te=t[74];let Ee;t[75]!==s||t[76]!==G||t[77]!==o||t[78]!==F||t[79]!==q||t[80]!==ve||t[81]!==_e||t[82]!==V||t[83]!==pe||t[84]!==U||t[85]!==H||t[86]!==re||t[87]!==d||t[88]!==u||t[89]!==l||t[90]!==a||t[91]!==me||t[92]!==T||t[93]!==de||t[94]!==W||t[95]!==P?(Ee=T===`ready`&&(0,Q.jsxs)(`div`,{className:`prism-slide-unit`,style:{width:_e?_e+(pe.length>0?218:0):void 0},children:[(0,Q.jsxs)(`div`,{className:`prism-slide-frame`,style:{width:_e||void 0,height:ve||void 0},children:[(0,Q.jsx)(`div`,{className:`prism-slide-canvas`,ref:A,style:{transform:`scale(${P})`},children:V?(0,Q.jsxs)(Q.Fragment,{children:[H&&(0,Q.jsx)(`h2`,{className:`prism-slide-title`,style:{fontSize:un(H.length)},children:ln(W,o,s,`title`)}),U.length>0&&(0,Q.jsx)(`div`,{className:`prism-slide-body`,style:{fontSize:dn(U.length)},children:U.map((e,t)=>(0,Q.jsx)(`p`,{className:`prism-slide-body-line`,children:ln(G[t]??[],o,s,`b${t}`)},t))})]}):(0,Q.jsx)(`div`,{className:`prism-slide-flat`,style:{fontSize:fn(re.length)},children:ln(q,o,s,`flat`)})}),(0,Q.jsx)(zt,{geometry:de,zoom:P,color:o,quote:a,also:s,penOn:l,penColor:u,penAccent:d,seed:me})]}),(0,Q.jsx)(Bt,{entries:pe,dims:F,zoom:P,seed:me})]}),t[75]=s,t[76]=G,t[77]=o,t[78]=F,t[79]=q,t[80]=ve,t[81]=_e,t[82]=V,t[83]=pe,t[84]=U,t[85]=H,t[86]=re,t[87]=d,t[88]=u,t[89]=l,t[90]=a,t[91]=me,t[92]=T,t[93]=de,t[94]=W,t[95]=P,t[96]=Ee):Ee=t[96];let De;return t[97]!==o||t[98]!==g||t[99]!==p||t[100]!==v||t[101]!==_||t[102]!==b||t[103]!==i||t[104]!==y||t[105]!==ye||t[106]!==be||t[107]!==xe||t[108]!==Se||t[109]!==Ce||t[110]!==we||t[111]!==Te||t[112]!==Ee||t[113]!==m?(De=(0,Q.jsxs)(Rt,{ariaLabel:ye,kindLabel:p,color:o,page:i,pageLabel:be,title:m,docName:xe,pageCount:y,onPageChange:b,zoom:Se,onClose:v,closeLabel:`Close source slide`,connections:g,onNavigate:_,scrollRef:k,panBody:!0,footer:Ce,children:[we,Te,Ee]}),t[97]=o,t[98]=g,t[99]=p,t[100]=v,t[101]=_,t[102]=b,t[103]=i,t[104]=y,t[105]=ye,t[106]=be,t[107]=xe,t[108]=Se,t[109]=Ce,t[110]=we,t[111]=Te,t[112]=Ee,t[113]=m,t[114]=De):De=t[114],De}function mn(e){return e.anchor===`primary`}function hn(e){return e.some(gn)}function gn(e){return e.anchor===`primary`}function _n(e){return e.anchor===`primary`}function vn(e){return e.trim()}function yn(e){return!!e.note?.trim()}var bn=2e4;function xn(e){let t=e.slice(0,e.indexOf(`
|
|
103
|
-
`)===-1?e.length:e.indexOf(`
|
|
104
|
-
`)),n={",":0," ":0,";":0},r=!1;for(let e of t)e===`"`?r=!r:!r&&e in n&&(n[e]+=1);let i=`,`;for(let e of Object.keys(n))n[e]>n[i]&&(i=e);return i}function Sn(e,t){let n=[],r=``,i=[],a=!1,o=()=>{i.push(r),r=``},s=()=>{o(),n.push(i),i=[]};for(let n=0;n<e.length;n+=1){let i=e[n];if(a){i===`"`?e[n+1]===`"`?(r+=`"`,n+=1):a=!1:r+=i;continue}i===`"`?a=!0:i===t?o():i===`
|
|
105
|
-
`?s():i===`\r`?e[n+1]!==`
|
|
106
|
-
`&&s():r+=i}return(r.length>0||i.length>0)&&s(),n}function Cn(e){let t=e.replace(/^\uFEFF/,``);if(!t.trim())return null;let n=Sn(t,xn(t)).filter(e=>!(e.length===1&&e[0].trim()===``));if(n.length===0)return null;let r=n[0].map((e,t)=>e.trim()||`col${t+1}`),i=r.length,a=n.slice(1),o=a.length,s=a.slice(0,bn).map(e=>{let t=e.slice(0,i);for(;t.length<i;)t.push(``);return t});return{headers:r,rows:s,sourceRowCount:o,truncated:o>s.length}}function wn(e){let t=[],n=/\S+/g,r;for(;r=n.exec(e);)t.push({start:r.index,end:r.index+r[0].length});return t}function Tn(e,t,n){let r=wn(e);if(r.length<=1)return;let i=r.findIndex(e=>e.end>t);if(i<0)return;let a=i;for(let e=i;e<r.length&&r[e].start<n;e+=1)a=e;return[i,a]}function En(e,t){if(!t.trim())return[];let n=[];return e.forEach((e,r)=>{if(!e)return;let{norm:i,map:a}=Wt(e),o=Gt(t,i,a);if(!o)return;let[s,c]=o,l=Tn(e,s,c);n.push(l?{row:r,cells:l}:{row:r})}),n}var Dn=880,On=13;function kn(e){let t=e.trim();if(!t)return!1;let n=t.replace(/^[-+(]/,``).replace(/[)%]$/,``).replace(/^[$€£¥]\s?/,``);return/^[\d,]*\.?\d+$/.test(n)}function An(e,t){return e.length>=t?e.slice(0,t):[...e,...Array(t-e.length).fill(``)]}function jn(e,t){if(e.length===0)return null;let n=e[0].map((e,t)=>e.trim()||`col${t+1}`),r=e.slice(1),i=r.length,a=r.slice(0,bn).map(e=>An(e,n.length));return{headers:n,rows:a,sheet:t,sourceRowCount:i,truncated:i>a.length}}function Mn(e,t){return e.find(e=>e.row>=1&&!t.has(e.row))}function Nn({doc:e,source:t,page:n,quote:r,color:i,also:a,note:o,penOn:s,penColor:c,penAccent:l,onAnnotated:u,kindLabel:d,title:f,docName:m,connections:h,onNavigate:g,onClose:_,pageCount:v,onPageChange:y}){let[b,x]=(0,j.useState)(`loading`),[S,C]=(0,j.useState)(null),[w,T]=(0,j.useState)(null);(0,j.useEffect)(()=>{let t=!1;return x(`loading`),C(null),T(null),p(e)?Ve(e).then(e=>{if(!t){if(!e.sheetGrids||e.sheetGrids.length===0){x(`failed`);return}T({rows:e.sheetGrids,labels:e.pageLabels??[]}),x(`ready`)}}):He(e).then(e=>{t||(!e||e.length===0?x(`failed`):(C(e),x(`ready`)))}),()=>{t=!0}},[e]);let E=w?.rows[n-1],D=w?.labels[n-1],O=S?.[n-1],k=(0,j.useMemo)(()=>b===`ready`?E?jn(E,D):O===void 0?null:Cn(O):null,[b,E,D,O]),A=(0,j.useMemo)(()=>E?E.map(e=>e.join(` `)):O===void 0?[]:O.replace(/\r\n?/g,`
|
|
107
|
-
`).split(`
|
|
108
|
-
`),[E,O]),M=(0,j.useMemo)(()=>En(A,r),[A,r]),ee=(0,j.useMemo)(()=>(a??[]).map(e=>En(A,e.quote)),[A,a]),{primaryHit:N,alsoHits:te}=(0,j.useMemo)(()=>{let e=new Set,t=Mn(M,e);return t&&e.add(t.row),{primaryHit:t,alsoHits:ee.map(t=>{let n=Mn(t,e);return n&&e.add(n.row),n})}},[M,ee]),P=!!N,F=(0,j.useRef)(null),I=(0,j.useRef)(null),L=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),R=Vt(F,b===`ready`,{gutterReserve:L?218:0}),{zoom:z,resetForNewContent:ne}=R,re=(0,j.useRef)(null);(0,j.useEffect)(()=>{let t=re.current;re.current={doc:e,page:n},(!t||t.doc!==e||t.page!==n)&&ne()},[e,n,ne]);let B=Yt(I,z,[k,N,te]),ie={dims:B.dims,rects:B.rects,alsoRects:B.alsoRects},V=(0,j.useMemo)(()=>B.dims.w===0?[]:$(B.rects,B.alsoRects,i,o,a,z),[B,o,a,i,z]),ae=`${t}:${n}:${r}`;(0,j.useEffect)(()=>{!s||b!==`ready`||!r.trim()||!u||B.dims.w===0||u({pageImage:``,imgW:Math.max(1,Math.round(B.dims.w)),imgH:Math.max(1,Math.round(B.dims.h)),rects:B.rects,isFigure:!1,seed:ae})},[s,b,r,u,B,ae]);let H=L?218:0,U=D?`SHEET · ${D}`:void 0;return(0,Q.jsxs)(Rt,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,pageLabel:U,title:f,docName:m?.replace(/\.(csv|tsv|xlsx)$/i,``),pageCount:v,onPageChange:y,zoom:b===`ready`?R:void 0,zoomVariant:`scale`,onClose:_,closeLabel:`Close source page`,connections:h,onNavigate:g,scrollRef:F,footer:r.trim()?b===`ready`&&P?`The highlighted row is the claim’s verbatim source, on its real page.`:`Quote grounded on this page.`:`Reading the document — the full sheet, exactly as it appears in the file.`,children:[b===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,n,`…`]}),b===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this page. The quote is still grounded on page `,n,`.`]}),b===`ready`&&k&&(0,Q.jsxs)(`div`,{className:`prism-sheet-unit`,style:{maxWidth:Dn+H},children:[(0,Q.jsx)(`div`,{className:`prism-sheet-scroll`,children:(0,Q.jsxs)(`div`,{className:`prism-sheet-inner`,ref:I,style:{fontSize:`${On*z}px`},children:[(0,Q.jsxs)(`table`,{className:`prism-sheet-table`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsx)(`tr`,{children:k.headers.map((e,t)=>(0,Q.jsx)(`th`,{className:kn(e)?`prism-sheet-num`:void 0,children:e},t))})}),(0,Q.jsx)(`tbody`,{children:k.rows.map((e,t)=>{let n=N!==void 0&&N.row-1===t?N:void 0,r=te.findIndex(e=>e!==void 0&&e.row-1===t),i=r>=0?te[r]:void 0,a=n?`primary`:i?`also-${r}`:void 0,o=n?.cells??i?.cells;return(0,Q.jsx)(`tr`,{"data-prism-anchor":a,children:e.map((e,t)=>(0,Q.jsx)(`td`,{className:[kn(e)&&`prism-sheet-num`,o&&t>=o[0]&&t<=o[1]&&`prism-sheet-cell-hit`].filter(Boolean).join(` `)||void 0,children:e},t))},t)})})]}),(0,Q.jsx)(zt,{geometry:ie,zoom:z,color:i,quote:r,also:a,penOn:s,penColor:c,penAccent:l,seed:ae})]})}),k.truncated&&(0,Q.jsxs)(`p`,{className:`prism-sheet-truncated`,children:[`Showing the first `,k.rows.length.toLocaleString(),` of`,` `,k.sourceRowCount.toLocaleString(),` rows.`]}),(0,Q.jsx)(Bt,{entries:V,dims:B.dims,zoom:z,seed:ae})]})]})}function Pn(e){let t=(0,M.c)(27),n,r,i,a;if(t[0]!==e){a=Symbol.for(`react.early_return_sentinel`);bb0:{let{slideImages:t,...o}=e;if(r=o,n=r.pdf,t&&t.length>0){a=(0,Q.jsx)(Ut,{image:t[r.page-1],page:r.page,quote:r.quote,color:r.color,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange});break bb0}if(m(n)){a=(0,Q.jsx)(pn,{doc:n,source:r.source,page:r.page,quote:r.quote,color:r.color,also:r.also,note:r.note,penOn:r.penOn,penColor:r.penColor,penAccent:r.penAccent,onAnnotated:r.onAnnotated,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange});break bb0}if(g(n)||S(n)&&!_(n)){a=(0,Q.jsx)($t,{doc:n,source:r.source,page:r.page,quote:r.quote,color:r.color,also:r.also,note:r.note,penOn:r.penOn,penColor:r.penColor,penAccent:r.penAccent,onAnnotated:r.onAnnotated,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange});break bb0}i=p(n)||_(n)}t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];if(a!==Symbol.for(`react.early_return_sentinel`))return a;if(i){let e;return t[5]!==n||t[6]!==r.also||t[7]!==r.color||t[8]!==r.connections||t[9]!==r.docName||t[10]!==r.kindLabel||t[11]!==r.note||t[12]!==r.onAnnotated||t[13]!==r.onClose||t[14]!==r.onNavigate||t[15]!==r.onPageChange||t[16]!==r.page||t[17]!==r.pageCount||t[18]!==r.penAccent||t[19]!==r.penColor||t[20]!==r.penOn||t[21]!==r.quote||t[22]!==r.source||t[23]!==r.title?(e=(0,Q.jsx)(Nn,{doc:n,source:r.source,page:r.page,quote:r.quote,color:r.color,also:r.also,note:r.note,penOn:r.penOn,penColor:r.penColor,penAccent:r.penAccent,onAnnotated:r.onAnnotated,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange}),t[5]=n,t[6]=r.also,t[7]=r.color,t[8]=r.connections,t[9]=r.docName,t[10]=r.kindLabel,t[11]=r.note,t[12]=r.onAnnotated,t[13]=r.onClose,t[14]=r.onNavigate,t[15]=r.onPageChange,t[16]=r.page,t[17]=r.pageCount,t[18]=r.penAccent,t[19]=r.penColor,t[20]=r.penOn,t[21]=r.quote,t[22]=r.source,t[23]=r.title,t[24]=e):e=t[24],e}let o;return t[25]===r?o=t[26]:(o=(0,Q.jsx)(Ht,{...r}),t[25]=r,t[26]=o),o}var Fn={holds:{label:`HOLDS`,token:`var(--insight)`},outdated:{label:`OUTDATED`,token:`var(--warning)`},disputed:{label:`DISPUTED`,token:`var(--warning)`},contradicted:{label:`CONTRADICTED`,token:`var(--danger)`},unsupported:{label:`UNSUPPORTED`,token:`#8c90a0`}},In=[`outdated`,`disputed`,`contradicted`,`unsupported`];function Ln(e,t,n=t+`s`){return e===1?t:n}function Rn(e){let t=e.length;if(t===0)return``;let n=e.filter(e=>In.includes(e));if(n.length===0){let e=t===1?`holds`:`hold`;return`All ${t} checked ${Ln(t,`claim`)} ${e} up against the public record.`}let r=[`contradicted`,`outdated`,`disputed`,`unsupported`],i={contradicted:`contradicted`,outdated:`outdated`,disputed:`disputed`,unsupported:`unsupported`},a=[];for(let e of r){let t=n.filter(t=>t===e).length;t>0&&a.push(`${t} ${i[e]}`)}return`${n.length} of ${t} checked ${Ln(t,`claim`)} need a second look: ${a.join(` · `)}.`}var zn=[`holds`,`outdated`,`disputed`,`contradicted`];function Bn(e,t){let n=A(e,t);if(zn.includes(e.verdict)&&!n)return{claimId:e.claimId,verdict:`unsupported`,note:`Nothing in the searched sources backs this up.`};let r=(e.note??``).trim();return{claimId:e.claimId,verdict:e.verdict,note:r||(e.verdict===`unsupported`?`Nothing in the searched sources backs this up.`:`The public record speaks to this.`),...n?{citation:n}:{}}}function Vn(e,t){let n=T(e);return n.needsKey&&!t?T(`wikipedia`):n}var Hn=[`holds`,`outdated`,`disputed`,`contradicted`,`unsupported`];function Un(e){let t=String(e??``).toLowerCase().trim();return Hn.includes(t)?t:`unsupported`}function Wn(e){return`${e.title} ${e.quote}`.replace(/\s+/g,` `).trim().slice(0,200)}function Gn(e){if(e&&typeof e==`object`)return e;let t=String(e),n=t.indexOf(`{`);if(n<0)return null;let r=0,i=!1,a=!1;for(let e=n;e<t.length;e+=1){let o=t[e];if(i){a?a=!1:o===`\\`?a=!0:o===`"`&&(i=!1);continue}if(o===`"`)i=!0;else if(o===`{`)r+=1;else if(o===`}`&&(--r,r===0))try{return JSON.parse(t.slice(n,e+1))}catch{return null}}return null}function Kn(e){return(typeof e==`string`?e.trim():``)||void 0}function qn(e){let t=Gn(e),n=t&&Array.isArray(t.verdicts)?t.verdicts:typeof e==`string`?w(e,`verdicts`):[],r=[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=e,n=Kn(t.claimId);n&&r.push({claimId:n,verdict:Un(t.verdict),note:Kn(t.note),citationQuote:Kn(t.citationQuote),citationUrl:Kn(t.citationUrl),citationDate:Kn(t.citationDate)})}return r}var Jn=`You are a meticulous fact-checker. You judge claims only against the sources given to you and return strict JSON. You never invent a source, a URL, or a quote, and you default to "unsupported" whenever the evidence is thin.`;function Yn(e,t){return`For each CLAIM below (a verbatim quote pulled from a document), decide how it stands against
|
|
109
|
-
the SOURCES listed for it (short web-search snippets — that is all you have, no full pages).
|
|
110
|
-
|
|
111
|
-
Return ONLY JSON (no prose, no fences):
|
|
112
|
-
{ "verdicts": [ { "claimId": "...", "verdict": "holds|outdated|disputed|contradicted|unsupported",
|
|
113
|
-
"note": "<=120 chars, plain", "citationQuote": "copied VERBATIM from one of that claim's sources",
|
|
114
|
-
"citationUrl": "that source's URL, copied exactly from the list" } ] }
|
|
115
|
-
|
|
116
|
-
Rules:
|
|
117
|
-
- "holds": a source clearly supports the claim. "outdated": a source gives a newer/superseding figure.
|
|
118
|
-
"disputed": credible sources genuinely conflict. "contradicted": a source directly contradicts it.
|
|
119
|
-
"unsupported": the sources don't actually bear on the claim — this is the DEFAULT; when in doubt, pick it.
|
|
120
|
-
- For ANY verdict other than "unsupported" you MUST copy a "citationQuote" word-for-word from ONE of
|
|
121
|
-
that claim's own sources, and copy its "citationUrl" exactly. If you cannot, the verdict is "unsupported".
|
|
122
|
-
- Never invent a source, URL, or quote. Only the snippets above are real. Bias hard toward "unsupported"
|
|
123
|
-
when evidence is thin or only loosely related — do not stretch a weak match into a verdict.
|
|
124
|
-
- "note" is a plain restatement ("the public record shows X" / "a 2024 source reports Y"), never "they lied".
|
|
125
|
-
|
|
126
|
-
CLAIMS AND THEIR SOURCES:
|
|
127
|
-
${e.map(e=>{let n=(t.get(e.id)??[]).map(e=>` - "${e.title}": ${e.snippet} (${e.url})`).join(`
|
|
128
|
-
`);return`[claim ${e.id}] "${e.quote}"\n sources:\n${n}`}).join(`
|
|
129
|
-
|
|
130
|
-
`)}`}async function Xn(e,t){let n=t.provider??Vn(t.searchProviderId,t.apiKey),r=e.filter(e=>e.role===`load-bearing`).slice(0,t.maxClaims??12);if(r.length===0)return[];let i=new Map;await Promise.all(r.map(async e=>{let r=await n.search(Wn(e),{apiKey:t.apiKey,signal:t.signal,limit:t.perClaimResults??4});i.set(e.id,r.map(e=>({title:e.title,url:e.url,snippet:e.snippet})))}));let a=r.filter(e=>(i.get(e.id)?.length??0)>0),o=r.filter(e=>(i.get(e.id)?.length??0)===0).map(e=>({claimId:e.id,verdict:`unsupported`,note:`No live source was found to check this.`}));if(a.length===0)return o;let s=Math.min(4096,Math.max(1400,250+a.length*150)),c;try{c=(await b(t.cfg.provider).generate({system:Jn,history:[],user:Yn(a,i),maxTokens:s,temperature:0,format:null,...t.signal?{signal:t.signal}:{}},t.cfg)).raw}catch{for(let e of a)o.push({claimId:e.id,verdict:`unsupported`,note:`Could not reach the fact-checker.`});return o}let l=qn(c),u=new Set;for(let e of l)u.has(e.claimId)||a.some(t=>t.id===e.claimId)&&(u.add(e.claimId),o.push(Bn(e,i.get(e.claimId)??[])));for(let e of a)u.has(e.id)||o.push({claimId:e.id,verdict:`unsupported`,note:`The sources did not clearly speak to this.`});return o}var Zn=4,Qn=3,$n=2,er={contradicted:4,disputed:3,outdated:2,unsupported:1,holds:0},tr={contradicts:`contradicts`,"in-tension":`is in tension with`,agrees:`agrees with`};function nr(e,t){let n=e.replace(/\s+/g,` `).trim();if(n.length<=t)return n;let r=n.slice(0,t),i=r.lastIndexOf(` `);return(i>t*.6?r.slice(0,i):r).trimEnd()+`…`}function rr(e){return Math.max(2600,Math.min(7e3,Math.round(e.length*60)+1200))}function ir(e){let t=new Map;for(let n of e)t.set(n.a,(t.get(n.a)??0)+1),t.set(n.b,(t.get(n.b)??0)+1);return t}function ar(e,t,n){if(e.length===0)return[];let r=new Map(e.map(e=>[e.id,e])),i=ir(t),a=[],o=new Set,s=0,c=(e,t,n,r)=>{a.push({id:`b${s+=1}`,kind:e,claimIds:t,caption:n,spoken:r,dwellMs:rr(r)});for(let e of t)o.add(e)},l=e.filter(e=>e.role===`load-bearing`),u=[...l.length>0?l:e].sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||e.page-t.page||e.id.localeCompare(t.id))[0];c(`open`,[u.id],`The case rests on this — “${nr(u.quote,96)}” · p.${u.page}`,`The whole case rests on this, on page ${u.page}. ${nr(u.quote,220)}`);let d={contradicts:0,"in-tension":1,agrees:2},f=t.filter(e=>e.relation!==`agrees`&&r.has(e.a)&&r.has(e.b)).sort((e,t)=>d[e.relation]-d[t.relation]).slice(0,Zn);for(let e of f){let t=r.get(e.a),n=r.get(e.b),i=e.crossDoc?` (across documents)`:``;c(`tension`,[t.id,n.id],`p.${t.page}: “${nr(t.quote,52)}” — ${tr[e.relation]}${i} — p.${n.page}: “${nr(n.quote,52)}”`,`On page ${t.page}, the document says ${nr(t.quote,140)}. But it ${tr[e.relation]} page ${n.page}: ${nr(n.quote,140)}.`)}let p=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2&&!o.has(e.c.id)).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page).slice(0,Qn);for(let{c:e,v:t}of p){let n=Fn[t].label;c(`verdict`,[e.id],`${n} — “${nr(e.quote,72)}” · p.${e.page}`,`The public record marks this ${n.toLowerCase()}: ${nr(e.quote,160)}`)}let m=e.filter(e=>(e.role===`context`||e.kind===`definition`)&&!o.has(e.id)).sort((e,t)=>e.page-t.page).slice(0,$n);for(let e of m)c(`context`,[e.id],`Context — ${nr(e.title,64)} · p.${e.page}`,`For context: ${e.title}.`);let h=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page)[0];if(h){let e=Fn[h.v].label;c(`close`,[h.c.id],`The weak point — ${e}: “${nr(h.c.quote,68)}” · p.${h.c.page}`,`So the weakest point: the public record marks this ${e.toLowerCase()} — ${nr(h.c.quote,150)}`)}else if(f.length>0){let e=f[0],t=r.get(e.a),n=r.get(e.b);c(`close`,[t.id,n.id],`The weak point — the document contradicts itself: p.${t.page} vs p.${n.page}`,`And the weakest point is that the document contradicts itself, between page ${t.page} and page ${n.page}.`)}else{let e=n.get(u.id)===`holds`;c(`close`,[u.id],e?`Nothing here contradicts itself — the case rests on this one claim, and it holds.`:`Nothing here contradicts itself — the whole case rests on this one claim.`,e?`Nothing here contradicts itself. The case rests entirely on that one claim — and the public record backs it.`:`Nothing here contradicts itself. The whole case rests on that one claim.`)}return a}var or=16;function sr(){let e=(0,M.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,j.useRef)(t),[r,i]=(0,j.useState)(0),a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{let t=n.current,r=t.findIndex(t=>t.seed===e.seed);r>=0?t[r]=e:(t.push(e),t.length>or&&t.shift()),i(t.length)},e[1]=a):a=e[1];let o=a,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{n.current=[],i(0)},e[2]=s):s=e[2];let c=s,l;return e[3]===r?l=e[4]:(l={steps:n,count:r,record:o,clear:c},e[3]=r,e[4]=l),l}var cr={forecast:`#5468e0`,stat:`#12a37a`,finding:`#1f9d7e`,risk:`#e0474d`,definition:`#5a6678`,method:`#cf8327`,diagram:`#5468e0`},lr=`#6a4fd0`;function ur(e){return cr[e]}var dr={"load-bearing":`The document leans on this`,supporting:`Supporting evidence`,context:`Context`};function fr(e){return`${dr[e.role]} — ${e.title}`}function pr(e){let t=e.role===`load-bearing`,n=e.kind===`forecast`;if(!(!t&&!n))return{...t?{star:t}:{},...n?{question:n}:{}}}var mr={forecast:`forecast`,stat:`figure`,finding:`finding`,risk:`risk`,definition:`definition`,method:`method`,diagram:`figure`},hr={"load-bearing":e=>`The ${e} the document leans on`,supporting:e=>`Supporting ${e}`,context:e=>`Context — ${e}`};function gr(e){return`${hr[e.role](mr[e.kind])} · page ${e.page}`}var _r=s();r();var vr=n(()=>c(()=>import(`./ShareModal-D4En6Y3L.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([7,2,1,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),yr=vr.Component;function br({steps:e,spec:t,pdfs:n,cfg:r,placed:a,verdicts:s}){let[l,d]=(0,j.useState)(!1),[f,p]=(0,j.useState)(null);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:l,onClick:(0,j.useCallback)(async()=>{if(!l){d(!0);try{let[{autoAnnotationSteps:r},{buildAnnotationReel:i}]=await Promise.all([c(()=>import(`./annotationAuto-BpBsjbDQ.js`),__vite__mapDeps([22,23,2,24,25,26,1,3,4,5,6,27])),c(()=>import(`./annotationReel-yzysA-Gr.js`).then(e=>e.t),__vite__mapDeps([28,2,10,1,3,4,5,6,11,16])),vr.preload()]),o=e.current,l=o.length>=1?o.slice():await r(t,n,{placed:a,verdicts:s,max:6});if(!l.length){u(`Turn on Annotate, then ask a question or tap a claim to mark it up`,`warn`);return}p(i(l,{fileName:t.fileName}))}finally{d(!1)}}},[l,e,t,n,a,s]),title:`Make a shareable reel of the marked-up pages`,...i(vr.preload),children:l?`Preparing…`:`Share reel`}),f&&(0,_r.createPortal)((0,Q.jsx)(o,{label:`Annotation reel`,overlay:!0,children:(0,Q.jsx)(yr,{script:f,cfg:r??void 0,onClose:()=>p(null)})}),document.body)]})}r();var xr=n(()=>c(()=>import(`./PrismAskController-DUvOTeW9.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([29,1,2,3,4,5,6,23,24,25,30,31,32,33,34]))),Sr=n(()=>c(()=>import(`./PrismBriefingPlayer-Bmo9tOGX.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([35,1,2,3,4,5,6,26,27]))),Cr=n(()=>c(()=>import(`./CrossExamPanel-Deywo95y.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([36,1,2,3,4,5,6,37]))),wr=n(()=>c(()=>import(`./ForecastPanel-BOG361kr.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([38,1,2,3,4,5,6,30,39]))),Tr=n(()=>c(()=>import(`./LeverPanel-CP32QcIf.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([40,1,2,3,4,5,6,41,42]))),Er=n(()=>c(()=>import(`./WhyMachineOverlay-B-KJhCjr.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([43,1,2,3,4,5,6,44,30,45]))),Dr=xr.Component,Or=Sr.Component,kr=Cr.Component,Ar=wr.Component,jr=Tr.Component,Mr=Er.Component,Nr=null,Pr=null,Fr=null,Ir=null,Lr=null,Rr=()=>Nr??=c(()=>import(`./run-BYP2YlZT.js`),__vite__mapDeps([46,23,2,24,25,32,47,48])),zr=()=>Pr??=c(()=>import(`./run-DSVvshaB.js`),__vite__mapDeps([49,23,2,24,25,32,48])),Br=()=>Fr??=c(()=>import(`./run-Dc2ZJz6n.js`),__vite__mapDeps([50,23,2,24,25,31,32,47,33,48])),Vr=()=>Ir??=c(()=>import(`./model-BE0UHu1w.js`),__vite__mapDeps([51,23,2,24,25,32,41,47])),Hr=()=>Lr??=c(()=>import(`./explode-WBykfhqW.js`),__vite__mapDeps([52,23,2,24,25,31,32,53,54,55])),Ur=null;function Wr(){return Ur??=c(()=>import(`./kokoro-kGWf7M0e.js`).then(e=>e.i),__vite__mapDeps([20,2,1,3,4,5,6,16])),Ur}function Gr(){Ur&&Ur.then(e=>e.cancelKokoro())}function Kr(e){Wr().then(t=>t.speakKokoroResult(e,`mavea`))}var qr={forecast:{color:`var(--presence)`,label:`FORECAST`},stat:{color:`var(--insight)`,label:`STAT`},finding:{color:`var(--insight-soft)`,label:`FINDING`},risk:{color:`var(--danger)`,label:`RISK`},definition:{color:`var(--text-muted)`,label:`DEFINITION`},method:{color:`var(--warning)`,label:`METHOD`},diagram:{color:`var(--presence)`,label:`FIGURE`}},Jr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],Yr={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},Xr=[{kind:`forecast`,desc:`what it predicts`},{kind:`finding`,desc:`what it observed`},{kind:`definition`,desc:`its terms`},{kind:`method`,desc:`how it knows`},{kind:`stat`,desc:`a hard number`},{kind:`risk`,desc:`the caveats`},{kind:`diagram`,desc:`a figure or chart`}],Zr=[{relation:`agrees`,name:`Supports`,desc:`one claim props up another`},{relation:`contradicts`,name:`Contradicts`,desc:`two passages disagree`},{relation:`in-tension`,name:`In tension`,desc:`a softer pull, not a clash`}],Qr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function $r(e,t){let n=t?`another document`:`another passage`;return e===`agrees`?`agrees with ${n}`:e===`in-tension`?`in tension with ${n}`:`contradicts ${n}`}function ei(e){return e?e.relation:`anchored`}function ti(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function ni({pdf:e,cfg:t,search:n,onClose:r,world:a,corpusChrome:s,autoBriefing:c}){let u=(0,j.useMemo)(()=>Array.isArray(e)?e:[e],[e]),f=u.length>1,[p,m]=(0,j.useState)(!1),h=_t(t),{phase:g,spec:_,corpus:v,proposed:y,error:b}=a??h,{explode:x}=h,[S,C]=(0,j.useState)(null),[w,T]=(0,j.useState)(null),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)(()=>new Set),[A,M]=(0,j.useState)(!1),[ee,N]=(0,j.useState)(!1),[te,P]=(0,j.useState)(null),[F,I]=(0,j.useState)(0),[L,R]=(0,j.useState)(null),[z,ne]=(0,j.useState)(()=>new Set),re=(0,j.useRef)(()=>{}),[B,ie]=(0,j.useState)(null),[V,ae]=(0,j.useState)(!1),[H,U]=(0,j.useState)(!1),oe=(0,j.useRef)(null),[W,se]=(0,j.useState)(null),[G,K]=(0,j.useState)(!1),[q,ce]=(0,j.useState)(!1),[J,ue]=(0,j.useState)(null),de=(0,j.useRef)(null),[fe,pe]=(0,j.useState)(null),[me,he]=(0,j.useState)(!1),[ge,_e]=(0,j.useState)(!1),[ve,ye]=(0,j.useState)(null),be=(0,j.useRef)(null),[xe,Se]=(0,j.useState)(null),[Ce,we]=(0,j.useState)(!1),[Te,Ee]=(0,j.useState)(!1),De=(0,j.useRef)(!1),Oe=(0,j.useRef)(null),[ke,Ae]=(0,j.useState)(`map`),[je,Me]=(0,j.useState)(null),[Ne,Pe]=(0,j.useState)(null),Fe=(0,j.useRef)(null),[Ie,Le]=(0,j.useState)(!1),[Re,ze]=(0,j.useState)(44),Be=(0,j.useRef)(null),Ve=(0,j.useRef)(!1),He=(0,j.useRef)(null);l(He);let[Ue,We]=(0,j.useState)(()=>new Map),[Ge,Ke]=(0,j.useState)(!1),[qe,Je]=(0,j.useState)(c===!0),[Ye,Xe]=(0,j.useState)(!1),[Ze,Qe]=(0,j.useState)(``),{steps:$e,record:et,clear:tt}=sr(),nt=(0,j.useCallback)(e=>{Ve.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),rt=(0,j.useCallback)(e=>{if(!Ve.current||!Be.current)return;let t=Be.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;ze(Math.max(24,Math.min(100,n)))},[]),it=(0,j.useCallback)(e=>{Ve.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),at=(0,j.useRef)(!1);(0,j.useEffect)(()=>{a||at.current||(at.current=!0,x(u))},[u,x]),(0,j.useEffect)(()=>()=>void le(),[]),(0,j.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(L?(Gr(),R(null),ne(new Set),C(null),re.current()):w?T(null):E?D(null):S?C(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L,w,E,S,r]);let[ot,st]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!_||_.claims.length<48)return;let e=!0;return Nt(_,Jr).then(t=>{e&&st({spec:_,result:t})}),()=>{e=!1}},[_]);let Y=(0,j.useMemo)(()=>_?_.claims.length<48?Tt(_,Jr):ot?.spec===_?ot.result:null:null,[ot,_]),ct=(0,j.useRef)(null),lt=(0,j.useMemo)(()=>{if(!Y||Y.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of Y.claims)e=Math.min(e,i.x),t=Math.min(t,i.y),n=Math.max(n,i.x+200),r=Math.max(r,i.y+96);for(let i of Y.regions)e=Math.min(e,i.cx),t=Math.min(t,i.cy),n=Math.max(n,i.cx),r=Math.max(r,i.cy);return{x:e-56,y:t-56,w:n-e+112,h:r-t+112}},[Y]),X=xt(ct,Y?.width??1,Y?.height??1,lt),ut=(0,j.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y.claims)e.set(t.id,t);return e},[Y]),dt=(0,j.useMemo)(()=>{let e=new Map,t=(t,n)=>{(e.get(t)??e.set(t,new Set).get(t)).add(n),(e.get(n)??e.set(n,new Set).get(n)).add(t)};if(Y)for(let e of Y.links)t(e.a,e.b);if(_)for(let e of _.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>ut.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[Y,_,ut]),ft=S?ut.get(S)??null:null,pt=(0,j.useMemo)(()=>S?dt.get(S)??[]:[],[S,dt]),mt=_?.threads.filter(e=>e.crossDoc).length??0,Z=g===`settled`&&!!Y,[ht,gt]=(0,j.useState)(null),vt=(0,j.useMemo)(()=>{let e=new Set;return s?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[s]),yt=(0,j.useMemo)(()=>{let e=new Set;return s?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[s]),bt=s?.lens??`all`;(0,j.useEffect)(()=>{if(!s||!Z)return;let e=bt===`contradictions`?s.contradictions:bt===`gaps`?s.gaps:bt===`consensus`?s.consensus:[];if(bt===`all`||e.length===0){X.fit();return}let t=e.map(e=>e.x),n=e.map(e=>e.y);X.frame({x:Math.min(...t)-200,y:Math.min(...n)-200,w:Math.max(...t)-Math.min(...t)+400,h:Math.max(...n)-Math.min(...n)+400},{maxScale:1.1})},[bt,Z]);let St=g===`igniting`?`EXTRACTING`:g===`blooming`?`MAPPING`:g===`settled`?`SETTLED`:g===`error`?`COULDN’T MAP`:`READY`,Ct=_?.claims.length??0,wt=(0,j.useCallback)(()=>{C(null),T(null),D(null),k(new Set),Gr(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null),Ae(`map`),x(u)},[x,u]),Et=(0,j.useRef)(null),{frame:Dt,fit:Ot}=X;re.current=Ot,(0,j.useEffect)(()=>{if(!Z||!Y||!_||Et.current===_)return;Et.current=_;let e=Y.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===Y.claims.length)return;let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);let a=96*1.3;Dt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[Z,Y,_,Dt]);let kt=(0,j.useRef)(null);(0,j.useEffect)(()=>{if(!Z||!_||!t||kt.current===_||(kt.current=_,We(new Map),Ke(!1),!n?.enabled)||_.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return Ke(!0),Xn(_.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||We(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||Ke(!1)}),()=>e.abort()},[Z,_,t,n]);let At=(0,j.useMemo)(()=>[...Ue.values()].map(e=>e.verdict),[Ue]),jt=(0,j.useMemo)(()=>Rn(At),[At]),Mt=(0,j.useCallback)(e=>{let t=(_?.documents[e]?.fileName??`Doc ${e+1}`).replace(/\.[^.]+$/,``).trim();return t.length>18?t.slice(0,17).trimEnd()+`…`:t||`Doc ${e+1}`},[_]),Pt=(0,j.useCallback)((e,t)=>{if(!Y)return;let n=Y.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=Y.claims.filter(t=>t.source===e);if(r.length===0)return;let i=r.reduce((e,n)=>Math.abs(n.page-t)<Math.abs(e.page-t)?n:e);n=r.filter(e=>e.page===i.page)}let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let e of n)r=Math.min(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);Dt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[Y,Dt]),Ft=(0,j.useCallback)(e=>{T(null),C(null),Qe(``),D(e),Pt(e.doc,e.page)},[Pt]),It=(0,j.useCallback)(e=>{k(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Ft(e.spans[0]),Qe(e.text)},[Ft]),Lt=(0,j.useMemo)(()=>!Z||!t||!v?null:{corpus:v,cfg:t,multiDoc:f,...n?{search:n}:{}},[Z,t,v,f,n]);(0,j.useEffect)(()=>()=>Fe.current?.abort(),[]);let Rt=(0,j.useCallback)(()=>{if(!t||!v)return;Fe.current?.abort();let e=new AbortController;Fe.current=e,Pe(`why`);let n=v.flat().join(`
|
|
131
|
-
`).slice(0,8e3),r=f?`Why — the argument these documents make`:`Why does "${u[0].name.replace(/\.[a-z0-9]+$/i,``)}" reach its conclusion?`;Hr().then(({explodeWhy:i})=>i(r,n,t,e.signal)).then(t=>{e.signal.aborted||Me(t)}).finally(()=>{e.signal.aborted||Pe(null)})},[t,v,f,u]);(0,j.useEffect)(()=>{I(e=>e+1),M(!1),N(!1),P(null),D(null),Qe(``),gt(null),k(new Set),Gr(),tt(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null)},[_,tt]);let $=(0,j.useMemo)(()=>{if(!Z)return null;if(w)return{source:w.doc,page:w.page,quote:``,color:`var(--presence)`,kindLabel:`PAGE`,title:`Reading the document`,isFigure:!1,connections:[],fromAsk:!1,browse:!0,penExplain:``,penColor:lr};if(E)return{source:E.doc,page:E.page,quote:E.quote,color:`var(--presence)`,kindLabel:`ANSWER`,title:`From your question`,isFigure:!1,connections:[],fromAsk:!0,penExplain:Ze||`“${E.quote.slice(0,160)}”`,penColor:lr};if(ft){let e=(Y?.claims??[]).filter(e=>e.id!==ft.id&&e.source===ft.source&&e.page===ft.page&&e.quote.trim().length>0).slice(0,6).map(e=>({quote:e.quote,color:qr[e.kind].color,note:e.title}));return{source:ft.source,page:ft.page,quote:ft.quote,color:qr[ft.kind].color,kindLabel:qr[ft.kind].label,title:ft.title,isFigure:ft.kind===`diagram`,...ft.box?{box:ft.box}:{},also:e,connections:pt.map(e=>({id:e,title:ut.get(e)?.title??``})),fromAsk:!1,penExplain:fr(ft),penColor:ur(ft.kind),...pr(ft)?{penAccent:pr(ft)}:{}}}return null},[Z,w,E,Ze,ft,pt,ut,Y]),zt=Z&&(!!$||!!ht),Bt=(0,j.useCallback)(e=>{if(!$)return;let t={...e,color:$.penColor,title:$.title,explanation:$.penExplain,...$.penAccent?{accent:$.penAccent}:{}};et(t),Ye&&t.explanation&&(Gr(),Kr(t.explanation))},[$,Ye,et]),Vt=!!L,Ht=(0,j.useCallback)(e=>{let t=e.map(e=>ut.get(e)).filter(e=>!!e);if(t.length===0)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);Dt({x:n-200,y:r-96*1.4,w:i-n+400,h:a-r+96*2.8},{maxScale:t.length>1?1.05:1.5})},[ut,Dt]),Ut=(0,j.useMemo)(()=>new Map([...Ue].map(([e,t])=>[e,t.verdict])),[Ue]),Wt=(0,j.useCallback)(e=>{ne(new Set(e.claimIds)),Ht(e.claimIds),(qe||c)&&C(e.claimIds[0]??null)},[qe,c,Ht]),Gt=(0,j.useCallback)(()=>{Gr(),R(null),ne(new Set),C(null),Ot()},[Ot]),Kt=(0,j.useCallback)(e=>{e!==`recon`&&(oe.current?.abort(),ae(!1)),e!==`xe`&&(de.current?.abort(),K(!1)),e!==`fa`&&(be.current?.abort(),he(!1)),e!==`lv`&&(Oe.current?.abort(),we(!1))},[]),qt=(0,j.useCallback)(()=>{if(!Y||!_)return;let e=ar(Y.claims,_.threads,Ut);e.length!==0&&(Gr(),Kt(`none`),C(null),D(null),M(!1),U(!1),ce(!1),_e(!1),Ee(!1),(qe||c)&&ze(e=>Math.max(e,60)),R(e))},[Y,_,Ut,qe,c,Kt]),Jt=(0,j.useRef)(!1),Yt=(0,j.useRef)(qt);Yt.current=qt;let Xt=(0,j.useRef)(null);(0,j.useEffect)(()=>{!c||Jt.current||g!==`settled`||!Y||!_||(Jt.current=!0,Xt.current=setTimeout(()=>Yt.current(),800))},[c,g,Y,_]),(0,j.useEffect)(()=>()=>{Xt.current!==null&&clearTimeout(Xt.current)},[]),(0,j.useEffect)(()=>()=>oe.current?.abort(),[]);let Zt=(0,j.useMemo)(()=>{let e=new Set;if(B)for(let t of B)for(let n of t.claimIds)e.add(n);return e},[B]),Qt=(0,j.useCallback)(()=>{if(H){U(!1);return}if(Kt(`recon`),ce(!1),_e(!1),Ee(!1),M(!1),B){U(!0);return}if(!_||!v||!t)return;oe.current?.abort();let e=new AbortController;oe.current=e,ae(!0);let n=_.claims.map(e=>({id:e.id,page:e.page,quote:e.quote}));Rr().then(({runReconcile:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||(ie(t),U(!0))}).catch(()=>{e.signal.aborted||ie([])}).finally(()=>{e.signal.aborted||ae(!1)})},[H,B,_,v,t,Kt]);(0,j.useEffect)(()=>()=>de.current?.abort(),[]);let $t=(0,j.useMemo)(()=>{let e=new Set;if(W)for(let t of W)e.add(t.claimId);return e},[W]),en=(0,j.useMemo)(()=>{let e=new Set;if(W)for(let t of W)t.status===`open`&&e.add(t.claimId);return e},[W]),tn=(0,j.useCallback)(e=>{ue(e.id),Ft({doc:e.doc,page:e.anchorPage,quote:e.anchorQuote})},[Ft]),nn=(0,j.useCallback)(()=>{if(q){ce(!1);return}if(Kt(`xe`),U(!1),_e(!1),Ee(!1),M(!1),W){ce(!0);return}if(!_||!v||!t)return;de.current?.abort();let e=new AbortController;de.current=e,K(!0),ce(!0);let n=_.claims.filter(e=>e.role===`load-bearing`).map(e=>({id:e.id,source:e.source,page:e.page,quote:e.quote,title:e.title}));zr().then(({runCrossExam:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||se(t)}).catch(()=>{e.signal.aborted||se([])}).finally(()=>{e.signal.aborted||K(!1)})},[q,W,_,v,t,Kt]);(0,j.useEffect)(()=>()=>be.current?.abort(),[]);let rn=(0,j.useMemo)(()=>{let e=new Set;if(fe)for(let t of fe)e.add(t.claimId);return e},[fe]),an=(0,j.useCallback)(e=>{ye(e.claimId);let t=ut.get(e.claimId);t&&Ft({doc:t.source,page:e.page,quote:e.predicted})},[ut,Ft]),on=(0,j.useCallback)(()=>{if(ge){_e(!1);return}if(Kt(`fa`),U(!1),ce(!1),Ee(!1),M(!1),fe){_e(!0);return}if(!_||!t||!n?.enabled)return;be.current?.abort();let e=new AbortController;be.current=e,he(!0),_e(!0);let r=_.claims.filter(e=>e.kind===`forecast`).map(e=>({id:e.id,page:e.page,quote:e.quote}));Br().then(({runAutopsy:i})=>i(r,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal})).then(t=>{e.signal.aborted||pe(t)}).catch(()=>{e.signal.aborted||pe([])}).finally(()=>{e.signal.aborted||he(!1)})},[ge,fe,_,t,n,Kt]);(0,j.useEffect)(()=>()=>Oe.current?.abort(),[]);let sn=(0,j.useMemo)(()=>{let e=new Set;if(xe)for(let t of xe.nodes)e.add(`${t.doc}:${t.page}`);return e},[xe]),cn=(0,j.useCallback)(e=>{Ft({doc:e.doc,page:e.page,quote:e.quote})},[Ft]),ln=(0,j.useCallback)(()=>{if(Te){Ee(!1);return}if(Kt(`lv`),U(!1),ce(!1),_e(!1),M(!1),De.current){Ee(!0);return}if(!_||!v||!t)return;Oe.current?.abort();let e=new AbortController;Oe.current=e,De.current=!0,we(!0),Ee(!0);let n=_.claims.map(e=>({quote:e.quote,page:e.page,doc:e.source}));Vr().then(({runLevers:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||Se(t)}).catch(()=>{e.signal.aborted||Se(null)}).finally(()=>{e.signal.aborted||we(!1)})},[Te,_,v,t,Kt]);return(0,Q.jsxs)(`div`,{className:`prism-scrim`,"data-expanded":p?`true`:void 0,onClick:r,role:`button`,tabIndex:0,"aria-label":`Close Prism`,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),r())},children:[(0,Q.jsxs)(`section`,{className:`prism-panel`,role:`dialog`,"aria-label":`Prism`,"data-phase":g,ref:He,onClick:e=>e.stopPropagation(),children:[(0,Q.jsxs)(`header`,{className:`prism-head`,children:[(0,Q.jsxs)(`div`,{className:`prism-file`,children:[(0,Q.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,Q.jsx)(`path`,{d:`M6 2h8l4 4v16H6z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,Q.jsx)(`path`,{d:`M14 2v4h4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`})]}),(0,Q.jsx)(`span`,{className:`prism-file-name`,children:f?`${u.length} documents`:u[0].name}),_&&(0,Q.jsxs)(`span`,{className:`prism-file-pages`,children:[`· `,_.pageCount,` pages`]})]}),(0,Q.jsxs)(`div`,{className:`prism-head-right`,children:[Z&&s&&(0,Q.jsx)(`div`,{className:`syn-lenses`,role:`tablist`,"aria-label":`Lens`,children:[[`all`,`All`,0],[`contradictions`,`Contradictions`,s.counts.contradictions],[`gaps`,`Gaps`,s.counts.gaps],[`consensus`,`Consensus`,s.counts.consensus]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":s.lens===e,className:`syn-lens`+(s.lens===e?` is-active`:``),onClick:()=>{gt(null),s.setLens(e)},children:[t,n>0&&(0,Q.jsx)(`span`,{className:`syn-lens-n`,children:n})]},e))}),Z&&y>0&&(0,Q.jsxs)(`span`,{className:`prism-counter`,title:`Every shown claim is a verbatim quote on its real page. Anything that couldn't be cited was dropped before it rendered.`,children:[(0,Q.jsx)(`strong`,{children:y}),` read · `,(0,Q.jsx)(`strong`,{children:Ct}),` grounded`,y>Ct?(0,Q.jsxs)(Q.Fragment,{children:[` `,`· `,(0,Q.jsx)(`strong`,{children:y-Ct}),` dropped`]}):null]}),(0,Q.jsxs)(`span`,{className:`prism-phase`,"data-active":g===`igniting`||g===`blooming`,title:St,children:[(0,Q.jsx)(`span`,{className:`prism-phase-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-phase-label`,children:St})]}),Z&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:()=>{D(null),C(null),T({doc:0,page:1})},"aria-label":`Read the whole document, page by page`,title:`Read the whole document, page by page`,children:[`▤`,(0,Q.jsx)(`span`,{className:`prism-replay-label`,children:` Read document`})]}),Z&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:wt,"aria-label":`Replay — re-map the document from scratch`,title:`Replay — re-map the document from scratch`,children:[`↻`,(0,Q.jsx)(`span`,{className:`prism-replay-label`,children:` Replay`})]}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:()=>m(e=>!e),"aria-label":p?`Exit full screen`:`Expand to full screen`,title:p?`Exit full screen`:`Full screen`,children:p?`⤡`:`⤢`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:r,"aria-label":`Close Prism`,children:`✕`})]})]}),f&&Z&&_&&(0,Q.jsxs)(`div`,{className:`prism-legend`,role:`list`,"aria-label":`Documents`,children:[_.documents.map((e,t)=>{let n=_.claims.filter(e=>e.source===t).length;return(0,Q.jsxs)(`span`,{className:`prism-legend-item`,role:`listitem`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-swatch`,style:{background:Qr[t%Qr.length]},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-name`,children:e.fileName.replace(/\.pdf$/i,``)}),(0,Q.jsx)(`span`,{className:`prism-legend-count`,children:n})]},t)}),mt>0&&(0,Q.jsxs)(`span`,{className:`prism-legend-cross`,children:[mt,` cross-document link`,mt===1?``:`s`]})]}),(0,Q.jsxs)(`div`,{className:`prism-split`,"data-split":zt?`true`:void 0,"data-pdfonly":zt&&Re>=99?`true`:void 0,ref:Be,children:[(0,Q.jsxs)(`div`,{className:`prism-stage`+(X.panning?` is-panning`:``),ref:ct,onWheel:Z?X.onWheel:void 0,onPointerDown:Z?X.onPointerDown:void 0,onPointerMove:Z?X.onPointerMove:void 0,onPointerUp:Z?X.onPointerUp:void 0,onPointerCancel:Z?X.onPointerUp:void 0,onClickCapture:e=>{X.movedRef.current&&(e.stopPropagation(),e.preventDefault(),X.movedRef.current=!1)},children:[(g===`idle`||g===`igniting`)&&(0,Q.jsxs)(`div`,{className:`prism-doc`,"data-igniting":g===`igniting`,"aria-hidden":`true`,children:[(0,Q.jsxs)(`div`,{className:`prism-doc-page`,children:[(0,Q.jsx)(`span`,{className:`prism-doc-eyebrow`,children:f?`DOCUMENTS`:`DOCUMENT`}),(0,Q.jsx)(`span`,{className:`prism-doc-title`,children:f?`${u.length} documents`:u[0].name.replace(/\.pdf$/i,``)}),(0,Q.jsx)(`div`,{className:`prism-doc-lines`,children:[92,84,88,70,90,60,80,66].map((e,t)=>(0,Q.jsx)(`span`,{className:`prism-doc-line`,style:{width:`${e}%`}},t))})]}),g===`igniting`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`prism-shock`}),ri.map((e,t)=>(0,Q.jsx)(`span`,{className:`prism-shard`,style:{"--sx":e.x,"--sy":e.y,"--sr":e.r,width:e.w,height:e.h,animationDelay:`${e.d}ms`}},t))]})]}),g===`blooming`&&(0,Q.jsxs)(`div`,{className:`prism-blooming`,children:[(0,Q.jsx)(`span`,{className:`prism-bloom-orb`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-bloom-label`,children:`Reading the document — mapping its claims…`})]}),g===`error`&&(0,Q.jsxs)(`div`,{className:`prism-error`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`prism-error-msg`,children:b}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-error-retry`,onClick:wt,children:`Try again`})]}),Z&&Y&&(0,Q.jsxs)(`div`,{className:`prism-world`,"data-briefing":Vt?`true`:void 0,style:{width:Y.width,height:Y.height,transform:X.transform},children:[Y.regions.map(e=>(0,Q.jsxs)(`div`,{className:`prism-region`,style:{left:e.cx,top:e.cy,"--region-color":e.color},children:[(0,Q.jsx)(`span`,{className:`prism-region-glow`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-region-name`,children:e.name})]},e.name)),Y.links.length>0&&(0,Q.jsx)(`svg`,{className:`prism-links`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:Y.links.map((e,t)=>{let n=ut.get(e.a),r=ut.get(e.b);return!n||!r?null:(0,Q.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y},t)})}),_&&_.threads.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:_.threads.map((e,t)=>{let n=ut.get(e.a),r=ut.get(e.b);if(!n||!r)return null;let i=(n.x+r.x)/2,a=(n.y+r.y)/2-28;return(0,Q.jsxs)(`g`,{className:`prism-thread`+(ke===`map`?``:` prism-thread-hot`),"data-relation":e.relation,"data-cross":e.crossDoc?`true`:void 0,children:[(0,Q.jsx)(`path`,{d:`M ${n.x} ${n.y} Q ${i} ${a} ${r.x} ${r.y}`,fill:`none`}),(0,Q.jsx)(`foreignObject`,{x:i-90,y:a-12,width:`180`,height:`22`,children:(0,Q.jsxs)(`span`,{className:`prism-thread-label`,children:[Yr[e.relation],e.crossDoc?` across docs`:` · p.${n.page}↔p.${r.page}`]})})]},t)})}),H&&B&&B.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads prism-recon`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:B.map(e=>{if(e.a===e.b)return null;let t=ut.get(e.a),n=ut.get(e.b);if(!t||!n)return null;let r=(t.x+n.x)/2,i=(t.y+n.y)/2-28;return(0,Q.jsxs)(`g`,{className:`prism-thread prism-thread-hot`,"data-relation":`contradicts`,children:[(0,Q.jsx)(`path`,{d:`M ${t.x} ${t.y} Q ${r} ${i} ${n.x} ${n.y}`,fill:`none`}),(0,Q.jsx)(`foreignObject`,{x:r-90,y:i-16,width:`180`,height:`30`,children:(0,Q.jsxs)(`span`,{className:`prism-thread-label prism-recon-label`,children:[e.stated,` ≠ `,e.computed]})})]},e.id)})}),Y.claims.map(e=>{let t=qr[e.kind],n=S===e.id,r=Ue.get(e.id),i=_?.threads.find(t=>t.a===e.id||t.b===e.id),a=r?.citation?d(r.citation.url):null,o=!!i,c=i?i.relation===`agrees`?`var(--insight)`:i.relation===`in-tension`?`var(--warning)`:`var(--danger)`:t.color,l=ke===`contra`&&!o,u=O.has(`${e.source}:${e.page}`),f=!!E&&O.size>0&&!u,p=z.has(e.id),m=Vt&&z.size>0&&!p,h=H&&Zt.has(e.id),g=H&&Zt.size>0&&!h,v=q&&en.has(e.id),y=q&&en.size>0&&!$t.has(e.id),b=ge&&rn.has(e.id),x=ge&&rn.size>0&&!b,w=Te&&sn.has(`${e.source}:${e.page}`),k=Te&&sn.size>0&&!w,A=!!s&&(bt===`gaps`?!0:bt===`contradictions`?!vt.has(e.id):bt===`consensus`?!yt.has(e.id):!1),j=()=>{Vt||(T(null),D(null),gt(null),C(n?null:e.id))};return(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":n,className:`prism-claim`+(n?` is-open`:``)+(o?` is-flagged`:``)+(u||p||h||b||w?` is-cited`:``)+(v?` is-objected`:``)+(l||f||m||g||y||x||k||A?` is-dim`:``),"data-role":e.role,style:{left:e.x,top:e.y,"--kind-color":c},onClick:j,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),j())},children:[(0,Q.jsxs)(`span`,{className:`prism-claim-head`,children:[(0,Q.jsxs)(`span`,{className:`prism-claim-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-claim-dot`,"aria-hidden":`true`}),t.label]}),e.role===`load-bearing`&&(0,Q.jsx)(`span`,{className:`prism-claim-key`,title:`Load-bearing — the document leans on this`,children:`★ KEY`}),(0,Q.jsxs)(`span`,{className:`prism-claim-page`,children:[`p.`,e.page]})]}),(0,Q.jsx)(`span`,{className:`prism-claim-title`,children:e.title}),r&&(0,Q.jsxs)(`span`,{className:`prism-seal`,"data-verdict":r.verdict,style:{"--seal-color":Fn[r.verdict].token},children:[(0,Q.jsx)(`span`,{className:`prism-seal-dot`,"aria-hidden":`true`}),Fn[r.verdict].label]}),n&&(0,Q.jsxs)(`span`,{className:`prism-claim-body`,children:[(0,Q.jsxs)(`span`,{className:`prism-claim-quote`,children:[`“`,e.quote,`”`]}),i&&(0,Q.jsxs)(`span`,{className:`prism-claim-flag`,children:[$r(i.relation,i.crossDoc),` — follow the thread`]}),r&&(0,Q.jsxs)(`span`,{className:`prism-claim-verdict`,"data-verdict":r.verdict,style:{"--seal-color":Fn[r.verdict].token},children:[(0,Q.jsxs)(`span`,{className:`prism-verdict-head`,children:[(0,Q.jsx)(`span`,{className:`prism-verdict-label`,children:Fn[r.verdict].label}),(0,Q.jsx)(`span`,{className:`prism-verdict-note`,children:r.note})]}),r.citation&&a&&(0,Q.jsxs)(`a`,{className:`prism-verdict-cite`,href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:[`“`,r.citation.quote,`”`,(0,Q.jsxs)(`span`,{className:`prism-verdict-host`,children:[`— `,r.citation.host,r.citation.date?` · ${r.citation.date}`:``]})]})]})]}),!n&&(0,Q.jsx)(`span`,{className:`prism-claim-state`,"data-state":ei(i),children:ti(i)})]},e.id)}),s&&(0,Q.jsxs)(Q.Fragment,{children:[s.consensus.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-consensus`+(bt!==`all`&&bt!==`consensus`?` is-dim`:``),style:{left:e.x-e.r,top:e.y-e.r,width:e.r*2,height:e.r*2},onClick:()=>{X.movedRef.current||(C(null),gt({kind:`consensus`,id:e.id}))},children:(0,Q.jsxs)(`span`,{className:`syn-consensus-badge`,children:[e.sourceCount,` of `,e.corpusSize,` agree`]})},e.id)),s.contradictions.map(e=>{let t=bt!==`all`&&bt!==`contradictions`;return(0,Q.jsxs)(`button`,{type:`button`,className:`syn-obj syn-obj-`+e.relation+(t?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{X.movedRef.current||(C(null),gt({kind:`contradiction`,id:e.id}))},children:[(0,Q.jsx)(`span`,{className:`syn-obj-dot`,"aria-hidden":`true`}),e.label]},e.id)}),s.gaps.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-obj syn-gap`+(bt!==`all`&&bt!==`gaps`?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{X.movedRef.current||(C(null),gt({kind:`gap`,id:e.id}))},children:e.label},e.id))]})]}),Z&&(0,Q.jsxs)(`div`,{className:`prism-zoom`,"aria-label":`Zoom the map`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.zoomBy(1.25),"aria-label":`Zoom in`,children:`+`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.zoomBy(1/1.25),"aria-label":`Zoom out`,children:`−`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.fit(),"aria-label":`Fit the whole map`,title:`Fit`,children:`⤢`})]}),Z&&ee&&Lt&&(0,Q.jsx)(o,{label:`Document ask`,children:(0,Q.jsx)(Dr,{open:A&&!Vt&&!q&&!ge&&!Te,ctx:Lt,seed:te,onAnswer:It,onFocusSpan:Ft,activeSpan:E,multiDoc:f,docLabel:Mt,onClose:()=>M(!1)},F)}),Z&&L&&(0,Q.jsx)(o,{label:`Briefing`,children:(0,Q.jsx)(Or,{beats:L,onBeat:Wt,onExit:Gt})}),Z&&q&&!Vt&&(0,Q.jsx)(o,{label:`Cross-examination`,children:(0,Q.jsx)(kr,{objections:W??[],busy:G,onFocusObjection:tn,activeId:J,multiDoc:f,docLabel:Mt,onClose:()=>ce(!1)})}),Z&&ge&&!Vt&&(0,Q.jsx)(o,{label:`Forecast review`,children:(0,Q.jsx)(Ar,{grades:fe??[],busy:me,onFocusForecast:an,activeId:ve,onClose:()=>_e(!1)})}),Z&&Te&&!Vt&&(0,Q.jsx)(o,{label:`Live levers`,children:(0,Q.jsx)(jr,{model:xe,busy:Ce,onFocusNode:cn,onClose:()=>Ee(!1)})})]}),zt&&(0,Q.jsx)(`div`,{className:`prism-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the map and the source page`,tabIndex:0,onPointerDown:nt,onPointerMove:rt,onPointerUp:it,onPointerCancel:it,onKeyDown:e=>{e.key===`ArrowLeft`?ze(e=>Math.min(100,e+4)):e.key===`ArrowRight`&&ze(e=>Math.max(24,e-4))},children:(0,Q.jsx)(`span`,{className:`prism-divider-grip`,"aria-hidden":`true`})}),$&&Z&&u[$.source]&&(()=>{let e=u[$.source],t=_?.documents[$.source]?.slideImages,n=_?.documents[$.source]?.pageCount??1;return(0,Q.jsxs)(`div`,{className:`prism-page-wrap`,style:{"--pdf-pct":`${Re}%`},children:[(0,Q.jsx)(Pn,{pdf:e,slideImages:t,source:$.source,page:$.page,quote:$.quote,color:$.color,also:$.also,note:$.penExplain,penOn:qe,penColor:$.penColor,penAccent:$.penAccent,onAnnotated:Bt,kindLabel:$.kindLabel,isFigure:$.isFigure,docName:f?e.name:void 0,title:$.title,connections:$.connections,onNavigate:e=>{T(null),D(null),C(e)},onClose:()=>{T(null),D(null),C(null)},pageCount:n,onPageChange:e=>{let t=Math.min(n,Math.max(1,e));D(null),C(null),T({doc:$.source,page:t})}}),qe&&!Vt&&$.penExplain&&(0,Q.jsxs)(`div`,{className:`prism-pen-caption`,children:[(0,Q.jsx)(`span`,{className:`prism-pen-caption-text`,children:$.penExplain}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-pen-mute`,onClick:()=>Xe(e=>!e),"aria-pressed":Ye,title:Ye?`Mute narration`:`Read it aloud`,children:Ye?`🔊`:`🔇`})]})]})})(),ht&&Z&&s&&(0,Q.jsx)(`div`,{className:`prism-page-wrap syn-detail-panel`,style:{"--pdf-pct":`${Re}%`},children:(0,Q.jsxs)(`div`,{className:`syn-detail`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-close syn-detail-close`,onClick:()=>gt(null),"aria-label":`Close`,children:`✕`}),ht.kind===`contradiction`&&(()=>{let e=s.contradictions.find(e=>e.id===ht.id);if(!e)return null;let t=ut.get(e.a),n=ut.get(e.b);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":e.relation,children:e.relation===`contradicts`?`Contradiction`:`In tension`}),(0,Q.jsx)(`h3`,{className:`syn-detail-title`,children:e.label}),!e.comparable&&(0,Q.jsxs)(`p`,{className:`syn-banner`,children:[`Not directly comparable`,e.caveat?` — differs on ${e.caveat}`:``,`.`]}),(0,Q.jsx)(`div`,{className:`syn-tape`,children:[t,n].map((e,t)=>e&&(0,Q.jsxs)(`button`,{type:`button`,className:`syn-tape-side`,onClick:()=>{gt(null),C(e.id)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[s.sourceLabel(e.source),` · p.`,e.page]}),(0,Q.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,e.quote,`”`]})]},t))}),e.delta&&(0,Q.jsxs)(`p`,{className:`syn-delta`,children:[e.delta.aValue,` vs `,e.delta.bValue,` `,e.delta.unit]}),(0,Q.jsx)(`button`,{type:`button`,className:`syn-interrogate`,onClick:()=>{N(!0),M(!0),P(t=>({id:(t?.id??0)+1,question:e.seedQuestion}))},children:`Interrogate — are these comparable?`})]})})(),ht.kind===`gap`&&(()=>{let e=s.gaps.find(e=>e.id===ht.id);return e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`gap`,children:e.kind===`absent`?`Gap`:`Thin coverage`}),(0,Q.jsx)(`h3`,{className:`syn-detail-title`,children:e.facet.label}),(0,Q.jsxs)(`p`,{className:`syn-receipt`,children:[(0,Q.jsxs)(`strong`,{children:[e.coveredCount,` of `,e.sourcesScanned,` sources`]}),` `,`mention this`,e.coveredCount===0?` — nothing in the corpus covers it`:``,`.`]}),(0,Q.jsx)(`p`,{className:`syn-searched-label`,children:`Searched for, verbatim:`}),(0,Q.jsx)(`ul`,{className:`syn-searched`,children:e.searchedForms.map(e=>(0,Q.jsx)(`li`,{children:e},e))}),(0,Q.jsx)(`p`,{className:`syn-note`,children:`A statement about the corpus text — it dissolves the moment a source covers it.`})]}):null})(),ht.kind===`consensus`&&(()=>{let e=s.consensus.find(e=>e.id===ht.id);return e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`agrees`,children:`Consensus`}),(0,Q.jsxs)(`p`,{className:`syn-consensus-count`,children:[(0,Q.jsxs)(`strong`,{children:[e.sourceCount,` of `,e.corpusSize,` sources`]}),` `,`agree`]}),(0,Q.jsx)(`p`,{className:`syn-proposition`,children:e.proposition}),(0,Q.jsx)(`p`,{className:`syn-proposition-note`,children:`A paraphrase of the shared point — the verbatim lines are below.`}),(0,Q.jsx)(`div`,{className:`syn-members`,children:e.memberClaimIds.map(e=>{let t=ut.get(e);return t&&(0,Q.jsxs)(`button`,{type:`button`,className:`syn-member`,onClick:()=>{gt(null),C(e)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[s.sourceLabel(t.source),` · p.`,t.page]}),(0,Q.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,t.quote,`”`]})]},e)})}),e.band&&(0,Q.jsxs)(`p`,{className:`syn-delta`,children:[e.band.min,`–`,e.band.max,` `,e.band.unit]})]}):null})()]})})]}),Z&&!V&&!H&&(Ge||jt)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":Ge?`true`:void 0,role:`status`,children:[(0,Q.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-standing-text`,children:Ge?`Checking the key claims against the public record…`:jt})]}),Z&&(V||H)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":V?`true`:void 0,"data-recon":`true`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-standing-text`,children:V?`Checking the document’s own numbers against each other…`:B&&B.length>0?`${B.length===1?`A number doesn’t`:`${B.length} numbers don’t`} add up — the document’s own figures disagree`:`Every number checks out — the document’s figures are consistent.`})]}),Z&&(0,Q.jsxs)(`footer`,{className:`prism-foot`,children:[(0,Q.jsxs)(`span`,{className:`prism-foot-stat`,children:[Ct,` claim`,Ct===1?``:`s`,` · `,Y?.regions.length??0,` region`,(Y?.regions.length??0)===1?``:`s`,` · every card cites a real page`,y>Ct?` · ${y-Ct} ungrounded dropped`:``]}),(0,Q.jsxs)(`div`,{className:`prism-foot-actions`,children:[(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Ask`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(A?` is-active`:` prism-foot-btn--primary`),onClick:()=>{A||(U(!1),ce(!1),_e(!1),Ee(!1)),A||N(!0),M(e=>!e)},...i(xr.preload),"aria-pressed":A,title:`Ask the document a question — the answer lights up the exact lines`,children:A?`Hide ask`:`Ask the document`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Vt?` is-active`:``),onClick:Vt?Gt:qt,...i(Sr.preload),disabled:!Y||Y.claims.length===0,"aria-pressed":Vt,title:`Play a silent, captioned flight through the document's argument — ending on its weakest point`,children:Vt?`End briefing`:`Brief me`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Verify`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(H?` is-active`:``),onClick:Qt,...i(()=>Rr().then(()=>void 0)),disabled:V||!t||!_||_.claims.length===0,"aria-pressed":H,title:`Check the document's own figures against each other — flags numbers that don't add up, computed in pure code`,children:V?`Checking…`:H?`Hide numbers`:`Check the numbers`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(q?` is-active`:``),onClick:nn,...i(()=>Promise.all([Cr.preload(),zr()]).then(()=>void 0)),disabled:G||!t||!_||_.claims.filter(e=>e.role===`load-bearing`).length===0,"aria-pressed":q,title:`Raise the sharpest objection to each load-bearing claim — and show only the ones the document never answers`,children:G?`Examining…`:q?`Hide objections`:`Cross-examine`}),_&&_.claims.some(e=>e.kind===`forecast`)&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ge?` is-active`:``),onClick:on,...i(()=>Promise.all([wr.preload(),Br()]).then(()=>void 0)),disabled:me||!t||!n?.enabled,"aria-pressed":ge,title:n?.enabled?`Grade the document's dated predictions against what actually happened (uses web search)`:`Turn on web search in Live settings to grade the document’s forecasts against reality`,children:me?`Grading…`:ge?`Hide forecasts`:`Grade forecasts`}),_&&_.claims.some(e=>/\d/.test(e.quote))&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Te?` is-active`:``),onClick:ln,...i(()=>Promise.all([Tr.preload(),Vr()]).then(()=>void 0)),disabled:Ce||!t||!v,"aria-pressed":Te,title:`Find the model implied under the document and drag its assumptions — every figure traces to a page, the conclusion recomputes live`,children:Ce?`Modeling…`:Te?`Hide levers`:`Live levers`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Explore`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ke===`contra`?` is-active`:``),onClick:()=>Ae(e=>e===`contra`?`map`:`contra`),disabled:!_||_.threads.length===0,title:_&&_.threads.length===0?f?`No links found between these documents`:`No contradictions found in this document`:void 0,children:_&&_.threads.length>0?f?`Show links (${_.threads.length})`:`Find contradictions (${_.threads.length})`:f?`No links`:`No contradictions`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:Rt,...i(()=>Promise.all([Er.preload(),Hr()]).then(()=>void 0)),disabled:!t||!v||Ne!==null,title:`Explode this document into a causal web — every link traces to a page`,children:Ne===`why`?`Tracing…`:`Why (causes)`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Annotate & share`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(qe?` is-active`:``),onClick:()=>Je(e=>!e),"aria-pressed":qe,title:`Annotate — Mavéa draws a pen mark over the cited lines and explains, on every question, claim, and briefing beat`,children:qe?`Pen on`:`Annotate`}),_&&(0,Q.jsx)(br,{steps:$e,spec:_,pdfs:u,cfg:t,placed:Y?.claims,verdicts:Ut})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group prism-foot-group--quiet`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:()=>Ae(`map`),children:`Reset view`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Ie?` is-active`:``),onClick:()=>Le(e=>!e),"aria-pressed":Ie,children:`Legend`})]})]})]}),Z&&Ie&&(0,Q.jsxs)(`aside`,{className:`prism-legend-panel`,"aria-label":`What the colors and lines mean`,children:[(0,Q.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-title`,children:`THE KIND PALETTE`}),(0,Q.jsx)(`ul`,{className:`prism-legend-kinds`,children:Xr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-kind-dot`,style:{background:qr[e.kind].color},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-kind-name`,children:qr[e.kind].label}),(0,Q.jsxs)(`span`,{className:`prism-legend-kind-desc`,children:[`· `,e.desc]})]},e.kind))})]}),(0,Q.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-title`,children:`THE THREAD PALETTE`}),(0,Q.jsx)(`ul`,{className:`prism-legend-threads`,children:Zr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-thread`,children:[(0,Q.jsx)(`svg`,{className:`prism-legend-thread-line`,"data-relation":e.relation,viewBox:`0 0 40 8`,width:`40`,height:`8`,"aria-hidden":`true`,children:(0,Q.jsx)(`line`,{x1:`2`,y1:`4`,x2:`38`,y2:`4`})}),(0,Q.jsx)(`span`,{className:`prism-legend-thread-name`,children:e.name}),(0,Q.jsxs)(`span`,{className:`prism-legend-thread-desc`,children:[`· `,e.desc]})]},e.relation))}),(0,Q.jsxs)(`p`,{className:`prism-legend-note`,children:[`Threads never turn into red errors — a contradiction is a line you can follow to both pages. The thread map is what makes the document `,(0,Q.jsx)(`strong`,{children:`arguable`}),`, not just readable.`]})]})]}),!Z&&g!==`error`&&(0,Q.jsx)(`footer`,{className:`prism-foot prism-foot-quiet`,children:(0,Q.jsx)(`span`,{className:`prism-foot-stat`,children:`The document blooms into a map of its claims — each one a verbatim quote anchored to its page.`})})]}),je&&(0,Q.jsx)(o,{label:`Why map`,overlay:!0,children:(0,Q.jsx)(Mr,{dag:je,onClose:()=>Me(null)})})]})}var ri=[{x:`-210px`,y:`-150px`,r:`-34deg`,w:34,h:44,d:0},{x:`190px`,y:`-170px`,r:`28deg`,w:28,h:38,d:40},{x:`-260px`,y:`40px`,r:`-14deg`,w:40,h:30,d:20},{x:`250px`,y:`70px`,r:`22deg`,w:30,h:40,d:60},{x:`-120px`,y:`190px`,r:`-44deg`,w:24,h:32,d:80},{x:`150px`,y:`200px`,r:`18deg`,w:36,h:28,d:30},{x:`-300px`,y:`-40px`,r:`-24deg`,w:26,h:36,d:50},{x:`300px`,y:`-30px`,r:`30deg`,w:32,h:42,d:10},{x:`40px`,y:`-220px`,r:`12deg`,w:22,h:30,d:70},{x:`-60px`,y:`230px`,r:`-18deg`,w:30,h:24,d:90}];export{ni as PrismOverlay,Pt as a,He as c,ne as d,ar as i,H as l,gr as n,Et as o,ur as r,Ve as s,pr as t,ue as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-D4En6Y3L.js","assets/chunk-BVpWp9h4.js","assets/index-C7H7A1rW.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ReelJelly-DCD4bG10.js","assets/geometry-DXAbnb0J.js","assets/registry-B51MhOLx.js","assets/fit-B1LJWvMO.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-kGWf7M0e.js","assets/ShareModal-PobtP7AJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{I as r,J as i,L as a,ht as o,k as s,mt as c,q as l}from"./index-C7H7A1rW.js";import{n as u}from"./icons-CHVz6kv_.js";import"./ShareModal-D4En6Y3L.js";import"./annotationReel-yzysA-Gr.js";var d=t(),f=o(),p=c();function m(e){if(!e||!e.blocks?.length)return[];let t=e.blocks.map((e,t)=>({index:t}));return[{question:e.opener||e.title||``,narration:e.found||e.sub||e.opener||e.title||``,mode:`replace`,tour:t,spec:e,at:0}]}var h=n();i();var g=r(()=>l(()=>import(`./ShareModal-D4En6Y3L.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),_=g.Component;function v(e){let t=(0,f.c)(9),{frames:n,spec:r}=e,[i,o]=(0,d.useState)(!1),c;t[0]!==n||t[1]!==r?(c=n??(r?m(r):[]),t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c;if(!l.length)return null;let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(`button`,{type:`button`,style:y,onClick:()=>o(!0),...a(g.preload),children:`✨ Share as a story`}),t[3]=u):u=t[3];let v;t[4]!==i||t[5]!==l?(v=i&&(0,p.createPortal)((0,h.jsx)(s,{label:`Share story`,overlay:!0,children:(0,h.jsx)(_,{frames:l,onClose:()=>o(!1)})}),document.body),t[4]=i,t[5]=l,t[6]=v):v=t[6];let b;return t[7]===v?b=t[8]:(b=(0,h.jsxs)(h.Fragment,{children:[u,v]}),t[7]=v,t[8]=b),b}var y={display:`inline-flex`,alignItems:`center`,gap:8,padding:`10px 18px`,borderRadius:`var(--r-full)`,border:`none`,background:`var(--presence)`,color:`#fff`,font:`650 14px/1 var(--font)`,cursor:`pointer`,alignSelf:`flex-start`},b=e({ReplayCard:()=>x});function x(e){let t=(0,f.c)(12),{delay:n,line:r,spec:i}=e,a=(n||0)+`ms`,o;t[0]===a?o=t[1]:(o={"--delay":a},t[0]=a,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,h.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,h.jsx)(u.play,{className:`ic`,style:{color:`var(--presence-soft)`}}),` Mavéa Replay`]}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={fontSize:17,marginBottom:14},t[3]=l):l=t[3];let d=r||`“I dropped in 3 statements. Mavéa showed me where my money went in 20 seconds.”`,p;t[4]===d?p=t[5]:(p=(0,h.jsx)(`div`,{className:`insight-title`,style:l,children:d}),t[4]=d,t[5]=p);let m;t[6]===i?m=t[7]:(m=i&&(0,h.jsx)(v,{spec:i}),t[6]=i,t[7]=m);let g;return t[8]!==s||t[9]!==p||t[10]!==m?(g=(0,h.jsxs)(`div`,{className:`card replay-card reveal`,style:s,children:[c,p,m]}),t[8]=s,t[9]=p,t[10]=m,t[11]=g):g=t[11],g}export{b as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-BM_B9JEc.js","assets/index-C7H7A1rW.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/useSpatialCanvas-D_C8VoCy.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/cache-BumECILO.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/useFocusTrap-DbfG6zbM.js","assets/RippleOverlay-_iiZsQVZ.css","assets/useLiveConfig-Lm0cYTcu.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/kokoro-kGWf7M0e.js","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./lazyRetry-D50B1UMY.js";import{I as r,J as i,M as a,N as o,k as s,o as c,q as l}from"./index-C7H7A1rW.js";import{t as u}from"./homeTarget-BcZYH3DY.js";var d=e(),f=t();i();var p=r(()=>l(()=>import(`./RippleOverlay-BM_B9JEc.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),m=p.Component,h=n(()=>l(()=>import(`./seed-b1xc0dj2.js`),[]));function g(){(0,d.useEffect)(()=>a(o()),[]);let[e,t]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0;return p.preload().catch(()=>{}),h().then(({SEED_SHIP:n})=>{e&&t(n)}),()=>{e=!1}},[]);let[n,r]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0,t=window.setTimeout(()=>{l(async()=>{let{getLiveConfigV2:e,toModelConfig:t}=await import(`./useLiveConfig-Lm0cYTcu.js`).then(e=>e.d);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([17,2,1,3,4,5,6,18,19,20,14])).then(({getLiveConfigV2:t,toModelConfig:n})=>{if(!e)return;let i=n(t());r(i.apiKey?i:null)})},250);return()=>{e=!1,window.clearTimeout(t)}},[]);let i=(0,d.useCallback)(e=>{l(()=>import(`./kokoro-kGWf7M0e.js`).then(e=>e.y).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([21,2,1,3,4,5,6,22]))},[]);return e?(0,f.jsx)(s,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:i,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(c,{})}export{g as RippleApp};
|