@graphysdk/react-renderer 0.0.1-plugins.3 → 0.0.1-plugins.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,3 @@
1
1
  require('./index.css');
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),E=require("clsx"),g=require("react"),ee=require("zustand"),b=require("@graphysdk/viz-engine"),a=require("./tooltip-body-B4Mj-oru.cjs"),dr=require("motion/react"),_=require("zustand/react/shallow"),w=require("@floating-ui/react-dom"),hr=require("@tiptap/core"),Ke=require("@tiptap/extension-bold"),he=require("@tiptap/extension-document"),Ze=require("@tiptap/extension-hard-break"),Je=require("@tiptap/extension-heading"),Qe=require("@tiptap/extension-italic"),et=require("@tiptap/extension-link"),tt=require("@tiptap/extension-text"),rt=require("@tiptap/extension-text-align"),R=require("@tiptap/extension-text-style"),nt=require("@tiptap/extension-underline"),te=require("@tiptap/extensions"),gr=require("@tiptap/extension-paragraph"),ve=require("@tiptap/react"),S=require("@base-ui/react/toolbar"),B=require("@base-ui/react/tooltip"),xr=require("react-dom"),fr=require("@vanilla-extract/dynamic"),k=require("@base-ui/react/popover"),we=require("react-colorful"),A=require("@base-ui/react/menu"),pr=require("@base-ui/react/toggle"),mr=require("color2k");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.reactRenderer="0.0.1-plugins.3");var vr="drqe3u0",yr="drqe3u1",br="drqe3u2",jr="drqe3u3",K="drqe3u4",Tr="drqe3u5",Cr="drqe3u6",Sr="drqe3u7",ie="drqe3u8",kr="drqe3u9",wr="drqe3ua",Ar="drqe3ub",Er="drqe3uc",_r="drqe3ud",Lr="drqe3ue",Fr="drqe3uf",Nr="drqe3ug",Pr="drqe3uh",Mr="drqe3ui",Ae={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},Ee={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},st={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"};const Or=({width:e=380,style:t,className:r}={})=>{const{compileBus:s}=a.useGraphContext(),[o]=g.useState(()=>a.createDevToolsStore()),[i,c]=g.useState(!1),[l,u]=g.useState(b.isCompilerCachingEnabled);g.useEffect(()=>{const{recordCompile:m}=o.getState(),p=s.getLastTrigger(),y=s.getLastCompile();return p&&y&&m(p,y),s.subscribe(m)},[o,s]);const d=ee.useStore(o,m=>m.lastCompile),h=ee.useStore(o,m=>m.history),f=s.getCacheStats(),x=d===null&&h.length===0,v=()=>{u(m=>{const p=!m;return b.setCompilerCachingEnabled(p),p})};return n.jsxs("div",{className:E(wr,r),style:{width:e,...t},children:[n.jsxs("div",{className:vr,children:[n.jsxs("div",{children:[n.jsx("div",{className:yr,children:"compile cache"}),n.jsx("div",{className:Lr,children:x?"production: stats disabled":d?`last: ${d.label} · ${ot(d.durationMs)}`:"awaiting first compile…"})]}),n.jsx("button",{type:"button",onClick:()=>c(m=>!m),className:Fr,children:i?"▾":"▴"})]}),!i&&n.jsxs("div",{className:Ar,children:[n.jsxs("button",{type:"button",onClick:v,className:l?Ae.enabled:Ae.disabled,"aria-pressed":l,children:["cache ",l?"enabled":"disabled"]}),n.jsx("span",{className:Nr,children:"next compile reflects this toggle"})]}),!i&&!x&&n.jsxs(n.Fragment,{children:[n.jsx(Dr,{delta:d?.stages,cumulative:f}),n.jsx(Ir,{entries:h})]})]})},Dr=({delta:e,cumulative:t})=>n.jsxs("table",{className:br,children:[n.jsx("thead",{children:n.jsxs("tr",{className:Pr,children:[n.jsx("th",{className:jr,children:"stage"}),n.jsx("th",{className:K,children:"Δ miss"}),n.jsx("th",{className:K,children:"Δ hit"}),n.jsx("th",{className:K,children:"total miss"}),n.jsx("th",{className:K,children:"total hit"})]})}),n.jsx("tbody",{children:b.COMPILER_STAGE_KEYS.map(r=>{const s=e?.[r],o=Br(s);return n.jsxs("tr",{className:Er,children:[n.jsxs("td",{className:Tr,children:[n.jsx("span",{className:st[o],"aria-hidden":!0})," ",r]}),n.jsx("td",{className:o==="ran"?Ee.ran:Ee.dim,children:s?.misses??0}),n.jsx("td",{className:ie,children:s?.hits??0}),n.jsx("td",{className:ie,children:t[r].misses}),n.jsx("td",{className:ie,children:t[r].hits})]},r)})})]}),Ir=({entries:e})=>e.length===0?null:n.jsxs("div",{className:_r,children:[n.jsx("div",{className:Mr,children:"recent compiles"}),e.map(t=>{const r=Rr(t.stages,i=>i.misses>0),s=b.COMPILER_STAGE_KEYS.length,o=r===0?"cached":"ran";return n.jsxs("div",{className:Cr,children:[n.jsx("span",{className:st[o],"aria-hidden":!0}),n.jsx("span",{className:Sr,title:t.label,children:t.label}),n.jsxs("span",{className:kr,children:[r,"/",s," ran · ",ot(t.durationMs)]})]},t.id)})]}),Br=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",Rr=(e,t)=>{let r=0;for(const s of b.COMPILER_STAGE_KEYS)t(e[s])&&(r+=1);return r},ot=e=>e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,Hr={small:1.9,medium:2.3,large:2.6},Gr={small:1,medium:1,large:1.2},$r=a.DEFAULT_FONT_FAMILY,at=a.FONT_LINE_HEIGHT.sm,zr=12,qr=4,Vr=4,Wr=12,Yr=4,Ur=2,it=24;function W(e){const{store:t}=a.useHoverContext();return ee.useStore(t,e)}const Xr=e=>{const{cursorRef:t,subscribeCursorMove:r}=a.useHoverContext(),s=W(i=>i.isPointerInside),o=g.useRef(e);return o.current=e,g.useEffect(()=>r(()=>o.current?.()),[r]),{cursorRef:t,isInside:s}},Kr=16,Zr=8,Jr={x:0,y:0,top:0,left:0,right:0,bottom:0,width:0,height:0,toJSON:()=>({})},Qr=()=>{const e=a.useCompiledSelector(_.useShallow(j=>({layers:j.layers,coordSystem:j.coordSystem,scales:j.scales,guides:j.guides,numberFormat:j.config.numberFormat,parsingLocale:j.config.parsingLocale}))),{formattingLocale:t}=a.useGraphContext(),r=W(j=>j.hover),s=a.useResolveGeomPlugin(),o=g.useRef(()=>{}),{cursorRef:i,isInside:c}=Xr(()=>o.current()),l=g.useMemo(()=>b.buildTooltipContent({...e,hover:r,formattingLocale:t}),[e,r,t]),u=l!==null&&c,d=g.useMemo(()=>({getBoundingClientRect:()=>{const j=i.current;return j===null?Jr:en(j)}}),[i]),{refs:h,floatingStyles:f,update:x}=w.useFloating({open:u,placement:"right",middleware:[w.offset(Kr),w.flip(),w.shift({padding:Zr})],elements:{reference:d}});if(o.current=x,!u)return null;const v=r.primary,m=v===null?null:e.layers.find(j=>j.id===v.layerId)??null,p=m===null?null:s(m,e.coordSystem),y=v!==null&&m!==null&&p?.renderTooltip?p.renderTooltip({content:l,layer:m,coordSystem:e.coordSystem,primary:v,group:r.group,related:r.related}):null;return n.jsx("div",{ref:h.setFloating,role:"tooltip",className:a.root,style:f,"data-testid":"chart-tooltip",children:y??n.jsx(a.TooltipBody,{content:l})})},en=e=>({x:e.clientX,y:e.clientY,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,width:0,height:0,toJSON:()=>({})}),ye=a.FONT_SIZE_EM.sm,lt=a.DEFAULT_FONT_FAMILY,ct=!1,Z=6,P=10,tn=(e,t)=>r=>{if(!r.isVisible||r.ticks.length===0)return 0;const s=r.position==="top"||r.position==="bottom",o=r.ticks.map(l=>e.measureText(l.formattedLabel,{family:lt,size:a.emToPx(ye,t)})),i=r.labelMaxWidthPx??Number.POSITIVE_INFINITY;if(s){if(r.labelRotation!==0){const l=o.map(d=>d.width);return _e(l,i)+2*P}return Math.max(...o.map(l=>l.height))+P}return _e(o.map(l=>l.width),i)+P},_e=(e,t)=>Math.min(Math.max(...e),t),rn=e=>()=>a.emToPx(ye,e),nn=(e,t)=>(r,s)=>{const{labelLineHeight:o,labelFontWeight:i}=b.getDifferenceArrowDimensions(s,t);return e.measureText(r,{family:a.DEFAULT_FONT_FAMILY,size:o,weight:i})},ut=e=>{const{value:t,observationLabel:r,comparison:s,swatch:o,label:i}=e;return[{role:"valueRow",gap:Vr,segments:le([J("value","value",t??"–"),J("observation","label",r)])},{role:"trendRow",gap:Yr,ariaLabel:s===null?void 0:ln(s),segments:le([on(s),an(s),J("trendReference","label",s?.reference??null)])},{role:"groupRow",gap:qr,segments:le([sn(o),J("label","label",i)])}].filter(l=>l.segments.length>0)},J=(e,t,r)=>r===null?null:{kind:"text",textRole:e,fontRole:t,text:r},sn=e=>e===null?null:{kind:"swatch",swatch:e,size:zr},on=e=>e===null?null:{kind:"trendArrow",direction:e.direction,size:Wr},an=e=>e===null?null:{kind:"text",textRole:"trendPercentage",fontRole:"label",text:e.percentage,trendDirection:e.direction},ln=e=>{switch(e.direction){case"up":return`Increased ${e.percentage} ${e.reference}`;case"down":return`Decreased ${e.percentage} ${e.reference}`;case"flat":return`No change ${e.reference}`}},le=e=>e.filter(t=>t!==null),cn=(e,t)=>(r,s)=>{const o=dt(r,s,e,t),i=ht(o.map(l=>l.width)),c=Math.max(0,o.length-1)*it;return{width:i+c,height:Math.max(0,...o.map(l=>l.height))}},un=(e,t)=>(r,s)=>dt(r,s,e,t).map(o=>o.width),dn=(e,t)=>(r,s)=>{const o=ge("value",s,t);return{width:e.measureText(r,o).width,height:o.size*at}},hn=(e,t)=>{const r=cn(e,t),s=dn(e,t);return(o,i)=>o.kind==="perGroup"?r(o,i):s(o.value,i)},dt=(e,t,r,s)=>{const o={value:ge("value",t,s),label:ge("label",t,s)},i=c=>gn(c,o,r);return e.items.map(c=>{const l=ut(c).map(i),u=Math.max(0,l.length-1)*Ur;return{width:Math.max(0,...l.map(d=>d.width)),height:ht(l.map(d=>d.height))+u}})},gn=(e,t,r)=>{let s=0,o=0;for(const i of e.segments)if(i.kind==="text"){const c=t[i.fontRole];s+=r.measureText(i.text,c).width,o=Math.max(o,c.size*at)}else s+=i.size,o=Math.max(o,i.size);return{width:s+Math.max(0,e.segments.length-1)*e.gap,height:o}},ge=(e,t,r)=>{const s=e==="value"?Hr[t]:Gr[t];return{family:$r,size:a.emToPx(s,r)}},ht=e=>e.reduce((t,r)=>t+r,0),be=12,gt=10,xt=8,xn=8,fn=8,pn=2,ft=1,pt=2,mt=4,vt=a.FONT_SIZE_EM.sm,yt=a.FONT_LINE_HEIGHT.sm,bt=a.DEFAULT_FONT_FAMILY,jt=2*(fn+ft),je=2*(pn+ft),mn=pt*mt,Tt=e=>{const t=a.emToPx(vt,e);return{fontSizePx:t,lineBoxHeight:t*yt}},Ct=e=>e?gt:0,vn=(e,t)=>r=>{if(r.items.length===0)return 0;const{fontSizePx:s,lineBoxHeight:o}=Tt(t),i={family:bt,size:s};if(r.position==="top"||r.position==="bottom")return Math.max(o,be)+je;const l=r.items.map(u=>{const d=e.measureText(u.formattedLabel,i).width,h=Ct(u.visual.color);return h+(h>0?xt:0)+d});return Math.max(...l)+jt},yn=(e,t)=>r=>e.measureText(r,{family:lt,size:a.emToPx(ye,t)}),bn=(e,t)=>g.useMemo(()=>e?{measureAxis:tn(e,t),measureAxisLabel:rn(t),measureLegend:vn(e,t),measureHeadline:hn(e,t),measureHeadlineItemWidths:un(e,t),measureTickLabel:yn(e,t),measureDifferenceArrowLabel:nn(e,t)}:null,[e,t]),jn=({measurer:e,axes:t,numberFormat:r,parsingLocale:s,formattedLegends:o,containerSize:i,externalMeasurements:c,headline:l,formattingLocale:u,annotations:d,coordSystem:h,textScale:f})=>g.useMemo(()=>e?new b.LayoutCompiler(e).compile({axes:t,numberFormat:r,parsingLocale:s,formattedLegends:o,containerSize:i,externalMeasurements:c,headline:l,formattingLocale:u,annotations:d,coordSystem:h,textScale:f}):null,[t,r,s,o,i,c,l,u,d,h,f,e]),Le="data-variant",St=gr.Paragraph.extend({addAttributes(){return{variant:{default:null,parseHTML:e=>e.getAttribute(Le)??null,renderHTML:e=>e.variant?{[Le]:e.variant}:{}}}}}),Tn=hr.Extension.create({name:"preventBackspaceAcrossTitleBoundary",addOptions(){return{isTitleVisible:!0}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{if(!this.options.isTitleVisible)return!1;const{selection:t}=e.state;if(!t.empty)return!1;const{$from:r}=t;return r.depth!==1||r.parentOffset!==0?!1:r.index(0)===1}}}}),Cn=({titlePlaceholder:e,subtitlePlaceholder:t,isTitleVisible:r,isSubtitleVisible:s})=>[kn({isTitleVisible:r,isSubtitleVisible:s}),St,tt.Text,te.UndoRedo,Je.Heading.configure({levels:[1,2,3]}),Ke.Bold,Qe.Italic,nt.Underline,rt.TextAlign.configure({types:["heading","paragraph"]}),et.Link.configure({openOnClick:!1,autolink:!0}),R.TextStyle,R.Color,R.FontFamily,Ze.HardBreak,Tn.configure({isTitleVisible:r}),te.Placeholder.configure({showOnlyCurrent:!1,placeholder:({pos:o,editor:i})=>{if(r&&o===0)return e;const c=r?i.state.doc.firstChild?.nodeSize??-1:0;return s&&o===c?t:""}})],Sn=({placeholder:e})=>[he.Document,St,tt.Text,te.UndoRedo,Je.Heading.configure({levels:[1,2,3]}),Ke.Bold,Qe.Italic,nt.Underline,rt.TextAlign.configure({types:["heading","paragraph"]}),et.Link.configure({openOnClick:!1,autolink:!0}),R.TextStyle,R.Color,R.FontFamily,Ze.HardBreak,te.Placeholder.configure({showOnlyCurrent:!1,placeholder:({pos:t})=>t===0?e:""})],kn=({isTitleVisible:e,isSubtitleVisible:t})=>e&&t?he.Document.extend({content:"block{2,}"}):he.Document,T=(e,t)=>`color-mix(in srgb, transparent, ${e} ${t*100}%)`,se=(e,t)=>`hsl(from ${e} h s calc(l * ${1-t}))`,kt=(e,t)=>`hsl(from ${e} h s calc(l * ${1+t}))`,xe=(e,t,r)=>`color-mix(in srgb, ${e}, ${t} ${r*100}%)`,wn=e=>/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e),An=e=>e.length===0?!1:typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("color",e):/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),wt={elevationXs:"0 0 2px rgba(15, 15, 24, 0.12), 0 2px 2px rgba(14, 14, 52, 0.08)",elevationSm:"0 0 4px rgba(15, 15, 24, 0.12), 0 4px 4px rgba(14, 14, 52, 0.08)",elevationMd:"0 0 8px rgba(15, 15, 24, 0.12), 0 8px 8px rgba(14, 14, 52, 0.08)",elevationLg:"0 0 16px rgba(15, 15, 24, 0.12), 0 16px 16px rgba(14, 14, 52, 0.08)"},At={radiiXs:"4px",radiiSm:"6px",radiiMd:"8px",radiiLg:"12px"},Et={zIndexToolbar:"10",zIndexToolbarTooltip:"20",zIndexToolbarPopover:"30"},En=8,I=e=>`${En*e}px`,_t={spaceXxs:I(.25),spaceXs:I(.5),spaceSm:I(.75),spaceMd:I(1),spaceLg:I(1.5),spaceXl:I(2)},_n={transparent:"transparent",white:"#FFFFFF",black:"#000000",grey100:"#000000",grey95:"#0D0D0D",grey90:"#1A1A1A",grey85:"#1F1F1F",grey80:"#2A2A2A",grey75:"#2e2e2e",grey70:"#353535",grey60:"#494949",grey50:"#6F6F6F",grey0:"#FFFFFF",red60:"#CB3333",red50:"#F93939",amber70:"#F48135",amber50:"#FEAE47",amber40:"#FFC849",amber30:"#ffd061",green60:"#0AC600",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",greyGradient80:"linear-gradient(to top, #222429, #31353f)"},Ln={textPrimary:a.vars.grey0,textSecondary:T(a.vars.textPrimary,.8),textDisabled:T(a.vars.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:T(a.vars.textPrimary,.6),iconStickerBackground:a.vars.grey70,border100:a.vars.grey0,border50:T(a.vars.grey0,.5),border10:T(a.vars.grey0,.1),brand:a.vars.purple50,success:a.vars.green50,warning:a.vars.amber50,alert:a.vars.red50,sunkenBackground:a.vars.grey100,defaultBackground:a.vars.grey90,raisedBackground:a.vars.grey80,overlayBackground:a.vars.grey90,overlayBorderGradient:a.vars.greyGradient80},Fn={graphBackground:a.vars.grey90,gridLineColor:a.vars.border10,originLineColor:a.vars.grey0,targetLineColor:a.vars.border100,targetLineMarkerColor:a.vars.border100,targetLineLabelTextColor:a.vars.grey100,legendBackground:a.vars.defaultBackground,legendBorderColor:a.vars.border10,legendFocusOutlineColor:a.vars.border50,legendTextColor:a.vars.textPrimary,dimmedSeriesLabelTextColor:a.vars.textDisabled,dimmedSeriesLabelLineColor:a.vars.grey60,trendNegativeColor:a.vars.red60,trendPositiveColor:a.vars.green60,trendNeutralColor:a.vars.textSecondary,toolbarBackgroundColor:a.vars.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:a.vars.grey80,toolbarButtonBackgroundColorSelected:a.vars.grey60,toolbarSeparatorColor:a.vars.grey60,tooltipBackground:a.vars.grey70,tooltipBorderColor:a.vars.grey60,tooltipHeadingTextColor:a.vars.textPrimary,tooltipLabelTextColor:a.vars.textSecondary,tooltipValueTextColor:a.vars.textPrimary,tooltipPrimaryRowColor:a.vars.grey60,hoverGuideLineColor:T(a.vars.white,.08),hoverGuideFillColor:T(a.vars.white,.06),hoveredBarBorderColor:a.vars.white,hoveredPointRingColor:a.vars.white,pointStrokeColor:a.vars.white,stackedBarHoverBorderColor:a.vars.grey0,heatmapEmptyTileBackground:a.vars.grey80,dataLabelOutsideBackground:T(a.vars.textPrimary,.1),defaultAnnotationArrowStroke:a.vars.white,defaultAnnotationShapeStroke:a.vars.white,defaultAnnotationShapeFill:a.vars.canvasBlue,arrowAnnotationStickerOutlineColor:"#FFFFFF",arrowAnnotationStickerOutlineColorInverse:"#1D2129",annotationFrameBorderColor:a.vars.blue60,annotationMenuTriggerIconColor:a.vars.white},Nn={canvasDefault:"#FFFFFF",canvasBlue:"#60a5fa",canvasCyan:"#22d3ee",canvasGreen:"#34d399",canvasYellow:"#FFC800",canvasOrange:"#fb923c",canvasRed:"#f87171",canvasPink:"#F979D9",canvasPurple:"#a78bfa",canvasGray:"#a8a29e",canvasInverse:"#000000"},Pn={..._n,...Ln,...wt,...At,..._t,...Et,...Fn,...Nn,...a.baseTypographyTokens,...a.semanticTypographyTokens,...a.elementTypographyTokens},Mn={transparent:"transparent",white:"#FFFFFF",black:"#000000",grey100:"#FFFFFF",grey95:"#FCFCFC",grey90:"#FAFAFA",grey85:"#F5F5F5",grey80:"#F0F0F0",grey75:"#E8E8E8",grey70:"#E5E5E5",grey60:"#CCCCCC",grey50:"#C4C4C4",grey0:"#1D2129",red60:"#E14B49",red50:"#F93939",amber70:"#FFBA8C",amber50:"#FFC849",amber40:"#FEAE47",amber30:"#E7A816",green60:"#06B299",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",greyGradient80:"linear-gradient(to top, #F0F0F1, #F9F9FF)"},On={textPrimary:a.vars.black,textSecondary:T(a.vars.textPrimary,.6),textDisabled:T(a.vars.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:T(a.vars.textPrimary,.6),iconStickerBackground:a.vars.grey100,brand:a.vars.purple50,success:a.vars.green50,warning:a.vars.amber50,alert:a.vars.red50,border100:a.vars.grey0,border50:T(a.vars.grey0,.5),border10:T(a.vars.grey0,.1),sunkenBackground:a.vars.grey90,defaultBackground:a.vars.grey100,raisedBackground:a.vars.grey85,overlayBackground:a.vars.grey100,overlayBorderGradient:a.vars.border10},Dn={graphBackground:a.vars.grey100,gridLineColor:a.vars.border10,originLineColor:a.vars.grey0,targetLineColor:a.vars.border100,targetLineMarkerColor:"#A0A6C5",targetLineLabelTextColor:a.vars.grey100,legendBackground:a.vars.defaultBackground,legendBorderColor:a.vars.border10,legendFocusOutlineColor:a.vars.border50,legendTextColor:a.vars.textPrimary,dimmedSeriesLabelTextColor:a.vars.textDisabled,dimmedSeriesLabelLineColor:a.vars.grey60,trendNegativeColor:a.vars.red60,trendPositiveColor:a.vars.green60,trendNeutralColor:a.vars.textSecondary,toolbarBackgroundColor:a.vars.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:a.vars.grey80,toolbarButtonBackgroundColorSelected:a.vars.grey60,toolbarSeparatorColor:a.vars.grey60,tooltipBackground:a.vars.white,tooltipBorderColor:a.vars.border10,tooltipHeadingTextColor:a.vars.textPrimary,tooltipLabelTextColor:a.vars.textSecondary,tooltipValueTextColor:a.vars.textPrimary,tooltipPrimaryRowColor:a.vars.grey80,hoverGuideLineColor:T(a.vars.black,.08),hoverGuideFillColor:T(a.vars.black,.04),hoveredBarBorderColor:a.vars.white,hoveredPointRingColor:a.vars.white,pointStrokeColor:a.vars.white,stackedBarHoverBorderColor:a.vars.grey0,heatmapEmptyTileBackground:a.vars.grey80,dataLabelOutsideBackground:T(a.vars.textPrimary,.1),defaultAnnotationArrowStroke:a.vars.black,defaultAnnotationShapeStroke:a.vars.black,defaultAnnotationShapeFill:a.vars.canvasBlue,arrowAnnotationStickerOutlineColor:"#1D2129",arrowAnnotationStickerOutlineColorInverse:"#FFFFFF",annotationFrameBorderColor:a.vars.blue60,annotationMenuTriggerIconColor:"#3d414c"},In={canvasDefault:"#000000",canvasBlue:"#3b82f6",canvasCyan:"#06b6d4",canvasGreen:"#10b981",canvasYellow:"#E5B400",canvasOrange:"#f97316",canvasRed:"#ef4444",canvasPink:"#E845BF",canvasPurple:"#8b5cf6",canvasGray:"#78716c",canvasInverse:"#ffffff"},Bn={...Mn,...On,...wt,...At,..._t,...Et,...Dn,...In,...a.baseTypographyTokens,...a.semanticTypographyTokens,...a.elementTypographyTokens},re=.1,Rn={light:.05,dark:.1},Hn=(e,t)=>{switch(e.type){case"none":return null;case"solid":return e.color;case"tinted":return zn(e.color,t);case"gradient":return qn(e.color,t);case"preset":return b.BORDER_PRESET_GRADIENTS[e.preset]}},Gn=e=>e.type==="none"?0:e.width,$n=(e,t,r)=>{if(e.type==="solid")return e.color;if(e.type==="tinted")return xe(r,e.color,Rn[t])},zn=(e,t)=>t==="dark"?se(e,re):kt(e,re),qn=(e,t,r=90)=>{const s=e,o=t==="dark"?se(e,re):kt(e,re);return`linear-gradient(${r}deg, ${s} 0%, ${o} 100%)`};var Vn="bow4tg0",Wn="bow4tg1",Yn="bow4tg2",Un="bow4tg3",Lt="_1ii3bsb0",Ft="_1ii3bsb1";const Te=g.createContext(null),Ce=()=>{const e=g.useContext(Te);if(!e)throw new Error("useThemeContext must be used inside a <ThemeProvider>.");return e},Nt=({theme:e,themeOverrides:t={},appearance:r,children:s})=>{const o=g.useMemo(()=>({...e==="dark"?Pn:Bn,...t}),[e,t]),i=g.useMemo(()=>{const l={[a.vars.textScale]:String(r.textScale)};for(const[d,h]of Object.entries(t))l[a.vars[d]]=h;const u=$n(r.background,e,o.graphBackground);return u!==void 0&&(l[a.vars.graphBackground]=u),fr.assignInlineVars(l)},[r.textScale,r.background,e,o.graphBackground,t]),c=g.useMemo(()=>({theme:e,themeClass:e==="dark"?Ft:Lt,inlineVarsStyle:i,themeValues:o}),[e,i,o]);return n.jsx(Te.Provider,{value:c,children:s})},O=({children:e,className:t,style:r})=>{const s=g.useContext(Te),o=s?E(s.themeClass,Wn):void 0,i=s?{...s.inlineVarsStyle,...r}:r;return n.jsx("div",{className:E(o,t),style:i,children:e})},Xn="graphy_root",D=()=>typeof document>"u"?null:document.getElementById(Xn)??document.body;var Kn="yp3g0k0",Zn="yp3g0k1",Pt="yp3g0k3",Jn="yp3g0k4",Mt="yp3g0k5",fe="yp3g0k6",Qn="yp3g0k7",es="yp3g0k8",Ot="yp3g0k9",ts="yp3g0ka",rs="yp3g0kb",ns="yp3g0kc",ss="yp3g0kd",os="yp3g0ke";const as=a.CANVAS_COLOR_KEYS.map(e=>a.vars[e]),is=Object.fromEntries(a.CANVAS_COLOR_KEYS.map(e=>[a.vars[e],e])),ls=({editor:e,currentColor:t,isOpen:r,onOpenChange:s})=>{const o=us(),i=g.useCallback(l=>{e.chain().setColor(l).run()},[e]),c=l=>{e.chain().focus().setColor(l).run(),s(!1)};return n.jsxs(k.Popover.Root,{open:r,onOpenChange:s,children:[n.jsx(k.Popover.Trigger,{render:n.jsx(S.Toolbar.Button,{}),"aria-label":"Text color",className:Kn,onMouseDown:l=>l.preventDefault(),children:n.jsx("span",{className:Zn,style:{background:t??"transparent"}})}),n.jsx(k.Popover.Portal,{container:D(),children:n.jsx(O,{children:n.jsx(k.Popover.Positioner,{sideOffset:6,align:"start",className:Pt,children:n.jsxs(k.Popover.Popup,{className:Jn,onMouseDown:l=>l.preventDefault(),children:[n.jsx(Fe,{title:"Colors",colors:as,currentColor:t,onPick:c}),o.length>0&&n.jsx(Fe,{title:"Chart colors",colors:o,currentColor:t,onPick:c}),n.jsx(cs,{value:t??"#000000",onChange:i})]})})})})]})},Fe=({title:e,colors:t,currentColor:r,onPick:s})=>n.jsxs("div",{className:Mt,children:[n.jsx("div",{className:fe,children:e}),n.jsx("div",{className:Qn,children:t.map(o=>n.jsx("button",{type:"button","aria-label":o,className:es,"data-active":hs(o,r),onMouseDown:i=>i.preventDefault(),onClick:()=>s(o),children:n.jsx("span",{className:Ot,style:Dt(o)})},o))})]}),cs=({value:e,onChange:t})=>{const[r,s]=g.useState(!1),o=An(e)?e:"#000000",i=ds(o);return n.jsxs(k.Popover.Root,{open:r,onOpenChange:s,children:[n.jsxs("div",{className:Mt,children:[n.jsx("div",{className:fe,children:"Custom"}),n.jsxs(k.Popover.Trigger,{className:ts,onMouseDown:c=>c.preventDefault(),"aria-label":"Pick custom color",children:[n.jsx("span",{className:Ot,style:Dt(o)}),n.jsx("span",{className:rs,children:i})]})]}),n.jsx(k.Popover.Portal,{container:D(),children:n.jsx(O,{children:n.jsx(k.Popover.Positioner,{side:"right",align:"start",sideOffset:18,className:Pt,children:n.jsxs(k.Popover.Popup,{className:ns,onMouseDown:c=>c.preventDefault(),children:[n.jsx("div",{className:fe,children:"Pick color"}),n.jsx(we.HexColorPicker,{color:i,onChange:t,className:ss}),n.jsx(we.HexColorInput,{color:i,onChange:t,prefixed:!0,className:os,onMouseDown:c=>c.stopPropagation()})]})})})})]})},us=()=>{const e=a.useCompiledSelector(t=>t.scales.color);return g.useMemo(()=>{if(!e||e.kind!=="visual")return[];const t=new Set;for(const r of e.domain){const s=e.map(r);typeof s=="string"&&t.add(s)}return[...t]},[e])},Dt=e=>({background:e,border:`1px solid ${se(e,.1)}`}),ds=e=>{const{themeValues:t}=Ce();if(wn(e))return e.toUpperCase();const r=is[e];return r?t[r].toUpperCase():"#000000"},hs=(e,t)=>t===null?!1:e.toLowerCase()===t.toLowerCase(),gs={xxs:8,xs:12,sm:16,md:20,lg:24,xl:36};var xs={primary:"asohov1 asohov0",secondary:"asohov2 asohov0"};const N=({children:e,title:t,variant:r="primary",size:s="sm",...o})=>{const i=g.useId(),c=gs[s];return n.jsxs("svg",{className:xs[r],"aria-labelledby":t?i:void 0,height:c,width:c,fill:"none",viewBox:"0 0 24 24",role:"img",...o,children:[t&&n.jsx("title",{id:i,children:t}),e]})},It=e=>n.jsx(N,{...e,children:n.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m6 9 6 6 6-6"})})}),fs="'Noto Serif', Georgia, 'Times New Roman', serif, 'Apple Color Emoji', 'NotoColorEmoji'",Bt=`'Aeonik', 'Aeonik Fallback', ${a.DEFAULT_FONT_FAMILY}`,ps="'PT Mono', 'Courier New', monospace, 'Apple Color Emoji', 'NotoColorEmoji'",ms="'Intruding Cat', cursive, 'Apple Color Emoji', 'NotoColorEmoji'",vs=`var(--brand-font-family), ${Bt}`,pe=[{id:"modern",label:"Modern",preview:"Aa",fontFamily:a.DEFAULT_FONT_FAMILY},{id:"fresh",label:"Fresh",preview:"Aa",fontFamily:Bt},{id:"timeless",label:"Timeless",preview:"Aa",fontFamily:fs},{id:"technical",label:"Technical",preview:"00",fontFamily:ps},{id:"fineliner",label:"Fineliner",preview:"Aa",fontFamily:ms},{id:"brand",label:"Brand",preview:"Aa",fontFamily:vs}],ys=e=>e?pe.find(t=>t.fontFamily===e)??null:null;var Rt="_1qkyw7q0",Ht="_1qkyw7q1",Gt="_1qkyw7q3",$t="_1qkyw7q4",zt="_1qkyw7q5";const bs=({editor:e,currentFontFamily:t,isOpen:r,onOpenChange:s})=>{const o=ys(t)??pe[0],i=c=>{e.chain().focus().setFontFamily(c.fontFamily).run()};return n.jsxs(A.Menu.Root,{open:r,onOpenChange:s,children:[n.jsxs(A.Menu.Trigger,{render:n.jsx(S.Toolbar.Button,{}),"aria-label":"Font family",className:Rt,onMouseDown:c=>c.preventDefault(),children:[n.jsx("span",{className:Ht,style:{fontFamily:o?.fontFamily},children:o?.preview}),n.jsx(It,{size:"sm"})]}),n.jsx(A.Menu.Portal,{container:D(),children:n.jsx(O,{children:n.jsx(A.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:Gt,children:n.jsx(A.Menu.Popup,{className:$t,onMouseDown:c=>c.preventDefault(),children:pe.map(c=>n.jsx(A.Menu.Item,{className:zt,"data-selected":c.id===o?.id,onClick:()=>i(c),children:n.jsx("span",{style:{fontFamily:c.fontFamily},children:c.label})},c.id))})})})})]})},qt={id:"text",label:"Text",previewFont:a.vars.fontTextEditorBody},Ne=[{id:"caption",label:"Caption",previewFont:a.vars.fontTextEditorH6},qt,{id:"h3",label:"Heading 3",previewFont:a.vars.fontTextEditorH3},{id:"h2",label:"Heading 2",previewFont:a.vars.fontTextEditorH2},{id:"h1",label:"Heading 1",previewFont:a.vars.fontTextEditorH1}],js=({editor:e,activeStyle:t,isOpen:r,onOpenChange:s})=>{const o=Ne.find(i=>i.id===t)??qt;return n.jsxs(A.Menu.Root,{open:r,onOpenChange:s,children:[n.jsxs(A.Menu.Trigger,{render:n.jsx(S.Toolbar.Button,{}),"aria-label":"Text style",className:Rt,onMouseDown:i=>i.preventDefault(),children:[n.jsx("span",{className:Ht,children:o.label}),n.jsx(It,{size:"sm"})]}),n.jsx(A.Menu.Portal,{container:D(),children:n.jsx(O,{children:n.jsx(A.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:Gt,children:n.jsx(A.Menu.Popup,{className:$t,onMouseDown:i=>i.preventDefault(),children:Ne.map(i=>n.jsx(A.Menu.Item,{className:zt,"data-selected":i.id===o.id,onClick:()=>Ts(e,i.id),children:n.jsx(Cs,{font:i.previewFont,children:i.label})},i.id))})})})})]})},Ts=(e,t)=>{switch(t){case"caption":{e.chain().focus().setNode("paragraph",{variant:"caption"}).run();return}case"text":{e.chain().focus().setNode("paragraph",{variant:null}).run();return}case"h1":e.chain().focus().setHeading({level:1}).run();return;case"h2":e.chain().focus().setHeading({level:2}).run();return;case"h3":e.chain().focus().setHeading({level:3}).run()}},Cs=({font:e,children:t})=>n.jsx("span",{style:{font:e,margin:0},children:t}),Ss=e=>n.jsx(N,{...e,children:n.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})})}),ks=e=>n.jsx(N,{...e,children:n.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),ws=e=>n.jsx(N,{...e,children:n.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]})}),As=e=>!e.content||e.content.length===0?!0:e.content.every(t=>!t.content||t.content.length===0),Es=e=>{const{$from:t}=e.state.selection,r=t.parent.textContent,s=t.parentOffset,o=t.start();let i=s;for(;i>0&&Pe(r[i-1]);)i-=1;let c=s;for(;c<r.length&&Pe(r[c]);)c+=1;return{from:o+i,to:o+c}},Pe=e=>e!==void 0&&/\S/.test(e);var _s="b5kquu0",Ls="b5kquu1",Fs="b5kquu2",Ns="b5kquu3",Me="b5kquu4";const Ps=({editor:e,currentUrl:t,isActive:r,isOpen:s,onOpenChange:o})=>{const[i,c]=g.useState(""),l=g.useRef(null);g.useEffect(()=>{s&&c(t??"")},[s,t]);const u=()=>{Ms(e,i),o(!1)},d=()=>{c(""),o(!1)},h=x=>{c(x.target.value)},f=x=>{x.key==="Enter"&&(x.preventDefault(),u())};return n.jsxs(k.Popover.Root,{open:s,onOpenChange:o,children:[n.jsx(k.Popover.Trigger,{render:n.jsx(S.Toolbar.Button,{}),"aria-label":"Link","data-active":r,className:_s,onMouseDown:x=>x.preventDefault(),children:n.jsx(ks,{})}),n.jsx(k.Popover.Portal,{container:D(),children:n.jsx(O,{children:n.jsx(k.Popover.Positioner,{sideOffset:6,align:"end",className:Ls,children:n.jsxs(k.Popover.Popup,{className:Fs,initialFocus:l,onMouseDown:x=>x.preventDefault(),children:[n.jsx("input",{ref:l,type:"url",value:i,placeholder:"Type or paste a link...","aria-label":"Link URL",className:Ns,onMouseDown:x=>x.stopPropagation(),onChange:h,onKeyDown:f}),n.jsx("button",{type:"button","aria-label":"Cancel",className:Me,onClick:d,children:n.jsx(ws,{})}),n.jsx("button",{type:"button","aria-label":"Apply link",className:Me,onClick:u,children:n.jsx(Ss,{})})]})})})})]})},Ms=(e,t)=>{const r=t.trim(),{selection:s}=e.state;if(!r){e.chain().focus().extendMarkRange("link").unsetLink().run();return}if(!s.empty){e.chain().focus().setLink({href:r}).run();return}if(e.isActive("link")){e.chain().focus().extendMarkRange("link").setLink({href:r}).run();return}const o=Es(e);e.chain().focus().setTextSelection(o).setLink({href:r}).run()},Os=e=>n.jsx(N,{...e,children:n.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M21 5H3"}),n.jsx("path",{d:"M17 12H7"}),n.jsx("path",{d:"M19 19H5"})]})}),Ds=e=>n.jsx(N,{...e,children:n.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M21 5H3"}),n.jsx("path",{d:"M21 12H9"}),n.jsx("path",{d:"M21 19H7"})]})}),Is=e=>n.jsx(N,{...e,children:n.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M21 5H3"}),n.jsx("path",{d:"M15 12H3"}),n.jsx("path",{d:"M17 19H3"})]})});var Bs="k91gos0",Rs="k91gos1";const Hs=6,H=({label:e,isActive:t,onToggle:r,children:s})=>{const o=i=>i.preventDefault();return n.jsxs(B.Tooltip.Root,{children:[n.jsx(B.Tooltip.Trigger,{render:n.jsx(pr.Toggle,{render:n.jsx(S.Toolbar.Button,{}),pressed:t,onPressedChange:()=>r()}),"aria-label":e,className:Bs,onMouseDown:o,children:s}),n.jsx(B.Tooltip.Portal,{container:D(),children:n.jsx(O,{children:n.jsx(B.Tooltip.Positioner,{sideOffset:Hs,children:n.jsx(B.Tooltip.Popup,{className:Rs,children:e})})})})]})},Gs=({editor:e,activeAlignment:t="left"})=>n.jsxs(n.Fragment,{children:[n.jsx(H,{label:"Align left",isActive:t==="left",onToggle:()=>e.chain().focus().setTextAlign("left").run(),children:n.jsx(Is,{})}),n.jsx(H,{label:"Align center",isActive:t==="center",onToggle:()=>e.chain().focus().setTextAlign("center").run(),children:n.jsx(Os,{})}),n.jsx(H,{label:"Align right",isActive:t==="right",onToggle:()=>e.chain().focus().setTextAlign("right").run(),children:n.jsx(Ds,{})})]});var $s="_1bp10ig0",V="_1bp10ig1",Q="_1bp10ig2";const zs=({editor:e})=>({isBold:e?.isActive("bold")??!1,isItalic:e?.isActive("italic")??!1,isUnderline:e?.isActive("underline")??!1,isLink:e?.isActive("link")??!1,linkUrl:e?.getAttributes("link").href??null,color:e?.getAttributes("textStyle").color??null,fontFamily:e?.getAttributes("textStyle").fontFamily??null,fontSize:qs(e),textAlign:Vs(e)}),qs=e=>e?e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":e.isActive("paragraph",{variant:"caption"})?"caption":"text":"text",Vs=e=>e?e.isActive({textAlign:"center"})?"center":e.isActive({textAlign:"right"})?"right":"left":"left",Ws=8,Ys=8,Us=({editor:e})=>{const[t,r]=g.useState(!1),[s,o]=g.useState(null),i=s!==null,c=v=>m=>{o(m?v:null)},{refs:l,floatingStyles:u}=w.useFloating({placement:"top-start",strategy:"fixed",middleware:[w.offset(Ws),w.flip(),w.shift({padding:Ys})],whileElementsMounted:w.autoUpdate}),d=g.useRef(null),h=ve.useEditorState({editor:e,selector:zs}),f=g.useCallback(v=>{d.current=v,l.setFloating(v)},[l]);if(g.useEffect(()=>{e&&l.setReference(e.view.dom)},[e,l]),g.useEffect(()=>{if(!e)return;const v=()=>r(!0),m=({event:p})=>{const{relatedTarget:y,currentTarget:j}=p,C=y instanceof Node&&d.current?.contains(y),L=y instanceof Node&&j instanceof Node&&j.contains(y);!C&&!L&&r(!1)};return e.on("focus",v),e.on("blur",m),()=>{e.off("focus",v),e.off("blur",m)}},[e]),!e||!t&&!i)return null;const x=D();return x?xr.createPortal(n.jsx(O,{children:n.jsx(B.Tooltip.Provider,{children:n.jsxs(S.Toolbar.Root,{ref:f,className:$s,style:u,children:[n.jsxs(S.Toolbar.Group,{className:V,children:[n.jsx(ls,{editor:e,currentColor:h?.color??null,isOpen:s==="color",onOpenChange:c("color")}),n.jsx(bs,{editor:e,currentFontFamily:h?.fontFamily??null,isOpen:s==="fontFamily",onOpenChange:c("fontFamily")})]}),n.jsx(S.Toolbar.Separator,{className:Q}),n.jsx(S.Toolbar.Group,{className:V,children:n.jsx(js,{editor:e,activeStyle:h?.fontSize??"text",isOpen:s==="fontSize",onOpenChange:c("fontSize")})}),n.jsx(S.Toolbar.Separator,{className:Q}),n.jsxs(S.Toolbar.Group,{className:V,children:[n.jsx(H,{label:"Bold",isActive:h?.isBold??!1,onToggle:()=>e.chain().focus().toggleBold().run(),children:n.jsx("strong",{children:"B"})}),n.jsx(H,{label:"Italic",isActive:h?.isItalic??!1,onToggle:()=>e.chain().focus().toggleItalic().run(),children:n.jsx("em",{children:"I"})}),n.jsx(H,{label:"Underline",isActive:h?.isUnderline??!1,onToggle:()=>e.chain().focus().toggleUnderline().run(),children:n.jsx("u",{children:"U"})})]}),n.jsx(S.Toolbar.Separator,{className:Q}),n.jsx(S.Toolbar.Group,{className:V,children:n.jsx(Gs,{editor:e,activeAlignment:h?.textAlign})}),n.jsx(S.Toolbar.Separator,{className:Q}),n.jsx(S.Toolbar.Group,{className:V,children:n.jsx(Ps,{editor:e,currentUrl:h?.linkUrl??null,isActive:h?.isLink??!1,isOpen:s==="link",onOpenChange:c("link")})})]})})}),x):null};var Xs="_2ngohc0";const Vt=({editor:e,ariaLabel:t})=>n.jsxs("div",{className:Xs,children:[n.jsx(Us,{editor:e}),n.jsx(ve.EditorContent,{editor:e,"aria-label":t})]}),Ks=(e,t)=>{const r=g.useRef(e);r.current=e;const s=g.useRef(t);s.current=t;const o=g.useRef(null),i=g.useRef(null),c=g.useMemo(()=>{const l=()=>{i.current!==null&&(clearTimeout(i.current),i.current=null),o.current=null},u=()=>{i.current!==null&&(clearTimeout(i.current),i.current=null);const h=o.current;h!==null&&(o.current=null,r.current(...h))};return{run:(...h)=>{if(s.current<=0){r.current(...h);return}o.current=h,i.current!==null&&clearTimeout(i.current),i.current=setTimeout(u,s.current)},flush:u,cancel:l}},[]);return g.useEffect(()=>()=>{i.current!==null&&clearTimeout(i.current)},[]),c},Zs=200,Wt=({content:e,extensions:t,isEditable:r,onUpdate:s,updateDebounceMs:o=Zs})=>{const i=g.useRef(Oe(e)),c=g.useRef(!1),l=Ks(d=>{c.current=!0,s?.(d)},o),u=ve.useEditor({extensions:t,content:i.current,editable:r,immediatelyRender:!1,onUpdate:({editor:d})=>l.run(d.getJSON())});return g.useEffect(()=>{u?.setEditable(r)},[u,r]),g.useEffect(()=>{if(!u)return;if(c.current){c.current=!1;return}const d=Oe(e),h=u.getJSON();Js(h,d)||(l.cancel(),u.commands.setContent(d,{emitUpdate:!1}))},[u,e,l]),g.useEffect(()=>()=>l.flush(),[l]),u},Oe=e=>e===null?{type:"doc",content:[]}:typeof e=="string"?{type:"doc",content:[{type:"paragraph",content:e?[{type:"text",text:e}]:[]}]}:e,Js=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Qs=/^(?:https?:|mailto:)/i,Yt=e=>{if(typeof e!="string")return!1;const t=e.replace(/^[\x00-\x20]+/,"");return t.length===0?!1:Qs.test(t)};var eo="_1cocly40";const to={modern:"'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif",timeless:"'Noto Serif', Georgia, 'Times New Roman', serif",fresh:"'Aeonik', 'Aeonik Fallback', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif",technical:"'PT Mono', 'Courier New', monospace",handwritten:"'Permanent Marker', cursive",fineliner:"'Intruding Cat', cursive",brand:"var(--brand-font-family), 'Aeonik', 'Inter', sans-serif"},ne=({content:e})=>n.jsx(n.Fragment,{children:Ut(e.content??[e])}),Ut=e=>e.map((t,r)=>ro(t,r)),ro=(e,t)=>{if(e.type==="text")return no(e,t);if(e.type==="hardBreak"||e.type==="hard_break")return n.jsx("br",{},t);const r=e.content?Ut(e.content):null;switch(e.type){case"doc":return n.jsx(g.Fragment,{children:r},t);case"heading":{const s=io(e.attrs?.level);return lo(s,t,r,Ie(e.attrs))}case"paragraph":{const s=G(e.attrs?.variant);return n.jsx("p",{"data-variant":s??void 0,style:Xt(Ie(e.attrs)),children:r},t)}case"blockquote":return n.jsx("blockquote",{children:r},t);case"bulletList":case"bullet_list":return n.jsx("ul",{children:r},t);case"orderedList":case"ordered_list":return n.jsx("ol",{children:r},t);case"listItem":case"list_item":return n.jsx("li",{children:r},t);default:return n.jsx("span",{children:r},t)}},no=(e,t)=>{const r=e.text??"";return!e.marks||e.marks.length===0?n.jsx("span",{children:r},t):e.marks.reduceRight((s,o,i)=>so(o,s,`${t}-${i}`),r)},so=(e,t,r)=>{switch(e.type){case"bold":case"strong":return n.jsx("strong",{children:t},r);case"italic":case"em":return n.jsx("em",{children:t},r);case"underline":return n.jsx("u",{children:t},r);case"strike":case"strikethrough":case"s":return n.jsx("s",{children:t},r);case"code":return n.jsx("code",{children:t},r);case"link":{const s=G(e.attrs?.href);return Yt(s)?n.jsx("a",{className:eo,href:s,rel:"noopener noreferrer",target:"_blank",children:t},r):n.jsx("span",{children:t},r)}case"textStyle":{const s=oo(e.attrs);return s?n.jsx("span",{style:s,children:t},r):n.jsx("span",{children:t},r)}default:return n.jsx("span",{children:t},r)}},De=e=>{const t=G(e&&typeof e=="object"?e.fontFamily:e);if(t)return to[t]??t},oo=e=>{if(!e)return null;const t={},r=G(e.color);r&&(t.color=r);const s=De(e.font)??De(e.fontFamily);s&&(t.fontFamily=s);const o=ao(e.fontSize);return o&&(t.fontSize=o),Object.keys(t).length>0?t:null},ao=e=>typeof e=="number"&&Number.isFinite(e)?`${e/10}em`:G(e),G=e=>typeof e=="string"&&e.length>0?e:void 0,io=e=>typeof e!="number"?3:e<1?1:e>3?3:Math.round(e),lo=(e,t,r,s)=>{const o=Xt(s);switch(e){case 1:return n.jsx("h1",{style:o,children:r},t);case 2:return n.jsx("h2",{style:o,children:r},t);case 3:return n.jsx("h3",{style:o,children:r},t)}},Ie=e=>{const t=e?.textAlign;if(t==="left"||t==="right"||t==="center"||t==="justify")return t},Xt=e=>e?{textAlign:e}:void 0;var co="_4dlrid0",Kt="_4dlrid1",uo="xfz7dq0",ho="xfz7dq1",go="xfz7dq2",xo="xfz7dq3",fo="xfz7dq4";const po=({ref:e,footerRect:t,mode:r="readonly"})=>{const{caption:s,isCaptionVisible:o,source:i,isSourceVisible:c}=a.useCompiledSelector(_.useShallow(h=>({caption:h.config.content.caption,isCaptionVisible:h.config.content.isCaptionVisible,source:h.config.content.source,isSourceVisible:h.config.content.isSourceVisible}))),l=r==="editable",u=o&&(l||s!==null),d=c&&i!==null&&bo(i);return!u&&!d?null:n.jsxs("div",{ref:e,className:uo,style:{left:t.x,top:t.y,width:t.width},children:[u?l?n.jsx(jo,{caption:s}):n.jsx(mo,{caption:s}):null,d&&n.jsx(vo,{source:i})]})},mo=({caption:e})=>e===null?null:typeof e=="string"?n.jsx("p",{className:Kt,children:e}):n.jsx(ne,{content:e}),vo=({source:e})=>{const t=Yt(e.url)?e.url:void 0,r=e.label??(t!==void 0?yo(t):"");return r===""&&t===void 0?null:n.jsxs("div",{className:ho,children:[n.jsx("span",{className:xo,children:"Source:"}),t!==void 0?n.jsx("a",{className:go,href:t,target:"_blank",rel:"noopener noreferrer",children:r}):n.jsx("span",{className:fo,children:r})]})},yo=e=>{try{return new URL(e).hostname}catch{return e}},bo=e=>e.label!==void 0&&e.label!==""||e.url!==void 0&&e.url!=="",jo=({caption:e})=>{const t=a.useGraphCommandDispatcher(),r=g.useMemo(()=>Sn({placeholder:"Add caption"}),[]),s=Wt({content:e,extensions:r,isEditable:!0,onUpdate:o=>{const i=As(o)?null:o;t(new b.SetContentCaptionCommand({caption:i}))}});return n.jsx(Vt,{editor:s,ariaLabel:"Chart caption"})};var To="_1k4qtbg0";const Co=3,So=({title:e,isTitleVisible:t,subtitle:r,isSubtitleVisible:s})=>{const o=[];return t&&o.push({type:"heading",attrs:{level:Co},content:wo(e)}),s&&o.push(...Ao(r)),{type:"doc",content:o}},ko=e=>{const t=e.content??[],[r,...s]=t;return{title:Eo(r?.content??[]),subtitle:_o(s)}},Se=e=>({type:e.type??"text",...e.content!==void 0?{content:e.content.map(Se)}:{},...e.text!==void 0?{text:e.text}:{},...e.marks!==void 0?{marks:e.marks}:{},...e.attrs!==void 0?{attrs:e.attrs}:{}}),wo=e=>e===null?[]:typeof e=="string"?e===""?[]:[{type:"text",text:e}]:e.type==="doc"&&e.content?e.content.flatMap(t=>t.content??[]):e.type==="text"||e.type==="hardBreak"?[e]:e.content??[],Ao=e=>e===null?[{type:"paragraph"}]:typeof e=="string"?e===""?[{type:"paragraph"}]:[{type:"paragraph",content:[{type:"text",text:e}]}]:e.type==="doc"&&e.content?e.content.length===0?[{type:"paragraph"}]:e.content.map(Be):[Be(e)],Be=e=>e.type==="paragraph"?e:{type:"paragraph",content:e.content??[e]},Eo=e=>{if(e.length===0)return null;const[t]=e;return t&&e.length===1&&t.type==="text"&&(!t.marks||t.marks.length===0)?t.text??null:{type:"paragraph",content:e.map(Se)}},_o=e=>{const t=e.filter(s=>(s.content??[]).length>0);if(t.length===0)return null;const[r]=t;if(r&&t.length===1&&r.type==="paragraph"){const s=r.content??[],[o]=s;if(o&&s.length===1&&o.type==="text"&&(!o.marks||o.marks.length===0))return o.text??null}return{type:"doc",content:t.map(Se)}},Lo=({ref:e,headerRect:t,mode:r="readonly"})=>{const{title:s,isTitleVisible:o,subtitle:i,isSubtitleVisible:c}=a.useCompiledSelector(_.useShallow(h=>({isTitleVisible:h.config.content.isTitleVisible,isSubtitleVisible:h.config.content.isSubtitleVisible,title:h.config.content.title,subtitle:h.config.content.subtitle}))),l=r==="editable";return!(o&&(l||s!==null))&&!(c&&(l||i!==null))?null:n.jsx("div",{ref:e,className:To,style:{left:t.x,top:t.y,width:t.width},children:l?n.jsx(No,{title:s,isTitleVisible:o,isSubtitleVisible:c,subtitle:i},[o?"title":"",c?"subtitle":""].join("-")):n.jsx(Fo,{title:s,isTitleVisible:o,isSubtitleVisible:c,subtitle:i})})},Fo=({title:e,isTitleVisible:t,isSubtitleVisible:r,subtitle:s})=>{const o=t&&e!==null,i=r&&s!==null;return n.jsxs(n.Fragment,{children:[o&&(typeof e=="string"?n.jsx("h1",{className:co,children:e}):n.jsx(ne,{content:e})),i&&(typeof s=="string"?n.jsx("p",{className:Kt,children:s}):n.jsx(ne,{content:s}))]})},No=({title:e,isTitleVisible:t,isSubtitleVisible:r,subtitle:s})=>{const o=a.useGraphCommandDispatcher(),i=g.useMemo(()=>Cn({titlePlaceholder:"Untitled",subtitlePlaceholder:"Untitled",isTitleVisible:t,isSubtitleVisible:r}),[t,r]),c=g.useMemo(()=>So({title:e,isTitleVisible:t,subtitle:s,isSubtitleVisible:r}),[e,t,s,r]),l=Wt({content:c,extensions:i,isEditable:!0,onUpdate:u=>{const d=ko(u);t&&o(new b.SetContentTitleCommand({title:d.title})),r&&o(new b.SetContentSubtitleCommand({subtitle:d.subtitle}))}});return n.jsx(Vt,{editor:l,ariaLabel:"Chart title and subtitle"})};var Po="_1u9qprb0",Mo="_1u9qprb1",Oo="_9aen060",Do="_9aen061",Io="_9aen062",Zt="_9aen063";const Bo=Object.freeze(Object.defineProperty({__proto__:null,groupRow:Io,item:Zt,trendRow:Do,valueRow:Oo},Symbol.toStringTag,{value:"Module"})),Ro=e=>n.jsx(N,{...e,children:n.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"m5 12 7-7 7 7"}),n.jsx("path",{d:"M12 19V5"})]})}),Ho=e=>n.jsx(N,{...e,children:n.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M5 12h14"})})});var Jt="n7clvo0",Go="n7clvo1",$o="n7clvo2",zo="n7clvo3",Qt={small:"n7clvo4",medium:"n7clvo5",large:"n7clvo6"},qo={small:"n7clvo7",medium:"n7clvo8",large:"n7clvo9"},Vo={up:"n7clvoa",down:"n7clvob",flat:"n7clvoc"},Wo={up:"n7clvoe n7clvod",down:"n7clvof n7clvod",flat:"n7clvog n7clvod"};const Yo=({segment:e,resolvedSize:t})=>{if(e.kind==="swatch")return n.jsx(a.Swatch,{shape:e.swatch.shape,color:e.swatch.color,width:e.size,height:e.size});if(e.kind==="trendArrow")return n.jsx("div",{className:Wo[e.direction],children:e.direction==="flat"?n.jsx(Ho,{size:"xs",title:""}):n.jsx(Ro,{size:"xs",title:""})});const r=e.fontRole==="value"?Qt[t]:qo[t];return n.jsx("span",{className:E.clsx(Uo(e),r),children:e.text})},Uo=e=>{switch(e.textRole){case"value":return Jt;case"observation":return Go;case"trendPercentage":return Vo[e.trendDirection??"up"];case"trendReference":return $o;case"label":return zo}},Xo=({item:e,resolvedSize:t})=>n.jsx("div",{className:Zt,children:ut(e).map(r=>n.jsx(Ko,{row:r,resolvedSize:t},r.role))}),Ko=({row:e,resolvedSize:t})=>{const r=e.role==="trendRow";return n.jsx("div",{className:Bo[e.role],"data-testid":r?"headline-trend":void 0,"data-direction":r?Zo(e):void 0,role:r?"img":void 0,"aria-label":r?e.ariaLabel:void 0,children:e.segments.map((s,o)=>n.jsx(Yo,{segment:s,resolvedSize:t},o))})},Zo=e=>{const t=e.segments.find(r=>r.kind==="trendArrow");return t?.kind==="trendArrow"?t.direction:void 0},Jo=({headline:e,rect:t,resolvedSize:r,visibleItemCount:s})=>{const o={left:t.x,top:t.y,width:t.width,height:t.height};return e.kind==="grandTotal"?n.jsx("div",{className:Mo,style:o,children:n.jsx("span",{className:E.clsx(Jt,Qt[r]),children:e.value})}):n.jsx("div",{className:Po,style:o,children:e.items.slice(0,s).map((i,c)=>n.jsx(Xo,{item:i,resolvedSize:r},`${i.label}-${c}`))})};var Qo="_1oj6yix0",ea="_1oj6yix1",ta="_1oj6yix2";const ra=8,na=16,sa=2,oa=({legends:e,containerRect:t,textScale:r})=>{const{lineBoxHeight:s}=Tt(r),{placements:o,hasOverlap:i}=aa(e,t,s);if(o.length===0)return null;const c=i?na:ra,l=c-sa;return n.jsxs("div",{className:Qo,children:[i&&n.jsx("svg",{className:ea,width:t.width,height:t.height,children:o.map(u=>n.jsx(ia,{anchorY:u.anchorY,labelY:u.y,endX:l,color:u.payload.color},u.payload.key))}),o.map(u=>n.jsx("span",{className:ta,style:{left:c,top:u.y,color:u.payload.color},children:u.payload.label},u.payload.key))]})},aa=(e,t,r)=>g.useMemo(()=>{const s=[];for(const o of e)for(const i of o.items){if(i.normalizedY===null)continue;const c=typeof i.visual.color=="string"?i.visual.color:void 0;s.push({normalizedY:i.normalizedY,payload:{key:String(s.length),label:i.formattedLabel,color:c}})}return s.length===0||t.height<=0?{placements:[],hasOverlap:!1}:b.computeDirectLabelsLayout({items:s,containerHeight:t.height,labelHeight:r})},[e,t.height,r]),ia=({anchorY:e,labelY:t,endX:r,color:s})=>{const o=r/2;return n.jsx("path",{d:`M0,${e} C${o},${e} ${o},${t} ${r},${t}`,fill:"none",stroke:s??"currentColor",strokeWidth:1,strokeDasharray:"2 2"})};var la="_6a636s0",ca="_1kjk02r0",ua="_1kjk02r1",da="_1kjk02r2",ha="_1kjk02r3",ga="_1kjk02r4",xa="_1kjk02r5",fa="_1kjk02r6",pa="_1kjk02r7",ma="_1kjk02r8",va="_1kjk02r9",ya="_1kjk02ra",ba="_1kjk02rb",ja="_1dw9dgx0";const Ta="#9ca3af",ce="\0",Ca=e=>{const t=[];return e.forEach((r,s)=>{const o=r.aesthetics.includes("size");for(const i of r.items){if(o){const d=Number(i.visual.size);if(!Number.isFinite(d)||d<=0)continue}const c=i.visual.color??"",l=o?`${ce}${Number(i.visual.size)}`:"",u=i.visual.lineType;t.push({key:`${s}${ce}${String(i.value)}${ce}${c}${l}`,formattedLabel:i.formattedLabel,visual:i.visual,swatchShape:i.swatchShape,isBubble:o,primaryLineType:u})}}),t},er=({pill:e})=>e.isBubble?n.jsx(wa,{pill:e}):n.jsx(ka,{pill:e}),Sa=({color:e,lineType:t,shape:r})=>e?n.jsx(a.Swatch,{shape:r,color:e,lineType:t,width:gt,height:be}):null,ka=({pill:e})=>n.jsxs(n.Fragment,{children:[n.jsx(Sa,{color:e.visual.color,lineType:e.primaryLineType,shape:e.swatchShape}),n.jsx("span",{children:e.formattedLabel})]}),wa=({pill:e})=>{const t=Number(e.visual.size);return n.jsxs(n.Fragment,{children:[n.jsx("span",{className:ja,style:{width:t,height:t,backgroundColor:e.visual.color??Ta}}),n.jsx("span",{children:e.formattedLabel})]})},Aa=({hiddenPills:e,placement:t})=>{const[r,s]=g.useState(!1),{refs:o,floatingStyles:i}=w.useFloating({open:r,placement:t,middleware:[w.offset(4),w.flip(),w.shift({padding:8})]});g.useEffect(()=>{if(!r)return;const d=f=>{const x=f.target;if(!x)return;const v=o.reference.current,m=o.floating.current;v instanceof Element&&v.contains(x)||m instanceof Element&&m.contains(x)||s(!1)},h=f=>{f.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",d),document.addEventListener("keydown",h),()=>{document.removeEventListener("pointerdown",d),document.removeEventListener("keydown",h)}},[r,o.floating,o.reference]);const c=t==="left"||t==="right",l=Math.min(e.length-1,pt),u=Array.from({length:l},(d,h)=>l-h);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:o.setReference,className:E.clsx(ca,{[da]:c,[ua]:!c}),children:[u.map(d=>n.jsx("span",{className:E.clsx(ha,{[xa]:c,[ga]:!c}),style:Ea(d,c),"aria-hidden":!0},d)),n.jsx("button",{type:"button",className:E.clsx(fa,{[pa]:r}),onClick:()=>s(d=>!d),"aria-haspopup":"dialog","aria-expanded":r,"aria-label":`Show ${e.length} hidden legend ${e.length===1?"item":"items"}`,children:n.jsxs("span",{className:ma,children:["+",e.length]})})]}),r&&n.jsx("div",{ref:o.setFloating,role:"dialog","aria-label":"Hidden legend items",className:va,style:i,children:n.jsx("ul",{className:ya,children:e.map(d=>n.jsx("li",{className:ba,children:n.jsx(er,{pill:d})},d.key))})})]})},Ea=(e,t)=>{const r=-e*mt;return{transform:t?`translateY(${r}px)`:`translateX(${r}px)`}};var _a="_1cecisi0",La="_1cecisi1",Fa="_1cecisi2",Na="_1cecisi3";const Pa=({edge:e,formattedLegends:t,containerWidth:r,containerHeight:s,textScale:o})=>{const i=a.useTextMeasurer(),c=g.useMemo(()=>Ca(t),[t]),l=e==="left"||e==="right",u=l?s:r,d=g.useMemo(()=>{if(c.length===0)return{visibleCount:0,hasOverflow:!1};if(u<=0)return{visibleCount:c.length,hasOverflow:!1};const v=a.emToPx(vt,o),m={family:bt,size:v},p=v*yt,y=$=>l?Ma($,p):Re({label:$.formattedLabel,swatchInlineSize:Oa($),textMeasurer:i,font:m}),j=c.map(y),L=(l?p+je:Re({label:`+${c.length}`,swatchInlineSize:0,textMeasurer:i,font:m}))+mn;return Ia({pillSizes:j,overflowPillSize:L,containerSize:u,gap:xn})},[c,u,l,i,o]);if(c.length===0)return null;const h=c.slice(0,d.visibleCount),f=c.slice(d.visibleCount),x=d.hasOverflow&&f.length>0;return n.jsxs("div",{className:E.clsx(_a,{[Fa]:l,[La]:!l}),children:[h.map(v=>n.jsx("div",{className:Na,children:n.jsx(er,{pill:v})},v.key)),x&&n.jsx(Aa,{hiddenPills:f,placement:Ba(e)})]})},Re=({label:e,swatchInlineSize:t,textMeasurer:r,font:s})=>{const o=r.measureText(e,s).width,i=t>0?xt:0;return t+i+o+jt},Ma=(e,t)=>{const r=Da(e);return Math.max(t,r)+je},Oa=e=>e.isBubble?Number(e.visual.size):Ct(e.visual.color),Da=e=>e.isBubble?Number(e.visual.size):be,Ia=({pillSizes:e,overflowPillSize:t,containerSize:r,gap:s})=>{if(e.length===0)return{visibleCount:0,hasOverflow:!1};let o=0;for(let l=0;l<e.length;l+=1)l>0&&(o+=s),o+=e[l]??0;if(o<=r)return{visibleCount:e.length,hasOverflow:!1};let i=0,c=0;for(const l of e){const u=i+(c>0?s:0)+l;if(u+s+t>r)break;i=u,c+=1}return{visibleCount:c,hasOverflow:!0}},Ba=e=>{switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}},Ra=g.memo(function({formattedLegends:t,rects:r,textScale:s}){const o=g.useMemo(()=>{const i=new Map;for(const c of t){let l=i.get(c.position);l||(l={pill:[],direct:[]},i.set(c.position,l)),c.display==="pill"?l.pill.push(c):l.direct.push(c)}return i},[t]);return n.jsx(n.Fragment,{children:Array.from(o,([i,c])=>{const l=r[i];return l===void 0?null:n.jsxs("div",{className:la,style:{left:l.x,top:l.y,width:l.width,height:l.height},children:[n.jsx(Pa,{edge:i,formattedLegends:c.pill,containerWidth:l.width,containerHeight:l.height,textScale:s}),n.jsx(oa,{legends:c.direct,containerRect:l,textScale:s})]},i)})})}),Ha=(e,t,r)=>{const s=e.filter(i=>i.interactive);if(s.length===0)return null;const o=s.map(i=>r(i,t)).filter(i=>i!==null).map(i=>i.guideMode);return o.length===0?null:o.some(i=>i==="bar")?"bar":o.every(i=>i==="continuous")?"continuous":null};function Ga(e,t){const r=b.getMainAxisCoordinate(e.mainAxis,t);if(e.mainAxis==="y"){const o=a.toPercent(a.toViewBoxY(r));return{x1:0,x2:"100%",y1:o,y2:o}}const s=a.toPercent(a.toViewBoxX(r));return{x1:s,x2:s,y1:0,y2:"100%"}}function $a(e,t,r){const s=e.mainAxis==="y"?b.getY(r.observation):b.getX(r.observation);if(s===null)return null;const o=e.mainAxis==="y"?qa(r):za(r),c=(t.x?.kind==="position"?t.x:null)?.bandwidth??o;if(c===null||c<=0)return null;const l=c/2;if(e.mainAxis==="y"){const h=a.toPercent(a.toViewBoxY(s+l)),f=a.toPercent(c);return{x:0,y:h,width:"100%",height:f}}const u=a.toPercent(a.toViewBoxX(s-l)),d=a.toPercent(c);return{x:u,y:0,width:d,height:"100%"}}function za(e){const t=b.getXMin(e.observation),r=b.getXMax(e.observation);return t===null||r===null?null:r-t}function qa(e){const t=b.getYMin(e.observation),r=b.getYMax(e.observation);return t===null||r===null?null:r-t}const Va=1,Wa="4 3",Ya=({panelRect:e})=>{const{coordSystem:t,layers:r,scales:s}=a.useCompiledSelector(_.useShallow(l=>({coordSystem:l.coordSystem,layers:l.layers,scales:l.scales}))),o=W(l=>l.hover.primary),i=a.useResolveGeomPlugin();if(t.type!=="cartesian"||r.length===0||o===null)return null;const c=Ha(r,t,i);return c===null?null:c==="bar"?n.jsx(Xa,{coordSystem:t,scales:s,primary:o,panelRect:e}):n.jsx(Ua,{coordSystem:t,primary:o,panelRect:e})},Ua=({coordSystem:e,primary:t,panelRect:r})=>{const s=Ga(e,t);return n.jsx(tr,{panelRect:r,children:n.jsx("line",{...s,stroke:a.vars.hoverGuideLineColor,strokeWidth:Va,strokeDasharray:Wa,strokeLinecap:"round","data-testid":"hover-guide-line"})})},Xa=({coordSystem:e,scales:t,primary:r,panelRect:s})=>{const o=$a(e,t,r);return o===null?null:n.jsx(tr,{panelRect:s,children:n.jsx("rect",{...o,fill:a.vars.hoverGuideFillColor,"data-testid":"hover-guide-rect"})})},tr=({panelRect:e,children:t})=>n.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,style:{overflow:"visible",pointerEvents:"none"},"data-testid":"hover-guide",children:t}),Ka=200,Za=({engine:e,store:t,overlayRef:r,setCursor:s=Ja})=>{g.useEffect(()=>{const o=r.current;if(!o)return;const i=Qa(o,e),c=ei(o,e,t,s);return()=>{c(),i()}},[e,t,r,s])},Ja=()=>{},Qa=(e,t)=>{const r=()=>{const c=e.getBoundingClientRect();c.width===0||c.height===0||t.setViewport({width:c.width,height:c.height})};let s=null;const o=()=>{s!==null&&clearTimeout(s),s=setTimeout(()=>{s=null,r()},Ka)},i=new ResizeObserver(o);return i.observe(e),r(),()=>{i.disconnect(),s!==null&&clearTimeout(s)}},ei=(e,t,r,s)=>{let o=null,i=null;const c=()=>{i=null;const d=o;if(o=null,!d)return;s({clientX:d.clientX,clientY:d.clientY});const h=e.getBoundingClientRect();if(h.width===0||h.height===0)return;const f={x:(d.clientX-h.left)/h.width,y:1-(d.clientY-h.top)/h.height};r.getState().setHoverState(t.query(f))},l=d=>{o=d,i===null&&(i=requestAnimationFrame(c))},u=()=>{o=null,i!==null&&(cancelAnimationFrame(i),i=null),s(null);const d=r.getState();d.hover.primary!==null&&d.setHoverState(b.RESTING_HOVER_STATE)};return e.addEventListener("pointermove",l),e.addEventListener("pointerleave",u),()=>{e.removeEventListener("pointermove",l),e.removeEventListener("pointerleave",u),i!==null&&cancelAnimationFrame(i),o=null}},ti=({panelRect:e})=>{const{engine:t,store:r,overlayRef:s,setCursor:o}=a.useHoverContext();return Za({engine:t,store:r,overlayRef:s,setCursor:o}),n.jsx("rect",{ref:s,x:e.x,y:e.y,width:e.width,height:e.height,fill:"transparent",pointerEvents:"all","data-testid":"pointer-capture-layer"})},ue="data-hover-active",ri=e=>{const{store:t}=a.useHoverContext(),r=ee.useStore(t,s=>s.hover.primary!==null);g.useEffect(()=>{const s=e.current;if(s)return r?s.setAttribute(ue,"true"):s.removeAttribute(ue),()=>{s.removeAttribute(ue)}},[e,r])},He=({panelRect:e,zOrder:t})=>{const r=a.useCompiledSelector(c=>c.annotations.custom),s=a.useResolveAnnotationPlugin(),o=r.filter(c=>{const l=s(c.type);return l!==null&&(c.zOrder??l.zOrder)===t});if(o.length===0)return null;const i={width:e.width,height:e.height};return n.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`custom-annotations-${t}`,children:o.map(c=>{const l=s(c.type);return l===null?null:n.jsx("g",{"data-annotation-type":c.type,children:l.draw({targets:c.targets,area:i,params:c.params})},c.id)})})},rr=a.FONT_SIZE_EM.xs,me=a.DEFAULT_FONT_FAMILY,nr=a.FONT_WEIGHT.medium,ni=a.FONT_WEIGHT.semibold,sr=6,or=2,si=4,oi=2,Ge=4;var ai="_1agclyl0",ii="_1agclyl1",li="_1agclyl2",ci={inside:"_1agclyl4 _1agclyl3",outside:"_1agclyl5 _1agclyl3"},ui="_1agclyl6 _1agclyl3";const ar=({x:e,y:t,width:r,height:s,text:o,isRotated:i,target:c,position:l,coordType:u})=>{const d=i?`rotate(-90 ${e} ${t})`:void 0,h=c==="aggregate"?ui:ci[l],f=di(c,l,u);return n.jsxs("g",{transform:d,children:[f&&n.jsx("rect",{className:f,x:e-r/2,y:t-s/2,width:r,height:s,rx:Ge,ry:Ge}),n.jsx("text",{className:h,x:e,y:t,textAnchor:"middle",dominantBaseline:"central",children:o})]})},di=(e,t,r)=>{if(e==="aggregate")return li;if(t==="outside"&&r==="cartesian")return ii},hi={dataLabel:{x:sr,y:or},stackTotal:{x:si,y:oi}},gi=({panelRect:e,formattingLocale:t})=>{const r=a.useTextMeasurer(),s=a.useCompiledSelector(_.useShallow(l=>({layers:l.layers,coordSystem:l.coordSystem,axes:l.guides.axes,numberFormat:l.config.numberFormat,parsingLocale:l.config.parsingLocale,textScale:l.config.appearance.textScale}))),o=g.useMemo(()=>{const l=a.emToPx(rr,s.textScale);return{dataLabel:{family:me,size:l,weight:nr},stackTotal:{family:me,size:l,weight:ni}}},[s.textScale]),i=g.useMemo(()=>(l,u)=>{const d=r.measureText(u,o[l]),h=hi[l];return{...d,width:d.width+h.x*2,height:d.height+h.y*2}},[r,o]),c=g.useMemo(()=>b.buildDataLabelsContent({...s,panelRect:e,measureDataLabel:i,formattingLocale:t}),[s,e,i,t]);return n.jsx("g",{className:ai,transform:`translate(${e.x}, ${e.y})`,"data-testid":"data-labels",children:c.labels.map(l=>n.jsx(ar,{x:l.x,y:l.y,width:l.width,height:l.height,text:l.text,isRotated:l.isRotated,target:l.target,position:l.position,coordType:s.coordSystem.type},l.key))})},xi=({linePath:e,arrowheadPath:t,stroke:r,strokeWidth:s})=>{const o={stroke:r,strokeWidth:s,strokeLinecap:"round",fill:"none"};return n.jsxs("g",{children:[n.jsx("path",{d:e,...o}),n.jsx("path",{d:t,...o,strokeLinejoin:"round"})]})},fi=({x:e,y:t,text:r,lineHeight:s,paddingX:o,paddingY:i,strokeWidth:c,strokeColor:l,fontWeight:u})=>{const d=a.useTextMeasurer(),f=g.useMemo(()=>d.measureText(r,{family:a.DEFAULT_FONT_FAMILY,size:s,weight:u}),[d,r,s,u]).width+o*2,x=s+i*2;return n.jsxs("g",{style:{pointerEvents:"none"},children:[n.jsx("rect",{x:e-f/2,y:t-x/2,width:f,height:x,rx:4,fill:a.vars.graphBackground,stroke:l,strokeWidth:c}),n.jsx("text",{x:e,y:t,dominantBaseline:"central",textAnchor:"middle",fill:a.vars.textPrimary,style:{fontFamily:a.DEFAULT_FONT_FAMILY,fontSize:s,fontWeight:u},children:r})]})},pi=({panelRect:e,formattingLocale:t})=>{const r=a.useCompiledSelector(_.useShallow(o=>({differenceArrows:o.annotations.differenceArrows,mainAxis:o.coordSystem.type==="cartesian"?o.coordSystem.mainAxis:"x",textScale:o.config.appearance.textScale}))),s=g.useMemo(()=>r.differenceArrows.map(o=>b.computeDifferenceArrow({arrow:o,mainAxis:r.mainAxis,panelWidth:e.width,panelHeight:e.height,textScale:r.textScale,locale:t})),[r,e.width,e.height,t]);return s.length===0?null:n.jsx("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"difference-arrows",children:s.map(({color:o,id:i,linePath:c,arrowheadPath:l,strokeWidth:u,labelPosition:d,labelText:h,labelLineHeight:f,labelPaddingX:x,labelPaddingY:v,labelStrokeWidth:m,labelFontWeight:p})=>{const y=o??a.vars.defaultAnnotationArrowStroke;return n.jsxs(g.Fragment,{children:[n.jsx(xi,{linePath:c,arrowheadPath:l,stroke:y,strokeWidth:u}),n.jsx(fi,{x:d.x,y:d.y,text:h,lineHeight:f,paddingX:x,paddingY:v,strokeWidth:m,strokeColor:y,fontWeight:p})]},i)})})},mi=0,vi=1.15,$e=1.15,yi="rgba(0, 0, 0, 0.16)",ze=2,bi=1.4,ji=({arrow:e,fallbackColor:t,stickerOutlineColor:r,stickerOutlineColorInverse:s})=>{const o=g.useId(),i=e.color??t,c=Ti(e.color,r,s),l=e.dashArray?{strokeDasharray:e.dashArray,strokeDashoffset:e.dashOffset}:{},u=e.arrowheadExtent+e.strokeWidth+ze+$e,d={x:Math.min(e.startX,e.endX)-u,y:Math.min(e.startY,e.endY)-u,width:Math.abs(e.endX-e.startX)+2*u,height:Math.abs(e.endY-e.startY)+2*u},h=[e.linePath,e.startArrowheadPath,e.endArrowheadPath].filter(f=>f.length>0).join(" ");return n.jsxs("g",{children:[e.hasStickerStyle&&n.jsx("defs",{children:n.jsx("filter",{id:o,filterUnits:"userSpaceOnUse",...d,children:n.jsx("feDropShadow",{dx:mi,dy:vi,stdDeviation:$e,floodColor:yi})})}),n.jsxs("g",{filter:e.hasStickerStyle?`url(#${o})`:void 0,children:[e.hasStickerStyle&&n.jsx("path",{d:h,stroke:c,strokeWidth:e.strokeWidth+2*ze,strokeLinecap:"round",fill:"none"}),n.jsx("path",{d:e.linePath,stroke:i,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none",...l}),e.startArrowheadPath.length>0&&n.jsx("path",{d:e.startArrowheadPath,stroke:i,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"}),e.endArrowheadPath.length>0&&n.jsx("path",{d:e.endArrowheadPath,stroke:i,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"})]})]})},Ti=(e,t,r)=>{if(e===null)return r;try{return mr.getContrast(e,t)<bi?r:t}catch{return r}},Ci=({panelRect:e})=>{const{themeValues:t}=Ce(),r=a.useCompiledSelector(o=>o.annotations.freeformArrows),s=g.useMemo(()=>r.map(o=>b.computeFreeformArrow({arrow:o,panelWidth:e.width,panelHeight:e.height})).filter(o=>o!==null),[r,e.width,e.height]);return s.length===0?null:n.jsx("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"freeform-arrows",children:s.map(o=>n.jsx(ji,{arrow:o,fallbackColor:a.vars.defaultAnnotationArrowStroke,stickerOutlineColor:t.arrowAnnotationStickerOutlineColor,stickerOutlineColorInverse:t.arrowAnnotationStickerOutlineColorInverse},o.id))})},Si=({edge:e,areTicksVisible:t,position:r,labelRotation:s,label:o})=>{const i=a.toPercent(r),c=t?1:0,l={style:{font:a.vars.fontTickLabel},fill:a.vars.textSecondary},u=s!==0&&(e==="top"||e==="bottom"),d=e==="top";return u?n.jsx("svg",{x:i,y:d?"100%":0,style:{overflow:"visible"},children:n.jsx("text",{...wi(d,c,s),...l,children:o})}):n.jsx("text",{...ki(e,i,c),...l,children:o})},ki=(e,t,r)=>{switch(e){case"bottom":return{x:t,y:P*r,textAnchor:"middle",dominantBaseline:"hanging"};case"top":return{x:t,y:"100%",dy:-P*r,textAnchor:"middle",dominantBaseline:"auto"};case"left":return{x:"100%",dx:-P*r,y:t,textAnchor:"end",dominantBaseline:"central"};case"right":return{x:P*r,y:t,textAnchor:"start",dominantBaseline:"central"}}},wi=(e,t,r)=>{const s=P*t,o=e?-s:s;return{x:0,y:o,textAnchor:e?"start":"end",dominantBaseline:"central",transform:`rotate(${r}, 0, ${o})`}},Ai=({formattedAxis:e,rect:t})=>{const r=e.position==="bottom"||e.position==="top";return n.jsxs("svg",{x:t.x,y:t.y,width:t.width,height:t.height,style:{overflow:"visible"},children:[ct,e.ticks.map((s,o)=>{const i=s.formattedLabel,c=r?s.position:1-s.position,l=Ei(e.position,c,t);return n.jsxs("g",{children:[e.ticksVisible&&n.jsx("line",{...l,stroke:a.vars.gridLineColor,strokeWidth:1}),n.jsx(Si,{edge:e.position,areTicksVisible:e.ticksVisible,position:c,labelRotation:e.labelRotation,label:i})]},o)})]})},Ei=(e,t,r)=>{const s=a.toPercent(t);switch(e){case"bottom":return{x1:s,y1:0,x2:s,y2:Z};case"top":return{x1:s,y1:r.height,x2:s,y2:r.height-Z};case"left":return{x1:r.width,y1:s,x2:r.width-Z,y2:s};case"right":return{x1:0,y1:s,x2:Z,y2:s}}},_i=({formattedAxes:e,rects:t})=>n.jsx(n.Fragment,{children:e.map(r=>{const s=t[r.position];return!s||!r.isVisible?null:n.jsx(Ai,{formattedAxis:r,rect:s},r.scaleAestheticKey)})}),Li=({axes:e,rects:t})=>n.jsx(n.Fragment,{children:e.map(r=>{const s=t[r.position];if(!s||!r.isVisible)return null;const o=Fi(r.position,s);return n.jsxs("g",{transform:`translate(${s.x}, ${s.y})`,children:[ct,n.jsx("text",{style:{font:a.vars.fontAxisLabel},fill:a.vars.textPrimary,...o,children:r.label})]},`axis-label-${r.position}`)})}),Fi=(e,t)=>{const r={x:t.width/2,y:t.height/2,textAnchor:"middle",dominantBaseline:"middle"};return e==="left"?(r.x=0,r.textAnchor="start"):e==="right"&&(r.x=t.width,r.textAnchor="end"),r},qe={strokeWidth:1,strokeDashoffset:"0",strokeDasharray:"2 3",strokeLinecap:"round"},Ni=({axes:e,panel:t,panelRect:r})=>n.jsxs("svg",{x:r.x,y:r.y,width:r.width,height:r.height,style:{overflow:"visible"},children:[t.border.isVisible&&n.jsx("rect",{x:0,y:0,width:r.width,height:r.height,fill:"none",stroke:a.vars.gridLineColor,rx:8,ry:8,...qe}),e.map(s=>{if(!s.gridVisible)return null;const o=s.position==="bottom"||s.position==="top";return n.jsx("g",{children:s.ticks.map((i,c)=>{if(i.position<=0||i.position>=1)return null;const l=o?i.position:1-i.position,u=a.toPercent(l),d=o?{x1:u,y1:0,x2:u,y2:"100%"}:{x1:0,y1:u,x2:"100%",y2:u};return n.jsx("line",{...d,...qe,stroke:a.vars.gridLineColor},c)})},s.scaleAestheticKey)})]}),Ve=8,We=.5,Ye={strokeWidth:1,strokeLinecap:"round"},Pi=({axes:e,panelRect:t,coordSystem:r})=>{const s=e.find(p=>p.geometry==="circular"),o=e.find(p=>p.geometry==="radial");if(!s||s.ticks.length===0)return null;const i=t.x+t.width/2,c=t.y+t.height/2,l=Math.min(t.width,t.height)/2,{startAngle:u,innerRadius:d}=r,h=p=>p*2*Math.PI+u,f=(p,y)=>{const j=i+y*Math.sin(p),C=c-y*Math.cos(p);return`${j.toFixed(2)},${C.toFixed(2)}`},x=s.ticks.map(p=>h(p.position)),v=p=>`${x.map((y,j)=>`${j===0?"M":"L"} ${f(y,p)}`).join(" ")} Z`,m=(o?.ticks??[]).map(p=>(d+p.position*(1-d))*l).filter(p=>p>We);return m.some(p=>Math.abs(p-l)<We)||m.push(l),n.jsxs("g",{"data-guide":"polar",style:{overflow:"visible"},children:[m.map((p,y)=>n.jsx("path",{d:v(p),fill:"none",stroke:a.vars.gridLineColor,...Ye},`ring-${y}`)),x.map((p,y)=>n.jsx("line",{x1:i,y1:c,x2:i+l*Math.sin(p),y2:c-l*Math.cos(p),stroke:a.vars.gridLineColor,...Ye},`spoke-${y}`)),s.ticks.map((p,y)=>{const j=h(p.position),C=Math.sin(j),L=-Math.cos(j);return n.jsx("text",{x:i+C*(l+Ve),y:c+L*(l+Ve),textAnchor:C>.1?"start":C<-.1?"end":"middle",dominantBaseline:L>.1?"hanging":L<-.1?"auto":"central",style:{font:a.vars.fontTickLabel},fill:a.vars.textSecondary,children:p.formattedLabel},`label-${y}`)})]})},Ue=({panelRect:e,zOrder:t})=>{const s=a.useCompiledSelector(o=>o.annotations.shapes).filter(o=>o.zOrder===t);return s.length===0?null:n.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`shapes-${t}`,children:s.map(({id:o,x:i,y:c,width:l,height:u,fillColor:d,fillOpacity:h,strokeWidth:f,strokeColor:x})=>n.jsx("rect",{x:a.toPercent(i),y:a.toPercent(c),width:a.toPercent(l),height:a.toPercent(u),fill:d,fillOpacity:h,stroke:f>0?x??a.vars.defaultAnnotationShapeStroke:"none",strokeWidth:f},o))})};var Mi="_120wioc0";const Oi=({panelRect:e})=>{const t=a.useCompiledSelector(r=>r.annotations.textAnnotations);return t.length===0?null:n.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":"text-annotations",children:t.map(r=>n.jsx("foreignObject",{x:a.toPercent(r.x),y:a.toPercent(r.y),width:a.toPercent(r.width),height:a.toPercent(1-r.y),overflow:"visible",children:n.jsx("div",{className:Mi,style:Di(r.backgroundColor,r.backgroundColorStyle),children:n.jsx(ne,{content:r.content})})},r.id))})},Di=(e,t)=>e===null||e==="transparent"?{color:a.vars.textPrimary}:t==="fade"?{color:a.vars.textPrimary,backgroundColor:xe(e,a.vars.grey100,.5),boxShadow:`0 0 0 1.5px ${xe(e,a.vars.grey0,.2)}`}:{color:a.vars.textPrimary,backgroundColor:e,boxShadow:`0 0 0 1.5px ${se(e,.1)}`};var Ii="usd3ea0",Bi="usd3ea1";const Ri=({layer:e,coordSystem:t,isAnimated:r,isDimmed:s,highlightStyle:o,formattingLocale:i})=>{const l=a.useResolveGeomPlugin()(e,t);return l===null?n.jsxs("text",{children:[e.geom," not implemented"]}):n.jsx("g",{className:E({[Bi]:s&&o==="desaturate",[Ii]:s&&o==="dim"}),children:l.render({layer:e,coordSystem:t,isAnimated:r,formattingLocale:i})})};function Hi({plugin:e,layer:t,coordSystem:r,candidates:s}){if(e?.getOverlayAnchor===void 0||s.length===0)return[];const o=[];for(const{observation:i,observationIndex:c}of s){const l=e.getOverlayAnchor({layer:t,coordSystem:r,observation:i});l!==null&&o.push({observation:i,observationIndex:c,anchor:l})}return o}const Gi=4,$i=({plugin:e,layer:t,matchedLayer:r,overlayCandidates:s,coordSystem:o,isAnimated:i,panelRect:c,formattingLocale:l})=>{const{numberFormat:u,textScale:d}=a.useCompiledSelector(_.useShallow(m=>({numberFormat:m.config.numberFormat,textScale:m.config.appearance.textScale}))),h=g.useMemo(()=>Hi({plugin:e,layer:t,coordSystem:o,candidates:s}),[e,t,o,s]),f=g.useMemo(()=>b.createSegmentYReader(t),[t]),x=g.useMemo(()=>b.buildLayerYValueFormatter({layer:t,numberFormat:u,locale:l}),[u,t,l]),v=rr*a.ROOT_FONT_SIZE_PX*d;return e===null||r===null&&h.length===0?null:n.jsxs(n.Fragment,{children:[r?e.render({layer:r,coordSystem:o,isAnimated:i,formattingLocale:l}):null,h.map(({observation:m,observationIndex:p,anchor:y})=>n.jsx(zi,{observation:m,anchor:y,panelRect:c,readSegmentY:f,formatYValue:x,labelFontSizePx:v},qi(m,p)))]})},zi=({observation:e,anchor:t,panelRect:r,readSegmentY:s,formatYValue:o,labelFontSizePx:i})=>{const c=a.useTextMeasurer(),l=a.toViewBoxX(t.x),u=a.toViewBoxY(t.y),d=(b.getSize(e)??a.DEFAULT_POINT_SIZE)/2,h=s(e),f=b.isDefined(h)?o(h,e):null,x=g.useMemo(()=>{if(f===null)return null;const v=c.measureText(f,{family:me,size:i,weight:nr});return{width:v.width+sr*2,height:v.height+or*2}},[f,c,i]);return n.jsxs(n.Fragment,{children:[n.jsx("circle",{"data-testid":"highlight-overlay-dot",cx:a.toPercent(l),cy:a.toPercent(u),r:d,fill:b.getColor(e)}),f!==null&&x!==null&&n.jsx(ar,{x:l*r.width,y:u*r.height-d-Gi-x.height/2,width:x.width,height:x.height,text:f,isRotated:!1,target:"observation",position:"outside",coordType:"cartesian"})]})},qi=(e,t)=>{const r=e[b.GROUP_VARIABLES.group];return`${String(r??"")}\0${t}`},Vi=({layer:e,coordSystem:t,panelRect:r})=>{const s=a.useResolveGeomPlugin(),{primary:o,group:i,related:c}=W(_.useShallow(d=>({primary:d.hover.primary,group:d.hover.group,related:d.hover.related})));if(o===null)return null;const l=s(e,t);if(l===null)return null;const u=c.get(e.id)??[];return o.layerId===e.id?l.renderHover({layer:e,coordSystem:t,primary:o,group:i,related:u,panelRect:r}):u.length===0?null:l.renderHoverCompanions({layer:e,primary:o,related:u})};var Wi="to1jkx0",Yi="to1jkx1";const Ui=({shouldAnimate:e,panelRect:t,formattingLocale:r})=>{const{layers:s,coordSystem:o,highlightStyle:i}=a.useCompiledSelector(_.useShallow(c=>({layers:c.layers,coordSystem:c.coordSystem,highlightStyle:c.config.appearance.highlightStyle})));return n.jsx("svg",{x:t.x,y:t.y,width:t.width,height:t.height,className:Wi,"data-testid":"geom-layers",children:s.map(c=>n.jsxs(g.Fragment,{children:[n.jsx(Zi,{layer:c,coordSystem:o,highlightStyle:i,shouldAnimate:e,panelRect:t,formattingLocale:r}),n.jsx(Vi,{layer:c,coordSystem:o,panelRect:t})]},`${c.id}-${Xi(o)}`))})},Xi=e=>e.type==="cartesian"?`cartesian-${e.mainAxis}`:e.type,Ki=e=>{if(e.highlight!==null)return Yi},Zi=({layer:e,coordSystem:t,highlightStyle:r,shouldAnimate:s,panelRect:o,formattingLocale:i})=>{const c=a.useResolveGeomPlugin(),l=g.useMemo(()=>c(e,t),[c,e,t]),u=e.highlight;return n.jsxs("g",{className:Ki(e),children:[n.jsx(Ri,{layer:e,coordSystem:t,isAnimated:s,isDimmed:u?.composition.isDimmed??!1,highlightStyle:r,formattingLocale:i}),u!==null&&n.jsx($i,{plugin:l,layer:e,matchedLayer:u.composition.matchedLayer,overlayCandidates:u.composition.overlayCandidates,coordSystem:t,isAnimated:s,panelRect:o,formattingLocale:i})]})};var Ji="_17uhij30";const Qi=({formattedAxes:e,formattedPolarAxes:t,plotRect:r,panelRect:s,axisRects:o,axisLabelRects:i,shouldAnimate:c,formattingLocale:l})=>{const u=g.useRef(null);ri(u);const{axes:d,panelGuide:h,coordSystem:f}=a.useCompiledSelector(_.useShallow(y=>({axes:y.guides.axes,panelGuide:y.guides.panel,coordSystem:y.coordSystem}))),x=g.useMemo(()=>ir(s,r),[s,r]),v=g.useMemo(()=>Xe(o,r),[o,r]),m=g.useMemo(()=>Xe(i,r),[i,r]),p=g.useMemo(()=>d.filter(y=>y.geometry==="linear"),[d]);return n.jsxs("svg",{ref:u,className:Ji,width:r.width,height:r.height,style:{transform:`translate(${r.x}px, ${r.y}px)`},"data-testid":"plot",children:[n.jsx(Ni,{axes:e,panel:h,panelRect:x}),f.type==="polar"&&n.jsx(Pi,{axes:t,panelRect:x,coordSystem:f}),n.jsx(Ya,{panelRect:x}),n.jsx(_i,{formattedAxes:e,rects:v}),n.jsx(Li,{axes:p,rects:m}),n.jsx(Ue,{panelRect:x,zOrder:"background"}),n.jsx(He,{panelRect:x,zOrder:"background"}),n.jsx(Ui,{shouldAnimate:c,panelRect:x,formattingLocale:l}),n.jsx(gi,{panelRect:x,formattingLocale:l}),n.jsx(pi,{panelRect:x,formattingLocale:l}),n.jsx(Ue,{panelRect:x,zOrder:"foreground"}),n.jsx(He,{panelRect:x,zOrder:"foreground"}),n.jsx(Ci,{panelRect:x}),n.jsx(Oi,{panelRect:x}),n.jsx(ti,{panelRect:x})]})},ir=(e,t)=>({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}),Xe=(e,t)=>{const r={};for(const[s,o]of Object.entries(e))r[s]=ir(o,t);return r},de={headerSize:{width:0,height:0},footerSize:{width:0,height:0}},el=()=>{const[e,t]=g.useState(null),[r,s]=g.useState(null),[o,i]=g.useState(de);return g.useEffect(()=>{const c=()=>{const u=e?{width:e.offsetWidth,height:e.offsetHeight}:de.headerSize,d=r?{width:r.offsetWidth,height:r.offsetHeight}:de.footerSize;i(h=>tl(h,{headerSize:u,footerSize:d})?{headerSize:u,footerSize:d}:h)};c();const l=new ResizeObserver(c);return e&&l.observe(e),r&&l.observe(r),()=>l.disconnect()},[e,r]),{headerRef:t,footerRef:s,measurements:o}},tl=(e,t)=>e.headerSize.width!==t.headerSize.width||e.headerSize.height!==t.headerSize.height||e.footerSize.width!==t.footerSize.width||e.footerSize.height!==t.footerSize.height,rl=({appearance:e,isEditable:t,style:r,children:s})=>{const{theme:o,themeClass:i,inlineVarsStyle:c}=Ce(),l=Gn(e.border),u=Math.max(0,e.cornerRadius),d=u===0?0:u+l,h=g.useMemo(()=>{const v={...r,borderRadius:`${d}px`,...c},m=Hn(e.border,o);return m!==null&&(v.background=m),v},[r,d,c,e.border,o]),f=g.useMemo(()=>({inset:`${l}px`,borderRadius:`${u}px`}),[l,u]),x=t&&e.background.type==="solid"&&e.background.color==="transparent";return n.jsx("div",{"data-testid":"graph-wrapper",className:E(Vn,i),style:h,children:n.jsx("div",{"data-testid":"graph-inner",className:E(Yn,{[Un]:x}),style:f,children:s})})},nl=e=>n.jsx(a.HoverProvider,{children:n.jsx(a.TextMeasurerProvider,{children:n.jsx(sl,{...e})})}),sl=({width:e,height:t,isAnimated:r,showTooltips:s=!0,mode:o="readonly"})=>{const{axes:i,legends:c,numberFormat:l,parsingLocale:u,appearance:d,annotations:h,coordSystem:f,headline:x,headlineConfig:v}=a.useCompiledSelector(_.useShallow(F=>({axes:F.guides.axes,legends:F.guides.legends,numberFormat:F.config.numberFormat,parsingLocale:F.config.parsingLocale,appearance:F.config.appearance,annotations:F.annotations,coordSystem:F.coordSystem,headline:F.guides.headline,headlineConfig:F.config.headline}))),m=dr.useReducedMotion(),{headerRef:p,footerRef:y,measurements:j}=el(),{formattingLocale:C,theme:L,themeOverrides:$}=a.useGraphContext(),ke=g.useMemo(()=>b.formatLegends({legends:c,numberFormat:l,parsingLocale:u,formattingLocale:C}),[c,l,u,C]),z=g.useMemo(()=>b.formatHeadline({headline:x,show:v.show,numberFormat:l,parsingLocale:u,formattingLocale:C}),[x,v.show,l,u,C]),lr=a.useTextMeasurer(),oe=d.border.type==="none"?0:d.border.width,ae=g.useMemo(()=>({width:Math.max(0,e-2*oe),height:Math.max(0,t-2*oe)}),[e,t,oe]),Y=g.useMemo(()=>z?{formatted:z,size:v.size,position:v.position,innerRadius:f.type==="polar"?f.innerRadius:0}:void 0,[z,v.size,v.position,f]),U=bn(lr,d.textScale),q=jn({measurer:U,axes:i,numberFormat:l,parsingLocale:u,formattedLegends:ke,containerSize:ae,externalMeasurements:j,headline:Y,formattingLocale:C,annotations:h,coordSystem:f,textScale:d.textScale}),X=g.useMemo(()=>!q||!Y||!U?null:b.resolveHeadlinePlacement({headline:Y,layout:q.layout,containerSize:ae,measurer:U,itemGap:it}),[q,Y,ae,U]);if(!q)return null;const{layout:M,formattedAxes:cr,formattedPolarAxes:ur}=q;return n.jsx(Nt,{theme:L,themeOverrides:$,appearance:d,children:n.jsxs(rl,{appearance:d,isEditable:o==="editable",style:{width:e,height:t},children:[n.jsx(Lo,{ref:p,headerRect:M.header,mode:o}),n.jsx(Qi,{formattedAxes:cr,formattedPolarAxes:ur,plotRect:M.plot,panelRect:M.panel,axisRects:M.axes,axisLabelRects:M.axisLabels,shouldAnimate:r??!m,formattingLocale:C??u}),n.jsx(po,{ref:y,footerRect:M.footer,mode:o}),n.jsx(Ra,{formattedLegends:ke,rects:M.legends,textScale:d.textScale}),z&&X&&n.jsx(Jo,{headline:z,rect:X.rect,resolvedSize:X.resolvedSize,visibleItemCount:X.visibleItemCount}),s&&n.jsx(Qr,{})]})})};exports.CanvasTextMeasurer=a.CanvasTextMeasurer;exports.GraphProvider=a.GraphProvider;exports.HoverProvider=a.HoverProvider;exports.TextMeasurerProvider=a.TextMeasurerProvider;exports.useCompiledSelector=a.useCompiledSelector;exports.useGraphCommandDispatcher=a.useGraphCommandDispatcher;exports.useTextMeasurer=a.useTextMeasurer;exports.vars=a.vars;exports.DevToolsPanel=Or;exports.GraphRenderer=nl;exports.ThemeProvider=Nt;exports.darkTheme=Ft;exports.lightTheme=Lt;exports.useHoverState=W;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),N=require("clsx"),g=require("react"),xe=require("zustand"),f=require("@graphysdk/viz-engine"),ot=require("zustand/vanilla"),E=require("motion/react"),ee=require("d3-shape"),Ir=require("d3-interpolate-path"),H=require("zustand/react/shallow"),Ke=require("color2k"),F=require("@floating-ui/react-dom"),Or=require("@tiptap/core"),Ut=require("@tiptap/extension-bold"),Ze=require("@tiptap/extension-document"),Kt=require("@tiptap/extension-hard-break"),Zt=require("@tiptap/extension-heading"),Jt=require("@tiptap/extension-italic"),Qt=require("@tiptap/extension-link"),en=require("@tiptap/extension-text"),tn=require("@tiptap/extension-text-align"),le=require("@tiptap/extension-text-style"),nn=require("@tiptap/extension-underline"),_e=require("@tiptap/extensions"),Dr=require("@tiptap/extension-paragraph"),st=require("@tiptap/react"),_=require("@base-ui/react/toolbar"),ie=require("@base-ui/react/tooltip"),rn=require("react-dom"),zr=require("@vanilla-extract/dynamic"),M=require("@base-ui/react/popover"),ft=require("react-colorful"),B=require("@base-ui/react/menu"),Gr=require("@base-ui/react/toggle");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.reactRenderer="0.0.1-plugins.5");const Wr=(e=[])=>{const t=new Map;for(const n of e)t.set(n.type,n);return n=>t.get(n)??null},$r=5,Xr=e=>{if(process.env.NODE_ENV==="production")return{emit:()=>{},subscribe:()=>Yr,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let n=null;return{emit:o=>{const s=e.getLastCompile();if(s){n=o;for(const a of t)a(o,s)}},subscribe:o=>(t.add(o),()=>{t.delete(o)}),getLastTrigger:()=>n,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},qr=()=>ot.createStore(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,n)=>e(o=>{if(o.lastSnapshot===n)return o;const s={id:o.nextId,label:Vr(t),stages:n.stages,durationMs:n.durationMs};return{lastCompile:s,history:Ur(o.history,s,$r),nextId:o.nextId+1,lastSnapshot:n}})})),Yr=()=>{},Vr=e=>{switch(e.kind){case"init":return"init";case"input":return"input change";case"data":return"data change";case"command":return e.command.metadata.description}},Ur=(e,t,n)=>{const o=e.length>=n?e.length-(n-1):0;return[...e.slice(o),t]};function Kr(e){return e}function Zr(e,t){return{...t,geom:e.type,highlightStrategy:e.highlightStrategy}}var on=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],l={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",grey100:"var(--graphy-grey-100)",grey95:"var(--graphy-grey-95)",grey90:"var(--graphy-grey-90)",grey85:"var(--graphy-grey-85)",grey80:"var(--graphy-grey-80)",grey75:"var(--graphy-grey-75)",grey70:"var(--graphy-grey-70)",grey60:"var(--graphy-grey-60)",grey50:"var(--graphy-grey-50)",grey0:"var(--graphy-grey-0)",greyGradient80:"var(--graphy-grey-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",gridLineColor:"var(--graphy-grid-line-color)",originLineColor:"var(--graphy-origin-line-color)",targetLineColor:"var(--graphy-target-line-color)",targetLineMarkerColor:"var(--graphy-target-line-marker-color)",targetLineLabelTextColor:"var(--graphy-target-line-label-text-color)",legendBackground:"var(--graphy-legend-background)",legendBorderColor:"var(--graphy-legend-border-color)",legendFocusOutlineColor:"var(--graphy-legend-focus-outline-color)",legendTextColor:"var(--graphy-legend-text-color)",dimmedSeriesLabelTextColor:"var(--graphy-dimmed-series-label-text-color)",dimmedSeriesLabelLineColor:"var(--graphy-dimmed-series-label-line-color)",trendNegativeColor:"var(--graphy-trend-negative-color)",trendPositiveColor:"var(--graphy-trend-positive-color)",trendNeutralColor:"var(--graphy-trend-neutral-color)",defaultAnnotationArrowStroke:"var(--graphy-default-annotation-arrow-stroke)",defaultAnnotationShapeStroke:"var(--graphy-default-annotation-shape-stroke)",defaultAnnotationShapeFill:"var(--graphy-default-annotation-shape-fill)",arrowAnnotationStickerOutlineColor:"var(--graphy-arrow-annotation-sticker-outline-color)",arrowAnnotationStickerOutlineColorInverse:"var(--graphy-arrow-annotation-sticker-outline-color-inverse)",annotationFrameBorderColor:"var(--graphy-annotation-frame-border-color)",annotationMenuTriggerIconColor:"var(--graphy-annotation-menu-trigger-icon-color)",heatmapEmptyTileBackground:"var(--graphy-heatmap-empty-tile-background)",dataLabelOutsideBackground:"var(--graphy-data-label-outside-background)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",tooltipBackground:"var(--graphy-tooltip-background)",tooltipBorderColor:"var(--graphy-tooltip-border-color)",tooltipHeadingTextColor:"var(--graphy-tooltip-heading-text-color)",tooltipLabelTextColor:"var(--graphy-tooltip-label-text-color)",tooltipValueTextColor:"var(--graphy-tooltip-value-text-color)",tooltipPrimaryRowColor:"var(--graphy-tooltip-primary-row-color)",hoverGuideLineColor:"var(--graphy-hover-guide-line-color)",hoverGuideFillColor:"var(--graphy-hover-guide-fill-color)",hoveredBarBorderColor:"var(--graphy-hovered-bar-border-color)",hoveredPointRingColor:"var(--graphy-hovered-point-ring-color)",pointStrokeColor:"var(--graphy-point-stroke-color)",stackedBarHoverBorderColor:"var(--graphy-stacked-bar-hover-border-color)",fontFamilyDefault:"var(--graphy-font-family-default)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",fontWeightBlack:"var(--graphy-font-weight-black)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontTickLabel:"var(--graphy-font-tick-label)",fontAxisLabel:"var(--graphy-font-axis-label)",fontDataLabel:"var(--graphy-font-data-label)",fontStackTotal:"var(--graphy-font-stack-total)",fontLegendLabel:"var(--graphy-font-legend-label)",fontSeriesLabel:"var(--graphy-font-series-label)",fontTooltipLabel:"var(--graphy-font-tooltip-label)",fontTooltipHeading:"var(--graphy-font-tooltip-heading)",fontTooltipFooter:"var(--graphy-font-tooltip-footer)",fontJumboTooltipLabel:"var(--graphy-font-jumbo-tooltip-label)",fontJumboTooltip:"var(--graphy-font-jumbo-tooltip)",fontMiniTooltipLabel:"var(--graphy-font-mini-tooltip-label)",fontMiniTooltipFooter:"var(--graphy-font-mini-tooltip-footer)",fontTooltipCaption:"var(--graphy-font-tooltip-caption)",fontTooltipCaptionSmall:"var(--graphy-font-tooltip-caption-small)",fontTrendTag:"var(--graphy-font-trend-tag)",fontTrendTagSmall:"var(--graphy-font-trend-tag-small)",fontGoalLineLabel:"var(--graphy-font-goal-line-label)",fontPieLabel:"var(--graphy-font-pie-label)",fontPieChartTotal:"var(--graphy-font-pie-chart-total)",fontDifferenceArrowSmall:"var(--graphy-font-difference-arrow-small)",fontDifferenceArrowMedium:"var(--graphy-font-difference-arrow-medium)",fontDifferenceArrowLarge:"var(--graphy-font-difference-arrow-large)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)"};const at=1,sn=8,Jr=12;l.pointStrokeColor;const Qr=1;function eo(e){return e}function z(e){return 1-e}const b=e=>`${Number.parseFloat((e*100).toFixed(4))}%`,to=2,no=.7,te=({hit:e})=>{const t=f.getColor(e.observation),n=(f.getAlpha(e.observation)??at)*no,o=(f.getSize(e.observation)??sn)/2;return r.jsx("circle",{cx:b(e.x),cy:b(z(e.y)),r:o,fill:t,opacity:n,stroke:l.hoveredPointRingColor,strokeWidth:to,"data-testid":"companion-point"})},an=.3,ln=1,I={type:"spring",stiffness:500,damping:60,mass:1},cn=1,ro=2,un=e=>e==="catmull-rom"?ee.curveCatmullRom:ee.curveLinear,He=e=>{switch(e){case"dashed":return"8 4";case"dotted":return"2 2";case"solid":return}},Be=(e,t)=>t.lineWidth!=="auto"?t.lineWidth:f.getStrokeWidth(e)??ro,Re=e=>t=>`${e}:${f.getIdentityKey(t)}`,Me=(e,t)=>{const n=E.useMotionValue(e);return g.useEffect(()=>{const o=Ir.interpolatePath(n.get(),e);E.animate(0,1,{...t,onUpdate:s=>{const a=o(s);return n.set(a)}})},[t,e,n]),n};var de="_1d8mpa10";const dn=(e,t)=>{const n=un(t.interpolate),o=ee.area().curve(n),s=ee.line().curve(n);if(e.mainAxis==="y"){const a=u=>z(f.getY(u)??0),c=u=>f.getXMin(u)??0,i=u=>f.getXMax(u)??f.getX(u)??0;o.y(a).x0(c).x1(i),s.y(a).x(i)}else{const a=u=>f.getX(u)??0,c=u=>z(f.getYMin(u)??0),i=u=>z(f.getYMax(u)??f.getY(u)??0);o.x(a).y0(c).y1(i),s.x(a).y(i)}if(t.missingValues==="gap"){const a=c=>f.getX(c)!==null&&f.getY(c)!==null;o.defined(a),s.defined(a)}return{lineGenerator:s,areaGenerator:o}},hn=(e,t)=>t!=="connect"?e:e.filter(n=>f.getX(n)!==null&&f.getY(n)!==null),oo=g.memo(function({layer:t,coordSystem:n,isAnimated:o}){const{lineGenerator:s,areaGenerator:a}=g.useMemo(()=>dn(n,t.params),[t.params,n]),c=g.useMemo(()=>{const i=Re(t.id),u=[];return t.data.groupBy(f.GROUP_VARIABLES.group).forEach(d=>{const h=hn([...d],t.params.missingValues),m=a(h),p=s(h);if(!m||!p)return;const x=h[0];if(!x)return;const v=f.getColor(x),y=f.getAlpha(x),S=Be(x,t.params),L=He(f.getLineType(x));u.push({key:i(x),areaPath:m,linePath:p,color:v,fillOpacity:y??an,strokeWidth:S,strokeOpacity:ln,strokeDasharray:L})}),u},[a,s,t.data,t.id,t.params]);return r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:de,children:c.map(i=>r.jsx(so,{areaPath:i.areaPath,linePath:i.linePath,color:i.color,fillOpacity:i.fillOpacity,strokeWidth:i.strokeWidth,strokeOpacity:i.strokeOpacity,strokeDasharray:i.strokeDasharray,isAnimated:o},i.key))})}),so=({areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,isAnimated:i})=>i?r.jsx(ao,{areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c}):r.jsxs("g",{children:[r.jsx("path",{d:e,fill:n,fillOpacity:o,stroke:"none"}),r.jsx("path",{d:t,fill:"none",stroke:n,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,vectorEffect:"non-scaling-stroke"})]}),ao=({areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c})=>{const i=Me(e,I),u=Me(t,I);return r.jsxs("g",{children:[r.jsx(E.motion.path,{d:i,fill:n,fillOpacity:o,stroke:"none"}),r.jsx(E.motion.path,{d:u,fill:"none",stroke:n,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,vectorEffect:"non-scaling-stroke"})]})};var io="_46ebsf0";const ze=1,lo=2,co=1,uo=Jr/2,ho=2.25,Ie=({hit:e,...t})=>{const n=go(e.observation),o=f.getColor(e.observation),s=f.getAlpha(e.observation)??at,a=b(e.x),c=b(z(e.y)),u=n+ze/2+co+ze/2;return r.jsxs("g",{...t,className:io,children:[r.jsx("circle",{cx:a,cy:c,r:u,fill:"none",stroke:l.hoveredPointRingColor,strokeWidth:lo}),r.jsx("circle",{cx:a,cy:c,r:n,fill:o,opacity:s,stroke:l.hoveredPointRingColor,strokeWidth:ze})]})},go=e=>{const t=f.getSize(e);return f.isDefined(t)?t/ho:uo},fo=({layer:e,coordSystem:t,primary:n,companions:o})=>{const s=f.getGroup(n.observation),a=g.useMemo(()=>{const p=e.data.filter(f.GROUP_VARIABLES.group,"eq",s);return hn([...p],e.params.missingValues)},[e.data,e.params.missingValues,s]),{areaPath:c,linePath:i}=g.useMemo(()=>{const{lineGenerator:p,areaGenerator:x}=dn(t,e.params);return{areaPath:x(a)??"",linePath:p(a)??""}},[t,e.params,a]);if(!c||!i)return null;const u=f.getColor(n.observation),d=f.getAlpha(n.observation)??an,h=Be(n.observation,e.params),m=He(f.getLineType(n.observation));return r.jsxs("g",{"data-testid":"hovered-area",children:[r.jsxs("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:de,children:[r.jsx("path",{d:c,fill:u,fillOpacity:d,stroke:"none","data-testid":"hovered-area-fill"}),r.jsx("path",{d:i,fill:"none",stroke:u,strokeWidth:h,strokeOpacity:ln,strokeDasharray:m,vectorEffect:"non-scaling-stroke","data-testid":"hovered-area-edge"})]}),o.map(p=>r.jsx(te,{hit:p},`companion-${p.layerId}-${p.pointIndex}`)),r.jsx(Ie,{hit:n,"data-testid":"hovered-area-point"})]})},po={geom:"area",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:e,coordSystem:t,isAnimated:n})=>r.jsx(oo,{layer:e,coordSystem:t,isAnimated:n}),renderHover:({layer:e,coordSystem:t,primary:n,group:o,related:s})=>r.jsx(fo,{layer:e,coordSystem:t,primary:n,companions:[...o,...s]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e,coordSystem:t})=>{if(t.mainAxis==="x"){const s=f.getX(e),a=f.getYMax(e)??f.getY(e);return s===null||a===null?null:{x:s,y:a}}const n=f.getY(e),o=f.getXMax(e)??f.getX(e);return n===null||o===null?null:{x:o,y:n}}},gn=1,ve=4,fn=(e,t)=>{const n=f.getXMin(t),o=f.getXMax(t),s=f.getYMin(t),a=f.getYMax(t)??f.getY(t);if(n===null||o===null||s===null||a===null)return null;if(e==="x"){let u=1-a,d=a-s;return d<0&&(u+=d,d=-d),{x:n,y:u,width:o-n,height:d}}let c=n,i=o-n;return i<0&&(c+=i,i=-i),{x:c,y:1-a,width:i,height:a-s}},mo=g.memo(function({layer:t,coordSystem:n,isAnimated:o}){const s=g.useId(),a=g.useMemo(()=>{const i=Re(t.id),u=new Map;for(const d of t.data){const h=fn(n.mainAxis,d);if(!h)continue;const m=vo(n.mainAxis,h),p=u.get(m),x={key:i(d),...h,fill:f.getColor(d),opacity:f.getAlpha(d)??gn};p?p.push(x):u.set(m,[x])}return[...u.entries()].map(([d,h])=>({id:`${s}${d}`,bars:h,...yo(h)}))},[s,n.mainAxis,t]),c=a.filter(i=>i.bars.length>1);return r.jsxs(r.Fragment,{children:[c.length>0&&r.jsx("defs",{children:c.map(i=>r.jsx("clipPath",{id:i.id,children:r.jsx(xo,{column:i,isAnimated:o})},i.id))}),a.map(i=>{const[u]=i.bars;if(i.bars.length===1&&u!==void 0){const{key:d,...h}=u;return r.jsx(pt,{...h,rx:ve,isAnimated:o},d)}return r.jsx("g",{clipPath:`url(#${i.id})`,children:i.bars.map(d=>{const{key:h,...m}=d;return r.jsx(pt,{...m,isAnimated:o},h)})},i.id)})]})}),pt=({isAnimated:e,rx:t,...n})=>e?r.jsx(E.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:I,fill:n.fill,opacity:n.opacity,rx:t,animate:{x:b(n.x),y:b(n.y),width:b(n.width),height:b(n.height),opacity:n.opacity}}):r.jsx("rect",{style:{transformBox:"view-box"},x:b(n.x),y:b(n.y),width:b(n.width),height:b(n.height),fill:n.fill,opacity:n.opacity,rx:t}),xo=({column:e,isAnimated:t})=>t?r.jsx(E.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:I,rx:ve,animate:{x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height)}}):r.jsx("rect",{x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height),rx:ve}),vo=(e,t)=>e==="x"?`${t.x}-${t.width}`:`${t.y}-${t.height}`,yo=e=>{let t=1/0,n=1/0,o=-1/0,s=-1/0;for(const a of e)a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x+a.width>o&&(o=a.x+a.width),a.y+a.height>s&&(s=a.y+a.height);return{x:t,y:n,width:o-t,height:s-n}};var bo="_1i6dtb60";const fe=3,So=({coordSystem:e,primary:t,panelRect:n})=>{const o=fn(e.mainAxis,t.observation);if(!o)return null;const s=o.x*n.width,a=o.y*n.height,c=o.width*n.width,i=o.height*n.height,u=s-fe,d=a-fe,h=c+fe*2,m=i+fe*2,p=ve+fe,x=f.getColor(t.observation),v=f.getAlpha(t.observation)??gn;return r.jsxs("g",{"data-testid":"hovered-bar",children:[r.jsx("rect",{x:u,y:d,width:h,height:m,rx:p,fill:l.hoveredBarBorderColor,className:bo,"data-testid":"hovered-bar-border"}),r.jsx("rect",{x:b(o.x),y:b(o.y),width:b(o.width),height:b(o.height),fill:x,opacity:v,rx:ve,"data-testid":"hovered-bar-fill"})]})},jo={geom:"bar",coord:"cartesian",highlightStrategy:"observation-rerender",guideMode:"bar",render:({layer:e,coordSystem:t,isAnimated:n})=>r.jsx(mo,{layer:e,coordSystem:t,isAnimated:n}),renderHover:({coordSystem:e,primary:t,panelRect:n})=>r.jsx(So,{coordSystem:e,primary:t,panelRect:n}),renderHoverCompanions:()=>null},pn=e=>{const t=ee.line().x(n=>f.getX(n)??0).y(n=>z(f.getY(n)??0)).curve(un(e.interpolate));return e.missingValues==="gap"&&t.defined(n=>f.getX(n)!==null&&f.getY(n)!==null),t},mn=(e,t)=>t!=="connect"?e:e.filter(n=>f.getX(n)!==null&&f.getY(n)!==null),Lo=g.memo(function({layer:t,isAnimated:n}){const o=g.useMemo(()=>pn(t.params),[t.params]),s=g.useMemo(()=>{const a=Re(t.id),c=[];return t.data.groupBy(f.GROUP_VARIABLES.group).forEach(i=>{const u=mn([...i],t.params.missingValues),d=o(u);if(!d)return;const h=u[0];if(!h)return;const m=f.getColor(h),p=f.getAlpha(h),x=Be(h,t.params),v=He(f.getLineType(h));c.push({key:a(h),pathData:d,color:m,opacity:p??cn,strokeWidth:x,strokeDasharray:v})}),c},[o,t.data,t.id,t.params]);return r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:de,children:s.map(a=>r.jsx(Co,{pathData:a.pathData,color:a.color,strokeWidth:a.strokeWidth,opacity:a.opacity,strokeDasharray:a.strokeDasharray,isAnimated:n},a.key))})}),Co=({pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s,isAnimated:a})=>a?r.jsx(ko,{pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s}):r.jsx("path",{d:e,fill:"none",stroke:t,strokeWidth:n,opacity:o,strokeDasharray:s,vectorEffect:"non-scaling-stroke"}),ko=({pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s})=>{const a=Me(e,I);return r.jsx(E.motion.path,{d:a,fill:"none",stroke:t,strokeWidth:n,opacity:o,strokeDasharray:s,vectorEffect:"non-scaling-stroke"})},To=({layer:e,primary:t,companions:n})=>{const o=f.getGroup(t.observation),s=g.useMemo(()=>{const h=e.data.filter(f.GROUP_VARIABLES.group,"eq",o);return mn([...h],e.params.missingValues)},[e.data,e.params.missingValues,o]),a=g.useMemo(()=>pn(e.params)(s),[e.params,s]);if(!a)return null;const c=f.getColor(t.observation),i=f.getAlpha(t.observation)??cn,u=Be(t.observation,e.params),d=He(f.getLineType(t.observation));return r.jsxs("g",{"data-testid":"hovered-line",children:[r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:de,children:r.jsx("path",{d:a,fill:"none",stroke:c,strokeWidth:u,opacity:i,strokeDasharray:d,vectorEffect:"non-scaling-stroke","data-testid":"hovered-line-path"})}),n.map(h=>r.jsx(te,{hit:h},`companion-${h.layerId}-${h.pointIndex}`)),r.jsx(Ie,{hit:t,"data-testid":"hovered-line-point"})]})},wo={geom:"line",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:e,isAnimated:t})=>r.jsx(Lo,{layer:e,isAnimated:t}),renderHover:({layer:e,primary:t,group:n,related:o})=>r.jsx(To,{layer:e,primary:t,companions:[...n,...o]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e})=>{const t=f.getX(e),n=f.getY(e);return t===null||n===null?null:{x:t,y:n}}},Ao=g.memo(function({layer:t,isAnimated:n}){const o=g.useMemo(()=>{const s=[];for(const a of t.data){const c=f.getX(a),i=f.getY(a);if(c===null||i===null)continue;const u=f.getColor(a),d=f.getAlpha(a),h=f.getSize(a),m=f.getStrokeWidth(a);s.push({key:f.getIdentityKey(a),cx:c,cy:z(i),radius:(h??t.params.size)/2,fill:u,stroke:l.pointStrokeColor,opacity:d??at,strokeWidth:m??Qr})}return s},[t.data,t.params.size]);return r.jsx(r.Fragment,{children:o.map(s=>n?r.jsx(E.motion.circle,{initial:!1,transition:I,fill:s.fill,stroke:s.stroke,strokeWidth:s.strokeWidth,animate:{cx:b(s.cx),cy:b(s.cy),r:s.radius,opacity:s.opacity}},s.key):r.jsx("circle",{cx:b(s.cx),cy:b(s.cy),r:s.radius,fill:s.fill,opacity:s.opacity,stroke:s.stroke,strokeWidth:s.strokeWidth},s.key))})}),Eo={geom:"point",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:null,render:({layer:e,isAnimated:t})=>r.jsx(Ao,{layer:e,isAnimated:t}),renderHover:({primary:e,group:t,related:n})=>r.jsxs("g",{"data-testid":"hovered-point",children:[[...t,...n].map(o=>r.jsx(te,{hit:o},`companion-${o.layerId}-${o.pointIndex}`)),r.jsx(Ie,{hit:e})]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e})=>{const t=f.getX(e),n=f.getY(e);return t===null||n===null?null:{x:t,y:n}}},xn=10,Y=(e,t)=>e*xn*t,_o=/\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu,vn="😀";class Oe{constructor(){this.emojiCorrections=new Map,this.currentFont="";const n=new OffscreenCanvas(1,1).getContext("2d");if(!n)throw new Error("Failed to create OffscreenCanvas 2D context");this.ctx=n}static async create(){return typeof document<"u"&&"fonts"in document&&await document.fonts.ready,new Oe}measureText(t,n){const o=f.buildFontString(n);this.setFont(o);const{width:s,fontBoundingBoxAscent:a,fontBoundingBoxDescent:c}=this.ctx.measureText(t);let i=s;const u=Mo(t);if(u>0){const d=this.getEmojiCorrection(o);i-=d*u}return{width:i,height:a+c,ascent:a,descent:c}}setFont(t){this.currentFont!==t&&(this.ctx.font=t,this.currentFont=t)}getEmojiCorrection(t){const n=this.emojiCorrections.get(t);if(n!==void 0)return n;this.setFont(t);const o=this.ctx.measureText(vn).width,s=Po(t);let a=0;if(s!==null){const c=o-s;a=c>.5?c:0}return this.emojiCorrections.set(t,a),a}}let X=null;const Mo=e=>{const t=e.match(_o);return t?t.length:0},Po=e=>{const t=Fo();return t?(t.style.font=e,t.getBoundingClientRect().width):null},Fo=()=>typeof document>"u"?null:(X||(X=document.createElement("span"),X.style.position="absolute",X.style.visibility="hidden",X.style.whiteSpace="nowrap",X.style.left="-9999px",X.textContent=vn,document.body.appendChild(X)),X),yn=g.createContext(null),bn=({children:e,measurer:t})=>{const[n,o]=g.useState(null);g.useEffect(()=>{if(t!==void 0)return;let a=!1;const c=()=>{a||o(No())};return(async()=>{typeof document<"u"&&"fonts"in document&&await document.fonts.ready,c()})(),typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",c),()=>{a=!0,typeof document<"u"&&"fonts"in document&&document.fonts.removeEventListener("loadingdone",c)}},[t]);const s=t??n;return s===null?null:r.jsx(yn.Provider,{value:s,children:e})},ne=()=>{const e=g.useContext(yn);if(e===null)throw new Error("useTextMeasurer must be used inside a <TextMeasurerProvider>.");return e},No=()=>{try{return new f.CachedTextMeasurer(new Oe)}catch{return new f.CachedTextMeasurer(new f.HeuristicTextMeasurer)}},O=`'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu',
3
+ 'Cantarell', 'Helvetica Neue', 'NotoSansArabic', 'NotoSansJP', 'NotoSansSC', 'NotoSansKR', 'NotoSerifKR', sans-serif, 'Apple Color Emoji', 'NotoColorEmoji'`,Ho=O,q={regular:400,medium:500,semibold:600,bold:700,extraBold:800,black:900},P={xxs:1,xs:1.1,sm:1.2,md:1.4,lg:1.6,xl:2,editorBody:1.5,headingSm:1.8,headingMd:2.2,headingLg:2.8},R={xxs:1,xs:1,sm:1.3,md:1.43,lg:1,xl:1,editorBody:1.47,headingSm:1.25,headingMd:1.41,headingLg:1.29},Bo=`var(--typography-chart-font-family, ${l.fontFamilyDefault})`,Ge=`var(--typography-chart-heading-font-family, ${l.fontFamilyHeading})`,W=e=>`${e}em`,Sn={textScale:"1",fontFamilyDefault:O,fontFamilyHeading:Ho,fontWeightRegular:q.regular.toString(),fontWeightMedium:q.medium.toString(),fontWeightSemibold:q.semibold.toString(),fontWeightBold:q.bold.toString(),fontWeightExtraBold:q.extraBold.toString(),fontWeightBlack:q.black.toString(),fontSizeXxs:W(P.xxs),fontSizeXs:W(P.xs),fontSizeSm:W(P.sm),fontSizeMd:W(P.md),fontSizeLg:W(P.lg),fontSizeXl:W(P.xl),fontLineHeightXxs:R.xxs.toString(),fontLineHeightXs:R.xs.toString(),fontLineHeightSm:R.sm.toString(),fontLineHeightMd:R.md.toString(),fontLineHeightLg:R.lg.toString(),fontLineHeightXl:R.xl.toString()},jn={fontSizeEditorBody:W(P.editorBody),fontSizeHeadingSm:W(P.headingSm),fontSizeHeadingMd:W(P.headingMd),fontSizeHeadingLg:W(P.headingLg),fontLineHeightEditorBody:R.editorBody.toString(),fontLineHeightHeadingSm:R.headingSm.toString(),fontLineHeightHeadingMd:R.headingMd.toString(),fontLineHeightHeadingLg:R.headingLg.toString()},j=(e,t,n,o=Bo)=>`${e} ${t}/${n} ${o}`,Ln={fontTickLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontAxisLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontDataLabel:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontStackTotal:j(l.fontWeightSemibold,l.fontSizeXs,l.fontLineHeightXs),fontLegendLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontSeriesLabel:j(l.fontWeightSemibold,l.fontSizeSm,l.fontLineHeightSm),fontTooltipLabel:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTooltipHeading:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTooltipFooter:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontJumboTooltipLabel:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontJumboTooltip:j(l.fontWeightMedium,l.fontSizeHeadingMd,l.fontLineHeightHeadingMd),fontMiniTooltipLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontMiniTooltipFooter:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontTooltipCaption:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTooltipCaptionSmall:j(l.fontWeightMedium,l.fontSizeXxs,l.fontLineHeightXxs),fontUITooltip:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontUITooltipSecondary:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTrendTag:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTrendTagSmall:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontGoalLineLabel:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontPieLabel:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontPieChartTotal:j(l.fontWeightBold,l.fontSizeHeadingLg,l.fontLineHeightHeadingLg),fontDifferenceArrowSmall:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontDifferenceArrowMedium:j(l.fontWeightMedium,l.fontSizeLg,l.fontLineHeightLg),fontDifferenceArrowLarge:j(l.fontWeightSemibold,l.fontSizeXl,l.fontLineHeightXl),fontButton:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontInput:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontInputLabel:j(l.fontWeightMedium,l.fontSizeXxs,l.fontLineHeightXxs),fontSelectLabel:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontSelectDescription:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontColorSelectLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontMenuTitle:j(l.fontWeightSemibold,l.fontSizeMd,l.fontLineHeightMd),fontMenuGroupTitle:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontMenuItemLabel:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontMenuItemLabelSecondary:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontErrorBoundaryTitle:j(l.fontWeightSemibold,l.fontSizeHeadingSm,l.fontLineHeightHeadingSm),fontErrorBoundaryMessage:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTableCell:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTableHeaderCell:j(l.fontWeightSemibold,l.fontSizeSm,l.fontLineHeightSm),fontSourceLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontSourceLink:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontTextEditorH1:j(l.fontWeightBold,l.fontSizeHeadingLg,l.fontLineHeightHeadingLg,Ge),fontTextEditorH2:j(l.fontWeightBold,l.fontSizeHeadingMd,l.fontLineHeightHeadingMd,Ge),fontTextEditorH3:j(l.fontWeightSemibold,l.fontSizeHeadingSm,l.fontLineHeightHeadingSm,Ge),fontTextEditorH6:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTextEditorBody:j(l.fontWeightMedium,l.fontSizeEditorBody,l.fontLineHeightEditorBody),fontTextEditorLink:j(l.fontWeightRegular,l.fontSizeMd,l.fontLineHeightMd),fontHighlightModeTitle:j(l.fontWeightBold,l.fontSizeMd,l.fontLineHeightMd),fontHighlightModeSubtitle:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm)},Ro=11.7,Io=P.xs,Oo=O,Do=q.medium,me=5,zo=5,mt=10,xt=10,Go=4,Pe=13,Cn=6,We=12,vt=21.6,Wo="0 0 10 18",$o="M2.48935 16.9323L9.07098 9.82964C9.51595 9.34944 9.51504 8.60728 9.0689 8.12818L2.48866 1.06172C1.85811 0.384586 0.974477 0 0.049217 0H0V18H0.0443689C0.972463 18 1.85854 17.6131 2.48935 16.9323Z",yt="#FFFFFF",$e="#1A1A1A";var Xo="_16vokpr0";const qo=(e,t)=>{const n=e.mapping.y!==void 0,o=t.mainAxis==="y";return n!==o},Yo=(e,t)=>{const n=b(e?1-t:t);return e?{x1:"0%",y1:n,x2:"100%",y2:n}:{x1:n,y1:"0%",x2:n,y2:"100%"}},Vo=(e,t)=>e==="solid"?{}:e==="dotted"?{strokeDasharray:`0 ${t*2}`,strokeLinecap:"round"}:{strokeDasharray:`${t*2} ${t*3}`,strokeLinecap:"round",strokeMiterlimit:16},Uo=e=>{const t=e.params.color,n=t??l.targetLineColor;let o=l.targetLineLabelTextColor;if(t!==void 0)try{o=Ke.getContrast(t,yt)>Ke.getContrast(t,$e)?yt:$e}catch{o=$e}return{lineColor:n,labelTextColor:o}},Ko=(e,t)=>ke(e)&&ke(t)?`${e}: ${t}`:ke(e)?e:ke(t)?t:null,ke=e=>e!=null&&e.trim()!=="";var Zo="_2qyyu60";const bt=2,Jo=12,Qo=12,St=1,jt=2,es=4,ye=({shape:e,color:t,lineType:n="solid",width:o=Jo,height:s=Qo})=>r.jsx("svg",{className:Zo,width:o,height:s,viewBox:`0 0 ${o} ${s}`,"aria-hidden":!0,"data-testid":"chart-swatch","data-shape":e,children:ts({shape:e,color:t,lineType:n,width:o,height:s})}),ts=({shape:e,color:t,lineType:n,width:o,height:s})=>{const a=ns(n,o);switch(e){case"square":return r.jsx("rect",{x:1,y:1,width:o-2,height:s-2,rx:2,fill:t});case"line":return r.jsx("line",{x1:a.x1,y1:s/2,x2:a.x2,y2:s/2,stroke:t,strokeWidth:bt,strokeLinecap:a.linecap,strokeDasharray:a.dashArray});case"circle":{const c=(Math.min(o,s)-2)/2;return r.jsx("circle",{cx:o/2,cy:s/2,r:c,fill:t})}case"area":{const c=s/2-1;return r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:1,y:c,width:o-2,height:s-c-1,fill:t,opacity:.45}),r.jsx("line",{x1:a.x1,y1:c,x2:a.x2,y2:c,stroke:t,strokeWidth:bt,strokeLinecap:a.linecap,strokeDasharray:a.dashArray})]})}case"slice":return r.jsx("path",{d:`M 0 ${s} L ${o} ${s} A ${o} ${s} 0 0 0 0 0 Z`,fill:t})}},ns=(e,t)=>{if(e==="solid")return{x1:0,x2:t,dashArray:void 0,linecap:"round"};if(e==="dashed"){const o=(t-St*(jt-1))/jt;return{x1:0,x2:t,dashArray:`${o} ${St}`,linecap:"butt"}}const n=t/(es-1);return{x1:0,x2:t,dashArray:`1 ${n}`,linecap:"round"}},rs=({labelPosition:e,linePosition:t,color:n,pillWidth:o,pillHeight:s,text:a,isAnimated:c})=>{const i=e==="start",u=i?-Pe:-(o-Pe),d=i?u+o-me:u+me-We,h=i?void 0:`rotate(180 ${d+We/2} ${s/2})`,m=i?"0%":"100%",p=b(1-t),x=r.jsxs("g",{transform:`translate(0, ${-s/2})`,pointerEvents:"none",children:[r.jsx("rect",{x:u,y:0,width:o,height:s,rx:Cn,fill:n}),r.jsx("g",{transform:h,children:r.jsx("svg",{x:d,y:(s-vt)/2,width:We,height:vt,viewBox:Wo,overflow:"visible",children:r.jsx("path",{d:$o,fill:n})})}),r.jsx("g",{transform:`translate(${u+me}, ${s/2})`,children:a})]});return c?r.jsx(E.motion.svg,{initial:!1,transition:I,x:m,animate:{y:p},overflow:"visible",children:x}):r.jsx("svg",{x:m,y:p,overflow:"visible",children:x})},os=({labelPosition:e,linePosition:t,color:n,pillWidth:o,pillHeight:s,text:a,isAnimated:c})=>{const i=e==="start",u=i?-Pe:-(s-Pe),d=b(t),h=i?"100%":"0%",m=r.jsxs("g",{transform:`translate(${-o/2}, 0)`,pointerEvents:"none",children:[r.jsx("rect",{x:0,y:u,width:o,height:s,rx:Cn,fill:n}),r.jsx("g",{transform:`translate(${me}, ${u+s/2})`,children:a})]});return c?r.jsx(E.motion.svg,{initial:!1,transition:I,y:h,animate:{x:d},overflow:"visible",children:m}):r.jsx("svg",{x:d,y:h,overflow:"visible",children:m})},ss=({label:e,textWidth:t,labelPosition:n,isHorizontalLine:o,position:s,color:a,textColor:c,symbolShape:i,symbolColor:u,isAnimated:d})=>{const h=i===null?0:mt+Go,m=t+h+me*2,p=Ro+zo*2,x=r.jsxs(r.Fragment,{children:[i!==null&&u!==null&&r.jsx("g",{transform:`translate(0, ${-xt/2})`,children:r.jsx(ye,{shape:i,color:u,width:mt,height:xt})}),r.jsx("text",{x:h,textAnchor:"start",dominantBaseline:"central",fill:c,style:{font:l.fontGoalLineLabel},children:e})]});return o?r.jsx(rs,{labelPosition:n,linePosition:s,color:a,pillWidth:m,pillHeight:p,text:x,isAnimated:d}):r.jsx(os,{labelPosition:n,linePosition:s,color:a,pillWidth:m,pillHeight:p,text:x,isAnimated:d})},as=({layer:e,isHorizontalLine:t,position:n,lineColor:o,isAnimated:s})=>{const a=Yo(t,n),c=Vo(e.params.lineType,e.params.strokeWidth);return s?r.jsx(E.motion.line,{initial:!1,transition:I,animate:{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},...c,stroke:o,strokeWidth:e.params.strokeWidth,vectorEffect:"non-scaling-stroke"}):r.jsx("line",{...a,...c,stroke:o,strokeWidth:e.params.strokeWidth,vectorEffect:"non-scaling-stroke"})},is=g.memo(function({layer:t,coordSystem:n,formattingLocale:o,isAnimated:s}){const a=ne(),{guides:c,numberFormat:i,textScale:u,layers:d,compiledLayers:h,colorScale:m}=T(H.useShallow(k=>({guides:k.guides,numberFormat:k.config.numberFormat,textScale:k.config.appearance.textScale,layers:k.spec.layers,compiledLayers:k.layers,colorScale:k.scales.color}))),p=g.useMemo(()=>f.buildAverageLineSymbols(d,h,m,n).get(t.id)??null,[d,h,m,n,t.id]),x=g.useMemo(()=>Ko(t.params.label,f.formatRuleValue({guides:c,numberFormat:i,layer:t,locale:o})),[c,i,o,t]),v=g.useMemo(()=>({family:Oo,size:Y(Io,u),weight:Do}),[u]),y=g.useMemo(()=>x===null?0:a.measureText(x,v).width,[x,v,a]),S=t.data.getFirst();if(!S)return null;const{lineColor:L,labelTextColor:C}=Uo(t),w=qo(t,n),D=w?f.getY(S):f.getX(S);return D===null?null:r.jsxs("g",{"data-geom":"rule",className:Xo,children:[r.jsx(as,{layer:t,isHorizontalLine:w,position:D,lineColor:L,isAnimated:s}),x!==null&&r.jsx(ss,{label:x,textWidth:y,labelPosition:t.params.labelPosition,isHorizontalLine:w,position:D,color:L,textColor:C,symbolShape:p?.shape??null,symbolColor:p?.color??null,isAnimated:s})]})}),ls={geom:"rule",coord:"cartesian",highlightStrategy:null,guideMode:null,render:({layer:e,coordSystem:t,formattingLocale:n,isAnimated:o})=>r.jsx(is,{layer:e,coordSystem:t,formattingLocale:n,isAnimated:o}),renderHover:()=>null,renderHoverCompanions:()=>null},kn=1,Je=ee.arc(),Lt=Math.PI*2,cs=g.memo(function({layer:t,isAnimated:n}){const o=g.useRef(!1);g.useEffect(()=>{o.current=!0},[]);const s=g.useMemo(()=>{const a=Re(t.id),c=[];for(const i of t.data){const u=a(i),{startAngle:d,endAngle:h}=f.getAngleExtent(i),{innerRadius:m,outerRadius:p}=f.getRadiusExtent(i);d===null||h===null||m===null||p===null||c.push({key:u,startAngle:d,endAngle:h,innerRadius:m,outerRadius:p,fill:f.getColor(i),opacity:f.getAlpha(i)??kn})}return c},[t]);return r.jsx("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"bar",className:de,children:s.map(a=>{if(n){const{key:c,...i}=a;return r.jsx(us,{isInitialRender:!o.current,...i},c)}return r.jsx("path",{d:Je({startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius})??void 0,fill:a.fill,opacity:a.opacity},a.key)})})}),us=({startAngle:e,endAngle:t,innerRadius:n,outerRadius:o,fill:s,opacity:a,isInitialRender:c})=>{const i=c?e:Lt,u=c?t:Lt,d=E.useSpring(i,I),h=E.useSpring(u,I),m=E.useMotionValue(Je({startAngle:i,endAngle:u,innerRadius:n,outerRadius:o})??"");return g.useEffect(()=>{d.set(e),h.set(t)},[d,h,e,t]),g.useEffect(()=>{const p=()=>{const y=d.get(),S=h.get();m.set(Je({startAngle:y,endAngle:S,innerRadius:n,outerRadius:o})??"")},x=d.on("change",p),v=h.on("change",p);return()=>{x(),v()}},[d,h,n,o,m]),r.jsx(E.motion.path,{d:m,fill:s,opacity:a,transition:I})},ds=ee.arc(),hs=({primary:e})=>{const{startAngle:t,endAngle:n}=f.getAngleExtent(e.observation),{innerRadius:o,outerRadius:s}=f.getRadiusExtent(e.observation);if(t===null||n===null||o===null||s===null)return null;const a=ds({startAngle:t,endAngle:n,innerRadius:o,outerRadius:s});if(!a)return null;const c=f.getColor(e.observation),i=f.getAlpha(e.observation)??kn;return r.jsx("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"arc","data-testid":"hovered-arc",className:de,children:r.jsx("path",{d:a,fill:c,opacity:i})})},gs={geom:"bar",coord:"polar",highlightStrategy:"observation-rerender",guideMode:null,render:({layer:e,isAnimated:t})=>r.jsx(cs,{layer:e,isAnimated:t}),renderHover:({primary:e})=>r.jsx(hs,{primary:e}),renderHoverCompanions:()=>null},Ct={bar:{cartesian:jo,polar:gs},line:{cartesian:wo},area:{cartesian:po},point:{cartesian:Eo},rule:{cartesian:ls}},fs=(e=[])=>{const t={};for(const n of Object.keys(Ct))t[n]={...Ct[n]};for(const n of e){const o=t[n.geom]??{};o[n.coord]=n,t[n.geom]=o}return(n,o)=>t[n.geom]?.[o.type]??null},ps=e=>ot.createStore(t=>({compiled:e,setCompiled:n=>t(o=>o.compiled===n?o:{compiled:n})}));function ms(e,t){const n=f.isGraphConfig(e)?e.themeOverrides:void 0;return g.useMemo(()=>({...t,...n}),[t,n])}const Tn=g.createContext(null),xs=({data:e,input:t,formattingLocale:n,onChange:o,customPalettes:s,theme:a="light",themeOverrides:c,geoms:i,plugins:u,annotationPlugins:d,children:h})=>{const[m]=g.useState(()=>f.createCompiler({geoms:i})),[p]=g.useState(()=>Xr(m)),x=g.useMemo(()=>fs(u),[u]),v=g.useMemo(()=>Wr(d),[d]),y=ms(t,c),S=g.useMemo(()=>({customPalettes:s,theme:a}),[s,a]),[L]=g.useState(()=>{const k=m.compile({input:t,data:e,ctx:S});return p.emit({kind:"init"}),ps(k)}),C=g.useRef({input:t,data:e,ctx:S});g.useEffect(()=>{const k=t!==C.current.input,G=e!==C.current.data,U=S!==C.current.ctx;if(!k&&!G&&!U)return;const K=L.getState(),Z=k||U?m.compile({input:t,data:e,ctx:S}):m.recompile({spec:K.compiled.spec,data:e});C.current={input:t,data:e,ctx:S},K.setCompiled(Z),p.emit({kind:k?"input":"data"})},[t,e,S,m,L,p]);const w=g.useCallback(k=>{const G=L.getState(),U=k.apply(G.compiled.spec);if(!U)return;const K=m.recompile({spec:U.spec});if(G.setCompiled(K),p.emit({kind:"command",command:k}),!o)return;const Z=f.convertSpecToInput(U.spec);C.current={input:Z,data:C.current.data,ctx:C.current.ctx},o(Z)},[o,m,p,L]),D=g.useMemo(()=>({store:L,dispatch:w,formattingLocale:n,compileBus:p,theme:a,themeOverrides:y,resolvePlugin:x,resolveAnnotationPlugin:v}),[L,w,n,p,a,y,x,v]);return r.jsx(Tn.Provider,{value:D,children:h})},re=()=>{const e=g.useContext(Tn);if(!e)throw new Error("useGraph* hooks must be used inside a <GraphProvider>");return e},T=e=>{const{store:t}=re();return xe.useStore(t,n=>e(n.compiled))},it=()=>{const{dispatch:e}=re();return e},be=()=>{const{resolvePlugin:e}=re();return e},vs=()=>{const{resolveAnnotationPlugin:e}=re();return e};var ys="drqe3u0",bs="drqe3u1",Ss="drqe3u2",js="drqe3u3",Te="drqe3u4",Ls="drqe3u5",Cs="drqe3u6",ks="drqe3u7",Xe="drqe3u8",Ts="drqe3u9",ws="drqe3ua",As="drqe3ub",Es="drqe3uc",_s="drqe3ud",Ms="drqe3ue",Ps="drqe3uf",Fs="drqe3ug",Ns="drqe3uh",Hs="drqe3ui",kt={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},Tt={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},wn={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"};const Bs=({width:e=380,style:t,className:n}={})=>{const{compileBus:o}=re(),[s]=g.useState(()=>qr()),[a,c]=g.useState(!1),[i,u]=g.useState(f.isCompilerCachingEnabled);g.useEffect(()=>{const{recordCompile:v}=s.getState(),y=o.getLastTrigger(),S=o.getLastCompile();return y&&S&&v(y,S),o.subscribe(v)},[s,o]);const d=xe.useStore(s,v=>v.lastCompile),h=xe.useStore(s,v=>v.history),m=o.getCacheStats(),p=d===null&&h.length===0,x=()=>{u(v=>{const y=!v;return f.setCompilerCachingEnabled(y),y})};return r.jsxs("div",{className:N(ws,n),style:{width:e,...t},children:[r.jsxs("div",{className:ys,children:[r.jsxs("div",{children:[r.jsx("div",{className:bs,children:"compile cache"}),r.jsx("div",{className:Ms,children:p?"production: stats disabled":d?`last: ${d.label} · ${An(d.durationMs)}`:"awaiting first compile…"})]}),r.jsx("button",{type:"button",onClick:()=>c(v=>!v),className:Ps,children:a?"▾":"▴"})]}),!a&&r.jsxs("div",{className:As,children:[r.jsxs("button",{type:"button",onClick:x,className:i?kt.enabled:kt.disabled,"aria-pressed":i,children:["cache ",i?"enabled":"disabled"]}),r.jsx("span",{className:Fs,children:"next compile reflects this toggle"})]}),!a&&!p&&r.jsxs(r.Fragment,{children:[r.jsx(Rs,{delta:d?.stages,cumulative:m}),r.jsx(Is,{entries:h})]})]})},Rs=({delta:e,cumulative:t})=>r.jsxs("table",{className:Ss,children:[r.jsx("thead",{children:r.jsxs("tr",{className:Ns,children:[r.jsx("th",{className:js,children:"stage"}),r.jsx("th",{className:Te,children:"Δ miss"}),r.jsx("th",{className:Te,children:"Δ hit"}),r.jsx("th",{className:Te,children:"total miss"}),r.jsx("th",{className:Te,children:"total hit"})]})}),r.jsx("tbody",{children:f.COMPILER_STAGE_KEYS.map(n=>{const o=e?.[n],s=Os(o);return r.jsxs("tr",{className:Es,children:[r.jsxs("td",{className:Ls,children:[r.jsx("span",{className:wn[s],"aria-hidden":!0})," ",n]}),r.jsx("td",{className:s==="ran"?Tt.ran:Tt.dim,children:o?.misses??0}),r.jsx("td",{className:Xe,children:o?.hits??0}),r.jsx("td",{className:Xe,children:t[n].misses}),r.jsx("td",{className:Xe,children:t[n].hits})]},n)})})]}),Is=({entries:e})=>e.length===0?null:r.jsxs("div",{className:_s,children:[r.jsx("div",{className:Hs,children:"recent compiles"}),e.map(t=>{const n=Ds(t.stages,a=>a.misses>0),o=f.COMPILER_STAGE_KEYS.length,s=n===0?"cached":"ran";return r.jsxs("div",{className:Cs,children:[r.jsx("span",{className:wn[s],"aria-hidden":!0}),r.jsx("span",{className:ks,title:t.label,children:t.label}),r.jsxs("span",{className:Ts,children:[n,"/",o," ran · ",An(t.durationMs)]})]},t.id)})]}),Os=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",Ds=(e,t)=>{let n=0;for(const o of f.COMPILER_STAGE_KEYS)t(e[o])&&(n+=1);return n},An=e=>e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,zs={small:1.9,medium:2.3,large:2.6},Gs={small:1,medium:1,large:1.2},Ws=O,En=R.sm,$s=12,Xs=4,qs=4,Ys=12,Vs=4,Us=2,_n=24,Ks=()=>ot.createStore(e=>({hover:f.RESTING_HOVER_STATE,isPointerInside:!1,setHoverState:t=>e(n=>n.hover===t?n:{hover:t}),setPointerInside:t=>e(n=>n.isPointerInside===t?n:{isPointerInside:t})})),Zs=(e,t)=>{const n=g.useMemo(()=>({layers:e,coordSystem:t}),[e,t]),o=g.useRef(null);o.current===null&&(o.current=new f.HoverEngine(n));const s=o.current,a=g.useRef(!1);return g.useEffect(()=>{if(!a.current){a.current=!0;return}s.update(n)},[s,n]),s},Mn=g.createContext(null),Pn=({children:e})=>{const{layers:t,coordSystem:n}=T(H.useShallow(u=>({layers:u.layers,coordSystem:u.coordSystem}))),o=Zs(t,n),[s]=g.useState(()=>Ks()),a=g.useRef(null),c=g.useRef(null);if(c.current===null){const u=new Map,d={current:null},h=new Set,m=x=>{if(d.current=x,s.getState().setPointerInside(x!==null),x!==null)for(const v of h)v()},p=x=>(h.add(x),()=>{h.delete(x)});c.current={engine:o,store:s,overlayRef:a,hitTesterRegistry:u,cursorRef:d,setCursor:m,subscribeCursorMove:p}}const{hitTesterRegistry:i}=c.current;return g.useEffect(()=>{o.setHitTesters(i)},[o,i]),r.jsx(Mn.Provider,{value:c.current,children:e})},he=()=>{const e=g.useContext(Mn);if(e===null)throw new Error("useHoverContext must be used inside a <HoverProvider>.");return e};function Se(e){const{store:t}=he();return xe.useStore(t,e)}var Js="_19519k80",Qs="_19519k81",ea="_19519k82",ta="_19519k83",na="_19519k86",ra="_19519k87",oa="_19519k88";const Fn=({content:e})=>r.jsxs(r.Fragment,{children:[e.header!==null&&r.jsx("div",{className:Js,children:e.header}),r.jsx("div",{className:Qs,children:e.rows.map(t=>r.jsx(Nn,{row:t,shouldHighlight:t.isPrimary&&e.rows.length>1},t.key))})]}),Nn=({row:e,shouldHighlight:t})=>r.jsxs("div",{className:N(ea,{[ta]:t}),"data-testid":"chart-tooltip-row",children:[e.swatchColor!==null?r.jsx(ye,{shape:e.swatchShape,color:e.swatchColor,lineType:e.swatchLineType}):null,r.jsx("span",{className:na,children:e.label}),r.jsx("span",{className:ra,children:e.value})]}),sa=e=>{const{cursorRef:t,subscribeCursorMove:n}=he(),o=Se(a=>a.isPointerInside),s=g.useRef(e);return s.current=e,g.useEffect(()=>n(()=>s.current?.()),[n]),{cursorRef:t,isInside:o}},aa=16,ia=8,la={x:0,y:0,top:0,left:0,right:0,bottom:0,width:0,height:0,toJSON:()=>({})},ca=()=>{const e=T(H.useShallow(L=>({layers:L.layers,coordSystem:L.coordSystem,scales:L.scales,guides:L.guides,numberFormat:L.config.numberFormat,parsingLocale:L.config.parsingLocale}))),{formattingLocale:t}=re(),n=Se(L=>L.hover),o=be(),s=g.useRef(()=>{}),{cursorRef:a,isInside:c}=sa(()=>s.current()),i=g.useMemo(()=>f.buildTooltipContent({...e,hover:n,formattingLocale:t}),[e,n,t]),u=i!==null&&c,d=g.useMemo(()=>({getBoundingClientRect:()=>{const L=a.current;return L===null?la:ua(L)}}),[a]),{refs:h,floatingStyles:m,update:p}=F.useFloating({open:u,placement:"right",middleware:[F.offset(aa),F.flip(),F.shift({padding:ia})],elements:{reference:d}});if(s.current=p,!u)return null;const x=n.primary,v=x===null?null:e.layers.find(L=>L.id===x.layerId)??null,y=v===null?null:o(v,e.coordSystem),S=x!==null&&v!==null&&y?.renderTooltip?y.renderTooltip({content:i,layer:v,coordSystem:e.coordSystem,primary:x,group:n.group,related:n.related}):null;return r.jsx("div",{ref:h.setFloating,role:"tooltip",className:oa,style:m,"data-testid":"chart-tooltip",children:S??r.jsx(Fn,{content:i})})},ua=e=>({x:e.clientX,y:e.clientY,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,width:0,height:0,toJSON:()=>({})}),lt=P.sm,Hn=O,Bn=!1,we=6,J=10,da=(e,t)=>n=>{if(!n.isVisible||n.ticks.length===0)return 0;const o=n.position==="top"||n.position==="bottom",s=n.ticks.map(i=>e.measureText(i.formattedLabel,{family:Hn,size:Y(lt,t)})),a=n.labelMaxWidthPx??Number.POSITIVE_INFINITY;if(o){if(n.labelRotation!==0){const i=s.map(d=>d.width);return wt(i,a)+2*J}return Math.max(...s.map(i=>i.height))+J}return wt(s.map(i=>i.width),a)+J},wt=(e,t)=>Math.min(Math.max(...e),t),ha=e=>()=>Y(lt,e),ga=(e,t)=>(n,o)=>{const{labelLineHeight:s,labelFontWeight:a}=f.getDifferenceArrowDimensions(o,t);return e.measureText(n,{family:O,size:s,weight:a})},Rn=e=>{const{value:t,observationLabel:n,comparison:o,swatch:s,label:a}=e;return[{role:"valueRow",gap:qs,segments:qe([Ae("value","value",t??"–"),Ae("observation","label",n)])},{role:"trendRow",gap:Vs,ariaLabel:o===null?void 0:xa(o),segments:qe([pa(o),ma(o),Ae("trendReference","label",o?.reference??null)])},{role:"groupRow",gap:Xs,segments:qe([fa(s),Ae("label","label",a)])}].filter(i=>i.segments.length>0)},Ae=(e,t,n)=>n===null?null:{kind:"text",textRole:e,fontRole:t,text:n},fa=e=>e===null?null:{kind:"swatch",swatch:e,size:$s},pa=e=>e===null?null:{kind:"trendArrow",direction:e.direction,size:Ys},ma=e=>e===null?null:{kind:"text",textRole:"trendPercentage",fontRole:"label",text:e.percentage,trendDirection:e.direction},xa=e=>{switch(e.direction){case"up":return`Increased ${e.percentage} ${e.reference}`;case"down":return`Decreased ${e.percentage} ${e.reference}`;case"flat":return`No change ${e.reference}`}},qe=e=>e.filter(t=>t!==null),va=(e,t)=>(n,o)=>{const s=In(n,o,e,t),a=On(s.map(i=>i.width)),c=Math.max(0,s.length-1)*_n;return{width:a+c,height:Math.max(0,...s.map(i=>i.height))}},ya=(e,t)=>(n,o)=>In(n,o,e,t).map(s=>s.width),ba=(e,t)=>(n,o)=>{const s=Qe("value",o,t);return{width:e.measureText(n,s).width,height:s.size*En}},Sa=(e,t)=>{const n=va(e,t),o=ba(e,t);return(s,a)=>s.kind==="perGroup"?n(s,a):o(s.value,a)},In=(e,t,n,o)=>{const s={value:Qe("value",t,o),label:Qe("label",t,o)},a=c=>ja(c,s,n);return e.items.map(c=>{const i=Rn(c).map(a),u=Math.max(0,i.length-1)*Us;return{width:Math.max(0,...i.map(d=>d.width)),height:On(i.map(d=>d.height))+u}})},ja=(e,t,n)=>{let o=0,s=0;for(const a of e.segments)if(a.kind==="text"){const c=t[a.fontRole];o+=n.measureText(a.text,c).width,s=Math.max(s,c.size*En)}else o+=a.size,s=Math.max(s,a.size);return{width:o+Math.max(0,e.segments.length-1)*e.gap,height:s}},Qe=(e,t,n)=>{const o=e==="value"?zs[t]:Gs[t];return{family:Ws,size:Y(o,n)}},On=e=>e.reduce((t,n)=>t+n,0),ct=12,Dn=10,zn=8,La=8,Ca=8,ka=2,Gn=1,Wn=2,$n=4,Xn=P.sm,qn=R.sm,Yn=O,Vn=2*(Ca+Gn),ut=2*(ka+Gn),Ta=Wn*$n,Un=e=>{const t=Y(Xn,e);return{fontSizePx:t,lineBoxHeight:t*qn}},Kn=e=>e?Dn:0,wa=(e,t)=>n=>{if(n.items.length===0)return 0;const{fontSizePx:o,lineBoxHeight:s}=Un(t),a={family:Yn,size:o};if(n.position==="top"||n.position==="bottom")return Math.max(s,ct)+ut;const i=n.items.map(u=>{const d=e.measureText(u.formattedLabel,a).width,h=Kn(u.visual.color);return h+(h>0?zn:0)+d});return Math.max(...i)+Vn},Aa=(e,t)=>n=>e.measureText(n,{family:Hn,size:Y(lt,t)}),Ea=(e,t)=>g.useMemo(()=>e?{measureAxis:da(e,t),measureAxisLabel:ha(t),measureLegend:wa(e,t),measureHeadline:Sa(e,t),measureHeadlineItemWidths:ya(e,t),measureTickLabel:Aa(e,t),measureDifferenceArrowLabel:ga(e,t)}:null,[e,t]),_a=({measurer:e,axes:t,numberFormat:n,parsingLocale:o,formattedLegends:s,containerSize:a,externalMeasurements:c,headline:i,formattingLocale:u,annotations:d,coordSystem:h,textScale:m})=>g.useMemo(()=>e?new f.LayoutCompiler(e).compile({axes:t,numberFormat:n,parsingLocale:o,formattedLegends:s,containerSize:a,externalMeasurements:c,headline:i,formattingLocale:u,annotations:d,coordSystem:h,textScale:m}):null,[t,n,o,s,a,c,i,u,d,h,m,e]),At="data-variant",Zn=Dr.Paragraph.extend({addAttributes(){return{variant:{default:null,parseHTML:e=>e.getAttribute(At)??null,renderHTML:e=>e.variant?{[At]:e.variant}:{}}}}}),Ma=Or.Extension.create({name:"preventBackspaceAcrossTitleBoundary",addOptions(){return{isTitleVisible:!0}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{if(!this.options.isTitleVisible)return!1;const{selection:t}=e.state;if(!t.empty)return!1;const{$from:n}=t;return n.depth!==1||n.parentOffset!==0?!1:n.index(0)===1}}}}),Pa=({titlePlaceholder:e,subtitlePlaceholder:t,isTitleVisible:n,isSubtitleVisible:o})=>[Na({isTitleVisible:n,isSubtitleVisible:o}),Zn,en.Text,_e.UndoRedo,Zt.Heading.configure({levels:[1,2,3]}),Ut.Bold,Jt.Italic,nn.Underline,tn.TextAlign.configure({types:["heading","paragraph"]}),Qt.Link.configure({openOnClick:!1,autolink:!0}),le.TextStyle,le.Color,le.FontFamily,Kt.HardBreak,Ma.configure({isTitleVisible:n}),_e.Placeholder.configure({showOnlyCurrent:!1,placeholder:({pos:s,editor:a})=>{if(n&&s===0)return e;const c=n?a.state.doc.firstChild?.nodeSize??-1:0;return o&&s===c?t:""}})],Fa=({placeholder:e})=>[Ze.Document,Zn,en.Text,_e.UndoRedo,Zt.Heading.configure({levels:[1,2,3]}),Ut.Bold,Jt.Italic,nn.Underline,tn.TextAlign.configure({types:["heading","paragraph"]}),Qt.Link.configure({openOnClick:!1,autolink:!0}),le.TextStyle,le.Color,le.FontFamily,Kt.HardBreak,_e.Placeholder.configure({showOnlyCurrent:!1,placeholder:({pos:t})=>t===0?e:""})],Na=({isTitleVisible:e,isSubtitleVisible:t})=>e&&t?Ze.Document.extend({content:"block{2,}"}):Ze.Document,A=(e,t)=>`color-mix(in srgb, transparent, ${e} ${t*100}%)`,De=(e,t)=>`hsl(from ${e} h s calc(l * ${1-t}))`,Jn=(e,t)=>`hsl(from ${e} h s calc(l * ${1+t}))`,et=(e,t,n)=>`color-mix(in srgb, ${e}, ${t} ${n*100}%)`,Ha=e=>/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e),Ba=e=>e.length===0?!1:typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("color",e):/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),Qn={elevationXs:"0 0 2px rgba(15, 15, 24, 0.12), 0 2px 2px rgba(14, 14, 52, 0.08)",elevationSm:"0 0 4px rgba(15, 15, 24, 0.12), 0 4px 4px rgba(14, 14, 52, 0.08)",elevationMd:"0 0 8px rgba(15, 15, 24, 0.12), 0 8px 8px rgba(14, 14, 52, 0.08)",elevationLg:"0 0 16px rgba(15, 15, 24, 0.12), 0 16px 16px rgba(14, 14, 52, 0.08)"},er={radiiXs:"4px",radiiSm:"6px",radiiMd:"8px",radiiLg:"12px"},tr={zIndexToolbar:"10",zIndexToolbarTooltip:"20",zIndexToolbarPopover:"30"},Ra=8,ae=e=>`${Ra*e}px`,nr={spaceXxs:ae(.25),spaceXs:ae(.5),spaceSm:ae(.75),spaceMd:ae(1),spaceLg:ae(1.5),spaceXl:ae(2)},Ia={transparent:"transparent",white:"#FFFFFF",black:"#000000",grey100:"#000000",grey95:"#0D0D0D",grey90:"#1A1A1A",grey85:"#1F1F1F",grey80:"#2A2A2A",grey75:"#2e2e2e",grey70:"#353535",grey60:"#494949",grey50:"#6F6F6F",grey0:"#FFFFFF",red60:"#CB3333",red50:"#F93939",amber70:"#F48135",amber50:"#FEAE47",amber40:"#FFC849",amber30:"#ffd061",green60:"#0AC600",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",greyGradient80:"linear-gradient(to top, #222429, #31353f)"},Oa={textPrimary:l.grey0,textSecondary:A(l.textPrimary,.8),textDisabled:A(l.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:A(l.textPrimary,.6),iconStickerBackground:l.grey70,border100:l.grey0,border50:A(l.grey0,.5),border10:A(l.grey0,.1),brand:l.purple50,success:l.green50,warning:l.amber50,alert:l.red50,sunkenBackground:l.grey100,defaultBackground:l.grey90,raisedBackground:l.grey80,overlayBackground:l.grey90,overlayBorderGradient:l.greyGradient80},Da={graphBackground:l.grey90,gridLineColor:l.border10,originLineColor:l.grey0,targetLineColor:l.border100,targetLineMarkerColor:l.border100,targetLineLabelTextColor:l.grey100,legendBackground:l.defaultBackground,legendBorderColor:l.border10,legendFocusOutlineColor:l.border50,legendTextColor:l.textPrimary,dimmedSeriesLabelTextColor:l.textDisabled,dimmedSeriesLabelLineColor:l.grey60,trendNegativeColor:l.red60,trendPositiveColor:l.green60,trendNeutralColor:l.textSecondary,toolbarBackgroundColor:l.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:l.grey80,toolbarButtonBackgroundColorSelected:l.grey60,toolbarSeparatorColor:l.grey60,tooltipBackground:l.grey70,tooltipBorderColor:l.grey60,tooltipHeadingTextColor:l.textPrimary,tooltipLabelTextColor:l.textSecondary,tooltipValueTextColor:l.textPrimary,tooltipPrimaryRowColor:l.grey60,hoverGuideLineColor:A(l.white,.08),hoverGuideFillColor:A(l.white,.06),hoveredBarBorderColor:l.white,hoveredPointRingColor:l.white,pointStrokeColor:l.white,stackedBarHoverBorderColor:l.grey0,heatmapEmptyTileBackground:l.grey80,dataLabelOutsideBackground:A(l.textPrimary,.1),defaultAnnotationArrowStroke:l.white,defaultAnnotationShapeStroke:l.white,defaultAnnotationShapeFill:l.canvasBlue,arrowAnnotationStickerOutlineColor:"#FFFFFF",arrowAnnotationStickerOutlineColorInverse:"#1D2129",annotationFrameBorderColor:l.blue60,annotationMenuTriggerIconColor:l.white},za={canvasDefault:"#FFFFFF",canvasBlue:"#60a5fa",canvasCyan:"#22d3ee",canvasGreen:"#34d399",canvasYellow:"#FFC800",canvasOrange:"#fb923c",canvasRed:"#f87171",canvasPink:"#F979D9",canvasPurple:"#a78bfa",canvasGray:"#a8a29e",canvasInverse:"#000000"},Ga={...Ia,...Oa,...Qn,...er,...nr,...tr,...Da,...za,...Sn,...jn,...Ln},Wa={transparent:"transparent",white:"#FFFFFF",black:"#000000",grey100:"#FFFFFF",grey95:"#FCFCFC",grey90:"#FAFAFA",grey85:"#F5F5F5",grey80:"#F0F0F0",grey75:"#E8E8E8",grey70:"#E5E5E5",grey60:"#CCCCCC",grey50:"#C4C4C4",grey0:"#1D2129",red60:"#E14B49",red50:"#F93939",amber70:"#FFBA8C",amber50:"#FFC849",amber40:"#FEAE47",amber30:"#E7A816",green60:"#06B299",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",greyGradient80:"linear-gradient(to top, #F0F0F1, #F9F9FF)"},$a={textPrimary:l.black,textSecondary:A(l.textPrimary,.6),textDisabled:A(l.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:A(l.textPrimary,.6),iconStickerBackground:l.grey100,brand:l.purple50,success:l.green50,warning:l.amber50,alert:l.red50,border100:l.grey0,border50:A(l.grey0,.5),border10:A(l.grey0,.1),sunkenBackground:l.grey90,defaultBackground:l.grey100,raisedBackground:l.grey85,overlayBackground:l.grey100,overlayBorderGradient:l.border10},Xa={graphBackground:l.grey100,gridLineColor:l.border10,originLineColor:l.grey0,targetLineColor:l.border100,targetLineMarkerColor:"#A0A6C5",targetLineLabelTextColor:l.grey100,legendBackground:l.defaultBackground,legendBorderColor:l.border10,legendFocusOutlineColor:l.border50,legendTextColor:l.textPrimary,dimmedSeriesLabelTextColor:l.textDisabled,dimmedSeriesLabelLineColor:l.grey60,trendNegativeColor:l.red60,trendPositiveColor:l.green60,trendNeutralColor:l.textSecondary,toolbarBackgroundColor:l.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:l.grey80,toolbarButtonBackgroundColorSelected:l.grey60,toolbarSeparatorColor:l.grey60,tooltipBackground:l.white,tooltipBorderColor:l.border10,tooltipHeadingTextColor:l.textPrimary,tooltipLabelTextColor:l.textSecondary,tooltipValueTextColor:l.textPrimary,tooltipPrimaryRowColor:l.grey80,hoverGuideLineColor:A(l.black,.08),hoverGuideFillColor:A(l.black,.04),hoveredBarBorderColor:l.white,hoveredPointRingColor:l.white,pointStrokeColor:l.white,stackedBarHoverBorderColor:l.grey0,heatmapEmptyTileBackground:l.grey80,dataLabelOutsideBackground:A(l.textPrimary,.1),defaultAnnotationArrowStroke:l.black,defaultAnnotationShapeStroke:l.black,defaultAnnotationShapeFill:l.canvasBlue,arrowAnnotationStickerOutlineColor:"#1D2129",arrowAnnotationStickerOutlineColorInverse:"#FFFFFF",annotationFrameBorderColor:l.blue60,annotationMenuTriggerIconColor:"#3d414c"},qa={canvasDefault:"#000000",canvasBlue:"#3b82f6",canvasCyan:"#06b6d4",canvasGreen:"#10b981",canvasYellow:"#E5B400",canvasOrange:"#f97316",canvasRed:"#ef4444",canvasPink:"#E845BF",canvasPurple:"#8b5cf6",canvasGray:"#78716c",canvasInverse:"#ffffff"},Ya={...Wa,...$a,...Qn,...er,...nr,...tr,...Xa,...qa,...Sn,...jn,...Ln},Fe=.1,Va={light:.05,dark:.1},Ua=(e,t)=>{switch(e.type){case"none":return null;case"solid":return e.color;case"tinted":return Ja(e.color,t);case"gradient":return Qa(e.color,t);case"preset":return f.BORDER_PRESET_GRADIENTS[e.preset]}},Ka=e=>e.type==="none"?0:e.width,Za=(e,t,n)=>{if(e.type==="solid")return e.color;if(e.type==="tinted")return et(n,e.color,Va[t])},Ja=(e,t)=>t==="dark"?De(e,Fe):Jn(e,Fe),Qa=(e,t,n=90)=>{const o=e,s=t==="dark"?De(e,Fe):Jn(e,Fe);return`linear-gradient(${n}deg, ${o} 0%, ${s} 100%)`};var ei="bow4tg0",ti="bow4tg1",ni="bow4tg2",ri="bow4tg3",rr="_1ii3bsb0",or="_1ii3bsb1";const dt=g.createContext(null),ht=()=>{const e=g.useContext(dt);if(!e)throw new Error("useThemeContext must be used inside a <ThemeProvider>.");return e},sr=({theme:e,themeOverrides:t={},appearance:n,children:o})=>{const s=g.useMemo(()=>({...e==="dark"?Ga:Ya,...t}),[e,t]),a=g.useMemo(()=>{const i={[l.textScale]:String(n.textScale)};for(const[d,h]of Object.entries(t))i[l[d]]=h;const u=Za(n.background,e,s.graphBackground);return u!==void 0&&(i[l.graphBackground]=u),zr.assignInlineVars(i)},[n.textScale,n.background,e,s.graphBackground,t]),c=g.useMemo(()=>({theme:e,themeClass:e==="dark"?or:rr,inlineVarsStyle:a,themeValues:s}),[e,a,s]);return r.jsx(dt.Provider,{value:c,children:o})},oe=({children:e,className:t,style:n})=>{const o=g.useContext(dt),s=o?N(o.themeClass,ti):void 0,a=o?{...o.inlineVarsStyle,...n}:n;return r.jsx("div",{className:N(s,t),style:a,children:e})},oi="graphy_root",se=()=>typeof document>"u"?null:document.getElementById(oi)??document.body;var si="yp3g0k0",ai="yp3g0k1",ar="yp3g0k3",ii="yp3g0k4",ir="yp3g0k5",tt="yp3g0k6",li="yp3g0k7",ci="yp3g0k8",lr="yp3g0k9",ui="yp3g0ka",di="yp3g0kb",hi="yp3g0kc",gi="yp3g0kd",fi="yp3g0ke";const pi=on.map(e=>l[e]),mi=Object.fromEntries(on.map(e=>[l[e],e])),xi=({editor:e,currentColor:t,isOpen:n,onOpenChange:o})=>{const s=yi(),a=g.useCallback(i=>{e.chain().setColor(i).run()},[e]),c=i=>{e.chain().focus().setColor(i).run(),o(!1)};return r.jsxs(M.Popover.Root,{open:n,onOpenChange:o,children:[r.jsx(M.Popover.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Text color",className:si,onMouseDown:i=>i.preventDefault(),children:r.jsx("span",{className:ai,style:{background:t??"transparent"}})}),r.jsx(M.Popover.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(M.Popover.Positioner,{sideOffset:6,align:"start",className:ar,children:r.jsxs(M.Popover.Popup,{className:ii,onMouseDown:i=>i.preventDefault(),children:[r.jsx(Et,{title:"Colors",colors:pi,currentColor:t,onPick:c}),s.length>0&&r.jsx(Et,{title:"Chart colors",colors:s,currentColor:t,onPick:c}),r.jsx(vi,{value:t??"#000000",onChange:a})]})})})})]})},Et=({title:e,colors:t,currentColor:n,onPick:o})=>r.jsxs("div",{className:ir,children:[r.jsx("div",{className:tt,children:e}),r.jsx("div",{className:li,children:t.map(s=>r.jsx("button",{type:"button","aria-label":s,className:ci,"data-active":Si(s,n),onMouseDown:a=>a.preventDefault(),onClick:()=>o(s),children:r.jsx("span",{className:lr,style:cr(s)})},s))})]}),vi=({value:e,onChange:t})=>{const[n,o]=g.useState(!1),s=Ba(e)?e:"#000000",a=bi(s);return r.jsxs(M.Popover.Root,{open:n,onOpenChange:o,children:[r.jsxs("div",{className:ir,children:[r.jsx("div",{className:tt,children:"Custom"}),r.jsxs(M.Popover.Trigger,{className:ui,onMouseDown:c=>c.preventDefault(),"aria-label":"Pick custom color",children:[r.jsx("span",{className:lr,style:cr(s)}),r.jsx("span",{className:di,children:a})]})]}),r.jsx(M.Popover.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(M.Popover.Positioner,{side:"right",align:"start",sideOffset:18,className:ar,children:r.jsxs(M.Popover.Popup,{className:hi,onMouseDown:c=>c.preventDefault(),children:[r.jsx("div",{className:tt,children:"Pick color"}),r.jsx(ft.HexColorPicker,{color:a,onChange:t,className:gi}),r.jsx(ft.HexColorInput,{color:a,onChange:t,prefixed:!0,className:fi,onMouseDown:c=>c.stopPropagation()})]})})})})]})},yi=()=>{const e=T(t=>t.scales.color);return g.useMemo(()=>{if(!e||e.kind!=="visual")return[];const t=new Set;for(const n of e.domain){const o=e.map(n);typeof o=="string"&&t.add(o)}return[...t]},[e])},cr=e=>({background:e,border:`1px solid ${De(e,.1)}`}),bi=e=>{const{themeValues:t}=ht();if(Ha(e))return e.toUpperCase();const n=mi[e];return n?t[n].toUpperCase():"#000000"},Si=(e,t)=>t===null?!1:e.toLowerCase()===t.toLowerCase(),ji={xxs:8,xs:12,sm:16,md:20,lg:24,xl:36};var Li={primary:"asohov1 asohov0",secondary:"asohov2 asohov0"};const V=({children:e,title:t,variant:n="primary",size:o="sm",...s})=>{const a=g.useId(),c=ji[o];return r.jsxs("svg",{className:Li[n],"aria-labelledby":t?a:void 0,height:c,width:c,fill:"none",viewBox:"0 0 24 24",role:"img",...s,children:[t&&r.jsx("title",{id:a,children:t}),e]})},ur=e=>r.jsx(V,{...e,children:r.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})}),Ci="'Noto Serif', Georgia, 'Times New Roman', serif, 'Apple Color Emoji', 'NotoColorEmoji'",dr=`'Aeonik', 'Aeonik Fallback', ${O}`,ki="'PT Mono', 'Courier New', monospace, 'Apple Color Emoji', 'NotoColorEmoji'",Ti="'Intruding Cat', cursive, 'Apple Color Emoji', 'NotoColorEmoji'",wi=`var(--brand-font-family), ${dr}`,nt=[{id:"modern",label:"Modern",preview:"Aa",fontFamily:O},{id:"fresh",label:"Fresh",preview:"Aa",fontFamily:dr},{id:"timeless",label:"Timeless",preview:"Aa",fontFamily:Ci},{id:"technical",label:"Technical",preview:"00",fontFamily:ki},{id:"fineliner",label:"Fineliner",preview:"Aa",fontFamily:Ti},{id:"brand",label:"Brand",preview:"Aa",fontFamily:wi}],Ai=e=>e?nt.find(t=>t.fontFamily===e)??null:null;var hr="_1qkyw7q0",gr="_1qkyw7q1",fr="_1qkyw7q3",pr="_1qkyw7q4",mr="_1qkyw7q5";const Ei=({editor:e,currentFontFamily:t,isOpen:n,onOpenChange:o})=>{const s=Ai(t)??nt[0],a=c=>{e.chain().focus().setFontFamily(c.fontFamily).run()};return r.jsxs(B.Menu.Root,{open:n,onOpenChange:o,children:[r.jsxs(B.Menu.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Font family",className:hr,onMouseDown:c=>c.preventDefault(),children:[r.jsx("span",{className:gr,style:{fontFamily:s?.fontFamily},children:s?.preview}),r.jsx(ur,{size:"sm"})]}),r.jsx(B.Menu.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(B.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:fr,children:r.jsx(B.Menu.Popup,{className:pr,onMouseDown:c=>c.preventDefault(),children:nt.map(c=>r.jsx(B.Menu.Item,{className:mr,"data-selected":c.id===s?.id,onClick:()=>a(c),children:r.jsx("span",{style:{fontFamily:c.fontFamily},children:c.label})},c.id))})})})})]})},xr={id:"text",label:"Text",previewFont:l.fontTextEditorBody},_t=[{id:"caption",label:"Caption",previewFont:l.fontTextEditorH6},xr,{id:"h3",label:"Heading 3",previewFont:l.fontTextEditorH3},{id:"h2",label:"Heading 2",previewFont:l.fontTextEditorH2},{id:"h1",label:"Heading 1",previewFont:l.fontTextEditorH1}],_i=({editor:e,activeStyle:t,isOpen:n,onOpenChange:o})=>{const s=_t.find(a=>a.id===t)??xr;return r.jsxs(B.Menu.Root,{open:n,onOpenChange:o,children:[r.jsxs(B.Menu.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Text style",className:hr,onMouseDown:a=>a.preventDefault(),children:[r.jsx("span",{className:gr,children:s.label}),r.jsx(ur,{size:"sm"})]}),r.jsx(B.Menu.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(B.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:fr,children:r.jsx(B.Menu.Popup,{className:pr,onMouseDown:a=>a.preventDefault(),children:_t.map(a=>r.jsx(B.Menu.Item,{className:mr,"data-selected":a.id===s.id,onClick:()=>Mi(e,a.id),children:r.jsx(Pi,{font:a.previewFont,children:a.label})},a.id))})})})})]})},Mi=(e,t)=>{switch(t){case"caption":{e.chain().focus().setNode("paragraph",{variant:"caption"}).run();return}case"text":{e.chain().focus().setNode("paragraph",{variant:null}).run();return}case"h1":e.chain().focus().setHeading({level:1}).run();return;case"h2":e.chain().focus().setHeading({level:2}).run();return;case"h3":e.chain().focus().setHeading({level:3}).run()}},Pi=({font:e,children:t})=>r.jsx("span",{style:{font:e,margin:0},children:t}),Fi=e=>r.jsx(V,{...e,children:r.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M20 6 9 17l-5-5"})})}),Ni=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),r.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),Hi=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]})}),Bi=e=>!e.content||e.content.length===0?!0:e.content.every(t=>!t.content||t.content.length===0),Ri=e=>{const{$from:t}=e.state.selection,n=t.parent.textContent,o=t.parentOffset,s=t.start();let a=o;for(;a>0&&Mt(n[a-1]);)a-=1;let c=o;for(;c<n.length&&Mt(n[c]);)c+=1;return{from:s+a,to:s+c}},Mt=e=>e!==void 0&&/\S/.test(e);var Ii="b5kquu0",Oi="b5kquu1",Di="b5kquu2",zi="b5kquu3",Pt="b5kquu4";const Gi=({editor:e,currentUrl:t,isActive:n,isOpen:o,onOpenChange:s})=>{const[a,c]=g.useState(""),i=g.useRef(null);g.useEffect(()=>{o&&c(t??"")},[o,t]);const u=()=>{Wi(e,a),s(!1)},d=()=>{c(""),s(!1)},h=p=>{c(p.target.value)},m=p=>{p.key==="Enter"&&(p.preventDefault(),u())};return r.jsxs(M.Popover.Root,{open:o,onOpenChange:s,children:[r.jsx(M.Popover.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Link","data-active":n,className:Ii,onMouseDown:p=>p.preventDefault(),children:r.jsx(Ni,{})}),r.jsx(M.Popover.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(M.Popover.Positioner,{sideOffset:6,align:"end",className:Oi,children:r.jsxs(M.Popover.Popup,{className:Di,initialFocus:i,onMouseDown:p=>p.preventDefault(),children:[r.jsx("input",{ref:i,type:"url",value:a,placeholder:"Type or paste a link...","aria-label":"Link URL",className:zi,onMouseDown:p=>p.stopPropagation(),onChange:h,onKeyDown:m}),r.jsx("button",{type:"button","aria-label":"Cancel",className:Pt,onClick:d,children:r.jsx(Hi,{})}),r.jsx("button",{type:"button","aria-label":"Apply link",className:Pt,onClick:u,children:r.jsx(Fi,{})})]})})})})]})},Wi=(e,t)=>{const n=t.trim(),{selection:o}=e.state;if(!n){e.chain().focus().extendMarkRange("link").unsetLink().run();return}if(!o.empty){e.chain().focus().setLink({href:n}).run();return}if(e.isActive("link")){e.chain().focus().extendMarkRange("link").setLink({href:n}).run();return}const s=Ri(e);e.chain().focus().setTextSelection(s).setLink({href:n}).run()},$i=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 5H3"}),r.jsx("path",{d:"M17 12H7"}),r.jsx("path",{d:"M19 19H5"})]})}),Xi=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 5H3"}),r.jsx("path",{d:"M21 12H9"}),r.jsx("path",{d:"M21 19H7"})]})}),qi=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 5H3"}),r.jsx("path",{d:"M15 12H3"}),r.jsx("path",{d:"M17 19H3"})]})});var Yi="k91gos0",Vi="k91gos1";const Ui=6,ce=({label:e,isActive:t,onToggle:n,children:o})=>{const s=a=>a.preventDefault();return r.jsxs(ie.Tooltip.Root,{children:[r.jsx(ie.Tooltip.Trigger,{render:r.jsx(Gr.Toggle,{render:r.jsx(_.Toolbar.Button,{}),pressed:t,onPressedChange:()=>n()}),"aria-label":e,className:Yi,onMouseDown:s,children:o}),r.jsx(ie.Tooltip.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(ie.Tooltip.Positioner,{sideOffset:Ui,children:r.jsx(ie.Tooltip.Popup,{className:Vi,children:e})})})})]})},Ki=({editor:e,activeAlignment:t="left"})=>r.jsxs(r.Fragment,{children:[r.jsx(ce,{label:"Align left",isActive:t==="left",onToggle:()=>e.chain().focus().setTextAlign("left").run(),children:r.jsx(qi,{})}),r.jsx(ce,{label:"Align center",isActive:t==="center",onToggle:()=>e.chain().focus().setTextAlign("center").run(),children:r.jsx($i,{})}),r.jsx(ce,{label:"Align right",isActive:t==="right",onToggle:()=>e.chain().focus().setTextAlign("right").run(),children:r.jsx(Xi,{})})]});var Zi="_1bp10ig0",pe="_1bp10ig1",Ee="_1bp10ig2";const Ji=({editor:e})=>({isBold:e?.isActive("bold")??!1,isItalic:e?.isActive("italic")??!1,isUnderline:e?.isActive("underline")??!1,isLink:e?.isActive("link")??!1,linkUrl:e?.getAttributes("link").href??null,color:e?.getAttributes("textStyle").color??null,fontFamily:e?.getAttributes("textStyle").fontFamily??null,fontSize:Qi(e),textAlign:el(e)}),Qi=e=>e?e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":e.isActive("paragraph",{variant:"caption"})?"caption":"text":"text",el=e=>e?e.isActive({textAlign:"center"})?"center":e.isActive({textAlign:"right"})?"right":"left":"left",tl=8,nl=8,rl=({editor:e})=>{const[t,n]=g.useState(!1),[o,s]=g.useState(null),a=o!==null,c=x=>v=>{s(v?x:null)},{refs:i,floatingStyles:u}=F.useFloating({placement:"top-start",strategy:"fixed",middleware:[F.offset(tl),F.flip(),F.shift({padding:nl})],whileElementsMounted:F.autoUpdate}),d=g.useRef(null),h=st.useEditorState({editor:e,selector:Ji}),m=g.useCallback(x=>{d.current=x,i.setFloating(x)},[i]);if(g.useEffect(()=>{e&&i.setReference(e.view.dom)},[e,i]),g.useEffect(()=>{if(!e)return;const x=()=>n(!0),v=({event:y})=>{const{relatedTarget:S,currentTarget:L}=y,C=S instanceof Node&&d.current?.contains(S),w=S instanceof Node&&L instanceof Node&&L.contains(S);!C&&!w&&n(!1)};return e.on("focus",x),e.on("blur",v),()=>{e.off("focus",x),e.off("blur",v)}},[e]),!e||!t&&!a)return null;const p=se();return p?rn.createPortal(r.jsx(oe,{children:r.jsx(ie.Tooltip.Provider,{children:r.jsxs(_.Toolbar.Root,{ref:m,className:Zi,style:u,children:[r.jsxs(_.Toolbar.Group,{className:pe,children:[r.jsx(xi,{editor:e,currentColor:h?.color??null,isOpen:o==="color",onOpenChange:c("color")}),r.jsx(Ei,{editor:e,currentFontFamily:h?.fontFamily??null,isOpen:o==="fontFamily",onOpenChange:c("fontFamily")})]}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsx(_.Toolbar.Group,{className:pe,children:r.jsx(_i,{editor:e,activeStyle:h?.fontSize??"text",isOpen:o==="fontSize",onOpenChange:c("fontSize")})}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsxs(_.Toolbar.Group,{className:pe,children:[r.jsx(ce,{label:"Bold",isActive:h?.isBold??!1,onToggle:()=>e.chain().focus().toggleBold().run(),children:r.jsx("strong",{children:"B"})}),r.jsx(ce,{label:"Italic",isActive:h?.isItalic??!1,onToggle:()=>e.chain().focus().toggleItalic().run(),children:r.jsx("em",{children:"I"})}),r.jsx(ce,{label:"Underline",isActive:h?.isUnderline??!1,onToggle:()=>e.chain().focus().toggleUnderline().run(),children:r.jsx("u",{children:"U"})})]}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsx(_.Toolbar.Group,{className:pe,children:r.jsx(Ki,{editor:e,activeAlignment:h?.textAlign})}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsx(_.Toolbar.Group,{className:pe,children:r.jsx(Gi,{editor:e,currentUrl:h?.linkUrl??null,isActive:h?.isLink??!1,isOpen:o==="link",onOpenChange:c("link")})})]})})}),p):null};var ol="_2ngohc0";const vr=({editor:e,ariaLabel:t})=>r.jsxs("div",{className:ol,children:[r.jsx(rl,{editor:e}),r.jsx(st.EditorContent,{editor:e,"aria-label":t})]}),sl=(e,t)=>{const n=g.useRef(e);n.current=e;const o=g.useRef(t);o.current=t;const s=g.useRef(null),a=g.useRef(null),c=g.useMemo(()=>{const i=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null),s.current=null},u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null);const h=s.current;h!==null&&(s.current=null,n.current(...h))};return{run:(...h)=>{if(o.current<=0){n.current(...h);return}s.current=h,a.current!==null&&clearTimeout(a.current),a.current=setTimeout(u,o.current)},flush:u,cancel:i}},[]);return g.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]),c},al=200,yr=({content:e,extensions:t,isEditable:n,onUpdate:o,updateDebounceMs:s=al})=>{const a=g.useRef(Ft(e)),c=g.useRef(!1),i=sl(d=>{c.current=!0,o?.(d)},s),u=st.useEditor({extensions:t,content:a.current,editable:n,immediatelyRender:!1,onUpdate:({editor:d})=>i.run(d.getJSON())});return g.useEffect(()=>{u?.setEditable(n)},[u,n]),g.useEffect(()=>{if(!u)return;if(c.current){c.current=!1;return}const d=Ft(e),h=u.getJSON();il(h,d)||(i.cancel(),u.commands.setContent(d,{emitUpdate:!1}))},[u,e,i]),g.useEffect(()=>()=>i.flush(),[i]),u},Ft=e=>e===null?{type:"doc",content:[]}:typeof e=="string"?{type:"doc",content:[{type:"paragraph",content:e?[{type:"text",text:e}]:[]}]}:e,il=(e,t)=>JSON.stringify(e)===JSON.stringify(t),ll=/^(?:https?:|mailto:)/i,br=e=>{if(typeof e!="string")return!1;const t=e.replace(/^[\x00-\x20]+/,"");return t.length===0?!1:ll.test(t)};var cl="_1cocly40";const ul={modern:"'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif",timeless:"'Noto Serif', Georgia, 'Times New Roman', serif",fresh:"'Aeonik', 'Aeonik Fallback', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif",technical:"'PT Mono', 'Courier New', monospace",handwritten:"'Permanent Marker', cursive",fineliner:"'Intruding Cat', cursive",brand:"var(--brand-font-family), 'Aeonik', 'Inter', sans-serif"},Ne=({content:e})=>r.jsx(r.Fragment,{children:Sr(e.content??[e])}),Sr=e=>e.map((t,n)=>dl(t,n)),dl=(e,t)=>{if(e.type==="text")return hl(e,t);if(e.type==="hardBreak"||e.type==="hard_break")return r.jsx("br",{},t);const n=e.content?Sr(e.content):null;switch(e.type){case"doc":return r.jsx(g.Fragment,{children:n},t);case"heading":{const o=ml(e.attrs?.level);return xl(o,t,n,Ht(e.attrs))}case"paragraph":{const o=ue(e.attrs?.variant);return r.jsx("p",{"data-variant":o??void 0,style:jr(Ht(e.attrs)),children:n},t)}case"blockquote":return r.jsx("blockquote",{children:n},t);case"bulletList":case"bullet_list":return r.jsx("ul",{children:n},t);case"orderedList":case"ordered_list":return r.jsx("ol",{children:n},t);case"listItem":case"list_item":return r.jsx("li",{children:n},t);default:return r.jsx("span",{children:n},t)}},hl=(e,t)=>{const n=e.text??"";return!e.marks||e.marks.length===0?r.jsx("span",{children:n},t):e.marks.reduceRight((o,s,a)=>gl(s,o,`${t}-${a}`),n)},gl=(e,t,n)=>{switch(e.type){case"bold":case"strong":return r.jsx("strong",{children:t},n);case"italic":case"em":return r.jsx("em",{children:t},n);case"underline":return r.jsx("u",{children:t},n);case"strike":case"strikethrough":case"s":return r.jsx("s",{children:t},n);case"code":return r.jsx("code",{children:t},n);case"link":{const o=ue(e.attrs?.href);return br(o)?r.jsx("a",{className:cl,href:o,rel:"noopener noreferrer",target:"_blank",children:t},n):r.jsx("span",{children:t},n)}case"textStyle":{const o=fl(e.attrs);return o?r.jsx("span",{style:o,children:t},n):r.jsx("span",{children:t},n)}default:return r.jsx("span",{children:t},n)}},Nt=e=>{const t=ue(e&&typeof e=="object"?e.fontFamily:e);if(t)return ul[t]??t},fl=e=>{if(!e)return null;const t={},n=ue(e.color);n&&(t.color=n);const o=Nt(e.font)??Nt(e.fontFamily);o&&(t.fontFamily=o);const s=pl(e.fontSize);return s&&(t.fontSize=s),Object.keys(t).length>0?t:null},pl=e=>typeof e=="number"&&Number.isFinite(e)?`${e/10}em`:ue(e),ue=e=>typeof e=="string"&&e.length>0?e:void 0,ml=e=>typeof e!="number"?3:e<1?1:e>3?3:Math.round(e),xl=(e,t,n,o)=>{const s=jr(o);switch(e){case 1:return r.jsx("h1",{style:s,children:n},t);case 2:return r.jsx("h2",{style:s,children:n},t);case 3:return r.jsx("h3",{style:s,children:n},t)}},Ht=e=>{const t=e?.textAlign;if(t==="left"||t==="right"||t==="center"||t==="justify")return t},jr=e=>e?{textAlign:e}:void 0;var vl="_4dlrid0",Lr="_4dlrid1",yl="xfz7dq0",bl="xfz7dq1",Sl="xfz7dq2",jl="xfz7dq3",Ll="xfz7dq4";const Cl=({ref:e,footerRect:t,mode:n="readonly"})=>{const{caption:o,isCaptionVisible:s,source:a,isSourceVisible:c}=T(H.useShallow(h=>({caption:h.config.content.caption,isCaptionVisible:h.config.content.isCaptionVisible,source:h.config.content.source,isSourceVisible:h.config.content.isSourceVisible}))),i=n==="editable",u=s&&(i||o!==null),d=c&&a!==null&&Al(a);return!u&&!d?null:r.jsxs("div",{ref:e,className:yl,style:{left:t.x,top:t.y,width:t.width},children:[u?i?r.jsx(El,{caption:o}):r.jsx(kl,{caption:o}):null,d&&r.jsx(Tl,{source:a})]})},kl=({caption:e})=>e===null?null:typeof e=="string"?r.jsx("p",{className:Lr,children:e}):r.jsx(Ne,{content:e}),Tl=({source:e})=>{const t=br(e.url)?e.url:void 0,n=e.label??(t!==void 0?wl(t):"");return n===""&&t===void 0?null:r.jsxs("div",{className:bl,children:[r.jsx("span",{className:jl,children:"Source:"}),t!==void 0?r.jsx("a",{className:Sl,href:t,target:"_blank",rel:"noopener noreferrer",children:n}):r.jsx("span",{className:Ll,children:n})]})},wl=e=>{try{return new URL(e).hostname}catch{return e}},Al=e=>e.label!==void 0&&e.label!==""||e.url!==void 0&&e.url!=="",El=({caption:e})=>{const t=it(),n=g.useMemo(()=>Fa({placeholder:"Add caption"}),[]),o=yr({content:e,extensions:n,isEditable:!0,onUpdate:s=>{const a=Bi(s)?null:s;t(new f.SetContentCaptionCommand({caption:a}))}});return r.jsx(vr,{editor:o,ariaLabel:"Chart caption"})};var _l="_1k4qtbg0";const Ml=3,Pl=({title:e,isTitleVisible:t,subtitle:n,isSubtitleVisible:o})=>{const s=[];return t&&s.push({type:"heading",attrs:{level:Ml},content:Nl(e)}),o&&s.push(...Hl(n)),{type:"doc",content:s}},Fl=e=>{const t=e.content??[],[n,...o]=t;return{title:Bl(n?.content??[]),subtitle:Rl(o)}},gt=e=>({type:e.type??"text",...e.content!==void 0?{content:e.content.map(gt)}:{},...e.text!==void 0?{text:e.text}:{},...e.marks!==void 0?{marks:e.marks}:{},...e.attrs!==void 0?{attrs:e.attrs}:{}}),Nl=e=>e===null?[]:typeof e=="string"?e===""?[]:[{type:"text",text:e}]:e.type==="doc"&&e.content?e.content.flatMap(t=>t.content??[]):e.type==="text"||e.type==="hardBreak"?[e]:e.content??[],Hl=e=>e===null?[{type:"paragraph"}]:typeof e=="string"?e===""?[{type:"paragraph"}]:[{type:"paragraph",content:[{type:"text",text:e}]}]:e.type==="doc"&&e.content?e.content.length===0?[{type:"paragraph"}]:e.content.map(Bt):[Bt(e)],Bt=e=>e.type==="paragraph"?e:{type:"paragraph",content:e.content??[e]},Bl=e=>{if(e.length===0)return null;const[t]=e;return t&&e.length===1&&t.type==="text"&&(!t.marks||t.marks.length===0)?t.text??null:{type:"paragraph",content:e.map(gt)}},Rl=e=>{const t=e.filter(o=>(o.content??[]).length>0);if(t.length===0)return null;const[n]=t;if(n&&t.length===1&&n.type==="paragraph"){const o=n.content??[],[s]=o;if(s&&o.length===1&&s.type==="text"&&(!s.marks||s.marks.length===0))return s.text??null}return{type:"doc",content:t.map(gt)}},Il=({ref:e,headerRect:t,mode:n="readonly"})=>{const{title:o,isTitleVisible:s,subtitle:a,isSubtitleVisible:c}=T(H.useShallow(h=>({isTitleVisible:h.config.content.isTitleVisible,isSubtitleVisible:h.config.content.isSubtitleVisible,title:h.config.content.title,subtitle:h.config.content.subtitle}))),i=n==="editable";return!(s&&(i||o!==null))&&!(c&&(i||a!==null))?null:r.jsx("div",{ref:e,className:_l,style:{left:t.x,top:t.y,width:t.width},children:i?r.jsx(Dl,{title:o,isTitleVisible:s,isSubtitleVisible:c,subtitle:a},[s?"title":"",c?"subtitle":""].join("-")):r.jsx(Ol,{title:o,isTitleVisible:s,isSubtitleVisible:c,subtitle:a})})},Ol=({title:e,isTitleVisible:t,isSubtitleVisible:n,subtitle:o})=>{const s=t&&e!==null,a=n&&o!==null;return r.jsxs(r.Fragment,{children:[s&&(typeof e=="string"?r.jsx("h1",{className:vl,children:e}):r.jsx(Ne,{content:e})),a&&(typeof o=="string"?r.jsx("p",{className:Lr,children:o}):r.jsx(Ne,{content:o}))]})},Dl=({title:e,isTitleVisible:t,isSubtitleVisible:n,subtitle:o})=>{const s=it(),a=g.useMemo(()=>Pa({titlePlaceholder:"Untitled",subtitlePlaceholder:"Untitled",isTitleVisible:t,isSubtitleVisible:n}),[t,n]),c=g.useMemo(()=>Pl({title:e,isTitleVisible:t,subtitle:o,isSubtitleVisible:n}),[e,t,o,n]),i=yr({content:c,extensions:a,isEditable:!0,onUpdate:u=>{const d=Fl(u);t&&s(new f.SetContentTitleCommand({title:d.title})),n&&s(new f.SetContentSubtitleCommand({subtitle:d.subtitle}))}});return r.jsx(vr,{editor:i,ariaLabel:"Chart title and subtitle"})};var zl="_1u9qprb0",Gl="_1u9qprb1",Wl="_9aen060",$l="_9aen061",Xl="_9aen062",Cr="_9aen063";const ql=Object.freeze(Object.defineProperty({__proto__:null,groupRow:Xl,item:Cr,trendRow:$l,valueRow:Wl},Symbol.toStringTag,{value:"Module"})),Yl=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"m5 12 7-7 7 7"}),r.jsx("path",{d:"M12 19V5"})]})}),Vl=e=>r.jsx(V,{...e,children:r.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M5 12h14"})})});var kr="n7clvo0",Ul="n7clvo1",Kl="n7clvo2",Zl="n7clvo3",Tr={small:"n7clvo4",medium:"n7clvo5",large:"n7clvo6"},Jl={small:"n7clvo7",medium:"n7clvo8",large:"n7clvo9"},Ql={up:"n7clvoa",down:"n7clvob",flat:"n7clvoc"},ec={up:"n7clvoe n7clvod",down:"n7clvof n7clvod",flat:"n7clvog n7clvod"};const tc=({segment:e,resolvedSize:t})=>{if(e.kind==="swatch")return r.jsx(ye,{shape:e.swatch.shape,color:e.swatch.color,width:e.size,height:e.size});if(e.kind==="trendArrow")return r.jsx("div",{className:ec[e.direction],children:e.direction==="flat"?r.jsx(Vl,{size:"xs",title:""}):r.jsx(Yl,{size:"xs",title:""})});const n=e.fontRole==="value"?Tr[t]:Jl[t];return r.jsx("span",{className:N.clsx(nc(e),n),children:e.text})},nc=e=>{switch(e.textRole){case"value":return kr;case"observation":return Ul;case"trendPercentage":return Ql[e.trendDirection??"up"];case"trendReference":return Kl;case"label":return Zl}},rc=({item:e,resolvedSize:t})=>r.jsx("div",{className:Cr,children:Rn(e).map(n=>r.jsx(oc,{row:n,resolvedSize:t},n.role))}),oc=({row:e,resolvedSize:t})=>{const n=e.role==="trendRow";return r.jsx("div",{className:ql[e.role],"data-testid":n?"headline-trend":void 0,"data-direction":n?sc(e):void 0,role:n?"img":void 0,"aria-label":n?e.ariaLabel:void 0,children:e.segments.map((o,s)=>r.jsx(tc,{segment:o,resolvedSize:t},s))})},sc=e=>{const t=e.segments.find(n=>n.kind==="trendArrow");return t?.kind==="trendArrow"?t.direction:void 0},ac=({headline:e,rect:t,resolvedSize:n,visibleItemCount:o})=>{const s={left:t.x,top:t.y,width:t.width,height:t.height};return e.kind==="grandTotal"?r.jsx("div",{className:Gl,style:s,children:r.jsx("span",{className:N.clsx(kr,Tr[n]),children:e.value})}):r.jsx("div",{className:zl,style:s,children:e.items.slice(0,o).map((a,c)=>r.jsx(rc,{item:a,resolvedSize:n},`${a.label}-${c}`))})};var ic="_1oj6yix0",lc="_1oj6yix1",cc="_1oj6yix2";const uc=8,dc=16,hc=2,gc=({legends:e,containerRect:t,textScale:n})=>{const{lineBoxHeight:o}=Un(n),{placements:s,hasOverlap:a}=fc(e,t,o);if(s.length===0)return null;const c=a?dc:uc,i=c-hc;return r.jsxs("div",{className:ic,children:[a&&r.jsx("svg",{className:lc,width:t.width,height:t.height,children:s.map(u=>r.jsx(pc,{anchorY:u.anchorY,labelY:u.y,endX:i,color:u.payload.color},u.payload.key))}),s.map(u=>r.jsx("span",{className:cc,style:{left:c,top:u.y,color:u.payload.color},children:u.payload.label},u.payload.key))]})},fc=(e,t,n)=>g.useMemo(()=>{const o=[];for(const s of e)for(const a of s.items){if(a.normalizedY===null)continue;const c=typeof a.visual.color=="string"?a.visual.color:void 0;o.push({normalizedY:a.normalizedY,payload:{key:String(o.length),label:a.formattedLabel,color:c}})}return o.length===0||t.height<=0?{placements:[],hasOverlap:!1}:f.computeDirectLabelsLayout({items:o,containerHeight:t.height,labelHeight:n})},[e,t.height,n]),pc=({anchorY:e,labelY:t,endX:n,color:o})=>{const s=n/2;return r.jsx("path",{d:`M0,${e} C${s},${e} ${s},${t} ${n},${t}`,fill:"none",stroke:o??"currentColor",strokeWidth:1,strokeDasharray:"2 2"})};var mc="_6a636s0",xc="_1kjk02r0",vc="_1kjk02r1",yc="_1kjk02r2",bc="_1kjk02r3",Sc="_1kjk02r4",jc="_1kjk02r5",Lc="_1kjk02r6",Cc="_1kjk02r7",kc="_1kjk02r8",Tc="_1kjk02r9",wc="_1kjk02ra",Ac="_1kjk02rb",Ec="_1dw9dgx0";const _c="#9ca3af",Ye="\0",Mc=e=>{const t=[];return e.forEach((n,o)=>{const s=n.aesthetics.includes("size");for(const a of n.items){if(s){const d=Number(a.visual.size);if(!Number.isFinite(d)||d<=0)continue}const c=a.visual.color??"",i=s?`${Ye}${Number(a.visual.size)}`:"",u=a.visual.lineType;t.push({key:`${o}${Ye}${String(a.value)}${Ye}${c}${i}`,formattedLabel:a.formattedLabel,visual:a.visual,swatchShape:a.swatchShape,isBubble:s,primaryLineType:u})}}),t},wr=({pill:e})=>e.isBubble?r.jsx(Nc,{pill:e}):r.jsx(Fc,{pill:e}),Pc=({color:e,lineType:t,shape:n})=>e?r.jsx(ye,{shape:n,color:e,lineType:t,width:Dn,height:ct}):null,Fc=({pill:e})=>r.jsxs(r.Fragment,{children:[r.jsx(Pc,{color:e.visual.color,lineType:e.primaryLineType,shape:e.swatchShape}),r.jsx("span",{children:e.formattedLabel})]}),Nc=({pill:e})=>{const t=Number(e.visual.size);return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:Ec,style:{width:t,height:t,backgroundColor:e.visual.color??_c}}),r.jsx("span",{children:e.formattedLabel})]})},Hc=({hiddenPills:e,placement:t})=>{const[n,o]=g.useState(!1),{refs:s,floatingStyles:a}=F.useFloating({open:n,placement:t,middleware:[F.offset(4),F.flip(),F.shift({padding:8})]});g.useEffect(()=>{if(!n)return;const d=m=>{const p=m.target;if(!p)return;const x=s.reference.current,v=s.floating.current;x instanceof Element&&x.contains(p)||v instanceof Element&&v.contains(p)||o(!1)},h=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",d),document.addEventListener("keydown",h),()=>{document.removeEventListener("pointerdown",d),document.removeEventListener("keydown",h)}},[n,s.floating,s.reference]);const c=t==="left"||t==="right",i=Math.min(e.length-1,Wn),u=Array.from({length:i},(d,h)=>i-h);return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:s.setReference,className:N.clsx(xc,{[yc]:c,[vc]:!c}),children:[u.map(d=>r.jsx("span",{className:N.clsx(bc,{[jc]:c,[Sc]:!c}),style:Bc(d,c),"aria-hidden":!0},d)),r.jsx("button",{type:"button",className:N.clsx(Lc,{[Cc]:n}),onClick:()=>o(d=>!d),"aria-haspopup":"dialog","aria-expanded":n,"aria-label":`Show ${e.length} hidden legend ${e.length===1?"item":"items"}`,children:r.jsxs("span",{className:kc,children:["+",e.length]})})]}),n&&r.jsx("div",{ref:s.setFloating,role:"dialog","aria-label":"Hidden legend items",className:Tc,style:a,children:r.jsx("ul",{className:wc,children:e.map(d=>r.jsx("li",{className:Ac,children:r.jsx(wr,{pill:d})},d.key))})})]})},Bc=(e,t)=>{const n=-e*$n;return{transform:t?`translateY(${n}px)`:`translateX(${n}px)`}};var Rc="_1cecisi0",Ic="_1cecisi1",Oc="_1cecisi2",Dc="_1cecisi3";const zc=({edge:e,formattedLegends:t,containerWidth:n,containerHeight:o,textScale:s})=>{const a=ne(),c=g.useMemo(()=>Mc(t),[t]),i=e==="left"||e==="right",u=i?o:n,d=g.useMemo(()=>{if(c.length===0)return{visibleCount:0,hasOverflow:!1};if(u<=0)return{visibleCount:c.length,hasOverflow:!1};const x=Y(Xn,s),v={family:Yn,size:x},y=x*qn,S=D=>i?Gc(D,y):Rt({label:D.formattedLabel,swatchInlineSize:Wc(D),textMeasurer:a,font:v}),L=c.map(S),w=(i?y+ut:Rt({label:`+${c.length}`,swatchInlineSize:0,textMeasurer:a,font:v}))+Ta;return Xc({pillSizes:L,overflowPillSize:w,containerSize:u,gap:La})},[c,u,i,a,s]);if(c.length===0)return null;const h=c.slice(0,d.visibleCount),m=c.slice(d.visibleCount),p=d.hasOverflow&&m.length>0;return r.jsxs("div",{className:N.clsx(Rc,{[Oc]:i,[Ic]:!i}),children:[h.map(x=>r.jsx("div",{className:Dc,children:r.jsx(wr,{pill:x})},x.key)),p&&r.jsx(Hc,{hiddenPills:m,placement:qc(e)})]})},Rt=({label:e,swatchInlineSize:t,textMeasurer:n,font:o})=>{const s=n.measureText(e,o).width,a=t>0?zn:0;return t+a+s+Vn},Gc=(e,t)=>{const n=$c(e);return Math.max(t,n)+ut},Wc=e=>e.isBubble?Number(e.visual.size):Kn(e.visual.color),$c=e=>e.isBubble?Number(e.visual.size):ct,Xc=({pillSizes:e,overflowPillSize:t,containerSize:n,gap:o})=>{if(e.length===0)return{visibleCount:0,hasOverflow:!1};let s=0;for(let i=0;i<e.length;i+=1)i>0&&(s+=o),s+=e[i]??0;if(s<=n)return{visibleCount:e.length,hasOverflow:!1};let a=0,c=0;for(const i of e){const u=a+(c>0?o:0)+i;if(u+o+t>n)break;a=u,c+=1}return{visibleCount:c,hasOverflow:!0}},qc=e=>{switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}},Yc=g.memo(function({formattedLegends:t,rects:n,textScale:o}){const s=g.useMemo(()=>{const a=new Map;for(const c of t){let i=a.get(c.position);i||(i={pill:[],direct:[]},a.set(c.position,i)),c.display==="pill"?i.pill.push(c):i.direct.push(c)}return a},[t]);return r.jsx(r.Fragment,{children:Array.from(s,([a,c])=>{const i=n[a];return i===void 0?null:r.jsxs("div",{className:mc,style:{left:i.x,top:i.y,width:i.width,height:i.height},children:[r.jsx(zc,{edge:a,formattedLegends:c.pill,containerWidth:i.width,containerHeight:i.height,textScale:o}),r.jsx(gc,{legends:c.direct,containerRect:i,textScale:o})]},a)})})}),Vc=(e,t,n)=>{const o=e.filter(a=>a.interactive);if(o.length===0)return null;const s=o.map(a=>n(a,t)).filter(a=>a!==null).map(a=>a.guideMode);return s.length===0?null:s.some(a=>a==="bar")?"bar":s.every(a=>a==="continuous")?"continuous":null};function Uc(e,t){const n=f.getMainAxisCoordinate(e.mainAxis,t);if(e.mainAxis==="y"){const s=b(z(n));return{x1:0,x2:"100%",y1:s,y2:s}}const o=b(n);return{x1:o,x2:o,y1:0,y2:"100%"}}function Kc(e,t,n){const o=e.mainAxis==="y"?f.getY(n.observation):f.getX(n.observation);if(o===null)return null;const s=e.mainAxis==="y"?Jc(n):Zc(n),c=(t.x?.kind==="position"?t.x:null)?.bandwidth??s;if(c===null||c<=0)return null;const i=c/2;if(e.mainAxis==="y"){const h=b(z(o+i)),m=b(c);return{x:0,y:h,width:"100%",height:m}}const u=b(o-i),d=b(c);return{x:u,y:0,width:d,height:"100%"}}function Zc(e){const t=f.getXMin(e.observation),n=f.getXMax(e.observation);return t===null||n===null?null:n-t}function Jc(e){const t=f.getYMin(e.observation),n=f.getYMax(e.observation);return t===null||n===null?null:n-t}const Qc=1,eu="4 3",tu=({panelRect:e})=>{const{coordSystem:t,layers:n,scales:o}=T(H.useShallow(i=>({coordSystem:i.coordSystem,layers:i.layers,scales:i.scales}))),s=Se(i=>i.hover.primary),a=be();if(t.type!=="cartesian"||n.length===0||s===null)return null;const c=Vc(n,t,a);return c===null?null:c==="bar"?r.jsx(ru,{coordSystem:t,scales:o,primary:s,panelRect:e}):r.jsx(nu,{coordSystem:t,primary:s,panelRect:e})},nu=({coordSystem:e,primary:t,panelRect:n})=>{const o=Uc(e,t);return r.jsx(Ar,{panelRect:n,children:r.jsx("line",{...o,stroke:l.hoverGuideLineColor,strokeWidth:Qc,strokeDasharray:eu,strokeLinecap:"round","data-testid":"hover-guide-line"})})},ru=({coordSystem:e,scales:t,primary:n,panelRect:o})=>{const s=Kc(e,t,n);return s===null?null:r.jsx(Ar,{panelRect:o,children:r.jsx("rect",{...s,fill:l.hoverGuideFillColor,"data-testid":"hover-guide-rect"})})},Ar=({panelRect:e,children:t})=>r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,style:{overflow:"visible",pointerEvents:"none"},"data-testid":"hover-guide",children:t}),ou=200,su=({engine:e,store:t,overlayRef:n,setCursor:o=au})=>{g.useEffect(()=>{const s=n.current;if(!s)return;const a=iu(s,e),c=lu(s,e,t,o);return()=>{c(),a()}},[e,t,n,o])},au=()=>{},iu=(e,t)=>{const n=()=>{const c=e.getBoundingClientRect();c.width===0||c.height===0||t.setViewport({width:c.width,height:c.height})};let o=null;const s=()=>{o!==null&&clearTimeout(o),o=setTimeout(()=>{o=null,n()},ou)},a=new ResizeObserver(s);return a.observe(e),n(),()=>{a.disconnect(),o!==null&&clearTimeout(o)}},lu=(e,t,n,o)=>{let s=null,a=null;const c=()=>{a=null;const d=s;if(s=null,!d)return;o({clientX:d.clientX,clientY:d.clientY});const h=e.getBoundingClientRect();if(h.width===0||h.height===0)return;const m={x:(d.clientX-h.left)/h.width,y:1-(d.clientY-h.top)/h.height};n.getState().setHoverState(t.query(m))},i=d=>{s=d,a===null&&(a=requestAnimationFrame(c))},u=()=>{s=null,a!==null&&(cancelAnimationFrame(a),a=null),o(null);const d=n.getState();d.hover.primary!==null&&d.setHoverState(f.RESTING_HOVER_STATE)};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",u),()=>{e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",u),a!==null&&cancelAnimationFrame(a),s=null}},cu=({panelRect:e})=>{const{engine:t,store:n,overlayRef:o,setCursor:s}=he();return su({engine:t,store:n,overlayRef:o,setCursor:s}),r.jsx("rect",{ref:o,x:e.x,y:e.y,width:e.width,height:e.height,fill:"transparent",pointerEvents:"all","data-testid":"pointer-capture-layer"})},Ve="data-hover-active",uu=e=>{const{store:t}=he(),n=xe.useStore(t,o=>o.hover.primary!==null);g.useEffect(()=>{const o=e.current;if(o)return n?o.setAttribute(Ve,"true"):o.removeAttribute(Ve),()=>{o.removeAttribute(Ve)}},[e,n])},It=({panelRect:e,zOrder:t})=>{const n=T(c=>c.annotations.custom),o=vs(),s=n.filter(c=>{const i=o(c.type);return i!==null&&(c.zOrder??i.zOrder)===t});if(s.length===0)return null;const a={width:e.width,height:e.height};return r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`custom-annotations-${t}`,children:s.map(c=>{const i=o(c.type);return i===null?null:r.jsx("g",{"data-annotation-type":c.type,children:i.draw({targets:c.targets,area:a,params:c.params})},c.id)})})},Er=P.xs,rt=O,_r=q.medium,du=q.semibold,Mr=6,Pr=2,hu=4,gu=2,Ot=4;var fu="_1agclyl0",pu="_1agclyl1",mu="_1agclyl2",xu={inside:"_1agclyl4 _1agclyl3",outside:"_1agclyl5 _1agclyl3"},vu="_1agclyl6 _1agclyl3";const Fr=({x:e,y:t,width:n,height:o,text:s,isRotated:a,target:c,position:i,coordType:u})=>{const d=a?`rotate(-90 ${e} ${t})`:void 0,h=c==="aggregate"?vu:xu[i],m=yu(c,i,u);return r.jsxs("g",{transform:d,children:[m&&r.jsx("rect",{className:m,x:e-n/2,y:t-o/2,width:n,height:o,rx:Ot,ry:Ot}),r.jsx("text",{className:h,x:e,y:t,textAnchor:"middle",dominantBaseline:"central",children:s})]})},yu=(e,t,n)=>{if(e==="aggregate")return mu;if(t==="outside"&&n==="cartesian")return pu},bu={dataLabel:{x:Mr,y:Pr},stackTotal:{x:hu,y:gu}},Su=({panelRect:e,formattingLocale:t})=>{const n=ne(),o=T(H.useShallow(i=>({layers:i.layers,coordSystem:i.coordSystem,axes:i.guides.axes,numberFormat:i.config.numberFormat,parsingLocale:i.config.parsingLocale,textScale:i.config.appearance.textScale}))),s=g.useMemo(()=>{const i=Y(Er,o.textScale);return{dataLabel:{family:rt,size:i,weight:_r},stackTotal:{family:rt,size:i,weight:du}}},[o.textScale]),a=g.useMemo(()=>(i,u)=>{const d=n.measureText(u,s[i]),h=bu[i];return{...d,width:d.width+h.x*2,height:d.height+h.y*2}},[n,s]),c=g.useMemo(()=>f.buildDataLabelsContent({...o,panelRect:e,measureDataLabel:a,formattingLocale:t}),[o,e,a,t]);return r.jsx("g",{className:fu,transform:`translate(${e.x}, ${e.y})`,"data-testid":"data-labels",children:c.labels.map(i=>r.jsx(Fr,{x:i.x,y:i.y,width:i.width,height:i.height,text:i.text,isRotated:i.isRotated,target:i.target,position:i.position,coordType:o.coordSystem.type},i.key))})},ju=({linePath:e,arrowheadPath:t,stroke:n,strokeWidth:o})=>{const s={stroke:n,strokeWidth:o,strokeLinecap:"round",fill:"none"};return r.jsxs("g",{children:[r.jsx("path",{d:e,...s}),r.jsx("path",{d:t,...s,strokeLinejoin:"round"})]})},Lu=({x:e,y:t,text:n,lineHeight:o,paddingX:s,paddingY:a,strokeWidth:c,strokeColor:i,fontWeight:u})=>{const d=ne(),m=g.useMemo(()=>d.measureText(n,{family:O,size:o,weight:u}),[d,n,o,u]).width+s*2,p=o+a*2;return r.jsxs("g",{style:{pointerEvents:"none"},children:[r.jsx("rect",{x:e-m/2,y:t-p/2,width:m,height:p,rx:4,fill:l.graphBackground,stroke:i,strokeWidth:c}),r.jsx("text",{x:e,y:t,dominantBaseline:"central",textAnchor:"middle",fill:l.textPrimary,style:{fontFamily:O,fontSize:o,fontWeight:u},children:n})]})},Cu=({panelRect:e,formattingLocale:t})=>{const n=T(H.useShallow(s=>({differenceArrows:s.annotations.differenceArrows,mainAxis:s.coordSystem.type==="cartesian"?s.coordSystem.mainAxis:"x",textScale:s.config.appearance.textScale}))),o=g.useMemo(()=>n.differenceArrows.map(s=>f.computeDifferenceArrow({arrow:s,mainAxis:n.mainAxis,panelWidth:e.width,panelHeight:e.height,textScale:n.textScale,locale:t})),[n,e.width,e.height,t]);return o.length===0?null:r.jsx("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"difference-arrows",children:o.map(({color:s,id:a,linePath:c,arrowheadPath:i,strokeWidth:u,labelPosition:d,labelText:h,labelLineHeight:m,labelPaddingX:p,labelPaddingY:x,labelStrokeWidth:v,labelFontWeight:y})=>{const S=s??l.defaultAnnotationArrowStroke;return r.jsxs(g.Fragment,{children:[r.jsx(ju,{linePath:c,arrowheadPath:i,stroke:S,strokeWidth:u}),r.jsx(Lu,{x:d.x,y:d.y,text:h,lineHeight:m,paddingX:p,paddingY:x,strokeWidth:v,strokeColor:S,fontWeight:y})]},a)})})},ku=0,Tu=1.15,Dt=1.15,wu="rgba(0, 0, 0, 0.16)",zt=2,Au=1.4,Eu=({arrow:e,fallbackColor:t,stickerOutlineColor:n,stickerOutlineColorInverse:o})=>{const s=g.useId(),a=e.color??t,c=_u(e.color,n,o),i=e.dashArray?{strokeDasharray:e.dashArray,strokeDashoffset:e.dashOffset}:{},u=e.arrowheadExtent+e.strokeWidth+zt+Dt,d={x:Math.min(e.startX,e.endX)-u,y:Math.min(e.startY,e.endY)-u,width:Math.abs(e.endX-e.startX)+2*u,height:Math.abs(e.endY-e.startY)+2*u},h=[e.linePath,e.startArrowheadPath,e.endArrowheadPath].filter(m=>m.length>0).join(" ");return r.jsxs("g",{children:[e.hasStickerStyle&&r.jsx("defs",{children:r.jsx("filter",{id:s,filterUnits:"userSpaceOnUse",...d,children:r.jsx("feDropShadow",{dx:ku,dy:Tu,stdDeviation:Dt,floodColor:wu})})}),r.jsxs("g",{filter:e.hasStickerStyle?`url(#${s})`:void 0,children:[e.hasStickerStyle&&r.jsx("path",{d:h,stroke:c,strokeWidth:e.strokeWidth+2*zt,strokeLinecap:"round",fill:"none"}),r.jsx("path",{d:e.linePath,stroke:a,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none",...i}),e.startArrowheadPath.length>0&&r.jsx("path",{d:e.startArrowheadPath,stroke:a,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"}),e.endArrowheadPath.length>0&&r.jsx("path",{d:e.endArrowheadPath,stroke:a,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"})]})]})},_u=(e,t,n)=>{if(e===null)return n;try{return Ke.getContrast(e,t)<Au?n:t}catch{return n}},Mu=({panelRect:e})=>{const{themeValues:t}=ht(),n=T(s=>s.annotations.freeformArrows),o=g.useMemo(()=>n.map(s=>f.computeFreeformArrow({arrow:s,panelWidth:e.width,panelHeight:e.height})).filter(s=>s!==null),[n,e.width,e.height]);return o.length===0?null:r.jsx("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"freeform-arrows",children:o.map(s=>r.jsx(Eu,{arrow:s,fallbackColor:l.defaultAnnotationArrowStroke,stickerOutlineColor:t.arrowAnnotationStickerOutlineColor,stickerOutlineColorInverse:t.arrowAnnotationStickerOutlineColorInverse},s.id))})},Pu=({edge:e,areTicksVisible:t,position:n,labelRotation:o,label:s})=>{const a=b(n),c=t?1:0,i={style:{font:l.fontTickLabel},fill:l.textSecondary},u=o!==0&&(e==="top"||e==="bottom"),d=e==="top";return u?r.jsx("svg",{x:a,y:d?"100%":0,style:{overflow:"visible"},children:r.jsx("text",{...Nu(d,c,o),...i,children:s})}):r.jsx("text",{...Fu(e,a,c),...i,children:s})},Fu=(e,t,n)=>{switch(e){case"bottom":return{x:t,y:J*n,textAnchor:"middle",dominantBaseline:"hanging"};case"top":return{x:t,y:"100%",dy:-J*n,textAnchor:"middle",dominantBaseline:"auto"};case"left":return{x:"100%",dx:-J*n,y:t,textAnchor:"end",dominantBaseline:"central"};case"right":return{x:J*n,y:t,textAnchor:"start",dominantBaseline:"central"}}},Nu=(e,t,n)=>{const o=J*t,s=e?-o:o;return{x:0,y:s,textAnchor:e?"start":"end",dominantBaseline:"central",transform:`rotate(${n}, 0, ${s})`}},Hu=({formattedAxis:e,rect:t})=>{const n=e.position==="bottom"||e.position==="top";return r.jsxs("svg",{x:t.x,y:t.y,width:t.width,height:t.height,style:{overflow:"visible"},children:[Bn,e.ticks.map((o,s)=>{const a=o.formattedLabel,c=n?o.position:1-o.position,i=Bu(e.position,c,t);return r.jsxs("g",{children:[e.ticksVisible&&r.jsx("line",{...i,stroke:l.gridLineColor,strokeWidth:1}),r.jsx(Pu,{edge:e.position,areTicksVisible:e.ticksVisible,position:c,labelRotation:e.labelRotation,label:a})]},s)})]})},Bu=(e,t,n)=>{const o=b(t);switch(e){case"bottom":return{x1:o,y1:0,x2:o,y2:we};case"top":return{x1:o,y1:n.height,x2:o,y2:n.height-we};case"left":return{x1:n.width,y1:o,x2:n.width-we,y2:o};case"right":return{x1:0,y1:o,x2:we,y2:o}}},Ru=({formattedAxes:e,rects:t})=>r.jsx(r.Fragment,{children:e.map(n=>{const o=t[n.position];return!o||!n.isVisible?null:r.jsx(Hu,{formattedAxis:n,rect:o},n.scaleAestheticKey)})}),Iu=({axes:e,rects:t})=>r.jsx(r.Fragment,{children:e.map(n=>{const o=t[n.position];if(!o||!n.isVisible)return null;const s=Ou(n.position,o);return r.jsxs("g",{transform:`translate(${o.x}, ${o.y})`,children:[Bn,r.jsx("text",{style:{font:l.fontAxisLabel},fill:l.textPrimary,...s,children:n.label})]},`axis-label-${n.position}`)})}),Ou=(e,t)=>{const n={x:t.width/2,y:t.height/2,textAnchor:"middle",dominantBaseline:"middle"};return e==="left"?(n.x=0,n.textAnchor="start"):e==="right"&&(n.x=t.width,n.textAnchor="end"),n},Gt={strokeWidth:1,strokeDashoffset:"0",strokeDasharray:"2 3",strokeLinecap:"round"},Du=({axes:e,panel:t,panelRect:n})=>r.jsxs("svg",{x:n.x,y:n.y,width:n.width,height:n.height,style:{overflow:"visible"},children:[t.border.isVisible&&r.jsx("rect",{x:0,y:0,width:n.width,height:n.height,fill:"none",stroke:l.gridLineColor,rx:8,ry:8,...Gt}),e.map(o=>{if(!o.gridVisible)return null;const s=o.position==="bottom"||o.position==="top";return r.jsx("g",{children:o.ticks.map((a,c)=>{if(a.position<=0||a.position>=1)return null;const i=s?a.position:1-a.position,u=b(i),d=s?{x1:u,y1:0,x2:u,y2:"100%"}:{x1:0,y1:u,x2:"100%",y2:u};return r.jsx("line",{...d,...Gt,stroke:l.gridLineColor},c)})},o.scaleAestheticKey)})]}),Wt=8,$t=.5,Xt={strokeWidth:1,strokeLinecap:"round"},zu=({axes:e,panelRect:t,coordSystem:n})=>{const o=e.find(y=>y.geometry==="circular"),s=e.find(y=>y.geometry==="radial");if(!o||o.ticks.length===0)return null;const a=t.x+t.width/2,c=t.y+t.height/2,i=Math.min(t.width,t.height)/2,{startAngle:u,innerRadius:d}=n,h=y=>y*2*Math.PI+u,m=(y,S)=>{const L=a+S*Math.sin(y),C=c-S*Math.cos(y);return`${L.toFixed(2)},${C.toFixed(2)}`},p=o.ticks.map(y=>h(y.position)),x=y=>`${p.map((S,L)=>`${L===0?"M":"L"} ${m(S,y)}`).join(" ")} Z`,v=(s?.ticks??[]).map(y=>(d+y.position*(1-d))*i).filter(y=>y>$t);return v.some(y=>Math.abs(y-i)<$t)||v.push(i),r.jsxs("g",{"data-guide":"polar",style:{overflow:"visible"},children:[v.map((y,S)=>r.jsx("path",{d:x(y),fill:"none",stroke:l.gridLineColor,...Xt},`ring-${S}`)),p.map((y,S)=>r.jsx("line",{x1:a,y1:c,x2:a+i*Math.sin(y),y2:c-i*Math.cos(y),stroke:l.gridLineColor,...Xt},`spoke-${S}`)),o.ticks.map((y,S)=>{const L=h(y.position),C=Math.sin(L),w=-Math.cos(L);return r.jsx("text",{x:a+C*(i+Wt),y:c+w*(i+Wt),textAnchor:C>.1?"start":C<-.1?"end":"middle",dominantBaseline:w>.1?"hanging":w<-.1?"auto":"central",style:{font:l.fontTickLabel},fill:l.textSecondary,children:y.formattedLabel},`label-${S}`)})]})},qt=({panelRect:e,zOrder:t})=>{const o=T(s=>s.annotations.shapes).filter(s=>s.zOrder===t);return o.length===0?null:r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`shapes-${t}`,children:o.map(({id:s,x:a,y:c,width:i,height:u,fillColor:d,fillOpacity:h,strokeWidth:m,strokeColor:p})=>r.jsx("rect",{x:b(a),y:b(c),width:b(i),height:b(u),fill:d,fillOpacity:h,stroke:m>0?p??l.defaultAnnotationShapeStroke:"none",strokeWidth:m},s))})};var Gu="_120wioc0";const Wu=({panelRect:e})=>{const t=T(n=>n.annotations.textAnnotations);return t.length===0?null:r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":"text-annotations",children:t.map(n=>r.jsx("foreignObject",{x:b(n.x),y:b(n.y),width:b(n.width),height:b(1-n.y),overflow:"visible",children:r.jsx("div",{className:Gu,style:$u(n.backgroundColor,n.backgroundColorStyle),children:r.jsx(Ne,{content:n.content})})},n.id))})},$u=(e,t)=>e===null||e==="transparent"?{color:l.textPrimary}:t==="fade"?{color:l.textPrimary,backgroundColor:et(e,l.grey100,.5),boxShadow:`0 0 0 1.5px ${et(e,l.grey0,.2)}`}:{color:l.textPrimary,backgroundColor:e,boxShadow:`0 0 0 1.5px ${De(e,.1)}`};var Xu="usd3ea0",qu="usd3ea1";const Yu=({layer:e,coordSystem:t,isAnimated:n,isDimmed:o,highlightStyle:s,formattingLocale:a})=>{const i=be()(e,t);return i===null?r.jsxs("text",{children:[e.geom," not implemented"]}):r.jsx("g",{className:N({[qu]:o&&s==="desaturate",[Xu]:o&&s==="dim"}),children:i.render({layer:e,coordSystem:t,isAnimated:n,formattingLocale:a})})};function Vu({plugin:e,layer:t,coordSystem:n,candidates:o}){if(e?.getOverlayAnchor===void 0||o.length===0)return[];const s=[];for(const{observation:a,observationIndex:c}of o){const i=e.getOverlayAnchor({layer:t,coordSystem:n,observation:a});i!==null&&s.push({observation:a,observationIndex:c,anchor:i})}return s}const Uu=4,Ku=({plugin:e,layer:t,matchedLayer:n,overlayCandidates:o,coordSystem:s,isAnimated:a,panelRect:c,formattingLocale:i})=>{const{numberFormat:u,textScale:d}=T(H.useShallow(v=>({numberFormat:v.config.numberFormat,textScale:v.config.appearance.textScale}))),h=g.useMemo(()=>Vu({plugin:e,layer:t,coordSystem:s,candidates:o}),[e,t,s,o]),m=g.useMemo(()=>f.createSegmentYReader(t),[t]),p=g.useMemo(()=>f.buildLayerYValueFormatter({layer:t,numberFormat:u,locale:i}),[u,t,i]),x=Er*xn*d;return e===null||n===null&&h.length===0?null:r.jsxs(r.Fragment,{children:[n?e.render({layer:n,coordSystem:s,isAnimated:a,formattingLocale:i}):null,h.map(({observation:v,observationIndex:y,anchor:S})=>r.jsx(Zu,{observation:v,anchor:S,panelRect:c,readSegmentY:m,formatYValue:p,labelFontSizePx:x},Ju(v,y)))]})},Zu=({observation:e,anchor:t,panelRect:n,readSegmentY:o,formatYValue:s,labelFontSizePx:a})=>{const c=ne(),i=t.x,u=z(t.y),d=(f.getSize(e)??sn)/2,h=o(e),m=f.isDefined(h)?s(h,e):null,p=g.useMemo(()=>{if(m===null)return null;const x=c.measureText(m,{family:rt,size:a,weight:_r});return{width:x.width+Mr*2,height:x.height+Pr*2}},[m,c,a]);return r.jsxs(r.Fragment,{children:[r.jsx("circle",{"data-testid":"highlight-overlay-dot",cx:b(i),cy:b(u),r:d,fill:f.getColor(e)}),m!==null&&p!==null&&r.jsx(Fr,{x:i*n.width,y:u*n.height-d-Uu-p.height/2,width:p.width,height:p.height,text:m,isRotated:!1,target:"observation",position:"outside",coordType:"cartesian"})]})},Ju=(e,t)=>{const n=e[f.GROUP_VARIABLES.group];return`${String(n??"")}\0${t}`},Qu=({layer:e,coordSystem:t,panelRect:n})=>{const o=be(),{primary:s,group:a,related:c}=Se(H.useShallow(d=>({primary:d.hover.primary,group:d.hover.group,related:d.hover.related})));if(s===null)return null;const i=o(e,t);if(i===null)return null;const u=c.get(e.id)??[];return s.layerId===e.id?i.renderHover({layer:e,coordSystem:t,primary:s,group:a,related:u,panelRect:n}):u.length===0?null:i.renderHoverCompanions({layer:e,primary:s,related:u})};var ed="to1jkx0",td="to1jkx1";const nd=({shouldAnimate:e,panelRect:t,formattingLocale:n})=>{const{layers:o,coordSystem:s,highlightStyle:a}=T(H.useShallow(c=>({layers:c.layers,coordSystem:c.coordSystem,highlightStyle:c.config.appearance.highlightStyle})));return r.jsx("svg",{x:t.x,y:t.y,width:t.width,height:t.height,className:ed,"data-testid":"geom-layers",children:o.map(c=>r.jsxs(g.Fragment,{children:[r.jsx(sd,{layer:c,coordSystem:s,highlightStyle:a,shouldAnimate:e,panelRect:t,formattingLocale:n}),r.jsx(Qu,{layer:c,coordSystem:s,panelRect:t})]},`${c.id}-${rd(s)}`))})},rd=e=>e.type==="cartesian"?`cartesian-${e.mainAxis}`:e.type,od=e=>{if(e.highlight!==null)return td},sd=({layer:e,coordSystem:t,highlightStyle:n,shouldAnimate:o,panelRect:s,formattingLocale:a})=>{const c=be(),i=g.useMemo(()=>c(e,t),[c,e,t]),u=e.highlight;return r.jsxs("g",{className:od(e),children:[r.jsx(Yu,{layer:e,coordSystem:t,isAnimated:o,isDimmed:u?.composition.isDimmed??!1,highlightStyle:n,formattingLocale:a}),u!==null&&r.jsx(Ku,{plugin:i,layer:e,matchedLayer:u.composition.matchedLayer,overlayCandidates:u.composition.overlayCandidates,coordSystem:t,isAnimated:o,panelRect:s,formattingLocale:a})]})};var ad="_17uhij30";const id=({formattedAxes:e,formattedPolarAxes:t,plotRect:n,panelRect:o,axisRects:s,axisLabelRects:a,shouldAnimate:c,formattingLocale:i})=>{const u=g.useRef(null);uu(u);const{axes:d,panelGuide:h,coordSystem:m}=T(H.useShallow(S=>({axes:S.guides.axes,panelGuide:S.guides.panel,coordSystem:S.coordSystem}))),p=g.useMemo(()=>Nr(o,n),[o,n]),x=g.useMemo(()=>Yt(s,n),[s,n]),v=g.useMemo(()=>Yt(a,n),[a,n]),y=g.useMemo(()=>d.filter(S=>S.geometry==="linear"),[d]);return r.jsxs("svg",{ref:u,className:ad,width:n.width,height:n.height,style:{transform:`translate(${n.x}px, ${n.y}px)`},"data-testid":"plot",children:[r.jsx(Du,{axes:e,panel:h,panelRect:p}),m.type==="polar"&&r.jsx(zu,{axes:t,panelRect:p,coordSystem:m}),r.jsx(tu,{panelRect:p}),r.jsx(Ru,{formattedAxes:e,rects:x}),r.jsx(Iu,{axes:y,rects:v}),r.jsx(qt,{panelRect:p,zOrder:"background"}),r.jsx(It,{panelRect:p,zOrder:"background"}),r.jsx(nd,{shouldAnimate:c,panelRect:p,formattingLocale:i}),r.jsx(Su,{panelRect:p,formattingLocale:i}),r.jsx(Cu,{panelRect:p,formattingLocale:i}),r.jsx(qt,{panelRect:p,zOrder:"foreground"}),r.jsx(It,{panelRect:p,zOrder:"foreground"}),r.jsx(Mu,{panelRect:p}),r.jsx(Wu,{panelRect:p}),r.jsx(cu,{panelRect:p})]})},Nr=(e,t)=>({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}),Yt=(e,t)=>{const n={};for(const[o,s]of Object.entries(e))n[o]=Nr(s,t);return n},Ue={headerSize:{width:0,height:0},footerSize:{width:0,height:0}},ld=()=>{const[e,t]=g.useState(null),[n,o]=g.useState(null),[s,a]=g.useState(Ue);return g.useEffect(()=>{const c=()=>{const u=e?{width:e.offsetWidth,height:e.offsetHeight}:Ue.headerSize,d=n?{width:n.offsetWidth,height:n.offsetHeight}:Ue.footerSize;a(h=>cd(h,{headerSize:u,footerSize:d})?{headerSize:u,footerSize:d}:h)};c();const i=new ResizeObserver(c);return e&&i.observe(e),n&&i.observe(n),()=>i.disconnect()},[e,n]),{headerRef:t,footerRef:o,measurements:s}},cd=(e,t)=>e.headerSize.width!==t.headerSize.width||e.headerSize.height!==t.headerSize.height||e.footerSize.width!==t.footerSize.width||e.footerSize.height!==t.footerSize.height,ud=({appearance:e,isEditable:t,style:n,children:o})=>{const{theme:s,themeClass:a,inlineVarsStyle:c}=ht(),i=Ka(e.border),u=Math.max(0,e.cornerRadius),d=u===0?0:u+i,h=g.useMemo(()=>{const x={...n,borderRadius:`${d}px`,...c},v=Ua(e.border,s);return v!==null&&(x.background=v),x},[n,d,c,e.border,s]),m=g.useMemo(()=>({inset:`${i}px`,borderRadius:`${u}px`}),[i,u]),p=t&&e.background.type==="solid"&&e.background.color==="transparent";return r.jsx("div",{"data-testid":"graph-wrapper",className:N(ei,a),style:h,children:r.jsx("div",{"data-testid":"graph-inner",className:N(ni,{[ri]:p}),style:m,children:o})})},dd=e=>r.jsx(Pn,{children:r.jsx(bn,{children:r.jsx(hd,{...e})})}),hd=({width:e,height:t,isAnimated:n,showTooltips:o=!0,mode:s="readonly"})=>{const{axes:a,legends:c,numberFormat:i,parsingLocale:u,appearance:d,annotations:h,coordSystem:m,headline:p,headlineConfig:x}=T(H.useShallow($=>({axes:$.guides.axes,legends:$.guides.legends,numberFormat:$.config.numberFormat,parsingLocale:$.config.parsingLocale,appearance:$.config.appearance,annotations:$.annotations,coordSystem:$.coordSystem,headline:$.guides.headline,headlineConfig:$.config.headline}))),v=E.useReducedMotion(),{headerRef:y,footerRef:S,measurements:L}=ld(),{formattingLocale:C,theme:w,themeOverrides:D}=re(),k=g.useMemo(()=>f.formatLegends({legends:c,numberFormat:i,parsingLocale:u,formattingLocale:C}),[c,i,u,C]),G=g.useMemo(()=>f.formatHeadline({headline:p,show:x.show,numberFormat:i,parsingLocale:u,formattingLocale:C}),[p,x.show,i,u,C]),U=ne(),K=d.border.type==="none"?0:d.border.width,Z=g.useMemo(()=>({width:Math.max(0,e-2*K),height:Math.max(0,t-2*K)}),[e,t,K]),je=g.useMemo(()=>G?{formatted:G,size:x.size,position:x.position,innerRadius:m.type==="polar"?m.innerRadius:0}:void 0,[G,x.size,x.position,m]),Le=Ea(U,d.textScale),ge=_a({measurer:Le,axes:a,numberFormat:i,parsingLocale:u,formattedLegends:k,containerSize:Z,externalMeasurements:L,headline:je,formattingLocale:C,annotations:h,coordSystem:m,textScale:d.textScale}),Ce=g.useMemo(()=>!ge||!je||!Le?null:f.resolveHeadlinePlacement({headline:je,layout:ge.layout,containerSize:Z,measurer:Le,itemGap:_n}),[ge,je,Z,Le]);if(!ge)return null;const{layout:Q,formattedAxes:Br,formattedPolarAxes:Rr}=ge;return r.jsx(sr,{theme:w,themeOverrides:D,appearance:d,children:r.jsxs(ud,{appearance:d,isEditable:s==="editable",style:{width:e,height:t},children:[r.jsx(Il,{ref:y,headerRect:Q.header,mode:s}),r.jsx(id,{formattedAxes:Br,formattedPolarAxes:Rr,plotRect:Q.plot,panelRect:Q.panel,axisRects:Q.axes,axisLabelRects:Q.axisLabels,shouldAnimate:n??!v,formattingLocale:C??u}),r.jsx(Cl,{ref:S,footerRect:Q.footer,mode:s}),r.jsx(Yc,{formattedLegends:k,rects:Q.legends,textScale:d.textScale}),G&&Ce&&r.jsx(ac,{headline:G,rect:Ce.rect,resolvedSize:Ce.resolvedSize,visibleItemCount:Ce.visibleItemCount}),o&&r.jsx(ca,{})]})})};function gd(e,t){return{type:e.type,zOrder:t.zOrder,draw:t.draw}}const fd=2147483646;function pd(){const e=g.useRef(null),[t,n]=g.useState(null),o=g.useCallback(()=>{const a=e.current;if(!a)return;const c=a.getBoundingClientRect(),i={left:c.left,top:c.top,width:c.width,height:c.height};n(u=>u&&xd(u,i)?u:i)},[]),s=g.useCallback(a=>{e.current=a},[]);return g.useLayoutEffect(()=>{if(!e.current)return;o();const a=new ResizeObserver(o);return a.observe(e.current),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{a.disconnect(),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[o]),{ref:s,rect:t}}function md({rect:e,children:t}){return rn.createPortal(r.jsx("div",{style:{position:"fixed",left:e.left,top:e.top,width:e.width,height:e.height,pointerEvents:"none",zIndex:fd,overflow:"visible"},children:t}),document.body)}function xd(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function*vd(e,t){for(const n of e)yield{kind:n[t],observation:n}}function yd(e,t,n,o){return e>=n&&t>=o}const bd=({children:e,style:t,...n})=>r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1 1",preserveAspectRatio:"none",...n,style:{overflow:"visible",...t},children:e});function Sd(){return g.useMemo(()=>{const e=f.DEFAULT_COLOR_PALETTE;return t=>e[t%e.length]??e[0]??"#000000"},[])}function jd(e,t){const{hitTesterRegistry:n}=he(),o=g.useRef(t);o.current=t,g.useLayoutEffect(()=>{const s=a=>o.current(a);return n.set(e,s),()=>{n.delete(e)}},[n,e])}function Ld(e){const{engine:t,store:n,setCursor:o}=he();return g.useCallback((s,a)=>{if(s===null){n.getState().setHoverState(f.RESTING_HOVER_STATE),o(null);return}n.getState().setHoverState(t.hoverByKey(e,s)),a&&o(a)},[t,n,o,e])}function Hr(e,t,n){const o=Vt(e),s=Vt(t),a=(c,i)=>Math.round(c+(i-c)*n);return`rgb(${a(o.red,s.red)}, ${a(o.green,s.green)}, ${a(o.blue,s.blue)})`}function Cd(e,t){return Hr(e,"#ffffff",t)}function Vt(e){const t=e.replace("#","");return{red:Number.parseInt(t.slice(0,2),16),green:Number.parseInt(t.slice(2,4),16),blue:Number.parseInt(t.slice(4,6),16)}}exports.CanvasTextMeasurer=Oe;exports.CompanionDot=te;exports.DevToolsPanel=Bs;exports.GraphProvider=xs;exports.GraphRenderer=dd;exports.HoverProvider=Pn;exports.PanelOverlayPortal=md;exports.PrimaryDot=Ie;exports.Swatch=ye;exports.TextMeasurerProvider=bn;exports.ThemeProvider=sr;exports.TooltipBody=Fn;exports.TooltipRowView=Nn;exports.UnitSpaceSvg=bd;exports.darkTheme=or;exports.defineAnnotationRenderer=gd;exports.defineGeomPlugin=Kr;exports.defineGeomRenderer=Zr;exports.emToPx=Y;exports.fitsLabel=yd;exports.lightTheme=rr;exports.lighten=Cd;exports.mixColor=Hr;exports.partitionByKind=vd;exports.toPercent=b;exports.toViewBoxX=eo;exports.toViewBoxY=z;exports.useCategoricalColor=Sd;exports.useCompiledSelector=T;exports.useGeomHitTest=jd;exports.useGeomHover=Ld;exports.useGraphCommandDispatcher=it;exports.useHoverState=Se;exports.usePanelScreenRect=pd;exports.useSvgPathMorph=Me;exports.useTextMeasurer=ne;exports.vars=l;