@mavea/mavea 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +4 -3
- package/dist/.vite/manifest.json +587 -605
- package/dist/assets/{AppCommandPalette-D_g8-7C0.js → AppCommandPalette-D5nd3VO_.js} +1 -1
- package/dist/assets/{BlockEmpty-Ddhgr5pu.js → BlockEmpty-BZn5ETuL.js} +1 -1
- package/dist/assets/{BriefingPlayer-D-QhLgXI.js → BriefingPlayer-JnrrvxYE.js} +1 -1
- package/dist/assets/{CanvasSkeleton-BIiOmCMG.js → CanvasSkeleton-D00MzkIV.js} +2 -2
- package/dist/assets/{CheckLogRail-ZrDqyjQ7.js → CheckLogRail--9iHharq.js} +1 -1
- package/dist/assets/{CodeOutput-D7sVg1Nr.js → CodeOutput-408gGn9V.js} +1 -1
- package/dist/assets/{CommandPalette-DNa2q8E_.js → CommandPalette-BIUG6Sn7.js} +1 -1
- package/dist/assets/{CourseLessonReader-BIpGjcJk.js → CourseLessonReader-Yp2qEsDx.js} +2 -2
- package/dist/assets/{CourseRail-CQaotzN0.js → CourseRail-BVvnoWBR.js} +1 -1
- package/dist/assets/{CoursesApp-q3kZJmu1.js → CoursesApp-0N_F1p_u.js} +2 -2
- package/dist/assets/{CrossExamPanel-BIJslibV.js → CrossExamPanel-CocJ_GxK.js} +1 -1
- package/dist/assets/{DashPresent-DGSE0vYM.js → DashPresent-G8Actzx7.js} +1 -1
- package/dist/assets/{DashboardDetail-BpaLNg8R.js → DashboardDetail-BpSe8wBT.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-CHPDkO3Y.js +1 -0
- package/dist/assets/{DashboardOverview-8x3OxX2i.js → DashboardOverview-Cdhy4x4b.js} +1 -1
- package/dist/assets/{DashboardSettings-f_zxcs5j.js → DashboardSettings-ChPkh0t4.js} +1 -1
- package/dist/assets/DashboardsApp-mp-V3d1i.js +2 -0
- package/dist/assets/{DeepZoomApp-E7bDmzuL.js → DeepZoomApp-mZHk132w.js} +1 -1
- package/dist/assets/{DelegatePanel-_9RZiLHM.css → DelegatePanel-Cf85-0qE.css} +1 -1
- package/dist/assets/DelegatePanel-Dtl0oHaA.js +33 -0
- package/dist/assets/{DemoGallery-DDzX8Z7I.js → DemoGallery-By2LV_U_.js} +1 -1
- package/dist/assets/{DropSelect-BMZYAX6q.js → DropSelect-CeCNaut0.js} +1 -1
- package/dist/assets/{ExportModal-CTMJaU1l.js → ExportModal-CZ1-Vihb.js} +2 -2
- package/dist/assets/{ExtractionPreview-C9wq7CrK.js → ExtractionPreview-CRkYnwCo.js} +1 -1
- package/dist/assets/{FlagshipCTA-DPNSflKv.js → FlagshipCTA-DNtUnl0n.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-55zqyPFm.js → FlagshipCommandPalette-DpP8joXb.js} +1 -1
- package/dist/assets/{FlagshipShowcase-BWpoPWOn.js → FlagshipShowcase-CoOezhT-.js} +1 -1
- package/dist/assets/{FlashcardsApp-apCj3I17.js → FlashcardsApp-REEdMdKG.js} +1 -1
- package/dist/assets/{ForecastPanel-CMRD-UKn.js → ForecastPanel-CpR32hwb.js} +1 -1
- package/dist/assets/{GalleryApp-CcsbirLT.js → GalleryApp-DJZRHjMH.js} +1 -1
- package/dist/assets/{HonestByDesign-DU4qmc61.js → HonestByDesign-CiOj_fA7.js} +1 -1
- package/dist/assets/{HowItWorks-CkZXftN-.js → HowItWorks-Ch2CgkVd.js} +1 -1
- package/dist/assets/{LegalApp-BmZpqH-6.js → LegalApp-BisEJynn.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-CcbAfubz.js → LegalMarkdownDocument-B7Yj_aRR.js} +1 -1
- package/dist/assets/{LegalPageShell-raMATqhx.js → LegalPageShell-k9e22JlP.js} +1 -1
- package/dist/assets/{LeverPanel-DVUgGcYW.js → LeverPanel-CXSDqinv.js} +1 -1
- package/dist/assets/{Library-D725dNcx.js → Library-CmpF6gOU.js} +1 -1
- package/dist/assets/{LibraryOverlay-D7PzQIpH.js → LibraryOverlay-BErgFYxu.js} +1 -1
- package/dist/assets/LiveApp-DZ7t3P1O.js +61 -0
- package/dist/assets/LiveApp-Dj_6EQuL.css +1 -0
- package/dist/assets/LiveSettings-BY5E3Ka8.js +6 -0
- package/dist/assets/{MindMapViewerDrawer-CIMuABKE.js → MindMapViewerDrawer-Bc_qHdm9.js} +1 -1
- package/dist/assets/MindShape-DGOmKwov.css +1 -0
- package/dist/assets/{MindShape-0KPrv0CF.js → MindShape-ULBAjrfD.js} +1 -1
- package/dist/assets/{PinToDashboard-ML4NFCAU.js → PinToDashboard-WgEX4YoY.js} +1 -1
- package/dist/assets/{PlanReview-CbJ_7Ld1.js → PlanReview-Dd3sxa_o.js} +1 -1
- package/dist/assets/{Presence-B_zDfiE7.js → Presence-DgzicbeF.js} +1 -1
- package/dist/assets/{PresentationDeck-Tm3PUdh5.js → PresentationDeck-Cx26X-wh.js} +1 -1
- package/dist/assets/{PrismApp-Bc-6PO_P.js → PrismApp-FPqASfhZ.js} +2 -2
- package/dist/assets/{PrismAskController-OwqFx5Pk.js → PrismAskController-Ds1tSE9S.js} +1 -1
- package/dist/assets/{PrismBriefingPlayer-Bu_ZxYdh.js → PrismBriefingPlayer-BzqCK6JP.js} +2 -2
- package/dist/assets/{PrismOverlay-UTsJ8R5d.js → PrismOverlay-Cq3DBJ-N.js} +4 -4
- package/dist/assets/{PrivacyApp-BLXan6dm.js → PrivacyApp-B8PGc-x5.js} +1 -1
- package/dist/assets/{Recap-5rYrcMCC.js → Recap-RwhzouRe.js} +1 -1
- package/dist/assets/{ReelJelly-Dg3XGB0c.js → ReelJelly-B2JQsaRI.js} +1 -1
- package/dist/assets/{ReplayCard-wMIMlorH.js → ReplayCard-DUBvQLBt.js} +2 -2
- package/dist/assets/{ReplayOverlay-BomkTonB.js → ReplayOverlay-CzUFHdjK.js} +1 -1
- package/dist/assets/{RewindOverlay-Izf89nG9.js → RewindOverlay-CMx_cVxX.js} +1 -1
- package/dist/assets/{RippleApp-8QSIEjTX.js → RippleApp-B186b8KW.js} +2 -2
- package/dist/assets/{RippleAskController-Cd86GrKs.js → RippleAskController-BA_kGOmL.js} +1 -1
- package/dist/assets/{RippleOverlay-SCrXZTqz.js → RippleOverlay-CkbkIgzC.js} +2 -2
- package/dist/assets/{SeeDontRead-Bp8qsF20.js → SeeDontRead-BZ4xFEKE.js} +1 -1
- package/dist/assets/{ShareModal-C-sD-aia.js → ShareModal-DNpc-U9U.js} +1 -1
- package/dist/assets/{ShipCascade-Cq_I4c_v.js → ShipCascade-BmTE193h.js} +1 -1
- package/dist/assets/{ShipCourse-CzsJyMnT.js → ShipCourse-K2vnS3Sw.js} +1 -1
- package/dist/assets/{ShipHotspots-OMjPhQWP.js → ShipHotspots-DILwqPxh.js} +1 -1
- package/dist/assets/{ShipIncident-Cqn6ZmKz.js → ShipIncident-DXXciEP7.js} +1 -1
- package/dist/assets/{ShipMigration-5_ZWn7K9.js → ShipMigration-rhBm0Tre.js} +1 -1
- package/dist/assets/{ShipOnboarding-Yr8oKgmQ.js → ShipOnboarding-9KCVVAkX.js} +1 -1
- package/dist/assets/{ShipRead-Bnw7mnv3.js → ShipRead-CMe1DNik.js} +1 -1
- package/dist/assets/{ShipRollout-ECsDrqAd.js → ShipRollout-BA4x-btU.js} +1 -1
- package/dist/assets/{ShipSuggestions-C6oDw2F8.js → ShipSuggestions-Jm45jfFl.js} +1 -1
- package/dist/assets/{ShipWorkspace-BT6gZrqd.js → ShipWorkspace--x-q6Ly3.js} +1 -1
- package/dist/assets/{SignatureLoop-D7sibSnc.js → SignatureLoop-B_cHyXgU.js} +1 -1
- package/dist/assets/{SynthesisApp-B768x2r_.js → SynthesisApp-CvR_8g1C.js} +2 -2
- package/dist/assets/{SynthesisOverlay-Ds0MhZLQ.js → SynthesisOverlay-DFFD69hf.js} +1 -1
- package/dist/assets/{TermsApp-Da8FeMj3.js → TermsApp-BxLgLSna.js} +1 -1
- package/dist/assets/{TopicCanvas-D64O3lvD.js → TopicCanvas-CKvJb_8Y.js} +2 -2
- package/dist/assets/{TopicCanvas-D2Nax9II.css → TopicCanvas-uRuHi99s.css} +1 -1
- package/dist/assets/{TourPrism-CTf1G-Vv.js → TourPrism-bqOmSZ9T.js} +1 -1
- package/dist/assets/{TrackerTile-DeujTCk-.js → TrackerTile-BuAVmOyi.js} +2 -2
- package/dist/assets/{TwoSurfaces-kyK2yqm0.js → TwoSurfaces-CjtKXWJr.js} +1 -1
- package/dist/assets/{UnderstoodPanel-Dgwk_Cuj.js → UnderstoodPanel-BWFbpk9o.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-C4eQC0lg.js → WhyMachineOverlay-D6pGEE78.js} +1 -1
- package/dist/assets/{WowFeatures-CaBZ5WPM.js → WowFeatures-CLx5VoKn.js} +1 -1
- package/dist/assets/{ZoomDeck-DnCtbhx1.js → ZoomDeck-R6MLUt4Z.js} +1 -1
- package/dist/assets/{alternateFinishes-FSV_gA1A.js → alternateFinishes-C8DBTwo_.js} +1 -1
- package/dist/assets/{annotationAuto-x_dV8z65.js → annotationAuto-ofVcqRve.js} +1 -1
- package/dist/assets/{annotationReel-SeXzv0P-.js → annotationReel-CdAmTPlv.js} +1 -1
- package/dist/assets/{backup-0zODkqi-.js → backup-TgoSxdwf.js} +1 -1
- package/dist/assets/canvas-BrUiUI9Q.js +1 -0
- package/dist/assets/{catalog-Car_1ocN.js → catalog-BrmxA4bP.js} +1 -1
- package/dist/assets/{dashboardEvents-BqcPN-K8.js → dashboardEvents-DT6ye9n7.js} +1 -1
- package/dist/assets/{dist-BTg4yEWr.js → dist-COAFD72d.js} +1 -1
- package/dist/assets/{fit-I3tuibfX.js → fit-BtKObM5Q.js} +1 -1
- package/dist/assets/{generateLive-Dk24OxVt.js → generateLive-BvE3kOrf.js} +1 -1
- package/dist/assets/gesture-Bouqjr3g.js +2 -0
- package/dist/assets/{index-CWqRe4-B.js → index-DOpl5xzv.js} +3 -3
- package/dist/assets/{jspdf.es.min-wkD3BzGZ.js → jspdf.es.min-DSMzCXtv.js} +1 -1
- package/dist/assets/{kokoro-B-3GqktX.js → kokoro-B-MNB16v.js} +1 -1
- package/dist/assets/{lib-CwruVYU_.js → lib-BLt1wpw2.js} +1 -1
- package/dist/assets/{liveSchema-CCpVMy0H.js → liveSchema-DbjsSolX.js} +2 -2
- package/dist/assets/{motion-CURfDtdH.js → motion-DKmdzFji.js} +1 -1
- package/dist/assets/{notes-BG5QP-Dj.js → notes-D_uDKcr5.js} +1 -1
- package/dist/assets/{pdf-x4qTBJIZ.js → pdf-uUFiTOYW.js} +1 -1
- package/dist/assets/{penStrokes-9Q_l7NTt.js → penStrokes-DlHnO9xE.js} +1 -1
- package/dist/assets/{perfProbe-BFwfpxJt.js → perfProbe-DIAQR2bi.js} +1 -1
- package/dist/assets/{pin-DRN5H7py.js → pin-DoSzEmTm.js} +1 -1
- package/dist/assets/{portal-BYHo9LOD.js → portal-4sKB1Tgc.js} +1 -1
- package/dist/assets/{pptxgen.es-DGywGiaX.js → pptxgen.es-BVKKMlmO.js} +1 -1
- package/dist/assets/{prewarm-CQNCE4Uq.js → prewarm-D31Si_08.js} +1 -1
- package/dist/assets/{quietHours-CKjQ2pGY.js → quietHours-sfkvrkJv.js} +1 -1
- package/dist/assets/registry--yZ1HduK.js +1 -0
- package/dist/assets/{registry-CfTTYQrE.js → registry-B3RfPAd6.js} +1 -1
- package/dist/assets/{registry-DBsjgIxw.js → registry-B3u3--Kv.js} +1 -1
- package/dist/assets/{registry-DFmFBfRz.js → registry-BOS6AdnB.js} +1 -1
- package/dist/assets/{registry-Dw42uggW.js → registry-BWzoIPXp.js} +1 -1
- package/dist/assets/{registry-CNr6L-3z.js → registry-Bj8q4igW.js} +1 -1
- package/dist/assets/{registry-_T6pLDPG.js → registry-BnSnMnyk.js} +2 -2
- package/dist/assets/{registry-aUZZeh27.js → registry-BpccSYOo.js} +1 -1
- package/dist/assets/{registry-BueBIP-N.js → registry-C4KB6Ls0.js} +1 -1
- package/dist/assets/{registry-cPmSqaRu.js → registry-CAZ7ubmd.js} +1 -1
- package/dist/assets/{registry-1BWL6SXY.js → registry-CYnKlcEy.js} +1 -1
- package/dist/assets/{registry-BZQeYzgv.js → registry-Chzw1Udo.js} +1 -1
- package/dist/assets/{registry-DrqQbf_n.js → registry-CkXIaQmB.js} +1 -1
- package/dist/assets/{registry-BklPTZre.js → registry-CrKVDfq8.js} +1 -1
- package/dist/assets/registry-D5oMqeSa.js +1 -0
- package/dist/assets/{registry-9S6KiKjR.js → registry-DOsiT4_6.js} +1 -1
- package/dist/assets/{registry-Bl3NkU-0.js → registry-DsjrEa0W.js} +1 -1
- package/dist/assets/{registry-Bc6_RQ8l.js → registry-DssqYPgu.js} +1 -1
- package/dist/assets/{registry-CqfjqOX5.js → registry-DxtkIiAV.js} +2 -2
- package/dist/assets/{registry-Bpx4VBWb.js → registry-DzNYBJ_a.js} +1 -1
- package/dist/assets/{registry-GLjcQX0n.js → registry-NdA9xh9G.js} +1 -1
- package/dist/assets/{registry-D84Bs-bD.js → registry-VRtsyPV7.js} +1 -1
- package/dist/assets/{registry-DEgW3zel.js → registry-d3dHoriR.js} +1 -1
- package/dist/assets/{registry-BpBiRe-o.js → registry-fLKnCnS5.js} +1 -1
- package/dist/assets/{relate-yq30L3hZ.js → relate-BG7aZWOq.js} +1 -1
- package/dist/assets/{shikiHighlight-BgZoQAHs.js → shikiHighlight-D9nfk5pW.js} +1 -1
- package/dist/assets/{useDashboardLoop-mGmJwv27.js → useDashboardLoop-CJ0M7ZXf.js} +3 -3
- package/dist/assets/{useLiveConfig-vMyjo2gV.js → useLiveConfig-DIvKKKpP.js} +1 -1
- package/dist/assets/{useSpatialCanvas-CEXy6ZC2.js → useSpatialCanvas-L0r29F7F.js} +1 -1
- package/dist/assets/{useSpotlightWalk-B9XJ6OLK.js → useSpotlightWalk-oyvTWe20.js} +1 -1
- package/dist/assets/{useSrsCards-Vc6B2_he.js → useSrsCards-BLNBqRe7.js} +1 -1
- package/dist/assets/{useStudy-6QnY-Fw_.js → useStudy-hvN-iGz0.js} +1 -1
- package/dist/assets/{useZoomGesture-BONUz5cE.js → useZoomGesture-Dl_Cfmxm.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/DashboardLoopRuntime-14yzj-xx.js +0 -1
- package/dist/assets/DashboardsApp-mvMbGmp0.js +0 -2
- package/dist/assets/DelegatePanel-pwRk9pFf.js +0 -26
- package/dist/assets/LiveApp-B8Jw1Q0h.js +0 -61
- package/dist/assets/LiveApp-DQhDk2ma.css +0 -1
- package/dist/assets/LiveSettings-BQ06gZB7.js +0 -6
- package/dist/assets/MindShape-Bel2yDqO.css +0 -1
- package/dist/assets/RehearsalPanel-BCU615wg.css +0 -1
- package/dist/assets/RehearsalPanel-CM4466Os.js +0 -6
- package/dist/assets/canvas-uhcwigAL.js +0 -1
- package/dist/assets/gesture-DabMpPcq.js +0 -2
- package/dist/assets/registry-BffpZK5w.js +0 -1
- package/dist/assets/registry-Z3TIPbYJ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{ht as r}from"./index-CWqRe4-B.js";import{n as i}from"./icons-CHVz6kv_.js";import{t as a}from"./richText-BkxJhl9N.js";import{n as o,r as s}from"./format-DlZTyeMy.js";import{a as c,i as l,n as u,r as d,t as f}from"./scale-Bcgfo6Hp.js";import{n as p,t as m}from"./motion-CURfDtdH.js";import{t as h}from"./registry-types-DMuK0vJ6.js";import{n as g}from"./fitText-CDFmCQzl.js";var _=t(),v=n();function y({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,value:r,unit:o,delta:s,deltaDir:c=`up`,color:l=`var(--presence)`,points:u,footer:d,delay:f}){let p=i[t]||i.chart,[m,h]=(0,_.useState)(Math.max(0,u.length-1)),g=u.map(e=>e.v),y=g.length?Math.min(...g):0,b=(g.length?Math.max(...g):0)-y||1,x=e=>4+e/Math.max(1,u.length-1)*212,S=e=>52-(e-y)/b*48,C=u.map((e,t)=>`${x(t)},${S(e.v)}`).join(` `),w=`4,56 ${C} 216,56`,T=u[Math.min(m,u.length-1)];return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(f||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`insight-stat`,style:{marginBottom:4},children:[(0,v.jsx)(`span`,{className:`big tab-num`,"data-mark":`underline`,style:{color:l},children:r}),s&&(0,v.jsxs)(`span`,{className:`delta ${c}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:13,height:13,transform:c===`down`?`rotate(180deg)`:`none`}}),s]})]}),o&&(0,v.jsx)(`div`,{className:`ss-unit faint`,children:o}),(0,v.jsxs)(`div`,{className:`ss-spark`,style:{marginTop:12},children:[(0,v.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 220 56`,className:`ss-svg`,preserveAspectRatio:`none`,children:[(0,v.jsx)(`defs`,{children:(0,v.jsxs)(`linearGradient`,{id:`ssfill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,v.jsx)(`stop`,{offset:`0%`,stopColor:l,stopOpacity:`0.22`}),(0,v.jsx)(`stop`,{offset:`100%`,stopColor:l,stopOpacity:`0`})]})}),(0,v.jsx)(`polygon`,{points:w,fill:`url(#ssfill)`}),(0,v.jsx)(`polyline`,{points:C,fill:`none`,stroke:l,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),u.map((e,t)=>(0,v.jsx)(`rect`,{x:x(t)-220/u.length/2,y:0,width:220/u.length,height:56,fill:`transparent`,onMouseEnter:()=>h(t),style:{cursor:`pointer`}},t)),(0,v.jsx)(`line`,{x1:x(m),y1:0,x2:x(m),y2:56,stroke:`var(--hover-line)`,strokeWidth:`1`}),T&&(0,v.jsx)(`circle`,{cx:x(m),cy:S(T.v),r:`3.4`,fill:l,stroke:`var(--surface-elevated)`,strokeWidth:`1.5`})]}),(0,v.jsxs)(`div`,{className:`ss-tip`,children:[(0,v.jsx)(`span`,{className:`ss-tip-v tab-num`,style:{color:l},children:T?T.v.toLocaleString():`—`}),T?.label&&(0,v.jsx)(`span`,{className:`ss-tip-l faint`,children:T.label})]})]}),d&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function b({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,value:r,prefix:o=``,suffix:s=``,decimals:c=0,label:l,delta:u,deltaDir:d=`up`,color:f=`var(--presence)`,footer:p,delay:m}){let h=i[t]||i.spark,[g,y]=(0,_.useState)(0),b=(0,_.useRef)(0);(0,_.useEffect)(()=>{if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){y(r);return}let e=performance.now()+(m||0),t=n=>{let i=Math.max(0,Math.min(1,(n-e)/1100));y(r*(1-(1-i)**3)),i<1&&(b.current=requestAnimationFrame(t))};return b.current=requestAnimationFrame(t),()=>cancelAnimationFrame(b.current)},[r,m]);let x=g.toLocaleString(void 0,{minimumFractionDigits:c,maximumFractionDigits:c});return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(m||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(h,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`ct-num tab-num`,"data-mark":`underline`,style:{color:f},children:[(0,v.jsx)(`span`,{className:`ct-affix`,children:o}),x,(0,v.jsx)(`span`,{className:`ct-affix`,children:s})]}),(0,v.jsxs)(`div`,{className:`ct-row`,children:[(0,v.jsx)(`span`,{className:`ct-label`,children:l}),u&&(0,v.jsxs)(`span`,{className:`delta ${d}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:13,height:13,transform:d===`down`?`rotate(180deg)`:`none`}}),u]})]}),p&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(p)})]})}function x({title:e,icon:t=`sparkle`,iconColor:n=`var(--presence)`,value:r,unit:o,narrative:s,trend:c,trendDir:l=`up`,detail:u,color:d=`var(--presence)`,footer:f,delay:p}){let m=i[t]||i.sparkle,[h,g]=(0,_.useState)(!1);return(0,v.jsxs)(`div`,{className:`card reveal hero-card stats-card`,style:{"--delay":(p||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(m,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`hero-value tab-num`,"data-mark":`underline`,style:{"--hero-c":d},children:[r,o&&(0,v.jsx)(`span`,{className:`hero-unit`,children:o})]}),s&&(0,v.jsx)(`div`,{className:`hero-narrative`,dangerouslySetInnerHTML:a(s)}),c&&(0,v.jsxs)(`div`,{className:`hero-chip ${l} ${h?`open`:``}`,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),onClick:()=>g(e=>!e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(e=>!e))},role:`button`,tabIndex:0,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:14,height:14,transform:l===`down`?`rotate(180deg)`:`none`}}),(0,v.jsx)(`span`,{children:c}),u&&(0,v.jsx)(i.chevR,{className:`ic hero-chip-caret`,style:{width:13,height:13}})]}),u&&(0,v.jsx)(`div`,{className:`hero-detail`,"data-open":h,dangerouslySetInnerHTML:a(u)}),f&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(f)})]})}var S=130,C=56,w=1.5;function T({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,value:r,delta:o,deltaDir:s=`up`,color:c=`var(--presence)`,bars:l,footer:u,delay:d}){let f=i[t]||i.chart,p=l.length>40?l.slice(-40):l,[m,h]=(0,_.useState)(Math.max(0,p.length-1)),g=Math.max(...p,1);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(d||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`tt-body`,children:[(0,v.jsxs)(`div`,{className:`tt-left`,children:[(0,v.jsx)(`div`,{className:`tt-value tab-num`,"data-mark":`underline`,style:{color:c},children:r}),(0,v.jsxs)(`div`,{className:`tt-delta delta ${s}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:14,height:14,transform:s===`down`?`rotate(180deg)`:`none`}}),o]})]}),(0,v.jsx)(`svg`,{className:`tt-bars`,viewBox:`0 0 ${S} ${C}`,width:`100%`,height:C,preserveAspectRatio:`none`,role:`group`,"aria-label":`recent trend`,children:p.map((e,t)=>{let n=S/p.length,r=Math.max(1,n-w),i=Math.min(C,Math.max(C*.08,e/g*C));return(0,v.jsx)(`rect`,{className:`tt-bar ${t===m?`on`:``}`,x:t*n+(n-r)/2,y:C-i,width:r,height:i,rx:1.5,fill:t===m?c:`var(--track)`,onMouseEnter:()=>h(t),children:(0,v.jsx)(`title`,{children:String(e)})},t)})})]}),u&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:10},dangerouslySetInnerHTML:a(u)})]})}function E({title:e,icon:t=`shield`,iconColor:n=`var(--insight)`,score:r,grade:o,caption:s,color:c=`var(--insight)`,components:l=[],footer:u,delay:d}){let f=i[t]||i.shield,[p,m]=(0,_.useState)(null),h=Math.max(0,Math.min(100,r))/100,g=2*Math.PI*46;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(d||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`sb-body`,children:[(0,v.jsxs)(`div`,{className:`sb-ring`,children:[(0,v.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 120 120`,className:`sb-svg`,children:[(0,v.jsx)(`circle`,{cx:`60`,cy:`60`,r:46,fill:`none`,stroke:`var(--track)`,strokeWidth:`9`}),(0,v.jsx)(`circle`,{cx:`60`,cy:`60`,r:46,fill:`none`,stroke:c,strokeWidth:`9`,strokeLinecap:`round`,strokeDasharray:g,strokeDashoffset:g*(1-h),transform:`rotate(-90 60 60)`,className:`sb-arc`})]}),(0,v.jsxs)(`div`,{className:`sb-center`,children:[(0,v.jsx)(`div`,{className:`sb-score tab-num`,"data-mark":`underline`,style:{color:c},children:o??Math.round(r)}),o&&(0,v.jsx)(`div`,{className:`sb-sub tab-num`,children:Math.round(r)})]})]}),(0,v.jsxs)(`div`,{className:`sb-list`,children:[s&&(0,v.jsx)(`div`,{className:`sb-caption faint`,children:s}),l.map((e,t)=>{let n=e.color||c,r=p===t;return(0,v.jsxs)(`div`,{className:`sb-comp ${r?`on`:``}`,onMouseEnter:()=>m(t),onMouseLeave:()=>m(null),children:[(0,v.jsx)(`span`,{className:`sb-comp-dot`,style:{background:n}}),(0,v.jsx)(`span`,{className:`sb-comp-label`,children:e.label}),(0,v.jsx)(`span`,{className:`sb-comp-track`,children:(0,v.jsx)(`span`,{className:`sb-comp-fill`,style:{width:e.value+`%`,background:n}})}),(0,v.jsx)(`span`,{className:`sb-comp-val tab-num`,style:r?{color:n}:void 0,children:e.value})]},t)})]})]}),u&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function D({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,percentile:r,value:o,unit:s,lowLabel:c=`p0`,highLabel:l=`p100`,color:u=`var(--presence)`,footer:d,delay:f}){let p=i[t]||i.chart,[m,h]=(0,_.useState)(!1),g=Math.max(0,Math.min(100,r)),y=Math.max(1,Math.round(100-g));return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(f||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`pb-head`,children:[(0,v.jsx)(`span`,{className:`pb-value tab-num`,"data-mark":`underline`,style:{color:u},children:o}),s&&(0,v.jsx)(`span`,{className:`pb-unit faint`,children:s}),(0,v.jsxs)(`span`,{className:`pb-pct tab-num`,children:[Math.round(g),`th pct`]})]}),(0,v.jsxs)(`div`,{className:`pb-track`,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,v.jsx)(`div`,{className:`pb-grad`}),[25,50,75].map(e=>(0,v.jsx)(`span`,{className:`pb-tick`,style:{left:e+`%`}},e)),(0,v.jsx)(`div`,{className:`pb-fill`,style:{width:g+`%`,background:`color-mix(in oklab, ${u} 22%, transparent)`}}),(0,v.jsx)(`div`,{className:`pb-marker`,style:{left:g+`%`,background:u},children:(0,v.jsxs)(`span`,{className:`pb-tip ${m?`on`:``}`,style:{borderColor:u,"--pb-tip-bias":`${50-g}%`},children:[`top `,y,`%`]})})]}),(0,v.jsxs)(`div`,{className:`pb-axis faint`,children:[(0,v.jsx)(`span`,{children:c}),(0,v.jsx)(`span`,{children:l})]}),d&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function O({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,left:r,right:o,connector:s=`→`,ratioLabel:c=`ratio`,footer:l,delay:u}){let d=i[t]||i.layers,[f,p]=(0,_.useState)(null),m=r.color||`var(--presence)`,h=o.color||`var(--insight)`,g=r.weight+o.weight||1,y=o.weight===0?`—`:(r.weight/o.weight).toFixed(2),b=r.weight/g*100;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(u||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`sp-row`,children:[(0,v.jsxs)(`div`,{className:`sp-side ${f===`left`?`on`:``}`,onMouseEnter:()=>p(`left`),onMouseLeave:()=>p(null),children:[(0,v.jsx)(`div`,{className:`sp-val tab-num`,style:{color:m},children:r.value}),(0,v.jsx)(`div`,{className:`sp-label`,children:r.label}),r.sub&&(0,v.jsx)(`div`,{className:`sp-sub faint`,children:r.sub})]}),(0,v.jsx)(`div`,{className:`sp-connector`,children:(0,v.jsx)(`span`,{className:`sp-arrow`,children:s})}),(0,v.jsxs)(`div`,{className:`sp-side right ${f===`right`?`on`:``}`,onMouseEnter:()=>p(`right`),onMouseLeave:()=>p(null),children:[(0,v.jsx)(`div`,{className:`sp-val tab-num`,style:{color:h},children:o.value}),(0,v.jsx)(`div`,{className:`sp-label`,children:o.label}),o.sub&&(0,v.jsx)(`div`,{className:`sp-sub faint`,children:o.sub})]})]}),(0,v.jsxs)(`div`,{className:`sp-bar`,children:[(0,v.jsx)(`span`,{className:`sp-bar-l`,style:{width:b+`%`,background:m}}),(0,v.jsx)(`span`,{className:`sp-bar-r`,style:{width:100-b+`%`,background:h}})]}),(0,v.jsxs)(`div`,{className:`sp-ratio`,children:[(0,v.jsx)(`span`,{className:`sp-ratio-v tab-num`,"data-mark":`underline`,children:y}),(0,v.jsx)(`span`,{className:`sp-ratio-l faint`,children:c})]}),l&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(l)})]})}function k({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,cols:r=2,tiles:o,footer:s,delay:c}){let l=i[t]||i.table,[u,d]=(0,_.useState)(null);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(c||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`sc-grid`,style:{"--sc-cols":r},children:o.map((e,t)=>{let n=e.icon?i[e.icon]||i.spark:null,r=e.color||`var(--presence)`,o=u===t;return(0,v.jsxs)(`div`,{className:`sc-tile ${o?`on`:``}`,onMouseEnter:()=>d(t),onMouseLeave:()=>d(null),children:[(0,v.jsxs)(`div`,{className:`sc-tile-top`,children:[n&&(0,v.jsx)(n,{className:`ic sc-tile-ic`,style:{color:r}}),(0,v.jsx)(`span`,{className:`sc-tile-label`,children:e.label})]}),(0,v.jsx)(`div`,{className:`sc-tile-val tab-num`,style:{color:r},children:e.value}),e.delta&&(0,v.jsxs)(`div`,{className:`sc-tile-delta delta ${e.deltaDir||`up`}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:12,height:12,transform:e.deltaDir===`down`?`rotate(180deg)`:`none`}}),e.delta]}),e.detail&&(0,v.jsx)(`div`,{className:`sc-tile-detail`,"data-open":o,dangerouslySetInnerHTML:a(e.detail)})]},t)})}),s&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}function A({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,prefix:r=``,suffix:o=``,steps:s,footer:c,delay:l}){let u=i[t]||i.layers,[d,f]=(0,_.useState)(null),p=0,m=s.map(e=>(e.isBase||e.isTotal?p=e.delta:p+=e.delta,{...e,running:p})),h=Math.max(...m.map(e=>Math.abs(e.running)),1),g=e=>r+e.toLocaleString()+o,y=(()=>{let e=m.findIndex(e=>e.isTotal);return e>=0?e:m.length-1})();return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(l||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`dc-list`,children:m.map((e,t)=>{let n=e.delta>=0,r=e.isBase||e.isTotal?`var(--presence)`:n?`var(--insight)`:`var(--danger)`,i=Math.abs(e.running)/h*100,o=d===t;return(0,v.jsxs)(`div`,{className:`dc-step ${e.isBase?`base`:``} ${e.isTotal?`total`:``} ${o?`on`:``}`,onMouseEnter:()=>f(t),onMouseLeave:()=>f(null),children:[(0,v.jsxs)(`div`,{className:`dc-step-head`,children:[(0,v.jsx)(`span`,{className:`dc-step-label`,children:e.label}),(0,v.jsx)(`span`,{className:`dc-step-delta tab-num`,"data-mark":t===y?`underline`:void 0,style:{color:r},children:e.isBase||e.isTotal?g(e.running):(n?`+`:``)+g(e.delta)})]}),(0,v.jsx)(`div`,{className:`dc-step-track`,children:(0,v.jsx)(`span`,{className:`dc-step-fill`,style:{width:i+`%`,background:r}})}),!e.isTotal&&(0,v.jsxs)(`div`,{className:`dc-run faint tab-num`,children:[`→ `,g(e.running)]}),e.detail&&(0,v.jsx)(`div`,{className:`dc-detail`,"data-open":o,dangerouslySetInnerHTML:a(e.detail)})]},t)})}),c&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(c)})]})}function j({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,rows:r,footer:o,delay:s}){let c=i[t]||i.chart,[l,u]=(0,_.useState)(null),d=(()=>{let e=0;return r.forEach((t,n)=>{t.value>r[e].value&&(e=n)}),e})();return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(s||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`bk-list`,children:r.map((e,t)=>{let n=e.color||`var(--presence)`,r=e.max||1,i=Math.max(0,Math.min(100,e.value/r*100)),a=Math.max(0,Math.min(100,e.target/r*100)),o=e.value>=e.target,s=l===t,c=e.target===0?0:Math.round(e.value/e.target*100);return(0,v.jsxs)(`div`,{className:`bk-row ${s?`on`:``}`,onMouseEnter:()=>u(t),onMouseLeave:()=>u(null),children:[(0,v.jsxs)(`div`,{className:`bk-head`,children:[(0,v.jsx)(`span`,{className:`bk-label`,children:e.label}),(0,v.jsx)(`span`,{className:`bk-val tab-num`,style:{color:n},children:e.display??e.value.toLocaleString()})]}),(0,v.jsxs)(`div`,{className:`bk-track`,children:[(0,v.jsx)(`span`,{className:`bk-band`}),(0,v.jsx)(`span`,{className:`bk-fill`,"data-mark":t===d?`circle`:void 0,style:{width:i+`%`,background:o?n:`color-mix(in oklab, ${n} 60%, var(--warning))`}}),(0,v.jsx)(`span`,{className:`bk-target`,style:{left:a+`%`},title:`target ${e.target}`})]}),(0,v.jsxs)(`div`,{className:`bk-meta faint tab-num`,"data-on":s,children:[c,`% of target`,s?` · target ${e.target.toLocaleString()}`:``]})]},t)})}),o&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var M=360,ee=320,N=96,te=56,ne=16,re=20,P=30;function F(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ie(e){if(!Number.isFinite(e))return`—`;let t=Math.round(e*1e3)/10;return(Number.isInteger(t)?t.toString():t.toFixed(1))+`%`}var ae=1/5.6;function oe(e,t){let n=Math.max(3,Math.floor(t*ae));return e.length>n?e.slice(0,n-1).trimEnd()+`…`:e}function se({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,classes:r,matrix:o,correctColor:s=`var(--presence)`,errorColor:c=`var(--danger)`,showTotals:u=!1,readout:d=`accuracy`,actualLabel:f=`Actual`,predictedLabel:p=`Predicted`,countLabel:m=`samples`,footer:h,delay:g}){let y=i[t]||i.table,b=(0,_.useMemo)(()=>{let e=r?.length??0;if(e<2||!o||o.length<e)return null;let t=r.map((e,t)=>{let n=o[t]??[];return r.map((e,t)=>{let r=n[t];return Number.isFinite(r)?r:0})}),n=t.reduce((e,t)=>e+F(t),0),i=t.reduce((e,t,n)=>e+(Number.isFinite(t[n])?t[n]:0),0),a=n>0?i/n:0,s=Math.max(1,...t.flat()),c=r.map((e,n)=>{let r=t.reduce((e,t)=>e+(Number.isFinite(t[n])?t[n]:0),0),i=F(t[n])>0?t[n][n]/F(t[n]):NaN;return{label:e,precision:r>0?t[n][n]/r:NaN,recall:i}}),d=M-ne-(u?P:0),f=ee-re-(u?P:0),p=Math.min(d-N,f-te),m=N,h=te;return{n:e,grid:t,total:n,correct:i,accuracy:a,perClass:c,ex:l([0,e],[m,m+p]),ey:l([0,e],[h,h+p]),cell:p/e,side:p,x0:m,y0:h,heat:e=>s>0?Math.sqrt(Math.max(0,e)/s):0,colTotals:r.map((e,n)=>t.reduce((e,t)=>e+(Number.isFinite(t[n])?t[n]:0),0)),rowTotals:t.map(e=>F(e))}},[r,o,u]);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(g||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(y,{className:`ic`,style:{color:n}}),` `,e]}),b&&(0,v.jsxs)(`div`,{className:`cfm-wrap`,children:[(0,v.jsxs)(`svg`,{viewBox:`0 0 ${M} ${ee}`,className:`cfm-svg`,role:`img`,"aria-label":e,children:[b.grid.map((e,t)=>e.map((e,n)=>{let r=b.ex(n),i=b.ey(t),a=t===n,o=a?s:c,l=b.heat(e),u=`color-mix(in oklab, ${o} ${(8+l*80).toFixed(1)}%, transparent)`,d=l>.55;return(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`rect`,{x:r+1,y:i+1,width:b.cell-2,height:b.cell-2,rx:4,fill:u,className:a?`cfm-cell cfm-cell--diag`:`cfm-cell`}),(0,v.jsx)(`text`,{x:r+b.cell/2,y:i+b.cell/2,className:d?`cfm-count cfm-count--on`:`cfm-count`,textAnchor:`middle`,dominantBaseline:`central`,"data-mark":a?`point`:void 0,children:e.toLocaleString()})]},`c${t}-${n}`)})),(0,v.jsx)(`rect`,{x:b.x0,y:b.y0,width:b.side,height:b.side,className:`cfm-frame`,fill:`none`}),r.map((e,t)=>{let n=oe(e,N-12);return(0,v.jsxs)(`text`,{x:b.x0-8,y:b.ey(t)+b.cell/2,className:`cfm-class`,textAnchor:`end`,dominantBaseline:`central`,children:[n!==e&&(0,v.jsx)(`title`,{children:e}),n]},`rl${t}`)}),r.map((e,t)=>{let n=oe(e,b.cell-4);return(0,v.jsxs)(`text`,{x:b.ex(t)+b.cell/2,y:b.y0-8,className:`cfm-class`,textAnchor:`middle`,children:[n!==e&&(0,v.jsx)(`title`,{children:e}),n]},`cl${t}`)}),(0,v.jsxs)(`text`,{x:0,y:0,transform:`translate(18, ${b.y0+b.side/2}) rotate(-90)`,className:`cfm-axis-title`,textAnchor:`middle`,children:[f,` ↓`]}),(0,v.jsxs)(`text`,{x:b.x0+b.side/2,y:18,className:`cfm-axis-title`,textAnchor:`middle`,children:[p,` →`]}),u&&(0,v.jsxs)(`g`,{className:`cfm-totals`,children:[b.rowTotals.map((e,t)=>(0,v.jsx)(`text`,{x:b.x0+b.side+P/2,y:b.ey(t)+b.cell/2,className:`cfm-total`,textAnchor:`middle`,dominantBaseline:`central`,children:e.toLocaleString()},`rt${t}`)),b.colTotals.map((e,t)=>(0,v.jsx)(`text`,{x:b.ex(t)+b.cell/2,y:b.y0+b.side+P/2,className:`cfm-total`,textAnchor:`middle`,dominantBaseline:`central`,children:e.toLocaleString()},`ct${t}`)),(0,v.jsx)(`text`,{x:b.x0+b.side+P/2,y:b.y0-8,className:`cfm-total-hd`,textAnchor:`middle`,children:`Σ`}),(0,v.jsx)(`text`,{x:b.x0-8,y:b.y0+b.side+P/2,className:`cfm-total-hd`,textAnchor:`end`,dominantBaseline:`central`,children:`Σ`})]})]}),d===`accuracy`&&(0,v.jsxs)(`div`,{className:`cfm-readout`,children:[(0,v.jsx)(`span`,{className:`cfm-acc tab-num`,style:{color:s},"data-mark":`underline`,children:ie(b.accuracy)}),(0,v.jsxs)(`span`,{className:`cfm-acc-lbl faint`,children:[`accuracy · `,b.correct.toLocaleString(),` of `,b.total.toLocaleString(),` `,m,` correct`]})]}),d===`perclass`&&(0,v.jsxs)(`div`,{className:`cfm-pc`,children:[(0,v.jsxs)(`div`,{className:`cfm-pc-row cfm-pc-head`,children:[(0,v.jsx)(`span`,{className:`cfm-pc-name`,children:`Class`}),(0,v.jsx)(`span`,{className:`cfm-pc-val`,children:`Precision`}),(0,v.jsx)(`span`,{className:`cfm-pc-val`,children:`Recall`})]}),b.perClass.map((e,t)=>(0,v.jsxs)(`div`,{className:`cfm-pc-row`,children:[(0,v.jsx)(`span`,{className:`cfm-pc-name`,children:e.label}),(0,v.jsx)(`span`,{className:`cfm-pc-val tab-num`,children:ie(e.precision)}),(0,v.jsx)(`span`,{className:`cfm-pc-val tab-num`,children:ie(e.recall)})]},`pc${t}`))]})]}),!b&&(0,v.jsx)(`div`,{className:`cfm-empty faint`,children:`Provide a class list and a square N×N matrix (matrix[i][j] = actual i predicted j).`}),h&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(h)})]})}var I=r(),L=132,R=40,z=4;function ce(e){return e===`down`?`var(--danger)`:`var(--insight)`}function le(e){let t=(0,I.c)(45),{spark:n,color:r}=e,[i,a]=(0,_.useState)(Math.max(0,n.length-1)),o=Math.min(...n),s=Math.max(...n),c=s-o||1,l;t[0]===n.length?l=t[1]:(l=e=>z+e/Math.max(1,n.length-1)*(L-z*2),t[0]=n.length,t[1]=l);let u=l,d;t[2]!==o||t[3]!==c?(d=e=>R-z-(e-o)/c*(R-z*2),t[2]=o,t[3]=c,t[4]=d):d=t[4];let f=d,p;if(t[5]!==n||t[6]!==u||t[7]!==f){let e;t[9]!==u||t[10]!==f?(e=(e,t)=>`${u(t)},${f(e)}`,t[9]=u,t[10]=f,t[11]=e):e=t[11],p=n.map(e).join(` `),t[5]=n,t[6]=u,t[7]=f,t[8]=p}else p=t[8];let m=p,h=`${z},${R} ${m} ${L-z},${R}`,g=Math.min(i,n.length-1),y;t[12]===o?y=t[13]:(y=Math.round(o),t[12]=o,t[13]=y);let b;t[14]===s?b=t[15]:(b=Math.round(s),t[14]=s,t[15]=b);let x=`kd-${y}-${b}-${n.length}`,S,C;t[16]===r?(S=t[17],C=t[18]):(S=(0,v.jsx)(`stop`,{offset:`0%`,stopColor:r,stopOpacity:`0.2`}),C=(0,v.jsx)(`stop`,{offset:`100%`,stopColor:r,stopOpacity:`0`}),t[16]=r,t[17]=S,t[18]=C);let w;t[19]!==x||t[20]!==S||t[21]!==C?(w=(0,v.jsx)(`defs`,{children:(0,v.jsxs)(`linearGradient`,{id:x,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[S,C]})}),t[19]=x,t[20]=S,t[21]=C,t[22]=w):w=t[22];let T=`url(#${x})`,E;t[23]!==h||t[24]!==T?(E=(0,v.jsx)(`polygon`,{points:h,fill:T}),t[23]=h,t[24]=T,t[25]=E):E=t[25];let D;t[26]!==r||t[27]!==m?(D=(0,v.jsx)(`polyline`,{points:m,fill:`none`,stroke:r,strokeWidth:`1.75`,strokeLinejoin:`round`,strokeLinecap:`round`}),t[26]=r,t[27]=m,t[28]=D):D=t[28];let O;if(t[29]!==n||t[30]!==u){let e;t[32]!==n.length||t[33]!==u?(e=(e,t)=>(0,v.jsx)(`rect`,{x:u(t)-L/n.length/2,y:0,width:L/n.length,height:R,fill:`transparent`,onMouseEnter:()=>a(t),style:{cursor:`pointer`}},t),t[32]=n.length,t[33]=u,t[34]=e):e=t[34],O=n.map(e),t[29]=n,t[30]=u,t[31]=O}else O=t[31];let k=u(g),A=f(n[g]),j;t[35]!==r||t[36]!==k||t[37]!==A?(j=(0,v.jsx)(`circle`,{cx:k,cy:A,r:`2.6`,fill:r,stroke:`var(--surface-elevated)`,strokeWidth:`1.4`}),t[35]=r,t[36]=k,t[37]=A,t[38]=j):j=t[38];let M;return t[39]!==E||t[40]!==D||t[41]!==O||t[42]!==j||t[43]!==w?(M=(0,v.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 ${L} ${R}`,className:`kd-spark`,preserveAspectRatio:`none`,children:[w,E,D,O,j]}),t[39]=E,t[40]=D,t[41]=O,t[42]=j,t[43]=w,t[44]=M):M=t[44],M}function ue({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,tiles:r,caption:o,footer:s,delay:c}){let l=i[t]||i.chart;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(c||0)+`ms`},children:[e&&(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`kd-grid`,children:r.map((e,t)=>{let n=e.deltaDir||`up`,r=ce(n),a=e.spark?.filter(e=>Number.isFinite(e))??[];return(0,v.jsxs)(`div`,{className:`kd-tile`,children:[(0,v.jsx)(`div`,{className:`kd-tile-label`,children:e.label}),(0,v.jsxs)(`div`,{className:`kd-tile-val tab-num`,children:[e.value,e.unit&&(0,v.jsx)(`span`,{className:`kd-tile-unit`,children:e.unit})]}),e.delta&&(0,v.jsxs)(`div`,{className:`kd-tile-delta`,style:{color:r},children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:12,height:12,transform:n===`down`?`rotate(180deg)`:`none`}}),(0,v.jsx)(`span`,{className:`kd-tile-delta-t`,children:e.delta})]}),a.length>1&&(0,v.jsx)(`div`,{className:`kd-tile-spark`,children:(0,v.jsx)(le,{spark:a,color:r})}),e.conf&&(0,v.jsx)(`div`,{className:`kd-tile-conf faint`,children:e.conf})]},t)})}),o&&(0,v.jsx)(`div`,{className:`kd-caption faint`,children:o}),s&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}function de(e){if(!Number.isFinite(e))return`—`;let t=e*100,n=Math.abs(t),r=n===0?0:n<1?2:+(n<10);return`${t.toFixed(r)}%`}function fe(e){return Number.isFinite(e)?Math.round(e).toLocaleString():`—`}function B(e){return`${e>=0?`+`:``}${e.toFixed(1)}%`}function pe(e){return e<.001?`p < .001`:`p = ${e.toFixed(3).replace(/^0\./,`.`)}`}function me(e,t,n){let r=Math.min(e,t),i=Math.max(e,t);if(!Number.isFinite(r)||!Number.isFinite(i))return null;let a=[r,i,0,...n!==null&&Number.isFinite(n)?[n]:[]],o=Math.min(...a),s=Math.max(...a),c=Math.max((s-o)*.14,.5),l=o-c,u=s+c-l||1,d=e=>(e-l)/u*100;return{loPct:d(r),hiPct:d(i),zeroPct:d(0),pointPct:n!==null&&Number.isFinite(n)?d(n):null}}function he({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,control:r,variant:o,pValue:s,confidenceInterval:c,significant:l,footer:u,delay:d}){let f=i[t]||i.chart,[p,h]=(0,_.useState)(null),g=r.conversionRate>0?(o.conversionRate-r.conversionRate)/r.conversionRate*100:NaN,y=Number.isFinite(g),b=m(y?g:0,{delay:(d||0)+260,format:B}),x=y?g>0?`var(--insight)`:g<0?`var(--danger)`:`var(--text-muted)`:`var(--text-muted)`,S=typeof l==`boolean`,C=typeof s==`number`&&Number.isFinite(s),w=S?l:C?s<.05:null,T=S||C,E=c&&c.length===2?me(c[0],c[1],y?g:null):null;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(d||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),T&&(0,v.jsx)(`div`,{className:`abt-head`,children:(0,v.jsxs)(`span`,{className:`abt-badge m-scale-in ${w?`on`:``}`,children:[w&&(0,v.jsx)(i.check,{className:`ic abt-badge-ic`}),w?`Significant`:`Not significant`,C&&(0,v.jsx)(`span`,{className:`abt-badge-p`,children:pe(s)})]})}),(0,v.jsxs)(`div`,{className:`abt-row`,children:[(0,v.jsxs)(`div`,{className:`abt-side m-fade-rise m-stagger-item ${p===`control`?`on`:``}`,style:{"--i":0},onMouseEnter:()=>h(`control`),onMouseLeave:()=>h(null),children:[(0,v.jsx)(`div`,{className:`abt-name`,children:r.name}),(0,v.jsx)(`div`,{className:`abt-val tab-num`,children:de(r.conversionRate)}),(0,v.jsxs)(`div`,{className:`abt-n faint`,children:[`n = `,fe(r.n)]})]}),(0,v.jsx)(`div`,{className:`abt-connector`,children:(0,v.jsx)(`span`,{className:`abt-arrow`,children:`→`})}),(0,v.jsxs)(`div`,{className:`abt-side m-fade-rise m-stagger-item ${p===`variant`?`on`:``}`,style:{"--i":1},onMouseEnter:()=>h(`variant`),onMouseLeave:()=>h(null),children:[(0,v.jsx)(`div`,{className:`abt-name`,children:o.name}),(0,v.jsx)(`div`,{className:`abt-val tab-num`,style:{color:x},children:de(o.conversionRate)}),(0,v.jsxs)(`div`,{className:`abt-n faint`,children:[`n = `,fe(o.n)]})]})]}),(0,v.jsxs)(`div`,{className:`abt-lift m-fade-rise m-stagger-item`,style:{"--i":2},children:[(0,v.jsx)(`span`,{className:`abt-lift-v tab-num`,style:{color:x},"data-mark":`underline`,children:y?b:`—`}),(0,v.jsx)(`span`,{className:`abt-lift-l faint`,children:`relative lift`})]}),E&&c&&(0,v.jsxs)(`div`,{className:`abt-ci m-fade-rise m-stagger-item`,style:{"--i":3},children:[(0,v.jsx)(`span`,{className:`abt-ci-lbl faint`,children:`95% confidence interval`}),(0,v.jsxs)(`div`,{className:`abt-ci-track`,children:[(0,v.jsx)(`span`,{className:`abt-ci-band`,style:{left:`${E.loPct}%`,width:`${Math.max(E.hiPct-E.loPct,1.5)}%`}}),(0,v.jsx)(`span`,{className:`abt-ci-zero`,style:{left:`${E.zeroPct}%`},title:`no effect`}),E.pointPct!==null&&(0,v.jsx)(`span`,{className:`abt-ci-point`,style:{left:`${E.pointPct}%`}})]}),(0,v.jsxs)(`div`,{className:`abt-ci-labels`,children:[(0,v.jsx)(`span`,{className:`tab-num`,children:B(c[0])}),(0,v.jsx)(`span`,{className:`tab-num`,children:B(c[1])})]})]}),u&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}var ge=320,_e=176,V={top:14,right:14,bottom:32,left:42},ve=[0,.25,.5,.75,1];function ye(e){let t=e<0?-1:1,n=Math.abs(e),r=1/(1+.3275911*n);return t*(1-((((1.061405429*r-1.453152027)*r+1.421413741)*r-.284496736)*r+.254829592)*r*Math.exp(-n*n))}function be(e){return .5*(1+ye(e/Math.SQRT2))}function xe(e){if(!(e>0)||!(e<1))return NaN;let t=[-39.69683028665376,220.9460984245205,-275.9285104469687,138.357751867269,-30.66479806614716,2.506628277459239],n=[-54.47609879822406,161.5858368580409,-155.6989798598866,66.80131188771972,-13.28068155288572],r=[-.007784894002430293,-.3223964580411365,-2.400758277161838,-2.549732539343734,4.374664141464968,2.938163982698783],i=[.007784695709041462,.3224671290700398,2.445134137142996,3.754408661907416];if(e<.02425){let t=Math.sqrt(-2*Math.log(e));return(((((r[0]*t+r[1])*t+r[2])*t+r[3])*t+r[4])*t+r[5])/((((i[0]*t+i[1])*t+i[2])*t+i[3])*t+1)}if(e<=.97575){let r=e-.5,i=r*r;return(((((t[0]*i+t[1])*i+t[2])*i+t[3])*i+t[4])*i+t[5])*r/(((((n[0]*i+n[1])*i+n[2])*i+n[3])*i+n[4])*i+1)}let a=Math.sqrt(-2*Math.log(1-e));return-(((((r[0]*a+r[1])*a+r[2])*a+r[3])*a+r[4])*a+r[5])/((((i[0]*a+i[1])*a+i[2])*a+i[3])*a+1)}function Se(e){return`α = ${e.toFixed(e<.01?3:2).replace(/^0\./,`.`)}`}function Ce({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,effectSize:r,alpha:s,power:h,requiredN:g,curve:y,footer:b,delay:x}){let S=i[t]||i.chart,C=(0,_.useRef)(null),w=(0,_.useMemo)(()=>{let e=Math.abs(r);if(!Number.isFinite(e)||e<=0)return null;let t=typeof s==`number`&&Number.isFinite(s)&&s>0&&s<1?s:.05,n=typeof g==`number`&&Number.isFinite(g)&&g>0?Math.max(1,Math.round(g)):null,i=typeof h==`number`&&Number.isFinite(h)&&h>0&&h<1?h:null,a=xe(1-t/2);if(n!==null){let r=i??be(Math.sqrt(n*e*e/2)-a);return{n,p:Math.min(1,Math.max(0,r)),alpha:t,d:e,mode:`evaluate`,derived:i===null}}let o=i??.8,c=xe(o);return{n:Math.ceil(2*(a+c)**2/(e*e)),p:o,alpha:t,d:e,mode:`design`,derived:!0}},[r,s,h,g]),T=m(w?.n??0,{delay:(x||0)+140,decimals:0}),E=(0,_.useMemo)(()=>{if(!w||!y||y.length===0)return null;let e=y.filter(e=>Number.isFinite(e?.n)&&e.n>0&&Number.isFinite(e?.power)).map(e=>({n:e.n,power:Math.min(1,Math.max(0,e.power))})).sort((e,t)=>e.n-t.n);if(e.length===0)return null;let t=f(e.map(e=>e.n).concat([w.n]))?.[1]??w.n,[n,r]=u(0,Math.max(t,1)),i=ge-V.left-V.right,a=_e-V.top-V.bottom,o=l([n,r],[V.left,V.left+i]),s=l([0,1],[V.top+a,V.top]);return{sx:o,sy:s,path:e.length>1?`M${e.map(e=>`${o(e.n)},${s(e.power)}`).join(`L`)}`:``,innerW:i,innerH:a,nTicks:c(n,r,d(r-n,4))}},[y,w]);if(p(C,{delay:(x||0)+220}),!w)return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(x||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(S,{className:`ic`,style:{color:n}}),` `,e||`Power analysis`]}),(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide a non-zero effect size.`})]});let D=o(w.p,{decimals:+(w.p>=.995||w.p<.1)});return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(x||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(S,{className:`ic`,style:{color:n}}),` `,e||`Power analysis`]}),(0,v.jsxs)(`div`,{className:`ps-head`,children:[(0,v.jsxs)(`div`,{className:`ps-n-row`,children:[(0,v.jsx)(`span`,{className:`ps-n tab-num`,children:T}),(0,v.jsx)(`span`,{className:`ps-n-suffix`,children:`per group`})]}),(0,v.jsx)(`div`,{className:`ps-power-line`,children:w.mode===`evaluate`&&w.derived?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{className:`ps-power-arrow`,children:`→`}),` `,(0,v.jsx)(`strong`,{children:D}),` power`,` `,(0,v.jsx)(`span`,{className:`faint`,children:`(achieved at this n)`})]}):(0,v.jsxs)(v.Fragment,{children:[`for `,(0,v.jsx)(`strong`,{children:D}),` power`]})})]}),(0,v.jsxs)(`div`,{className:`ps-stats`,children:[(0,v.jsxs)(`span`,{className:`ps-stat`,children:[(0,v.jsx)(`span`,{className:`ps-stat-k`,children:`effect size`}),(0,v.jsxs)(`span`,{className:`ps-stat-v tab-num`,children:[`d = `,r.toFixed(2)]})]}),(0,v.jsxs)(`span`,{className:`ps-stat`,children:[(0,v.jsx)(`span`,{className:`ps-stat-k`,children:`significance`}),(0,v.jsx)(`span`,{className:`ps-stat-v tab-num`,children:Se(w.alpha)})]})]}),E&&(0,v.jsx)(`div`,{className:`ps-curve-wrap`,children:(0,v.jsxs)(`svg`,{viewBox:`0 0 ${ge} ${_e}`,className:`ps-svg`,role:`img`,"aria-label":`Power vs. sample size, marked at n=${w.n}`,children:[ve.map(e=>(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`line`,{className:`ps-grid`,x1:V.left,y1:E.sy(e),x2:V.left+E.innerW,y2:E.sy(e)}),(0,v.jsxs)(`text`,{className:`ps-tick`,x:V.left-6,y:E.sy(e)+3.5,textAnchor:`end`,children:[Math.round(e*100),`%`]})]},`g${e}`)),(0,v.jsx)(`line`,{className:`ps-axis`,x1:V.left,y1:V.top+E.innerH,x2:V.left+E.innerW,y2:V.top+E.innerH}),(0,v.jsx)(`line`,{className:`ps-axis`,x1:V.left,y1:V.top,x2:V.left,y2:V.top+E.innerH}),E.nTicks.map(e=>(0,v.jsx)(`text`,{className:`ps-tick`,x:E.sx(e),y:V.top+E.innerH+15,textAnchor:`middle`,children:e.toLocaleString()},`xt${e}`)),E.path&&(0,v.jsx)(`path`,{ref:C,className:`ps-line`,d:E.path,fill:`none`}),(0,v.jsx)(`line`,{className:`ps-mark-guide`,x1:E.sx(w.n),y1:E.sy(w.p),x2:E.sx(w.n),y2:V.top+E.innerH}),(0,v.jsx)(`circle`,{className:`ps-mark`,cx:E.sx(w.n),cy:E.sy(w.p),r:4.5,"data-mark":`point`})]})}),b&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(b)})]})}var we={critical:`var(--danger)`,low:`var(--warning)`,healthy:`var(--insight)`},Te={critical:`Reorder now`,low:`Below reorder point`,healthy:`Healthy`};function H(e){return Math.max(0,Math.min(100,e))}function Ee(e,t){if(!e||typeof e!=`object`)return null;let n=typeof e.sku==`string`?e.sku.trim():``,r=typeof e.label==`string`&&e.label.trim()?e.label.trim():n;if(!r)return null;let i=Number.isFinite(e.level)?Math.max(0,e.level):0,a=Number.isFinite(e.reorderPoint)?Math.max(0,e.reorderPoint):0,o=Number.isFinite(e.safetyStock)?Math.max(0,e.safetyStock):0,s=Math.max(Number.isFinite(e.max)&&e.max>0?e.max:0,i,a,o,1),c=Math.min(a,s),l=Math.min(o,c),u=Number.isFinite(e.leadTimeDays)?Math.max(0,e.leadTimeDays):null,d=i<=l?`critical`:i<=c?`low`:`healthy`;return{key:n||`row-${t}`,sku:n,label:r,level:i,max:s,safetyStock:l,reorderPoint:c,leadTimeDays:u,status:d,levelPct:H(i/s*100),safetyPct:H(l/s*100),reorderPct:H(c/s*100)}}function De({title:e,icon:t=`cart`,iconColor:n=`var(--presence)`,items:r,footer:o,delay:s}){let c=i[t]||i.cart,l=(Array.isArray(r)?r:[]).map(Ee).filter(e=>e!==null);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(s||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),l.length===0&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide items with a level, a reorder point, and a max.`}),l.length>0&&(0,v.jsx)(`div`,{className:`ir-list`,children:l.map((e,t)=>(0,v.jsxs)(`div`,{className:`ir-row m-fade-rise m-stagger-item`,style:{"--i":t},children:[(0,v.jsxs)(`div`,{className:`ir-head`,children:[(0,v.jsxs)(`div`,{className:`ir-id`,children:[e.sku&&(0,v.jsx)(`span`,{className:`ir-sku`,children:e.sku}),(0,v.jsx)(`span`,{className:`ir-label`,children:e.label})]}),(0,v.jsx)(`span`,{className:`ir-status`,style:{color:we[e.status]},"data-mark":e.status===`critical`?`circle`:void 0,children:Te[e.status]})]}),(0,v.jsxs)(`div`,{className:`ir-track`,children:[(0,v.jsxs)(`div`,{className:`ir-track-inner`,children:[(0,v.jsx)(`span`,{className:`ir-zone ir-zone--danger`,style:{width:`${e.safetyPct}%`}}),(0,v.jsx)(`span`,{className:`ir-zone ir-zone--warn`,style:{left:`${e.safetyPct}%`,width:`${Math.max(0,e.reorderPct-e.safetyPct)}%`}}),(0,v.jsx)(`span`,{className:`ir-zone ir-zone--good`,style:{left:`${e.reorderPct}%`,width:`${Math.max(0,100-e.reorderPct)}%`}}),(0,v.jsx)(`span`,{className:`ir-fill`,style:{width:`${e.levelPct}%`,background:we[e.status]}})]}),(0,v.jsx)(`span`,{className:`ir-tick`,style:{left:`${e.reorderPct}%`},title:`reorder point`})]}),(0,v.jsxs)(`div`,{className:`ir-meta faint tab-num`,children:[e.level.toLocaleString(),` of `,e.max.toLocaleString(),` · reorder at`,` `,e.reorderPoint.toLocaleString(),e.leadTimeDays===null?``:` · ${e.leadTimeDays}d lead time`]})]},e.key))}),o&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}function Oe(e){let t=0;for(let n of e)n!==null&&(t+=n);return t}function ke({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,game:r,players:o,rounds:s,footer:c,delay:l}){let u=i[t]||i.table,d=Array.isArray(o)?o:[],f=Number.isFinite(s)&&s>0?Math.round(s):Math.max(0,...d.map(e=>Array.isArray(e?.roundScores)?e.roundScores.length:0)),p=d.map((e,t)=>{let n=typeof e?.name==`string`&&e.name.trim()?e.name.trim():`Player ${t+1}`,r=Array.isArray(e?.roundScores)?e.roundScores:[],i=Array.from({length:f},(e,t)=>Number.isFinite(r[t])?r[t]:null),a=Number.isFinite(e?.total)?e.total:Oe(i);return{key:`${n}-${t}`,name:n,scores:i,total:a}}),m=p.length>0,h=m?Math.max(...p.map(e=>e.total)):0,g=new Set(m?p.filter(e=>e.total===h).map(e=>e.key):[]),_=g.size===1?p.find(e=>g.has(e.key)):null,y=_&&p.length>1?_.total-Math.max(...p.filter(e=>e.key!==_.key).map(e=>e.total)):null,b=[];b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-head bgs-corner`,"aria-hidden":`true`},`corner`));for(let e of p)b.push((0,v.jsxs)(`div`,{className:`bgs-cell bgs-head bgs-player`,children:[g.has(e.key)&&(0,v.jsx)(`span`,{className:`bgs-crown`,"aria-label":`leading`,title:`Leading`,children:`●`}),(0,v.jsx)(`span`,{className:`bgs-name`,children:e.name})]},`h-${e.key}`));for(let e=0;e<f;e++){b.push((0,v.jsxs)(`div`,{className:`bgs-cell bgs-rowlabel m-fade-rise m-stagger-item`,style:{"--i":e},children:[`R`,e+1]},`rl-${e}`));for(let t of p)b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-score tab-num m-fade-rise m-stagger-item`,style:{"--i":e},children:t.scores[e]===null?`–`:t.scores[e].toLocaleString()},`s-${t.key}-${e}`))}b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-rowlabel bgs-totallabel`,children:`Total`},`tl`));for(let e of p)b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-total tab-num ${g.has(e.key)?`lead`:``}`,"data-mark":g.has(e.key)?`underline`:void 0,children:e.total.toLocaleString()},`t-${e.key}`));return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(l||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(u,{className:`ic`,style:{color:n}}),` `,e,r&&(0,v.jsx)(`span`,{className:`bgs-game faint`,children:r})]}),!m&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide players with round scores.`}),m&&(0,v.jsx)(`div`,{className:`bgs-scroll`,children:(0,v.jsx)(`div`,{className:`bgs-grid`,style:{"--bgs-cols":p.length,minWidth:`${64+p.length*84}px`},children:b})}),_&&y!==null&&(0,v.jsxs)(`p`,{className:`bgs-lead-note faint`,children:[_.name,` leads`,y>0?` by ${y.toLocaleString()}`:``,`.`]}),c&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(c)})]})}var Ae=[`none`,`low`,`medium`,`high`,`critical`];function je(e){switch(e){case`critical`:case`high`:return`var(--danger)`;case`medium`:return`var(--warning)`;case`low`:return`var(--insight)`;default:return`var(--text-muted)`}}function Me(e){return e>=9?`critical`:e>=7?`high`:e>=4?`medium`:e>0?`low`:`none`}var U=132,Ne=U/2-11;function Pe({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,baseScore:r,severity:o,vector:s,cve:c,footer:l,delay:u}){let d=i[t]||i.shield,f=typeof r==`number`&&Number.isFinite(r),p=f?Math.max(0,Math.min(10,r)):0,h=Ae.includes(o)?o:Me(p),g=je(h),_=p/10,y=m(f?p:0,{delay:(u||0)+120,decimals:1}),b=(Array.isArray(s)?s:[]).filter(e=>!!e&&typeof e.label==`string`&&e.label.trim()!==``&&typeof e.value==`string`&&e.value.trim()!==``).slice(0,12),x=typeof c==`string`&&c.trim()?c.trim():null;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(u||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(d,{className:`ic`,style:{color:n}}),` `,e,x&&(0,v.jsx)(`span`,{className:`cvss-cve`,children:x})]}),(0,v.jsxs)(`div`,{className:`cvss-body`,children:[(0,v.jsxs)(`div`,{className:`gauge-host`,style:{width:U,height:U},children:[(0,v.jsxs)(`svg`,{className:`gauge`,viewBox:`0 0 ${U} ${U}`,width:U,height:U,children:[(0,v.jsx)(`circle`,{cx:U/2,cy:U/2,r:Ne,fill:`none`,stroke:`var(--surface-glass-strong)`,strokeWidth:`10`}),f&&(0,v.jsx)(`circle`,{className:`gauge-arc`,cx:U/2,cy:U/2,r:Ne,fill:`none`,stroke:g,strokeWidth:`10`,strokeLinecap:`round`,pathLength:1,strokeDasharray:1,strokeDashoffset:1-_,transform:`rotate(-90 ${U/2} ${U/2})`})]}),(0,v.jsxs)(`div`,{className:`gauge-center`,children:[(0,v.jsx)(`div`,{className:`gauge-num tab-num`,"data-mark":f?`underline`:void 0,style:{color:g},children:f?y:`—`}),(0,v.jsx)(`div`,{className:`gauge-band`,style:{color:g},children:h})]})]}),(0,v.jsx)(`div`,{className:`cvss-side`,children:b.length>0?(0,v.jsx)(`div`,{className:`cvss-chips`,children:b.map((e,t)=>(0,v.jsxs)(`span`,{className:`cvss-chip m-fade-rise m-stagger-item`,style:{"--i":t},children:[(0,v.jsx)(`span`,{className:`cvss-chip-k`,children:e.label}),(0,v.jsx)(`span`,{className:`cvss-chip-v`,children:e.value})]},t))}):(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:f?`No vector components supplied.`:`Provide a base score 0–10.`})})]}),l&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(l)})]})}var Fe=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-soft)`,`var(--danger)`],Ie=320,W=90,Le=14,Re=12,ze=12,Be=30,Ve=W-10,He=1/5.4;function Ue(e){let t=Math.max(3,Math.floor(Ve*He));return e.length>t?e.slice(0,t-1).trimEnd()+`…`:e}function We(e,t,n,r,i){if(!e)return null;let a=typeof e.label==`string`&&e.label.trim()?e.label.trim():`Series ${t+1}`,o=(Array.isArray(e.curve)?e.curve:[]).filter(e=>Number.isFinite(e)&&e>=0);if(o.length<2)return null;let s=Math.max(...o)||1,c=o.length,l=e=>W+e/(c-1)*i,u=e=>n-e/s*r,d=o.map((e,t)=>`${l(t).toFixed(2)},${u(e).toFixed(2)}`),f=`M${d.join(`L`)}`,p=`M${l(0).toFixed(2)},${n} L${d.join(`L`)} L${l(c-1).toFixed(2)},${n} Z`,m=e.color||Fe[t%Fe.length];return{key:`${a}-${t}`,label:a,color:m,d:p,strokeD:f,baselineY:n}}function Ge(e){let t=(0,I.c)(5),{d:n,color:r,delay:i}=e,a=(0,_.useRef)(null),o;t[0]===i?o=t[1]:(o={delay:i},t[0]=i,t[1]=o),p(a,o);let s;return t[2]!==r||t[3]!==n?(s=(0,v.jsx)(`path`,{ref:a,d:n,fill:`none`,stroke:r,className:`rp-stroke`}),t[2]=r,t[3]=n,t[4]=s):s=t[4],s}function Ke({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,categories:r,overlap:o,footer:s,delay:c}){let l=i[t]||i.chart,u=Be*(1+(Number.isFinite(o)?Math.max(0,Math.min(1,o)):.55)*1.8),d=Ie-W-Le,f=Array.isArray(r)?r:[],p=[];f.forEach((e,t)=>{let n=We(e,t,Re+u+p.length*Be,u,d);n&&p.push(n)});let m=p.length>0?Re+u+(p.length-1)*Be+ze:0;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(c||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),p.length===0&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide at least one category with two or more curve values.`}),p.length>0&&(0,v.jsx)(`svg`,{viewBox:`0 0 ${Ie} ${m}`,className:`rp-svg`,role:`img`,"aria-label":e,children:p.map((e,t)=>(0,v.jsxs)(`g`,{className:`m-fade-rise m-stagger-item`,style:{"--i":t},children:[(0,v.jsx)(`line`,{x1:W,y1:e.baselineY,x2:Ie-Le,y2:e.baselineY,className:`rp-baseline`}),(0,v.jsx)(`path`,{d:e.d,fill:e.color,className:`rp-area`}),(0,v.jsx)(Ge,{d:e.strokeD,color:e.color,delay:(c||0)+t*60}),(0,v.jsxs)(`text`,{x:W-8,y:e.baselineY+3,className:`rp-label`,textAnchor:`end`,children:[Ue(e.label)!==e.label&&(0,v.jsx)(`title`,{children:e.label}),Ue(e.label)]})]},e.key))}),s&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}var G=320,K=200,q={top:14,right:14,bottom:30,left:42},qe=[0,.25,.5,.75,1];function Je(e){let t=e.length,n=[],r=0,i=0;for(;r<t;){let a=e[r],o=r;for(;o<t&&e[o]===a;)o++;n.push({x:a,y:i/t}),i+=o-r,n.push({x:a,y:i/t}),r=o}return n}function Ye(e){let t=e.length,n=Math.floor(t/2);return t%2==0?(e[n-1]+e[n])/2:e[n]}function Xe({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,values:r,unit:o,color:m=`var(--presence)`,footer:h,delay:g}){let y=i[t]||i.chart,b=(0,_.useRef)(null),x=(0,_.useMemo)(()=>{let e=(Array.isArray(r)?r:[]).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);if(e.length===0)return null;let t=f(e);if(!t)return null;let[n,i]=u(t[0],t[1]),a=l([n,i],[q.left,G-q.right]),o=l([0,1],[K-q.bottom,q.top]),s=Je(e),p=[`M${a(n).toFixed(2)},${o(0).toFixed(2)}`,...s.map(e=>`L${a(e.x).toFixed(2)},${o(e.y).toFixed(2)}`),`L${a(i).toFixed(2)},${o(1).toFixed(2)}`].join(` `),m=c(n,i,d(i-n,5)),h=Ye(e);return{n:e.length,d:p,sx:a,sy:o,xTicks:m,med:h}},[r]);return p(b,{delay:(g||0)+160}),(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(g||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(y,{className:`ic`,style:{color:n}}),` `,e]}),!x&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide at least one numeric value.`}),x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`svg`,{viewBox:`0 0 ${G} ${K}`,className:`ecdf-svg`,role:`img`,"aria-label":e,children:[qe.map(e=>(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`line`,{className:`ecdf-grid`,x1:q.left,y1:x.sy(e),x2:G-q.right,y2:x.sy(e)}),(0,v.jsx)(`text`,{className:`ecdf-tick`,x:q.left-6,y:x.sy(e)+3.5,textAnchor:`end`,children:e.toFixed(2)})]},`g${e}`)),(0,v.jsx)(`line`,{className:`ecdf-axis`,x1:q.left,y1:K-q.bottom,x2:G-q.right,y2:K-q.bottom}),(0,v.jsx)(`line`,{className:`ecdf-axis`,x1:q.left,y1:q.top,x2:q.left,y2:K-q.bottom}),x.xTicks.map(e=>(0,v.jsx)(`text`,{className:`ecdf-tick`,x:x.sx(e),y:K-q.bottom+15,textAnchor:`middle`,children:s(e,{unit:o||void 0})},`xt${e}`)),(0,v.jsx)(`line`,{className:`ecdf-mark-guide`,x1:x.sx(x.med),y1:K-q.bottom,x2:x.sx(x.med),y2:q.top}),(0,v.jsx)(`path`,{ref:b,className:`ecdf-line`,d:x.d,fill:`none`,stroke:m})]}),(0,v.jsxs)(`p`,{className:`ecdf-caption faint tab-num`,children:[`n = `,x.n.toLocaleString(),` · median`,` `,s(x.med,{unit:o||void 0})]})]}),h&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(h)})]})}var J=480,Ze=116,Qe=46,Y=122,X=J-Qe-10,$e=46,Z=1.959964,et={OR:`Odds ratio`,RR:`Risk ratio`,HR:`Hazard ratio`,MD:`Mean difference`,SMD:`Std. mean difference`};function Q(e){return typeof e==`number`&&Number.isFinite(e)}function $(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e3?s(e,{compact:!0}):t>0&&t<.1?s(e,{decimals:3}):s(e,{decimals:t>=100?0:t>=10?1:2})}function tt(e,t,n,r){if(!e||typeof e!=`object`||!Q(e.effect)||!Q(e.ciLow)||!Q(e.ciHigh))return null;let i=Math.min(e.ciLow,e.ciHigh),a=Math.max(e.ciLow,e.ciHigh),o=Math.min(a,Math.max(i,e.effect)),s=!1;n&&(i<=0&&(i=r,s=!0),a<=0&&(a=r,s=!0),o<=0&&(o=r,s=!0),i>a&&([i,a]=[a,i]),o=Math.min(a,Math.max(i,o)));let c=n?Math.log(o):o,l=n?(Math.log(a)-Math.log(i))/(2*Z):(a-i)/(2*Z),u=!s&&Number.isFinite(l)&&l>0?1/(l*l):null,d=typeof e.label==`string`&&e.label.trim()?e.label.trim():`Study ${t+1}`,f=`${d}${Q(e.year)?` ${Math.trunc(e.year)}`:``}${s?` †`:``}`;return{key:`${d}-${t}`,label:f,effect:o,lo:i,hi:a,givenWeight:Q(e.weight)&&e.weight>=0?Math.min(100,e.weight):null,clamped:s,ivWeight:u,theta:c}}function nt(e,t){let n=Math.ceil(e/Math.LN2-1e-9),r=Math.floor(t/Math.LN2+1e-9);if(r<n)return[1];let i=Math.max(1,Math.ceil((r-n+1)/7)),a=[];for(let e=n;e<=r;e++)(e%i+i)%i===0&&a.push(2**e);return a.length?a:[1]}function rt(e){let t=(0,I.c)(14),{label:n,cy:r,maxLines:i,fontSize:a,bold:o}=e,s,c,l,u;if(t[0]!==o||t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==i){let e=g(n,{maxWidth:Ze-8,fontSize:a,minFontSize:7,maxLines:i,lineHeight:1.12,bold:o}),d=e.lines.slice(0,i),f=r-(d.length-1)*e.lineHeightPx/2;s=o?`fpl-lbl fpl-lbl--pooled`:`fpl-lbl`,c=e.fontSize,l=`start`,u=d.map((t,n)=>(0,v.jsx)(`tspan`,{x:2,y:f+n*e.lineHeightPx,dominantBaseline:`central`,children:t},n)),t[0]=o,t[1]=r,t[2]=a,t[3]=n,t[4]=i,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else s=t[5],c=t[6],l=t[7],u=t[8];let d;return t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,v.jsx)(`text`,{className:s,fontSize:c,textAnchor:l,children:u}),t[9]=s,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function it({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,studies:r,measure:o=`OR`,pooled:f,heterogeneity:p,favorsLeft:m,favorsRight:h,footer:g,delay:y}){let b=i[t]||i.chart,x=(0,_.useMemo)(()=>{let e=et[o]?o:`OR`,t=e===`OR`||e===`RR`||e===`HR`,n=+!!t,i=Array.isArray(r)?r:[],a=1/0;for(let e of i)if(!(!e||typeof e!=`object`))for(let t of[e.effect,e.ciLow,e.ciHigh])Q(t)&&t>0&&t<a&&(a=t);if(f&&typeof f==`object`)for(let e of[f.effect,f.ciLow,f.ciHigh])Q(e)&&e>0&&e<a&&(a=e);let s=a===1/0?.01:a/10,p=[];if(i.forEach((e,n)=>{let r=tt(e,n,t,s);r&&p.push(r)}),p.length===0)return null;let m=p.reduce((e,t)=>e+(t.ivWeight??0),0),h=null;if(f&&typeof f==`object`&&Q(f.effect)&&Q(f.ciLow)&&Q(f.ciHigh)){let e=Math.min(f.ciLow,f.ciHigh),n=Math.max(f.ciLow,f.ciHigh);t&&(e=e<=0?s:e,n=n<=0?s:n);let r=Math.min(n,Math.max(e,t&&f.effect<=0?s:f.effect)),i=typeof f.label==`string`&&f.label.trim()?f.label.trim():`Pooled`;h={effect:r,lo:e,hi:n,label:i,computed:!1}}else if(m>0){let e=p.reduce((e,t)=>e+(t.ivWeight??0)*t.theta,0)/m,n=Math.sqrt(1/m),r=e=>t?Math.exp(e):e;h={effect:r(e),lo:r(e-Z*n),hi:r(e+Z*n),label:`Pooled`,computed:!0}}let g=p.map(e=>e.givenWeight===null?e.ivWeight!==null&&m>0?100*e.ivWeight/m:null:e.givenWeight),_=e=>t?Math.log(e):e,v=_(n===0?0:1),y=v,b=e=>{let t=_(e);t<v&&(v=t),t>y&&(y=t)};p.forEach(e=>{b(e.lo),b(e.hi)}),h&&(b(h.lo),b(h.hi));let x;if(t){y-v<1e-9&&(v-=Math.LN2,y+=Math.LN2);let e=(y-v)*.06;x=nt(v,y),v-=e,y+=e}else [v,y]=u(v,y),x=c(v,y,d(y-v,5));let S=l([v,y],[Y,X]),C=e=>S(_(e)),w=p.length,T=Math.max(11,Math.min(24,Math.round(320/w))),E=h?Math.max(T,20):0,D=32+w*T+3,O=D+(h?5+E:4),k=O+$e,A=Math.max(0,...g.filter(e=>e!==null)),j=Math.min(13,T-2);return{mKey:e,isRatio:t,nullValue:n,rows:p,weights:g,summary:h,x:C,axisTicks:x,rowH:T,rowsTop:32,sepY:D,axisY:O,H:k,side:e=>e===null||!(A>0)?4.5:4+(j-4)*Math.sqrt(Math.max(0,e)/A),anyClamped:p.some(e=>e.clamped)}},[r,o,f]),S=Math.min(7,x?x.rowH-4:7);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(y||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(b,{className:`ic`,style:{color:n}}),` `,e||`Forest plot`]}),!x&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide at least one study with an effect and its confidence interval.`}),x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`svg`,{viewBox:`0 0 ${J} ${x.H}`,className:`fpl-svg`,role:`img`,"aria-label":e||`Forest plot`,children:[(0,v.jsx)(`text`,{x:2,y:13,className:`fpl-colhead`,textAnchor:`start`,children:`Study`}),(0,v.jsxs)(`text`,{x:546/2,y:13,className:`fpl-colhead`,textAnchor:`middle`,children:[et[x.mKey],x.isRatio?` (log scale)`:``]}),(0,v.jsx)(`text`,{x:J-2,y:13,className:`fpl-colhead`,textAnchor:`end`,children:`Weight`}),(0,v.jsx)(`line`,{className:`fpl-null`,x1:x.x(x.nullValue),y1:26,x2:x.x(x.nullValue),y2:x.axisY}),x.rows.map((e,t)=>{let n=x.rowsTop+t*x.rowH+x.rowH/2,r=x.weights[t],i=x.side(r),a=x.rowH>=22?2:1,o=x.rowH>=18?10.5:x.rowH>=14?9.5:8.5;return(0,v.jsxs)(`g`,{className:e.clamped?`fpl-row fpl-row--clamped m-stagger-item`:`fpl-row m-stagger-item`,style:{"--i":Math.min(t,15)},children:[(0,v.jsx)(`title`,{children:`${e.label}: ${$(e.effect)} (95% CI ${$(e.lo)} to ${$(e.hi)})`+(r===null?``:`, weight ${s(r,{decimals:1})}%`)+(e.clamped?` — clamped to fit the log axis`:``)}),(0,v.jsx)(rt,{label:e.label,cy:n,maxLines:a,fontSize:o}),(0,v.jsx)(`line`,{className:`fpl-ci`,x1:x.x(e.lo),y1:n,x2:x.x(e.hi),y2:n}),(0,v.jsx)(`line`,{className:`fpl-ci`,x1:x.x(e.lo),y1:n-S/2,x2:x.x(e.lo),y2:n+S/2}),(0,v.jsx)(`line`,{className:`fpl-ci`,x1:x.x(e.hi),y1:n-S/2,x2:x.x(e.hi),y2:n+S/2}),(0,v.jsx)(`rect`,{className:`fpl-sq`,x:x.x(e.effect)-i/2,y:n-i/2,width:i,height:i}),(0,v.jsx)(`text`,{x:J-2,y:n,className:`fpl-wt`,textAnchor:`end`,dominantBaseline:`central`,children:r===null?`—`:`${s(r,{decimals:1})}%`})]},e.key)}),x.summary&&(0,v.jsxs)(`g`,{className:`fpl-row m-fade-rise m-stagger-item`,style:{"--i":Math.min(x.rows.length,16)},children:[(0,v.jsx)(`title`,{children:`${x.summary.label}: ${$(x.summary.effect)} (95% CI ${$(x.summary.lo)} to ${$(x.summary.hi)})`+(x.summary.computed?` — fixed-effect inverse-variance pool`:``)}),(0,v.jsx)(`line`,{className:`fpl-sep`,x1:2,y1:x.sepY,x2:J-2,y2:x.sepY}),(()=>{let e=x.sepY+5+Math.max(x.rowH,20)/2,t=Math.min(7,Math.max(5,x.rowH/2-1)),n=x.x(x.summary.lo),r=x.x(x.summary.hi),i=x.x(x.summary.effect);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(rt,{label:x.summary.label,cy:e,maxLines:1,fontSize:10.5,bold:!0}),(0,v.jsx)(`polygon`,{className:`fpl-diamond`,points:`${n},${e} ${i},${e-t} ${r},${e} ${i},${e+t}`}),(0,v.jsx)(`text`,{x:J-2,y:e,className:`fpl-wt fpl-wt--pooled`,textAnchor:`end`,dominantBaseline:`central`,children:`100%`})]})})()]}),(0,v.jsx)(`line`,{className:`fpl-axis`,x1:Y,y1:x.axisY,x2:X,y2:x.axisY}),x.axisTicks.map(e=>(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`line`,{className:`fpl-axis`,x1:x.x(e),y1:x.axisY,x2:x.x(e),y2:x.axisY+4}),(0,v.jsx)(`text`,{className:`fpl-tick`,x:x.x(e),y:x.axisY+15,textAnchor:`middle`,children:Math.abs(e)>=1e3?s(e,{compact:!0}):s(e)})]},`t${e}`)),typeof m==`string`&&m.trim()&&(0,v.jsx)(at,{text:`← ${m.trim()}`,x:Y,anchor:`start`,y:x.axisY+28}),typeof h==`string`&&h.trim()&&(0,v.jsx)(at,{text:`${h.trim()} →`,x:X,anchor:`end`,y:x.axisY+28})]}),(0,v.jsxs)(`p`,{className:`fpl-caption faint tab-num`,children:[x.summary?`${x.summary.label} ${x.mKey} ${$(x.summary.effect)} (95% CI ${$(x.summary.lo)}–${$(x.summary.hi)})`+(x.summary.computed?` · fixed-effect, inverse-variance`:``):`${x.rows.length} ${x.rows.length===1?`study`:`studies`}`,typeof p==`string`&&p.trim()?` · ${p.trim()}`:``]}),x.anyClamped&&(0,v.jsx)(`p`,{className:`fpl-caption faint`,children:`† interval clamped — a log axis cannot place values ≤ 0.`})]}),g&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(g)})]})}function at(e){let t=(0,I.c)(13),{text:n,x:r,anchor:i,y:a}=e,o,s,c,l;if(t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==a){let e=g(n,{maxWidth:(X-Y)/2-8,fontSize:9,minFontSize:7,maxLines:2,lineHeight:1.15});o=`fpl-favors`,s=e.fontSize,c=i,l=e.lines.slice(0,2).map((t,n)=>(0,v.jsx)(`tspan`,{x:r,y:a+n*e.lineHeightPx,children:t},n)),t[0]=i,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else o=t[4],s=t[5],c=t[6],l=t[7];let u;return t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,v.jsx)(`text`,{className:o,fontSize:s,textAnchor:c,children:l}),t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}var ot=e({statsRegistry:()=>st}),st={sparkstat:h(y),counter:h(b),herostat:h(x),trendtile:h(T),scorebadge:h(E),percentilebar:h(D),statpair:h(O),scorecard:h(k),deltacascade:h(A),bulletkpi:h(j),confusionmatrix:h(se),kpidashboard:h(ue),abtestresult:h(he),powersample:h(Ce),inventoryreorder:h(De),boardgamescore:h(ke),cvssscorecard:h(Pe),ridgeplot:h(Ke),ecdf:h(Xe),forestplot:h(it)};export{st as n,ot as t};
|
|
1
|
+
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{ht as r}from"./index-DOpl5xzv.js";import{n as i}from"./icons-CHVz6kv_.js";import{t as a}from"./richText-BkxJhl9N.js";import{n as o,r as s}from"./format-DlZTyeMy.js";import{a as c,i as l,n as u,r as d,t as f}from"./scale-Bcgfo6Hp.js";import{n as p,t as m}from"./motion-DKmdzFji.js";import{t as h}from"./registry-types-DMuK0vJ6.js";import{n as g}from"./fitText-CDFmCQzl.js";var _=t(),v=n();function y({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,value:r,unit:o,delta:s,deltaDir:c=`up`,color:l=`var(--presence)`,points:u,footer:d,delay:f}){let p=i[t]||i.chart,[m,h]=(0,_.useState)(Math.max(0,u.length-1)),g=u.map(e=>e.v),y=g.length?Math.min(...g):0,b=(g.length?Math.max(...g):0)-y||1,x=e=>4+e/Math.max(1,u.length-1)*212,S=e=>52-(e-y)/b*48,C=u.map((e,t)=>`${x(t)},${S(e.v)}`).join(` `),w=`4,56 ${C} 216,56`,T=u[Math.min(m,u.length-1)];return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(f||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`insight-stat`,style:{marginBottom:4},children:[(0,v.jsx)(`span`,{className:`big tab-num`,"data-mark":`underline`,style:{color:l},children:r}),s&&(0,v.jsxs)(`span`,{className:`delta ${c}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:13,height:13,transform:c===`down`?`rotate(180deg)`:`none`}}),s]})]}),o&&(0,v.jsx)(`div`,{className:`ss-unit faint`,children:o}),(0,v.jsxs)(`div`,{className:`ss-spark`,style:{marginTop:12},children:[(0,v.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 220 56`,className:`ss-svg`,preserveAspectRatio:`none`,children:[(0,v.jsx)(`defs`,{children:(0,v.jsxs)(`linearGradient`,{id:`ssfill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,v.jsx)(`stop`,{offset:`0%`,stopColor:l,stopOpacity:`0.22`}),(0,v.jsx)(`stop`,{offset:`100%`,stopColor:l,stopOpacity:`0`})]})}),(0,v.jsx)(`polygon`,{points:w,fill:`url(#ssfill)`}),(0,v.jsx)(`polyline`,{points:C,fill:`none`,stroke:l,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),u.map((e,t)=>(0,v.jsx)(`rect`,{x:x(t)-220/u.length/2,y:0,width:220/u.length,height:56,fill:`transparent`,onMouseEnter:()=>h(t),style:{cursor:`pointer`}},t)),(0,v.jsx)(`line`,{x1:x(m),y1:0,x2:x(m),y2:56,stroke:`var(--hover-line)`,strokeWidth:`1`}),T&&(0,v.jsx)(`circle`,{cx:x(m),cy:S(T.v),r:`3.4`,fill:l,stroke:`var(--surface-elevated)`,strokeWidth:`1.5`})]}),(0,v.jsxs)(`div`,{className:`ss-tip`,children:[(0,v.jsx)(`span`,{className:`ss-tip-v tab-num`,style:{color:l},children:T?T.v.toLocaleString():`—`}),T?.label&&(0,v.jsx)(`span`,{className:`ss-tip-l faint`,children:T.label})]})]}),d&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function b({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,value:r,prefix:o=``,suffix:s=``,decimals:c=0,label:l,delta:u,deltaDir:d=`up`,color:f=`var(--presence)`,footer:p,delay:m}){let h=i[t]||i.spark,[g,y]=(0,_.useState)(0),b=(0,_.useRef)(0);(0,_.useEffect)(()=>{if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){y(r);return}let e=performance.now()+(m||0),t=n=>{let i=Math.max(0,Math.min(1,(n-e)/1100));y(r*(1-(1-i)**3)),i<1&&(b.current=requestAnimationFrame(t))};return b.current=requestAnimationFrame(t),()=>cancelAnimationFrame(b.current)},[r,m]);let x=g.toLocaleString(void 0,{minimumFractionDigits:c,maximumFractionDigits:c});return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(m||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(h,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`ct-num tab-num`,"data-mark":`underline`,style:{color:f},children:[(0,v.jsx)(`span`,{className:`ct-affix`,children:o}),x,(0,v.jsx)(`span`,{className:`ct-affix`,children:s})]}),(0,v.jsxs)(`div`,{className:`ct-row`,children:[(0,v.jsx)(`span`,{className:`ct-label`,children:l}),u&&(0,v.jsxs)(`span`,{className:`delta ${d}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:13,height:13,transform:d===`down`?`rotate(180deg)`:`none`}}),u]})]}),p&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(p)})]})}function x({title:e,icon:t=`sparkle`,iconColor:n=`var(--presence)`,value:r,unit:o,narrative:s,trend:c,trendDir:l=`up`,detail:u,color:d=`var(--presence)`,footer:f,delay:p}){let m=i[t]||i.sparkle,[h,g]=(0,_.useState)(!1);return(0,v.jsxs)(`div`,{className:`card reveal hero-card stats-card`,style:{"--delay":(p||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(m,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`hero-value tab-num`,"data-mark":`underline`,style:{"--hero-c":d},children:[r,o&&(0,v.jsx)(`span`,{className:`hero-unit`,children:o})]}),s&&(0,v.jsx)(`div`,{className:`hero-narrative`,dangerouslySetInnerHTML:a(s)}),c&&(0,v.jsxs)(`div`,{className:`hero-chip ${l} ${h?`open`:``}`,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),onClick:()=>g(e=>!e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(e=>!e))},role:`button`,tabIndex:0,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:14,height:14,transform:l===`down`?`rotate(180deg)`:`none`}}),(0,v.jsx)(`span`,{children:c}),u&&(0,v.jsx)(i.chevR,{className:`ic hero-chip-caret`,style:{width:13,height:13}})]}),u&&(0,v.jsx)(`div`,{className:`hero-detail`,"data-open":h,dangerouslySetInnerHTML:a(u)}),f&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(f)})]})}var S=130,C=56,w=1.5;function T({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,value:r,delta:o,deltaDir:s=`up`,color:c=`var(--presence)`,bars:l,footer:u,delay:d}){let f=i[t]||i.chart,p=l.length>40?l.slice(-40):l,[m,h]=(0,_.useState)(Math.max(0,p.length-1)),g=Math.max(...p,1);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(d||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`tt-body`,children:[(0,v.jsxs)(`div`,{className:`tt-left`,children:[(0,v.jsx)(`div`,{className:`tt-value tab-num`,"data-mark":`underline`,style:{color:c},children:r}),(0,v.jsxs)(`div`,{className:`tt-delta delta ${s}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:14,height:14,transform:s===`down`?`rotate(180deg)`:`none`}}),o]})]}),(0,v.jsx)(`svg`,{className:`tt-bars`,viewBox:`0 0 ${S} ${C}`,width:`100%`,height:C,preserveAspectRatio:`none`,role:`group`,"aria-label":`recent trend`,children:p.map((e,t)=>{let n=S/p.length,r=Math.max(1,n-w),i=Math.min(C,Math.max(C*.08,e/g*C));return(0,v.jsx)(`rect`,{className:`tt-bar ${t===m?`on`:``}`,x:t*n+(n-r)/2,y:C-i,width:r,height:i,rx:1.5,fill:t===m?c:`var(--track)`,onMouseEnter:()=>h(t),children:(0,v.jsx)(`title`,{children:String(e)})},t)})})]}),u&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:10},dangerouslySetInnerHTML:a(u)})]})}function E({title:e,icon:t=`shield`,iconColor:n=`var(--insight)`,score:r,grade:o,caption:s,color:c=`var(--insight)`,components:l=[],footer:u,delay:d}){let f=i[t]||i.shield,[p,m]=(0,_.useState)(null),h=Math.max(0,Math.min(100,r))/100,g=2*Math.PI*46;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(d||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`sb-body`,children:[(0,v.jsxs)(`div`,{className:`sb-ring`,children:[(0,v.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 120 120`,className:`sb-svg`,children:[(0,v.jsx)(`circle`,{cx:`60`,cy:`60`,r:46,fill:`none`,stroke:`var(--track)`,strokeWidth:`9`}),(0,v.jsx)(`circle`,{cx:`60`,cy:`60`,r:46,fill:`none`,stroke:c,strokeWidth:`9`,strokeLinecap:`round`,strokeDasharray:g,strokeDashoffset:g*(1-h),transform:`rotate(-90 60 60)`,className:`sb-arc`})]}),(0,v.jsxs)(`div`,{className:`sb-center`,children:[(0,v.jsx)(`div`,{className:`sb-score tab-num`,"data-mark":`underline`,style:{color:c},children:o??Math.round(r)}),o&&(0,v.jsx)(`div`,{className:`sb-sub tab-num`,children:Math.round(r)})]})]}),(0,v.jsxs)(`div`,{className:`sb-list`,children:[s&&(0,v.jsx)(`div`,{className:`sb-caption faint`,children:s}),l.map((e,t)=>{let n=e.color||c,r=p===t;return(0,v.jsxs)(`div`,{className:`sb-comp ${r?`on`:``}`,onMouseEnter:()=>m(t),onMouseLeave:()=>m(null),children:[(0,v.jsx)(`span`,{className:`sb-comp-dot`,style:{background:n}}),(0,v.jsx)(`span`,{className:`sb-comp-label`,children:e.label}),(0,v.jsx)(`span`,{className:`sb-comp-track`,children:(0,v.jsx)(`span`,{className:`sb-comp-fill`,style:{width:e.value+`%`,background:n}})}),(0,v.jsx)(`span`,{className:`sb-comp-val tab-num`,style:r?{color:n}:void 0,children:e.value})]},t)})]})]}),u&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function D({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,percentile:r,value:o,unit:s,lowLabel:c=`p0`,highLabel:l=`p100`,color:u=`var(--presence)`,footer:d,delay:f}){let p=i[t]||i.chart,[m,h]=(0,_.useState)(!1),g=Math.max(0,Math.min(100,r)),y=Math.max(1,Math.round(100-g));return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(f||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`pb-head`,children:[(0,v.jsx)(`span`,{className:`pb-value tab-num`,"data-mark":`underline`,style:{color:u},children:o}),s&&(0,v.jsx)(`span`,{className:`pb-unit faint`,children:s}),(0,v.jsxs)(`span`,{className:`pb-pct tab-num`,children:[Math.round(g),`th pct`]})]}),(0,v.jsxs)(`div`,{className:`pb-track`,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,v.jsx)(`div`,{className:`pb-grad`}),[25,50,75].map(e=>(0,v.jsx)(`span`,{className:`pb-tick`,style:{left:e+`%`}},e)),(0,v.jsx)(`div`,{className:`pb-fill`,style:{width:g+`%`,background:`color-mix(in oklab, ${u} 22%, transparent)`}}),(0,v.jsx)(`div`,{className:`pb-marker`,style:{left:g+`%`,background:u},children:(0,v.jsxs)(`span`,{className:`pb-tip ${m?`on`:``}`,style:{borderColor:u,"--pb-tip-bias":`${50-g}%`},children:[`top `,y,`%`]})})]}),(0,v.jsxs)(`div`,{className:`pb-axis faint`,children:[(0,v.jsx)(`span`,{children:c}),(0,v.jsx)(`span`,{children:l})]}),d&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function O({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,left:r,right:o,connector:s=`→`,ratioLabel:c=`ratio`,footer:l,delay:u}){let d=i[t]||i.layers,[f,p]=(0,_.useState)(null),m=r.color||`var(--presence)`,h=o.color||`var(--insight)`,g=r.weight+o.weight||1,y=o.weight===0?`—`:(r.weight/o.weight).toFixed(2),b=r.weight/g*100;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(u||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsxs)(`div`,{className:`sp-row`,children:[(0,v.jsxs)(`div`,{className:`sp-side ${f===`left`?`on`:``}`,onMouseEnter:()=>p(`left`),onMouseLeave:()=>p(null),children:[(0,v.jsx)(`div`,{className:`sp-val tab-num`,style:{color:m},children:r.value}),(0,v.jsx)(`div`,{className:`sp-label`,children:r.label}),r.sub&&(0,v.jsx)(`div`,{className:`sp-sub faint`,children:r.sub})]}),(0,v.jsx)(`div`,{className:`sp-connector`,children:(0,v.jsx)(`span`,{className:`sp-arrow`,children:s})}),(0,v.jsxs)(`div`,{className:`sp-side right ${f===`right`?`on`:``}`,onMouseEnter:()=>p(`right`),onMouseLeave:()=>p(null),children:[(0,v.jsx)(`div`,{className:`sp-val tab-num`,style:{color:h},children:o.value}),(0,v.jsx)(`div`,{className:`sp-label`,children:o.label}),o.sub&&(0,v.jsx)(`div`,{className:`sp-sub faint`,children:o.sub})]})]}),(0,v.jsxs)(`div`,{className:`sp-bar`,children:[(0,v.jsx)(`span`,{className:`sp-bar-l`,style:{width:b+`%`,background:m}}),(0,v.jsx)(`span`,{className:`sp-bar-r`,style:{width:100-b+`%`,background:h}})]}),(0,v.jsxs)(`div`,{className:`sp-ratio`,children:[(0,v.jsx)(`span`,{className:`sp-ratio-v tab-num`,"data-mark":`underline`,children:y}),(0,v.jsx)(`span`,{className:`sp-ratio-l faint`,children:c})]}),l&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(l)})]})}function k({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,cols:r=2,tiles:o,footer:s,delay:c}){let l=i[t]||i.table,[u,d]=(0,_.useState)(null);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(c||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`sc-grid`,style:{"--sc-cols":r},children:o.map((e,t)=>{let n=e.icon?i[e.icon]||i.spark:null,r=e.color||`var(--presence)`,o=u===t;return(0,v.jsxs)(`div`,{className:`sc-tile ${o?`on`:``}`,onMouseEnter:()=>d(t),onMouseLeave:()=>d(null),children:[(0,v.jsxs)(`div`,{className:`sc-tile-top`,children:[n&&(0,v.jsx)(n,{className:`ic sc-tile-ic`,style:{color:r}}),(0,v.jsx)(`span`,{className:`sc-tile-label`,children:e.label})]}),(0,v.jsx)(`div`,{className:`sc-tile-val tab-num`,style:{color:r},children:e.value}),e.delta&&(0,v.jsxs)(`div`,{className:`sc-tile-delta delta ${e.deltaDir||`up`}`,children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:12,height:12,transform:e.deltaDir===`down`?`rotate(180deg)`:`none`}}),e.delta]}),e.detail&&(0,v.jsx)(`div`,{className:`sc-tile-detail`,"data-open":o,dangerouslySetInnerHTML:a(e.detail)})]},t)})}),s&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}function A({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,prefix:r=``,suffix:o=``,steps:s,footer:c,delay:l}){let u=i[t]||i.layers,[d,f]=(0,_.useState)(null),p=0,m=s.map(e=>(e.isBase||e.isTotal?p=e.delta:p+=e.delta,{...e,running:p})),h=Math.max(...m.map(e=>Math.abs(e.running)),1),g=e=>r+e.toLocaleString()+o,y=(()=>{let e=m.findIndex(e=>e.isTotal);return e>=0?e:m.length-1})();return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(l||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`dc-list`,children:m.map((e,t)=>{let n=e.delta>=0,r=e.isBase||e.isTotal?`var(--presence)`:n?`var(--insight)`:`var(--danger)`,i=Math.abs(e.running)/h*100,o=d===t;return(0,v.jsxs)(`div`,{className:`dc-step ${e.isBase?`base`:``} ${e.isTotal?`total`:``} ${o?`on`:``}`,onMouseEnter:()=>f(t),onMouseLeave:()=>f(null),children:[(0,v.jsxs)(`div`,{className:`dc-step-head`,children:[(0,v.jsx)(`span`,{className:`dc-step-label`,children:e.label}),(0,v.jsx)(`span`,{className:`dc-step-delta tab-num`,"data-mark":t===y?`underline`:void 0,style:{color:r},children:e.isBase||e.isTotal?g(e.running):(n?`+`:``)+g(e.delta)})]}),(0,v.jsx)(`div`,{className:`dc-step-track`,children:(0,v.jsx)(`span`,{className:`dc-step-fill`,style:{width:i+`%`,background:r}})}),!e.isTotal&&(0,v.jsxs)(`div`,{className:`dc-run faint tab-num`,children:[`→ `,g(e.running)]}),e.detail&&(0,v.jsx)(`div`,{className:`dc-detail`,"data-open":o,dangerouslySetInnerHTML:a(e.detail)})]},t)})}),c&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(c)})]})}function j({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,rows:r,footer:o,delay:s}){let c=i[t]||i.chart,[l,u]=(0,_.useState)(null),d=(()=>{let e=0;return r.forEach((t,n)=>{t.value>r[e].value&&(e=n)}),e})();return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(s||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`bk-list`,children:r.map((e,t)=>{let n=e.color||`var(--presence)`,r=e.max||1,i=Math.max(0,Math.min(100,e.value/r*100)),a=Math.max(0,Math.min(100,e.target/r*100)),o=e.value>=e.target,s=l===t,c=e.target===0?0:Math.round(e.value/e.target*100);return(0,v.jsxs)(`div`,{className:`bk-row ${s?`on`:``}`,onMouseEnter:()=>u(t),onMouseLeave:()=>u(null),children:[(0,v.jsxs)(`div`,{className:`bk-head`,children:[(0,v.jsx)(`span`,{className:`bk-label`,children:e.label}),(0,v.jsx)(`span`,{className:`bk-val tab-num`,style:{color:n},children:e.display??e.value.toLocaleString()})]}),(0,v.jsxs)(`div`,{className:`bk-track`,children:[(0,v.jsx)(`span`,{className:`bk-band`}),(0,v.jsx)(`span`,{className:`bk-fill`,"data-mark":t===d?`circle`:void 0,style:{width:i+`%`,background:o?n:`color-mix(in oklab, ${n} 60%, var(--warning))`}}),(0,v.jsx)(`span`,{className:`bk-target`,style:{left:a+`%`},title:`target ${e.target}`})]}),(0,v.jsxs)(`div`,{className:`bk-meta faint tab-num`,"data-on":s,children:[c,`% of target`,s?` · target ${e.target.toLocaleString()}`:``]})]},t)})}),o&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var M=360,ee=320,N=96,te=56,ne=16,re=20,P=30;function F(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ie(e){if(!Number.isFinite(e))return`—`;let t=Math.round(e*1e3)/10;return(Number.isInteger(t)?t.toString():t.toFixed(1))+`%`}var ae=1/5.6;function oe(e,t){let n=Math.max(3,Math.floor(t*ae));return e.length>n?e.slice(0,n-1).trimEnd()+`…`:e}function se({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,classes:r,matrix:o,correctColor:s=`var(--presence)`,errorColor:c=`var(--danger)`,showTotals:u=!1,readout:d=`accuracy`,actualLabel:f=`Actual`,predictedLabel:p=`Predicted`,countLabel:m=`samples`,footer:h,delay:g}){let y=i[t]||i.table,b=(0,_.useMemo)(()=>{let e=r?.length??0;if(e<2||!o||o.length<e)return null;let t=r.map((e,t)=>{let n=o[t]??[];return r.map((e,t)=>{let r=n[t];return Number.isFinite(r)?r:0})}),n=t.reduce((e,t)=>e+F(t),0),i=t.reduce((e,t,n)=>e+(Number.isFinite(t[n])?t[n]:0),0),a=n>0?i/n:0,s=Math.max(1,...t.flat()),c=r.map((e,n)=>{let r=t.reduce((e,t)=>e+(Number.isFinite(t[n])?t[n]:0),0),i=F(t[n])>0?t[n][n]/F(t[n]):NaN;return{label:e,precision:r>0?t[n][n]/r:NaN,recall:i}}),d=M-ne-(u?P:0),f=ee-re-(u?P:0),p=Math.min(d-N,f-te),m=N,h=te;return{n:e,grid:t,total:n,correct:i,accuracy:a,perClass:c,ex:l([0,e],[m,m+p]),ey:l([0,e],[h,h+p]),cell:p/e,side:p,x0:m,y0:h,heat:e=>s>0?Math.sqrt(Math.max(0,e)/s):0,colTotals:r.map((e,n)=>t.reduce((e,t)=>e+(Number.isFinite(t[n])?t[n]:0),0)),rowTotals:t.map(e=>F(e))}},[r,o,u]);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(g||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(y,{className:`ic`,style:{color:n}}),` `,e]}),b&&(0,v.jsxs)(`div`,{className:`cfm-wrap`,children:[(0,v.jsxs)(`svg`,{viewBox:`0 0 ${M} ${ee}`,className:`cfm-svg`,role:`img`,"aria-label":e,children:[b.grid.map((e,t)=>e.map((e,n)=>{let r=b.ex(n),i=b.ey(t),a=t===n,o=a?s:c,l=b.heat(e),u=`color-mix(in oklab, ${o} ${(8+l*80).toFixed(1)}%, transparent)`,d=l>.55;return(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`rect`,{x:r+1,y:i+1,width:b.cell-2,height:b.cell-2,rx:4,fill:u,className:a?`cfm-cell cfm-cell--diag`:`cfm-cell`}),(0,v.jsx)(`text`,{x:r+b.cell/2,y:i+b.cell/2,className:d?`cfm-count cfm-count--on`:`cfm-count`,textAnchor:`middle`,dominantBaseline:`central`,"data-mark":a?`point`:void 0,children:e.toLocaleString()})]},`c${t}-${n}`)})),(0,v.jsx)(`rect`,{x:b.x0,y:b.y0,width:b.side,height:b.side,className:`cfm-frame`,fill:`none`}),r.map((e,t)=>{let n=oe(e,N-12);return(0,v.jsxs)(`text`,{x:b.x0-8,y:b.ey(t)+b.cell/2,className:`cfm-class`,textAnchor:`end`,dominantBaseline:`central`,children:[n!==e&&(0,v.jsx)(`title`,{children:e}),n]},`rl${t}`)}),r.map((e,t)=>{let n=oe(e,b.cell-4);return(0,v.jsxs)(`text`,{x:b.ex(t)+b.cell/2,y:b.y0-8,className:`cfm-class`,textAnchor:`middle`,children:[n!==e&&(0,v.jsx)(`title`,{children:e}),n]},`cl${t}`)}),(0,v.jsxs)(`text`,{x:0,y:0,transform:`translate(18, ${b.y0+b.side/2}) rotate(-90)`,className:`cfm-axis-title`,textAnchor:`middle`,children:[f,` ↓`]}),(0,v.jsxs)(`text`,{x:b.x0+b.side/2,y:18,className:`cfm-axis-title`,textAnchor:`middle`,children:[p,` →`]}),u&&(0,v.jsxs)(`g`,{className:`cfm-totals`,children:[b.rowTotals.map((e,t)=>(0,v.jsx)(`text`,{x:b.x0+b.side+P/2,y:b.ey(t)+b.cell/2,className:`cfm-total`,textAnchor:`middle`,dominantBaseline:`central`,children:e.toLocaleString()},`rt${t}`)),b.colTotals.map((e,t)=>(0,v.jsx)(`text`,{x:b.ex(t)+b.cell/2,y:b.y0+b.side+P/2,className:`cfm-total`,textAnchor:`middle`,dominantBaseline:`central`,children:e.toLocaleString()},`ct${t}`)),(0,v.jsx)(`text`,{x:b.x0+b.side+P/2,y:b.y0-8,className:`cfm-total-hd`,textAnchor:`middle`,children:`Σ`}),(0,v.jsx)(`text`,{x:b.x0-8,y:b.y0+b.side+P/2,className:`cfm-total-hd`,textAnchor:`end`,dominantBaseline:`central`,children:`Σ`})]})]}),d===`accuracy`&&(0,v.jsxs)(`div`,{className:`cfm-readout`,children:[(0,v.jsx)(`span`,{className:`cfm-acc tab-num`,style:{color:s},"data-mark":`underline`,children:ie(b.accuracy)}),(0,v.jsxs)(`span`,{className:`cfm-acc-lbl faint`,children:[`accuracy · `,b.correct.toLocaleString(),` of `,b.total.toLocaleString(),` `,m,` correct`]})]}),d===`perclass`&&(0,v.jsxs)(`div`,{className:`cfm-pc`,children:[(0,v.jsxs)(`div`,{className:`cfm-pc-row cfm-pc-head`,children:[(0,v.jsx)(`span`,{className:`cfm-pc-name`,children:`Class`}),(0,v.jsx)(`span`,{className:`cfm-pc-val`,children:`Precision`}),(0,v.jsx)(`span`,{className:`cfm-pc-val`,children:`Recall`})]}),b.perClass.map((e,t)=>(0,v.jsxs)(`div`,{className:`cfm-pc-row`,children:[(0,v.jsx)(`span`,{className:`cfm-pc-name`,children:e.label}),(0,v.jsx)(`span`,{className:`cfm-pc-val tab-num`,children:ie(e.precision)}),(0,v.jsx)(`span`,{className:`cfm-pc-val tab-num`,children:ie(e.recall)})]},`pc${t}`))]})]}),!b&&(0,v.jsx)(`div`,{className:`cfm-empty faint`,children:`Provide a class list and a square N×N matrix (matrix[i][j] = actual i predicted j).`}),h&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(h)})]})}var I=r(),L=132,R=40,z=4;function ce(e){return e===`down`?`var(--danger)`:`var(--insight)`}function le(e){let t=(0,I.c)(45),{spark:n,color:r}=e,[i,a]=(0,_.useState)(Math.max(0,n.length-1)),o=Math.min(...n),s=Math.max(...n),c=s-o||1,l;t[0]===n.length?l=t[1]:(l=e=>z+e/Math.max(1,n.length-1)*(L-z*2),t[0]=n.length,t[1]=l);let u=l,d;t[2]!==o||t[3]!==c?(d=e=>R-z-(e-o)/c*(R-z*2),t[2]=o,t[3]=c,t[4]=d):d=t[4];let f=d,p;if(t[5]!==n||t[6]!==u||t[7]!==f){let e;t[9]!==u||t[10]!==f?(e=(e,t)=>`${u(t)},${f(e)}`,t[9]=u,t[10]=f,t[11]=e):e=t[11],p=n.map(e).join(` `),t[5]=n,t[6]=u,t[7]=f,t[8]=p}else p=t[8];let m=p,h=`${z},${R} ${m} ${L-z},${R}`,g=Math.min(i,n.length-1),y;t[12]===o?y=t[13]:(y=Math.round(o),t[12]=o,t[13]=y);let b;t[14]===s?b=t[15]:(b=Math.round(s),t[14]=s,t[15]=b);let x=`kd-${y}-${b}-${n.length}`,S,C;t[16]===r?(S=t[17],C=t[18]):(S=(0,v.jsx)(`stop`,{offset:`0%`,stopColor:r,stopOpacity:`0.2`}),C=(0,v.jsx)(`stop`,{offset:`100%`,stopColor:r,stopOpacity:`0`}),t[16]=r,t[17]=S,t[18]=C);let w;t[19]!==x||t[20]!==S||t[21]!==C?(w=(0,v.jsx)(`defs`,{children:(0,v.jsxs)(`linearGradient`,{id:x,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[S,C]})}),t[19]=x,t[20]=S,t[21]=C,t[22]=w):w=t[22];let T=`url(#${x})`,E;t[23]!==h||t[24]!==T?(E=(0,v.jsx)(`polygon`,{points:h,fill:T}),t[23]=h,t[24]=T,t[25]=E):E=t[25];let D;t[26]!==r||t[27]!==m?(D=(0,v.jsx)(`polyline`,{points:m,fill:`none`,stroke:r,strokeWidth:`1.75`,strokeLinejoin:`round`,strokeLinecap:`round`}),t[26]=r,t[27]=m,t[28]=D):D=t[28];let O;if(t[29]!==n||t[30]!==u){let e;t[32]!==n.length||t[33]!==u?(e=(e,t)=>(0,v.jsx)(`rect`,{x:u(t)-L/n.length/2,y:0,width:L/n.length,height:R,fill:`transparent`,onMouseEnter:()=>a(t),style:{cursor:`pointer`}},t),t[32]=n.length,t[33]=u,t[34]=e):e=t[34],O=n.map(e),t[29]=n,t[30]=u,t[31]=O}else O=t[31];let k=u(g),A=f(n[g]),j;t[35]!==r||t[36]!==k||t[37]!==A?(j=(0,v.jsx)(`circle`,{cx:k,cy:A,r:`2.6`,fill:r,stroke:`var(--surface-elevated)`,strokeWidth:`1.4`}),t[35]=r,t[36]=k,t[37]=A,t[38]=j):j=t[38];let M;return t[39]!==E||t[40]!==D||t[41]!==O||t[42]!==j||t[43]!==w?(M=(0,v.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 ${L} ${R}`,className:`kd-spark`,preserveAspectRatio:`none`,children:[w,E,D,O,j]}),t[39]=E,t[40]=D,t[41]=O,t[42]=j,t[43]=w,t[44]=M):M=t[44],M}function ue({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,tiles:r,caption:o,footer:s,delay:c}){let l=i[t]||i.chart;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(c||0)+`ms`},children:[e&&(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,v.jsx)(`div`,{className:`kd-grid`,children:r.map((e,t)=>{let n=e.deltaDir||`up`,r=ce(n),a=e.spark?.filter(e=>Number.isFinite(e))??[];return(0,v.jsxs)(`div`,{className:`kd-tile`,children:[(0,v.jsx)(`div`,{className:`kd-tile-label`,children:e.label}),(0,v.jsxs)(`div`,{className:`kd-tile-val tab-num`,children:[e.value,e.unit&&(0,v.jsx)(`span`,{className:`kd-tile-unit`,children:e.unit})]}),e.delta&&(0,v.jsxs)(`div`,{className:`kd-tile-delta`,style:{color:r},children:[(0,v.jsx)(i.arrowUp,{className:`ic`,style:{width:12,height:12,transform:n===`down`?`rotate(180deg)`:`none`}}),(0,v.jsx)(`span`,{className:`kd-tile-delta-t`,children:e.delta})]}),a.length>1&&(0,v.jsx)(`div`,{className:`kd-tile-spark`,children:(0,v.jsx)(le,{spark:a,color:r})}),e.conf&&(0,v.jsx)(`div`,{className:`kd-tile-conf faint`,children:e.conf})]},t)})}),o&&(0,v.jsx)(`div`,{className:`kd-caption faint`,children:o}),s&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}function de(e){if(!Number.isFinite(e))return`—`;let t=e*100,n=Math.abs(t),r=n===0?0:n<1?2:+(n<10);return`${t.toFixed(r)}%`}function fe(e){return Number.isFinite(e)?Math.round(e).toLocaleString():`—`}function B(e){return`${e>=0?`+`:``}${e.toFixed(1)}%`}function pe(e){return e<.001?`p < .001`:`p = ${e.toFixed(3).replace(/^0\./,`.`)}`}function me(e,t,n){let r=Math.min(e,t),i=Math.max(e,t);if(!Number.isFinite(r)||!Number.isFinite(i))return null;let a=[r,i,0,...n!==null&&Number.isFinite(n)?[n]:[]],o=Math.min(...a),s=Math.max(...a),c=Math.max((s-o)*.14,.5),l=o-c,u=s+c-l||1,d=e=>(e-l)/u*100;return{loPct:d(r),hiPct:d(i),zeroPct:d(0),pointPct:n!==null&&Number.isFinite(n)?d(n):null}}function he({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,control:r,variant:o,pValue:s,confidenceInterval:c,significant:l,footer:u,delay:d}){let f=i[t]||i.chart,[p,h]=(0,_.useState)(null),g=r.conversionRate>0?(o.conversionRate-r.conversionRate)/r.conversionRate*100:NaN,y=Number.isFinite(g),b=m(y?g:0,{delay:(d||0)+260,format:B}),x=y?g>0?`var(--insight)`:g<0?`var(--danger)`:`var(--text-muted)`:`var(--text-muted)`,S=typeof l==`boolean`,C=typeof s==`number`&&Number.isFinite(s),w=S?l:C?s<.05:null,T=S||C,E=c&&c.length===2?me(c[0],c[1],y?g:null):null;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(d||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),T&&(0,v.jsx)(`div`,{className:`abt-head`,children:(0,v.jsxs)(`span`,{className:`abt-badge m-scale-in ${w?`on`:``}`,children:[w&&(0,v.jsx)(i.check,{className:`ic abt-badge-ic`}),w?`Significant`:`Not significant`,C&&(0,v.jsx)(`span`,{className:`abt-badge-p`,children:pe(s)})]})}),(0,v.jsxs)(`div`,{className:`abt-row`,children:[(0,v.jsxs)(`div`,{className:`abt-side m-fade-rise m-stagger-item ${p===`control`?`on`:``}`,style:{"--i":0},onMouseEnter:()=>h(`control`),onMouseLeave:()=>h(null),children:[(0,v.jsx)(`div`,{className:`abt-name`,children:r.name}),(0,v.jsx)(`div`,{className:`abt-val tab-num`,children:de(r.conversionRate)}),(0,v.jsxs)(`div`,{className:`abt-n faint`,children:[`n = `,fe(r.n)]})]}),(0,v.jsx)(`div`,{className:`abt-connector`,children:(0,v.jsx)(`span`,{className:`abt-arrow`,children:`→`})}),(0,v.jsxs)(`div`,{className:`abt-side m-fade-rise m-stagger-item ${p===`variant`?`on`:``}`,style:{"--i":1},onMouseEnter:()=>h(`variant`),onMouseLeave:()=>h(null),children:[(0,v.jsx)(`div`,{className:`abt-name`,children:o.name}),(0,v.jsx)(`div`,{className:`abt-val tab-num`,style:{color:x},children:de(o.conversionRate)}),(0,v.jsxs)(`div`,{className:`abt-n faint`,children:[`n = `,fe(o.n)]})]})]}),(0,v.jsxs)(`div`,{className:`abt-lift m-fade-rise m-stagger-item`,style:{"--i":2},children:[(0,v.jsx)(`span`,{className:`abt-lift-v tab-num`,style:{color:x},"data-mark":`underline`,children:y?b:`—`}),(0,v.jsx)(`span`,{className:`abt-lift-l faint`,children:`relative lift`})]}),E&&c&&(0,v.jsxs)(`div`,{className:`abt-ci m-fade-rise m-stagger-item`,style:{"--i":3},children:[(0,v.jsx)(`span`,{className:`abt-ci-lbl faint`,children:`95% confidence interval`}),(0,v.jsxs)(`div`,{className:`abt-ci-track`,children:[(0,v.jsx)(`span`,{className:`abt-ci-band`,style:{left:`${E.loPct}%`,width:`${Math.max(E.hiPct-E.loPct,1.5)}%`}}),(0,v.jsx)(`span`,{className:`abt-ci-zero`,style:{left:`${E.zeroPct}%`},title:`no effect`}),E.pointPct!==null&&(0,v.jsx)(`span`,{className:`abt-ci-point`,style:{left:`${E.pointPct}%`}})]}),(0,v.jsxs)(`div`,{className:`abt-ci-labels`,children:[(0,v.jsx)(`span`,{className:`tab-num`,children:B(c[0])}),(0,v.jsx)(`span`,{className:`tab-num`,children:B(c[1])})]})]}),u&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}var ge=320,_e=176,V={top:14,right:14,bottom:32,left:42},ve=[0,.25,.5,.75,1];function ye(e){let t=e<0?-1:1,n=Math.abs(e),r=1/(1+.3275911*n);return t*(1-((((1.061405429*r-1.453152027)*r+1.421413741)*r-.284496736)*r+.254829592)*r*Math.exp(-n*n))}function be(e){return .5*(1+ye(e/Math.SQRT2))}function xe(e){if(!(e>0)||!(e<1))return NaN;let t=[-39.69683028665376,220.9460984245205,-275.9285104469687,138.357751867269,-30.66479806614716,2.506628277459239],n=[-54.47609879822406,161.5858368580409,-155.6989798598866,66.80131188771972,-13.28068155288572],r=[-.007784894002430293,-.3223964580411365,-2.400758277161838,-2.549732539343734,4.374664141464968,2.938163982698783],i=[.007784695709041462,.3224671290700398,2.445134137142996,3.754408661907416];if(e<.02425){let t=Math.sqrt(-2*Math.log(e));return(((((r[0]*t+r[1])*t+r[2])*t+r[3])*t+r[4])*t+r[5])/((((i[0]*t+i[1])*t+i[2])*t+i[3])*t+1)}if(e<=.97575){let r=e-.5,i=r*r;return(((((t[0]*i+t[1])*i+t[2])*i+t[3])*i+t[4])*i+t[5])*r/(((((n[0]*i+n[1])*i+n[2])*i+n[3])*i+n[4])*i+1)}let a=Math.sqrt(-2*Math.log(1-e));return-(((((r[0]*a+r[1])*a+r[2])*a+r[3])*a+r[4])*a+r[5])/((((i[0]*a+i[1])*a+i[2])*a+i[3])*a+1)}function Se(e){return`α = ${e.toFixed(e<.01?3:2).replace(/^0\./,`.`)}`}function Ce({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,effectSize:r,alpha:s,power:h,requiredN:g,curve:y,footer:b,delay:x}){let S=i[t]||i.chart,C=(0,_.useRef)(null),w=(0,_.useMemo)(()=>{let e=Math.abs(r);if(!Number.isFinite(e)||e<=0)return null;let t=typeof s==`number`&&Number.isFinite(s)&&s>0&&s<1?s:.05,n=typeof g==`number`&&Number.isFinite(g)&&g>0?Math.max(1,Math.round(g)):null,i=typeof h==`number`&&Number.isFinite(h)&&h>0&&h<1?h:null,a=xe(1-t/2);if(n!==null){let r=i??be(Math.sqrt(n*e*e/2)-a);return{n,p:Math.min(1,Math.max(0,r)),alpha:t,d:e,mode:`evaluate`,derived:i===null}}let o=i??.8,c=xe(o);return{n:Math.ceil(2*(a+c)**2/(e*e)),p:o,alpha:t,d:e,mode:`design`,derived:!0}},[r,s,h,g]),T=m(w?.n??0,{delay:(x||0)+140,decimals:0}),E=(0,_.useMemo)(()=>{if(!w||!y||y.length===0)return null;let e=y.filter(e=>Number.isFinite(e?.n)&&e.n>0&&Number.isFinite(e?.power)).map(e=>({n:e.n,power:Math.min(1,Math.max(0,e.power))})).sort((e,t)=>e.n-t.n);if(e.length===0)return null;let t=f(e.map(e=>e.n).concat([w.n]))?.[1]??w.n,[n,r]=u(0,Math.max(t,1)),i=ge-V.left-V.right,a=_e-V.top-V.bottom,o=l([n,r],[V.left,V.left+i]),s=l([0,1],[V.top+a,V.top]);return{sx:o,sy:s,path:e.length>1?`M${e.map(e=>`${o(e.n)},${s(e.power)}`).join(`L`)}`:``,innerW:i,innerH:a,nTicks:c(n,r,d(r-n,4))}},[y,w]);if(p(C,{delay:(x||0)+220}),!w)return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(x||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(S,{className:`ic`,style:{color:n}}),` `,e||`Power analysis`]}),(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide a non-zero effect size.`})]});let D=o(w.p,{decimals:+(w.p>=.995||w.p<.1)});return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(x||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(S,{className:`ic`,style:{color:n}}),` `,e||`Power analysis`]}),(0,v.jsxs)(`div`,{className:`ps-head`,children:[(0,v.jsxs)(`div`,{className:`ps-n-row`,children:[(0,v.jsx)(`span`,{className:`ps-n tab-num`,children:T}),(0,v.jsx)(`span`,{className:`ps-n-suffix`,children:`per group`})]}),(0,v.jsx)(`div`,{className:`ps-power-line`,children:w.mode===`evaluate`&&w.derived?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{className:`ps-power-arrow`,children:`→`}),` `,(0,v.jsx)(`strong`,{children:D}),` power`,` `,(0,v.jsx)(`span`,{className:`faint`,children:`(achieved at this n)`})]}):(0,v.jsxs)(v.Fragment,{children:[`for `,(0,v.jsx)(`strong`,{children:D}),` power`]})})]}),(0,v.jsxs)(`div`,{className:`ps-stats`,children:[(0,v.jsxs)(`span`,{className:`ps-stat`,children:[(0,v.jsx)(`span`,{className:`ps-stat-k`,children:`effect size`}),(0,v.jsxs)(`span`,{className:`ps-stat-v tab-num`,children:[`d = `,r.toFixed(2)]})]}),(0,v.jsxs)(`span`,{className:`ps-stat`,children:[(0,v.jsx)(`span`,{className:`ps-stat-k`,children:`significance`}),(0,v.jsx)(`span`,{className:`ps-stat-v tab-num`,children:Se(w.alpha)})]})]}),E&&(0,v.jsx)(`div`,{className:`ps-curve-wrap`,children:(0,v.jsxs)(`svg`,{viewBox:`0 0 ${ge} ${_e}`,className:`ps-svg`,role:`img`,"aria-label":`Power vs. sample size, marked at n=${w.n}`,children:[ve.map(e=>(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`line`,{className:`ps-grid`,x1:V.left,y1:E.sy(e),x2:V.left+E.innerW,y2:E.sy(e)}),(0,v.jsxs)(`text`,{className:`ps-tick`,x:V.left-6,y:E.sy(e)+3.5,textAnchor:`end`,children:[Math.round(e*100),`%`]})]},`g${e}`)),(0,v.jsx)(`line`,{className:`ps-axis`,x1:V.left,y1:V.top+E.innerH,x2:V.left+E.innerW,y2:V.top+E.innerH}),(0,v.jsx)(`line`,{className:`ps-axis`,x1:V.left,y1:V.top,x2:V.left,y2:V.top+E.innerH}),E.nTicks.map(e=>(0,v.jsx)(`text`,{className:`ps-tick`,x:E.sx(e),y:V.top+E.innerH+15,textAnchor:`middle`,children:e.toLocaleString()},`xt${e}`)),E.path&&(0,v.jsx)(`path`,{ref:C,className:`ps-line`,d:E.path,fill:`none`}),(0,v.jsx)(`line`,{className:`ps-mark-guide`,x1:E.sx(w.n),y1:E.sy(w.p),x2:E.sx(w.n),y2:V.top+E.innerH}),(0,v.jsx)(`circle`,{className:`ps-mark`,cx:E.sx(w.n),cy:E.sy(w.p),r:4.5,"data-mark":`point`})]})}),b&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(b)})]})}var we={critical:`var(--danger)`,low:`var(--warning)`,healthy:`var(--insight)`},Te={critical:`Reorder now`,low:`Below reorder point`,healthy:`Healthy`};function H(e){return Math.max(0,Math.min(100,e))}function Ee(e,t){if(!e||typeof e!=`object`)return null;let n=typeof e.sku==`string`?e.sku.trim():``,r=typeof e.label==`string`&&e.label.trim()?e.label.trim():n;if(!r)return null;let i=Number.isFinite(e.level)?Math.max(0,e.level):0,a=Number.isFinite(e.reorderPoint)?Math.max(0,e.reorderPoint):0,o=Number.isFinite(e.safetyStock)?Math.max(0,e.safetyStock):0,s=Math.max(Number.isFinite(e.max)&&e.max>0?e.max:0,i,a,o,1),c=Math.min(a,s),l=Math.min(o,c),u=Number.isFinite(e.leadTimeDays)?Math.max(0,e.leadTimeDays):null,d=i<=l?`critical`:i<=c?`low`:`healthy`;return{key:n||`row-${t}`,sku:n,label:r,level:i,max:s,safetyStock:l,reorderPoint:c,leadTimeDays:u,status:d,levelPct:H(i/s*100),safetyPct:H(l/s*100),reorderPct:H(c/s*100)}}function De({title:e,icon:t=`cart`,iconColor:n=`var(--presence)`,items:r,footer:o,delay:s}){let c=i[t]||i.cart,l=(Array.isArray(r)?r:[]).map(Ee).filter(e=>e!==null);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(s||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),l.length===0&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide items with a level, a reorder point, and a max.`}),l.length>0&&(0,v.jsx)(`div`,{className:`ir-list`,children:l.map((e,t)=>(0,v.jsxs)(`div`,{className:`ir-row m-fade-rise m-stagger-item`,style:{"--i":t},children:[(0,v.jsxs)(`div`,{className:`ir-head`,children:[(0,v.jsxs)(`div`,{className:`ir-id`,children:[e.sku&&(0,v.jsx)(`span`,{className:`ir-sku`,children:e.sku}),(0,v.jsx)(`span`,{className:`ir-label`,children:e.label})]}),(0,v.jsx)(`span`,{className:`ir-status`,style:{color:we[e.status]},"data-mark":e.status===`critical`?`circle`:void 0,children:Te[e.status]})]}),(0,v.jsxs)(`div`,{className:`ir-track`,children:[(0,v.jsxs)(`div`,{className:`ir-track-inner`,children:[(0,v.jsx)(`span`,{className:`ir-zone ir-zone--danger`,style:{width:`${e.safetyPct}%`}}),(0,v.jsx)(`span`,{className:`ir-zone ir-zone--warn`,style:{left:`${e.safetyPct}%`,width:`${Math.max(0,e.reorderPct-e.safetyPct)}%`}}),(0,v.jsx)(`span`,{className:`ir-zone ir-zone--good`,style:{left:`${e.reorderPct}%`,width:`${Math.max(0,100-e.reorderPct)}%`}}),(0,v.jsx)(`span`,{className:`ir-fill`,style:{width:`${e.levelPct}%`,background:we[e.status]}})]}),(0,v.jsx)(`span`,{className:`ir-tick`,style:{left:`${e.reorderPct}%`},title:`reorder point`})]}),(0,v.jsxs)(`div`,{className:`ir-meta faint tab-num`,children:[e.level.toLocaleString(),` of `,e.max.toLocaleString(),` · reorder at`,` `,e.reorderPoint.toLocaleString(),e.leadTimeDays===null?``:` · ${e.leadTimeDays}d lead time`]})]},e.key))}),o&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}function Oe(e){let t=0;for(let n of e)n!==null&&(t+=n);return t}function ke({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,game:r,players:o,rounds:s,footer:c,delay:l}){let u=i[t]||i.table,d=Array.isArray(o)?o:[],f=Number.isFinite(s)&&s>0?Math.round(s):Math.max(0,...d.map(e=>Array.isArray(e?.roundScores)?e.roundScores.length:0)),p=d.map((e,t)=>{let n=typeof e?.name==`string`&&e.name.trim()?e.name.trim():`Player ${t+1}`,r=Array.isArray(e?.roundScores)?e.roundScores:[],i=Array.from({length:f},(e,t)=>Number.isFinite(r[t])?r[t]:null),a=Number.isFinite(e?.total)?e.total:Oe(i);return{key:`${n}-${t}`,name:n,scores:i,total:a}}),m=p.length>0,h=m?Math.max(...p.map(e=>e.total)):0,g=new Set(m?p.filter(e=>e.total===h).map(e=>e.key):[]),_=g.size===1?p.find(e=>g.has(e.key)):null,y=_&&p.length>1?_.total-Math.max(...p.filter(e=>e.key!==_.key).map(e=>e.total)):null,b=[];b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-head bgs-corner`,"aria-hidden":`true`},`corner`));for(let e of p)b.push((0,v.jsxs)(`div`,{className:`bgs-cell bgs-head bgs-player`,children:[g.has(e.key)&&(0,v.jsx)(`span`,{className:`bgs-crown`,"aria-label":`leading`,title:`Leading`,children:`●`}),(0,v.jsx)(`span`,{className:`bgs-name`,children:e.name})]},`h-${e.key}`));for(let e=0;e<f;e++){b.push((0,v.jsxs)(`div`,{className:`bgs-cell bgs-rowlabel m-fade-rise m-stagger-item`,style:{"--i":e},children:[`R`,e+1]},`rl-${e}`));for(let t of p)b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-score tab-num m-fade-rise m-stagger-item`,style:{"--i":e},children:t.scores[e]===null?`–`:t.scores[e].toLocaleString()},`s-${t.key}-${e}`))}b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-rowlabel bgs-totallabel`,children:`Total`},`tl`));for(let e of p)b.push((0,v.jsx)(`div`,{className:`bgs-cell bgs-total tab-num ${g.has(e.key)?`lead`:``}`,"data-mark":g.has(e.key)?`underline`:void 0,children:e.total.toLocaleString()},`t-${e.key}`));return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(l||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(u,{className:`ic`,style:{color:n}}),` `,e,r&&(0,v.jsx)(`span`,{className:`bgs-game faint`,children:r})]}),!m&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide players with round scores.`}),m&&(0,v.jsx)(`div`,{className:`bgs-scroll`,children:(0,v.jsx)(`div`,{className:`bgs-grid`,style:{"--bgs-cols":p.length,minWidth:`${64+p.length*84}px`},children:b})}),_&&y!==null&&(0,v.jsxs)(`p`,{className:`bgs-lead-note faint`,children:[_.name,` leads`,y>0?` by ${y.toLocaleString()}`:``,`.`]}),c&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(c)})]})}var Ae=[`none`,`low`,`medium`,`high`,`critical`];function je(e){switch(e){case`critical`:case`high`:return`var(--danger)`;case`medium`:return`var(--warning)`;case`low`:return`var(--insight)`;default:return`var(--text-muted)`}}function Me(e){return e>=9?`critical`:e>=7?`high`:e>=4?`medium`:e>0?`low`:`none`}var U=132,Ne=U/2-11;function Pe({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,baseScore:r,severity:o,vector:s,cve:c,footer:l,delay:u}){let d=i[t]||i.shield,f=typeof r==`number`&&Number.isFinite(r),p=f?Math.max(0,Math.min(10,r)):0,h=Ae.includes(o)?o:Me(p),g=je(h),_=p/10,y=m(f?p:0,{delay:(u||0)+120,decimals:1}),b=(Array.isArray(s)?s:[]).filter(e=>!!e&&typeof e.label==`string`&&e.label.trim()!==``&&typeof e.value==`string`&&e.value.trim()!==``).slice(0,12),x=typeof c==`string`&&c.trim()?c.trim():null;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(u||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(d,{className:`ic`,style:{color:n}}),` `,e,x&&(0,v.jsx)(`span`,{className:`cvss-cve`,children:x})]}),(0,v.jsxs)(`div`,{className:`cvss-body`,children:[(0,v.jsxs)(`div`,{className:`gauge-host`,style:{width:U,height:U},children:[(0,v.jsxs)(`svg`,{className:`gauge`,viewBox:`0 0 ${U} ${U}`,width:U,height:U,children:[(0,v.jsx)(`circle`,{cx:U/2,cy:U/2,r:Ne,fill:`none`,stroke:`var(--surface-glass-strong)`,strokeWidth:`10`}),f&&(0,v.jsx)(`circle`,{className:`gauge-arc`,cx:U/2,cy:U/2,r:Ne,fill:`none`,stroke:g,strokeWidth:`10`,strokeLinecap:`round`,pathLength:1,strokeDasharray:1,strokeDashoffset:1-_,transform:`rotate(-90 ${U/2} ${U/2})`})]}),(0,v.jsxs)(`div`,{className:`gauge-center`,children:[(0,v.jsx)(`div`,{className:`gauge-num tab-num`,"data-mark":f?`underline`:void 0,style:{color:g},children:f?y:`—`}),(0,v.jsx)(`div`,{className:`gauge-band`,style:{color:g},children:h})]})]}),(0,v.jsx)(`div`,{className:`cvss-side`,children:b.length>0?(0,v.jsx)(`div`,{className:`cvss-chips`,children:b.map((e,t)=>(0,v.jsxs)(`span`,{className:`cvss-chip m-fade-rise m-stagger-item`,style:{"--i":t},children:[(0,v.jsx)(`span`,{className:`cvss-chip-k`,children:e.label}),(0,v.jsx)(`span`,{className:`cvss-chip-v`,children:e.value})]},t))}):(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:f?`No vector components supplied.`:`Provide a base score 0–10.`})})]}),l&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(l)})]})}var Fe=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-soft)`,`var(--danger)`],Ie=320,W=90,Le=14,Re=12,ze=12,Be=30,Ve=W-10,He=1/5.4;function Ue(e){let t=Math.max(3,Math.floor(Ve*He));return e.length>t?e.slice(0,t-1).trimEnd()+`…`:e}function We(e,t,n,r,i){if(!e)return null;let a=typeof e.label==`string`&&e.label.trim()?e.label.trim():`Series ${t+1}`,o=(Array.isArray(e.curve)?e.curve:[]).filter(e=>Number.isFinite(e)&&e>=0);if(o.length<2)return null;let s=Math.max(...o)||1,c=o.length,l=e=>W+e/(c-1)*i,u=e=>n-e/s*r,d=o.map((e,t)=>`${l(t).toFixed(2)},${u(e).toFixed(2)}`),f=`M${d.join(`L`)}`,p=`M${l(0).toFixed(2)},${n} L${d.join(`L`)} L${l(c-1).toFixed(2)},${n} Z`,m=e.color||Fe[t%Fe.length];return{key:`${a}-${t}`,label:a,color:m,d:p,strokeD:f,baselineY:n}}function Ge(e){let t=(0,I.c)(5),{d:n,color:r,delay:i}=e,a=(0,_.useRef)(null),o;t[0]===i?o=t[1]:(o={delay:i},t[0]=i,t[1]=o),p(a,o);let s;return t[2]!==r||t[3]!==n?(s=(0,v.jsx)(`path`,{ref:a,d:n,fill:`none`,stroke:r,className:`rp-stroke`}),t[2]=r,t[3]=n,t[4]=s):s=t[4],s}function Ke({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,categories:r,overlap:o,footer:s,delay:c}){let l=i[t]||i.chart,u=Be*(1+(Number.isFinite(o)?Math.max(0,Math.min(1,o)):.55)*1.8),d=Ie-W-Le,f=Array.isArray(r)?r:[],p=[];f.forEach((e,t)=>{let n=We(e,t,Re+u+p.length*Be,u,d);n&&p.push(n)});let m=p.length>0?Re+u+(p.length-1)*Be+ze:0;return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(c||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),p.length===0&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide at least one category with two or more curve values.`}),p.length>0&&(0,v.jsx)(`svg`,{viewBox:`0 0 ${Ie} ${m}`,className:`rp-svg`,role:`img`,"aria-label":e,children:p.map((e,t)=>(0,v.jsxs)(`g`,{className:`m-fade-rise m-stagger-item`,style:{"--i":t},children:[(0,v.jsx)(`line`,{x1:W,y1:e.baselineY,x2:Ie-Le,y2:e.baselineY,className:`rp-baseline`}),(0,v.jsx)(`path`,{d:e.d,fill:e.color,className:`rp-area`}),(0,v.jsx)(Ge,{d:e.strokeD,color:e.color,delay:(c||0)+t*60}),(0,v.jsxs)(`text`,{x:W-8,y:e.baselineY+3,className:`rp-label`,textAnchor:`end`,children:[Ue(e.label)!==e.label&&(0,v.jsx)(`title`,{children:e.label}),Ue(e.label)]})]},e.key))}),s&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}var G=320,K=200,q={top:14,right:14,bottom:30,left:42},qe=[0,.25,.5,.75,1];function Je(e){let t=e.length,n=[],r=0,i=0;for(;r<t;){let a=e[r],o=r;for(;o<t&&e[o]===a;)o++;n.push({x:a,y:i/t}),i+=o-r,n.push({x:a,y:i/t}),r=o}return n}function Ye(e){let t=e.length,n=Math.floor(t/2);return t%2==0?(e[n-1]+e[n])/2:e[n]}function Xe({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,values:r,unit:o,color:m=`var(--presence)`,footer:h,delay:g}){let y=i[t]||i.chart,b=(0,_.useRef)(null),x=(0,_.useMemo)(()=>{let e=(Array.isArray(r)?r:[]).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);if(e.length===0)return null;let t=f(e);if(!t)return null;let[n,i]=u(t[0],t[1]),a=l([n,i],[q.left,G-q.right]),o=l([0,1],[K-q.bottom,q.top]),s=Je(e),p=[`M${a(n).toFixed(2)},${o(0).toFixed(2)}`,...s.map(e=>`L${a(e.x).toFixed(2)},${o(e.y).toFixed(2)}`),`L${a(i).toFixed(2)},${o(1).toFixed(2)}`].join(` `),m=c(n,i,d(i-n,5)),h=Ye(e);return{n:e.length,d:p,sx:a,sy:o,xTicks:m,med:h}},[r]);return p(b,{delay:(g||0)+160}),(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(g||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(y,{className:`ic`,style:{color:n}}),` `,e]}),!x&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide at least one numeric value.`}),x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`svg`,{viewBox:`0 0 ${G} ${K}`,className:`ecdf-svg`,role:`img`,"aria-label":e,children:[qe.map(e=>(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`line`,{className:`ecdf-grid`,x1:q.left,y1:x.sy(e),x2:G-q.right,y2:x.sy(e)}),(0,v.jsx)(`text`,{className:`ecdf-tick`,x:q.left-6,y:x.sy(e)+3.5,textAnchor:`end`,children:e.toFixed(2)})]},`g${e}`)),(0,v.jsx)(`line`,{className:`ecdf-axis`,x1:q.left,y1:K-q.bottom,x2:G-q.right,y2:K-q.bottom}),(0,v.jsx)(`line`,{className:`ecdf-axis`,x1:q.left,y1:q.top,x2:q.left,y2:K-q.bottom}),x.xTicks.map(e=>(0,v.jsx)(`text`,{className:`ecdf-tick`,x:x.sx(e),y:K-q.bottom+15,textAnchor:`middle`,children:s(e,{unit:o||void 0})},`xt${e}`)),(0,v.jsx)(`line`,{className:`ecdf-mark-guide`,x1:x.sx(x.med),y1:K-q.bottom,x2:x.sx(x.med),y2:q.top}),(0,v.jsx)(`path`,{ref:b,className:`ecdf-line`,d:x.d,fill:`none`,stroke:m})]}),(0,v.jsxs)(`p`,{className:`ecdf-caption faint tab-num`,children:[`n = `,x.n.toLocaleString(),` · median`,` `,s(x.med,{unit:o||void 0})]})]}),h&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(h)})]})}var J=480,Ze=116,Qe=46,Y=122,X=J-Qe-10,$e=46,Z=1.959964,et={OR:`Odds ratio`,RR:`Risk ratio`,HR:`Hazard ratio`,MD:`Mean difference`,SMD:`Std. mean difference`};function Q(e){return typeof e==`number`&&Number.isFinite(e)}function $(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e3?s(e,{compact:!0}):t>0&&t<.1?s(e,{decimals:3}):s(e,{decimals:t>=100?0:t>=10?1:2})}function tt(e,t,n,r){if(!e||typeof e!=`object`||!Q(e.effect)||!Q(e.ciLow)||!Q(e.ciHigh))return null;let i=Math.min(e.ciLow,e.ciHigh),a=Math.max(e.ciLow,e.ciHigh),o=Math.min(a,Math.max(i,e.effect)),s=!1;n&&(i<=0&&(i=r,s=!0),a<=0&&(a=r,s=!0),o<=0&&(o=r,s=!0),i>a&&([i,a]=[a,i]),o=Math.min(a,Math.max(i,o)));let c=n?Math.log(o):o,l=n?(Math.log(a)-Math.log(i))/(2*Z):(a-i)/(2*Z),u=!s&&Number.isFinite(l)&&l>0?1/(l*l):null,d=typeof e.label==`string`&&e.label.trim()?e.label.trim():`Study ${t+1}`,f=`${d}${Q(e.year)?` ${Math.trunc(e.year)}`:``}${s?` †`:``}`;return{key:`${d}-${t}`,label:f,effect:o,lo:i,hi:a,givenWeight:Q(e.weight)&&e.weight>=0?Math.min(100,e.weight):null,clamped:s,ivWeight:u,theta:c}}function nt(e,t){let n=Math.ceil(e/Math.LN2-1e-9),r=Math.floor(t/Math.LN2+1e-9);if(r<n)return[1];let i=Math.max(1,Math.ceil((r-n+1)/7)),a=[];for(let e=n;e<=r;e++)(e%i+i)%i===0&&a.push(2**e);return a.length?a:[1]}function rt(e){let t=(0,I.c)(14),{label:n,cy:r,maxLines:i,fontSize:a,bold:o}=e,s,c,l,u;if(t[0]!==o||t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==i){let e=g(n,{maxWidth:Ze-8,fontSize:a,minFontSize:7,maxLines:i,lineHeight:1.12,bold:o}),d=e.lines.slice(0,i),f=r-(d.length-1)*e.lineHeightPx/2;s=o?`fpl-lbl fpl-lbl--pooled`:`fpl-lbl`,c=e.fontSize,l=`start`,u=d.map((t,n)=>(0,v.jsx)(`tspan`,{x:2,y:f+n*e.lineHeightPx,dominantBaseline:`central`,children:t},n)),t[0]=o,t[1]=r,t[2]=a,t[3]=n,t[4]=i,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else s=t[5],c=t[6],l=t[7],u=t[8];let d;return t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,v.jsx)(`text`,{className:s,fontSize:c,textAnchor:l,children:u}),t[9]=s,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function it({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,studies:r,measure:o=`OR`,pooled:f,heterogeneity:p,favorsLeft:m,favorsRight:h,footer:g,delay:y}){let b=i[t]||i.chart,x=(0,_.useMemo)(()=>{let e=et[o]?o:`OR`,t=e===`OR`||e===`RR`||e===`HR`,n=+!!t,i=Array.isArray(r)?r:[],a=1/0;for(let e of i)if(!(!e||typeof e!=`object`))for(let t of[e.effect,e.ciLow,e.ciHigh])Q(t)&&t>0&&t<a&&(a=t);if(f&&typeof f==`object`)for(let e of[f.effect,f.ciLow,f.ciHigh])Q(e)&&e>0&&e<a&&(a=e);let s=a===1/0?.01:a/10,p=[];if(i.forEach((e,n)=>{let r=tt(e,n,t,s);r&&p.push(r)}),p.length===0)return null;let m=p.reduce((e,t)=>e+(t.ivWeight??0),0),h=null;if(f&&typeof f==`object`&&Q(f.effect)&&Q(f.ciLow)&&Q(f.ciHigh)){let e=Math.min(f.ciLow,f.ciHigh),n=Math.max(f.ciLow,f.ciHigh);t&&(e=e<=0?s:e,n=n<=0?s:n);let r=Math.min(n,Math.max(e,t&&f.effect<=0?s:f.effect)),i=typeof f.label==`string`&&f.label.trim()?f.label.trim():`Pooled`;h={effect:r,lo:e,hi:n,label:i,computed:!1}}else if(m>0){let e=p.reduce((e,t)=>e+(t.ivWeight??0)*t.theta,0)/m,n=Math.sqrt(1/m),r=e=>t?Math.exp(e):e;h={effect:r(e),lo:r(e-Z*n),hi:r(e+Z*n),label:`Pooled`,computed:!0}}let g=p.map(e=>e.givenWeight===null?e.ivWeight!==null&&m>0?100*e.ivWeight/m:null:e.givenWeight),_=e=>t?Math.log(e):e,v=_(n===0?0:1),y=v,b=e=>{let t=_(e);t<v&&(v=t),t>y&&(y=t)};p.forEach(e=>{b(e.lo),b(e.hi)}),h&&(b(h.lo),b(h.hi));let x;if(t){y-v<1e-9&&(v-=Math.LN2,y+=Math.LN2);let e=(y-v)*.06;x=nt(v,y),v-=e,y+=e}else [v,y]=u(v,y),x=c(v,y,d(y-v,5));let S=l([v,y],[Y,X]),C=e=>S(_(e)),w=p.length,T=Math.max(11,Math.min(24,Math.round(320/w))),E=h?Math.max(T,20):0,D=32+w*T+3,O=D+(h?5+E:4),k=O+$e,A=Math.max(0,...g.filter(e=>e!==null)),j=Math.min(13,T-2);return{mKey:e,isRatio:t,nullValue:n,rows:p,weights:g,summary:h,x:C,axisTicks:x,rowH:T,rowsTop:32,sepY:D,axisY:O,H:k,side:e=>e===null||!(A>0)?4.5:4+(j-4)*Math.sqrt(Math.max(0,e)/A),anyClamped:p.some(e=>e.clamped)}},[r,o,f]),S=Math.min(7,x?x.rowH-4:7);return(0,v.jsxs)(`div`,{className:`card reveal stats-card`,style:{"--delay":(y||0)+`ms`},children:[(0,v.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,v.jsx)(b,{className:`ic`,style:{color:n}}),` `,e||`Forest plot`]}),!x&&(0,v.jsx)(`p`,{className:`faint`,style:{fontSize:13,margin:0},children:`Provide at least one study with an effect and its confidence interval.`}),x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`svg`,{viewBox:`0 0 ${J} ${x.H}`,className:`fpl-svg`,role:`img`,"aria-label":e||`Forest plot`,children:[(0,v.jsx)(`text`,{x:2,y:13,className:`fpl-colhead`,textAnchor:`start`,children:`Study`}),(0,v.jsxs)(`text`,{x:546/2,y:13,className:`fpl-colhead`,textAnchor:`middle`,children:[et[x.mKey],x.isRatio?` (log scale)`:``]}),(0,v.jsx)(`text`,{x:J-2,y:13,className:`fpl-colhead`,textAnchor:`end`,children:`Weight`}),(0,v.jsx)(`line`,{className:`fpl-null`,x1:x.x(x.nullValue),y1:26,x2:x.x(x.nullValue),y2:x.axisY}),x.rows.map((e,t)=>{let n=x.rowsTop+t*x.rowH+x.rowH/2,r=x.weights[t],i=x.side(r),a=x.rowH>=22?2:1,o=x.rowH>=18?10.5:x.rowH>=14?9.5:8.5;return(0,v.jsxs)(`g`,{className:e.clamped?`fpl-row fpl-row--clamped m-stagger-item`:`fpl-row m-stagger-item`,style:{"--i":Math.min(t,15)},children:[(0,v.jsx)(`title`,{children:`${e.label}: ${$(e.effect)} (95% CI ${$(e.lo)} to ${$(e.hi)})`+(r===null?``:`, weight ${s(r,{decimals:1})}%`)+(e.clamped?` — clamped to fit the log axis`:``)}),(0,v.jsx)(rt,{label:e.label,cy:n,maxLines:a,fontSize:o}),(0,v.jsx)(`line`,{className:`fpl-ci`,x1:x.x(e.lo),y1:n,x2:x.x(e.hi),y2:n}),(0,v.jsx)(`line`,{className:`fpl-ci`,x1:x.x(e.lo),y1:n-S/2,x2:x.x(e.lo),y2:n+S/2}),(0,v.jsx)(`line`,{className:`fpl-ci`,x1:x.x(e.hi),y1:n-S/2,x2:x.x(e.hi),y2:n+S/2}),(0,v.jsx)(`rect`,{className:`fpl-sq`,x:x.x(e.effect)-i/2,y:n-i/2,width:i,height:i}),(0,v.jsx)(`text`,{x:J-2,y:n,className:`fpl-wt`,textAnchor:`end`,dominantBaseline:`central`,children:r===null?`—`:`${s(r,{decimals:1})}%`})]},e.key)}),x.summary&&(0,v.jsxs)(`g`,{className:`fpl-row m-fade-rise m-stagger-item`,style:{"--i":Math.min(x.rows.length,16)},children:[(0,v.jsx)(`title`,{children:`${x.summary.label}: ${$(x.summary.effect)} (95% CI ${$(x.summary.lo)} to ${$(x.summary.hi)})`+(x.summary.computed?` — fixed-effect inverse-variance pool`:``)}),(0,v.jsx)(`line`,{className:`fpl-sep`,x1:2,y1:x.sepY,x2:J-2,y2:x.sepY}),(()=>{let e=x.sepY+5+Math.max(x.rowH,20)/2,t=Math.min(7,Math.max(5,x.rowH/2-1)),n=x.x(x.summary.lo),r=x.x(x.summary.hi),i=x.x(x.summary.effect);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(rt,{label:x.summary.label,cy:e,maxLines:1,fontSize:10.5,bold:!0}),(0,v.jsx)(`polygon`,{className:`fpl-diamond`,points:`${n},${e} ${i},${e-t} ${r},${e} ${i},${e+t}`}),(0,v.jsx)(`text`,{x:J-2,y:e,className:`fpl-wt fpl-wt--pooled`,textAnchor:`end`,dominantBaseline:`central`,children:`100%`})]})})()]}),(0,v.jsx)(`line`,{className:`fpl-axis`,x1:Y,y1:x.axisY,x2:X,y2:x.axisY}),x.axisTicks.map(e=>(0,v.jsxs)(`g`,{children:[(0,v.jsx)(`line`,{className:`fpl-axis`,x1:x.x(e),y1:x.axisY,x2:x.x(e),y2:x.axisY+4}),(0,v.jsx)(`text`,{className:`fpl-tick`,x:x.x(e),y:x.axisY+15,textAnchor:`middle`,children:Math.abs(e)>=1e3?s(e,{compact:!0}):s(e)})]},`t${e}`)),typeof m==`string`&&m.trim()&&(0,v.jsx)(at,{text:`← ${m.trim()}`,x:Y,anchor:`start`,y:x.axisY+28}),typeof h==`string`&&h.trim()&&(0,v.jsx)(at,{text:`${h.trim()} →`,x:X,anchor:`end`,y:x.axisY+28})]}),(0,v.jsxs)(`p`,{className:`fpl-caption faint tab-num`,children:[x.summary?`${x.summary.label} ${x.mKey} ${$(x.summary.effect)} (95% CI ${$(x.summary.lo)}–${$(x.summary.hi)})`+(x.summary.computed?` · fixed-effect, inverse-variance`:``):`${x.rows.length} ${x.rows.length===1?`study`:`studies`}`,typeof p==`string`&&p.trim()?` · ${p.trim()}`:``]}),x.anyClamped&&(0,v.jsx)(`p`,{className:`fpl-caption faint`,children:`† interval clamped — a log axis cannot place values ≤ 0.`})]}),g&&(0,v.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(g)})]})}function at(e){let t=(0,I.c)(13),{text:n,x:r,anchor:i,y:a}=e,o,s,c,l;if(t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==a){let e=g(n,{maxWidth:(X-Y)/2-8,fontSize:9,minFontSize:7,maxLines:2,lineHeight:1.15});o=`fpl-favors`,s=e.fontSize,c=i,l=e.lines.slice(0,2).map((t,n)=>(0,v.jsx)(`tspan`,{x:r,y:a+n*e.lineHeightPx,children:t},n)),t[0]=i,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else o=t[4],s=t[5],c=t[6],l=t[7];let u;return t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,v.jsx)(`text`,{className:o,fontSize:s,textAnchor:c,children:l}),t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}var ot=e({statsRegistry:()=>st}),st={sparkstat:h(y),counter:h(b),herostat:h(x),trendtile:h(T),scorebadge:h(E),percentilebar:h(D),statpair:h(O),scorecard:h(k),deltacascade:h(A),bulletkpi:h(j),confusionmatrix:h(se),kpidashboard:h(ue),abtestresult:h(he),powersample:h(Ce),inventoryreorder:h(De),boardgamescore:h(ke),cvssscorecard:h(Pe),ridgeplot:h(Ke),ecdf:h(Xe),forestplot:h(it)};export{st as n,ot as t};
|