ztd-charts-cli 0.7.0 → 0.8.0
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/README.md +1 -1
- package/dist/api.d.ts +11 -1
- package/dist/api.js +5 -1
- package/dist/{chunk-4WXNLD5P.js → chunk-FB5WHEJX.js} +38 -15
- package/dist/cli.js +5 -4
- package/dist/client/NOTICE.md +39 -0
- package/dist/client/area.js +10 -10
- package/dist/client/bar.js +10 -10
- package/dist/client/barRace.js +28 -0
- package/dist/client/beeswarm.js +10 -10
- package/dist/client/box.js +10 -10
- package/dist/client/bubble.js +10 -10
- package/dist/client/bullet.js +9 -9
- package/dist/client/bump.js +10 -10
- package/dist/client/calendar.js +9 -9
- package/dist/client/candlestick.js +9 -9
- package/dist/client/chord.js +10 -10
- package/dist/client/choropleth.js +28 -0
- package/dist/client/donut.js +10 -10
- package/dist/client/dumbbell.js +9 -9
- package/dist/client/flowMap.js +28 -0
- package/dist/client/funnel.js +10 -10
- package/dist/client/gauge.js +10 -10
- package/dist/client/geo-kr-sido.js +1 -0
- package/dist/client/geo-us-states.js +1 -0
- package/dist/client/geo-world.js +1 -0
- package/dist/client/heatmap.js +9 -9
- package/dist/client/histogram.js +6 -6
- package/dist/client/line.js +10 -10
- package/dist/client/lollipop.js +10 -10
- package/dist/client/marimekko.js +6 -6
- package/dist/client/network.js +28 -0
- package/dist/client/parallel.js +9 -9
- package/dist/client/pareto.js +10 -10
- package/dist/client/pie.js +10 -10
- package/dist/client/radar.js +10 -10
- package/dist/client/radialBar.js +10 -10
- package/dist/client/ridgeline.js +10 -10
- package/dist/client/sankey.js +10 -10
- package/dist/client/scatter.js +10 -10
- package/dist/client/segmented.js +9 -9
- package/dist/client/skyline.js +10 -10
- package/dist/client/slope.js +10 -10
- package/dist/client/sparkline.js +10 -10
- package/dist/client/stream.js +10 -10
- package/dist/client/sunburst.js +9 -9
- package/dist/client/symbolMap.js +28 -0
- package/dist/client/tileMap.js +10 -10
- package/dist/client/timeline.js +28 -0
- package/dist/client/tree.js +28 -0
- package/dist/client/treemap.js +9 -9
- package/dist/client/waffle.js +9 -9
- package/dist/client/waterfall.js +10 -10
- package/package.json +2 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
(()=>{var qi=Object.create;var $r=Object.defineProperty;var Zi=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var ea=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var wn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var na=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qi(t))!ta.call(e,o)&&o!==n&&$r(e,o,{get:()=>t[o],enumerable:!(r=Zi(t,o))||r.enumerable});return e};var _=(e,t,n)=>(n=e!=null?qi(ea(e)):{},na(t||!e||!e.__esModule?$r(n,"default",{value:e,enumerable:!0}):n,e));var J=wn((Fl,Tr)=>{Tr.exports=globalThis.__ztdReact.react});var Cr=wn((Pl,Mr)=>{Mr.exports=globalThis.__ztdReact["react-dom/client"]});var j=wn((Kl,Qr)=>{Qr.exports=globalThis.__ztdReact["react/jsx-runtime"]});var lr=_(J(),1),Ei=_(Cr(),1);var St=_(J(),1);var Kt=_(J(),1);var Sr=_(J(),1),nt=(0,Sr.createContext)(void 0);var Fr=_(J(),1);var ra=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Ar='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Nr='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',He={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Ar,monoFamily:Nr,radius:18,radiusCode:14,radiusMark:4},vn={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Ar,monoFamily:Nr,radius:18,radiusCode:14,radiusMark:4},$n={dark:He,light:vn};function _t(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Tn(e){let t={};for(let n of ra){let r=e[n];typeof r=="string"&&(t[_t(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function Mn(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var oa=`
|
|
2
|
+
.ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
|
|
3
|
+
.ztd-root:focus{outline:none}
|
|
4
|
+
.ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${He.accent});outline-offset:3px;border-radius:6px}
|
|
5
|
+
.ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
|
|
6
|
+
.ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
|
|
7
|
+
.ztd-tip{animation:ztd-fade .14s ease-out;transition:left .2s cubic-bezier(.22,1,.36,1),top .2s cubic-bezier(.22,1,.36,1)}
|
|
8
|
+
.ztd-guide{transition:transform .2s cubic-bezier(.22,1,.36,1)}
|
|
9
|
+
.ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
|
|
10
|
+
.ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
|
|
11
|
+
.ztd-btn:focus{outline:none}
|
|
12
|
+
.ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${He.accent});outline-offset:2px}
|
|
13
|
+
.ztd-card{transition:border-color .16s ease}
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${He.dim})}
|
|
15
|
+
@media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
|
|
16
|
+
@keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
|
|
17
|
+
@keyframes ztd-fade{from{opacity:0}to{opacity:1}}
|
|
18
|
+
.ztd-pop{transform-box:fill-box;transform-origin:center}
|
|
19
|
+
@keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
|
|
20
|
+
.ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
|
|
21
|
+
@media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
|
|
22
|
+
`;function Pr(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function _r(e,t){let[n]=(0,Fr.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var Rr=!1;function yt(){if(Rr||typeof document>"u"||(Rr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=oa,document.head.appendChild(e)}var Dt=_(J(),1),$e=typeof window<"u"&&typeof document<"u",Pe=$e?Dt.useLayoutEffect:Dt.useEffect;function Lt(){return typeof performance<"u"?performance.now():Date.now()}function Q(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Le(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Dr={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},Lr={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ia=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],aa={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function sa(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function la(e){return sa(ia,e)}function Er(e,t){let n=la(e);return{text:n?n[t]:e,...aa[n?.id??"basic"]}}var Or={white:"#ffffff",black:"#000000",transparent:"#00000000"};function rt(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Or[t.toLowerCase()]&&(t=Or[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function Br(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Sn(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function ot(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ir(e){return .2126*ot(e[0])+.7152*ot(e[1])+.0722*ot(e[2])}function An(e,t,n){let r=typeof e=="string"?rt(e):e,o=typeof t=="string"?rt(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?rt(n):n:null;o[3]<1&&a&&(o=Sn(o,a));let i=r[3]<1?Sn(r,o):r,s=Ir(i),l=Ir(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function ca(e){return[ot(e[0]),ot(e[1]),ot(e[2])]}function Cn(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function zr(e){let[t,n,r]=ca(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function ua([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[Cn(4.0767416621*o-3.3077115913*a+.2309699292*i),Cn(-1.2684380046*o+2.6097574011*a-.3413193965*i),Cn(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Et(e,t,n){let r=rt(e),o=rt(t);if(!r||!o)return e;let a=zr(r),i=zr(o),s=Math.max(0,Math.min(1,n));return Br(ua([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Nn(e,t,n){let r=t[0],o=-1;for(let a of t){let i=An(a,e,n);i>o&&(o=i,r=a)}return r}function te(e,t){let n=e.theme;switch(t){case"accent":return{role:t,fill:e.paint("accent"),text:e.paint("onAccent"),raw:n.accent};case"ink":return{role:t,fill:e.paint("ink"),text:e.paint("onInk"),raw:n.ink};case"strong":return{role:t,fill:e.paint("neutralStrong"),text:e.paint("onNeutralStrong"),raw:n.neutralStrong};case"soft":return{role:t,fill:e.paint("neutralSoft"),text:e.paint("ink"),raw:n.neutralSoft};default:return{role:"neutral",fill:e.paint("neutral"),text:e.paint("ink"),raw:n.neutral}}}function ma(e,t){let n=Nn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return An(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Nn(t,["#FFFFFF","#000000"])}function Ot(e,t){let n=Et(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:ma(e,n),raw:n}}function me(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=te(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=te(e,"neutral");else if(s===0)r[i]=te(e,"ink");else if(s===a-1)r[i]=te(e,"neutral");else if(a===3)r[i]=te(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?te(e,"strong"):Ot(e,1-l)}}),r}var Rn="mix:";function je(e){return e({theme:vn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Rn}${o}`}).map(n=>n.fill)}function Hr(e,t){return t?.startsWith(Rn)?e.mix("neutralStrong","neutral",Number(t.slice(Rn.length))):e.color(t)}function xt(e,t,n){return me(e,t+1,n).slice(0,t)}function jr(e,t,n,r="neutral"){let o=te(e,"accent"),a=te(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function Gr(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=te(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=te(e,"neutral"):s===0?r[i]=te(e,"strong"):s===a-1?r[i]=te(e,"neutral"):r[i]=Ot(e,1-s/(a-1))}),r}var Te=_(J(),1);var it=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),se="en-US",Vr=new Map;function Pn(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=Vr.get(r);return o||(o=new Intl.NumberFormat(e,n),Vr.set(r,o)),o}function _n(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ue(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=se,...r}=t;return _n(Pn(n,r).format(e))}var Dn=e=>e!==0&&Math.abs(e)<.05,Ln=(e,t,n="")=>`${Ue(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function It(e,t={}){if(!Number.isFinite(e))return"-";if(Dn(e)&&t.maximumFractionDigits===void 0)return Ln(e,t.locale??se,"%");let n=Math.abs(e);return`${Ue(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Xr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=se,...r}=t;if(Q(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,l]=a[i],c=o/s,d=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**d)/10**d;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+Ue(u,{locale:n,...r,maximumFractionDigits:d})+l}}return _n(Pn(n,{notation:"compact",...r}).format(e))}var da=(e,t=Q(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Xe(e,t=se,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Pn(t,o);return l=>Number.isFinite(l)?`${i}${_n(s.format(l))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>It(o,{locale:t});case"ratio":return o=>It(o*100,{locale:t});case"compact":return o=>Xr(o,{locale:t});case"currency":return r(da(t));default:{let o=r({maximumFractionDigits:1});return a=>Dn(a)?Ln(a,t):o(a)}}}function zt(e,t=se,n=0){return e!==void 0?Xe(e,t):n>=1e5?r=>Dn(r)?Ln(r,t):Xr(r,{locale:t}):r=>Ue(r,{locale:t})}function fa(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var En=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,ha=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,ga=["january","february","march","april","may","june","july","august","september","october","november","december"],Wr=e=>{let t=e.toLowerCase();return t.length<3?0:ga.findIndex(n=>n.startsWith(t))+1},Kr=e=>+e+(+e<30?2e3:1900);function Yr(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var pa=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],Jr=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,qr=/\{([^{}]+)\}/g;function Bt(e,t){let n;for(let r of pa)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[Kr(n[3]),+n[2],+n[1],1]:[Kr(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=Jr.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Wr(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=Wr(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Ht=e=>ha.test(e)||Bt(e)!==null;function jt(e){let t;for(let n of e){let r=typeof n=="string"?Jr.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function at(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(En(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return at(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=Bt(n,t);if(r)return fa(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var Fn=[["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];function Zr(e,t=se){if(!Number.isFinite(e))return"-";let n=Math.abs(e),r=e<0?"-":"",o=(a,i,s="short",l=0)=>Ue(i,{locale:t,style:"unit",unit:a,unitDisplay:s,maximumFractionDigits:l});if(n>=864e5*365)return r+o("year",n/(864e5*365.25),"short",1);for(let a=0;a<Fn.length;a++){let[i,s]=Fn[a];if(n<s)continue;let l=Math.floor(n/s),c=Fn[a+1];if(l>=10||!c)return r+o(i,i==="second"&&l<10?n/s:Math.round(n/s),"short",i==="second"?1:0);let d=Math.round((n-l*s)/c[1]);return d*c[1]>=s&&(l++,d=0),r+(d?`${o(i,l,"narrow")} ${o(c[0],d,"narrow")}`:o(i,l))}return r+o("millisecond",n)}var Ur=new Map;function Ee(e,t={month:"short",day:"numeric"}){let n=at(e);if(!n)return"-";let{locale:r=se,...o}=t,a=r+JSON.stringify(o),i=Ur.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Ur.set(a,i)),i.format(n)}var On=_(j(),1),Gt=(0,Te.createContext)({theme:He,cssVars:!0});function ba(e,t=He){return e?typeof e=="string"?$n[e]??t:Mn(t,e):t}function Vt(e){let t=(0,Te.useContext)(Gt),n=e.base?$n[e.base]:t.theme,r=(0,Te.useMemo)(()=>ba(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,Te.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,Te.useMemo)(()=>Tn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,On.jsx)(Gt.Provider,{value:i,children:(0,On.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var ya=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function eo(e){return ya.has(e)}function xa(e,t){let n=r=>t?`var(${_t(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?eo(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?eo(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:Et(e[r],e[o],a)}}}function Me(e){let t=(0,Te.useContext)(Gt);return(0,Te.useMemo)(()=>{let n=Mn(t.theme,e);return xa(n,t.cssVars)},[t.theme,t.cssVars,e])}function de(e){let t=(0,Te.useContext)(Gt);return e??t.locale??se}function to(e){return e?Tn(e):{}}var Wt=_(J(),1),In=(0,Wt.createContext)(void 0);function no(e){let t=(0,Wt.useContext)(In);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var D=_(j(),1),ka={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},wa={en:ka,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var va={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},zn=e=>wa[Q(de(e))];function Bn(e){let t=Me(e.theme),n=zn(e.locale),[r,o]=(0,Kt.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(d=>!s.has(d.label)).length,c=(0,D.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((d,u)=>{let m=!s.has(d.label),h=m&&l===1,f=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)($a,{p:t,item:d,off:!m}),(0,D.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,D.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,D.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":h||void 0,onClick:()=>{h||(i(d.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:h?"default":void 0},children:f}):f},u)})});return i?(0,D.jsxs)(D.Fragment,{children:[c,(0,D.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:va,children:r?n.shown(l,e.items.length):""})]}):c}function $a({p:e,item:t,off:n}){let r=Hr(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,D.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,D.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,D.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,D.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function Ta(e){let t=Me(e.theme),n=Er(e.level,Q(de(e.locale)));return(0,D.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Ma(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,D.jsxs)(D.Fragment,{children:[e.slice(0,r),(0,D.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function ro(e){let t=Me(e.theme),n=zn(e.locale),[r,o]=(0,Kt.useState)(0);Pe(()=>yt(),[]);let a=()=>{o(m=>m+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,D.jsx)(Bn,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,d=e.source!==void 0||e.note!==void 0?(0,D.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,D.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,D.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,D.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,D.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,D.jsx)(Ta,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,D.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,D.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,D.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:l}):null,(0,D.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Ma(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,D.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,D.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,D.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,D.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,D.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,D.jsx)("span",{}),i]}):null]}),(0,D.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,D.jsx)(In.Provider,{value:r,children:(0,D.jsx)(nt.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,D.jsxs)(D.Fragment,{children:[d,u]}):u]})}function Hn(e){let t=Me(e.theme),n=zn(e.locale),r=e.height??220;if(Pe(()=>yt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,D.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,D.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,D.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,D.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,D.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,D.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,D.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,D.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,D.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,D.jsx)(D.Fragment,{children:e.children})}var mt=_(J(),1);var fe=_(J(),1);var W=_(j(),1),Ut=60;var Xt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function oo(e){let{c:t,events:n}=e,r=(0,fe.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,Pe(()=>{yt()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,fe.useContext)(nt),c=e.ariaLabel??l??e.kind,d=(0,fe.useMemo)(()=>s?`${n.length}${n.slice(0,Ut).map(k=>`${k.label}${k.series??""}${k.formatted??k.value??""}`).join("")}`:"",[n,s]),u=(0,fe.useMemo)(()=>(0,W.jsx)(Ca,{label:c,events:n,t:t.t}),[c,d,t.t]),m=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{let k=()=>{m.current=null};return window.addEventListener("scroll",k,{capture:!0,passive:!0}),window.addEventListener("resize",k,{passive:!0}),()=>{window.removeEventListener("scroll",k,{capture:!0}),window.removeEventListener("resize",k)}},[]),(0,fe.useEffect)(()=>{m.current=null},[t.width,t.height]);let h=k=>{if(k.target!==k.currentTarget)return;if(e.onKey?.(k)){k.preventDefault();return}let T=t.active,O;switch(k.key){case"ArrowRight":case"ArrowDown":O=T===null?0:(T+1)%i;break;case"ArrowLeft":case"ArrowUp":O=T===null?i-1:(T-1+i)%i;break;case"Home":O=0;break;case"End":O=i-1;break;case"Escape":if(T===null)return;O=null;break;case"Enter":case" ":T!==null&&(k.preventDefault(),t.click(T));return;default:return}k.preventDefault(),t.setActive(O,"keyboard")},{via:f,node:p,setActive:$}=t;(0,fe.useEffect)(()=>{if(f!=="touch"||!p)return;let k=T=>{p.contains(T.target)||$(null)};return document.addEventListener("pointerdown",k),()=>document.removeEventListener("pointerdown",k)},[f,p,$]);let b=t.active!==null?n[t.active]:null,M=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,C=M&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,R=typeof e.renderTip=="function"&&b?e.renderTip(b):null,x=e.announce??(t.via==="keyboard"&&b?`${b.label}${b.series?` ${b.series}`:""}: ${b.formatted??b.value??""} (${(t.active??0)+1}/${i})`:""),P;if(M){let k=M.x*C,T=t.width*C,O=`clamp(${(4-k).toFixed(1)}px, -50%, calc(${(T-k-4).toFixed(1)}px - 100%))`,G=M.y<64;P={position:"absolute",left:k,top:M.y*C,transform:`translate(${O}, ${G?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*C-8)}}let E=k=>{m.current=null,k.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},I=k=>k?T=>{let O=m.current??(m.current=T.currentTarget.getBoundingClientRect());O.width&&k((T.clientX-O.left)/O.width*t.width,(T.clientY-O.top)/O.height*t.height,T)}:void 0,B=I(e.onPointerMove),z=I(e.onPointerDown),w=B||z?k=>{k.pointerType==="touch"&&B?.(k),z?.(k)}:void 0,S=I(e.onPointerUp),A=to(e.theme);return(0,W.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:k=>{t.via==="keyboard"&&!k.currentTarget.contains(k.relatedTarget)&&t.setActive(null)},onPointerLeave:E,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...A,...e.style},children:[t.pending?null:e.underlay,(0,W.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:B,onPointerDown:w,onPointerUp:S,onPointerCancel:S,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,W.jsx)("title",{id:o,children:c}),(0,W.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,W.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,M?(0,W.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:P,children:R??(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:M.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:M.title}),M.rows.map((k,T)=>(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,W.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(k.strong?"ink":"muted")},children:[k.color?(0,W.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:k.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,k.label]}),(0,W.jsx)("span",{style:{fontWeight:k.strong===!1?500:700},children:k.value})]},T))]})}):null,(0,W.jsx)("span",{className:"ztd-sr",style:Xt,"aria-live":"polite","aria-atomic":"true",children:x}),s&&!t.pending?u:null]})}function Ca({label:e,events:t,t:n}){return(0,W.jsx)("div",{className:"ztd-sr",style:Xt,children:(0,W.jsxs)("table",{children:[(0,W.jsx)("caption",{children:n.table(e)}),(0,W.jsxs)("tbody",{children:[t.slice(0,Ut).map((r,o)=>(0,W.jsxs)("tr",{children:[(0,W.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,W.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>Ut?(0,W.jsx)("tr",{children:(0,W.jsx)("td",{colSpan:2,children:n.more(t.length-Ut)})}):null]})]})})}function Ce(e){let t=e.baseline??"central";return(0,W.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var y=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ye=y("label","string",!0,"Item name field"),ie=y("value","number",!0,"Value field"),Sa=[ye,ie],Aa=[ye,ie],Na=[y("label","string",!0,"Stage name"),y("value","number",!0,"Users at the stage")],Ra=[ye,ie],Fa=[y("label","string",!0,"Leaf (lowest level) name"),ie,y("group","string",!1,"Parent group field")],Pa=[y("label","string",!0,"Leaf name"),ie,y("group","string",!1,"Parent group field")],_a=[ye,y("value","number",!0,"Change (total rows may omit it)"),y("type","string",!1,'"total" makes a total bar')],Da=[ye,ie],La=[y("x","string",!0,"Column field"),y("series","string",!0,"Stacked series field"),ie],Ea=[y("x","string",!0,"Column field"),y("y","string",!0,"Row field"),ie],Oa=[y("axis","string",!0,"Metric (axis) field"),y("value","number",!0,"Value field",{multi:!0}),y("series","string",!1,"Series field")],Ia=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("size","number",!1,"Circle size"),y("label","string",!1,"Name")],ao=y("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),za=[y("x","any",!0,"x field (date, number or category)"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables)"),y("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),ao],Ba=[y("x","any",!0,"x field"),y("y","number",!0,"y field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),ao],Ha=[y("x","any",!0,"x field"),y("y","number",!0,"y field",{multi:!0}),y("series","string",!1,"Series field")],ja=[y("x","string",!0,"Category field"),y("y","number",!0,"Value field. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field"),y("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],Ga=[ye,ie],Va=[y("value","number",!0,"Value field",{prop:"valueKey"}),y("target","number",!1,"Target field",{prop:"targetKey"})],Wa=[ye,y("value","number",!0,"Actual value field"),y("target","number",!1,"Target field")],Ka=[y("x","any",!1,"x field"),y("y","number",!0,"y field")],Ua=[ye,y("x","string",!1,"Period field (long tables)"),y("value","number",!1,"Value field (long tables)")],Xa=[ye,y("start","number",!0,"Before value"),y("end","number",!0,"After value")],Ya=[ye,ie],Ja=[y("value","number",!0,"Value field"),y("group","string",!1,"Group (row) field"),y("label","string",!1,"Dot name")],qa=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],Za=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),ie],Qa=[y("source","string",!0,"Sending group"),y("target","string",!0,"Receiving group"),ie],es=[y("date","date",!0,"Date field"),ie],ts=[y("x","any",!0,"Period field"),y("series","string",!0,"Item field"),y("rank","number",!1,"Rank field (1 is first)"),y("value","number",!1,"Value field (instead of rank, largest is first)")],ns=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],rs=[y("label","string",!1,"Row name field")],os=[y("x","date",!0,"Date (period) field"),y("open","number",!0,"Open price field"),y("high","number",!0,"High price field"),y("low","number",!0,"Low price field"),y("close","number",!0,"Close price field"),y("volume","number",!1,"Volume field")],is=[ye,ie],as=[y("x","any",!0,"Period field (date or category)"),y("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),y("series","string",!1,"Series field (long tables, back row only)"),y("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],ss=[y("value","number",!1,"Sample value field (raw rows)"),y("group","string",!1,"Group field. Up to 2 groups overlap"),y("x0","number",!1,"Bin start (pre-binned rows)"),y("x1","number",!1,"Bin end (pre-binned rows)"),y("count","number",!1,"Samples in the bin (pre-binned rows)")],ls=[y("region","string",!0,"Region name or code, matched to a tile of options.map"),ie],cs=[ye,ie,y("frame","any",!0,"Time step field: a year, a date or any ordered key. Numbers and dates play in order, other text in the order it first appears. An item with no value in a step leaves the bars for that step")],us=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),y("value","number",!1,"Link weight. Without it every row counts 1")],ms=[y("label","string",!0,"Row name. Items with the same name share a row"),y("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),y("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),y("group","string",!1,"Group field (one color per group, and the legend)"),y("status","string",!1,"State of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status strip")],ds=[y("label","string",!0,"Node name field"),y("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),y("group","string",!1,"Parent group field (flat rows, as in the treemap)"),y("id","string",!1,"Row id for id/parent rows. Defaults to the label"),y("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],fs=[y("region","string",!0,"Region name or code, matched to a region of options.map"),ie],hs=[y("lon","number",!1,"Longitude (degrees)"),y("lat","number",!1,"Latitude (degrees)"),y("size","number",!1,"Value (circle area). Without it all circles match"),y("label","string",!1,"Place name"),y("region","string",!1,"Region of options.map, for rows without lon and lat"),y("group","string",!1,"Group field (one color per group)")],gs=[y("source","string",!0,"Start: a name in options.places or a region"),y("target","string",!0,"End"),y("value","number",!1,"Amount. Without it each row counts 1")],ps=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("series","string",!1,"Series field (one color per series)"),y("label","string",!1,"Name")],io={pie:Sa,donut:Aa,funnel:Na,waffle:Ra,treemap:Fa,sunburst:Pa,waterfall:_a,pareto:Da,marimekko:La,heatmap:Ea,radar:Oa,bubble:Ia,line:za,area:Ba,stream:Ha,bar:ja,radialBar:Ga,gauge:Va,bullet:Wa,sparkline:Ka,slope:Ua,dumbbell:Xa,lollipop:Ya,beeswarm:Ja,ridgeline:qa,sankey:Za,chord:Qa,calendar:es,bump:ts,box:ns,parallel:rs,candlestick:os,segmented:is,skyline:as,histogram:ss,scatter:ps,tileMap:ls,barRace:cs,network:us,timeline:ms,tree:ds,choropleth:fs,symbolMap:hs,flowMap:gs},st={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"},barRace:{component:"BarRace",name:"Bar race",nameKo:"막대 레이스"},network:{component:"NetworkChart",name:"Network",nameKo:"네트워크"},timeline:{component:"Timeline",name:"Timeline",nameKo:"타임라인"},tree:{component:"Tree",name:"Tree",nameKo:"트리"},choropleth:{component:"Choropleth",name:"Choropleth map",nameKo:"단계구분도"},symbolMap:{component:"SymbolMap",name:"Symbol map",nameKo:"기호 지도"},flowMap:{component:"FlowMap",name:"Flow map",nameKo:"흐름 지도"}};function so(e,t){return t==="ko"?e.nameKo:e.name}function lo(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var co=["line","area","bar","scatter"],uo=24,jn=["line","area","bar","scatter","timeline"];function Gn(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function mo(e,t,n){return jn.includes(e)&&!Gn(e,t,n).length&&!(e==="scatter"&&Yt(n))}function Yt(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function fo(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var bs={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap"};function Jt(e){let t=io[e]?e:bs[e]??Object.keys(st).find(n=>n.toLowerCase()===e.toLowerCase()||st[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!st[t]))return{type:t,component:st[t].component,name:st[t].name,nameKo:st[t].nameKo,encoding:io[t]}}function ho(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of Jt(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}function go(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function ys(e,t){if(e==null||typeof e!="object")return;let n=e;if(go(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!go(r,o))return;r=r[o]}return r}}function xe(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function Oe(e,t){if(typeof e=="function")return e;let n=e??t;return r=>ys(r,n)}function qt(e,t){let n=Oe(e,t);return(r,o)=>xe(n(r,o))}function ke(e,t){let n=Oe(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function Se(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function xs(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
|
|
23
|
+
`||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var ks=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function po(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(ks.test(t)||/^[-+]?\.\d+$/.test(t)){let n=xe(t);if(Number.isFinite(n))return n}return t}function Ye(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??xs(o),i=[],s=[],l="",c=!1;for(let f=0;f<o.length;f++){let p=o[f];c?p==='"'?o[f+1]==='"'?(l+='"',f++):c=!1:l+=p:p==='"'&&!l.trim()?(c=!0,l=""):p===a?(s.push(l),l=""):p===`
|
|
24
|
+
`||p==="\r"?(p==="\r"&&o[f+1]===`
|
|
25
|
+
`&&f++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let d=i.filter(f=>!(f.length===1&&f[0].trim()===""));if(!d.length)return[];let u=f=>n?po(f):f;if(!r)return d.map(f=>Object.fromEntries(f.map((p,$)=>[String($),u(p)])));let m=[],h=new Set;return d[0].forEach((f,p)=>{let $=f.trim()||`col${p+1}`,b=$;for(let M=2;h.has(b);M++)b=`${$}_${M}`;h.add(b),m.push(b)}),d.slice(1).map(f=>Object.fromEntries(m.map((p,$)=>[p,u(f[$]??"")])))}function Vn(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof i[l]=="string"?po(i[l]):i[l]??null])))}function ws(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,l)=>Object.fromEntries(a.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function bo(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function Ge(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Ge(JSON.parse(t))}catch{}return Ye(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Vn(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?Ge(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Vn(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?Ge(t.rows):Array.isArray(t.values)?Vn(t.values):Array.isArray(t.items)?Ge(t.items):Array.isArray(t.results)?Ge(t.results):ws(t)}return[]}function Zt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}function Wn(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(l,c)=>{let d=e[l][c];return Number.isFinite(d)&&d>0?d:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let d=0,u=0;for(let m=0;m<n;m++){let h=i(m,c),f=h-i(m,c-1),p=0;for(let $=0;$<m;$++)p+=i($,c)-i($,c-1);d+=h,u+=(f/2+p)*h}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,m=0;for(let h=0;h<n;h++){let f=e[h][l],p=Number.isFinite(f)?f:0;p>=0?(o[h][l]=u,u+=p,a[h][l]=u):(o[h][l]=m,m+=p,a[h][l]=m)}continue}let c=0;for(let u=0;u<n;u++)c+=i(u,l);let d=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let m=i(u,l);t==="expand"&&(m=c?m/c*100:0),o[u][l]=d,d+=m,a[u][l]=d}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,a[n-1]?.[u]??0);let d=0;for(let u=0;u<r;u++)d+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;d/=r;for(let u=0;u<n;u++)for(let m=0;m<r;m++)o[u][m]-=d,a[u][m]-=d}return{y0:o,y1:a}}function yo(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function xo(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((m,h)=>{m>u&&(u=m,d=h)}),d}),r=e.map(c=>c.reduce((d,u)=>d+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,d)=>d).sort((c,d)=>n[c]-n[d]),a=[],i=[],s=0,l=0;for(let c of o)s<l?(a.push(c),s+=r[c]):(i.push(c),l+=r[c]);return[...i.reverse(),...a]}var vs=Math.PI*2;function ko(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function Kn(e,t){let n=0,r=e.length-1;if(r<0)return-1;for(;r-n>1;){let o=n+r>>1;e[o]<t?n=o:r=o}return Math.abs(e[n]-t)<=Math.abs(e[r]-t)?n:r}function Qt(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function vo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function wo(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var en=new Map;function re(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=en.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);vo(c)?i+=wo(c):s+=wo(c)}a=i+s*(n>=600?1.07:1),en.size>5e3&&en.clear(),en.set(o,a)}return a*t}function lt(e,t,n,r=400){if(e=e.trim(),re(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;re(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(vo(s.charCodeAt(0))?2:3)?"":s+o}function $o(e,t,n=0){return e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n}var kt=_(j(),1),$s=e=>Array.isArray(e)&&e.length===2;function To(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&$s(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var Ts=(e,t)=>re(e,10.5,t?700:500)+8;function tn(e,t,n,r="start",o){let a=Ts(e,o);return{x:r==="end"?t-a:t,y:n-8,w:a,h:16}}function Mo({p:e,x:t,y:n,text:r,anchor:o="start",strong:a}){let i=tn(r,t,n,o,a);return(0,kt.jsxs)("g",{children:[(0,kt.jsx)("rect",{x:i.x,y:i.y,width:i.w,height:i.h,rx:5,fill:e.paint("panel"),opacity:.94}),(0,kt.jsx)(Ce,{x:i.x+4,y:n,size:10.5,weight:a?700:500,fill:e.paint(a?"ink":"muted"),children:r})]})}var Ao=_(j(),1),ct=10.5;function Ms(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let i=1;i<e.length;i++)o=Math.min(o,Math.abs(e[i]-e[i-1]));let a=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(i=>Ue(i,{locale:n,maximumFractionDigits:a}))}function Co(e,t,n){let r=18;for(let o of Ms(e,t,n))r=Math.max(r,re(o,ct));return Math.ceil(r+8)}function So(e,t,n){let r=[],o=-1/0;for(let a of e){let i=re(a.label,ct),s=Math.max(a.x-i/2,0);s<o+8||a.x-i/2<t||a.x+i/2>n||(r.push(a),o=s+i)}return r}function Un(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=e/Math.max(1,t),r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r;return(o>=7.071?10:o>=3.162?5:o>=1.414?2:1)*r}function Ve(e,t,n=4,r={}){let o=e,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,l=Un(i,n),c=[o,a];for(let d=0;d<4;d++){let u=Math.ceil(a/l-1e-9)*l,m=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-m<=l*.3?m:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let h=Un(c[1]-c[0],n);if(h===l)break;l=h}return c}function No(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=Un(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,c=0;l<=o+a*1e-9&&c<200;l+=a,c++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function wt(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(l=>o+(l-n)*i);return s.domain=e,s.range=t,s.invert=l=>i===0?n:n+(l-o)/i,s.ticks=(l=4)=>No(n,r,l),s}function Xn(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[a,i]=Ve(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function Cs(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(c,d=1)=>{let u=[];for(let m=Math.floor(r);m<=Math.ceil(o);m++)if(!(m%d))for(let h of c){let f=Number((h*10**m).toPrecision(12));f>=e*(1-1e-9)&&f<=t*(1+1e-9)&&u.push(f)}return u},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:No(e,t,3)}function Ro(e,t){let n=wt([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>Cs(e[0],e[1],Math.abs(t[1]-t[0])),r}function vt(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var Ss=864e5;function nn(e,t,n,r=se){let o=t-e;if(!(o>0))return[{t:e,label:Ee(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Ss,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,m,h=!1)=>{let f=new Date(d),p=-1,$=0;for(;f.getTime()<=t&&$++<500;){if(f.getTime()>=e){let b=f.getFullYear(),M=h&&!l&&b!==p;i.push({t:f.getTime(),label:Ee(f,{locale:r,...m,...M?{year:"numeric"}:{}})}),p=b}u(f)}};if(a<=1.5){let d=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=d)??12,m=new Date(s);m.setMinutes(0,0,0),c(m,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(d,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());d.setDate(d.getDate()+(8-d.getDay())%7),c(d,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let d=a/30.44,u=Math.max(1,Math.ceil(d/Math.max(1,n))),m=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(m>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(h,f=>f.setFullYear(f.getFullYear()+m/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=h.getMonth()%m;f&&h.setMonth(h.getMonth()+(m-f)),c(h,p=>p.setMonth(p.getMonth()+m),{month:"short"},!0)}}return i}function Fo(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var As=(e,t,n)=>e==="date"?at(t,n)?.getTime()??NaN:xe(t);function Ns(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Ht(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function $t(e,t,n,r,o={}){let a=Oe(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:Oe(n,"y"),c=!i&&r!==void 0?Oe(r,"series"):null,d=e.map((A,k)=>a(A,k)),u=o.xType??Ns(d),m=o.locale??se,h,f,p;if(u==="band"){let A=d.map(T=>String(T??""));h=Se(A);let k=new Map(h.map((T,O)=>[T,O]));f=h.map((T,O)=>O),p=Int32Array.from(A,T=>k.get(T)??-1)}else{let A=u==="date"?o.dayFirst??jt(d):void 0,k=d.map(G=>As(u,G,A)),T=Array.from(new Set(k.filter(G=>Number.isFinite(G)))).sort((G,le)=>G-le),O=new Map(T.map((G,le)=>[G,le]));f=T,h=T.map(String),p=Int32Array.from(k,G=>O.get(G)??-1)}let $=o.dateFormat,b=A=>typeof A=="string"?Bt(A.trim())?.[3]:void 0,M=u==="date"&&d.length<5e3?b(d[0]):void 0,C=(M===2||M===3)&&d.every(A=>b(A)===M),R=C&&M===3;if(u==="date"&&!$){let A=f.length>1?f[f.length-1]-f[0]:0;$=C&&M===2||A>864e5*120?{month:"short"}:A<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},A>864e5*800&&($={year:"numeric",month:"short"})}let x;if(u==="band")x=h;else if(R&&!o.dateFormat){let A=Q(m)==="ko";x=f.map(k=>{let T=new Date(k),O=Math.floor(T.getMonth()/3)+1;return A?`${T.getFullYear()}년 ${O}분기`:`Q${O} ${T.getFullYear()}`})}else{let A=f.every(En),k=u==="date"?new Intl.DateTimeFormat(m,$):new Intl.NumberFormat(m,A?{useGrouping:!1}:{maximumFractionDigits:6});x=f.length>1e3?Fo(f.length,T=>k.format(f[T])):f.map(T=>k.format(T))}let P=s?[...s]:c?Se(e.map((A,k)=>String(c(A,k)??""))):[""],E=new Map(P.map((A,k)=>[A,k])),I=P.map(()=>new Array(h.length).fill(NaN)),B=P.map(()=>new Array(h.length).fill(null)),z=o.aggregate??"sum",w=z==="mean"?P.map(()=>new Uint32Array(h.length)):null,S=(A,k,T,O)=>{let G=I[A][k];z==="last"?I[A][k]=T:z==="count"?I[A][k]=(Number.isFinite(G)?G:0)+1:z==="mean"?Number.isFinite(T)&&(I[A][k]=(Number.isFinite(G)?G:0)+T,w[A][k]++):I[A][k]=Number.isFinite(G)?G+(Number.isFinite(T)?T:0):T,B[A][k]=O};for(let A=0;A<e.length;A++){let k=p[A];if(k<0)continue;let T=e[A];if(s)for(let O=0;O<s.length;O++)S(O,k,xe(T[s[O]]),T);else{let O=c?E.get(String(c(T,A)??""))??0:0;S(O,k,xe(l(T,A)),T)}}if(w)for(let A=0;A<I.length;A++)for(let k=0;k<h.length;k++)w[A][k]>1&&(I[A][k]/=w[A][k]);return{type:u,keys:h,xnum:f,labels:x,series:P,values:I,rows:B}}var Rs=140,Mt=12,Po=14,Yn=20,_o=12.5;function Fs(e,t,n=uo){let r=ke(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),c=o.get(l);c?c.push(i):o.set(l,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function Ps(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Mt)/(Rs+Mt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function _s(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*Mt)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var Tt=e=>e.filter(Number.isFinite);function rn(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=qt(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return Tt(n)}function Do(e,t,n,r,o,a){return $t(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function Ds(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let x=t.flat(),P=r.refLines??{},[E,I]=vt([...rn(x,r.x??"x"),...Tt([Number(P.x)])]),[B,z]=vt([...rn(x,r.y??"y"),...Tt([Number(P.y)])].filter(S=>!s||S>0)),w=r.zero??!1;return{y:c??(s?Xn(B,z,i):Ve(B,z,i,{zero:w,pad:.08})),x:r.xDomain??Ve(E,I,Math.max(2,Math.round(o/110)),{zero:w,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",m=n[0]?.keys.join(""),h=n.every(x=>x.keys.join("")===m),f=n.length>0&&n.every(x=>x.type!=="band"&&x.type===n[0].type),p=r.xDomain??(!d&&f?vt(n.flatMap(x=>Tt(x.xnum))):void 0),$=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if($==="percent")return{x:p,sameKeys:h};if(c)return{y:c,x:p,sameKeys:h};let b=[];t.forEach((x,P)=>{let E=n[P];if($==="stacked"||$==="auto"&&E.series.length>1){let B=Wn(E.values,"zero");B.y0.forEach(z=>b.push(...z)),B.y1.forEach(z=>b.push(...z))}else E.values.forEach(B=>b.push(...B));d&&!u&&r.line!==void 0&&Do(e,x,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(B=>b.push(...B)),d||b.push(...rn(x,r.lower),...rn(x,r.upper))}),d&&b.push(0),u||b.push(...To(r.annotations));for(let x of r.referenceLines??[])b.push(x.y);r.signColors&&b.push(Number(r.baseline??0));let[M,C]=vt(Tt(b).filter(x=>!s||x>0));return{y:s?Xn(M,C,i):d?Ve(M,C,u?Math.max(2,Math.round(o/120)):i):Ve(M,C,i,{zero:r.zero??e==="area"}),x:p,sameKeys:h}}function Ls(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=$t(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?Ro:wt)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),d=Co(c,zt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(x=>x.series),m=r.endLabels??n.some(x=>x.series.length>1),h=d+6,f=a-(m?Math.min(a*.28,Math.max(...u.map(x=>re(x,11,700)),20)+14):10),p=l.keys.length,[$,b]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,M=l.type==="number"?p>12:p>nn($,b,Math.max(2,Math.floor((f-h)/64)),s).length;if(l.type==="band"||!p||M)return;let C=x=>h+(l.xnum[x]-$)/(b-$)*(f-h),R=x=>re(l.labels[x],ct);for(let x=1;;x++){let P=Array.from({length:Math.ceil(p/x)},(E,I)=>I*x);if(x>=p||P.every((E,I)=>!I||C(E)-C(P[I-1])>=(R(E)+R(P[I-1]))/2+8))return P.map(E=>({value:l.xnum[E],label:l.labels[E]}))}}function Es(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function Os(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${Es(`${e}|${t}|${o}|${Zt(r)}`)}`}function Is(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var zs={en:{intro:(e,t)=>`${Le(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}},Jn=18;function Lo(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=Fs(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Ps(s,i,e.columns),{pw:c,ph:d}=_s(s,l,e.height),u=e.scale!=="free",m=t==="scatter"?[]:o.map(w=>Do(t,w,n,n.y,n.series,n.aggregate)),h=u?Ds(t,o,m,n,c,d):{sameKeys:!1},f=u?Ls(t,o,m,n,h,c,d,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",$=u&&(!p||h.sameKeys),b=u&&(p||h.x!==void 0||h.sameKeys),M=new Set(Is(e.highlight,r)?[e.highlight].flat():[]),C=M.size>0,R=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,x=e.syncId??Os(t,e.by,n,e.data),P=it(Xe(n.format,e.locale),n.unit),E=zs[e.lang],I=[],B=r.map(w=>w===""?E.blank:w);return{panels:r.map((w,S)=>{let A=o[S],k=B[S],T=S%l,O;if(t!=="scatter"){let le=m[S],Ne=ge=>le.values.reduce((X,ft)=>X+(Number.isFinite(ft[ge])?ft[ge]:0),0),H=le.keys.map((ge,X)=>X).filter(ge=>le.values.some(X=>Number.isFinite(X[ge]))),U=H[H.length-1];I.push({first:H.length?Ne(H[0]):NaN,last:H.length?Ne(U):NaN,total:H.reduce((ge,X)=>ge+Ne(X),0)}),t!=="bar"&&le.series.length===1&&U!==void 0&&(O=P(le.values[0][U]))}else I.push({first:NaN,last:NaN,total:A.length});let G={data:A,width:c,height:d,ariaLabel:e.title?`${e.title}, ${k}`:k,syncId:x,highlight:C?M.has(w)?R?()=>!0:void 0:"none":e.highlight,showYAxis:!$||T===0,showXAxis:!b||S+l>=i};return h.y&&(G.yDomain=h.y),h.x&&(G.xDomain=h.x),f&&(G.xTicks=f),{value:w,label:k,props:G,last:O,isPicked:M.has(w)}}),cols:l,pw:c,ph:d,isPanelPick:C,description:Bs(t,e.by,B,I,a,P,E)}}function Bs(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>Qt(r.map(d=>d[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=i.endHigh(n[c],a(r[c].last)));let d=n.filter((u,m)=>r[m].last<r[m].first);s+=d.length?i.falling(`${d.slice(0,5).join(", ")}${d.length>5?i.more:""}`):i.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?i.total(n[c],a(r[c].total)):i.points(n[c],r[c].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var he=_(J(),1);function Hs(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function js(e,t,n=1/0){let r=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=Math.min(r*.5,n))}var on={threshold:.25,enoughPx:96,rootMargin:"0px"};function Io(e,t=!0){let[n,r]=(0,he.useState)({visible:!t,near:!t});return(0,he.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=js(i[i.length-1],on.threshold,on.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:Hs(on.threshold),rootMargin:on.rootMargin}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Eo(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function an(e){let[t,n]=(0,he.useState)(null),[r,o]=(0,he.useState)(e??null),a=(0,he.useCallback)(i=>{n(i),i&&e===void 0&&o(Eo(i))},[e]);return Pe(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(d=>d!==null&&Math.abs(d-c)<.5?d:c),s=()=>i(Eo(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let d=c[c.length-1]?.contentRect;d?i(d.width>0?Math.round(d.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var Gs=()=>()=>{};function ut(){return(0,he.useSyncExternalStore)(Gs,()=>!0,()=>!1)}var Oo="(prefers-reduced-motion: reduce)";function sn(e="auto"){let[t,n]=(0,he.useState)(()=>$e&&typeof window.matchMedia=="function"?window.matchMedia(Oo).matches:!1);return(0,he.useEffect)(()=>{if(e!=="auto"||!$e||typeof window.matchMedia!="function")return;let r=window.matchMedia(Oo),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Ae=_(j(),1),Vs=60,Ws=420;function zo(e){let t=Me(),n=e.chartProps??{},[,r,o]=an(e.width),a=e.width??(o||480),i=de(e.locale??n.locale),s=Q(i),l=(0,mt.useContext)(nt),c=e.title??l,d=e.chart.facetPlan,u=(0,mt.useMemo)(()=>{let b=Lo({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:c,locale:i,lang:s});return d?d(b,n,i):b},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(b,M)=>typeof M=="function"?String(M):M),e.highlight,e.syncId,a,e.height,c,i,s,d]),m=`${(0,mt.useId)().replace(/:/g,"")}fd`,h=sn(n.reducedMotion??"auto"),f=ut(),p=_r({motion:{enabled:n.animate!==!1&&!h&&$e},hydrated:f},{waiting:!1,generation:0}),$=e.chart;return(0,Ae.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":m,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Ae.jsx)("p",{id:m,style:Xt,children:e.description??u.description}),(0,Ae.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:Mt,rowGap:Po,...u.legend?{marginTop:Jn}:null},children:u.panels.map((b,M)=>{let C=t.paint(b.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,Ae.jsxs)("div",{"data-facet":b.value,style:{minWidth:0,...Pr(p,!1,"fade",M*Vs,Ws)},children:[(0,Ae.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Yn,fontSize:_o,fontWeight:700,lineHeight:`${Yn}px`,color:C},children:[(0,Ae.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.label}),b.last!==void 0?(0,Ae.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:b.last}):null]}),(0,Ae.jsx)($,{...n,...b.props})]},b.value)})}),u.legend?(0,Ae.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:Jn},children:u.legend}):null]})}var Bo=["max","min","first","last","none"];function _e(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let d=-1,u=c==="max"?-1/0:1/0;r.forEach((m,h)=>{Number.isFinite(m)&&(c==="max"?m>u:m<u)&&(u=m,d=h)}),d>=0&&a.add(d)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,d)=>{d<i&&c!==null&&c!==void 0&&e(c,d)&&a.add(d)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((d,u)=>{d===c&&a.add(u)});return a}var we=_(J(),1);async function Ks(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(Q(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Ye(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return Ye(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):Ye(a)}async function Us(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await Ks(a,t.parse,o,t.locale)}return t.select&&(r=bo(r,t.select)),t.transform?t.transform(r):Ge(r)}function Ho(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,we.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,we.useState)(0),c=de(t.locale),d=(0,we.useRef)(t);d.current={...t,locale:c};let u=(0,we.useRef)(e);u.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],f=JSON.stringify(h.map(b=>typeof b=="object"?JSON.stringify(b):String(b))),p=(0,we.useRef)(!1);(0,we.useEffect)(()=>{let b=u.current;if(!b||!r){i(R=>R.status==="loading"?{...R,status:"idle"}:R);return}let M=new AbortController,C=!0;return p.current=!0,i(R=>({...R,data:o?R.data:[],status:"loading",error:null})),Us(b,{...d.current,signal:M.signal}).then(R=>{C&&i({data:R,status:"success",error:null,updatedAt:Date.now()})}).catch(R=>{!C||M.signal.aborted||i(x=>({...x,status:"error",error:R instanceof Error?R:new Error(String(R))}))}).finally(()=>{C&&(p.current=!1)}),()=>{C=!1,p.current=!1,M.abort()}},[m,r,s,f,o]),(0,we.useEffect)(()=>{if(!n||!r)return;let b=setInterval(()=>{p.current||l(M=>M+1)},n);return()=>clearInterval(b)},[n,r]);let $=(0,we.useCallback)(()=>l(b=>b+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:$}}var Zn=_(j(),1),Xs=["csv","svg","png"],Ys=/^[=+\-@\t\r\n=+-@]/,Js=/var\(|color-mix\(/;function jo(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?Yr(e.getTime()):String(e);return`"${(Ys.test(t)&&!Number.isFinite(xe(t))?`'${t}`:t).replace(/"/g,'""')}"`}function qs(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Zs(e,t){return`\uFEFF${[t.map(jo),...e.map(r=>t.map(o=>jo(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
|
+
`)}\r
|
|
27
|
+
`}function Qs(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function qn(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Go=2,We=16;function Vo(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function Wo(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let[r,o]of Object.entries(t))n.setAttribute(r,String(o));return n}function Ko(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,l]=[a+We*2,i+We*2],c=o.cloneNode(!0),d=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((f,p)=>{let $;for(let b of Array.from(f.attributes)){if(!Js.test(b.value))continue;let M=($??($=getComputedStyle(f))).getPropertyValue(b.name);M&&d[p].setAttribute(b.name,Vo(M,u))}}),c.removeAttribute("style");for(let[f,p]of Object.entries({viewBox:`${-We} ${-We} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(f,String(p));let m=Vo(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let f=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Wo("rect",{x:-We,y:-We,width:s,height:l,fill:m}),f),h&&c.insertBefore(Wo("image",{href:h.toDataURL(),width:a,height:i}),f)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:m,canvas:h}}function el(e,t){let n=Ko(e,Go,!1);if(!n)return;let r=Go,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,We*r,We*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(l=>l&&qn(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function Uo(e){let t=Me(e.theme),n=Q(de(e.locale))==="ko",r=Qs(e.filename),o=(a,i)=>{if(a==="csv")return qn(new Blob([Zs(e.data,e.columns?.length?e.columns:qs(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return el(i,r);let s=Ko(i,1,!0);s&&qn(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Zn.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Xs.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,Zn.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(a,l.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var Yo=_(j(),1);function Xo(e,t=se){let n=Xe(void 0,t),r=e.split(`
|
|
28
|
+
`),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Ee(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(qr,(d,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Yo.jsx)("div",{children:s},l)):null}}var qo=e=>e==null||e==="";function Qn(e){if(qo(e))return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"x":"d";if(typeof e=="number")return Number.isFinite(e)?"n":"x";if(typeof e=="string"){let t=e.trim();return Ht(t)?"d":Number.isFinite(xe(t))?"n":t?"x":""}return"x"}function Zo(e,t,n={}){let r=ke(t.label,"label"),o=Oe(t.start,"start"),a=Oe(t.end,"end"),i=t.group===void 0?null:ke(t.group,"group"),s=t.status===void 0?null:ke(t.status,"status"),l=e.map((w,S)=>o(w,S)),c=e.map((w,S)=>a(w,S)),d=l.concat(c),u=n.xType,m=0,h=0;if(!u){for(let w of d){let S=Qn(w);S==="d"?m++:S==="n"&&h++}u=m>h?"date":"number"}let f=!n.xType,p=u==="date"?n.dayFirst??jt(d):void 0,$=u==="date"?"d":"n",b=w=>f&&Qn(w)!==$?NaN:u==="date"?at(w,p)?.getTime()??NaN:xe(w),M=w=>f&&Qn(w)===($==="d"?"n":"d"),C={swapped:0,open:0,noStart:0,badEnd:0,mixed:0,duplicate:0},R=[],x=-1/0;for(let w=0;w<e.length;w++){let S=b(l[w]),A=b(c[w]);if(!Number.isFinite(S)){M(l[w])?C.mixed++:C.noStart++;continue}let k=!Number.isFinite(A)&&qo(c[w]);if(!Number.isFinite(A)&&!k){M(c[w])?C.mixed++:C.badEnd++;continue}k?C.open++:A<S&&([S,A]=[A,S],C.swapped++),x=Math.max(x,k?S:A);let T=e[w];R.push({i:w,label:r(T,w),start:S,end:A,open:k,point:!k&&A===S,group:i?i(T,w):"",status:s?s(T,w):"",datum:T})}let P=n.now===void 0?NaN:b(n.now),E=new Set;for(let w of R){w.open&&(w.end=Number.isFinite(P)&&P>=w.start?P:Math.max(x,w.start),w.point=w.end===w.start);let S=`${w.label}${w.start}${w.end}${w.group}`;E.has(S)?C.duplicate++:E.add(S)}let I=u==="date",B=I&&R.length>0&&R.every(w=>Jo(w.start)&&Jo(w.end)),z=I&&!B&&R.some(w=>new Date(w.start).getSeconds()||new Date(w.end).getSeconds());return{kind:u,items:R,issues:C,dateOnly:B,hasSeconds:z,read:b}}function ln(e,t,n=!1){let r=ke(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=Se(o);if(!n)return a;let i=new Map;for(let s of o)i.set(s,(i.get(s)??0)+1);return a.map((s,l)=>[s,l]).sort((s,l)=>i.get(s[0])-i.get(l[0])||s[1]-l[1]).map(([s])=>s)}var Je=864e5;function Qo(e){let t=1/0,n=-1/0;for(let o of e.items)o.start<t&&(t=o.start),o.end>n&&(n=o.end);if(t===1/0)return[0,1];if(e.kind==="number")return Ve(t,n,5,{zero:!1});let r=e.dateOnly?Je:Je/2;return t===n?[t-r,n+r]:[t,n]}var Jo=e=>{let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0&&t.getMilliseconds()===0};function ei(e,t="none"){let n=new Map;e.forEach((i,s)=>{let l=n.get(i.label);l?l.push(s):n.set(i.label,[s])});let r=new Int32Array(e.length),o=[];for(let[i,s]of n){s.sort((d,u)=>e[d].start-e[u].start||e[d].end-e[u].end||d-u);let l=[],c=[];for(let d of s){let u=e[d],m=0;for(;m<l.length&&!(l[m]<u.start||l[m]===u.start&&!(c[m]&&u.point));)m++;l[m]=u.end,c[m]=u.point,r[d]=m}o.push({label:i,items:s,lanes:l.length,lane0:0})}if(t==="start")o.sort((i,s)=>e[i.items[0]].start-e[s.items[0]].start);else if(t==="duration"){let i=l=>l.items.reduce((c,d)=>c+e[d].end-e[d].start,0),s=new Map(o.map(l=>[l,i(l)]));o.sort((l,c)=>s.get(c)-s.get(l))}let a=0;for(let i of o)i.lane0=a,a+=i.lanes;return{rows:o,lane:r}}function ti(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return Ye(t.csv)}return null}var mi=_(J(),1);var qe=_(J(),1);var ve=_(j(),1),tl={zoomHint:" Press Enter to zoom in.",pickHint:" Press Enter to select.",high:"High",low:"Low",resetLabel:"Show all (reset zoom)",reset:"Show all",extremes:(e,t)=>`, high ${e}, low ${t}`,range:(e,t)=>`${e} to ${t}`},nl={en:tl,ko:{zoomHint:" Enter를 누르면 확대해요.",pickHint:" Enter를 누르면 이 구간을 골라요.",high:"최고",low:"최저",resetLabel:"전체 보기(확대 풀기)",reset:"전체 보기",extremes:(e,t)=>`, 최고 ${e}, 최저 ${t}`,range:(e,t)=>`${e}~${t}`}},rl=4;function ol(e){let[t,n]=(0,qe.useState)(null),[r,o]=(0,qe.useState)(!1),a=(0,qe.useRef)(null),i=(0,qe.useRef)(null),s=()=>{a.current=null,i.current=null,o(!1),n(null)},l=(m,h,f)=>!e.enabled||e.count<2||f.pointerType==="touch"||f.button!==0||!e.inPlot(m,h)?!1:(a.current={i:e.indexAt(m),x:m,moved:!1},f.currentTarget.setPointerCapture?.(f.pointerId),!0),c=m=>{let h=a.current;if(!h)return!1;if(!h.moved&&Math.abs(m-h.x)<rl)return!0;h.moved=!0;let f=e.indexAt(m),p=Math.min(h.i,f),$=Math.max(h.i,f);return o(!0),n(b=>b?.from===p&&b.to===$?b:{from:p,to:$}),!0},d=(m,h,f)=>{let p=a.current;if(a.current=null,f.currentTarget.hasPointerCapture?.(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),!p)return;if(o(!1),!p.moved||f.type==="pointercancel"){t&&(n(null),e.onCommit(null));return}let $=e.indexAt(m),b={from:Math.min(p.i,$),to:Math.max(p.i,$)},M=b.to>b.from;n(M&&e.keep!==!1?b:null),e.onCommit(M?b:null)},u=(m,h)=>{if(!e.enabled)return!1;if(m.key==="Escape"&&t)return s(),e.onCommit(null),!0;if(m.key==="Enter"&&t&&i.current!==null)return i.current=null,e.keep===!1&&n(null),e.onCommit(t),!0;if(!m.shiftKey||m.key!=="ArrowLeft"&&m.key!=="ArrowRight"||e.count<2)return!1;let f=m.key==="ArrowRight"?1:-1,p=i.current??h??(f>0?0:e.count-1),$=t&&i.current!==null?t.from===p?t.to:t.from:p,b=Math.max(0,Math.min(e.count-1,$+f));return i.current=p,n(b===p?null:{from:Math.min(p,b),to:Math.max(p,b)}),!0};return{range:t,dragging:r,keyboard:t!==null&&i.current!==null,down:l,move:c,up:d,key:u}}function ni(e){let[t,n]=(0,qe.useState)(null);return t&&t.sig!==e&&n(null),{view:t&&t.sig===e?t.range:null,zoomTo:r=>n({sig:e,range:r}),reset:()=>n(null)}}function ri(e,t,n){let r=nl[n.lang],o=e.brush==="zoom"?"zoom":e.brush?"select":null,a=ol({enabled:o!==null,count:n.count,indexAt:n.indexAt,inPlot:n.inPlot,keep:o!=="zoom",onCommit:l=>{let c=l?n.toXRange(l):null;e.onBrush?.(c),o==="zoom"&&c&&c.to>c.from&&t.zoomTo([c.from,c.to])}}),i={onPointerDown:o?a.down:void 0,onPointerUp:o?a.up:void 0,onKey:o?l=>l.key==="Escape"&&t.view&&!a.range?(t.reset(),!0):a.key(l,n.active):void 0,overlay:t.view?(0,ve.jsx)(il,{p:n.p,onReset:t.reset,text:r}):null},s=a.keyboard?o==="zoom"?r.zoomHint:r.pickHint:"";return{brush:a,frame:i,hint:s,text:r}}function oi(e){let{p:t,top:n,bottom:r}=e,o=Math.min(e.x0,e.x1),a=Math.max(e.x0,e.x1),i=re(e.main,11.5,800),s=re(e.sub,10.5,500)+6,l=i+s+16,c=Math.max(2,Math.min(e.width-l-2,(o+a)/2-l/2)),d=n+4;return(0,ve.jsxs)("g",{pointerEvents:"none","aria-hidden":"true",children:[(0,ve.jsx)("rect",{x:o,y:n,width:Math.max(1,a-o),height:Math.max(0,r-n),fill:t.paint("accent"),opacity:e.dragging?.1:.14}),(0,ve.jsx)("line",{x1:o,x2:o,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,ve.jsx)("line",{x1:a,x2:a,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,ve.jsx)("rect",{x:c,y:d,width:l,height:22,rx:8,fill:t.paint("panel"),stroke:t.paint("line")}),(0,ve.jsx)(Ce,{x:c+8,y:d+11,size:11.5,weight:800,fill:t.paint("ink"),children:e.main}),(0,ve.jsx)(Ce,{x:c+8+i+6,y:d+11,size:10.5,weight:500,fill:t.paint("muted"),children:e.sub})]})}function il(e){let{p:t}=e;return(0,ve.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onReset,"aria-label":e.text.resetLabel,style:{position:"absolute",top:0,right:0,height:24,padding:"0 10px",borderRadius:12,border:`1px solid ${t.paint("line")}`,background:t.paint("panel"),color:t.paint("muted"),fontSize:11.5,fontWeight:600,zIndex:4},children:e.text.reset})}var ne=_(J(),1);function ii(e,t){let n=Me(e.theme),[r,o,a]=an(e.width),i=ut(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=sn(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&$e,m=Io(r,e.animateOnView!==!1&&u),h=de(e.locale),f=Q(h),p=(0,ne.useMemo)(()=>Xe(e.format,h,t.format),[e.format,h,t.format]),$=(0,ne.useCallback)(H=>It(H,{locale:h}),[h]),b=(0,ne.useMemo)(()=>it(p,e.unit),[p,e.unit]),M=(0,ne.useMemo)(()=>Zt(e.data),[e.data]),[C,R]=(0,ne.useState)(null),[x,P]=(0,ne.useState)(null),E=(0,ne.useRef)([]),I=(0,ne.useRef)(e.onHover);I.current=e.onHover;let B=(0,ne.useRef)(e.onClick);B.current=e.onClick;let z=(0,ne.useRef)(null),w=(0,ne.useRef)(null),S=(0,ne.useRef)(null),A=(0,ne.useCallback)((H,U="pointer")=>{if(S.current!==H){S.current=H;let ge=H===null?null:E.current[H]??null;queueMicrotask(()=>I.current?.(ge)),w.current?.(H)}z.current=H===null?null:U,R(H),P(z.current)},[]),k=(0,ne.useCallback)(H=>{z.current!=="keyboard"&&(z.current=H===null?null:"sync",R(H),P(z.current))},[]),T=(0,ne.useCallback)(H=>{let U=E.current[H];U&&B.current?.(U)},[]),O=no(e.replayKey),G=e.width!==void 0||(a??0)>0,le={enabled:u,active:m.visible&&G,near:m.near,replayKey:O,dataKey:M,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},Ne=(0,ne.useCallback)((H,U=1)=>C===null||C===H?U:U*.38,[C]);return{p:n,width:s,height:c,measured:G,responsive:e.width===void 0,pending:$e&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:le,fv:b,fmt:p,pct:$,locale:h,lang:f,t:f==="ko"?Lr:Dr,active:C,via:x,setActive:A,click:T,events:E,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:Ne,sig:M,description:e.description,reduced:d,publish:w,applySync:k}}var ee=_(J(),1);function al(e){return 1-Math.pow(1-e,3)}function sl(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function ll(e){return e==="easeInOut"?sl:e==="linear"?t=>t:al}function cl(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function dt(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function cn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(Number.isNaN(r)!==Number.isNaN(o)||Math.abs(r-o)>1e-6)return!1}return!0}function ai(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function si(e,t,n,r){if(!t||!n||t.length!==n.length)return dt(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let l of dt(s,n[i]))o.push(l)}return o.length===r?o:dt(e,r)}var un=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let o=this.tracks.get(r.key);if(!o||o.exiting||!cn(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),ai(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=cn(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),l=r>0?Math.min(a*r,240):0;if(s){let c=i.to.length;s.from=si(s.cur,s.parts,i.parts,c),s.vel=si(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),ai(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=cn(s.from,s.to)&&s.vel.every(d=>Math.abs(d)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=cn(c.from,c.to),this.tracks.set(i.key,c)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=dt(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=ll(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=dt(s.from,c)),s.vel.length!==c&&(s.vel=dt(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let d;if(this.easing==="spring"){let u=Math.exp(-a*l),m=a*l>=8&&a*l<20,h=0;for(let f=0;f<c;f++){let p=s.from[f]-s.to[f],$=s.vel[f]+a*p;s.cur[f]=s.to[f]+(p+$*l)*u,s.curVel[f]=(s.vel[f]-a*$*l)*u,m&&h<.15&&(h=Math.max(h,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/a)))}d=a*l>=20||m&&h<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),m=r(u),h=cl(this.easing,u)/o;for(let f=0;f<c;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*m,s.curVel[f]=(s.to[f]-s.from[f])*h;d=u>=1,s.progress=m}if(d){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Ct=new Set,mn=0;function li(e){mn=0;let t=Array.from(Ct);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ct.delete(n)}Ct.size&&typeof requestAnimationFrame<"u"&&(mn=requestAnimationFrame(li))}function ci(e){return Ct.add(e),!mn&&typeof requestAnimationFrame<"u"&&(mn=requestAnimationFrame(li)),()=>{Ct.delete(e)}}function ul(e){let t=new Map,n=!1;for(let r of e){let o=(t.get(r.key)??0)+1;t.set(r.key,o),o>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let o=(t.get(r.key)??0)+1;return t.set(r.key,o),o>1?{...r,key:`${r.key}#${o}`}:r})):e}function ui(e,t){let n=(0,ee.useMemo)(()=>ul(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:d=0}=t,u=(0,ee.useRef)(null),m=(0,ee.useRef)("init"),h=(0,ee.useRef)(null),f=(0,ee.useRef)(s),p=(0,ee.useRef)(i),$=(0,ee.useRef)(!1),b=(0,ee.useRef)(0),[,M]=(0,ee.useState)(0),C=(0,ee.useRef)(null),R=(0,ee.useRef)(!0);u.current||(u.current=new un,u.current.configure(l,c),u.current.snap(n),h.current=n);let x=u.current;if(x.configure(l,c),h.current!==n){let w=m.current,S=!Object.is(f.current,s);x.sameTargets(n)?x.refreshData(n):!r||w==="init"?x.snap(n):w==="idle"?x.hold(n):w==="running"||S?x.update(n,Lt(),d):x.snap(n),h.current=n,f.current=s}let P=(0,ee.useRef)(()=>!1);P.current=w=>{if(!R.current)return!1;let S=x.step(w);return!S&&m.current==="running"&&(m.current="done"),M(A=>(A+1)%1e9),S||(C.current=null),S};let E=(0,ee.useCallback)(()=>{if(!$e||C.current||!x.animating)return;let w=S=>P.current(S);C.current=ci(w)},[x]);Pe(()=>{let w=!Object.is(p.current,i);if(p.current=i,!r){(m.current!=="done"||x.animating)&&(x.snap(h.current??n),m.current="done",M(S=>S+1));return}m.current==="init"||w&&a?(x.hold(h.current??n),m.current="idle",$.current=!1,M(S=>S+1)):w&&($.current=!0)},[r,i]),Pe(()=>{!r||!a||!$.current||($.current=!1,x.hold(h.current??n),m.current="idle",M(w=>w+1))},[a,r]),(0,ee.useEffect)(()=>{r&&o&&m.current==="idle"&&(x.start(Lt()),b.current+=1,m.current="running",E(),M(w=>w+1))},[r,o,i,x,E]),(0,ee.useEffect)(()=>{x.animating&&E()}),(0,ee.useEffect)(()=>(R.current=!0,()=>{R.current=!1,C.current?.(),C.current=null}),[]);let I=Lt(),B=x.elapsed(I),z=r&&m.current==="idle";return{items:x.items(),get:w=>x.get(w),elapsed:z?0:B,fade:(w,S=320)=>z?0:Number.isFinite(B)?Math.max(0,Math.min(1,(B-w)/S)):1,waiting:z,animating:x.animating,generation:b.current}}var er=_(j(),1);function di(e,t,n,r,o){if(r)return o==="categorical"?me(e,t,n):Gr(e,t,n);if(o==="categorical")return me(e,t,n);let a=te(e,"strong"),i=te(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var ml=_(J(),1);var tr=_(j(),1);var fi=e=>e?"neutralStrong":"accent";var nr=_(j(),1);function hi(e,t,n,r){if(typeof e!="function")return _e(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let l=o.get(r(i,s));l!==void 0&&e(i,s)&&a.add(l)}),a}var dl=_(J(),1);var or=_(j(),1),fl={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${Le(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},gi={en:fl,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},rr=["ink","muted","dim"];function pi(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,rr.length)}var hl=_(J(),1);var wi=_(j(),1),gl={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Le(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},pl={en:gl,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},bi=(e,t)=>pl[e].other(t);function yi(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,ko(o.map(a=>a.value)))}}var xi=e=>Number.isFinite(e)&&e>0?e:0;function ki(e,t,n,r){return r==="emphasis"?jr(e,t,n):me(e,t,n)}var bl=_(J(),1);var Mi=_(j(),1);function vi(e,t){return t===!1?e.map((n,r)=>r):xo(e)}function $i(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return _e(e,t,t,r,"max")}function Ti(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=te(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?te(e,"neutral"):Ot(e,1-i/Math.max(1,o.length-1))),r}function Ci(e){return!e||typeof e!="object"||Array.isArray(e)?[]:Se(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function Si(e,t){return xt(e,t+1,new Set)}var K=_(J(),1);var q=_(j(),1),yl={kind:"Timeline",start:"Start",end:"End",at:"At",duration:"Duration",status:"Status",group:"Group",open:"open",now:"Now",range:(e,t)=>`${e} to ${t}`,desc:(e,t,n,r)=>`${Le(e,"item")} on ${Le(t,"row")}, from ${n} to ${r}`,longest:(e,t)=>`Longest: ${e}, ${t}`,lines:"Reference lines"},xl={en:yl,ko:{kind:"타임라인",start:"시작",end:"끝",at:"시각",duration:"걸린 시간",status:"상태",group:"묶음",open:"진행 중",now:"지금",range:(e,t)=>`${e}~${t}`,desc:(e,t,n,r)=>`항목 ${e}개, 줄 ${t}개, ${n}부터 ${r}까지`,longest:(e,t)=>`가장 긴 항목은 ${e}, ${t}`,lines:"기준선"}},Ai=26,kl=520,wl=2,Ni=22,ir=11.5,Ri=13,vl=14,Ze=11,Fi=7,$l=.28,ar=3,Pi=600;function Tl(e,t,n,r){let o=(t-e)/Math.max(1,n);if(t>e&&o>Je*30.44*6){let c=new Date(e).getFullYear(),d=new Date(t).getFullYear()-c,u=[1,2,5,10,20,50,100,200,500,1e3].find(h=>d/h<=n)??1e3,m=[];for(let h=Math.ceil(c/u)*u,f=0;f<500;h+=u,f++){let p=new Date(h,0,1).getTime();if(p>t)break;p>=e&&m.push({t:p,label:Ee(p,{locale:r,year:"numeric"})})}if(m.length>=2)return m}let a=[1,2,5,10,15,30,60,120,300,600,900,1800].map(c=>c*1e3).find(c=>c>=o);if(!(t>e)||a===void 0)return nn(e,t,n,r);let i=a<6e4?{hour:"numeric",minute:"2-digit",second:"2-digit"}:{hour:"numeric",minute:"2-digit"},s=new Date(e).getTimezoneOffset()*6e4,l=[];for(let c=Math.ceil((e-s)/a)*a+s,d=0;c<=t&&d<500;c+=a,d++)l.push({t:c,label:Ee(c,{locale:r,...i})});return l}function sr(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Bo.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}function _i(e,t,n=!1){let r=0,o=e.length;for(;r<o;){let a=r+o>>1;(n?e[a]<=t:e[a]<t)?r=a+1:o=a}return r}function dn(e){let t=(0,K.useMemo)(()=>Zo(e.data,{label:e.label,start:e.start,end:e.end,group:e.group,status:e.status},{xType:e.xType,dayFirst:e.dayFirst,now:e.now}),[e.data,e.label,e.start,e.end,e.group,e.status,e.xType,e.dayFirst,e.now]),{items:n,kind:r,dateOnly:o}=t,a=e.sort==="start"||e.sort==="duration"?e.sort:"none",{rows:i,lane:s}=(0,K.useMemo)(()=>ei(n,a),[n,a]),l=i.reduce((g,v)=>g+v.lanes,0),c=Array.isArray(e.referenceLines)?e.referenceLines:[],d=c.length>0||e.now!==void 0?24:6,u=ii(e,{height:()=>d+Ni+Math.max(40,Math.min(l*Ai,kl),l*wl),duration:700,stagger:40}),{p:m,width:h,height:f,locale:p,fv:$}=u,b=xl[u.lang],M=ni(u.sig),C=(0,K.useMemo)(()=>i.flatMap(g=>g.items),[i]),R=e.group===void 0,x=R?e.status:e.group,P=g=>R?g.status:g.group,E=(0,K.useMemo)(()=>x===void 0?[]:ln(e.data,x,R),[e.data,x,R]),I=(0,K.useMemo)(()=>new Map(E.map((g,v)=>[g,v])),[E]),B=e.highlight,z=(0,K.useMemo)(()=>sr(B,E),[B,E]),w=(0,K.useMemo)(()=>{let g=C.map(F=>n[F].end-n[F].start),v=_e(B,C.map(F=>n[F].datum),C.map(F=>n[F].label),g,E.length?"none":"max"),N=new Set([...v].map(F=>C[F]));return z.size&&n.forEach((F,L)=>z.has(I.get(P(F))??-1)&&N.add(L)),N},[B,C,n,E.length,I,z,R]),S=(0,K.useMemo)(()=>E.length?me(m,E.length,z):null,[m,E,z]),A=Array.isArray(e.hidden)?e.hidden.join(""):"",k=(0,K.useMemo)(()=>new Set(E.length&&A?A.split(""):[]),[E.length,A]),T=(0,K.useMemo)(()=>Array.from(new Set(n.flatMap(g=>[g.start,g.end]))).sort((g,v)=>g-v),[n]),O=T.length?T[0]:0,G=T.length?T[T.length-1]:1,le=(0,K.useMemo)(()=>Qo(t),[t]),Ne=M.view&&T[M.view[1]]>T[M.view[0]]?M.view:null,H=Ne?T[Ne[0]]:le[0],U=Ne?T[Ne[1]]:le[1],ge=(0,K.useMemo)(()=>{if(o)return new Date(O).getFullYear()===new Date(G).getFullYear()?{month:"short",day:"numeric"}:{year:"numeric",month:"short",day:"numeric"};let g={hour:"numeric",minute:"2-digit",...t.hasSeconds?{second:"2-digit"}:{}};return G-O<Je*1.5?g:{month:"short",day:"numeric",...g}},[o,t.hasSeconds,O,G]),X=g=>r==="number"?$(g):Ee(g,{locale:p,...ge}),ft=g=>r==="number"?$(g):Zr(o?Math.round(g/Je)*Je:g,p),Ke=(0,K.useMemo)(()=>{let g=n.map(v=>ft(v.end-v.start));return{text:g,w:g.map(v=>re(v,Ze,600)),wHi:g.map(v=>re(v,Ze,800))}},[n,r,o,$,p]),Ii=(0,K.useMemo)(()=>i.reduce((g,v)=>Math.max(g,re(v.label,ir,700)),24),[i]),At=Math.min(h*.32,Ii+10),Re=At+10,Fe=Math.max(Re+10,h-16),Qe=f-Ni,pe=(Qe-d)/Math.max(1,l),ht=pe>=6?Math.min(18,Math.max(4,pe*.62)):Math.max(1,pe*.8),ce=wt([H,U],[Re+Fi,Fe-Fi]),Nt=(0,K.useMemo)(()=>{let g=new Int32Array(n.length);return i.forEach((v,N)=>v.items.forEach(F=>g[F]=N)),g},[i,n.length]),cr=g=>d+(i[Nt[g]].lane0+s[g]+.5)*pe,ae=(0,K.useMemo)(()=>C.filter(g=>!k.has(P(n[g]))&&n[g].end>=H&&n[g].start<=U),[C,k,n,H,U,R]),gt=(0,K.useMemo)(()=>new Map(ae.map((g,v)=>[g,v])),[ae]),fn=u.motion.stagger??40,hn=u.showLabels&&pe>=vl,gn=(0,K.useMemo)(()=>{let g=new Map;return ae.map((v,N)=>{let F=n[v],L=(g.get(F.label)??0)+1;g.set(F.label,L);let V=Math.max(Re,Math.min(Fe,ce(F.start))),oe=F.point?V:Math.max(V+ar,Math.min(Fe,ce(F.end))),Y=cr(v);return{key:`${F.label}${L}`,to:[V,oe,1,Y],from:[V,V,0,Y],delay:Math.min(N*fn,Pi),data:v}})},[ae,n,i,Nt,s,Re,Fe,H,U,d,pe,fn]),ur=ui(gn,u.motion),zi=(0,K.useMemo)(()=>{let g=new Map;if(!hn)return g;for(let v of gn){let N=n[v.data];if(!N.status)continue;let F=N.point?N.status:lt(N.status,Math.max(1,v.to[1]-v.to[0])-12,Ze,600);g.set(v.data,{text:F,w:re(F,Ze,600)})}return g},[gn,n,hn]),mr=g=>{let v=I.get(P(n[g]));return S&&v!==void 0?S[v]:te(m,!S&&w.has(g)?"accent":"neutral")},dr=(0,K.useMemo)(()=>{let g=new Float64Array(n.length).fill(h-2);for(let v of i){let N=new Map;for(let F of v.items){if(k.has(P(n[F])))continue;let L=N.get(s[F]);L!==void 0&&(g[L]=ce(n[F].start)),N.set(s[F],F)}}return g},[i,n,s,k,h,Re,Fe,H,U,R]),fr=(0,K.useMemo)(()=>ae.map((g,v)=>{let N=n[g],F=N.point?X(N.start):`${b.range(X(N.start),X(N.end))}, ${Ke.text[g]}`;return{datum:N.datum,index:v,key:`${N.label}#${N.i}`,label:N.label,value:N.end-N.start,...N.group&&{series:N.group},formatted:`${F}${N.status?`, ${N.status}`:""}`}}),[ae,n,b,Ke,$,p,ge,r]),{b0:hr,visB:De,visX:Bi}=(0,K.useMemo)(()=>{let g=_i(T,H),v=T.slice(g,Math.max(g,_i(T,U,!0)));return{b0:g,visB:v,visX:v.map(N=>ce(N))}},[T,H,U,Re,Fe]),ue=u.active!==null?ae[u.active]:void 0,{brush:ze,frame:Rt,hint:Hi}=ri({brush:e.brush?"zoom":!1,onBrush:e.onBrush},M,{p:m,active:ue===void 0?null:Math.max(0,Kn(De,n[ue].start)),lang:u.lang,count:De.length,indexAt:g=>Kn(Bi,g),inPlot:(g,v)=>g>=Re-4&&g<=Fe+4&&v>=d&&v<=Qe,toXRange:g=>({from:hr+g.from,to:hr+g.to,fromKey:String(De[g.from]),toKey:String(De[g.to]),fromLabel:X(De[g.from]),toLabel:X(De[g.to])})}),ji=(g,v)=>{let N=Math.floor((v-d)/pe);if(N<0||N>=l)return null;let F=0,L=i.length-1;for(;F<L;){let Z=F+L+1>>1;i[Z].lane0<=N?F=Z:L=Z-1}let V=i[F],oe=null,Y=10;for(let Z of V.items){let be=gt.get(Z);if(be===void 0||s[Z]!==N-V.lane0)continue;let Be=ce(n[Z].start),et=Math.max(0,Be-g,g-Math.max(ce(n[Z].end),n[Z].point?Be:Be+ar));(et<Y||et===0&&Y===0)&&(Y=et,oe=be)}return oe},Gi=g=>{if(Rt.onKey?.(g))return!0;if(g.key!=="ArrowUp"&&g.key!=="ArrowDown"&&g.key!=="ArrowLeft"&&g.key!=="ArrowRight")return!1;if(!ae.length)return!0;if(ue===void 0)return u.setActive(g.key==="ArrowUp"||g.key==="ArrowLeft"?ae.length-1:0,"keyboard"),!0;let v=Nt[ue],N=L=>i[L].items.filter(V=>gt.has(V));if(g.key==="ArrowLeft"||g.key==="ArrowRight"){let L=N(v),V=L[L.indexOf(ue)+(g.key==="ArrowRight"?1:-1)];return V!==void 0&&u.setActive(gt.get(V),"keyboard"),!0}let F=g.key==="ArrowDown"?1:-1;for(let L=v+F;L>=0&&L<i.length;L+=F){let V=N(L);if(!V.length)continue;let oe=n[ue].start,Y=V.reduce((Z,be)=>Math.abs(n[be].start-oe)<Math.abs(n[Z].start-oe)?be:Z,V[0]);u.setActive(gt.get(Y),"keyboard");break}return!0},gr=null,pn="";if(ue!==void 0&&!ze.dragging){let g=n[ue],v=mr(ue),N=g.point?[{label:b.at,value:X(g.start),color:v.fill}]:[{label:b.start,value:X(g.start),strong:!1},{label:b.end,value:g.open?`${X(g.end)} (${b.open})`:X(g.end),strong:!1},{label:b.duration,value:Ke.text[ue],color:v.fill}];g.group&&N.push({label:b.group,value:g.group,strong:!1}),g.status&&N.push({label:b.status,value:g.status,strong:!1});let F=Math.max(Re,ce(g.start)),L=Math.max(F+(g.point?0:ar),Math.min(Fe,ce(g.end)));gr={x:(F+L)/2,y:cr(ue)-ht/2,title:g.label,rows:N},u.via==="keyboard"&&(pn=`${g.label}, ${fr[u.active].formatted}`)}let pr=null;if(ze.range&&ze.range.to<De.length){let g=De[ze.range.from],v=De[ze.range.to],N=ft(v-g);pr=(0,q.jsx)(oi,{p:m,x0:ce(g),x1:ce(v),top:d,bottom:Qe,width:h,main:N,sub:b.range(X(g),X(v)),dragging:ze.dragging}),ze.dragging||(pn=`${b.range(X(g),X(v))}, ${N}.${Hi}`)}let bn=Math.max(2,Math.floor((Fe-Re)/(r==="number"?70:64))),br=e.format,yr=e.unit,Vi=(0,K.useMemo)(()=>{let g=it(zt(br,p,Math.max(Math.abs(H),Math.abs(U))),yr);return So(r==="number"?ce.ticks(bn).map(v=>({x:ce(v),label:g(v)})):Tl(H,U,bn,p).map(v=>({x:ce(v.t),label:v.label})),-2,h+2)},[r,bn,H,U,Re,Fe,h,br,yr,p]),yn=[...c.map(g=>({t:t.read(g?.x),label:typeof g?.label=="string"?g.label:"",now:!1})),...e.now!==void 0?[{t:t.read(e.now),label:b.now,now:!0}]:[]].filter(g=>Number.isFinite(g.t)&&g.t>=H&&g.t<=U),xr=[],Wi=yn.map((g,v)=>{let N=ce(g.t),F=g.label?lt(g.label,140,10.5,g.now?700:500):"",L=N+tn(F,0,0,"start",g.now).w+2>h,V=F?tn(F,L?N-3:N+3,d-14,L?"end":"start",g.now):null,oe=V!==null&&V.x>=0&&!xr.some(Y=>$o(V,Y,4));return oe&&xr.push(V),(0,q.jsxs)("g",{children:[(0,q.jsx)("line",{x1:N,x2:N,y1:d-(oe?14:2),y2:Qe,stroke:m.paint(g.now?"ink":"dim"),strokeOpacity:g.now?.55:1,strokeDasharray:g.now?"2 3":"4 3"}),oe?(0,q.jsx)(Mo,{p:m,x:L?N-3:N+3,y:d-14,text:F,anchor:L?"end":"start",strong:g.now}):null]},v)}),kr=ue===void 0?-1:Nt[ue],Ki=(0,K.useMemo)(()=>{let g=i.reduce((L,V)=>Math.min(L,V.lanes),1/0),v=Math.max(1,Math.ceil(Ri/Math.max(.01,Math.min(g*pe,Ai)))),N=i.some(L=>L.lanes>1),F=-1/0;return i.map((L,V)=>{let oe=d+(L.lane0+L.lanes/2)*pe,Y=V%v===0&&oe-F>=Ri;Y&&(F=oe);let Z=V===kr||L.items.some(be=>w.has(be));return(0,q.jsxs)("g",{children:[N&&V?(0,q.jsx)("line",{x1:0,x2:h,y1:d+L.lane0*pe,y2:d+L.lane0*pe,stroke:m.paint("line"),opacity:.7}):null,Y?(0,q.jsx)(Ce,{x:At,y:oe,anchor:"end",size:ir,weight:Z?700:600,fill:m.paint(Z?"ink":"muted"),children:lt(L.label,At-4,ir,700)}):null]},V)})},[i,pe,d,At,h,m,w,kr]),Ui=u.motion.duration??700,Xi=Math.min(m.theme.radiusMark,ht/2),Ft=(0,K.useMemo)(()=>ae.length?ae[Qt(ae.map(g=>n[g].end-n[g].start))]:-1,[ae,n]),Yi=yn.length?` ${b.lines}: ${yn.map(g=>`${g.label?`${g.label} `:""}${X(g.t)}`).join(", ")}.`:"",Ji=e.description??(ae.length?`${b.kind}. ${b.desc(ae.length,i.length,X(H>O?H:O),X(U<G?U:G))}. ${Ft>=0&&!n[Ft].point?`${b.longest(n[Ft].label,Ke.text[Ft])}.`:""}${Yi}`.trim():"");return(0,q.jsxs)(oo,{c:u,kind:b.kind,ariaLabel:e.ariaLabel,description:Ji,events:fr,tip:gr,renderTip:e.tooltip,announce:pn||void 0,className:e.className,style:e.style,theme:e.theme,onPointerDown:Rt.onPointerDown,onPointerUp:Rt.onPointerUp,overlay:Rt.overlay,onPointerMove:(g,v,N)=>{if(ze.move(g))return;let F=ji(g,v);F!==u.active&&u.setActive(F,N.pointerType==="touch"?"touch":"pointer")},onKey:Gi,children:[(0,q.jsxs)("g",{"aria-hidden":"true",children:[Vi.map((g,v)=>(0,q.jsxs)("g",{children:[(0,q.jsx)("line",{x1:g.x,x2:g.x,y1:d,y2:Qe,stroke:m.paint("line")}),(0,q.jsx)(Ce,{x:g.x,y:Qe+12,anchor:"middle",size:ct,fill:m.paint("muted"),children:g.label})]},v)),Ki]}),ur.items.map(g=>{if(g.exiting)return null;let v=g.data,N=gt.get(v);if(N===void 0)return null;let F=n[v],[L,V,oe,Y]=g.v,Z=mr(v),be=w.has(v),Be=u.active===N&&u.via==="keyboard"||S!==null&&be&&!z.has(I.get(P(F))??-1),et=u.dim(N)*Math.min(1,oe*1.5),xn=ur.fade(Math.min(N*fn,Pi)+Ui*.4,260),pt=zi.get(v);if(F.point){let tt=Math.max(3,Math.min(ht,12)/2+1);return(0,q.jsxs)("g",{opacity:et,children:[(0,q.jsx)("path",{d:`M${L} ${Y-tt}L${L+tt} ${Y}L${L} ${Y+tt}L${L-tt} ${Y}Z`,fill:Z.fill,stroke:m.paint(Be?"ink":"panel"),strokeWidth:Be?2:1,className:"ztd-mark",onClick:()=>u.click(N)}),pt&&L+tt+6+pt.w<dr[v]-4?(0,q.jsx)(Ce,{x:L+tt+6,y:Y,size:Ze,weight:600,fill:m.paint("muted"),opacity:xn,children:pt.text}):null]},g.key)}let bt=Math.max(1,V-L),kn=hn?Ke.text[v]:"",wr=be?Ke.wHi[v]:Ke.w[v],Pt=kn&&L+bt+6+wr<dr[v]-4,vr=kn&&!Pt&&!F.status&&wr+12<=bt;return(0,q.jsxs)("g",{opacity:et,children:[(0,q.jsx)("rect",{x:L,y:Y-ht/2,width:bt,height:ht,rx:Xi,fill:Z.fill,fillOpacity:F.open?$l:1,stroke:Be?m.paint("ink"):F.open?Z.fill:"none",strokeWidth:Be?2:1,strokeDasharray:F.open?"3 2":void 0,className:"ztd-mark",onClick:()=>u.click(N)}),pt?.text?(0,q.jsx)(Ce,{x:L+6,y:Y,size:Ze,weight:600,fill:F.open?m.paint("ink"):Z.text,opacity:xn,children:pt.text}):null,Pt||vr?(0,q.jsx)(Ce,{x:Pt?L+bt+6:L+bt-6,y:Y,anchor:Pt?"start":"end",size:Ze,weight:be?800:600,fill:vr?F.open?m.paint("ink"):Z.text:m.paint(be?"ink":"muted"),opacity:xn,children:kn}):null]},g.key)}),(0,q.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:Wi}),pr]})}var Ie=_(j(),1);function Di(e,t,n){let r=Jt(e);return r?.type==="scatter"&&t?.size!==void 0&&!Yt(n)?Jt("bubble"):r}function Ml(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function Cl(e,t,n,r=!1){let o=Di(e.type,e.encoding,e.options);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&jn.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(m=>!l.has(m.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(d.includes(o.type)){let u=ke(a.label,"label"),m=qt(a.value,"value"),h=o.type==="waffle",f=t.map((x,P)=>({r:x,label:u(x,P),value:h?m(x,P):xi(m(x,P))})),{kept:p,other:$}=h?{kept:f,other:null}:yi(f,i.other,(x,P)=>({r:{},label:bi(Q(n),x),value:P})),b=_e(s,p.map(x=>x.r),p.map(x=>x.label),p.map(x=>x.value),h?"first":"max"),M=$?[...p,$]:p,C=je(x=>h?me(x,M.length,b):ki(x,M.length,b,i.colorMode)),R=h&&i.shape==="arc";return M.map((x,P)=>({label:x.label,color:C[P],...R&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=pi(Array.isArray(i.ma)?i.ma:void 0,t.length),m=gi[Q(n)];return[{label:m.up,color:i.upColor??"accent"},{label:m.down,color:i.downColor??"neutralStrong"},...u.map((h,f)=>({label:m.maLegend(h),color:rr[f],shape:"line"}))]}if(o.type==="network"){let u=Ci(i.groups);if(u.length<2)return[];let m=je(h=>Si(h,u.length));return u.map((h,f)=>({label:h,color:m[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=ke(a.group,"group"),m=Se(t.map((f,p)=>u(f,p)).filter(Boolean));if(m.length<2)return[];let h=je(f=>xt(f,m.length,new Set));return m.map((f,p)=>({label:f,color:h[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||Yt(i))return[];let u=ke(a.series,"series"),m=Se(t.map((p,$)=>u(p,$)));if(m.length<2)return[];let h=hi(s,t,m,u),f=je(p=>xt(p,m.length,h));return c(m.map((p,$)=>({label:p,color:f[$],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",m=u?a.status:a.group;if(typeof m!="string")return[];let h=ln(t,m,u),f=je(p=>me(p,h.length,sr(s,h)));return c(h.map((p,$)=>({label:p,color:f[$],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let C=ke(a.series,"series");u=Se(t.map((R,x)=>C(R,x)))}let m=Gn(o.type,a,i);if(m.length){let C=_e(s,u,u,u.map(()=>0),"none"),R=je(P=>me(P,u.length,C)),x=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((P,E)=>({label:P,color:R[E]}));return[...c(x),...m.map((P,E)=>({label:P,color:fi(E),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&i.layout==="diverging"&&s===void 0?yo(u.length,Array.isArray(i.negative)?i.negative.map(C=>u.indexOf(String(C))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,p=f>=0?new Set([f]):_e(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((C,R)=>({label:C,color:p.has(R)?"accent":"neutralStrong",shape:"square"})));let $=i.colorMode,b=C=>me(C,u.length,p);if((o.type==="line"||o.type==="area")&&(b=C=>di(C,u.length,p,o.type==="area",$)),o.type==="stream"){let C=$t(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),R=vi(C.values,i.reorder),x=$i(s,C.series,C.values);b=P=>Ti(P,R,x)}let M=je(b);return c(u.map((C,R)=>({label:C,color:M[R],...o.type==="line"&&{shape:"line"}})))}return[]}function Sl(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&co.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Al(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:c,...d}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:d,width:o,height:a,highlight:i,syncId:s,title:l,description:c}}function Li(e,t){let{spec:n}=e,r=Di(n.type,n.encoding,n.options),o=(0,St.useMemo)(()=>ti(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=lo(n,e.locale),s=de(i),l=Q(s),c=Ho(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),d=fo(n),u=(0,St.useMemo)(()=>d?Xo(d,s):void 0,[d,s]),m=n.options?.hidden,h=Array.isArray(m)?m.map(String):[],f=h.join(""),[p,$]=(0,St.useState)(null);if(!r)return(0,Ie.jsx)(Hn,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let b=o??c.data,M=t[r.type],C={...n.options??{}},R={...Ml(r,n.encoding),...C,...u?{tooltip:u}:{},data:b,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},x=n.card?.legend==="toggle"&&mo(r.type,n.encoding??{},C),P=p&&p.base===f?p.hidden:h;x&&(R.hidden=P);let E=S=>$(A=>{let k=A&&A.base===f?A.hidden:h;return{base:f,hidden:k.includes(S)?k.filter(T=>T!==S):[...k,S]}}),I=R.height??220,B=Sl(n,r.type),z=a&&!b.length&&(c.loading||c.error||c.empty)?(0,Ie.jsx)(Hn,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:I,locale:i}):B?(0,Ie.jsx)(zo,{chart:M,...Al(r.type,B,R)}):(0,Ie.jsx)(M,{...R});if(n.card){let S=n.card,A=S.legend==="auto"||S.legend==="toggle"?Cl(n,b,s,x):S.legend,k=A?.length?x?(0,Ie.jsx)(Bn,{items:A,hidden:P,onToggle:E,locale:i}):A:void 0,T=S.download?(0,Ie.jsx)(Uo,{data:b,columns:ho(n),filename:S.title??r.type,formats:Array.isArray(S.download)?S.download:void 0,locale:i}):void 0;z=(0,Ie.jsx)(ro,{number:S.number,title:S.title??so(r,l),subtitle:S.subtitle,legend:k,actions:T,source:S.source||void 0,note:S.note||void 0,accent:S.accent,takeaway:S.takeaway,level:S.level,sample:S.sample,replay:S.replay!==!1,className:e.className,locale:i,children:z})}let w=e.theme??n.theme;return w&&(z=(0,Ie.jsx)(Vt,{theme:w,children:z})),z}function Nl({cfg:e,components:t}){let n=ut();return Li({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Oi(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Ei.hydrateRoot)(r,(0,lr.createElement)(Vt,{theme:o.theme,cssVars:!0},(0,lr.createElement)(Nl,{cfg:o,components:{[e]:t}})))}Oi("timeline",dn);})();
|