(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,725622,e=>{"use strict";var t=e.i(651681);let r={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],725622)},621591,e=>{"use strict";var t=e.i(651681);let r={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],621591)},530685,e=>{"use strict";var t=e.i(659350),r=e.i(663456),n=e.i(340800),i=e.i(782143),a=e.i(288265),l=e.i(136562),o=e.i(315368),s=e.i(138257),c=e.i(304903);e.s(["f",0,function(e){let u,d,h,f,m,p,g,x,v=(0,r.c)(49),{coordinate:y,active:b,label:w,payload:k,totalConfig:j,chartHeight:S,isHighRes:M,displayTimezone:C}=e,N=(0,a.f)(),O=(0,s.useLocale)(),T=(0,c.P)(void 0===C?"utc":C);if(!b||!y||void 0===y.x||!w)return null;let _="string"==typeof w?w:"";if(v[0]!==S||v[1]!==y.x||v[2]!==_||v[3]!==N||v[4]!==M||v[5]!==O||v[6]!==k||v[7]!==T||v[8]!==j){d=Symbol.for("react.early_return_sentinel");e:{let e=(0,o.I)(_);if(j){var L;let r,a,l,o,s,c,u,h;if(v[11]!==O||v[12]!==k){let e=k?k.reduce((e,t)=>e+(Number(t.value)||0),0):0;r=(0,i.f)(e,{locale:O,preset:"decimal-3"})??"—",v[11]=O,v[12]=k,v[13]=r}else r=v[13];let f=r,m=M?(0,n.P)(e,{locale:O,timeZone:T,preset:"numeric"})??"—":void 0,p=(0,n.C)(e,{locale:O,timeZone:T,preset:"weekday-day-month"})??"—";if(v[14]!==N||v[15]!==j.bucketMs)a=j.bucketMs?(L=j.bucketMs,L<6e4?N("{count}s",{count:L/1e3}):L<36e5?N("{count}m",{count:L/6e4}):L<864e5?N("{count}h",{count:L/36e5}):N("{count}d",{count:L/864e5})):void 0,v[14]=N,v[15]=j.bucketMs,v[16]=a;else a=v[16];let g=a,x=S??0,b=`${y.x}px`;v[17]!==b?(l={"--tooltip-left":b},v[17]=b,v[18]=l):l=v[18],v[19]!==f||v[20]!==j.suffix?(o=(0,t.jsxs)("span",{className:"rounded-sm px-1.5 py-0.5 text-xs font-medium whitespace-nowrap",children:["~",f,j.suffix]}),v[19]=f,v[20]=j.suffix,v[21]=o):o=v[21],v[22]!==l||v[23]!==o?(s=(0,t.jsx)("div",{className:"absolute pointer-events-none z-overlay left-(--tooltip-left) -top-7 -translate-x-1/2","data-allow-inline-style":!0,style:l,children:o}),v[22]=l,v[23]=o,v[24]=s):s=v[24];let w=`${y.x}px`,C=`${x-26}px`;v[25]!==w||v[26]!==C?(c={"--tooltip-left":w,"--tooltip-top":C},v[25]=w,v[26]=C,v[27]=c):c=v[27],v[28]!==g?(u=g&&(0,t.jsx)("span",{className:"rounded-sm px-1 py-px font-semibold",children:g}),v[28]=g,v[29]=u):u=v[29];let _=(0,t.jsx)("div",{className:"absolute pointer-events-none z-overlay left-(--tooltip-left) top-(--tooltip-top) -translate-x-1/2","data-allow-inline-style":!0,style:c,children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm shadow-md border bg-background px-1.5 py-0.5 text-2xs whitespace-nowrap",children:[u,m&&`${m} `,p]})});v[30]!==_||v[31]!==s?(h=(0,t.jsxs)(t.Fragment,{children:[s,_]}),v[30]=_,v[31]=s,v[32]=h):h=v[32],d=h;break e}u=M?(0,n.P)(e,{locale:O,timeZone:T,preset:"numeric"})??"—":(0,n.C)(e,{locale:O,timeZone:T,preset:"medium"})??"—"}v[0]=S,v[1]=y.x,v[2]=_,v[3]=N,v[4]=M,v[5]=O,v[6]=k,v[7]=T,v[8]=j,v[9]=u,v[10]=d}else u=v[9],d=v[10];if(d!==Symbol.for("react.early_return_sentinel"))return d;let R=u,U=y.x>200,$=U?"-translate-x-full":"translate-x-0";v[33]!==$?(h=(0,l.f)("absolute pointer-events-none z-overlay flex items-center gap-2 left-(--tooltip-left) -top-5",$),v[33]=$,v[34]=h):h=v[34];let z=`${y.x+(U?2.5:-2.5)}px`;return v[35]!==z?(f={"--tooltip-left":z},v[35]=z,v[36]=f):f=v[36],v[37]!==R||v[38]!==U?(m=U&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:R}),v[37]=R,v[38]=U,v[39]=m):m=v[39],v[40]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)("div",{className:"size-1 md:size-2 rounded-full bg-border"}),v[40]=p):p=v[40],v[41]!==R||v[42]!==U?(g=!U&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:R}),v[41]=R,v[42]=U,v[43]=g):g=v[43],v[44]!==g||v[45]!==h||v[46]!==f||v[47]!==m?(x=(0,t.jsxs)("div",{className:h,"data-allow-inline-style":!0,style:f,children:[m,p,g]}),v[44]=g,v[45]=h,v[46]=f,v[47]=m,v[48]=x):x=v[48],x}])},695880,e=>{"use strict";var t=e.i(659350),r=e.i(782143),n=e.i(297510),i=e.i(368174),a=e.i(288265),l=e.i(16043),o=e.i(527629),s=e.i(968416),c=e.i(590387),u=e.i(699707),d=e.i(503608),h=e.i(364029),f=e.i(663673),m=e.i(569284),p=e.i(804599),g=e.i(836466),x=e.i(760638),v=e.i(136562),y=e.i(885024),b=e.i(315368);let w=[.1431,.1483,.1525,.1515,.1484,.1257,.1305];var k=e.i(535072),j=e.i(138257),S=e.i(304903),M=e.i(261499),C=e.i(522396),N=e.i(860674),O=e.i(82224),T=e.i(397618),_=e.i(70294),L=e.i(707951),R=e.i(775922),U=e.i(336810),$=e.i(530685);function z(e){return Object.values(e).reduce((e,t)=>e+t,0)}function A(e){let{row:t,allKeys:r,project:n}=e;return{[U.l]:t.x,...Object.fromEntries([...r].map(e=>[e,n(t.ys[e]??0)]))}}function P(e,t){return e.map(e=>Object.entries(e.ys).reduce((e,[r,n])=>t?.has(r)?e:e+n,0))}function E(e,t){let r=P(e,t).filter(e=>e>0);return 0===r.length?1:10**Math.floor(Math.log10(Math.min(...r)))}let F={fill:"currentColor",className:"text-muted"},I={" ":.171,",":.285,".":.301,":":.301,"-":.515,"'":.256,"%":.986,0:.6,1:.6,2:.6,3:.6,4:.6,5:.6,6:.6,7:.6,8:.6,9:.6,a:.573,b:.668,c:.601,d:.668,e:.615,f:.395,g:.66,h:.576,i:.233,j:.233,k:.553,l:.233,m:.911,n:.576,o:.655,p:.668,q:.668,r:.344,s:.51,t:.392,u:.576,v:.525,w:.811,x:.499,y:.544,z:.454,A:.662,B:.694,C:.78,D:.742,E:.609,F:.582,G:.819,H:.736,I:.26,J:.385,K:.658,L:.533,M:.846,N:.737,O:.878,P:.644,Q:.878,R:.644,S:.646,T:.517,U:.703,V:.66,W:.99,X:.608,Y:.629,Z:.582},D=[3,3,0,0],H=(0,N.f)("tabular-nums"),Y=(0,N.f)();function V(e,{locale:t,isPercentage:i}){return i?`${(0,n.I)(e,{locale:t,preset:"native-fixed-1"})??"—"}`:(0,r.f)(e,{locale:t,preset:"compact-chart-thousands"})??"—"}e.s(["StackedBarChart",0,function({data:e,colors:N=U.N,height:W=U.i,barSize:B=50,maxBarSize:X,hideZeroTotalTooltip:q=!1,yAxisLabel:K,yAxisLabelClassName:G,yAxisHidden:Q,yAxisWidth:Z,yAxisMaxOnly:J,yAxisRightSide:ee,onClick:et,onBarClick:er,getIsSeriesClickable:en,onLabel:ei,onTooltipLabel:ea,onIcon:el,isPercentage:eo=!1,hiddenSeries:es,highlight:ec,forecast:eu,forecastFromTimestamp:ed,isAnimationActive:eh=!1,legendConfig:ef,"data-testid":em,displayTimezone:ep="local",tooltipTotalConfig:eg,roundedBars:ex=!1,valueFormatter:ev,yAxisTickFormatter:ey,referenceArea:eb,referenceLine:ew,xAxisTickFormatter:ek,colorMapping:ej,showPercentage:eS,showLogScaleToggle:eM=!1,headerControl:eC,allowTooltipToRight:eN=!1,useRichTooltip:eO=!1,renderBarHoverContent:eT,getSegmentFill:e_,shouldHighlightHoveredSeries:eL=!1}){var eR;let eU=(0,S.P)(ep),e$=(0,a.f)(),ez=(0,j.useLocale)(),[eA,eP]=(0,l.useState)(null),[eE,eF]=(0,l.useState)(null),[eI,eD]=(0,l.useState)(),[eH,eY]=(0,l.useState)(!1),eV=ec??eI,eW=(0,l.useDeferredValue)(eV),eB=(0,l.useDeferredValue)(eA),eX=eS??eo,eq=function({yAxisWidth:e,yAxisLabel:t}){return void 0!==e?e:t?72:void 0}({yAxisWidth:Z,yAxisLabel:K}),eK=(0,k.x)(),{containerRef:eG,containerWidth:eQ,tooltipWrapperStyle:eZ,tooltipContentClassName:eJ,tooltipAllowEscapeViewBox:e0}=(0,O.f)({enabled:eN&&eK,hasBlockingLegend:void 0!==ef}),e1=(0,l.useMemo)(()=>ev??(e=>V(e,{locale:ez,isPercentage:eX})),[ez,ev,eX]),e2=ef?.position==="right"&&eK,e3=(0,l.useMemo)(()=>new Set(e.flatMap(e=>Object.keys(e.ys))),[e]),e6=(0,l.useMemo)(()=>{var t;return eX?e.map(e=>{let t=z(e.ys);return A({row:e,allKeys:e3,project:e=>t>0?e/t*100:0})}):eu?(t=function({data:e,rollup:t,forecastFromTimestamp:r}){if(0===e.length)return[];let n=r?new Date(r):new Date,i=[];for(let r of e){let a={x:r.x,ys:{...r.ys}};if(!function(e,t){if(0===e.length)return!1;let r=(0,b.I)(e.at(-1)?.x||""),n=(0,b.I)(t.x);return r.getTime()===n.getTime()}(e,r)||!function({dataPointX:e,now:t,rollup:r}){let n=(0,b.I)(e);switch(r){case y.n.OneMinute:return n.getUTCFullYear()===t.getUTCFullYear()&&n.getUTCMonth()===t.getUTCMonth()&&n.getUTCDate()===t.getUTCDate()&&n.getUTCHours()===t.getUTCHours()&&n.getUTCMinutes()===t.getUTCMinutes();case y.n.OneHour:return n.getUTCFullYear()===t.getUTCFullYear()&&n.getUTCMonth()===t.getUTCMonth()&&n.getUTCDate()===t.getUTCDate()&&n.getUTCHours()===t.getUTCHours();case y.n.OneDay:return n.getUTCFullYear()===t.getUTCFullYear()&&n.getUTCMonth()===t.getUTCMonth()&&n.getUTCDate()===t.getUTCDate();case y.n.OneWeek:{let e=e=>{let t=e.getUTCDay();return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+(0===t?-6:1-t))};return e(n)===e(t)}case y.n.OneMonth:return n.getUTCFullYear()===t.getUTCFullYear()&&n.getUTCMonth()===t.getUTCMonth();default:return!1}}({dataPointX:r.x,now:n,rollup:t})){i.push(a);continue}let l=function(e,t){switch(t){case y.n.OneMinute:return 60/Math.max(1,e.getUTCSeconds());case y.n.OneHour:return 60/Math.max(1,e.getUTCMinutes());case y.n.OneDay:return 24/Math.max(1,e.getUTCHours());case y.n.OneWeek:{let t=(e.getUTCDay()||7)-1,r=e.getUTCHours()/24,n=0;for(let e=0;ee+t,0),s=e.findIndex(e=>e.x===r.x),c=s>0?e[s-1]:null,u=c?Object.values(c.ys).reduce((e,t)=>e+t,0):o,d=o*(l-1),h=Math.min(d,1.1*u);o>u&&u>0?a.forecast={total:d}:h>0&&(a.forecast={total:h}),i.push(a)}return i}({data:e,rollup:eu,forecastFromTimestamp:ed}),t.map(e=>{let t={__RECHARTS_X_LABEL__:e.x};if(Object.assign(t,e.ys),void 0!==e.forecast){let r="number"==typeof e.forecast?e.forecast:Object.values(e.forecast).reduce((e,t)=>e+t,0);r>0&&(t[eu]=r)}return t})):e.map(e=>A({row:e,allKeys:e3,project:e=>e}))},[e,eX,eu,ed,e3]),e4=(0,l.useMemo)(()=>{if(!eH||eX)return e6;let t=E(e,es),r=eu?[...e3,eu]:[...e3];return e6.map(e=>(function({entry:e,seriesKeys:t,lowerBound:r,hiddenSeries:n}){let i=t.flatMap(t=>{let r=e[t];return"number"!=typeof r||n?.has(t)?[]:[[t,r]]}),a=i.reduce((e,[,t])=>e+t,0);if(a<=r)return e;let l=a/r,o={...e},s=0,c=0;for(let[e,t]of i){s+=t;let n=r*l**(s/a);o[e]=n-c,c=n}return o})({entry:e,seriesKeys:r,lowerBound:t,hiddenSeries:es}))},[e6,eH,eX,e,es,e3,eu]),e5=(0,l.useMemo)(()=>(function(e){let{data:t,isPercentage:r,yAxisMaxOnly:n}=e;return n&&0!==t.length?r?100:Math.max(...t.map(e=>z(e.ys))):0})({data:e,isPercentage:eX,yAxisMaxOnly:J??!1}),[e,eX,J]),e7=(0,l.useMemo)(()=>{let t,r,n;return eH?(t=E(e,es),r=Math.max(0,...P(e,es)),Array.from({length:Math.max(n=Math.round(Math.log10(t)),Math.ceil(Math.log10(r)))-n+1},(e,t)=>10**(n+t))):void 0},[eH,e,es]),e8=(0,l.useMemo)(()=>{if(ej)return ej;if(!e||0===e.length)return new Map;let t=[...new Set(e.flatMap(e=>Object.keys(e.ys)))],r=new Map;return t.forEach((e,t)=>{r.set(e,N[t%N.length]||U.F.Slate400)}),r},[e,N,ej]),e9=(0,l.useMemo)(()=>{if(!e||0===e.length||void 0===ef)return new Map;let t=new Map;return e.forEach(e=>{let r=Object.values(e.ys).reduce((e,t)=>e+t,0),n=Object.entries(e.ys).map(([e,t])=>({name:e,value:t,percentage:r>0?t/r*100:0,color:e8.get(e)||U.F.Slate400})),i=n.findIndex(e=>"others"===e.name.toLowerCase()),a=-1!==i?n.splice(i,1)[0]:void 0;n.sort((e,t)=>(t.value??-1/0)-(e.value??-1/0)),a&&n.push(a),t.set(e.x,n)}),t},[e,e8,ef]),te=(0,l.useMemo)(()=>{if(void 0===ef)return[];let t=[];if(eB)t=e9.get(eB.x)||[];else if(e&&e.length>0){let r=e.at(-1);t=e9.get(r.x)||[]}return void 0!==ef.maxItems&&t.length>ef.maxItems?t.slice(0,ef.maxItems):t},[eB,e9,e,ef]),tt=(0,l.useCallback)(e=>{eP(e)},[]),tr=(0,l.useRef)(new Set),tn=(0,l.useCallback)(e=>{tr.current.add(e),(void 0!==eT||eL)&&eF(e)},[eT,eL]),ti=(0,l.useCallback)(e=>{tr.current.delete(e),(void 0!==eT||eL)&&eF(t=>t===e?null:t)},[eT,eL]),ta=(0,l.useCallback)(e=>{void 0===ec&&eD(e)},[ec]),tl=(0,l.useCallback)(()=>{void 0===ec&&eD(void 0)},[ec]),to=(0,l.useMemo)(()=>ex?function(e){let{rows:t,allKeys:r,hiddenSeries:n}=e,i=[...r].reverse().filter(e=>!n?.has(e)),a=new Map;for(let e of t){let t=e[U.l];if("string"!=typeof t&&"number"!=typeof t)continue;let r=i.find(t=>{let r=e[t];return"number"==typeof r&&r>0});void 0!==r&&a.set(t,r)}return a}({rows:e6,allKeys:e3,hiddenSeries:es}):new Map,[ex,e3,e6,es]),ts=!e6.some(e=>Object.values(e).some(Boolean)),tc=(0,l.useMemo)(()=>eu?`${eu}:${[...e3].join("\0")}`:void 0,[e3,eu]),{containsMultipleYears:tu,containsMultipleDays:td,isHighRes:th}=(0,l.useMemo)(()=>{let t=e.map(e=>e.x);return(0,U.D)(e6,t)},[e6,e]),tf=(0,l.useCallback)((e,t)=>th?(0,b.M)(ez,{value:e,shouldIncludeDay:td,timeZone:eU}):(0,b.$)(ez,e,tu&&0===t),[th,td,tu,ez,eU]),tm=void 0===eq?-18:0,tp=(eR=!!(K||Q),ee?eR?5:48:eR?32:5),tg=(0,l.useMemo)(()=>({left:tp,right:5}),[tp]),tx=ek??tf,tv=(0,l.useMemo)(()=>(function({labels:e,plotWidth:t,padding:r,fontSize:n,minTickGap:i}){let a=e.length;if(0===a||!Number.isFinite(t)||t<=0)return;let l=(t-r.left-r.right)/a,o=e.map((e,t)=>({coordinate:r.left+l*(t+.5),halfWidth:[...e].reduce((e,t)=>e+(I[t]??1)*n*1.07,0)/2}));for(let e=1;e<=a;e++)if(function({step:e,ticks:t,plotWidth:r,minTickGap:n}){let i=0;for(let[a,{coordinate:l,halfWidth:o}]of t.filter((t,r)=>r%e==0).entries()){let e=l-o>=i&&l+o<=r;if(a>0&&!e)return!1;i=l+o+n}return!0}({step:e,ticks:o,plotWidth:t,minTickGap:i}))return e-1;return a-1})({labels:e4.map((e,t)=>tx(String(e[U.l]),t)),plotWidth:Math.round(eQ)-tm-(Q?0:eq??60),padding:tg,fontSize:12,minTickGap:32}),[e4,tx,eQ,tm,Q,eq,tg]),ty=Math.ceil(te.length/2),tb=te.slice(0,ty),tw=te.slice(ty),tk=(0,l.useMemo)(()=>ts?null:(0,t.jsx)(m.$,{ref:eG,width:"100%",height:W,className:"relative z-10 w-full [&_svg]:outline-hidden",children:(0,t.jsxs)(u.f,{data:e4,className:"group",margin:{top:12*!Q,left:tm},barSize:void 0===X?B:void 0,maxBarSize:X,onMouseMove:(t,r)=>{t?.activeLabel&&tt(e.find(e=>e.x===t.activeLabel)||null)},onTouchMove:(t,r)=>{t?.activeLabel&&tt(e.find(e=>e.x===t.activeLabel)||null)},onMouseLeave:()=>{(ef?.dismissTooltipOnLeave||eO)&&tt(null)},children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("pattern",{id:"forecastStripes",patternUnits:"userSpaceOnUse",width:"6",height:"6",patternTransform:"rotate(45)",children:[(0,t.jsx)("rect",{width:"6",height:"6",className:"fill-chart-tokens-uncached"}),(0,t.jsx)("rect",{width:"3",height:"6",className:"fill-background",fillOpacity:"0.15"})]})}),(0,t.jsx)("style",{children:` @keyframes glowPulse { 0% { opacity: 0.7; } 50% { opacity: 0.9; } 100% { opacity: 0.7; } } .forecast-bar { transition: opacity 0.3s ease-in-out; opacity: 0.8; } .forecast-bar:hover { animation: glowPulse 3s ease-in-out infinite; } `}),(0,t.jsx)(g.f,{dataKey:U.l,padding:tg,fontSize:12,tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:32,tick:void 0!==tv&&H,interval:tv,tickFormatter:tx}),(0,t.jsx)(x.f,{hide:Q,width:eq,fontSize:12,orientation:ee?"right":void 0,tickLine:!1,axisLine:!1,scale:eH?"log":"auto",allowDataOverflow:eH||void 0,ticks:e7??(J?[0,e5]:void 0),tick:Y,interval:e7?"preserveEnd":0,padding:J?{top:15}:void 0,tickFormatter:e=>J||0!==e?eX?(0,n.I)(Math.round(e),{locale:ez,preset:"fee"})??"—":ey?.(Number(e))??(0,r.f)(e,{locale:ez,preset:"compact-rounded-thousands"})??"—":"",domain:e7?[e7[0],e7.at(-1)]:eX?[0,100]:J&&void 0!==e5?[0,e5]:void 0,className:(0,v.f)(K?"origin-left translate-x-4 md:translate-x-6 text-xs":""),children:K&&(0,t.jsx)(c.Q,{value:K,angle:-90,position:"insideLeft",offset:-10,className:(0,v.f)("fill-muted-foreground text-xs [text-anchor:middle]",G)})}),(0,t.jsx)(p.f,{active:void 0!==ef&&!ef.dismissTooltipOnLeave&&!eO||void 0,isAnimationActive:!1,wrapperStyle:eZ,allowEscapeViewBox:e0,cursor:!eL&&e6.length>1&&F,content:e=>{if(!e.active||!e.payload||ef?.hideTooltip||q&&!e.payload.some(e=>"number"==typeof e.value&&e.value>0))return null;if(void 0!==eT&&null!==eE&&"string"==typeof e.label){let t=eT({x:e.label,seriesKey:eE});if(null!==t)return t}let r=eH?e6.find(t=>t[U.l]===e.label):void 0,n=e.payload.map(e=>{let t=r&&"string"==typeof e.dataKey?r[e.dataKey]:void 0;return"number"==typeof t?{...e,value:t}:e});return void 0===ef||eO?(0,t.jsx)(_.f,{...e,payload:n,shouldShowTime:th,displayTimezone:ep,wrapperClassName:(0,v.f)(e.wrapperClassName,eJ),onLabel:ea??ei,sortOrder:_.g.Descending,highlightedRef:tr,forecast:eu,valueFormatter:e1,...eO?{maxItems:Math.max(1,Math.floor((W-_.b)/_.U))}:{}}):(0,t.jsx)($.f,{...e,payload:n,totalConfig:eg,chartHeight:W,isHighRes:th,displayTimezone:ep})}}),[...e3].map(e=>(0,t.jsx)(o.e,{hide:es?es.has(e):void 0,onClick:t=>{if(en?.(e)===!1)return;et?.(e);let r=t?.payload,n=r?.[U.l];"string"==typeof n&&er?.({x:n,seriesKey:e})},onMouseEnter:()=>tn(e),onMouseLeave:()=>ti(e),className:(0,v.f)(M.m,eL&&null!==eE?(0,U.I)(eE===e):[void 0!==eW&&(0,U.I)(eW===e),"group-hover:opacity-100 group-hover:hover:opacity-80"],(!!et||!!er)&&en?.(e)!==!1&&"cursor-pointer"),dataKey:e,fill:(0,L.F)(e,e8),stackId:"a",isAnimationActive:eh,shape:ex?function({barKey:e,topBarKeyByX:r,xLabelKey:n}){return function(a){let l=(0,i.f)(a.payload)?a.payload:void 0,o=l?.[n],s=("string"==typeof o||"number"==typeof o)&&r.get(o)===e;return(0,t.jsx)(d.f,{...a,radius:s?D:0})}}({barKey:e,topBarKeyByX:to,xLabelKey:U.l}):void 0,children:void 0!==e_&&e4.map(r=>{let n=String(r[U.l]);return(0,t.jsx)(s.f,{fill:e_({x:n,seriesKey:e})??(0,L.F)(e,e8),stroke:"var(--color-card)",strokeWidth:1},n)})},e)),eu&&(0,t.jsx)(o.e,{hide:!1,className:"forecast-bar",dataKey:eu,fill:"url(#forecastStripes)",stackId:"a",isAnimationActive:eh},tc),ew&&(0,t.jsx)(f.f,{y:ew.y,stroke:"currentColor",strokeDasharray:"3 3",className:"text-muted-foreground",ifOverflow:"extendDomain"}),eb&&(0,t.jsx)(h.f,{x1:eb.x1,x2:eb.x2,fill:"currentColor",fillOpacity:.12,stroke:"none",ifOverflow:"visible"})]})}),[ez,e3,B,X,q,e8,N,eG,ex,to,td,tu,e,ep,eu,tc,b.$,b.M,U.I,tt,tn,ti,ts,W,es,eW,tr,eh,th,eX,en,et,er,ei,ea,U.l,e6,e4,tm,tg,tv,tf,ef,e1,K,G,Q,eq,ey,J,ee,e5,eb,ew,ek,eg,eH,e7,e0,eJ,eZ,eO,eT,e_,eE,eL,eU]),tj=eM||eC?(0,t.jsxs)("div",{className:"flex items-center gap-2 self-end",children:[eC,eM&&(0,t.jsxs)(C.c,{"aria-label":e$("Y-axis scale"),size:"sm",value:eH?"log":"linear",onValueChange:e=>{eY("log"===e)},children:[(0,t.jsx)(C.Y,{value:"linear",children:e$("Linear")}),(0,t.jsx)(C.Y,{value:"log",children:e$("Log")})]})]}):null;if(ts)return tj?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[tj,(0,t.jsx)(R.f,{height:W})]}):(0,t.jsx)(R.f,{height:W});let tS=tj?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[tj,tk]}):tk;if(void 0===ef)return em?(0,t.jsx)("div",{"data-testid":em,className:"contents",children:tS}):tS;let tM=e2||ef?.forceSingleColumn,tC=!!el,tN=(0,v.f)("grid grid-cols-1 md:grid-cols-2 gap-5",tC?"md:gap-20":"md:gap-16"),tO=te.length>0&&(0,t.jsxs)("div",{className:(0,v.f)("flex flex-col gap-5",e2?"w-64 shrink-0 pb-8":!ef?.forceSingleColumn&&!tC&&"px-2 md:px-16"),children:[(0,t.jsx)("div",{className:(0,v.f)(tM?"flex flex-col gap-3":tN),children:tM?te.map((e,r)=>(0,t.jsx)(T.f,{data:e,index:r,offset:1,onLabel:ei,onIcon:el,isHighlighted:void 0===eV?void 0:eV===e.name,onMouseEnter:()=>ta(e.name),onMouseLeave:tl,isRanking:ef?.isRanking??!0,showPercentage:ef?.showPercentage??!0,valueFormatter:ef?.valueFormatter},e.name)):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex flex-col gap-y-5",children:tb.map((e,r)=>(0,t.jsx)(T.f,{data:e,index:r,offset:1,onLabel:ei,onIcon:el,isHighlighted:void 0===eV?void 0:eV===e.name,onMouseEnter:()=>ta(e.name),onMouseLeave:tl,isRanking:ef?.isRanking??!0,showPercentage:ef?.showPercentage??!0,valueFormatter:ef?.valueFormatter},e.name))}),(0,t.jsx)("div",{className:"flex flex-col gap-y-5",children:tw.map((e,r)=>(0,t.jsx)(T.f,{data:e,index:r,offset:ty+1,onLabel:ei,onIcon:el,isHighlighted:void 0===eV?void 0:eV===e.name,onMouseEnter:()=>ta(e.name),onMouseLeave:tl,isRanking:ef?.isRanking??!0,showPercentage:ef?.showPercentage??!0,valueFormatter:ef?.valueFormatter},e.name))})]})}),ef?.description&&(0,t.jsx)("p",{className:"text-muted-foreground text-sm pt-3",children:ef.description})]});return(0,t.jsxs)("div",{"data-testid":em,className:(0,v.f)("relative",e2?"flex flex-row gap-6 items-center":"flex flex-col gap-10"),children:[(0,t.jsx)("div",{className:e2?"flex-1 min-w-0":void 0,children:tS}),tO]})},"TEST_formatDefaultTooltipValue",0,V],695880)},860674,82224,e=>{"use strict";var t=e.i(659350),r=e.i(261019),n=e.i(136562);e.s(["f",0,function(e){return({payload:i,index:a,tickFormatter:l,...o})=>(0,t.jsx)(r.f,{...o,className:(0,n.f)("recharts-cartesian-axis-tick-value",e),width:void 0,children:String(l?l(i.value,a):i.value)})}],860674);var i=e.i(663456),a=e.i(16043),l=e.i(336810);e.s(["f",0,function(e){let t,r,n,o,s,c,u,d,h=(0,i.c)(18),{enabled:f,hasBlockingLegend:m}=e,p=void 0!==m&&m;h[0]===Symbol.for("react.memo_cache_sentinel")?(t={containerWidth:0,spaceOnRight:0},h[0]=t):t=h[0];let[g,x]=(0,a.useState)(t),v=(0,a.useRef)(null),y=(0,a.useRef)(null);h[1]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{if(y.current=e,!e){let e=v.current;e&&queueMicrotask(()=>{v.current===e&&null===y.current&&(e.disconnect(),v.current=null)});return}if(v.current?.element!==e){var t;let r,n;v.current?.disconnect(),v.current={element:e,disconnect:(t=e=>{x(t=>t.containerWidth===e.containerWidth&&t.spaceOnRight===e.spaceOnRight?t:e)},r=()=>{let r=e.getBoundingClientRect();t({containerWidth:r.width,spaceOnRight:window.innerWidth-r.right})},(n="u"{n?.disconnect(),window.removeEventListener("resize",r)})}}},h[1]=r):r=h[1];let b=r;h[2]===Symbol.for("react.memo_cache_sentinel")?(n=()=>()=>{v.current?.disconnect(),v.current=null},o=[],h[2]=n,h[3]=o):(n=h[2],o=h[3]),(0,a.useEffect)(n,o),h[4]!==f||h[5]!==p||h[6]!==g?(s=function({enabled:e,spaceOnRight:t,containerWidth:r,hasBlockingLegend:n=!1}){return e&&!n&&r>0&&t>=24+l.U+8}({enabled:f,hasBlockingLegend:p,...g}),h[4]=f,h[5]=p,h[6]=g,h[7]=s):s=h[7];let w=s;h[8]!==g.containerWidth||h[9]!==w?(c=function({containerWidth:e,shouldUseRightPlacement:t}){return t?{zIndex:10,position:"absolute",left:e+24,top:16,width:"max-content",transform:"none",transition:"none"}:{zIndex:10}}({containerWidth:g.containerWidth,shouldUseRightPlacement:w}),h[8]=g.containerWidth,h[9]=w,h[10]=c):c=h[10];let k=c,j=w?"absolute left-0 top-0":void 0;h[11]!==w?(u={x:w,y:w},h[11]=w,h[12]=u):u=h[12];let S=u;return h[13]!==g.containerWidth||h[14]!==S||h[15]!==j||h[16]!==k?(d={containerRef:b,containerWidth:g.containerWidth,tooltipWrapperStyle:k,tooltipContentClassName:j,tooltipAllowEscapeViewBox:S},h[13]=g.containerWidth,h[14]=S,h[15]=j,h[16]=k,h[17]=d):d=h[17],d}],82224)},707951,e=>{"use strict";var t=e.i(336810);e.s(["Y",0,function(e,r=t.N){let n=e.filter(e=>"Others"!==e).sort(),i=new Map;return n.forEach((e,n)=>{i.set(e,r[n%r.length]??t.F.Slate400)}),e.includes("Others")&&i.set("Others",t.F.Slate400),i},"F",0,function(e,r,n=t.F.Slate400){return r.get(e)??n}])},623578,136968,481914,e=>{"use strict";var t=e.i(659350),r=e.i(663456),n=e.i(16043);let i={CopyImage:"copy_image",Download:"download",CopyLink:"copy_link",PostOnX:"post_on_x",PostOnLinkedIn:"post_on_linkedin",NativeShare:"native_share"},a=[i.CopyImage,i.Download,i.CopyLink,i.PostOnX,i.NativeShare],l={Dialog:"dialog",Menu:"menu",Inline:"inline"},o={Card:"card",Surface:"surface"};e.s(["u",0,i,"H",0,o,"h",0,l,"W",0,a],136968);var s=e.i(535072),c=e.i(199168),u=e.i(80676),d=e.i(217411),h=e.i(10460),f=e.i(725622),m=e.i(621591),p=e.i(651681);let g={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};g.node;let x=(0,p.f)(g);var v=e.i(136562),y=e.i(139697);function b(e){let n,i,a=(0,r.c)(3),{className:l}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"}),a[0]=n):n=a[0],a[1]!==l?(i=(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,className:l,children:n}),a[1]=l,a[2]=i):i=a[2],i}function w(e){let n,a,l,o,s,u,d,p=(0,r.c)(24),{share:g,layout:w}=e,k=(0,c.o)(),j=null!==g.previewUrl;if(p[0]!==k||p[1]!==j||p[2]!==w||p[3]!==g){s=Symbol.for("react.early_return_sentinel");e:{let e,r,c,u,d;p[9]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(h.f,{className:"size-4"}),p[9]=e):e=p[9];let S={action:i.CopyImage,label:k("Copy image"),icon:e,disabled:!j},M=g.canNativeShare?{action:i.NativeShare,label:k("Share"),icon:(0,t.jsx)(x,{className:"size-4"})}:null,C=M??S;p[10]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(b,{}),p[10]=r):r=p[10],p[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(m.f,{className:"size-4"}),p[11]=c):c=p[11],p[12]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(f.f,{className:"size-4"}),p[12]=u):u=p[12];let N=[{action:i.PostOnX,label:k("Post on X"),icon:r},...M?[S]:[],{action:i.CopyLink,label:k("Copy link"),icon:c},{action:i.Download,label:k("Download"),icon:u,disabled:!j}],O=N.length%2==1;p[13]!==g?(d=e=>()=>void g.run(e),p[13]=g,p[14]=d):d=p[14];let T=d;if("row"===w){s=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:[C,...N].map(e=>(0,t.jsxs)(y.Button,{size:"sm",variant:e===C?"default":"outline",disabled:e.disabled,onClick:T(e.action),children:[e.icon,e.label]},e.action))});break e}l="flex flex-col gap-2",o=(0,t.jsxs)(y.Button,{variant:"default",className:"w-full",disabled:C.disabled,onClick:T(C.action),children:[C.icon,C.label]});let _=O&&"sm:grid-cols-3";p[15]!==_?(n=(0,v.f)("grid grid-cols-2 gap-2",_),p[15]=_,p[16]=n):n=p[16],a=N.map((e,r)=>(0,t.jsxs)(y.Button,{variant:"outline",className:(0,v.f)(O&&r===N.length-1&&"col-span-2 sm:col-span-1"),disabled:e.disabled,onClick:T(e.action),children:[e.icon,e.label]},e.action))}p[0]=k,p[1]=j,p[2]=w,p[3]=g,p[4]=n,p[5]=a,p[6]=l,p[7]=o,p[8]=s}else n=p[4],a=p[5],l=p[6],o=p[7],s=p[8];return s!==Symbol.for("react.early_return_sentinel")?s:(p[17]!==n||p[18]!==a?(u=(0,t.jsx)("div",{className:n,children:a}),p[17]=n,p[18]=a,p[19]=u):u=p[19],p[20]!==l||p[21]!==o||p[22]!==u?(d=(0,t.jsxs)("div",{className:l,children:[o,u]}),p[20]=l,p[21]=o,p[22]=u,p[23]=d):d=p[23],d)}var k=e.i(41277);function j(e){let i,a,l,o,s,c,u=(0,r.c)(14),{trigger:d,disabled:h,children:f}=e,m=void 0!==h&&h?null:d,[p,g]=(0,n.useState)(0);u[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>(g(M),()=>g(S)),u[0]=i):i=u[0];let x=i;u[1]!==m?(a={trigger:m,onMount:x},u[1]=m,u[2]=a):a=u[2];let v=a;return u[3]!==f?(l=(0,t.jsx)("div",{className:"isolate",children:f}),u[3]=f,u[4]=l):l=u[4],u[5]!==m||u[6]!==p?(o=0===p&&null!==m&&(0,t.jsx)("div",{className:"absolute top-0 right-0 z-above",children:m}),u[5]=m,u[6]=p,u[7]=o):o=u[7],u[8]!==l||u[9]!==o?(s=(0,t.jsxs)("div",{className:"group relative",children:[l,o]}),u[8]=l,u[9]=o,u[10]=s):s=u[10],u[11]!==v||u[12]!==s?(c=(0,t.jsx)(k.o.Provider,{value:v,children:s}),u[11]=v,u[12]=s,u[13]=c):c=u[13],c}function S(e){return e-1}function M(e){return e+1}var C=e.i(670168);function N(e){let n,i,a,l,o=(0,r.c)(26),{share:s,className:u}=e,d=(0,c.o)(),h=s.previewAspectRatio??"16 / 9";if(s.renderError){let e,r,n;return o[0]!==h?(e={"--chart-share-aspect":h},o[0]=h,o[1]=e):e=o[1],o[2]!==u?(r=(0,v.f)("flex aspect-(--chart-share-aspect) items-center justify-center rounded-lg border border-border bg-muted p-4 text-center text-body text-muted-foreground",u),o[2]=u,o[3]=r):r=o[3],o[4]!==s.renderError||o[5]!==e||o[6]!==r?(n=(0,t.jsx)("div",{role:"alert",style:e,"data-allow-inline-style":!0,className:r,children:s.renderError}),o[4]=s.renderError,o[5]=e,o[6]=r,o[7]=n):n=o[7],n}if(!s.previewUrl){let e,r,n;return o[8]!==h?(e={"--chart-share-aspect":h},o[8]=h,o[9]=e):e=o[9],o[10]!==u?(r=(0,v.f)("aspect-(--chart-share-aspect) w-full rounded-lg",u),o[10]=u,o[11]=r):r=o[11],o[12]!==e||o[13]!==r?(n=(0,t.jsx)(C.l,{style:e,"data-allow-inline-style":!0,className:r}),o[12]=e,o[13]=r,o[14]=n):n=o[14],n}let f=s.previewUrl;return o[15]!==d?(n=d("Preview of the chart image"),o[15]=d,o[16]=n):n=o[16],o[17]!==h?(i={"--chart-share-aspect":h},o[17]=h,o[18]=i):i=o[18],o[19]!==u?(a=(0,v.f)("aspect-(--chart-share-aspect) w-full rounded-lg border border-border",u),o[19]=u,o[20]=a):a=o[20],o[21]!==s.previewUrl||o[22]!==n||o[23]!==i||o[24]!==a?(l=(0,t.jsx)("img",{src:f,alt:n,style:i,"data-allow-inline-style":!0,className:a}),o[21]=s.previewUrl,o[22]=n,o[23]=i,o[24]=a,o[25]=l):l=o[25],l}function O(e){let n,i,a,l,o,s,u=(0,r.c)(13);u[0]!==e?({children:i,"aria-label":n,...a}=e,u[0]=e,u[1]=n,u[2]=i,u[3]=a):(n=u[1],i=u[2],a=u[3]);let d=(0,c.o)();return u[4]!==n||u[5]!==d?(l=n??d("Share chart"),u[4]=n,u[5]=d,u[6]=l):l=u[6],u[7]!==i?(o=i??(0,t.jsx)(x,{className:"size-4 opacity-70"}),u[7]=i,u[8]=o):o=u[8],u[9]!==a||u[10]!==l||u[11]!==o?(s=(0,t.jsx)(y.Button,{size:"icon-sm",variant:"ghost",tone:"strong",reveal:"hover","aria-label":l,...a,children:o}),u[9]=a,u[10]=l,u[11]=o,u[12]=s):s=u[12],s}function T(e){let n,i,a,l=(0,r.c)(12),{share:o,disabled:h,children:f}=e,m=(0,c.o)(),p=(0,s.W)();l[0]!==o?(n=(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(N,{share:o}),(0,t.jsx)(w,{share:o,layout:"stack"})]}),l[0]=o,l[1]=n):n=l[1];let g=n;l[2]!==g||l[3]!==m||l[4]!==p||l[5]!==o.isOpen||l[6]!==o.setOpen?(i=p?(0,t.jsxs)(u.N,{open:o.isOpen,onOpenChange:o.setOpen,children:[(0,t.jsx)(u.a,{render:(0,t.jsx)(O,{})}),(0,t.jsxs)(u.d,{className:"max-w-2xl",keepMounted:!1,children:[(0,t.jsx)(u.s,{children:(0,t.jsx)(u.F,{children:m("Share")})}),g]})]}):(0,t.jsxs)(d.j,{open:o.isOpen,onOpenChange:o.setOpen,children:[(0,t.jsx)(d.V,{render:(0,t.jsx)(O,{})}),(0,t.jsxs)(d.U,{side:"bottom",className:"max-h-[85dvh] overflow-y-auto",keepMounted:!1,children:[(0,t.jsx)(d.L,{children:m("Share")}),g]})]}),l[2]=g,l[3]=m,l[4]=p,l[5]=o.isOpen,l[6]=o.setOpen,l[7]=i):i=l[7];let x=i;return l[8]!==f||l[9]!==h||l[10]!==x?(a=(0,t.jsx)(j,{trigger:x,disabled:h,children:f}),l[8]=f,l[9]=h,l[10]=x,l[11]=a):a=l[11],a}var _=e.i(612927),L=e.i(702441);function R(e){let n,i,a,l,o,s,u,d=(0,r.c)(22),{share:h,disabled:f,children:m}=e,p=(0,c.o)();d[0]!==p||d[1]!==h.isOpen?(n=h.isOpen?p("Close"):void 0,d[0]=p,d[1]=h.isOpen,d[2]=n):n=d[2],d[3]!==h?(i=()=>h.setOpen(!h.isOpen),d[3]=h,d[4]=i):i=d[4],d[5]!==h.isOpen?(a=h.isOpen?(0,t.jsx)(_.X,{className:"size-4"}):void 0,d[5]=h.isOpen,d[6]=a):a=d[6],d[7]!==h.isOpen||d[8]!==n||d[9]!==i||d[10]!==a?(l=(0,t.jsx)(O,{"aria-expanded":h.isOpen,"aria-label":n,onClick:i,children:a}),d[7]=h.isOpen,d[8]=n,d[9]=i,d[10]=a,d[11]=l):l=d[11];let g=l;return d[12]!==m||d[13]!==f||d[14]!==g?(o=(0,t.jsx)(j,{trigger:g,disabled:f,children:m}),d[12]=m,d[13]=f,d[14]=g,d[15]=o):o=d[15],d[16]!==f||d[17]!==h?(s=h.isOpen&&!f&&(0,t.jsxs)(L.N,{className:"flex w-full flex-col gap-3 p-3 sm:flex-row sm:items-center",children:[(0,t.jsx)(N,{share:h,className:"sm:w-48 sm:shrink-0"}),(0,t.jsx)(w,{share:h,layout:"row"})]}),d[16]=f,d[17]=h,d[18]=s):s=d[18],d[19]!==o||d[20]!==s?(u=(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[o,s]}),d[19]=o,d[20]=s,d[21]=u):u=d[21],u}var U=e.i(978242);function $(e){let n,i,a=(0,r.c)(3),{className:l}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.14 1.45-2.14 2.94v5.67H9.35V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.73v20.54C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.73V1.73C24 .77 23.2 0 22.22 0z"}),a[0]=n):n=a[0],a[1]!==l?(i=(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,className:l,children:n}),a[1]=l,a[2]=i):i=a[2],i}function z(e){let n,l,o,s,u,d,p,g,v,y,w,k,S,M=(0,r.c)(50),{share:C,disabled:N,actions:T,triggerReveal:_,children:L}=e,R=void 0===T?a:T,z=void 0===_?"hover":_,A=(0,c.o)();M[0]!==R?(n=e=>R.includes(e),M[0]=R,M[1]=n):n=M[1];let P=n,E=null!==C.previewUrl;return M[2]!==z?(l=(0,t.jsx)(U.X,{render:(0,t.jsx)(O,{reveal:z})}),M[2]=z,M[3]=l):l=M[3],M[4]!==L||M[5]!==N||M[6]!==l?(o=(0,t.jsx)(j,{trigger:l,disabled:N,children:L}),M[4]=L,M[5]=N,M[6]=l,M[7]=o):o=M[7],M[8]!==A||M[9]!==E||M[10]!==C||M[11]!==P?(s=P(i.CopyImage)&&(0,t.jsxs)(U.r,{disabled:!E,onClick:()=>void C.run(i.CopyImage),children:[(0,t.jsx)(h.f,{className:"size-4"}),A("Copy image")]}),M[8]=A,M[9]=E,M[10]=C,M[11]=P,M[12]=s):s=M[12],M[13]!==A||M[14]!==E||M[15]!==C||M[16]!==P?(u=P(i.Download)&&(0,t.jsxs)(U.r,{disabled:!E,onClick:()=>void C.run(i.Download),children:[(0,t.jsx)(f.f,{className:"size-4"}),A("Download image")]}),M[13]=A,M[14]=E,M[15]=C,M[16]=P,M[17]=u):u=M[17],M[18]!==C.renderError?(d=C.renderError&&(0,t.jsx)(U.P,{children:(0,t.jsx)(U.B,{role:"alert",children:C.renderError})}),M[18]=C.renderError,M[19]=d):d=M[19],M[20]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(U.U,{}),M[20]=p):p=M[20],M[21]!==A||M[22]!==C||M[23]!==P?(g=P(i.CopyLink)&&(0,t.jsxs)(U.r,{onClick:()=>void C.run(i.CopyLink),children:[(0,t.jsx)(m.f,{className:"size-4"}),A("Copy link")]}),M[21]=A,M[22]=C,M[23]=P,M[24]=g):g=M[24],M[25]!==A||M[26]!==C||M[27]!==P?(v=P(i.PostOnX)&&(0,t.jsxs)(U.r,{onClick:()=>void C.run(i.PostOnX),children:[(0,t.jsx)(b,{className:"size-4"}),A("Post on X")]}),M[25]=A,M[26]=C,M[27]=P,M[28]=v):v=M[28],M[29]!==A||M[30]!==C||M[31]!==P?(y=P(i.PostOnLinkedIn)&&(0,t.jsxs)(U.r,{onClick:()=>void C.run(i.PostOnLinkedIn),children:[(0,t.jsx)($,{className:"size-4"}),A("Post on LinkedIn")]}),M[29]=A,M[30]=C,M[31]=P,M[32]=y):y=M[32],M[33]!==A||M[34]!==C||M[35]!==P?(w=P(i.NativeShare)&&C.canNativeShare&&(0,t.jsxs)(U.r,{onClick:()=>void C.run(i.NativeShare),children:[(0,t.jsx)(x,{className:"size-4"}),A("Share")]}),M[33]=A,M[34]=C,M[35]=P,M[36]=w):w=M[36],M[37]!==g||M[38]!==v||M[39]!==y||M[40]!==w||M[41]!==s||M[42]!==u||M[43]!==d?(k=(0,t.jsxs)(U.L,{align:"end",children:[s,u,d,p,g,v,y,w]}),M[37]=g,M[38]=v,M[39]=y,M[40]=w,M[41]=s,M[42]=u,M[43]=d,M[44]=k):k=M[44],M[45]!==C.isOpen||M[46]!==C.setOpen||M[47]!==k||M[48]!==o?(S=(0,t.jsxs)(U.G,{open:C.isOpen,onOpenChange:C.setOpen,children:[o,k]}),M[45]=C.isOpen,M[46]=C.setOpen,M[47]=k,M[48]=o,M[49]=S):S=M[49],S}var A=e.i(647204),P=e.i(960773),E=e.i(982432);let F={copy_link:"copy_link",post_on_x:"x",post_on_linkedin:"linkedin",native_share:"native"};function I({url:e,action:t,tracking:r}){let n=F[t];if(void 0===r||void 0===n)return e;let i=new URL(e);for(let e of Array.from(i.searchParams.keys()).filter(e=>e.startsWith("utm_")))i.searchParams.delete(e);return i.searchParams.set("utm_source","share"),i.searchParams.set("utm_medium",n),i.searchParams.set("utm_campaign",r.campaign),i.searchParams.set("utm_content",r.content),i.toString()}let D="image/png";async function H(e){let t=globalThis.navigator?.clipboard;if(!t?.write||"u"t.write([new ClipboardItem({[e.type]:e})]));return(0,A.V)(r)?(0,A.Y)("image copy failed"):(0,A.N)(void 0)}async function Y(e){let t=globalThis.navigator?.clipboard;if(!t?.writeText)return(0,A.Y)("text clipboard is unsupported");let r=await (0,A.$)(()=>t.writeText(e));return(0,A.V)(r)?(0,A.Y)("link copy failed"):(0,A.N)(void 0)}async function V(e){let t=globalThis.navigator;if("function"!=typeof t?.share)return(0,A.Y)("native share is unsupported");let r=await (0,A.$)(()=>t.share(e));return(0,A.V)(r)?r.error instanceof DOMException&&"AbortError"===r.error.name?(0,A.N)("dismissed"):(0,A.Y)("native share failed"):(0,A.N)("shared")}function W(e){globalThis.open(e,"_blank","noopener,noreferrer")}let B={kind:"idle",isOpen:!1,aspectRatio:null};function X(e,t){let r="recapture_pending"===e.kind?"recapture_pending":"idle";return e.kind===r&&e.isOpen===t.isOpen&&e.aspectRatio===t.aspectRatio?e:{kind:r,...t}}function q(e){return{isOpen:e.isOpen,aspectRatio:e.aspectRatio}}var K=e.i(337602);let G={width:1200,padding:56,titleFontSize:40,subtitleFontSize:24,footerFontSize:20,lineGap:12,sectionGap:32,footerHeight:36,maxChartHeight:560,logoHeight:28};function Q(e,{maxWidth:t,measure:r}){let n=e.trim().split(/\s+/).filter(Boolean),i=[];for(let e of n){let n=i.at(-1);if(void 0===n){i.push(e);continue}let a=`${n} ${e}`;r(a)<=t?i[i.length-1]=a:i.push(e)}return i}function Z(e){return new Promise(t=>{let r=new FileReader;r.onload=()=>t("string"==typeof r.result?r.result:null),r.onerror=()=>t(null),r.readAsDataURL(e)})}let J=/url\((['"]?)([^'")]+)\1\)/g,ee=new Map;async function et(e){var t;let r=function(e){let t=new Set;for(let r of[e,...e.querySelectorAll("*")])for(let e of globalThis.getComputedStyle(r).getPropertyValue("font-family").split(",")){let r=ei(e);""!==r&&t.add(r)}return t}(e);if(0===r.size)return"";let n=(await Promise.all(Array.from((t=globalThis.document).styleSheets).flatMap(e=>(function e(t,r){return t.flatMap(t=>{var n;return t instanceof CSSFontFaceRule?[{rule:t,baseUrl:r}]:(n=t)instanceof CSSGroupingRule||n instanceof CSSMediaRule||n instanceof CSSSupportsRule?e(Array.from(t.cssRules),r):[]})})(function(e){try{return Array.from(e.cssRules)}catch{return[]}}(e),e.href??t.baseURI)).filter(({rule:e})=>r.has(ei(e.style.getPropertyValue("font-family")))).map(({rule:e,baseUrl:t})=>er(e.cssText,t)))).filter(e=>null!==e).join("\n");return""===n?"":``}async function er(e,t){let r=Array.from(e.matchAll(J),e=>e[2]??""),n=await Promise.all(r.map(e=>(function(e,t){if(e.startsWith("data:"))return Promise.resolve(e);let r=function(e,t){try{return new URL(e,t).href}catch{return null}}(e,t);if(null===r)return Promise.resolve(null);let n=ee.get(r);if(void 0!==n)return n;let i=en(r).then(e=>(null===e&&ee.delete(r),e));return ee.set(r,i),i})(e,t)));if(n.some(e=>null===e))return null;let i=0;return e.replaceAll(J,()=>`url(${n[i++]??""})`)}async function en(e){try{let t=await fetch(e,{signal:AbortSignal.timeout(5e3)});if(!t.ok)return await t.body?.cancel(),null;return await Z(await t.blob())}catch{return null}}function ei(e){return e.trim().replaceAll(/^['"]|['"]$/g,"")}let ea="http://www.w3.org/2000/svg",el=["fill","fill-opacity","stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-linecap","stroke-linejoin","opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline","letter-spacing","color","visibility","display","transform","transform-origin","translate"],eo=["display","visibility","position","top","left","right","bottom","width","height","min-width","min-height","max-width","flex","flex-direction","flex-wrap","align-items","justify-content","gap","grid-template-columns","grid-column","padding","margin","border","border-radius","background-color","background-image","color","opacity","overflow","font-family","font-size","font-weight","line-height","letter-spacing","text-align","text-overflow","white-space","overflow-wrap","word-break","line-clamp","-webkit-line-clamp","-webkit-box-orient","transform","translate","rotate","scale","box-sizing","object-fit","list-style-type"],es="data-chart-share-surface",ec=new Set(["style","class","src","href","alt"]);function eu(e){let t=e.querySelector(`svg.recharts-surface, [${es}]`);return t instanceof SVGSVGElement||t instanceof HTMLElement?t:null}let ed=".recharts-tooltip-cursor, .recharts-active-bar",eh=new Set(["d","x","y","x1","y1","x2","y2","dx","dy","width","height","cx","cy","r","rx","ry","points","transform","viewBox","href","clip-path","fill","stroke","stroke-width","stroke-dasharray","font-size","font-weight","text-anchor","dominant-baseline","stop-color","stop-opacity","patternUnits","patternTransform"]),ef=new Set([...eh,...ec]);function em(e){let t=e.cloneNode(!0);if(!(t instanceof Element))return"";for(let e of t.querySelectorAll(ed))e.remove();let r="svg"===t.localName?eh:ef;for(let e of[t,...t.querySelectorAll("*")]){let t=eC(e)?ec:r;for(let r of e.getAttributeNames())t.has(r)||e.removeAttribute(r)}return new XMLSerializer().serializeToString(t)}function ep(e){let t=e.getBoundingClientRect(),r=e instanceof HTMLElement?Math.round(Math.max(t.width,e.scrollWidth)):Math.round(t.width||Number(e.getAttribute("width"))||0),n=e instanceof HTMLElement?Math.round(Math.max(t.height,e.scrollHeight)):Math.round(t.height||Number(e.getAttribute("height"))||0);return r<=0||n<=0?(0,A.Y)("chart has no size"):(0,A.N)({width:r,height:n})}async function eg(e,{inset:t=0}={}){let r=ep(e);if((0,A.V)(r))return r;let{width:n,height:i}=r.data;if(e instanceof HTMLElement)return ev({element:e,width:n,height:i,inset:t});let a=e.cloneNode(!0);if(!(a instanceof SVGSVGElement))return(0,A.Y)("chart svg could not be cloned");for(let t of(eO({source:e,target:a}),await ey(e,a),a.querySelectorAll(ed)))t.remove();return a.setAttribute("xmlns",ea),a.setAttribute("width",String(n)),a.setAttribute("height",String(i)),a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${n} ${i}`),(0,A.N)({markup:new XMLSerializer().serializeToString(a),width:n,height:i})}function ex(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}async function ev({element:e,width:t,height:r,inset:n}){var i;let a,l,o,s=e.cloneNode(!0);if(!(s instanceof HTMLElement))return(0,A.Y)("chart html could not be cloned");eO({source:e,target:s,declarationsFor:ej});let c=await et(e);for(let t of(await ey(e,s),s.querySelectorAll("[data-chart-share-exclude]")))t instanceof HTMLElement&&(t.style.opacity="0");let u=t+(i=e,a="[data-chart-share-expand]",l=Array.from(s.querySelectorAll(a)),o=0,Array.from(i.querySelectorAll(a)).forEach((e,t)=>{let r=l[t];e instanceof HTMLElement&&r instanceof HTMLElement&&(o=Math.max(o,e.scrollWidth-e.clientWidth),r.style.width=`${e.scrollWidth}px`,r.style.overflow="visible")}),o);s.style.width=`${u}px`,s.style.height=`${r}px`,s.style.maxHeight="none",s.style.overflow="visible",s.style.margin=`${n}px`,s.setAttribute("xmlns","http://www.w3.org/1999/xhtml");let d=new XMLSerializer().serializeToString(s),h=u+2*n,f=r+2*n,m=`${c}${d}`;return(0,A.N)({markup:m,width:h,height:f})}async function ey(e,t){let r=Array.from(e.querySelectorAll("img")),n=Array.from(t.querySelectorAll("img"));await Promise.all(n.map(async(e,t)=>{let n=r[t],i=n?await eb(n):null;null===i?e.remove():(e.setAttribute("src",i),e.removeAttribute("srcset"),e.removeAttribute("loading"))}))}async function eb(e){let t=e.currentSrc||e.src||(e.getAttribute("src")??"");return t.startsWith("data:")?t:function(e){if(!e.complete||0===e.naturalWidth)return null;try{let t=document.createElement("canvas");t.width=e.naturalWidth,t.height=e.naturalHeight;let r=t.getContext("2d");if(!r)return null;return r.drawImage(e,0,0),t.toDataURL("image/png")}catch{return null}}(e)??await ew(t)??await ew(function(e){let t=globalThis.location?.href;if(!URL.canParse(e,t))return"";let r=new URL(e,t);return r.origin===globalThis.location?.origin?"":`/_next/image?url=${encodeURIComponent(r.href)}&w=64&q=75`}(t))}async function ew(e){if(!e)return null;try{let t=await fetch(e,{signal:AbortSignal.timeout(5e3)});if(!t.ok)return await t.body?.cancel(),null;let r=await t.blob();if(!r.type.startsWith("image/"))return null;let n=await Z(r);return null!==n&&await new Promise(e=>{let t=new Image;t.onload=()=>e(!0),t.onerror=()=>e(!1),t.src=n})?n:null}catch{return null}}let ek=new Set(["normal","pre-wrap","pre-line","break-spaces"]);function ej({element:e,computed:t,declarations:r}){var n,i;let a=!function(e,t){if(!(e instanceof HTMLElement)||e.textContent?.trim()===""||e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||"absolute"===t.position||"fixed"===t.position||eM(t)||!ek.has(t.whiteSpace||"normal"))return!1;let r=e.ownerDocument.createRange();return r.selectNodeContents(e),1>=Math.abs(r.getBoundingClientRect().width-(e.getBoundingClientRect().width-Number.parseFloat(t.paddingLeft||"0")-Number.parseFloat(t.paddingRight||"0")))}(e,t)?r:r.filter(e=>!eS.has(e.split(":")[0]??"")),l=eM(t)?a.map(e=>"display:flow-root"===e?"display:-webkit-box":e):a;return(n=e,i=t,n instanceof HTMLElement&&"ellipsis"===i.textOverflow&&n.scrollWidth<=n.clientWidth)?[...l,"text-overflow:clip"]:l}let eS=new Set(["width","height"]);function eM(e){return"-webkit-box"===e.display||["line-clamp","-webkit-line-clamp"].some(t=>{let r=e.getPropertyValue(t);return""!==r&&"none"!==r})}function eC(e){if("svg"===e.localName||"foreignObject"===e.localName)return!1;let t=e.parentElement?.closest("svg, foreignObject");return null==t||"foreignObject"===t.localName}let eN=[...new Set([...eo,...el])];function eO({source:e,target:t,declarationsFor:r,isRoot:n=!0}){let i=globalThis.getComputedStyle(e),a=(function(e){return eC(e)?eo:"svg"===e.localName&&null!==e.parentElement&&eC(e.parentElement)?eN:el})(e).map(e=>{let t=i.getPropertyValue(e);return t?`${e}:${t}`:null}).filter(e=>null!==e),l=n||void 0===r?a:r({element:e,computed:i,declarations:a});l.length>0&&t.setAttribute("style",l.join(";"));let o=Array.from(e.children),s=Array.from(t.children);o.forEach((e,t)=>{let n=s[t];n&&eO({source:e,target:n,declarationsFor:r,isRoot:!1})})}async function eT({svg:e,meta:t,palette:r,fontFamily:n,scale:i=2,onLayout:a,imageLayout:l=o.Card}){if(l===o.Surface)return e_({svg:e,palette:r,scale:i,onLayout:a});let s=ep(e);if((0,A.V)(s))return s;let c=document.createElement("canvas"),u=c.getContext("2d");if(!u)return(0,A.Y)("canvas is unavailable");let d=(e,t)=>r=>(u.font=`${t} ${e}px ${n}`,u.measureText(r).width),h=G.width-2*G.padding,f=Q(t.title,{maxWidth:h,measure:d(G.titleFontSize,600)}),m=t.subtitle?Q(t.subtitle,{maxWidth:h,measure:d(G.subtitleFontSize,400)}):[],p=function({chartWidth:e,chartHeight:t,titleLineCount:r,subtitleLineCount:n}){let{width:i,padding:a,titleFontSize:l,subtitleFontSize:o,lineGap:s,sectionGap:c}=G,u=i-2*a,d=a+l,h=d+(Math.max(1,r)-1)*(l+s),f=n>0?h+s+o:null,m=(null===f?h:f+(n-1)*(o+s))+c,p=function({chartWidth:e,chartHeight:t,innerWidth:r}){if(e<=0||t<=0)return{width:r,height:Math.round(.5*r)};let n=Math.min(r/e,G.maxChartHeight/t);return{width:Math.round(e*n),height:Math.round(t*n)}}({chartWidth:e,chartHeight:t,innerWidth:u}),g={x:a+Math.round((u-p.width)/2),y:m,width:p.width,height:p.height},x=m+g.height+c+G.footerFontSize;return{width:i,height:Math.round(x+a-(G.footerFontSize-G.footerHeight/2)),innerWidth:u,titleBaseline:d,subtitleBaseline:f,chart:g,footerBaseline:x}}({chartWidth:s.data.width,chartHeight:s.data.height,titleLineCount:f.length,subtitleLineCount:m.length});a?.(p);let g=await eg(e);if((0,A.V)(g))return g;let[x,v]=await Promise.all([ez(ex(g.data.markup)),ez(ex(function(e){let{width:t,height:r}=K.D;return``}(r.foreground)))]);return(0,A.V)(x)?x:(0,A.V)(v)?v:(c.width=p.width*i,c.height=p.height*i,u.scale(i,i),function(e,{width:t,height:r,palette:n}){e.fillStyle=n.background,e.fillRect(0,0,t,r),e.strokeStyle=n.border,e.lineWidth=1,e.strokeRect(.5,.5,t-1,r-1)}(u,{width:p.width,height:p.height,palette:r}),eR(u,{lines:f,x:G.padding,baseline:p.titleBaseline,fontSize:G.titleFontSize,weight:600,color:r.foreground,fontFamily:n}),null!==p.subtitleBaseline&&eR(u,{lines:m,x:G.padding,baseline:p.subtitleBaseline,fontSize:G.subtitleFontSize,weight:400,color:r.mutedForeground,fontFamily:n}),u.drawImage(x.data,p.chart.x,p.chart.y,p.chart.width,p.chart.height),function(e,{baseline:t,width:r,meta:n,palette:i,fontFamily:a,logo:l}){let{padding:o,footerFontSize:s,logoHeight:c}=G,u=K.D.width/K.D.height*c;e.font=`600 ${s}px ${a}`;let d=e.measureText("OpenRouter"),h=t-(d.actualBoundingBoxAscent||s*e$)/2-G.logoHeight/2;e.drawImage(l,o,h,u,c),e.fillStyle=i.foreground,e.textAlign="left",e.fillText("OpenRouter",o+u+12,t);let f=o+u+12+d.width;e.font=`400 ${s}px ${a}`,e.fillStyle=i.mutedForeground,e.textAlign="right";let m=function(e,{maxWidth:t,measure:r}){if(r(e)<=t)return e;let n=e.length-1;for(;n>0&&r(`${e.slice(0,n)}…`)>t;)n-=1;return`${e.slice(0,n)}…`}(`${n.source} \xb7 ${n.url.replace(/^https?:\/\//,"").replace(/\/$/,"")}`,{maxWidth:r-o-f-eU,measure:t=>e.measureText(t).width});e.fillText(m,r-o,t)}(u,{baseline:p.footerBaseline,width:p.width,meta:t,palette:r,fontFamily:n,logo:v.data}),eA(c))}async function e_({svg:e,palette:t,scale:r,onLayout:n}){let i=ep(e);if((0,A.V)(i))return i;let a=i.data.width+2*eL,l=i.data.height+2*eL;n?.({width:a,height:l});let o=await eg(e,{inset:eL});if((0,A.V)(o))return o;let{width:s,height:c}=o.data;(s!==a||c!==l)&&n?.({width:s,height:c});let u=await ez(ex(o.data.markup));if((0,A.V)(u))return u;let d=document.createElement("canvas"),h=d.getContext("2d");return h?(d.width=s*r,d.height=c*r,h.scale(r,r),h.fillStyle=t.background,h.fillRect(0,0,s,c),h.drawImage(u.data,0,0,s,c),eA(d)):(0,A.Y)("canvas is unavailable")}e.s(["g",0,es,"i",0,em,"Y",0,eu,"P",0,ep,"_",0,eg,"n",0,ex],481914);let eL=32;function eR(e,{lines:t,x:r,baseline:n,fontSize:i,weight:a,color:l,fontFamily:o}){e.font=`${a} ${i}px ${o}`,e.fillStyle=l,e.textAlign="left",e.textBaseline="alphabetic",t.forEach((t,a)=>{e.fillText(t,r,n+a*(i+G.lineGap))})}let eU=32,e$=.7;async function ez(e){let t=await (0,A.$)(()=>new Promise((t,r)=>{let n=new Image;n.decoding="async",n.onload=()=>t(n),n.onerror=()=>r(Error("chart image failed to load")),n.src=e}));return(0,A.V)(t)?(0,A.Y)("chart image failed to load"):(0,A.N)(t.data)}async function eA(e){let t=await new Promise(t=>{e.toBlob(t,"image/png")});return t?(0,A.N)(t):(0,A.Y)("png encoding failed")}let eP={background:"--background",foreground:"--foreground",mutedForeground:"--muted-foreground",border:"--border"},eE={background:"#ffffff",foreground:"#0f172a",mutedForeground:"#64748b",border:"#e2e8f0"},eF="data-chart-share-probe",eI=["class","style","data-theme"];function eD(e){let t=[...e.addedNodes,...e.removedNodes];if(t.length>0&&t.every(eH))return!1;let r=e.target instanceof Element?e.target:e.target.parentElement;return null===r||!eH(r)&&null===r.closest(".recharts-tooltip-wrapper, .recharts-tooltip-cursor, .recharts-active-bar")}function eH(e){return e instanceof Element&&e.hasAttribute(eF)}let eY={[i.CopyImage]:async({blob:e,gt:t})=>{if(!e)return(0,A.Y)(t("The image is still rendering."));let r=await H(e);return(0,A.V)(r)?(0,A.Y)(t("Your browser cannot copy images here.")):(0,A.N)(t("Image copied"))},[i.Download]:async({blob:e,filename:t,gt:r})=>{if(!e)return(0,A.Y)(r("The image is still rendering."));let n=function(e,t){if("function"!=typeof URL.createObjectURL)return(0,A.Y)("downloads are unsupported");let r=URL.createObjectURL(e),n=document.createElement("a");return n.href=r,n.download=t,n.rel="noopener",document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3),(0,A.N)(void 0)}(e,t);return(0,A.V)(n)?(0,A.Y)(r("Your browser blocked the download.")):(0,A.N)(null)},[i.CopyLink]:async({meta:e,gt:t})=>{let r=await Y(I({url:e.url,action:i.CopyLink,tracking:e.tracking}));return(0,A.V)(r)?(0,A.Y)(t("Your browser cannot copy links here.")):(0,A.N)(t("Link copied"))},[i.PostOnX]:async({blob:e,meta:t,gt:r})=>{let n=e?await H(e):null;return W(function({text:e,url:t}){let r=new URL("https://x.com/intent/post");return r.searchParams.set("text",e),r.searchParams.set("url",t),r.toString()}({text:t.title,url:I({url:t.url,action:i.PostOnX,tracking:t.tracking})})),(0,A.N)(r(null!==n&&(0,A.C)(n)?"Image copied. Paste it into the post.":"Image not copied. Download it and attach it to the post."))},[i.PostOnLinkedIn]:async({blob:e,meta:t,gt:r})=>{let n=e?await H(e):null;return W(function({url:e}){let t=new URL("https://www.linkedin.com/sharing/share-offsite/");return t.searchParams.set("url",e),t.toString()}({url:I({url:t.url,action:i.PostOnLinkedIn,tracking:t.tracking})})),(0,A.N)(r(null!==n&&(0,A.C)(n)?"Image copied. Paste it into the post.":"Image not copied. Download it and attach it to the post."))},[i.NativeShare]:async({blob:e,meta:t,filename:r,gt:n})=>{let a=e?[new File([e],r,{type:D})]:void 0,l=await V({title:t.title,url:I({url:t.url,action:i.NativeShare,tracking:t.tracking}),files:a});return(0,A.V)(l)?(0,A.Y)(n("Your browser cannot share here.")):(0,A.N)(null)}};function eV(e){let n=(0,r.c)(14),{variant:i,share:a,disabled:o,menuActions:s,menuTriggerReveal:c,children:u}=e;switch(i){case l.Dialog:{let e;return n[0]!==u||n[1]!==o||n[2]!==a?(e=(0,t.jsx)(T,{share:a,disabled:o,children:u}),n[0]=u,n[1]=o,n[2]=a,n[3]=e):e=n[3],e}case l.Menu:{let e;return n[4]!==u||n[5]!==o||n[6]!==s||n[7]!==c||n[8]!==a?(e=(0,t.jsx)(z,{share:a,disabled:o,actions:s,triggerReveal:c,children:u}),n[4]=u,n[5]=o,n[6]=s,n[7]=c,n[8]=a,n[9]=e):e=n[9],e}case l.Inline:{let e;return n[10]!==u||n[11]!==o||n[12]!==a?(e=(0,t.jsx)(R,{share:a,disabled:o,children:u}),n[10]=u,n[11]=o,n[12]=a,n[13]=e):e=n[13],e}default:return i}}e.s(["f",0,function(e){let i,a,o,s,u,d,h=(0,r.c)(24),{children:f,meta:m,surface:p,variant:g,className:x,recaptureDelayMs:v,disabled:y,menuActions:b,menuTriggerReveal:w,imageLayout:k}=e,j=void 0===g?l.Dialog:g,S=void 0!==y&&y,[M,C]=(0,n.useState)(null);h[0]!==M||h[1]!==k||h[2]!==m||h[3]!==v||h[4]!==p||h[5]!==j?(i={chartElement:M,meta:m,surface:p,variant:j,recaptureDelayMs:v,imageLayout:k},h[0]=M,h[1]=k,h[2]=m,h[3]=v,h[4]=p,h[5]=j,h[6]=i):i=h[6];let N=function({chartElement:e,meta:t,surface:r,variant:i,recaptureDelayMs:a=300,imageLayout:l}){let o,s=(0,c.o)(),u=(0,P.Q)(),[d,h]=(0,n.useState)(B),f=(0,n.useRef)(B),m=(0,n.useCallback)(e=>{let t=function(e,t){switch(t.type){case"opened":return X(e,{isOpen:!0,aspectRatio:e.aspectRatio});case"closed":return e.isOpen?{...e,isOpen:!1}:e;case"key_changed":return X(e,{isOpen:!1,aspectRatio:null});case"render_started":return"idle"===e.kind?{...e,kind:"rendering"}:e;case"chart_missing":return"idle"===e.kind?{...q(e),kind:"failed",error:t.error}:e;case"layout_measured":return"rendering"===e.kind&&e.aspectRatio!==t.aspectRatio?{...e,aspectRatio:t.aspectRatio}:e;case"render_succeeded":return"rendering"===e.kind?{...q(e),kind:"ready",blob:t.blob,previewUrl:t.previewUrl,canNativeShare:t.canNativeShare}:e;case"render_failed":return"rendering"===e.kind?{...q(e),kind:"failed",error:t.error}:e;case"recapture_scheduled":return"recapture_pending"===e.kind?e:{...q(e),kind:"recapture_pending"};case"recapture_elapsed":case"observers_detached":return"recapture_pending"===e.kind?{...q(e),kind:"idle"}:e;default:return t}}(f.current,e);t!==f.current&&(f.current=t,h(t))},[]),p=(0,n.useRef)(0),g=(0,n.useRef)(null),{isOpen:x}=d,v="ready"===d.kind?d.blob:null,y="ready"===d.kind?d.previewUrl:null,b="rendering"===d.kind;(0,n.useEffect)(()=>{if(y)return()=>URL.revokeObjectURL(y)},[y]);let w=(0,n.useMemo)(()=>{var e,r;let n,i;return e=t.title,r=new Date,n=e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,60),i=r.toISOString().slice(0,10),`openrouter-${n||"chart"}-${i}.png`},[t.title]),k=(0,n.useCallback)(()=>{var e;return{...t,url:("function"==typeof(e=t).url?e.url():e.url)??globalThis.location.href}},[t]),j=(0,n.useCallback)(e=>{p.current+=1,m(e)},[m]),S=(o="function"==typeof t.url?"":t.url,[t.title,t.subtitle,t.source,o,r].join("\0"));(0,n.useEffect)(()=>()=>j({type:"key_changed"}),[S,j]);let M=(0,n.useCallback)(async()=>{var t;let r,n,i;if("rendering"===d.kind||"ready"===d.kind||"failed"===d.kind||"recapture_pending"===f.current.kind)return;let a=e?eu(e):null;if(!e||!a)return void m({type:"chart_missing",error:s("This chart has nothing to share yet.")});let o=++p.current;g.current=em(a),m({type:"render_started"});let c=await eT({svg:a,meta:k(),palette:((r=e.ownerDocument.createElement("span")).setAttribute(eF,""),r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.visibility="hidden",e.append(r),i={background:(n=e=>{let t=eP[e];for(let e of[`hsl(var(${t}))`,`var(${t})`]){r.style.backgroundColor=e;let t=globalThis.getComputedStyle(r).backgroundColor;if(t&&"rgba(0, 0, 0, 0)"!==t)return t}return eE[e]})("background"),foreground:n("foreground"),mutedForeground:n("mutedForeground"),border:n("border")},r.remove(),i),fontFamily:globalThis.getComputedStyle(e).fontFamily||"sans-serif",imageLayout:l,onLayout:e=>{o===p.current&&m({type:"layout_measured",aspectRatio:`${e.width} / ${e.height}`})}}).catch(()=>(0,A.Y)("chart image rendering threw"));if(o===p.current){let e;if((0,A.V)(c))return void m({type:"render_failed",error:s("The chart image could not be created.")});m({type:"render_succeeded",blob:c.data,previewUrl:URL.createObjectURL(c.data),canNativeShare:(t=new File([c.data],w,{type:D}),e=globalThis.navigator,"function"==typeof e?.canShare&&e.canShare({files:[t]}))})}},[d.kind,m,e,s,r,i,k,w,l]);(0,n.useEffect)(()=>{x&&M()},[x,M]),(0,n.useEffect)(()=>{let t;if(!x||!e)return;let r=()=>{clearTimeout(t),"recapture_pending"!==f.current.kind&&j({type:"recapture_scheduled"}),t=setTimeout(()=>{m({type:"recapture_elapsed"})},a)},n=new MutationObserver(t=>{var n,i;let a;t.some(eD)&&("recapture_pending"===f.current.kind||(n=e,i=g.current,null===(a=eu(n))||null===i||em(a)!==i))&&r()});n.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0});let i=new MutationObserver(r);return i.observe(e.ownerDocument.documentElement,{attributes:!0,attributeFilter:eI}),()=>{clearTimeout(t),m({type:"observers_detached"}),n.disconnect(),i.disconnect()}},[x,e,j,m,a]);let C=(0,n.useCallback)(e=>{e?(j({type:"opened"}),u.capture("share_chart_open",{surface:r,variant:i,...k().analytics})):m({type:"closed"})},[u,r,i,k,j,m]),N=(0,n.useCallback)(async e=>{u.capture("share_chart_action",{surface:r,variant:i,action:e,...k().analytics});let t=await eY[e]({blob:v,meta:k(),filename:w,gt:s});return(0,A.V)(t)?((0,E.c)({title:s("Sharing failed"),description:t.error,variant:"destructive"}),!1):(t.data&&(0,E.c)({title:t.data,variant:"success"}),!0)},[u,r,i,v,k,w,s]);return{previewUrl:y,previewAspectRatio:d.aspectRatio,isRendering:b,renderError:"failed"===d.kind?d.error:null,canNativeShare:"ready"===d.kind&&d.canNativeShare,isOpen:x,setOpen:C,run:N}}(i),{isOpen:O,setOpen:T}=N;return h[7]!==S||h[8]!==O||h[9]!==T?(a=()=>{S&&O&&T(!1)},o=[S,O,T],h[7]=S,h[8]=O,h[9]=T,h[10]=a,h[11]=o):(a=h[10],o=h[11]),(0,n.useEffect)(a,o),h[12]!==f?(s=(0,t.jsx)("div",{ref:C,children:f}),h[12]=f,h[13]=s):s=h[13],h[14]!==S||h[15]!==b||h[16]!==w||h[17]!==N||h[18]!==s||h[19]!==j?(u=(0,t.jsx)(eV,{variant:j,share:N,disabled:S,menuActions:b,menuTriggerReveal:w,children:s}),h[14]=S,h[15]=b,h[16]=w,h[17]=N,h[18]=s,h[19]=j,h[20]=u):u=h[20],h[21]!==x||h[22]!==u?(d=(0,t.jsx)("div",{className:x,children:u}),h[21]=x,h[22]=u,h[23]=d):d=h[23],d}],623578)},447906,e=>{"use strict";var t=e.i(659350),r=e.i(663456),n=e.i(623578),i=e.i(199168),a=e.i(402600),l=e.i(463686),o=e.i(950008),s=e.i(369677);let c=[];e.s(["f",0,function(e){let u,d,h,f,m,p,g,x,v=(0,r.c)(30),{sectionId:y,chartId:b,title:w,filters:k,inSectionTitle:j,enabled:S,source:M,children:C}=e,N=void 0===k?c:k,O=void 0!==j&&j,T=(0,i.o)(),{model:_}=(0,s.useModelPage)(),L=(0,a.f)()??"",R=(0,l.useSearchParams)()?.toString()??"",U=""===R?"":`?${R}`;v[0]!==b||v[1]!==L||v[2]!==y||v[3]!==U?(u=function({origin:e,pathname:t,search:r,sectionId:n,chartId:i}){return{url:`${e}${t}${r}#${n}`,tracking:{campaign:"model_page_chart",content:`${n}:${i}`},analytics:{section:n,chart:i}}}({origin:globalThis.location?.origin??"",pathname:L,search:U,sectionId:y,chartId:b}),v[0]=b,v[1]=L,v[2]=y,v[3]=U,v[4]=u):u=v[4];let $=u,z=!(void 0===S||S);if(v[5]!==b||v[6]!==y)d=`model_page_${y}_${b}`,v[5]=b,v[6]=y,v[7]=d;else d=v[7];return v[8]!==T||v[9]!==_.short_name||v[10]!==w?(h=T("{modelName} — {title}",{modelName:_.short_name,title:w}),v[8]=T,v[9]=_.short_name,v[10]=w,v[11]=h):h=v[11],v[12]!==N?(f=0===N.length?void 0:N.join(" · "),v[12]=N,v[13]=f):f=v[13],v[14]!==T||v[15]!==M?(m=M??T("Source: OpenRouter"),v[14]=T,v[15]=M,v[16]=m):m=v[16],v[17]!==$||v[18]!==m||v[19]!==h||v[20]!==f?(p={title:h,subtitle:f,source:m,...$},v[17]=$,v[18]=m,v[19]=h,v[20]=f,v[21]=p):p=v[21],v[22]!==O?(g=O&&(0,t.jsx)(o.ModelSectionSharePortal,{}),v[22]=O,v[23]=g):g=v[23],v[24]!==C||v[25]!==p||v[26]!==g||v[27]!==z||v[28]!==d?(x=(0,t.jsxs)(n.f,{disabled:z,surface:d,meta:p,children:[g,C]}),v[24]=C,v[25]=p,v[26]=g,v[27]=z,v[28]=d,v[29]=x):x=v[29],x}],447906)}]); //# sourceMappingURL=3uoik497hqd-4.js.map