ztd-charts-cli 0.11.3 → 0.13.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.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/api.js +1 -1
  3. package/dist/{chunk-VUZPZ5FT.js → chunk-LR5X5LI2.js} +53 -29
  4. package/dist/cli.js +6 -1
  5. package/dist/client/area.js +6 -6
  6. package/dist/client/bar.js +9 -9
  7. package/dist/client/barRace.js +6 -6
  8. package/dist/client/beeswarm.js +7 -7
  9. package/dist/client/box.js +9 -9
  10. package/dist/client/bubble.js +7 -7
  11. package/dist/client/bullet.js +6 -6
  12. package/dist/client/bump.js +6 -6
  13. package/dist/client/calendar.js +10 -10
  14. package/dist/client/candlestick.js +6 -6
  15. package/dist/client/chord.js +7 -7
  16. package/dist/client/choropleth.js +9 -9
  17. package/dist/client/cohort.js +28 -0
  18. package/dist/client/donut.js +6 -6
  19. package/dist/client/dumbbell.js +6 -6
  20. package/dist/client/flowMap.js +7 -7
  21. package/dist/client/funnel.js +9 -9
  22. package/dist/client/gauge.js +6 -6
  23. package/dist/client/heatmap.js +9 -9
  24. package/dist/client/histogram.js +6 -6
  25. package/dist/client/horizon.js +28 -0
  26. package/dist/client/line.js +6 -6
  27. package/dist/client/lollipop.js +6 -6
  28. package/dist/client/marimekko.js +6 -6
  29. package/dist/client/network.js +9 -9
  30. package/dist/client/parallel.js +6 -6
  31. package/dist/client/pareto.js +6 -6
  32. package/dist/client/pie.js +6 -6
  33. package/dist/client/radar.js +7 -7
  34. package/dist/client/radialBar.js +6 -6
  35. package/dist/client/ridgeline.js +6 -6
  36. package/dist/client/sankey.js +10 -10
  37. package/dist/client/scatter.js +10 -10
  38. package/dist/client/segmented.js +6 -6
  39. package/dist/client/skyline.js +7 -7
  40. package/dist/client/slope.js +6 -6
  41. package/dist/client/sparkTable.js +28 -0
  42. package/dist/client/sparkline.js +6 -6
  43. package/dist/client/stream.js +7 -7
  44. package/dist/client/sunburst.js +7 -7
  45. package/dist/client/symbolMap.js +7 -7
  46. package/dist/client/tileMap.js +6 -6
  47. package/dist/client/timeline.js +9 -9
  48. package/dist/client/tree.js +6 -6
  49. package/dist/client/treemap.js +7 -7
  50. package/dist/client/waffle.js +7 -7
  51. package/dist/client/waterfall.js +6 -6
  52. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
- (()=>{var $o=Object.create;var fn=Object.defineProperty;var Mo=Object.getOwnPropertyDescriptor;var To=Object.getOwnPropertyNames;var So=Object.getPrototypeOf,Co=Object.prototype.hasOwnProperty;var vt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Ao=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of To(t))!Co.call(e,o)&&o!==n&&fn(e,o,{get:()=>t[o],enumerable:!(r=Mo(t,o))||r.enumerable});return e};var A=(e,t,n)=>(n=e!=null?$o(So(e)):{},Ao(t||!e||!e.__esModule?fn(n,"default",{value:e,enumerable:!0}):n,e));var V=vt((Xi,hn)=>{hn.exports=globalThis.__ztdReact.react});var pn=vt((Yi,gn)=>{gn.exports=globalThis.__ztdReact["react-dom/client"]});var B=vt((cs,Vn)=>{Vn.exports=globalThis.__ztdReact["react/jsx-runtime"]});var un=A(V(),1),xo=A(pn(),1);var We=A(V(),1);var it=A(V(),1);var yn=A(V(),1),Se=(0,yn.createContext)(void 0);var wn=A(V(),1);var No=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],bn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',xn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',be={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:bn,monoFamily:xn,radius:18,radiusCode:14,radiusMark:4},$t={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:bn,monoFamily:xn,radius:18,radiusCode:14,radiusMark:4},Mt={dark:be,light:$t};function Xe(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Tt(e){let t={};for(let n of No){let r=e[n];typeof r=="string"&&(t[Xe(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 St(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 Ro=`
1
+ (()=>{var Do=Object.create;var Mn=Object.defineProperty;var Eo=Object.getOwnPropertyDescriptor;var Io=Object.getOwnPropertyNames;var Oo=Object.getPrototypeOf,zo=Object.prototype.hasOwnProperty;var _t=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Bo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Io(t))!zo.call(e,o)&&o!==n&&Mn(e,o,{get:()=>t[o],enumerable:!(r=Eo(t,o))||r.enumerable});return e};var _=(e,t,n)=>(n=e!=null?Do(Oo(e)):{},Bo(t||!e||!e.__esModule?Mn(n,"default",{value:e,enumerable:!0}):n,e));var Y=_t((us,Tn)=>{Tn.exports=globalThis.__ztdReact.react});var Cn=_t((ms,Sn)=>{Sn.exports=globalThis.__ztdReact["react-dom/client"]});var j=_t((Ts,nr)=>{nr.exports=globalThis.__ztdReact["react/jsx-runtime"]});var kn=_(Y(),1),Ro=_(Cn(),1);var qe=_(Y(),1);var ft=_(Y(),1);var An=_(Y(),1),Pe=(0,An.createContext)(void 0);var _n=_(Y(),1);var Ho=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Nn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Rn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Te={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Nn,monoFamily:Rn,radius:18,radiusCode:14,radiusMark:4},Lt={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Nn,monoFamily:Rn,radius:18,radiusCode:14,radiusMark:4},Pt={dark:Te,light:Lt};function tt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Dt(e){let t={};for(let n of Ho){let r=e[n];typeof r=="string"&&(t[tt(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 Et(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 jo=`
2
2
  .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
3
  .ztd-root:focus{outline:none}
4
- .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${be.accent});outline-offset:3px;border-radius:6px}
4
+ .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${Te.accent});outline-offset:3px;border-radius:6px}
5
5
  .ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
6
6
  .ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
7
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)}
@@ -9,9 +9,9 @@
9
9
  .ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
10
10
  .ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
11
11
  .ztd-btn:focus{outline:none}
12
- .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${be.accent});outline-offset:2px}
12
+ .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${Te.accent});outline-offset:2px}
13
13
  .ztd-card{transition:border-color .16s ease}
14
- .ztd-card:hover{border-color:var(--ztd-dim,${be.dim})}
14
+ .ztd-card:hover{border-color:var(--ztd-dim,${Te.dim})}
15
15
  @media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
16
16
  @keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
17
17
  @keyframes ztd-fade{from{opacity:0}to{opacity:1}}
@@ -19,10 +19,10 @@
19
19
  @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
20
  .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
21
  @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
- `;function vn(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 $n(e,t){let[n]=(0,wn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var kn=!1;function Ee(){if(kn||typeof document>"u"||(kn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Ro,document.head.appendChild(e)}var Ye=A(V(),1),ae=typeof window<"u"&&typeof document<"u",he=ae?Ye.useLayoutEffect:Ye.useEffect;function Je(){return typeof performance<"u"?performance.now():Date.now()}function K(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function ge(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Mn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},Tn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Fo=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],_o={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Lo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Po(e){return Lo(Fo,e)}function Sn(e,t){let n=Po(e);return{text:n?n[t]:e,..._o[n?.id??"basic"]}}var Cn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ce(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Cn[t.toLowerCase()]&&(t=Cn[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(a=>a+a).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let i=parseInt(o,16);return o.length===6?[i>>16&255,i>>8&255,i&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 i=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),a=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return i.some(s=>Number.isNaN(s))?null:[i[0],i[1],i[2],Number.isNaN(a)?1:a]}return null}function Rn(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 At(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 Ae(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function An(e){return .2126*Ae(e[0])+.7152*Ae(e[1])+.0722*Ae(e[2])}function Nt(e,t,n){let r=typeof e=="string"?Ce(e):e,o=typeof t=="string"?Ce(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Ce(n):n:null;o[3]<1&&i&&(o=At(o,i));let a=r[3]<1?At(r,o):r,s=An(a),c=An(o);return(Math.max(s,c)+.05)/(Math.min(s,c)+.05)}function Do(e){return[Ae(e[0]),Ae(e[1]),Ae(e[2])]}function Ct(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 Nn(e){let[t,n,r]=Do(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*i-.0040720468*a,1.9779984951*o-2.428592205*i+.4505937099*a,.0259040371*o+.7827717662*i-.808675766*a]}function Eo([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[Ct(4.0767416621*o-3.3077115913*i+.2309699292*a),Ct(-1.2684380046*o+2.6097574011*i-.3413193965*a),Ct(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function qe(e,t,n){let r=Ce(e),o=Ce(t);if(!r||!o)return e;let i=Nn(r),a=Nn(o),s=Math.max(0,Math.min(1,n));return Rn(Eo([i[0]*s+a[0]*(1-s),i[1]*s+a[1]*(1-s),i[2]*s+a[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Rt(e,t,n){let r=t[0],o=-1;for(let i of t){let a=Nt(i,e,n);a>o&&(o=a,r=i)}return r}function X(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 Oo(e,t){let n=Rt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Nt(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Rt(t,["#FFFFFF","#000000"])}function Ze(e,t){let n=qe(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Oo(e,n),raw:n}}function ie(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=X(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=X(e,"neutral");else if(s===0)r[a]=X(e,"ink");else if(s===i-1)r[a]=X(e,"neutral");else if(i===3)r[a]=X(e,"strong");else{let c=(s-1)/Math.max(1,i-2);r[a]=c<=.001?X(e,"strong"):Ze(e,1-c)}}),r}var Ft="mix:";function xe(e){return e({theme:$t,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Ft}${o}`}).map(n=>n.fill)}function Fn(e,t){return t?.startsWith(Ft)?e.mix("neutralStrong","neutral",Number(t.slice(Ft.length))):e.color(t)}function Oe(e,t,n){return ie(e,t+1,n).slice(0,t)}function _n(e,t,n,r="neutral"){let o=X(e,"accent"),i=X(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function Ln(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=X(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=X(e,"neutral"):s===0?r[a]=X(e,"strong"):s===i-1?r[a]=X(e,"neutral"):r[a]=Ze(e,1-s/(i-1))}),r}var se=A(V(),1);var et=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),q="en-US",Pn=new Map;function _t(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=Pn.get(r);return o||(o=new Intl.NumberFormat(e,n),Pn.set(r,o)),o}function Lt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ne(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=q,...r}=t;return Lt(_t(n,r).format(e))}var Pt=e=>e!==0&&Math.abs(e)<.05,Dt=(e,t,n="")=>`${Ne(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Qe(e,t={}){if(!Number.isFinite(e))return"-";if(Pt(e)&&t.maximumFractionDigits===void 0)return Dt(e,t.locale??q,"%");let n=Math.abs(e);return`${Ne(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function In(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=q,...r}=t;if(K(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,c]=i[a],u=o/s,h=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),m=Math.round(u*10**h)/10**h;if(a>0&&m>=i[a-1][0]/s){a--;continue}return(e<0&&m!==0?"-":"")+Ne(m,{locale:n,...r,maximumFractionDigits:h})+c}}return Lt(_t(n,{notation:"compact",...r}).format(e))}var Io=(e,t=K(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function ve(e,t=q,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=_t(t,o);return c=>Number.isFinite(c)?`${a}${Lt(s.format(c))}${i}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:i="",...a}=e;return r(a,o,i)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Qe(o,{locale:t});case"ratio":return o=>Qe(o*100,{locale:t});case"compact":return o=>In(o,{locale:t});case"currency":return r(Io(t));default:{let o=r({maximumFractionDigits:1});return i=>Pt(i)?Dt(i,t):o(i)}}}function zn(e,t=q,n=0){return e!==void 0?ve(e,t):n>=1e5?r=>Pt(r)?Dt(r,t):In(r,{locale:t}):r=>Ne(r,{locale:t})}function zo(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Et=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Bo=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Ho=["january","february","march","april","may","june","july","august","september","october","november","december"],Dn=e=>{let t=e.toLowerCase();return t.length<3?0:Ho.findIndex(n=>n.startsWith(t))+1},En=e=>+e+(+e<30?2e3:1900);function Bn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var jo=[/^(\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})일)?$/],Hn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,jn=/\{([^{}]+)\}/g;function tt(e,t){let n;for(let r of jo)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?[En(n[3]),+n[2],+n[1],1]:[En(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=Hn.exec(e)){let r=+n[1],o=+n[3],i=r>12||o<=12&&t===!0;return[+n[4],i?o:r,i?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Dn(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=Dn(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Gn=e=>Bo.test(e)||tt(e)!==null;function Wn(e){let t;for(let n of e){let r=typeof n=="string"?Hn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function nt(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(Et(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return nt(`${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=tt(n,t);if(r)return zo(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 On=new Map;function Ie(e,t={month:"short",day:"numeric"}){let n=nt(e);if(!n)return"-";let{locale:r=q,...o}=t,i=r+JSON.stringify(o),a=On.get(i);return a||(a=new Intl.DateTimeFormat(r,o),On.set(i,a)),a.format(n)}var Ot=A(B(),1),rt=(0,se.createContext)({theme:be,cssVars:!0});function Go(e,t=be){return e?typeof e=="string"?Mt[e]??t:St(t,e):t}function ot(e){let t=(0,se.useContext)(rt),n=e.base?Mt[e.base]:t.theme,r=(0,se.useMemo)(()=>Go(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,se.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,se.useMemo)(()=>Tt(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Ot.jsx)(rt.Provider,{value:a,children:(0,Ot.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var Wo=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Kn(e){return Wo.has(e)}function Vo(e,t){let n=r=>t?`var(${Xe(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Kn(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Kn(r)?e[r]:r:e[o],mix:(r,o,i)=>{let a=Math.round(Math.max(0,Math.min(1,i))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${a}%, ${n(o)})`:qe(e[r],e[o],i)}}}function le(e){let t=(0,se.useContext)(rt);return(0,se.useMemo)(()=>{let n=St(t.theme,e);return Vo(n,t.cssVars)},[t.theme,t.cssVars,e])}function Q(e){let t=(0,se.useContext)(rt);return e??t.locale??q}function Un(e){return e?Tt(e):{}}var at=A(V(),1),It=(0,at.createContext)(void 0);function Xn(e){let t=(0,at.useContext)(It);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var N=A(B(),1),Ko={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`},Uo={en:Ko,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Xo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},zt=e=>Uo[K(Q(e))];function Bt(e){let t=le(e.theme),n=zt(e.locale),[r,o]=(0,it.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),c=e.items.filter(h=>!s.has(h.label)).length,u=(0,N.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((h,m)=>{let g=!s.has(h.label),f=g&&c===1,p=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Yo,{p:t,item:h,off:!g}),(0,N.jsx)("span",{style:g?void 0:{textDecoration:"line-through"},children:h.label})]});return(0,N.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,N.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":g,"aria-disabled":f||void 0,onClick:()=>{f||(a(h.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:f?"default":void 0},children:p}):p},m)})});return a?(0,N.jsxs)(N.Fragment,{children:[u,(0,N.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Xo,children:r?n.shown(c,e.items.length):""})]}):u}function Yo({p:e,item:t,off:n}){let r=Fn(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,N.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,N.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,N.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,N.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 Jo(e){let t=le(e.theme),n=Sn(e.level,K(Q(e.locale)));return(0,N.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 qo(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,N.jsxs)(N.Fragment,{children:[e.slice(0,r),(0,N.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Yn(e){let t=le(e.theme),n=zt(e.locale),[r,o]=(0,it.useState)(0);he(()=>Ee(),[]);let i=()=>{o(g=>g+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,N.jsx)(Bt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,u=e.replay||e.onReplay,h=e.source!==void 0||e.note!==void 0?(0,N.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,m=e.takeaway!==void 0||e.level||e.sample?(0,N.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,N.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,N.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,N.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,N.jsx)(Jo,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,N.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,N.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,N.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:c}):null,(0,N.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:qo(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,N.jsx)("button",{type:"button",className:"ztd-btn",onClick:i,"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,N.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,N.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,N.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,N.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,N.jsx)("span",{}),a]}):null]}),(0,N.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,N.jsx)(It.Provider,{value:r,children:(0,N.jsx)(Se.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),h?(0,N.jsxs)(N.Fragment,{children:[h,m]}):m]})}function Ht(e){let t=le(e.theme),n=zt(e.locale),r=e.height??220;if(he(()=>Ee(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,N.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,N.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,N.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,N.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,N.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,i)=>(0,N.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${i*90}ms`}},i))}):e.empty?(0,N.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,N.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,N.jsx)(N.Fragment,{children:e.children})}var Pe=A(V(),1);var ee=A(V(),1);var H=A(B(),1),st=60;var lt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Jn(e){let{c:t,events:n}=e,r=(0,ee.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,he(()=>{Ee()},[]);let a=n.length,s=!e.noNav&&a>0,c=(0,ee.useContext)(Se),u=e.ariaLabel??c??e.kind,h=(0,ee.useMemo)(()=>s?`${n.length}${n.slice(0,st).map(d=>`${d.label}${d.series??""}${d.formatted??d.value??""}`).join("")}`:"",[n,s]),m=(0,ee.useMemo)(()=>(0,H.jsx)(Zo,{label:u,events:n,t:t.t}),[u,h,t.t]),g=(0,ee.useRef)(null);(0,ee.useEffect)(()=>{let d=()=>{g.current=null};return window.addEventListener("scroll",d,{capture:!0,passive:!0}),window.addEventListener("resize",d,{passive:!0}),()=>{window.removeEventListener("scroll",d,{capture:!0}),window.removeEventListener("resize",d)}},[]),(0,ee.useEffect)(()=>{g.current=null},[t.width,t.height]);let f=d=>{if(d.target!==d.currentTarget)return;if(e.onKey?.(d)){d.preventDefault();return}let l=t.active,k;switch(d.key){case"ArrowRight":case"ArrowDown":k=l===null?0:(l+1)%a;break;case"ArrowLeft":case"ArrowUp":k=l===null?a-1:(l-1+a)%a;break;case"Home":k=0;break;case"End":k=a-1;break;case"Escape":if(l===null)return;k=null;break;case"Enter":case" ":l!==null&&(d.preventDefault(),t.click(l));return;default:return}d.preventDefault(),t.setActive(k,"keyboard")},{via:p,node:x,setActive:M}=t;(0,ee.useEffect)(()=>{if(p!=="touch"||!x)return;let d=l=>{x.contains(l.target)||M(null)};return document.addEventListener("pointerdown",d),()=>document.removeEventListener("pointerdown",d)},[p,x,M]);let w=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,T=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,_=typeof e.renderTip=="function"&&w?e.renderTip(w):null,y=e.announce??(t.via==="keyboard"&&w?`${w.label}${w.series?` ${w.series}`:""}: ${w.formatted??w.value??""} (${(t.active??0)+1}/${a})`:""),R;if($){let d=$.x*T,l=t.width*T,k=`clamp(${(4-d).toFixed(1)}px, -50%, calc(${(l-d-4).toFixed(1)}px - 100%))`,v=$.y<64;R={position:"absolute",left:d,top:$.y*T,transform:`translate(${k}, ${v?"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*T-8)}}let z=d=>{g.current=null,d.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},D=d=>d?l=>{let k=g.current??(g.current=l.currentTarget.getBoundingClientRect());k.width&&d((l.clientX-k.left)/k.width*t.width,(l.clientY-k.top)/k.height*t.height,l)}:void 0,E=D(e.onPointerMove),I=D(e.onPointerDown),L=E||I?d=>{d.pointerType==="touch"&&E?.(d),I?.(d)}:void 0,C=D(e.onPointerUp),S=Un(e.theme);return(0,H.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":u,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?f:void 0,onBlur:d=>{t.via==="keyboard"&&!d.currentTarget.contains(d.relatedTarget)&&t.setActive(null)},onPointerLeave:z,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"),...S,...e.style},children:[t.pending?null:e.underlay,(0,H.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${i}`,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:E,onPointerDown:L,onPointerUp:C,onPointerCancel:C,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,H.jsx)("title",{id:o,children:u}),(0,H.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,H.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,$?(0,H.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:R,children:_??(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:$.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:$.title}),$.rows.map((d,l)=>(0,H.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,H.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(d.strong?"ink":"muted")},children:[d.color?(0,H.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:d.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,d.label]}),(0,H.jsx)("span",{style:{fontWeight:d.strong===!1?500:700},children:d.value})]},l))]})}):null,(0,H.jsx)("span",{className:"ztd-sr",style:lt,"aria-live":"polite","aria-atomic":"true",children:y}),s&&!t.pending?m:null]})}function Zo({label:e,events:t,t:n}){return(0,H.jsx)("div",{className:"ztd-sr",style:lt,children:(0,H.jsxs)("table",{children:[(0,H.jsx)("caption",{children:n.table(e)}),(0,H.jsxs)("tbody",{children:[t.slice(0,st).map((r,o)=>(0,H.jsxs)("tr",{children:[(0,H.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,H.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>st?(0,H.jsx)("tr",{children:(0,H.jsx)("td",{colSpan:2,children:n.more(t.length-st)})}):null]})]})})}function jt(e){let t=e.baseline??"central";return(0,H.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 b=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ne=b("label","string",!0,"Item name field"),J=b("value","number",!0,"Value field"),Qo=[ne,J],ea=[ne,J],ta=[b("label","string",!0,"Stage name"),b("value","number",!0,"Users at the stage")],na=[ne,J],ra=[b("label","string",!0,"Leaf (lowest level) name"),J,b("group","string",!1,"Parent group field")],oa=[b("label","string",!0,"Leaf name"),J,b("group","string",!1,"Parent group field")],aa=[ne,b("value","number",!0,"Change (total rows may omit it)"),b("type","string",!1,'"total" makes a total bar')],ia=[ne,J],sa=[b("x","string",!0,"Column field"),b("series","string",!0,"Stacked series field"),J],la=[b("x","string",!0,"Column field"),b("y","string",!0,"Row field"),J],ca=[b("axis","string",!0,"Metric (axis) field"),b("value","number",!0,"Value field",{multi:!0}),b("series","string",!1,"Series field")],ua=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("size","number",!1,"Circle size"),b("label","string",!1,"Name")],Zn=b("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ma=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)"),b("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Zn],da=[b("x","any",!0,"x field"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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}),Zn],fa=[b("x","any",!0,"x field"),b("y","number",!0,"y field",{multi:!0}),b("series","string",!1,"Series field")],ha=[b("x","string",!0,"Category field"),b("y","number",!0,"Value field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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=[ne,J],pa=[b("value","number",!0,"Value field",{prop:"valueKey"}),b("target","number",!1,"Target field",{prop:"targetKey"})],ya=[ne,b("value","number",!0,"Actual value field"),b("target","number",!1,"Target field")],ba=[b("x","any",!1,"x field"),b("y","number",!0,"y field")],xa=[ne,b("x","string",!1,"Period field (long tables)"),b("value","number",!1,"Value field (long tables)")],ka=[ne,b("start","number",!0,"Before value"),b("end","number",!0,"After value")],wa=[ne,J],va=[b("value","number",!0,"Value field"),b("group","string",!1,"Group (row) field"),b("label","string",!1,"Dot name")],$a=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],Ma=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),J],Ta=[b("source","string",!0,"Sending group"),b("target","string",!0,"Receiving group"),J],Sa=[b("date","date",!0,"Date field"),J],Ca=[b("x","any",!0,"Period field"),b("series","string",!0,"Item field"),b("rank","number",!1,"Rank field (1 is first)"),b("value","number",!1,"Value field (instead of rank, largest is first)")],Aa=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],Na=[b("label","string",!1,"Row name field")],Ra=[b("x","date",!0,"Date (period) field"),b("open","number",!0,"Open price field"),b("high","number",!0,"High price field"),b("low","number",!0,"Low price field"),b("close","number",!0,"Close price field"),b("volume","number",!1,"Volume field")],Fa=[ne,J],_a=[b("x","any",!0,"Period field (date or category)"),b("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables, back row only)"),b("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],La=[b("value","number",!1,"Sample value field (raw rows)"),b("group","string",!1,"Group field. Up to 2 groups overlap"),b("x0","number",!1,"Bin start (pre-binned rows)"),b("x1","number",!1,"Bin end (pre-binned rows)"),b("count","number",!1,"Samples in the bin (pre-binned rows)")],Pa=[b("region","string",!0,"Region name or code, matched to a tile of options.map"),J],Da=[ne,J,b("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")],Ea=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),b("value","number",!1,"Link weight. Without it every row counts 1")],Oa=[b("label","string",!0,"Row name. Items with the same name share a row"),b("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),b("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),b("group","string",!1,"Group field (one color per group, and the legend)"),b("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")],Ia=[b("label","string",!0,"Node name field"),b("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),b("group","string",!1,"Parent group field (flat rows, as in the treemap)"),b("id","string",!1,"Row id for id/parent rows. Defaults to the label"),b("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],za=[b("region","string",!0,"Region name or code, matched to a region of options.map"),J],Ba=[b("lon","number",!1,"Longitude (degrees)"),b("lat","number",!1,"Latitude (degrees)"),b("size","number",!1,"Value (circle area). Without it all circles match"),b("label","string",!1,"Place name"),b("region","string",!1,"Region of options.map, for rows without lon and lat"),b("group","string",!1,"Group field (one color per group)")],Ha=[b("source","string",!0,"Start: a name in options.places or a region"),b("target","string",!0,"End"),b("value","number",!1,"Amount. Without it each row counts 1")],ja=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("series","string",!1,"Series field (one color per series)"),b("label","string",!1,"Name")],qn={pie:Qo,donut:ea,funnel:ta,waffle:na,treemap:ra,sunburst:oa,waterfall:aa,pareto:ia,marimekko:sa,heatmap:la,radar:ca,bubble:ua,line:ma,area:da,stream:fa,bar:ha,radialBar:ga,gauge:pa,bullet:ya,sparkline:ba,slope:xa,dumbbell:ka,lollipop:wa,beeswarm:va,ridgeline:$a,sankey:Ma,chord:Ta,calendar:Sa,bump:Ca,box:Aa,parallel:Na,candlestick:Ra,segmented:Fa,skyline:_a,histogram:La,scatter:ja,tileMap:Pa,barRace:Da,network:Ea,timeline:Oa,tree:Ia,choropleth:za,symbolMap:Ba,flowMap:Ha},Re={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 Qn(e,t){return t==="ko"?e.nameKo:e.name}function er(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var tr=["line","area","bar","scatter"],nr=24,Gt=["line","area","bar","scatter","timeline"];function Wt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function rr(e,t,n){return Gt.includes(e)&&!Wt(e,t,n).length&&!(e==="scatter"&&ct(n))}function ct(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function or(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Ga={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 ut(e){let t=qn[e]?e:Ga[e]??Object.keys(Re).find(n=>n.toLowerCase()===e.toLowerCase()||Re[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Re[t]))return{type:t,component:Re[t].component,name:Re[t].name,nameKo:Re[t].nameKo,encoding:qn[t]}}function ar(e){let t=new Set,n=i=>{Array.isArray(i)?i.forEach(n):typeof i=="string"&&i&&t.add(i)},r=e.encoding??{};for(let i of ut(e.type)?.encoding.map(a=>a.name)??Object.keys(r))n(r[i]);let o=e.options??{};for(let i of["dimensions","start","end","ranges"])n(o[i]);return[...t]}function ir(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Wa(e,t){if(e==null||typeof e!="object")return;let n=e;if(ir(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!ir(r,o))return;r=r[o]}return r}}function pe(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 $e(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Wa(r,n)}function Fe(e,t){let n=$e(e,t);return(r,o)=>pe(n(r,o))}function re(e,t){let n=$e(e,t);return(r,o)=>{let i=n(r,o);return i==null?"":i instanceof Date?new Date(i.getTime()-i.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(i)}}function ce(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Va(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let u=e[c];if(u==='"')n=!n;else if(!n&&(u===`
23
- `||u==="\r"))break;t.push(n?"":u)}let r=t.join(""),o=c=>r.split(c).length-1,i=[","," ",";","|"],a=",",s=0;for(let c of i){let u=o(c);u>s&&(s=u,a=c)}return a}var Ka=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function sr(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Ka.test(t)||/^[-+]?\.\d+$/.test(t)){let n=pe(t);if(Number.isFinite(n))return n}return t}function Me(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??Va(o),a=[],s=[],c="",u=!1;for(let p=0;p<o.length;p++){let x=o[p];u?x==='"'?o[p+1]==='"'?(c+='"',p++):u=!1:c+=x:x==='"'&&!c.trim()?(u=!0,c=""):x===i?(s.push(c),c=""):x===`
24
- `||x==="\r"?(x==="\r"&&o[p+1]===`
25
- `&&p++,s.push(c),a.push(s),s=[],c=""):c+=x}(c!==""||s.length)&&(s.push(c),a.push(s));let h=a.filter(p=>!(p.length===1&&p[0].trim()===""));if(!h.length)return[];let m=p=>n?sr(p):p;if(!r)return h.map(p=>Object.fromEntries(p.map((x,M)=>[String(M),m(x)])));let g=[],f=new Set;return h[0].forEach((p,x)=>{let M=p.trim()||`col${x+1}`,w=M;for(let $=2;f.has(w);$++)w=`${M}_${$}`;f.add(w),g.push(w)}),h.slice(1).map(p=>Object.fromEntries(g.map((x,M)=>[x,m(p[M]??"")])))}function Vt(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((a,s)=>String(a??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(a=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof a[c]=="string"?sr(a[c]):a[c]??null])))}function Ua(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(i=>Array.isArray(i))){let i=Object.keys(e),a=Math.max(...o.map(s=>s.length));return Array.from({length:a},(s,c)=>Object.fromEntries(i.map(u=>[u,e[u][c]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function lr(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 ke(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ke(JSON.parse(t))}catch{}return Me(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Vt(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)?ke(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Vt(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)?ke(t.rows):Array.isArray(t.values)?Vt(t.values):Array.isArray(t.items)?ke(t.items):Array.isArray(t.results)?ke(t.results):Ua(t)}return[]}function mt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=i=>{try{return JSON.stringify(i)}catch{return String(i)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let i=0;i<t;i+=r)o.push(e[i]);return o.push(e[t-1]),`${t}:${n(o)}`}function Kt(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),i=e.map(()=>new Array(r).fill(0)),a=(c,u)=>{let h=e[c][u];return Number.isFinite(h)&&h>0?h:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let c=0;for(let u=1;u<r;u++){let h=0,m=0;for(let g=0;g<n;g++){let f=a(g,u),p=f-a(g,u-1),x=0;for(let M=0;M<g;M++)x+=a(M,u)-a(M,u-1);h+=f,m+=(p/2+x)*f}h&&(c-=m/h),s[u]=c}}for(let c=0;c<r;c++){if(t==="zero"){let m=0,g=0;for(let f=0;f<n;f++){let p=e[f][c],x=Number.isFinite(p)?p:0;x>=0?(o[f][c]=m,m+=x,i[f][c]=m):(o[f][c]=g,g+=x,i[f][c]=g)}continue}let u=0;for(let m=0;m<n;m++)u+=a(m,c);let h=t==="silhouette"?-u/2:s[c];for(let m=0;m<n;m++){let g=a(m,c);t==="expand"&&(g=u?g/u*100:0),o[m][c]=h,h+=g,i[m][c]=h}}if(t==="wiggle"&&r){let c=1/0,u=-1/0;for(let m=0;m<r;m++)c=Math.min(c,o[0]?.[m]??0),u=Math.max(u,i[n-1]?.[m]??0);let h=0;for(let m=0;m<r;m++)h+=((o[0]?.[m]??0)+(i[n-1]?.[m]??0))/2;h/=r;for(let m=0;m<n;m++)for(let g=0;g<r;g++)o[m][g]-=h,i[m][g]-=h}return{y0:o,y1:i}}function cr(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 ur(e){let t=e.length,n=e.map(u=>{let h=0,m=-1/0;return u.forEach((g,f)=>{g>m&&(m=g,h=f)}),h}),r=e.map(u=>u.reduce((h,m)=>h+(Number.isFinite(m)?m:0),0)),o=Array.from({length:t},(u,h)=>h).sort((u,h)=>n[u]-n[h]),i=[],a=[],s=0,c=0;for(let u of o)s<c?(i.push(u),s+=r[u]):(a.push(u),c+=r[u]);return[...a.reverse(),...i]}var Xa=Math.PI*2;function dt(e,t,n){return e<t?t:e>n?n:e}function mr(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function G(e){return Math.round(e*100)/100}function dr(e,t,n,r,o){if(n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),n<=.01||r<=.01)return"";let i=typeof o=="number"?{tl:o,tr:o,br:o,bl:o}:o,a=Math.min(n,r)/2,s=dt(i.tl??0,0,a),c=dt(i.tr??0,0,a),u=dt(i.br??0,0,a),h=dt(i.bl??0,0,a);return`M${G(e+s)},${G(t)}H${G(e+n-c)}`+(c?`A${G(c)},${G(c)} 0 0 1 ${G(e+n)},${G(t+c)}`:"")+`V${G(t+r-u)}`+(u?`A${G(u)},${G(u)} 0 0 1 ${G(e+n-u)},${G(t+r)}`:"")+`H${G(e+h)}`+(h?`A${G(h)},${G(h)} 0 0 1 ${G(e)},${G(t+r-h)}`:"")+`V${G(t+s)}`+(s?`A${G(s)},${G(s)} 0 0 1 ${G(e+s)},${G(t)}`:"")+"Z"}function fr(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function gr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function hr(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 ft=new Map;function Z(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=ft.get(o);if(i===void 0){let a=0,s=0;for(let c=0;c<r.length;c++){let u=r.charCodeAt(c);gr(u)?a+=hr(u):s+=hr(u)}i=a+s*(n>=600?1.07:1),ft.size>5e3&&ft.clear(),ft.set(o,i)}return i*t}function Ut(e,t,n,r=400){if(e=e.trim(),Z(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let c=i+a+1>>1;Z(e.slice(0,c)+o,n,r)<=t?i=c:a=c-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(gr(s.charCodeAt(0))?2:3)?"":s+o}var yr=A(B(),1),Ya=e=>Array.isArray(e)&&e.length===2;function pr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Ya(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var xr=A(B(),1),Xt=10.5;function Ja(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let a=1;a<e.length;a++)o=Math.min(o,Math.abs(e[a]-e[a-1]));let i=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(a=>Ne(a,{locale:n,maximumFractionDigits:i}))}function br(e,t,n){let r=18;for(let o of Ja(e,t,n))r=Math.max(r,Z(o,Xt));return Math.ceil(r+8)}function Yt(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 _e(e,t,n=4,r={}){let o=e,i=t;if(!Number.isFinite(o)||!Number.isFinite(i))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),i<0&&(i=0)),o===i)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let a=i-o,s=r.pad??.07,c=Yt(a,n),u=[o,i];for(let h=0;h<4;h++){let m=Math.ceil(i/c-1e-9)*c,g=Math.floor(o/c+1e-9)*c;u=[o===0?0:o-g<=c*.3?g:o-a*s,i===0?0:m-i<=c*.3?m:i+a*s];let f=Yt(u[1]-u[0],n);if(f===c)break;c=f}return u}function kr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=Yt(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let c=s,u=0;c<=o+i*1e-9&&u<200;c+=i,u++)a.push(Number((Math.round(c/i)*i).toPrecision(12)));return a}function Jt(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(c=>o+(c-n)*a);return s.domain=e,s.range=t,s.invert=c=>a===0?n:n+(c-o)/a,s.ticks=(c=4)=>kr(n,r,c),s}function qt(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[i,a]=_e(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function qa(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(u,h=1)=>{let m=[];for(let g=Math.floor(r);g<=Math.ceil(o);g++)if(!(g%h))for(let f of u){let p=Number((f*10**g).toPrecision(12));p>=e*(1-1e-9)&&p<=t*(1+1e-9)&&m.push(p)}return m},s=i>=110?a([1,2,5]):a([1],Math.max(1,Math.ceil(24/i)));if(s.length>=2)return s;let c=a([1,2,3,4,5,6,7,8,9]);return c.length>=2?c:kr(e,t,3)}function wr(e,t){let n=Jt([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=()=>qa(e[0],e[1],Math.abs(t[1]-t[0])),r}function ze(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 Za=864e5;function vr(e,t,n,r=q){let o=t-e;if(!(o>0))return[{t:e,label:Ie(e,{locale:r,month:"short",day:"numeric"})}];let i=o/Za,a=[],s=new Date(e),c=new Date(e).getFullYear()===new Date(t).getFullYear(),u=(h,m,g,f=!1)=>{let p=new Date(h),x=-1,M=0;for(;p.getTime()<=t&&M++<500;){if(p.getTime()>=e){let w=p.getFullYear(),$=f&&!c&&w!==x;a.push({t:p.getTime(),label:Ie(p,{locale:r,...g,...$?{year:"numeric"}:{}})}),x=w}m(p)}};if(i<=1.5){let h=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),m=[1,2,3,4,6,12].find(f=>f>=h)??12,g=new Date(s);g.setMinutes(0,0,0),u(g,f=>f.setHours(f.getHours()+m),{hour:"numeric"})}else if(i<=n*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());u(h,m=>m.setDate(m.getDate()+1),{month:"numeric",day:"numeric"})}else if(i<=n*7*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());h.setDate(h.getDate()+(8-h.getDay())%7),u(h,m=>m.setDate(m.getDate()+7),{month:"numeric",day:"numeric"})}else{let h=i/30.44,m=Math.max(1,Math.ceil(h/Math.max(1,n))),g=[1,2,3,6,12,24,60].find(f=>f>=m)??120;if(g>=12){let f=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);u(f,p=>p.setFullYear(p.getFullYear()+g/12),{year:"numeric"})}else{let f=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),p=f.getMonth()%g;p&&f.setMonth(f.getMonth()+(g-p)),u(f,x=>x.setMonth(x.getMonth()+g),{month:"short"},!0)}}return a}function $r(e,t){let n=new Array(e),r=new Uint8Array(e),o=i=>{if(typeof i!="string"||i.length===0||i.length>9)return-1;let a=Number(i);return Number.isInteger(a)&&a>=0&&a<e&&String(a)===i?a:-1};return new Proxy(n,{get(i,a,s){let c=o(a);return c>=0?(r[c]||(i[c]=t(c),r[c]=1),i[c]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var Qa=(e,t,n)=>e==="date"?nt(t,n)?.getTime()??NaN:pe(t);function ei(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Gn(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Be(e,t,n,r,o={}){let i=$e(t,"x"),a=Array.isArray(n),s=a?n:null,c=a?null:$e(n,"y"),u=!a&&r!==void 0?$e(r,"series"):null,h=e.map((S,d)=>i(S,d)),m=o.xType??ei(h),g=o.locale??q,f,p,x;if(m==="band"){let S=h.map(l=>String(l??""));f=ce(S);let d=new Map(f.map((l,k)=>[l,k]));p=f.map((l,k)=>k),x=Int32Array.from(S,l=>d.get(l)??-1)}else{let S=m==="date"?o.dayFirst??Wn(h):void 0,d=h.map(v=>Qa(m,v,S)),l=Array.from(new Set(d.filter(v=>Number.isFinite(v)))).sort((v,F)=>v-F),k=new Map(l.map((v,F)=>[v,F]));p=l,f=l.map(String),x=Int32Array.from(d,v=>k.get(v)??-1)}let M=o.dateFormat,w=S=>typeof S=="string"?tt(S.trim())?.[3]:void 0,$=m==="date"&&h.length<5e3?w(h[0]):void 0,T=($===2||$===3)&&h.every(S=>w(S)===$),_=T&&$===3;if(m==="date"&&!M){let S=p.length>1?p[p.length-1]-p[0]:0;M=T&&$===2||S>864e5*120?{month:"short"}:S<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},S>864e5*800&&(M={year:"numeric",month:"short"})}let y;if(m==="band")y=f;else if(_&&!o.dateFormat){let S=K(g)==="ko";y=p.map(d=>{let l=new Date(d),k=Math.floor(l.getMonth()/3)+1;return S?`${l.getFullYear()}년 ${k}분기`:`Q${k} ${l.getFullYear()}`})}else{let S=p.every(Et),d=m==="date"?new Intl.DateTimeFormat(g,M):new Intl.NumberFormat(g,S?{useGrouping:!1}:{maximumFractionDigits:6});y=p.length>1e3?$r(p.length,l=>d.format(p[l])):p.map(l=>d.format(l))}let R=s?[...s]:u?ce(e.map((S,d)=>String(u(S,d)??""))):[""],z=new Map(R.map((S,d)=>[S,d])),D=R.map(()=>new Array(f.length).fill(NaN)),E=R.map(()=>new Array(f.length).fill(null)),I=o.aggregate??"sum",L=I==="mean"?R.map(()=>new Uint32Array(f.length)):null,C=(S,d,l,k)=>{let v=D[S][d];I==="last"?D[S][d]=l:I==="count"?D[S][d]=(Number.isFinite(v)?v:0)+1:I==="mean"?Number.isFinite(l)&&(D[S][d]=(Number.isFinite(v)?v:0)+l,L[S][d]++):D[S][d]=Number.isFinite(v)?v+(Number.isFinite(l)?l:0):l,E[S][d]=k};for(let S=0;S<e.length;S++){let d=x[S];if(d<0)continue;let l=e[S];if(s)for(let k=0;k<s.length;k++)C(k,d,pe(l[s[k]]),l);else{let k=u?z.get(String(u(l,S)??""))??0:0;C(k,d,pe(c(l,S)),l)}}if(L)for(let S=0;S<D.length;S++)for(let d=0;d<f.length;d++)L[S][d]>1&&(D[S][d]/=L[S][d]);return{type:m,keys:f,xnum:p,labels:y,series:R,values:D,rows:E}}var ti=140,je=12,Mr=14,Zt=20,Tr=12.5;function ni(e,t,n=nr){let r=re(t,t),o=new Map;e.forEach((a,s)=>{let c=r(a,s),u=o.get(c);u?u.push(a):o.set(c,[a])});let i=[...o.keys()].slice(0,n);return{values:i,groups:i.map(a=>o.get(a)),dropped:Math.max(0,o.size-n)}}function ri(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+je)/(ti+je))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function oi(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*je)/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 He=e=>e.filter(Number.isFinite);function ht(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Fe(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return He(n)}function Sr(e,t,n,r,o,i){return Be(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function ai(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),c=r.yDomain,u=c&&(!s||c[0]>0&&c[1]>0)?c:void 0;if(e==="scatter"){let y=t.flat(),R=r.refLines??{},[z,D]=ze([...ht(y,r.x??"x"),...He([Number(R.x)])]),[E,I]=ze([...ht(y,r.y??"y"),...He([Number(R.y)])].filter(C=>!s||C>0)),L=r.zero??!1;return{y:u??(s?qt(E,I,a):_e(E,I,a,{zero:L,pad:.08})),x:r.xDomain??_e(z,D,Math.max(2,Math.round(o/110)),{zero:L,pad:.06}),sameKeys:!0}}let h=e==="bar",m=h&&r.orientation==="horizontal",g=n[0]?.keys.join(""),f=n.every(y=>y.keys.join("")===g),p=n.length>0&&n.every(y=>y.type!=="band"&&y.type===n[0].type),x=r.xDomain??(!h&&p?ze(n.flatMap(y=>He(y.xnum))):void 0),M=h?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(M==="percent")return{x,sameKeys:f};if(u)return{y:u,x,sameKeys:f};let w=[];t.forEach((y,R)=>{let z=n[R];if(M==="stacked"||M==="auto"&&z.series.length>1){let E=Kt(z.values,"zero");E.y0.forEach(I=>w.push(...I)),E.y1.forEach(I=>w.push(...I))}else z.values.forEach(E=>w.push(...E));h&&!m&&r.line!==void 0&&Sr(e,y,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(E=>w.push(...E)),h||w.push(...ht(y,r.lower),...ht(y,r.upper))}),h&&w.push(0),m||w.push(...pr(r.annotations));for(let y of r.referenceLines??[])w.push(y.y);r.signColors&&w.push(Number(r.baseline??0));let[$,T]=ze(He(w).filter(y=>!s||y>0));return{y:s?qt($,T,a):h?_e($,T,m?Math.max(2,Math.round(o/120)):a):_e($,T,a,{zero:r.zero??e==="area"}),x,sameKeys:f}}function ii(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let c=Be(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),u=(r.yScale==="log"&&e==="line"?wr:Jt)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),h=br(u,zn(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),m=n.flatMap(y=>y.series),g=r.endLabels??n.some(y=>y.series.length>1),f=h+6,p=i-(g?Math.min(i*.28,Math.max(...m.map(y=>Z(y,11,700)),20)+14):10),x=c.keys.length,[M,w]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,$=c.type==="number"?x>12:x>vr(M,w,Math.max(2,Math.floor((p-f)/64)),s).length;if(c.type==="band"||!x||$)return;let T=y=>f+(c.xnum[y]-M)/(w-M)*(p-f),_=y=>Z(c.labels[y],Xt);for(let y=1;;y++){let R=Array.from({length:Math.ceil(x/y)},(z,D)=>D*y);if(y>=x||R.every((z,D)=>!D||T(z)-T(R[D-1])>=(_(z)+_(R[D-1]))/2+8))return R.map(z=>({value:c.xnum[z],label:c.labels[z]}))}}function si(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 li(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${si(`${e}|${t}|${o}|${mt(r)}`)}`}function ci(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 ui={en:{intro:(e,t)=>`${ge(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:"(빈 값)"}},Qt=18;function Cr(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=ni(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,c=ri(s,a,e.columns),{pw:u,ph:h}=oi(s,c,e.height),m=e.scale!=="free",g=t==="scatter"?[]:o.map(L=>Sr(t,L,n,n.y,n.series,n.aggregate)),f=m?ai(t,o,g,n,u,h):{sameKeys:!1},p=m?ii(t,o,g,n,f,u,h,e.locale):void 0,x=t==="bar"&&n.orientation==="horizontal",M=m&&(!x||f.sameKeys),w=m&&(x||f.x!==void 0||f.sameKeys),$=new Set(ci(e.highlight,r)?[e.highlight].flat():[]),T=$.size>0,_=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,y=e.syncId??li(t,e.by,n,e.data),R=et(ve(n.format,e.locale),n.unit),z=ui[e.lang],D=[],E=r.map(L=>L===""?z.blank:L);return{panels:r.map((L,C)=>{let S=o[C],d=E[C],l=C%c,k;if(t!=="scatter"){let F=g[C],O=W=>F.values.reduce((fe,Ve)=>fe+(Number.isFinite(Ve[W])?Ve[W]:0),0),P=F.keys.map((W,fe)=>fe).filter(W=>F.values.some(fe=>Number.isFinite(fe[W]))),j=P[P.length-1];D.push({first:P.length?O(P[0]):NaN,last:P.length?O(j):NaN,total:P.reduce((W,fe)=>W+O(fe),0)}),t!=="bar"&&F.series.length===1&&j!==void 0&&(k=R(F.values[0][j]))}else D.push({first:NaN,last:NaN,total:S.length});let v={data:S,width:u,height:h,ariaLabel:e.title?`${e.title}, ${d}`:d,syncId:y,highlight:T?$.has(L)?_?()=>!0:void 0:"none":e.highlight,showYAxis:!M||l===0,showXAxis:!w||C+c>=a};return f.y&&(v.yDomain=f.y),f.x&&(v.xDomain=f.x),p&&(v.xTicks=p),{value:L,label:d,props:v,last:k,isPicked:$.has(L)}}),cols:c,pw:u,ph:h,isPanelPick:T,description:mi(t,e.by,E,D,i,R,z)}}function mi(e,t,n,r,o,i,a){let s=a.intro(n.length,t),c=u=>fr(r.map(h=>h[u]));if(e==="line"||e==="area"){let u=c("last");u>=0&&(s+=a.endHigh(n[u],i(r[u].last)));let h=n.filter((m,g)=>r[g].last<r[g].first);s+=h.length?a.falling(`${h.slice(0,5).join(", ")}${h.length>5?a.more:""}`):a.noneFalling}else{let u=c("total");u>=0&&(s+=e==="bar"?a.total(n[u],i(r[u].total)):a.points(n[u],r[u].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var te=A(V(),1);function di(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function fi(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 gt={threshold:.25,enoughPx:96,rootMargin:"0px"};function Rr(e,t=!0){let[n,r]=(0,te.useState)({visible:!t,near:!t});return(0,te.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(a=>{let s=fi(a[a.length-1],gt.threshold,gt.enoughPx);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:di(gt.threshold),rootMargin:gt.rootMargin}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),i.observe(e),()=>{o.disconnect(),i.disconnect()}},[e,t]),n}function Ar(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function pt(e){let[t,n]=(0,te.useState)(null),[r,o]=(0,te.useState)(e??null),i=(0,te.useCallback)(a=>{n(a),a&&e===void 0&&o(Ar(a))},[e]);return he(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=u=>o(h=>h!==null&&Math.abs(h-u)<.5?h:u),s=()=>a(Ar(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(u=>{let h=u[u.length-1]?.contentRect;h?a(h.width>0?Math.round(h.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,i,r]}var hi=()=>()=>{};function Le(){return(0,te.useSyncExternalStore)(hi,()=>!0,()=>!1)}var Nr="(prefers-reduced-motion: reduce)";function yt(e="auto"){let[t,n]=(0,te.useState)(()=>ae&&typeof window.matchMedia=="function"?window.matchMedia(Nr).matches:!1);return(0,te.useEffect)(()=>{if(e!=="auto"||!ae||typeof window.matchMedia!="function")return;let r=window.matchMedia(Nr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var ue=A(B(),1),gi=60,pi=420;function Fr(e){let t=le(),n=e.chartProps??{},[,r,o]=pt(e.width),i=e.width??(o||480),a=Q(e.locale??n.locale),s=K(a),c=(0,Pe.useContext)(Se),u=e.title??c,h=e.chart.facetPlan,m=(0,Pe.useMemo)(()=>{let w=Cr({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:i,height:e.height,title:u,locale:a,lang:s});return h?h(w,n,a):w},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(w,$)=>typeof $=="function"?String($):$),e.highlight,e.syncId,i,e.height,u,a,s,h]),g=`${(0,Pe.useId)().replace(/:/g,"")}fd`,f=yt(n.reducedMotion??"auto"),p=Le(),x=$n({motion:{enabled:n.animate!==!1&&!f&&ae},hydrated:p},{waiting:!1,generation:0}),M=e.chart;return(0,ue.jsxs)("div",{ref:r,role:"group","aria-label":u,"aria-describedby":g,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,ue.jsx)("p",{id:g,style:lt,children:e.description??m.description}),(0,ue.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${m.cols}, minmax(0, 1fr))`,columnGap:je,rowGap:Mr,...m.legend?{marginTop:Qt}:null},children:m.panels.map((w,$)=>{let T=t.paint(w.isPicked?"accentText":m.isPanelPick?"muted":"ink");return(0,ue.jsxs)("div",{"data-facet":w.value,style:{minWidth:0,...vn(x,!1,"fade",$*gi,pi)},children:[(0,ue.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Zt,fontSize:Tr,fontWeight:700,lineHeight:`${Zt}px`,color:T},children:[(0,ue.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.label}),w.last!==void 0?(0,ue.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:w.last}):null]}),(0,ue.jsx)(M,{...n,...w.props})]},w.value)})}),m.legend?(0,ue.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:Qt},children:m.legend}):null]})}var _r=["max","min","first","last","none"];function me(e,t,n,r,o="max"){let i=new Set,a=n.length,s=u=>{if(a&&u!=="none"){if(u==="first")i.add(0);else if(u==="last")i.add(a-1);else if(u==="max"||u==="min"){let h=-1,m=u==="max"?-1/0:1/0;r.forEach((g,f)=>{Number.isFinite(g)&&(u==="max"?g>m:g<m)&&(m=g,h=f)}),h>=0&&i.add(h)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((u,h)=>{h<a&&u!==null&&u!==void 0&&e(u,h)&&i.add(h)}),i;let c=Array.isArray(e)?e:[e];for(let u of c)typeof u=="number"?u>=0&&u<a&&i.add(u):u==="max"||u==="min"||u==="first"||u==="last"||u==="none"?s(u):n.forEach((h,m)=>{h===u&&i.add(m)});return i}var oe=A(V(),1);async function yi(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",i=await e.text();if(t==="text")return i;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(i))throw new Error(K(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Me(i);if(t==="json"||o.includes("json"))return JSON.parse(i);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return Me(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):Me(i)}async function bi(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),i=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!i.ok)throw new Error(`HTTP ${i.status}${i.statusText?` ${i.statusText}`:""}`);r=await yi(i,t.parse,o,t.locale)}return t.select&&(r=lr(r,t.select)),t.transform?t.transform(r):ke(r)}function Lr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,oe.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,oe.useState)(0),u=Q(t.locale),h=(0,oe.useRef)(t);h.current={...t,locale:u};let m=(0,oe.useRef)(e);m.current=e;let g=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",f=t.deps??[],p=JSON.stringify(f.map(w=>typeof w=="object"?JSON.stringify(w):String(w))),x=(0,oe.useRef)(!1);(0,oe.useEffect)(()=>{let w=m.current;if(!w||!r){a(_=>_.status==="loading"?{..._,status:"idle"}:_);return}let $=new AbortController,T=!0;return x.current=!0,a(_=>({..._,data:o?_.data:[],status:"loading",error:null})),bi(w,{...h.current,signal:$.signal}).then(_=>{T&&a({data:_,status:"success",error:null,updatedAt:Date.now()})}).catch(_=>{!T||$.signal.aborted||a(y=>({...y,status:"error",error:_ instanceof Error?_:new Error(String(_))}))}).finally(()=>{T&&(x.current=!1)}),()=>{T=!1,x.current=!1,$.abort()}},[g,r,s,p,o]),(0,oe.useEffect)(()=>{if(!n||!r)return;let w=setInterval(()=>{x.current||c($=>$+1)},n);return()=>clearInterval(w)},[n,r]);let M=(0,oe.useCallback)(()=>c(w=>w+1),[]);return{data:i.data,status:i.status,loading:i.status==="loading",error:i.error,empty:i.status==="success"&&i.data.length===0,updatedAt:i.updatedAt,reload:M}}var tn=A(B(),1),xi=["csv","svg","png"],ki=/^[=+\-@\t\r\n=+-@]/,wi=/var\(|color-mix\(/;function Pr(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?Bn(e.getTime()):String(e);return`"${(ki.test(t)&&!Number.isFinite(pe(t))?`'${t}`:t).replace(/"/g,'""')}"`}function vi(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function $i(e,t){return`\uFEFF${[t.map(Pr),...e.map(r=>t.map(o=>Pr(r[o])))].map(r=>r.join(",")).join(`\r
22
+ `;function Ln(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 Pn(e,t){let[n]=(0,_n.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var Fn=!1;function Ve(){if(Fn||typeof document>"u"||(Fn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=jo,document.head.appendChild(e)}var nt=_(Y(),1),me=typeof window<"u"&&typeof document<"u",xe=me?nt.useLayoutEffect:nt.useEffect;function rt(){return typeof performance<"u"?performance.now():Date.now()}function J(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function ke(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Dn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},En={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Go=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Vo={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Wo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Ko(e){return Wo(Go,e)}function In(e,t){let n=Ko(e);return{text:n?n[t]:e,...Vo[n?.id??"basic"]}}var On={white:"#ffffff",black:"#000000",transparent:"#00000000"};function De(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),On[t.toLowerCase()]&&(t=On[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(a=>a+a).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let i=parseInt(o,16);return o.length===6?[i>>16&255,i>>8&255,i&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 i=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),a=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return i.some(s=>Number.isNaN(s))?null:[i[0],i[1],i[2],Number.isNaN(a)?1:a]}return null}function Hn(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 Ot(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 Ee(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function zn(e){return .2126*Ee(e[0])+.7152*Ee(e[1])+.0722*Ee(e[2])}function zt(e,t,n){let r=typeof e=="string"?De(e):e,o=typeof t=="string"?De(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?De(n):n:null;o[3]<1&&i&&(o=Ot(o,i));let a=r[3]<1?Ot(r,o):r,s=zn(a),l=zn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Xo(e){return[Ee(e[0]),Ee(e[1]),Ee(e[2])]}function It(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 Bn(e){let[t,n,r]=Xo(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*i-.0040720468*a,1.9779984951*o-2.428592205*i+.4505937099*a,.0259040371*o+.7827717662*i-.808675766*a]}function Uo([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[It(4.0767416621*o-3.3077115913*i+.2309699292*a),It(-1.2684380046*o+2.6097574011*i-.3413193965*a),It(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function ot(e,t,n){let r=De(e),o=De(t);if(!r||!o)return e;let i=Bn(r),a=Bn(o),s=Math.max(0,Math.min(1,n));return Hn(Uo([i[0]*s+a[0]*(1-s),i[1]*s+a[1]*(1-s),i[2]*s+a[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Bt(e,t,n){let r=t[0],o=-1;for(let i of t){let a=zt(i,e,n);a>o&&(o=a,r=i)}return r}function q(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 Yo(e,t){let n=Bt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return zt(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Bt(t,["#FFFFFF","#000000"])}function at(e,t){let n=ot(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Yo(e,n),raw:n}}function de(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=q(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=q(e,"neutral");else if(s===0)r[a]=q(e,"ink");else if(s===i-1)r[a]=q(e,"neutral");else if(i===3)r[a]=q(e,"strong");else{let l=(s-1)/Math.max(1,i-2);r[a]=l<=.001?q(e,"strong"):at(e,1-l)}}),r}var Ht="mix:";function Se(e){return e({theme:Lt,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Ht}${o}`}).map(n=>n.fill)}function jn(e,t){return t?.startsWith(Ht)?e.mix("neutralStrong","neutral",Number(t.slice(Ht.length))):e.color(t)}function We(e,t,n){return de(e,t+1,n).slice(0,t)}function Gn(e,t,n,r="neutral"){let o=q(e,"accent"),i=q(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function Vn(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=q(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=q(e,"neutral"):s===0?r[a]=q(e,"strong"):s===i-1?r[a]=q(e,"neutral"):r[a]=at(e,1-s/(i-1))}),r}var fe=_(Y(),1);var st=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),ne="en-US",Wn=new Map;function jt(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=Wn.get(r);return o||(o=new Intl.NumberFormat(e,n),Wn.set(r,o)),o}function Gt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ie(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ne,...r}=t;return Gt(jt(n,r).format(e))}var Vt=e=>e!==0&&Math.abs(e)<.05,Wt=(e,t,n="")=>`${Ie(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function it(e,t={}){if(!Number.isFinite(e))return"-";if(Vt(e)&&t.maximumFractionDigits===void 0)return Wt(e,t.locale??ne,"%");let n=Math.abs(e);return`${Ie(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Yn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ne,...r}=t;if(J(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,l]=i[a],c=o/s,f=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**f)/10**f;if(a>0&&u>=i[a-1][0]/s){a--;continue}return(e<0&&u!==0?"-":"")+Ie(u,{locale:n,...r,maximumFractionDigits:f})+l}}return Gt(jt(n,{notation:"compact",...r}).format(e))}var Jo=(e,t=J(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ne(e,t=ne,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=jt(t,o);return l=>Number.isFinite(l)?`${a}${Gt(s.format(l))}${i}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:i="",...a}=e;return r(a,o,i)}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=>Yn(o,{locale:t});case"currency":return r(Jo(t));default:{let o=r({maximumFractionDigits:1});return i=>Vt(i)?Wt(i,t):o(i)}}}function Jn(e,t=ne,n=0){return e!==void 0?Ne(e,t):n>=1e5?r=>Vt(r)?Wt(r,t):Yn(r,{locale:t}):r=>Ie(r,{locale:t})}function Zo(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Kt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,qo=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Qo=["january","february","march","april","may","june","july","august","september","october","november","december"],Kn=e=>{let t=e.toLowerCase();return t.length<3?0:Qo.findIndex(n=>n.startsWith(t))+1},Xn=e=>+e+(+e<30?2e3:1900);function Zn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var ea=[/^(\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})일)?$/],qn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Qn=/\{([^{}]+)\}/g;function lt(e,t){let n;for(let r of ea)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?[Xn(n[3]),+n[2],+n[1],1]:[Xn(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=qn.exec(e)){let r=+n[1],o=+n[3],i=r>12||o<=12&&t===!0;return[+n[4],i?o:r,i?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Kn(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=Kn(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var er=e=>qo.test(e)||lt(e)!==null;function tr(e){let t;for(let n of e){let r=typeof n=="string"?qn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function ct(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(Kt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return ct(`${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=lt(n,t);if(r)return Zo(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 Un=new Map;function Ke(e,t={month:"short",day:"numeric"}){let n=ct(e);if(!n)return"-";let{locale:r=ne,...o}=t,i=r+JSON.stringify(o),a=Un.get(i);return a||(a=new Intl.DateTimeFormat(r,o),Un.set(i,a)),a.format(n)}var Xt=_(j(),1),ut=(0,fe.createContext)({theme:Te,cssVars:!0});function ta(e,t=Te){return e?typeof e=="string"?Pt[e]??t:Et(t,e):t}function mt(e){let t=(0,fe.useContext)(ut),n=e.base?Pt[e.base]:t.theme,r=(0,fe.useMemo)(()=>ta(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,fe.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,fe.useMemo)(()=>Dt(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Xt.jsx)(ut.Provider,{value:a,children:(0,Xt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var na=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function rr(e){return na.has(e)}function ra(e,t){let n=r=>t?`var(${tt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?rr(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?rr(r)?e[r]:r:e[o],mix:(r,o,i)=>{let a=Math.round(Math.max(0,Math.min(1,i))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${a}%, ${n(o)})`:ot(e[r],e[o],i)}}}function he(e){let t=(0,fe.useContext)(ut);return(0,fe.useMemo)(()=>{let n=Et(t.theme,e);return ra(n,t.cssVars)},[t.theme,t.cssVars,e])}function oe(e){let t=(0,fe.useContext)(ut);return e??t.locale??ne}function or(e){return e?Dt(e):{}}var dt=_(Y(),1),Ut=(0,dt.createContext)(void 0);function ar(e){let t=(0,dt.useContext)(Ut);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var L=_(j(),1),oa={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`},aa={en:oa,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var ia={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Yt=e=>aa[J(oe(e))];function Jt(e){let t=he(e.theme),n=Yt(e.locale),[r,o]=(0,ft.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),l=e.items.filter(f=>!s.has(f.label)).length,c=(0,L.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((f,u)=>{let m=!s.has(f.label),h=m&&l===1,d=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(sa,{p:t,item:f,off:!m}),(0,L.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:f.label})]});return(0,L.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,L.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":h||void 0,onClick:()=>{h||(a(f.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:d}):d},u)})});return a?(0,L.jsxs)(L.Fragment,{children:[c,(0,L.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:ia,children:r?n.shown(l,e.items.length):""})]}):c}function sa({p:e,item:t,off:n}){let r=jn(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,L.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,L.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,L.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,L.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 la(e){let t=he(e.theme),n=In(e.level,J(oe(e.locale)));return(0,L.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 ca(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,L.jsxs)(L.Fragment,{children:[e.slice(0,r),(0,L.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function ir(e){let t=he(e.theme),n=Yt(e.locale),[r,o]=(0,ft.useState)(0);xe(()=>Ve(),[]);let i=()=>{o(m=>m+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,L.jsx)(Jt,{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,f=e.source!==void 0||e.note!==void 0?(0,L.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,L.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,L.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,L.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,L.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,L.jsx)(la,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,L.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,L.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,L.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,L.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:ca(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,L.jsx)("button",{type:"button",className:"ztd-btn",onClick:i,"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,L.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,L.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,L.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,L.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,L.jsx)("span",{}),a]}):null]}),(0,L.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,L.jsx)(Ut.Provider,{value:r,children:(0,L.jsx)(Pe.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),f?(0,L.jsxs)(L.Fragment,{children:[f,u]}):u]})}function Zt(e){let t=he(e.theme),n=Yt(e.locale),r=e.height??220;if(xe(()=>Ve(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,L.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,L.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,L.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,L.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,L.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,L.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,i)=>(0,L.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${i*90}ms`}},i))}):e.empty?(0,L.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,L.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,L.jsx)(L.Fragment,{children:e.children})}var He=_(Y(),1);var ae=_(Y(),1);var W=_(j(),1),ht=60;var gt={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function sr(e){let{c:t,events:n}=e,r=(0,ae.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,xe(()=>{Ve()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,ae.useContext)(Pe),c=e.ariaLabel??l??e.kind,f=(0,ae.useMemo)(()=>s?`${n.length}${n.slice(0,ht).map(w=>`${w.label}${w.series??""}${w.formatted??w.value??""}`).join("")}`:"",[n,s]),u=(0,ae.useMemo)(()=>(0,W.jsx)(ua,{label:c,events:n,t:t.t}),[c,f,t.t]),m=(0,ae.useRef)(null);(0,ae.useEffect)(()=>{let w=()=>{m.current=null};return window.addEventListener("scroll",w,{capture:!0,passive:!0}),window.addEventListener("resize",w,{passive:!0}),()=>{window.removeEventListener("scroll",w,{capture:!0}),window.removeEventListener("resize",w)}},[]),(0,ae.useEffect)(()=>{m.current=null},[t.width,t.height]);let h=w=>{if(w.target!==w.currentTarget)return;if(e.onKey?.(w)){w.preventDefault();return}let g=t.active,T;switch(w.key){case"ArrowRight":case"ArrowDown":T=g===null?0:(g+1)%a;break;case"ArrowLeft":case"ArrowUp":T=g===null?a-1:(g-1+a)%a;break;case"Home":T=0;break;case"End":T=a-1;break;case"Escape":if(g===null)return;T=null;break;case"Enter":case" ":g!==null&&(w.preventDefault(),t.click(g));return;default:return}w.preventDefault(),t.setActive(T,"keyboard")},{via:d,node:p,setActive:M}=t;(0,ae.useEffect)(()=>{if(d!=="touch"||!p)return;let w=g=>{p.contains(g.target)||M(null)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[d,p,M]);let b=t.active!==null?n[t.active]:null,v=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,S=v&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,F=typeof e.renderTip=="function"&&b?e.renderTip(b):null,k=e.announce??(t.via==="keyboard"&&b?`${b.label}${b.series?` ${b.series}`:""}: ${b.formatted??b.value??""} (${(t.active??0)+1}/${a})`:""),P;if(v){let w=v.x*S,g=t.width*S,T=`clamp(${(4-w).toFixed(1)}px, -50%, calc(${(g-w-4).toFixed(1)}px - 100%))`,N=v.y<64;P={position:"absolute",left:w,top:v.y*S,transform:`translate(${T}, ${N?"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*S-8)}}let H=w=>{m.current=null,w.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},I=w=>w?g=>{let T=m.current??(m.current=g.currentTarget.getBoundingClientRect());T.width&&w((g.clientX-T.left)/T.width*t.width,(g.clientY-T.top)/T.height*t.height,g)}:void 0,G=I(e.onPointerMove),z=I(e.onPointerDown),D=G||z?w=>{w.pointerType==="touch"&&G?.(w),z?.(w)}:void 0,C=I(e.onPointerUp),A=or(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":i,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:w=>{t.via==="keyboard"&&!w.currentTarget.contains(w.relatedTarget)&&t.setActive(null)},onPointerLeave:H,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} ${i}`,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:G,onPointerDown:D,onPointerUp:C,onPointerCancel:C,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:i,children:a||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,v?(0,W.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:P,children:F??(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:v.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:v.title}),v.rows.map((w,g)=>(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(w.strong?"ink":"muted")},children:[w.color?(0,W.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:w.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,w.label]}),(0,W.jsx)("span",{style:{fontWeight:w.strong===!1?500:700},children:w.value})]},g))]})}):null,(0,W.jsx)("span",{className:"ztd-sr",style:gt,"aria-live":"polite","aria-atomic":"true",children:k}),s&&!t.pending?u:null]})}function ua({label:e,events:t,t:n}){return(0,W.jsx)("div",{className:"ztd-sr",style:gt,children:(0,W.jsxs)("table",{children:[(0,W.jsx)("caption",{children:n.table(e)}),(0,W.jsxs)("tbody",{children:[t.slice(0,ht).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>ht?(0,W.jsx)("tr",{children:(0,W.jsx)("td",{colSpan:2,children:n.more(t.length-ht)})}):null]})]})})}function pt(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}),ce=y("label","string",!0,"Item name field"),ee=y("value","number",!0,"Value field"),ma=[ce,ee],da=[ce,ee],fa=[y("label","string",!0,"Stage name"),y("value","number",!0,"Users at the stage")],ha=[ce,ee],ga=[y("label","string",!0,"Leaf (lowest level) name"),ee,y("group","string",!1,"Parent group field")],pa=[y("label","string",!0,"Leaf name"),ee,y("group","string",!1,"Parent group field")],ya=[ce,y("value","number",!0,"Change (total rows may omit it)"),y("type","string",!1,'"total" makes a total bar')],ba=[ce,ee],xa=[y("x","string",!0,"Column field"),y("series","string",!0,"Stacked series field"),ee],ka=[y("x","string",!0,"Column field"),y("y","string",!0,"Row field"),ee],wa=[y("axis","string",!0,"Metric (axis) field"),y("value","number",!0,"Value field",{multi:!0}),y("series","string",!1,"Series field")],va=[y("x","number",!0,"x value"),y("y","number",!0,"y value"),y("size","number",!1,"Circle size"),y("label","string",!1,"Name")],cr=y("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),$a=[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}),cr],Ma=[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}),cr],Ta=[y("x","any",!0,"x field"),y("y","number",!0,"y field",{multi:!0}),y("series","string",!1,"Series field")],Sa=[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})],Ca=[ce,ee],Aa=[y("value","number",!0,"Value field",{prop:"valueKey"}),y("target","number",!1,"Target field",{prop:"targetKey"})],Na=[ce,y("value","number",!0,"Actual value field"),y("target","number",!1,"Target field")],Ra=[y("x","any",!1,"x field"),y("y","number",!0,"y field")],Fa=[ce,y("x","string",!1,"Period field (long tables)"),y("value","number",!1,"Value field (long tables)")],_a=[ce,y("start","number",!0,"Before value"),y("end","number",!0,"After value")],La=[ce,ee],Pa=[y("value","number",!0,"Value field"),y("group","string",!1,"Group (row) field"),y("label","string",!1,"Dot name")],Da=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],Ea=[y("source","string",!1,"Source node"),y("target","string",!1,"Target node"),y("dimensions","string",!1,"Stage columns of a wide table, left to right (2 to 6). Each row is one path, so source and target are not used. Without value, each row counts 1",{multi:!0}),y("value","number",!1,"Value field")],Ia=[y("source","string",!0,"Sending group"),y("target","string",!0,"Receiving group"),ee],Oa=[y("date","date",!0,"Date field"),ee],za=[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)")],Ba=[y("group","string",!0,"Group field"),y("value","number",!0,"Value field")],Ha=[y("label","string",!1,"Row name field")],ja=[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")],Ga=[ce,ee],Va=[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})],Wa=[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)")],Ka=[y("region","string",!0,"Region name or code, matched to a tile of options.map"),ee],Xa=[ce,ee,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")],Ua=[y("source","string",!0,"Source node"),y("target","string",!0,"Target node"),y("value","number",!1,"Link weight. Without it every row counts 1")],Ya=[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")],Ja=[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")],Za=[y("region","string",!0,"Region name or code, matched to a region of options.map"),ee],qa=[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)")],Qa=[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")],ei=[y("cohort","any",!0,"Cohort: a name or a start date. Cohorts go in date order when all read as dates, otherwise in order of first appearance"),y("period","any",!0,"Periods since the cohort started: 0, 1, 2 ... In number order when all are numbers"),y("value","number",!0,"People still active, or the share still active (see options.valueType)"),y("size","number",!1,"Cohort size. The first value of each cohort counts")],ti=[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)")],ni=[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")],ri=[y("label","string",!0,"Row name field (one row per metric)"),y("x","any",!0,"Period field (date, number or category). Every row shares the same period axis"),ee,y("target","number",!1,"Target field. Each row uses its last filled value")],lr={pie:ma,donut:da,funnel:fa,waffle:ha,treemap:ga,sunburst:pa,waterfall:ya,pareto:ba,marimekko:xa,heatmap:ka,radar:wa,bubble:va,line:$a,area:Ma,stream:Ta,bar:Sa,radialBar:Ca,gauge:Aa,bullet:Na,sparkline:Ra,slope:Fa,dumbbell:_a,lollipop:La,beeswarm:Pa,ridgeline:Da,sankey:Ea,chord:Ia,calendar:Oa,bump:za,box:Ba,parallel:Ha,candlestick:ja,segmented:Ga,skyline:Va,histogram:Wa,scatter:ni,tileMap:Ka,barRace:Xa,network:Ua,timeline:Ya,tree:Ja,choropleth:Za,symbolMap:qa,flowMap:Qa,sparkTable:ri,cohort:ei,horizon:ti},Oe={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:"흐름 지도"},sparkTable:{component:"SparkTable",name:"KPI table",nameKo:"지표 표"},cohort:{component:"CohortChart",name:"Cohort chart",nameKo:"코호트 차트"},horizon:{component:"HorizonChart",name:"Horizon chart",nameKo:"호라이즌 차트"}};function ur(e,t){return t==="ko"?e.nameKo:e.name}function mr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var dr=["line","area","bar","scatter"],fr=24;var qt=["line","area","bar","scatter","timeline"];function Qt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function hr(e,t,n){return qt.includes(e)&&!Qt(e,t,n).length&&!(e==="scatter"&&yt(n))}function yt(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function gr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var oi={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",butterfly:"bar",pyramid:"bar",populationPyramid:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",raincloud:"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",alluvial:"sankey",parallelSets:"sankey",kpiTable:"sparkTable",metricTable:"sparkTable",sparklineTable:"sparkTable",retention:"cohort",cohortTable:"cohort",retentionTable:"cohort",horizonChart:"horizon",horizonGraph:"horizon"};function bt(e){let t=lr[e]?e:oi[e]??Object.keys(Oe).find(n=>n.toLowerCase()===e.toLowerCase()||Oe[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Oe[t]))return{type:t,component:Oe[t].component,name:Oe[t].name,nameKo:Oe[t].nameKo,encoding:lr[t]}}function pr(e){let t=new Set,n=i=>{Array.isArray(i)?i.forEach(n):typeof i=="string"&&i&&t.add(i)},r=e.encoding??{};for(let i of bt(e.type)?.encoding.map(a=>a.name)??Object.keys(r))n(r[i]);let o=e.options??{};for(let i of["dimensions","start","end","ranges"])n(o[i]);return[...t]}function xt(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function ai(e,t){if(e==null||typeof e!="object")return;let n=e;if(xt(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!xt(r,o))return;r=r[o]}return r}}function we(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 Re(e,t){if(typeof e=="function")return e;let n=e??t;return r=>ai(r,n)}function Fe(e,t){let n=Re(e,t);return(r,o)=>we(n(r,o))}function ie(e,t){let n=Re(e,t);return(r,o)=>{let i=n(r,o);return i==null?"":i instanceof Date?new Date(i.getTime()-i.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(i)}}function ge(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function ii(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,i=[","," ",";","|"],a=",",s=0;for(let l of i){let c=o(l);c>s&&(s=c,a=l)}return a}var si=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function yr(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(si.test(t)||/^[-+]?\.\d+$/.test(t)){let n=we(t);if(Number.isFinite(n))return n}return t}function _e(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??ii(o),a=[],s=[],l="",c=!1;for(let d=0;d<o.length;d++){let p=o[d];c?p==='"'?o[d+1]==='"'?(l+='"',d++):c=!1:l+=p:p==='"'&&!l.trim()?(c=!0,l=""):p===i?(s.push(l),l=""):p===`
24
+ `||p==="\r"?(p==="\r"&&o[d+1]===`
25
+ `&&d++,s.push(l),a.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),a.push(s));let f=a.filter(d=>!(d.length===1&&d[0].trim()===""));if(!f.length)return[];let u=d=>n?yr(d):d;if(!r)return f.map(d=>Object.fromEntries(d.map((p,M)=>[String(M),u(p)])));let m=[],h=new Set;return f[0].forEach((d,p)=>{let M=d.trim()||`col${p+1}`,b=M;for(let v=2;h.has(b);v++)b=`${M}_${v}`;h.add(b),m.push(b)}),f.slice(1).map(d=>Object.fromEntries(m.map((p,M)=>[p,u(d[M]??"")])))}function en(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((a,s)=>String(a??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(a=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof a[l]=="string"?yr(a[l]):a[l]??null])))}function li(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(i=>Array.isArray(i))){let i=Object.keys(e),a=Math.max(...o.map(s=>s.length));return Array.from({length:a},(s,l)=>Object.fromEntries(i.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function br(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 Ce(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Ce(JSON.parse(t))}catch{}return _e(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?en(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)?Ce(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?en(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)?Ce(t.rows):Array.isArray(t.values)?en(t.values):Array.isArray(t.items)?Ce(t.items):Array.isArray(t.results)?Ce(t.results):li(t)}return[]}function kt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=i=>{try{return JSON.stringify(i)}catch{return String(i)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let i=0;i<t;i+=r)o.push(e[i]);return o.push(e[t-1]),`${t}:${n(o)}`}function tn(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),i=e.map(()=>new Array(r).fill(0)),a=(l,c)=>{let f=e[l][c];return Number.isFinite(f)&&f>0?f: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 f=0,u=0;for(let m=0;m<n;m++){let h=a(m,c),d=h-a(m,c-1),p=0;for(let M=0;M<m;M++)p+=a(M,c)-a(M,c-1);f+=h,u+=(d/2+p)*h}f&&(l-=u/f),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 d=e[h][l],p=Number.isFinite(d)?d:0;p>=0?(o[h][l]=u,u+=p,i[h][l]=u):(o[h][l]=m,m+=p,i[h][l]=m)}continue}let c=0;for(let u=0;u<n;u++)c+=a(u,l);let f=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let m=a(u,l);t==="expand"&&(m=c?m/c*100:0),o[u][l]=f,f+=m,i[u][l]=f}}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,i[n-1]?.[u]??0);let f=0;for(let u=0;u<r;u++)f+=((o[0]?.[u]??0)+(i[n-1]?.[u]??0))/2;f/=r;for(let u=0;u<n;u++)for(let m=0;m<r;m++)o[u][m]-=f,i[u][m]-=f}return{y0:o,y1:i}}function xr(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 kr(e){let t=e.length,n=e.map(c=>{let f=0,u=-1/0;return c.forEach((m,h)=>{m>u&&(u=m,f=h)}),f}),r=e.map(c=>c.reduce((f,u)=>f+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,f)=>f).sort((c,f)=>n[c]-n[f]),i=[],a=[],s=0,l=0;for(let c of o)s<l?(i.push(c),s+=r[c]):(a.push(c),l+=r[c]);return[...a.reverse(),...i]}var ci=Math.PI*2;function wt(e,t,n){return e<t?t:e>n?n:e}function wr(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function X(e){return Math.round(e*100)/100}function vr(e,t,n,r,o){if(n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),n<=.01||r<=.01)return"";let i=typeof o=="number"?{tl:o,tr:o,br:o,bl:o}:o,a=Math.min(n,r)/2,s=wt(i.tl??0,0,a),l=wt(i.tr??0,0,a),c=wt(i.br??0,0,a),f=wt(i.bl??0,0,a);return`M${X(e+s)},${X(t)}H${X(e+n-l)}`+(l?`A${X(l)},${X(l)} 0 0 1 ${X(e+n)},${X(t+l)}`:"")+`V${X(t+r-c)}`+(c?`A${X(c)},${X(c)} 0 0 1 ${X(e+n-c)},${X(t+r)}`:"")+`H${X(e+f)}`+(f?`A${X(f)},${X(f)} 0 0 1 ${X(e)},${X(t+r-f)}`:"")+`V${X(t+s)}`+(s?`A${X(s)},${X(s)} 0 0 1 ${X(e+s)},${X(t)}`:"")+"Z"}function $r(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Tr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Mr(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 vt=new Map;function re(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=vt.get(o);if(i===void 0){let a=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);Tr(c)?a+=Mr(c):s+=Mr(c)}i=a+s*(n>=600?1.07:1),vt.size>5e3&&vt.clear(),vt.set(o,i)}return i*t}function $t(e,t,n,r=400){if(e=e.trim(),re(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let l=i+a+1>>1;re(e.slice(0,l)+o,n,r)<=t?i=l:a=l-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(Tr(s.charCodeAt(0))?2:3)?"":s+o}var Cr=_(j(),1),ui=e=>Array.isArray(e)&&e.length===2;function Sr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&ui(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var Nr=_(j(),1),nn=10.5;function mi(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let a=1;a<e.length;a++)o=Math.min(o,Math.abs(e[a]-e[a-1]));let i=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(a=>Ie(a,{locale:n,maximumFractionDigits:i}))}function Ar(e,t,n){let r=18;for(let o of mi(e,t,n))r=Math.max(r,re(o,nn));return Math.ceil(r+8)}function rn(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 ze(e,t,n=4,r={}){let o=e,i=t;if(!Number.isFinite(o)||!Number.isFinite(i))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),i<0&&(i=0)),o===i)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let a=i-o,s=r.pad??.07,l=rn(a,n),c=[o,i];for(let f=0;f<4;f++){let u=Math.ceil(i/l-1e-9)*l,m=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-m<=l*.3?m:o-a*s,i===0?0:u-i<=l*.3?u:i+a*s];let h=rn(c[1]-c[0],n);if(h===l)break;l=h}return c}function Rr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=rn(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let l=s,c=0;l<=o+i*1e-9&&c<200;l+=i,c++)a.push(Number((Math.round(l/i)*i).toPrecision(12)));return a}function on(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(l=>o+(l-n)*a);return s.domain=e,s.range=t,s.invert=l=>a===0?n:n+(l-o)/a,s.ticks=(l=4)=>Rr(n,r,l),s}function an(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[i,a]=ze(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function di(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(c,f=1)=>{let u=[];for(let m=Math.floor(r);m<=Math.ceil(o);m++)if(!(m%f))for(let h of c){let d=Number((h*10**m).toPrecision(12));d>=e*(1-1e-9)&&d<=t*(1+1e-9)&&u.push(d)}return u},s=i>=110?a([1,2,5]):a([1],Math.max(1,Math.ceil(24/i)));if(s.length>=2)return s;let l=a([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:Rr(e,t,3)}function Fr(e,t){let n=on([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=()=>di(e[0],e[1],Math.abs(t[1]-t[0])),r}function Xe(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 fi=864e5;function _r(e,t,n,r=ne){let o=t-e;if(!(o>0))return[{t:e,label:Ke(e,{locale:r,month:"short",day:"numeric"})}];let i=o/fi,a=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(f,u,m,h=!1)=>{let d=new Date(f),p=-1,M=0;for(;d.getTime()<=t&&M++<500;){if(d.getTime()>=e){let b=d.getFullYear(),v=h&&!l&&b!==p;a.push({t:d.getTime(),label:Ke(d,{locale:r,...m,...v?{year:"numeric"}:{}})}),p=b}u(d)}};if(i<=1.5){let f=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=f)??12,m=new Date(s);m.setMinutes(0,0,0),c(m,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(i<=n*1.2){let f=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(f,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(i<=n*7*1.2){let f=new Date(s.getFullYear(),s.getMonth(),s.getDate());f.setDate(f.getDate()+(8-f.getDay())%7),c(f,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let f=i/30.44,u=Math.max(1,Math.ceil(f/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,d=>d.setFullYear(d.getFullYear()+m/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),d=h.getMonth()%m;d&&h.setMonth(h.getMonth()+(m-d)),c(h,p=>p.setMonth(p.getMonth()+m),{month:"short"},!0)}}return a}function Lr(e,t){let n=new Array(e),r=new Uint8Array(e),o=i=>{if(typeof i!="string"||i.length===0||i.length>9)return-1;let a=Number(i);return Number.isInteger(a)&&a>=0&&a<e&&String(a)===i?a:-1};return new Proxy(n,{get(i,a,s){let l=o(a);return l>=0?(r[l]||(i[l]=t(l),r[l]=1),i[l]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var hi=(e,t,n)=>e==="date"?ct(t,n)?.getTime()??NaN:we(t);function gi(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&er(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Ue(e,t,n,r,o={}){let i=Re(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:Re(n,"y"),c=!a&&r!==void 0?Re(r,"series"):null,f=e.map((A,w)=>i(A,w)),u=o.xType??gi(f),m=o.locale??ne,h,d,p;if(u==="band"){let A=f.map(g=>String(g??""));h=ge(A);let w=new Map(h.map((g,T)=>[g,T]));d=h.map((g,T)=>T),p=Int32Array.from(A,g=>w.get(g)??-1)}else{let A=u==="date"?o.dayFirst??tr(f):void 0,w=f.map(N=>hi(u,N,A)),g=Array.from(new Set(w.filter(N=>Number.isFinite(N)))).sort((N,E)=>N-E),T=new Map(g.map((N,E)=>[N,E]));d=g,h=g.map(String),p=Int32Array.from(w,N=>T.get(N)??-1)}let M=o.dateFormat,b=A=>typeof A=="string"?lt(A.trim())?.[3]:void 0,v=u==="date"&&f.length<5e3?b(f[0]):void 0,S=(v===2||v===3)&&f.every(A=>b(A)===v),F=S&&v===3;if(u==="date"&&!M){let A=d.length>1?d[d.length-1]-d[0]:0;M=S&&v===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&&(M={year:"numeric",month:"short"})}let k;if(u==="band")k=h;else if(F&&!o.dateFormat){let A=J(m)==="ko";k=d.map(w=>{let g=new Date(w),T=Math.floor(g.getMonth()/3)+1;return A?`${g.getFullYear()}년 ${T}분기`:`Q${T} ${g.getFullYear()}`})}else{let A=d.every(Kt),w=u==="date"?new Intl.DateTimeFormat(m,M):new Intl.NumberFormat(m,A?{useGrouping:!1}:{maximumFractionDigits:6});k=d.length>1e3?Lr(d.length,g=>w.format(d[g])):d.map(g=>w.format(g))}let P=s?[...s]:c?ge(e.map((A,w)=>String(c(A,w)??""))):[""],H=new Map(P.map((A,w)=>[A,w])),I=P.map(()=>new Array(h.length).fill(NaN)),G=P.map(()=>new Array(h.length).fill(null)),z=o.aggregate??"sum",D=z==="mean"?P.map(()=>new Uint32Array(h.length)):null,C=(A,w,g,T)=>{let N=I[A][w];z==="last"?I[A][w]=g:z==="count"?I[A][w]=(Number.isFinite(N)?N:0)+1:z==="mean"?Number.isFinite(g)&&(I[A][w]=(Number.isFinite(N)?N:0)+g,D[A][w]++):I[A][w]=Number.isFinite(N)?N+(Number.isFinite(g)?g:0):g,G[A][w]=T};for(let A=0;A<e.length;A++){let w=p[A];if(w<0)continue;let g=e[A];if(s)for(let T=0;T<s.length;T++)C(T,w,we(g[s[T]]),g);else{let T=c?H.get(String(c(g,A)??""))??0:0;C(T,w,we(l(g,A)),g)}}if(D)for(let A=0;A<I.length;A++)for(let w=0;w<h.length;w++)D[A][w]>1&&(I[A][w]/=D[A][w]);return{type:u,keys:h,xnum:d,labels:k,series:P,values:I,rows:G}}var pi=140,Je=12,Pr=14,sn=20,Dr=12.5;function yi(e,t,n=fr){let r=ie(t,t),o=new Map;e.forEach((a,s)=>{let l=r(a,s),c=o.get(l);c?c.push(a):o.set(l,[a])});let i=[...o.keys()].slice(0,n);return{values:i,groups:i.map(a=>o.get(a)),dropped:Math.max(0,o.size-n)}}function bi(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Je)/(pi+Je))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function xi(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*Je)/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 Ye=e=>e.filter(Number.isFinite);function Mt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=Fe(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return Ye(n)}function Er(e,t,n,r,o,i){return Ue(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function ki(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/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 k=t.flat(),P=r.refLines??{},[H,I]=Xe([...Mt(k,r.x??"x"),...Ye([Number(P.x)])]),[G,z]=Xe([...Mt(k,r.y??"y"),...Ye([Number(P.y)])].filter(C=>!s||C>0)),D=r.zero??!1;return{y:c??(s?an(G,z,a):ze(G,z,a,{zero:D,pad:.08})),x:r.xDomain??ze(H,I,Math.max(2,Math.round(o/110)),{zero:D,pad:.06}),sameKeys:!0}}let f=e==="bar",u=f&&r.orientation==="horizontal",m=n[0]?.keys.join(""),h=n.every(k=>k.keys.join("")===m),d=n.length>0&&n.every(k=>k.type!=="band"&&k.type===n[0].type),p=r.xDomain??(!f&&d?Xe(n.flatMap(k=>Ye(k.xnum))):void 0),M=f?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(M==="percent")return{x:p,sameKeys:h};if(c)return{y:c,x:p,sameKeys:h};let b=[];t.forEach((k,P)=>{let H=n[P];if(M==="stacked"||M==="auto"&&H.series.length>1){let G=tn(H.values,"zero");G.y0.forEach(z=>b.push(...z)),G.y1.forEach(z=>b.push(...z))}else H.values.forEach(G=>b.push(...G));f&&!u&&r.line!==void 0&&Er(e,k,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(G=>b.push(...G)),f||b.push(...Mt(k,r.lower),...Mt(k,r.upper))}),f&&b.push(0),u||b.push(...Sr(r.annotations));for(let k of r.referenceLines??[])b.push(k.y);r.signColors&&b.push(Number(r.baseline??0));let[v,S]=Xe(Ye(b).filter(k=>!s||k>0));return{y:s?an(v,S,a):f?ze(v,S,u?Math.max(2,Math.round(o/120)):a):ze(v,S,a,{zero:r.zero??e==="area"}),x:p,sameKeys:h}}function wi(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Ue(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?Fr:on)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),f=Ar(c,Jn(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(k=>k.series),m=r.endLabels??n.some(k=>k.series.length>1),h=f+6,d=i-(m?Math.min(i*.28,Math.max(...u.map(k=>re(k,11,700)),20)+14):10),p=l.keys.length,[M,b]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,v=l.type==="number"?p>12:p>_r(M,b,Math.max(2,Math.floor((d-h)/64)),s).length;if(l.type==="band"||!p||v)return;let S=k=>h+(l.xnum[k]-M)/(b-M)*(d-h),F=k=>re(l.labels[k],nn);for(let k=1;;k++){let P=Array.from({length:Math.ceil(p/k)},(H,I)=>I*k);if(k>=p||P.every((H,I)=>!I||S(H)-S(P[I-1])>=(F(H)+F(P[I-1]))/2+8))return P.map(H=>({value:l.xnum[H],label:l.labels[H]}))}}function vi(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 $i(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${vi(`${e}|${t}|${o}|${kt(r)}`)}`}function Mi(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 Ti={en:{intro:(e,t)=>`${ke(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:"(빈 값)"}},ln=18;function Ir(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=yi(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=bi(s,a,e.columns),{pw:c,ph:f}=xi(s,l,e.height),u=e.scale!=="free",m=t==="scatter"?[]:o.map(D=>Er(t,D,n,n.y,n.series,n.aggregate)),h=u?ki(t,o,m,n,c,f):{sameKeys:!1},d=u?wi(t,o,m,n,h,c,f,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",M=u&&(!p||h.sameKeys),b=u&&(p||h.x!==void 0||h.sameKeys),v=new Set(Mi(e.highlight,r)?[e.highlight].flat():[]),S=v.size>0,F=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,k=e.syncId??$i(t,e.by,n,e.data),P=st(Ne(n.format,e.locale),n.unit),H=Ti[e.lang],I=[],G=r.map(D=>D===""?H.blank:D);return{panels:r.map((D,C)=>{let A=o[C],w=G[C],g=C%l,T;if(t!=="scatter"){let E=m[C],B=K=>E.values.reduce((x,$)=>x+(Number.isFinite($[K])?$[K]:0),0),O=E.keys.map((K,x)=>x).filter(K=>E.values.some(x=>Number.isFinite(x[K]))),U=O[O.length-1];I.push({first:O.length?B(O[0]):NaN,last:O.length?B(U):NaN,total:O.reduce((K,x)=>K+B(x),0)}),t!=="bar"&&E.series.length===1&&U!==void 0&&(T=P(E.values[0][U]))}else I.push({first:NaN,last:NaN,total:A.length});let N={data:A,width:c,height:f,ariaLabel:e.title?`${e.title}, ${w}`:w,syncId:k,highlight:S?v.has(D)?F?()=>!0:void 0:"none":e.highlight,showYAxis:!M||g===0,showXAxis:!b||C+l>=a};return h.y&&(N.yDomain=h.y),h.x&&(N.xDomain=h.x),d&&(N.xTicks=d),{value:D,label:w,props:N,last:T,isPicked:v.has(D)}}),cols:l,pw:c,ph:f,isPanelPick:S,description:Si(t,e.by,G,I,i,P,H)}}function Si(e,t,n,r,o,i,a){let s=a.intro(n.length,t),l=c=>$r(r.map(f=>f[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=a.endHigh(n[c],i(r[c].last)));let f=n.filter((u,m)=>r[m].last<r[m].first);s+=f.length?a.falling(`${f.slice(0,5).join(", ")}${f.length>5?a.more:""}`):a.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?a.total(n[c],i(r[c].total)):a.points(n[c],r[c].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var se=_(Y(),1);function Ci(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ai(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 Tt={threshold:.25,enoughPx:96,rootMargin:"0px"};function Br(e,t=!0){let[n,r]=(0,se.useState)({visible:!t,near:!t});return(0,se.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(a=>{let s=Ai(a[a.length-1],Tt.threshold,Tt.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:Ci(Tt.threshold),rootMargin:Tt.rootMargin}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),i.observe(e),()=>{o.disconnect(),i.disconnect()}},[e,t]),n}function Or(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function St(e){let[t,n]=(0,se.useState)(null),[r,o]=(0,se.useState)(e??null),i=(0,se.useCallback)(a=>{n(a),a&&e===void 0&&o(Or(a))},[e]);return xe(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=c=>o(f=>f!==null&&Math.abs(f-c)<.5?f:c),s=()=>a(Or(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let f=c[c.length-1]?.contentRect;f?a(f.width>0?Math.round(f.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,i,r]}var Ni=()=>()=>{};function Be(){return(0,se.useSyncExternalStore)(Ni,()=>!0,()=>!1)}var zr="(prefers-reduced-motion: reduce)";function Ct(e="auto"){let[t,n]=(0,se.useState)(()=>me&&typeof window.matchMedia=="function"?window.matchMedia(zr).matches:!1);return(0,se.useEffect)(()=>{if(e!=="auto"||!me||typeof window.matchMedia!="function")return;let r=window.matchMedia(zr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var pe=_(j(),1),Ri=60,Fi=420;function Hr(e){let t=he(),n=e.chartProps??{},[,r,o]=St(e.width),i=e.width??(o||480),a=oe(e.locale??n.locale),s=J(a),l=(0,He.useContext)(Pe),c=e.title??l,f=e.chart.facetPlan,u=(0,He.useMemo)(()=>{let b=Ir({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:i,height:e.height,title:c,locale:a,lang:s});return f?f(b,n,a):b},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(b,v)=>typeof v=="function"?String(v):v),e.highlight,e.syncId,i,e.height,c,a,s,f]),m=`${(0,He.useId)().replace(/:/g,"")}fd`,h=Ct(n.reducedMotion??"auto"),d=Be(),p=Pn({motion:{enabled:n.animate!==!1&&!h&&me},hydrated:d},{waiting:!1,generation:0}),M=e.chart;return(0,pe.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":m,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,pe.jsx)("p",{id:m,style:gt,children:e.description??u.description}),(0,pe.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:Je,rowGap:Pr,...u.legend?{marginTop:ln}:null},children:u.panels.map((b,v)=>{let S=t.paint(b.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,pe.jsxs)("div",{"data-facet":b.value,style:{minWidth:0,...Ln(p,!1,"fade",v*Ri,Fi)},children:[(0,pe.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:sn,fontSize:Dr,fontWeight:700,lineHeight:`${sn}px`,color:S},children:[(0,pe.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.label}),b.last!==void 0?(0,pe.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:b.last}):null]}),(0,pe.jsx)(M,{...n,...b.props})]},b.value)})}),u.legend?(0,pe.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:ln},children:u.legend}):null]})}var jr=["max","min","first","last","none"];function ye(e,t,n,r,o="max"){let i=new Set,a=n.length,s=c=>{if(a&&c!=="none"){if(c==="first")i.add(0);else if(c==="last")i.add(a-1);else if(c==="max"||c==="min"){let f=-1,u=c==="max"?-1/0:1/0;r.forEach((m,h)=>{Number.isFinite(m)&&(c==="max"?m>u:m<u)&&(u=m,f=h)}),f>=0&&i.add(f)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((c,f)=>{f<a&&c!==null&&c!==void 0&&e(c,f)&&i.add(f)}),i;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<a&&i.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((f,u)=>{f===c&&i.add(u)});return i}var ue=_(Y(),1);async function _i(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",i=await e.text();if(t==="text")return i;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(i))throw new Error(J(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return _e(i);if(t==="json"||o.includes("json"))return JSON.parse(i);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return _e(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):_e(i)}async function Li(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),i=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!i.ok)throw new Error(`HTTP ${i.status}${i.statusText?` ${i.statusText}`:""}`);r=await _i(i,t.parse,o,t.locale)}return t.select&&(r=br(r,t.select)),t.transform?t.transform(r):Ce(r)}function Gr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,ue.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,ue.useState)(0),c=oe(t.locale),f=(0,ue.useRef)(t);f.current={...t,locale:c};let u=(0,ue.useRef)(e);u.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],d=JSON.stringify(h.map(b=>typeof b=="object"?JSON.stringify(b):String(b))),p=(0,ue.useRef)(!1);(0,ue.useEffect)(()=>{let b=u.current;if(!b||!r){a(F=>F.status==="loading"?{...F,status:"idle"}:F);return}let v=new AbortController,S=!0;return p.current=!0,a(F=>({...F,data:o?F.data:[],status:"loading",error:null})),Li(b,{...f.current,signal:v.signal}).then(F=>{S&&a({data:F,status:"success",error:null,updatedAt:Date.now()})}).catch(F=>{!S||v.signal.aborted||a(k=>({...k,status:"error",error:F instanceof Error?F:new Error(String(F))}))}).finally(()=>{S&&(p.current=!1)}),()=>{S=!1,p.current=!1,v.abort()}},[m,r,s,d,o]),(0,ue.useEffect)(()=>{if(!n||!r)return;let b=setInterval(()=>{p.current||l(v=>v+1)},n);return()=>clearInterval(b)},[n,r]);let M=(0,ue.useCallback)(()=>l(b=>b+1),[]);return{data:i.data,status:i.status,loading:i.status==="loading",error:i.error,empty:i.status==="success"&&i.data.length===0,updatedAt:i.updatedAt,reload:M}}var un=_(j(),1),Pi=["csv","svg","png"],Di=/^[=+\-@\t\r\n=+-@]/,Ei=/var\(|color-mix\(/;function Vr(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?Zn(e.getTime()):String(e);return`"${(Di.test(t)&&!Number.isFinite(we(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ii(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Oi(e,t){return`\uFEFF${[t.map(Vr),...e.map(r=>t.map(o=>Vr(r[o])))].map(r=>r.join(",")).join(`\r
26
26
  `)}\r
27
- `}function Mi(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function en(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Dr=2,we=16;function Er(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,i,a,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${i}, ${a})`:`rgba(${o}, ${i}, ${a}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function Or(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 Ir(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:i,height:a}=o.viewBox.baseVal,[s,c]=[i+we*2,a+we*2],u=o.cloneNode(!0),h=u.querySelectorAll("*"),m=new Map;o.querySelectorAll("*").forEach((p,x)=>{let M;for(let w of Array.from(p.attributes)){if(!wi.test(w.value))continue;let $=(M??(M=getComputedStyle(p))).getPropertyValue(w.name);$&&h[x].setAttribute(w.name,Er($,m))}}),u.removeAttribute("style");for(let[p,x]of Object.entries({viewBox:`${-we} ${-we} ${s} ${c}`,width:s*t,height:c*t,"font-family":getComputedStyle(o).fontFamily}))u.setAttribute(p,String(x));let g=Er(getComputedStyle(r).backgroundColor,m),f=o.parentElement?.querySelector("canvas")??null;if(n){let p=u.querySelector("desc")?.nextSibling??u.firstChild;u.insertBefore(Or("rect",{x:-we,y:-we,width:s,height:c,fill:g}),p),f&&u.insertBefore(Or("image",{href:f.toDataURL(),width:i,height:a}),p)}return{svg:new XMLSerializer().serializeToString(u),w:s,h:c,vw:i,vh:a,bg:g,canvas:f}}function Ti(e,t){let n=Ir(e,Dr,!1);if(!n)return;let r=Dr,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let i=o.getContext("2d");if(!i)return;i.fillStyle=n.bg,i.fillRect(0,0,o.width,o.height),n.canvas&&i.drawImage(n.canvas,we*r,we*r,n.vw*r,n.vh*r);let a=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{i.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(a),o.toBlob(c=>c&&en(c,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function zr(e){let t=le(e.theme),n=K(Q(e.locale))==="ko",r=Mi(e.filename),o=(i,a)=>{if(i==="csv")return en(new Blob([$i(e.data,e.columns?.length?e.columns:vi(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return Ti(a,r);let s=Ir(a,1,!0);s&&en(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,tn.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:xi.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,tn.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:c=>o(i,c.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:a},i)})})}var Hr=A(B(),1);function Br(e,t=q){let n=ve(void 0,t),r=e.split(`
28
- `),o=(i,a)=>{if(a==="label")return i.label;if(a==="value")return i.formatted??(i.value===null?null:n(i.value));if(a==="series")return i.series??null;let s=i.datum&&typeof i.datum=="object"?i.datum[a]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Ie(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let c=!1,u=s.replace(jn,(h,m)=>o(i,m.trim())??(c=!0,""));c||a.push(u)}return a.length?a.map((s,c)=>(0,Hr.jsx)("div",{children:s},c)):null}}function jr(e,t,n=!1){let r=re(t,"group"),o=e.map((s,c)=>r(s,c)).filter(Boolean),i=ce(o);if(!n)return i;let a=new Map;for(let s of o)a.set(s,(a.get(s)??0)+1);return i.map((s,c)=>[s,c]).sort((s,c)=>a.get(s[0])-a.get(c[0])||s[1]-c[1]).map(([s])=>s)}function Gr(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 Me(t.csv)}return null}var Jr=A(V(),1);var Y=A(V(),1);function Wr(e,t){let n=le(e.theme),[r,o,i]=pt(e.width),a=Le(),s=e.width??(i||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,u=e.height??c,h=yt(e.reducedMotion??"auto"),m=e.animate!==!1&&!h&&ae,g=Rr(r,e.animateOnView!==!1&&m),f=Q(e.locale),p=K(f),x=(0,Y.useMemo)(()=>ve(e.format,f,t.format),[e.format,f,t.format]),M=(0,Y.useCallback)(P=>Qe(P,{locale:f}),[f]),w=(0,Y.useMemo)(()=>et(x,e.unit),[x,e.unit]),$=(0,Y.useMemo)(()=>mt(e.data),[e.data]),[T,_]=(0,Y.useState)(null),[y,R]=(0,Y.useState)(null),z=(0,Y.useRef)([]),D=(0,Y.useRef)(e.onHover);D.current=e.onHover;let E=(0,Y.useRef)(e.onClick);E.current=e.onClick;let I=(0,Y.useRef)(null),L=(0,Y.useRef)(null),C=(0,Y.useRef)(null),S=(0,Y.useCallback)((P,j="pointer")=>{if(C.current!==P){C.current=P;let W=P===null?null:z.current[P]??null;queueMicrotask(()=>D.current?.(W)),L.current?.(P)}I.current=P===null?null:j,_(P),R(I.current)},[]),d=(0,Y.useCallback)(P=>{I.current!=="keyboard"&&(I.current=P===null?null:"sync",_(P),R(I.current))},[]),l=(0,Y.useCallback)(P=>{let j=z.current[P];j&&E.current?.(j)},[]),k=Xn(e.replayKey),v=e.width!==void 0||(i??0)>0,F={enabled:m,active:g.visible&&v,near:g.near,replayKey:k,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},O=(0,Y.useCallback)((P,j=1)=>T===null||T===P?j:j*.38,[T]);return{p:n,width:s,height:u,measured:v,responsive:e.width===void 0,pending:ae&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:F,fv:w,fmt:x,pct:M,locale:f,lang:p,t:p==="ko"?Tn:Mn,active:T,via:y,setActive:S,click:l,events:z,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:O,sig:$,description:e.description,reduced:h,publish:L,applySync:d}}var U=A(V(),1);function Si(e){return 1-Math.pow(1-e,3)}function Ci(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Ai(e){return e==="easeInOut"?Ci:e==="linear"?t=>t:Si}function Ni(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 De(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),i=Math.floor(o),a=Math.min(e.length-1,i+1);n[r]=e[i]+(e[a]-e[i])*(o-i)}return n}function bt(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 Vr(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 Kr(e,t,n,r){if(!t||!n||t.length!==n.length)return De(e,r);let o=[],i=0;for(let a=0;a<n.length;a++){let s=e.slice(i,i+t[a]);i+=t[a];for(let c of De(s,n[a]))o.push(c)}return o.length===r?o:De(e,r)}var xt=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||!bt(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 i=t.from??t.to,a=t.enter??i;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:i.slice(),enter:a.slice(),exit:(t.exit??a).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),i=this.make(r,r.to,0,0);o&&(i.order=o.order),i.done=!0,i.progress=1,n.set(r.key,i)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let i=this.tracks.get(o.key),a=this.make(o,o.from??o.to,1/0,o.delay??0);i&&(a.order=i.order),r=Math.max(r,o.delay??0),n.set(o.key,a)}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),Vr(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=bt(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,i=0;for(let a of t){o.add(a.key);let s=this.tracks.get(a.key),c=r>0?Math.min(i*r,240):0;if(s){let u=a.to.length;s.from=Kr(s.cur,s.parts,a.parts,u),s.vel=Kr(s.curVel,s.parts,a.parts,u),s.parts=a.parts,s.to=a.to.slice(),Vr(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(a.from??a.to).slice(),s.enter=(a.enter??s.appear).slice(),s.exit=(a.exit??s.enter).slice(),s.data=a.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=bt(s.from,s.to)&&s.vel.every(h=>Math.abs(h)<1e-6),s.progress=s.done?1:0}else{let u=this.make(a,a.enter??a.from??a.to,n+c,0);u.done=bt(u.from,u.to),this.tracks.set(a.key,u)}i++}for(let a of this.tracks.values())o.has(a.key)||a.exiting||(a.from=a.cur.slice(),a.vel=a.curVel.slice(),a.to=De(a.exit,a.cur.length),a.t0=n,a.exiting=!0,a.done=!1,a.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=Ai(this.easing),o=this.duration/1e3,i=this.omega,a=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,u=s.to.length;if(s.from.length!==u&&(s.from=De(s.from,u)),s.vel.length!==u&&(s.vel=De(s.vel,u)),s.cur.length!==u&&(s.cur=new Array(u).fill(0),s.curVel=new Array(u).fill(0)),!(c>0)){for(let m=0;m<u;m++)s.cur[m]=s.from[m],s.curVel[m]=0;s.progress=0,n=!0;continue}let h;if(this.easing==="spring"){let m=Math.exp(-i*c),g=i*c>=8&&i*c<20,f=0;for(let p=0;p<u;p++){let x=s.from[p]-s.to[p],M=s.vel[p]+i*x;s.cur[p]=s.to[p]+(x+M*c)*m,s.curVel[p]=(s.vel[p]-i*M*c)*m,g&&f<.15&&(f=Math.max(f,Math.abs(s.cur[p]-s.to[p]),Math.abs(s.curVel[p]/i)))}h=i*c>=20||g&&f<.15,s.progress=Math.min(1,1-(1+i*c)*m)}else{let m=Math.min(1,c/o),g=r(m),f=Ni(this.easing,m)/o;for(let p=0;p<u;p++)s.cur[p]=s.from[p]+(s.to[p]-s.from[p])*g,s.curVel[p]=(s.to[p]-s.from[p])*f;h=m>=1,s.progress=g}if(h){for(let m=0;m<u;m++)s.cur[m]=s.to[m],s.curVel[m]=0;s.done=!0,s.progress=1,s.exiting&&a.push(s.key)}else n=!0}for(let s of a)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}},Ge=new Set,kt=0;function Ur(e){kt=0;let t=Array.from(Ge);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ge.delete(n)}Ge.size&&typeof requestAnimationFrame<"u"&&(kt=requestAnimationFrame(Ur))}function Xr(e){return Ge.add(e),!kt&&typeof requestAnimationFrame<"u"&&(kt=requestAnimationFrame(Ur)),()=>{Ge.delete(e)}}function Ri(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 Yr(e,t){let n=(0,U.useMemo)(()=>Ri(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:c="spring",duration:u=900,stagger:h=0}=t,m=(0,U.useRef)(null),g=(0,U.useRef)("init"),f=(0,U.useRef)(null),p=(0,U.useRef)(s),x=(0,U.useRef)(a),M=(0,U.useRef)(!1),w=(0,U.useRef)(0),[,$]=(0,U.useState)(0),T=(0,U.useRef)(null),_=(0,U.useRef)(!0);m.current||(m.current=new xt,m.current.configure(c,u),m.current.snap(n),f.current=n);let y=m.current;if(y.configure(c,u),f.current!==n){let L=g.current,C=!Object.is(p.current,s);y.sameTargets(n)?y.refreshData(n):!r||L==="init"?y.snap(n):L==="idle"?y.hold(n):L==="running"||C?y.update(n,Je(),h):y.snap(n),f.current=n,p.current=s}let R=(0,U.useRef)(()=>!1);R.current=L=>{if(!_.current)return!1;let C=y.step(L);return!C&&g.current==="running"&&(g.current="done"),$(S=>(S+1)%1e9),C||(T.current=null),C};let z=(0,U.useCallback)(()=>{if(!ae||T.current||!y.animating)return;let L=C=>R.current(C);T.current=Xr(L)},[y]);he(()=>{let L=!Object.is(x.current,a);if(x.current=a,!r){(g.current!=="done"||y.animating)&&(y.snap(f.current??n),g.current="done",$(C=>C+1));return}g.current==="init"||L&&i?(y.hold(f.current??n),g.current="idle",M.current=!1,$(C=>C+1)):L&&(M.current=!0)},[r,a]),he(()=>{!r||!i||!M.current||(M.current=!1,y.hold(f.current??n),g.current="idle",$(L=>L+1))},[i,r]),(0,U.useEffect)(()=>{r&&o&&g.current==="idle"&&(y.start(Je()),w.current+=1,g.current="running",z(),$(L=>L+1))},[r,o,a,y,z]),(0,U.useEffect)(()=>{y.animating&&z()}),(0,U.useEffect)(()=>(_.current=!0,()=>{_.current=!1,T.current?.(),T.current=null}),[]);let D=Je(),E=y.elapsed(D),I=r&&g.current==="idle";return{items:y.items(),get:L=>y.get(L),elapsed:I?0:E,fade:(L,C=320)=>I?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-L)/C)):1,waiting:I,animating:y.animating,generation:w.current}}var nn=A(B(),1);function qr(e,t,n,r,o){if(r)return o==="categorical"?ie(e,t,n):Ln(e,t,n);if(o==="categorical")return ie(e,t,n);let i=X(e,"strong"),a=X(e,"accent");return Array.from({length:t},(s,c)=>n.has(c)?a:i)}var Fi=A(V(),1);var rn=A(B(),1);var Zr=e=>e?"neutralStrong":"accent";var on=A(B(),1);function Qr(e,t,n,r){if(typeof e!="function")return me(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((a,s)=>[a,s])),i=new Set;return t.forEach((a,s)=>{let c=o.get(r(a,s));c!==void 0&&e(a,s)&&i.add(c)}),i}var _i=A(V(),1);var sn=A(B(),1),Li={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}, ${ge(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},eo={en:Li,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}일 이동평균`}},an=["ink","muted","dim"];function to(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,an.length)}var Pi=A(V(),1);var io=A(B(),1),Di={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${ge(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ei={en:Di,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},no=(e,t)=>Ei[e].other(t);function ro(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((i,a)=>({v:i.value,i:a})).sort((i,a)=>a.v-i.v).slice(0,Math.floor(t)).map(i=>i.i)),o=e.filter((i,a)=>!r.has(a));return{kept:e.filter((i,a)=>r.has(a)),other:n(o.length,mr(o.map(i=>i.value)))}}var oo=e=>Number.isFinite(e)&&e>0?e:0;function ao(e,t,n,r){return r==="emphasis"?_n(e,t,n):ie(e,t,n)}var Te=A(V(),1);function ln(e,t,n){let{width:r,height:o,nodeWidth:i=10,iterations:a=24,align:s="justify",x0:c=0,y0:u=0}=n,h=new Map,m=[],g=(l,k)=>{let v=h.get(l);return v?k&&(v.label=k):(v={id:l,label:k??l,index:m.length,depth:0,layer:0,value:0,x0:0,x1:0,y0:0,y1:0,inLinks:[],outLinks:[]},h.set(l,v),m.push(v)),v};e.forEach(l=>g(l.id,l.label));let f=[];t.forEach(l=>{if(!(l.value>0)||l.source===l.target)return;let k=g(l.source),v=g(l.target),F={index:f.length,source:k,target:v,value:l.value,width:0,y0:0,y1:0};f.push(F),k.outLinks.push(F),v.inLinks.push(F)});for(let l of m)l.value=Math.max(l.inLinks.reduce((k,v)=>k+v.value,0),l.outLinks.reduce((k,v)=>k+v.value,0));let p=m.filter(l=>!l.inLinks.length);p.length||(p=m.slice(0,1));let x=new Map,M=new Set,w=l=>{x.set(l,1);for(let k of l.outLinks){let v=x.get(k.target);v===1?M.add(k):v||w(k.target)}x.set(l,2)};[...p,...m].forEach(l=>x.has(l)||w(l));let $=new Map;p.forEach(l=>$.set(l,0));let T=!0,_=0;for(;T&&_++<m.length+1;){T=!1;for(let l of f){if(M.has(l))continue;let k=($.get(l.source)??0)+1;k>($.get(l.target)??-1)&&k<=m.length&&($.set(l.target,k),T=!0)}}for(let l of m)l.depth=$.get(l)??0;let y=Math.max(0,...m.map(l=>l.depth));for(let l of m)l.layer=s==="justify"&&!l.outLinks.length?y:l.depth;let R=y+1,z=R>1?(r-i)/(R-1):0;for(let l of m)l.x0=c+l.layer*z,l.x1=l.x0+i;let D=Array.from({length:R},()=>[]);m.forEach(l=>D[l.layer].push(l));let E=Math.max(1,...D.map(l=>l.length)),I=Math.min(n.nodePadding??12,o/E*.6),L=Math.min(...D.filter(l=>l.length).map(l=>(o-(l.length-1)*I)/Math.max(1e-9,l.reduce((k,v)=>k+v.value,0))));for(let l of D){let k=u;for(let v of l)v.y0=k,v.y1=k+v.value*L,k=v.y1+I}for(let l of f)l.width=l.value*L;let C=l=>(l.y0+l.y1)/2,S=l=>{l.sort((F,O)=>F.y0-O.y0);let k=u;for(let F of l){let O=k-F.y0;O>0&&(F.y0+=O,F.y1+=O),k=F.y1+I}if(k-I-(u+o)>0){let F=u+o;for(let O=l.length-1;O>=0;O--){let P=l[O],j=P.y1-F;j>0&&(P.y0-=j,P.y1-=j),F=P.y0-I}}},d=1;for(let l=0;l<a;l++){d*=.99;let k=Math.pow(.99,l);for(let v=D.length-2;v>=0;v--){for(let F of D[v]){if(!F.outLinks.length)continue;let O=0,P=0;for(let W of F.outLinks)P+=C(W.target)*W.value,O+=W.value;let j=(P/O-C(F))*k;F.y0+=j,F.y1+=j}S(D[v])}for(let v=1;v<D.length;v++){for(let F of D[v]){if(!F.inLinks.length)continue;let O=0,P=0;for(let W of F.inLinks)P+=C(W.source)*W.value,O+=W.value;let j=(P/O-C(F))*k;F.y0+=j,F.y1+=j}S(D[v])}}for(let l of m){l.outLinks.sort((O,P)=>O.target.y0-P.target.y0),l.inLinks.sort((O,P)=>O.source.y0-P.source.y0);let k=l.outLinks.reduce((O,P)=>O+P.width,0),v=l.inLinks.reduce((O,P)=>O+P.width,0),F=l.y0+Math.max(0,(l.y1-l.y0-k)/2);for(let O of l.outLinks)O.y0=F+O.width/2,F+=O.width;F=l.y0+Math.max(0,(l.y1-l.y0-v)/2);for(let O of l.inLinks)O.y1=F+O.width/2,F+=O.width}return{nodes:m,links:f}}function so(e,t=1){let n=e.source.x1,r=n+(e.target.x0-n)*t,o=e.y0+(e.y1-e.y0)*t,i=(n+r)/2,a=e.width/2,s=c=>Math.round(c*100)/100;return`M${s(n)},${s(e.y0-a)}C${s(i)},${s(e.y0-a)} ${s(i)},${s(o-a)} ${s(r)},${s(o-a)}L${s(r)},${s(o+a)}C${s(i)},${s(o+a)} ${s(i)},${s(e.y0+a)} ${s(n)},${s(e.y0+a)}Z`}var de=A(B(),1),Oi={kind:"Sankey diagram",total:"Total",in:"In",out:"Out",flow:"Flow",flows:e=>ge(e,"flow"),from:e=>`Share of ${e}`,desc:(e,t)=>`${ge(e,"node")}, ${ge(t,"flow")}. Largest flows`},Ii={en:Oi,ko:{kind:"생키 다이어그램",total:"합계",in:"들어옴",out:"나감",flow:"흐름",flows:e=>`흐름 ${e}개`,from:e=>`${e} 중 비중`,desc:(e,t)=>`노드 ${e}개, 흐름 ${t}개. 큰 흐름`}};function cn(e){let t=Wr(e,{height:d=>Math.max(220,Math.min(340,d*.6)),duration:1e3,stagger:70}),{p:n,width:r,height:o}=t,i=Ii[t.lang],a=(0,Te.useMemo)(()=>{let d=re(e.source,"source"),l=re(e.target,"target"),k=Fe(e.value,"value");return e.data.map((v,F)=>({source:d(v,F),target:l(v,F),value:k(v,F)||0,d:v}))},[e.data,e.source,e.target,e.value]),s=(0,Te.useMemo)(()=>ln([],a,{width:100,height:100,iterations:0}),[a]),c=s.nodes.filter(d=>d.layer===0),u=Math.max(0,...s.nodes.map(d=>d.layer)),h=s.nodes.filter(d=>d.layer===u&&u>0),m=Math.min(r*.22,Math.max(0,...c.map(d=>Math.max(Z(d.label,11.5,700),Z(t.fmt(d.value),10.5))))+10),g=Math.min(r*.22,Math.max(0,...h.map(d=>Math.max(Z(d.label,11.5,700),Z(t.fmt(d.value),10.5))))+10),f=(0,Te.useMemo)(()=>ln([],a,{width:Math.max(60,r-m-g),height:o-8,x0:m,y0:4,nodeWidth:e.nodeWidth??10,nodePadding:e.nodePadding??14}),[a,r,o,m,g,e.nodeWidth,e.nodePadding]),p=(0,Te.useMemo)(()=>{let d=f.nodes.map(v=>v.label);if(e.highlight!==void 0)return me(e.highlight,f.nodes,d,f.nodes.map(v=>v.value));let k=f.nodes.filter(v=>v.layer===u).sort((v,F)=>F.value-v.value)[0];return new Set(k?[k.index]:[])},[f,e.highlight,u]),x=d=>p.has(d.source.index)||p.has(d.target.index),M=t.motion.stagger??70,w=t.motion.duration??1e3,$=(0,Te.useMemo)(()=>{let d=[];return f.nodes.forEach(l=>{let k=(l.y0+l.y1)/2;d.push({key:`n:${l.id}`,to:[l.y0,l.y1],from:[k,k],enter:[k,k],delay:l.layer*M*2,data:{node:l}})}),f.links.forEach((l,k)=>d.push({key:`l:${l.source.id}>${l.target.id}`,to:[1,l.y0,l.y1,l.width],from:[0,l.y0,l.y1,l.width],enter:[0,l.y0,l.y1,l.width],delay:w*.25+l.source.layer*M*3+k%6*25,data:{link:l}})),d},[f,M,w]),T=Yr($,t.motion),_=X(n,"accent"),y=f.nodes.length,R=t.fv,z=(0,Te.useMemo)(()=>{let d=new Map;for(let l of a)d.has(`${l.source}>${l.target}`)||d.set(`${l.source}>${l.target}`,l.d);return[...f.nodes.map(l=>({datum:null,index:l.index,key:l.id,label:l.label,value:l.value,formatted:R(l.value)})),...f.links.map((l,k)=>({datum:d.get(`${l.source.id}>${l.target.id}`)??null,index:y+k,key:`${l.source.id}>${l.target.id}`,label:`${l.source.label} → ${l.target.label}`,value:l.value,formatted:R(l.value)}))]},[f,a,y,R]),D=null,E=t.active;if(E!==null)if(E<y){let d=f.nodes[E];d&&(D={x:(d.x0+d.x1)/2,y:d.y0,title:d.label,rows:[{label:i.total,value:t.fv(d.value),color:p.has(d.index)?_.fill:n.paint("neutralStrong")},...d.inLinks.length?[{label:i.in,value:i.flows(d.inLinks.length)}]:[],...d.outLinks.length?[{label:i.out,value:i.flows(d.outLinks.length)}]:[]]})}else{let d=f.links[E-y];d&&(D={x:(d.source.x1+d.target.x0)/2,y:(d.y0+d.y1)/2-d.width/2,title:`${d.source.label} → ${d.target.label}`,rows:[{label:i.flow,value:t.fv(d.value),color:x(d)?_.fill:n.paint("neutral")},{label:i.from(d.source.label),value:t.pct(d.value/(d.source.value||1)*100)}]})}let I=E!==null&&E<y?f.nodes[E]:null,L=E!==null&&E>=y?f.links[E-y]:null,C=d=>I?d.source===I||d.target===I?.75:.12:L?d===L?.8:.12:x(d)?.55:.32,S=e.description??`${i.kind}. ${i.desc(y,f.links.length)}: ${[...f.links].sort((d,l)=>l.value-d.value).slice(0,3).map(d=>`${d.source.label}→${d.target.label} ${t.fv(d.value)}`).join(", ")}.`;return(0,de.jsxs)(Jn,{c:t,kind:i.kind,ariaLabel:e.ariaLabel,description:S,events:z,tip:D,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,de.jsx)("g",{children:T.items.map(d=>{let l=d.data.link;if(!l)return null;let k=f.links.indexOf(l),[v,F,O,P]=d.v;if(v<=.001)return null;let j=x(l);return(0,de.jsx)("path",{className:"ztd-mark",d:so({source:l.source,target:l.target,y0:F,y1:O,width:P},v),fill:j?_.fill:n.paint("neutralStrong"),opacity:C(l)*Math.min(1,v*1.5),onPointerEnter:W=>t.setActive(y+k,W.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click(y+k)},d.key)})}),T.items.map(d=>{let l=d.data.node;if(!l)return null;let[k,v]=d.v,F=p.has(l.index),O=E===l.index,P=l.layer===0,j=l.layer===u&&u>0,W=P?l.x0-8:l.x1+8,fe=P?"end":"start",Ve=P?m-10:j?g-10:Math.max(40,(f.nodes.find(wt=>wt.layer===l.layer+1)?.x0??r)-l.x1-16),Ke=(l.y0+l.y1)/2,Ue=l.y1-l.y0>=26,wo=!P&&!j,mn=Ut(l.label,Ve,11.5,700),vo=Math.max(Z(mn,11.5,800),Ue?Z(t.fmt(l.value),10.5):0)+10,dn=Ue?32:18;return(0,de.jsxs)("g",{onPointerEnter:wt=>t.setActive(l.index,wt.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click(l.index),children:[(0,de.jsx)("path",{d:dr(l.x0,k,l.x1-l.x0,Math.max(1,v-k),2),fill:F?_.fill:n.paint("ink"),stroke:O&&t.via==="keyboard"?n.paint("accent"):"none",strokeWidth:2}),t.showLabels?(0,de.jsxs)("g",{opacity:T.fade(l.layer*M*2+w*.35,300),pointerEvents:"none",children:[wo?(0,de.jsx)("rect",{x:G(W-5),y:G(Ke-dn/2),width:vo,height:dn,rx:6,fill:n.paint("panel"),opacity:.94}):null,(0,de.jsx)(jt,{x:W,y:Ue?Ke-7:Ke,anchor:fe,size:11.5,weight:F||O?800:600,fill:n.paint("ink"),children:mn}),Ue?(0,de.jsx)(jt,{x:W,y:Ke+8,anchor:fe,size:10.5,fill:n.paint("muted"),children:t.fmt(l.value)}):null]}):null]},d.key)})]})}var zi=A(V(),1);var mo=A(B(),1);function lo(e,t){return t===!1?e.map((n,r)=>r):ur(e)}function co(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return me(e,t,t,r,"max")}function uo(e,t,n){let r=new Array(t.length),o=t.filter(i=>!n.has(i));for(let i of t)n.has(i)&&(r[i]=X(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?X(e,"neutral"):Ze(e,1-a/Math.max(1,o.length-1))),r}function fo(e){return!e||typeof e!="object"||Array.isArray(e)?[]:ce(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function ho(e,t){return Oe(e,t+1,new Set)}var Bi=A(V(),1);var po=A(B(),1);var Hi=26;var Tc=Hi*.62;function go(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!_r.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var ye=A(B(),1);function yo(e,t,n){let r=ut(e);return r?.type==="scatter"&&t?.size!==void 0&&!ct(n)?ut("bubble"):r}function ji(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 Gi(e,t,n,r=!1){let o=yo(e.type,e.encoding,e.options);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,c=new Set(!r&&Gt.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),u=m=>m.filter(g=>!c.has(g.label)),h=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(h.includes(o.type)){let m=re(i.label,"label"),g=Fe(i.value,"value"),f=o.type==="waffle",p=t.map((y,R)=>({r:y,label:m(y,R),value:f?g(y,R):oo(g(y,R))})),{kept:x,other:M}=f?{kept:p,other:null}:ro(p,a.other,(y,R)=>({r:{},label:no(K(n),y),value:R})),w=me(s,x.map(y=>y.r),x.map(y=>y.label),x.map(y=>y.value),f?"first":"max"),$=M?[...x,M]:x,T=xe(y=>f?ie(y,$.length,w):ao(y,$.length,w,a.colorMode)),_=f&&a.shape==="arc";return $.map((y,R)=>({label:y.label,color:T[R],..._&&{shape:"circle"}}))}if(o.type==="candlestick"){let m=to(Array.isArray(a.ma)?a.ma:void 0,t.length),g=eo[K(n)];return[{label:g.up,color:a.upColor??"accent"},{label:g.down,color:a.downColor??"neutralStrong"},...m.map((f,p)=>({label:g.maLegend(f),color:an[p],shape:"line"}))]}if(o.type==="network"){let m=fo(a.groups);if(m.length<2)return[];let g=xe(f=>ho(f,m.length));return m.map((f,p)=>({label:f,color:g[p],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let m=re(i.group,"group"),g=ce(t.map((p,x)=>m(p,x)).filter(Boolean));if(g.length<2)return[];let f=xe(p=>Oe(p,g.length,new Set));return g.map((p,x)=>({label:p,color:f[x],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||ct(a))return[];let m=re(i.series,"series"),g=ce(t.map((x,M)=>m(x,M)));if(g.length<2)return[];let f=Qr(s,t,g,m),p=xe(x=>Oe(x,g.length,f));return u(g.map((x,M)=>({label:x,color:p[M],shape:"circle"})))}if(o.type==="timeline"){let m=typeof i.group!="string",g=m?i.status:i.group;if(typeof g!="string")return[];let f=jr(t,g,m),p=xe(x=>ie(x,f.length,go(s,f)));return u(f.map((x,M)=>({label:x,color:p[M],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let m=[];if(Array.isArray(i.y))m=i.y;else if(typeof i.series=="string"){let T=re(i.series,"series");m=ce(t.map((_,y)=>T(_,y)))}let g=Wt(o.type,i,a);if(g.length){let T=me(s,m,m,m.map(()=>0),"none"),_=xe(R=>ie(R,m.length,T)),y=m.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:m.map((R,z)=>({label:R,color:_[z]}));return[...u(y),...g.map((R,z)=>({label:R,color:Zr(z),shape:"line"}))]}if(m.length<2)return[];let p=o.type==="bar"&&a.layout==="diverging"&&s===void 0?cr(m.length,Array.isArray(a.negative)?a.negative.map(T=>m.indexOf(String(T))):[],typeof a.neutral=="string"?m.indexOf(a.neutral):-1):-1,x=p>=0?new Set([p]):me(s,m,m,m.map(()=>0),"first");if(o.type==="radar")return u(m.map((T,_)=>({label:T,color:x.has(_)?"accent":"neutralStrong",shape:"square"})));let M=a.colorMode,w=T=>ie(T,m.length,x);if((o.type==="line"||o.type==="area")&&(w=T=>qr(T,m.length,x,o.type==="area",M)),o.type==="stream"){let T=Be(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),_=lo(T.values,a.reorder),y=co(s,T.series,T.values);w=R=>uo(R,_,y)}let $=xe(w);return u(m.map((T,_)=>({label:T,color:$[_],...o.type==="line"&&{shape:"line"}})))}return[]}function Wi(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&tr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Vi(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:c,description:u,...h}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:h,width:o,height:i,highlight:a,syncId:s,title:c,description:u}}function bo(e,t){let{spec:n}=e,r=yo(n.type,n.encoding,n.options),o=(0,We.useMemo)(()=>Gr(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=er(n,e.locale),s=Q(a),c=K(s),u=Lr(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),h=or(n),m=(0,We.useMemo)(()=>h?Br(h,s):void 0,[h,s]),g=n.options?.hidden,f=Array.isArray(g)?g.map(String):[],p=f.join(""),[x,M]=(0,We.useState)(null);if(!r)return(0,ye.jsx)(Ht,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let w=o??u.data,$=t[r.type],T={...n.options??{}},_={...ji(r,n.encoding),...T,...m?{tooltip:m}:{},data:w,...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:a},y=n.card?.legend==="toggle"&&rr(r.type,n.encoding??{},T),R=x&&x.base===p?x.hidden:f;y&&(_.hidden=R);let z=C=>M(S=>{let d=S&&S.base===p?S.hidden:f;return{base:p,hidden:d.includes(C)?d.filter(l=>l!==C):[...d,C]}}),D=_.height??220,E=Wi(n,r.type),I=i&&!w.length&&(u.loading||u.error||u.empty)?(0,ye.jsx)(Ht,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:D,locale:a}):E?(0,ye.jsx)(Fr,{chart:$,...Vi(r.type,E,_)}):(0,ye.jsx)($,{..._});if(n.card){let C=n.card,S=C.legend==="auto"||C.legend==="toggle"?Gi(n,w,s,y):C.legend,d=S?.length?y?(0,ye.jsx)(Bt,{items:S,hidden:R,onToggle:z,locale:a}):S:void 0,l=C.download?(0,ye.jsx)(zr,{data:w,columns:ar(n),filename:C.title??r.type,formats:Array.isArray(C.download)?C.download:void 0,locale:a}):void 0;I=(0,ye.jsx)(Yn,{number:C.number,title:C.title??Qn(r,c),subtitle:C.subtitle,legend:d,actions:l,source:C.source||void 0,note:C.note||void 0,accent:C.accent,takeaway:C.takeaway,level:C.level,sample:C.sample,replay:C.replay!==!1,className:e.className,locale:a,children:I})}let L=e.theme??n.theme;return L&&(I=(0,ye.jsx)(ot,{theme:L,children:I})),I}function Ki({cfg:e,components:t}){let n=Le();return bo({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function ko(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,xo.hydrateRoot)(r,(0,un.createElement)(ot,{theme:o.theme,cssVars:!0},(0,un.createElement)(Ki,{cfg:o,components:{[e]:t}})))}ko("sankey",cn);})();
27
+ `}function zi(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function cn(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Wr=2,Ae=16;function Kr(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,i,a,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${i}, ${a})`:`rgba(${o}, ${i}, ${a}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function Xr(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 Ur(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:i,height:a}=o.viewBox.baseVal,[s,l]=[i+Ae*2,a+Ae*2],c=o.cloneNode(!0),f=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((d,p)=>{let M;for(let b of Array.from(d.attributes)){if(!Ei.test(b.value))continue;let v=(M??(M=getComputedStyle(d))).getPropertyValue(b.name);v&&f[p].setAttribute(b.name,Kr(v,u))}}),c.removeAttribute("style");for(let[d,p]of Object.entries({viewBox:`${-Ae} ${-Ae} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(d,String(p));let m=Kr(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let d=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Xr("rect",{x:-Ae,y:-Ae,width:s,height:l,fill:m}),d),h&&c.insertBefore(Xr("image",{href:h.toDataURL(),width:i,height:a}),d)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:i,vh:a,bg:m,canvas:h}}function Bi(e,t){let n=Ur(e,Wr,!1);if(!n)return;let r=Wr,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let i=o.getContext("2d");if(!i)return;i.fillStyle=n.bg,i.fillRect(0,0,o.width,o.height),n.canvas&&i.drawImage(n.canvas,Ae*r,Ae*r,n.vw*r,n.vh*r);let a=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{i.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(a),o.toBlob(l=>l&&cn(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function Yr(e){let t=he(e.theme),n=J(oe(e.locale))==="ko",r=zi(e.filename),o=(i,a)=>{if(i==="csv")return cn(new Blob([Oi(e.data,e.columns?.length?e.columns:Ii(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return Bi(a,r);let s=Ur(a,1,!0);s&&cn(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,un.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Pi.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,un.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(i,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:a},i)})})}var Zr=_(j(),1);function Jr(e,t=ne){let n=Ne(void 0,t),r=e.split(`
28
+ `),o=(i,a)=>{if(a==="label")return i.label;if(a==="value")return i.formatted??(i.value===null?null:n(i.value));if(a==="series")return i.series??null;let s=i.datum&&typeof i.datum=="object"?i.datum[a]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Ke(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let l=!1,c=s.replace(Qn,(f,u)=>o(i,u.trim())??(l=!0,""));l||a.push(c)}return a.length?a.map((s,l)=>(0,Zr.jsx)("div",{children:s},l)):null}}function dn(e,t,n){let{width:r,height:o,nodeWidth:i=10,iterations:a=24,align:s="justify",x0:l=0,y0:c=0}=n,f=new Map,u=[],m=(g,T)=>{let N=f.get(g);return N?T&&(N.label=T):(N={id:g,label:T??g,index:u.length,depth:0,layer:0,value:0,x0:0,x1:0,y0:0,y1:0,inLinks:[],outLinks:[]},f.set(g,N),u.push(N)),N};e.forEach(g=>m(g.id,g.label));let h=[];t.forEach(g=>{if(!(g.value>0)||g.source===g.target)return;let T=m(g.source),N=m(g.target),E={index:h.length,source:T,target:N,value:g.value,width:0,y0:0,y1:0};h.push(E),T.outLinks.push(E),N.inLinks.push(E)});for(let g of u)g.value=Math.max(g.inLinks.reduce((T,N)=>T+N.value,0),g.outLinks.reduce((T,N)=>T+N.value,0));let d=u.filter(g=>!g.inLinks.length);d.length||(d=u.slice(0,1));let p=new Map,M=new Set,b=g=>{p.set(g,1);for(let T of g.outLinks){let N=p.get(T.target);N===1?M.add(T):N||b(T.target)}p.set(g,2)};[...d,...u].forEach(g=>p.has(g)||b(g));let v=new Map;d.forEach(g=>v.set(g,0));let S=!0,F=0;for(;S&&F++<u.length+1;){S=!1;for(let g of h){if(M.has(g))continue;let T=(v.get(g.source)??0)+1;T>(v.get(g.target)??-1)&&T<=u.length&&(v.set(g.target,T),S=!0)}}for(let g of u)g.depth=v.get(g)??0;let k=Math.max(0,...u.map(g=>g.depth));for(let g of u)g.layer=s==="justify"&&!g.outLinks.length?k:g.depth;let P=k+1,H=P>1?(r-i)/(P-1):0;for(let g of u)g.x0=l+g.layer*H,g.x1=g.x0+i;let I=Array.from({length:P},()=>[]);u.forEach(g=>I[g.layer].push(g));let G=Math.max(1,...I.map(g=>g.length)),z=Math.min(n.nodePadding??12,o/G*.6),D=Math.min(...I.filter(g=>g.length).map(g=>(o-(g.length-1)*z)/Math.max(1e-9,g.reduce((T,N)=>T+N.value,0))));for(let g of I){let T=c;for(let N of g)N.y0=T,N.y1=T+N.value*D,T=N.y1+z}for(let g of h)g.width=g.value*D;let C=g=>(g.y0+g.y1)/2,A=g=>{g.sort((E,B)=>E.y0-B.y0);let T=c;for(let E of g){let B=T-E.y0;B>0&&(E.y0+=B,E.y1+=B),T=E.y1+z}if(T-z-(c+o)>0){let E=c+o;for(let B=g.length-1;B>=0;B--){let O=g[B],U=O.y1-E;U>0&&(O.y0-=U,O.y1-=U),E=O.y0-z}}},w=1;for(let g=0;g<a;g++){w*=.99;let T=Math.pow(.99,g);for(let N=I.length-2;N>=0;N--){for(let E of I[N]){if(!E.outLinks.length)continue;let B=0,O=0;for(let K of E.outLinks)O+=C(K.target)*K.value,B+=K.value;let U=(O/B-C(E))*T;E.y0+=U,E.y1+=U}A(I[N])}for(let N=1;N<I.length;N++){for(let E of I[N]){if(!E.inLinks.length)continue;let B=0,O=0;for(let K of E.inLinks)O+=C(K.source)*K.value,B+=K.value;let U=(O/B-C(E))*T;E.y0+=U,E.y1+=U}A(I[N])}}for(let g of u){g.outLinks.sort((B,O)=>B.target.y0-O.target.y0),g.inLinks.sort((B,O)=>B.source.y0-O.source.y0);let T=g.outLinks.reduce((B,O)=>B+O.width,0),N=g.inLinks.reduce((B,O)=>B+O.width,0),E=g.y0+Math.max(0,(g.y1-g.y0-T)/2);for(let B of g.outLinks)B.y0=E+B.width/2,E+=B.width;E=g.y0+Math.max(0,(g.y1-g.y0-N)/2);for(let B of g.inLinks)B.y1=E+B.width/2,E+=B.width}return{nodes:u,links:h}}var qr=6,mn=12;function Qr(e,t,n,r){let o=[];t.length>1&&e.forEach((m,h)=>{let d=n(m,h);d>0&&o.push({cells:t.map(p=>p(m,h)),v:d})});let i=[],a=[],s=t.map((m,h)=>{let d=new Map;for(let v of o)d.set(v.cells[h],(d.get(v.cells[h])??0)+v.v);let p=d.size>mn?d.size-mn+1:0;a.push(p);let M=p?new Set([...d.entries()].sort((v,S)=>S[1]-v[1]).slice(0,mn-1).map(([v])=>v)):null,b=new Map;for(let v of d.keys())M&&!M.has(v)||(b.set(v,i.length),i.push({id:`${h}${v}`,label:v===""?r.blank:v}));if(M){let v=i.length;i.push({id:`${h}`,label:r.other(p)});for(let S of d.keys())M.has(S)||b.set(S,v)}return b}),l=[],c=new Map;for(let m of o){let h=m.cells.map((M,b)=>s[b].get(M)),d=h.join(","),p=c.get(d);if(p)p.value+=m.v;else{let M={nodes:h,links:[],value:m.v};c.set(d,M),l.push(M)}}let f=[],u=new Map;for(let m=0;m+1<t.length;m++)for(let h of l){let d=`${h.nodes[m]},${h.nodes[m+1]}`,p=u.get(d);p===void 0&&(p=f.length,u.set(d,p),f.push({source:i[h.nodes[m]].id,target:i[h.nodes[m+1]].id,value:0})),f[p].value+=h.value,h.links.push(p)}return{nodes:i,links:f,paths:l,grouped:a}}function fn(e,t=1){let n=e.source.x1,r=n+(e.target.x0-n)*t,o=e.y0+(e.y1-e.y0)*t,i=(n+r)/2,a=e.width/2,s=l=>Math.round(l*100)/100;return`M${s(n)},${s(e.y0-a)}C${s(i)},${s(e.y0-a)} ${s(i)},${s(o-a)} ${s(r)},${s(o-a)}L${s(r)},${s(o+a)}C${s(i)},${s(o+a)} ${s(i)},${s(e.y0+a)} ${s(n)},${s(e.y0+a)}Z`}function eo(e,t,n=!1){let r=ie(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),i=ge(o);if(!n)return i;let a=new Map;for(let s of o)a.set(s,(a.get(s)??0)+1);return i.map((s,l)=>[s,l]).sort((s,l)=>a.get(s[0])-a.get(l[0])||s[1]-l[1]).map(([s])=>s)}function to(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 _e(t.csv)}return null}var lo=_(Y(),1);var Q=_(Y(),1);function no(e,t){let n=he(e.theme),[r,o,i]=St(e.width),a=Be(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,f=Ct(e.reducedMotion??"auto"),u=e.animate!==!1&&!f&&me,m=Br(r,e.animateOnView!==!1&&u),h=oe(e.locale),d=J(h),p=(0,Q.useMemo)(()=>Ne(e.format,h,t.format),[e.format,h,t.format]),M=(0,Q.useCallback)(O=>it(O,{locale:h}),[h]),b=(0,Q.useMemo)(()=>st(p,e.unit),[p,e.unit]),v=(0,Q.useMemo)(()=>kt(e.data),[e.data]),[S,F]=(0,Q.useState)(null),[k,P]=(0,Q.useState)(null),H=(0,Q.useRef)([]),I=(0,Q.useRef)(e.onHover);I.current=e.onHover;let G=(0,Q.useRef)(e.onClick);G.current=e.onClick;let z=(0,Q.useRef)(null),D=(0,Q.useRef)(null),C=(0,Q.useRef)(null),A=(0,Q.useCallback)((O,U="pointer")=>{if(C.current!==O){C.current=O;let K=O===null?null:H.current[O]??null;queueMicrotask(()=>I.current?.(K)),D.current?.(O)}z.current=O===null?null:U,F(O),P(z.current)},[]),w=(0,Q.useCallback)(O=>{z.current!=="keyboard"&&(z.current=O===null?null:"sync",F(O),P(z.current))},[]),g=(0,Q.useCallback)(O=>{let U=H.current[O];U&&G.current?.(U)},[]),T=ar(e.replayKey),N=e.width!==void 0||(i??0)>0,E={enabled:u,active:m.visible&&N,near:m.near,replayKey:T,dataKey:v,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},B=(0,Q.useCallback)((O,U=1)=>S===null||S===O?U:U*.38,[S]);return{p:n,width:s,height:c,measured:N,responsive:e.width===void 0,pending:me&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:E,fv:b,fmt:p,pct:M,locale:h,lang:d,t:d==="ko"?En:Dn,active:S,via:k,setActive:A,click:g,events:H,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:B,sig:v,description:e.description,reduced:f,publish:D,applySync:w}}var Z=_(Y(),1);function Hi(e){return 1-Math.pow(1-e,3)}function ji(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Gi(e){return e==="easeInOut"?ji:e==="linear"?t=>t:Hi}function Vi(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 je(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),i=Math.floor(o),a=Math.min(e.length-1,i+1);n[r]=e[i]+(e[a]-e[i])*(o-i)}return n}function At(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 ro(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 oo(e,t,n,r){if(!t||!n||t.length!==n.length)return je(e,r);let o=[],i=0;for(let a=0;a<n.length;a++){let s=e.slice(i,i+t[a]);i+=t[a];for(let l of je(s,n[a]))o.push(l)}return o.length===r?o:je(e,r)}var Nt=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||!At(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 i=t.from??t.to,a=t.enter??i;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:i.slice(),enter:a.slice(),exit:(t.exit??a).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),i=this.make(r,r.to,0,0);o&&(i.order=o.order),i.done=!0,i.progress=1,n.set(r.key,i)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let i=this.tracks.get(o.key),a=this.make(o,o.from??o.to,1/0,o.delay??0);i&&(a.order=i.order),r=Math.max(r,o.delay??0),n.set(o.key,a)}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),ro(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=At(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,i=0;for(let a of t){o.add(a.key);let s=this.tracks.get(a.key),l=r>0?Math.min(i*r,240):0;if(s){let c=a.to.length;s.from=oo(s.cur,s.parts,a.parts,c),s.vel=oo(s.curVel,s.parts,a.parts,c),s.parts=a.parts,s.to=a.to.slice(),ro(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(a.from??a.to).slice(),s.enter=(a.enter??s.appear).slice(),s.exit=(a.exit??s.enter).slice(),s.data=a.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=At(s.from,s.to)&&s.vel.every(f=>Math.abs(f)<1e-6),s.progress=s.done?1:0}else{let c=this.make(a,a.enter??a.from??a.to,n+l,0);c.done=At(c.from,c.to),this.tracks.set(a.key,c)}i++}for(let a of this.tracks.values())o.has(a.key)||a.exiting||(a.from=a.cur.slice(),a.vel=a.curVel.slice(),a.to=je(a.exit,a.cur.length),a.t0=n,a.exiting=!0,a.done=!1,a.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=Gi(this.easing),o=this.duration/1e3,i=this.omega,a=[];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=je(s.from,c)),s.vel.length!==c&&(s.vel=je(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 f;if(this.easing==="spring"){let u=Math.exp(-i*l),m=i*l>=8&&i*l<20,h=0;for(let d=0;d<c;d++){let p=s.from[d]-s.to[d],M=s.vel[d]+i*p;s.cur[d]=s.to[d]+(p+M*l)*u,s.curVel[d]=(s.vel[d]-i*M*l)*u,m&&h<.15&&(h=Math.max(h,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/i)))}f=i*l>=20||m&&h<.15,s.progress=Math.min(1,1-(1+i*l)*u)}else{let u=Math.min(1,l/o),m=r(u),h=Vi(this.easing,u)/o;for(let d=0;d<c;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*m,s.curVel[d]=(s.to[d]-s.from[d])*h;f=u>=1,s.progress=m}if(f){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&&a.push(s.key)}else n=!0}for(let s of a)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}},Ze=new Set,Rt=0;function ao(e){Rt=0;let t=Array.from(Ze);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ze.delete(n)}Ze.size&&typeof requestAnimationFrame<"u"&&(Rt=requestAnimationFrame(ao))}function io(e){return Ze.add(e),!Rt&&typeof requestAnimationFrame<"u"&&(Rt=requestAnimationFrame(ao)),()=>{Ze.delete(e)}}function Wi(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 so(e,t){let n=(0,Z.useMemo)(()=>Wi(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:c=900,stagger:f=0}=t,u=(0,Z.useRef)(null),m=(0,Z.useRef)("init"),h=(0,Z.useRef)(null),d=(0,Z.useRef)(s),p=(0,Z.useRef)(a),M=(0,Z.useRef)(!1),b=(0,Z.useRef)(0),[,v]=(0,Z.useState)(0),S=(0,Z.useRef)(null),F=(0,Z.useRef)(!0);u.current||(u.current=new Nt,u.current.configure(l,c),u.current.snap(n),h.current=n);let k=u.current;if(k.configure(l,c),h.current!==n){let D=m.current,C=!Object.is(d.current,s);k.sameTargets(n)?k.refreshData(n):!r||D==="init"?k.snap(n):D==="idle"?k.hold(n):D==="running"||C?k.update(n,rt(),f):k.snap(n),h.current=n,d.current=s}let P=(0,Z.useRef)(()=>!1);P.current=D=>{if(!F.current)return!1;let C=k.step(D);return!C&&m.current==="running"&&(m.current="done"),v(A=>(A+1)%1e9),C||(S.current=null),C};let H=(0,Z.useCallback)(()=>{if(!me||S.current||!k.animating)return;let D=C=>P.current(C);S.current=io(D)},[k]);xe(()=>{let D=!Object.is(p.current,a);if(p.current=a,!r){(m.current!=="done"||k.animating)&&(k.snap(h.current??n),m.current="done",v(C=>C+1));return}m.current==="init"||D&&i?(k.hold(h.current??n),m.current="idle",M.current=!1,v(C=>C+1)):D&&(M.current=!0)},[r,a]),xe(()=>{!r||!i||!M.current||(M.current=!1,k.hold(h.current??n),m.current="idle",v(D=>D+1))},[i,r]),(0,Z.useEffect)(()=>{r&&o&&m.current==="idle"&&(k.start(rt()),b.current+=1,m.current="running",H(),v(D=>D+1))},[r,o,a,k,H]),(0,Z.useEffect)(()=>{k.animating&&H()}),(0,Z.useEffect)(()=>(F.current=!0,()=>{F.current=!1,S.current?.(),S.current=null}),[]);let I=rt(),G=k.elapsed(I),z=r&&m.current==="idle";return{items:k.items(),get:D=>k.get(D),elapsed:z?0:G,fade:(D,C=320)=>z?0:Number.isFinite(G)?Math.max(0,Math.min(1,(G-D)/C)):1,waiting:z,animating:k.animating,generation:b.current}}var hn=_(j(),1);function co(e,t,n,r,o){if(r)return o==="categorical"?de(e,t,n):Vn(e,t,n);if(o==="categorical")return de(e,t,n);let i=q(e,"strong"),a=q(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?a:i)}var Ki=_(Y(),1);var gn=_(j(),1);var uo=e=>e?"neutralStrong":"accent";var pn=_(j(),1);function mo(e,t,n,r){if(typeof e!="function")return ye(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((a,s)=>[a,s])),i=new Set;return t.forEach((a,s)=>{let l=o.get(r(a,s));l!==void 0&&e(a,s)&&i.add(l)}),i}var Xi=_(Y(),1);var bn=_(j(),1),Ui={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}, ${ke(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},fo={en:Ui,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}일 이동평균`}},yn=["ink","muted","dim"];function ho(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,yn.length)}var Yi=_(Y(),1);var xo=_(j(),1),Ji={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${ke(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Zi={en:Ji,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},go=(e,t)=>Zi[e].other(t);function po(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((i,a)=>({v:i.value,i:a})).sort((i,a)=>a.v-i.v).slice(0,Math.floor(t)).map(i=>i.i)),o=e.filter((i,a)=>!r.has(a));return{kept:e.filter((i,a)=>r.has(a)),other:n(o.length,wr(o.map(i=>i.value)))}}var yo=e=>Number.isFinite(e)&&e>0?e:0;function bo(e,t,n,r){return r==="emphasis"?Gn(e,t,n):de(e,t,n)}var ve=_(Y(),1);var te=_(j(),1),qi={kind:"Sankey diagram",total:"Total",in:"In",out:"Out",flow:"Flow",flows:e=>ke(e,"flow"),from:e=>`Share of ${e}`,desc:(e,t)=>`${ke(e,"node")}, ${ke(t,"flow")}. Largest flows`,blank:"(blank)",other:e=>`Other (${e})`,ofTotal:"Share of total",through:e=>`Through ${e}`},Qi={en:qi,ko:{kind:"생키 다이어그램",total:"합계",in:"들어옴",out:"나감",flow:"흐름",flows:e=>`흐름 ${e}개`,from:e=>`${e} 중 비중`,desc:(e,t)=>`노드 ${e}개, 흐름 ${t}개. 큰 흐름`,blank:"(빈 값)",other:e=>`기타 ${e}개`,ofTotal:"전체 중 비중",through:e=>`${e} 경유`}},es=[];function xn(e){let t=no(e,{height:x=>Math.max(220,Math.min(340,x*.6)),duration:1e3,stagger:70}),{p:n,width:r,height:o}=t,i=Qi[t.lang],a=(0,ve.useMemo)(()=>{if(e.dimensions===void 0)return null;let x=[].concat(e.dimensions).slice(0,qr),$=e.value!==void 0||e.data.some(R=>R!==null&&typeof R=="object"&&xt(R,"value"));return{fields:x,...Qr(e.data,x.map(R=>ie(R,R)),$?Fe(e.value,"value"):()=>1,i)}},[e.data,e.dimensions,e.value,i]),s=(0,ve.useMemo)(()=>{if(a)return[];let x=ie(e.source,"source"),$=ie(e.target,"target"),R=Fe(e.value,"value");return e.data.map((V,le)=>({source:x(V,le),target:$(V,le),value:R(V,le)||0,d:V}))},[a,e.data,e.source,e.target,e.value]),l=a?a.nodes:es,c=a?a.links:s,f=(0,ve.useMemo)(()=>dn(l,c,{width:100,height:100,iterations:0}),[l,c]),u=f.nodes.filter(x=>x.layer===0),m=Math.max(0,...f.nodes.map(x=>x.layer)),h=f.nodes.filter(x=>x.layer===m&&m>0),d=Math.min(r*.22,Math.max(0,...u.map(x=>Math.max(re(x.label,11.5,700),re(t.fmt(x.value),10.5))))+10),p=Math.min(r*.22,Math.max(0,...h.map(x=>Math.max(re(x.label,11.5,700),re(t.fmt(x.value),10.5))))+10),M=a?18:0,b=(0,ve.useMemo)(()=>dn(l,c,{width:Math.max(60,r-d-p),height:o-8-M,x0:d,y0:4+M,nodeWidth:e.nodeWidth??10,nodePadding:e.nodePadding??14}),[l,c,r,o,d,p,M,e.nodeWidth,e.nodePadding]),v=(0,ve.useMemo)(()=>{let x=b.nodes.map(V=>V.label);if(e.highlight!==void 0)return ye(e.highlight,b.nodes,x,b.nodes.map(V=>V.value));let R=b.nodes.filter(V=>V.layer===m).sort((V,le)=>le.value-V.value)[0];return new Set(R?[R.index]:[])},[b,e.highlight,m]),S=x=>!a&&(v.has(x.source.index)||v.has(x.target.index)),F=t.active,k=F!==null&&F<b.nodes.length?F:-1,P=(0,ve.useMemo)(()=>{if(!a)return null;let x=k>=0?new Set([k]):v,$=a.links.map(()=>0);if(x.size){for(let R of a.paths)if(R.nodes.some(V=>x.has(V)))for(let V of R.links)$[V]+=R.value}return $},[a,v,k]),H=t.motion.stagger??70,I=t.motion.duration??1e3,G=(0,ve.useMemo)(()=>{let x=[];return b.nodes.forEach($=>{let R=($.y0+$.y1)/2;x.push({key:`n:${$.id}`,to:[$.y0,$.y1],from:[R,R],enter:[R,R],delay:$.layer*H*2,data:{node:$}})}),b.links.forEach(($,R)=>x.push({key:`l:${$.source.id}>${$.target.id}`,to:[1,$.y0,$.y1,$.width],from:[0,$.y0,$.y1,$.width],enter:[0,$.y0,$.y1,$.width],delay:I*.25+$.source.layer*H*3+R%6*25,data:{link:$}})),x},[b,H,I]),z=so(G,t.motion),D=q(n,"accent"),C=b.nodes.length,A=e.dimensionLabels,w=(0,ve.useMemo)(()=>a?a.fields.map(x=>A?.[x]??x):null,[a,A]),g=t.fv,T=(0,ve.useMemo)(()=>{let x=new Map;for(let R of s)x.has(`${R.source}>${R.target}`)||x.set(`${R.source}>${R.target}`,R.d);let $=R=>w?`${w[R.layer]}: ${R.label}`:R.label;return[...b.nodes.map(R=>({datum:null,index:R.index,key:R.id,label:$(R),value:R.value,formatted:g(R.value)})),...b.links.map((R,V)=>({datum:x.get(`${R.source.id}>${R.target.id}`)??null,index:C+V,key:`${R.source.id}>${R.target.id}`,label:`${$(R.source)} → ${$(R.target)}`,value:R.value,formatted:g(R.value)}))]},[b,s,C,g,w]),N=null;if(F!==null)if(F<C){let x=b.nodes[F],$=a?a.paths.reduce((R,V)=>R+V.value,0):0;x&&(N={x:(x.x0+x.x1)/2,y:x.y0,title:x.label,rows:[{label:i.total,value:t.fv(x.value),color:v.has(x.index)?D.fill:n.paint("neutralStrong")},...a?[{label:i.ofTotal,value:t.pct(x.value/($||1)*100)}]:[],...x.inLinks.length?[{label:i.in,value:i.flows(x.inLinks.length)}]:[],...x.outLinks.length?[{label:i.out,value:i.flows(x.outLinks.length)}]:[]]})}else{let x=b.links[F-C];if(x){let $=P&&v.size?[{label:i.through([...v].map(R=>b.nodes[R].label).join(", ")),value:t.fv(P[x.index]),color:D.fill}]:[];N={x:(x.source.x1+x.target.x0)/2,y:(x.y0+x.y1)/2-x.width/2,title:`${x.source.label} → ${x.target.label}`,rows:[{label:i.flow,value:t.fv(x.value),color:S(x)?D.fill:n.paint("neutral")},{label:i.from(x.source.label),value:t.pct(x.value/(x.source.value||1)*100)},...$]}}}let E=F!==null&&F<C?b.nodes[F]:null,B=F!==null&&F>=C?b.links[F-C]:null,O=x=>a?B?x===B?.5:.2:E?.2:.32:E?x.source===E||x.target===E?.75:.12:B?x===B?.8:.12:S(x)?.55:.32,U=e.description??`${i.kind}. ${i.desc(C,b.links.length)}: ${[...b.links].sort((x,$)=>$.value-x.value).slice(0,3).map(x=>`${x.source.label}→${x.target.label} ${t.fv(x.value)}`).join(", ")}.`,K=w?w.map((x,$)=>b.nodes.find(R=>R.layer===$)).map(x=>x?(x.x0+x.x1)/2:0):[];return(0,te.jsxs)(sr,{c:t,kind:i.kind,ariaLabel:e.ariaLabel,description:U,events:T,tip:N,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[w&&C?(0,te.jsx)("g",{children:w.map((x,$)=>{let R=$===w.length-1,V=$===0?(K[0]+K[1])/2-6:R?r-(K[$-1]+K[$])/2-6:Math.min(K[$]-K[$-1],K[$+1]-K[$])-12;return(0,te.jsx)(pt,{x:$===0?0:R?r:K[$],y:9,anchor:$===0?"start":R?"end":"middle",size:11,weight:700,fill:n.paint("muted"),children:$t(x,V,11,700)},$)})}):null,(0,te.jsx)("g",{children:z.items.map(x=>{let $=x.data.link;if(!$)return null;let R=b.links.indexOf($),[V,le,Le,be]=x.v;if(V<=.001)return null;let Me=S($);return(0,te.jsx)("path",{className:"ztd-mark",d:fn({source:$.source,target:$.target,y0:le,y1:Le,width:be},V),fill:Me?D.fill:n.paint("neutralStrong"),opacity:O($)*Math.min(1,V*1.5),onPointerEnter:Ge=>t.setActive(C+R,Ge.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click(C+R)},x.key)})}),P?(0,te.jsx)("g",{pointerEvents:"none",children:z.items.map(x=>{let $=x.data.link,R=$&&!x.exiting?P[$.index]:0;if(!$||!(R>0))return null;let[V,le,Le,be]=x.v;if(V<=.001)return null;let Me=be*R/$.value;return(0,te.jsx)("path",{d:fn({source:$.source,target:$.target,y0:le-(be-Me)/2,y1:Le-(be-Me)/2,width:Me},V),fill:D.fill,opacity:.6*Math.min(1,V*1.5)},x.key)})}):null,z.items.map(x=>{let $=x.data.node;if(!$)return null;let[R,V]=x.v,le=v.has($.index),Le=F===$.index,be=$.layer===0,Me=$.layer===m&&m>0,Ge=be?$.x0-8:$.x1+8,wn=be?"end":"start",_o=be?d-10:Me?p-10:Math.max(40,(b.nodes.find(Ft=>Ft.layer===$.layer+1)?.x0??r)-$.x1-16),Qe=($.y0+$.y1)/2,et=$.y1-$.y0>=26,Lo=!be&&!Me,vn=$t($.label,_o,11.5,700),Po=Math.max(re(vn,11.5,800),et?re(t.fmt($.value),10.5):0)+10,$n=et?32:18;return(0,te.jsxs)("g",{onPointerEnter:Ft=>t.setActive($.index,Ft.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click($.index),children:[(0,te.jsx)("path",{d:vr($.x0,R,$.x1-$.x0,Math.max(1,V-R),2),fill:le?D.fill:n.paint("ink"),stroke:Le&&t.via==="keyboard"?n.paint("accent"):"none",strokeWidth:2}),t.showLabels?(0,te.jsxs)("g",{opacity:z.fade($.layer*H*2+I*.35,300),pointerEvents:"none",children:[Lo?(0,te.jsx)("rect",{x:X(Ge-5),y:X(Qe-$n/2),width:Po,height:$n,rx:6,fill:n.paint("panel"),opacity:.94}):null,(0,te.jsx)(pt,{x:Ge,y:et?Qe-7:Qe,anchor:wn,size:11.5,weight:le||Le?800:600,fill:n.paint("ink"),children:vn}),et?(0,te.jsx)(pt,{x:Ge,y:Qe+8,anchor:wn,size:10.5,fill:n.paint("muted"),children:t.fmt($.value)}):null]}):null]},x.key)})]})}var ts=_(Y(),1);var $o=_(j(),1);function ko(e,t){return t===!1?e.map((n,r)=>r):kr(e)}function wo(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return ye(e,t,t,r,"max")}function vo(e,t,n){let r=new Array(t.length),o=t.filter(i=>!n.has(i));for(let i of t)n.has(i)&&(r[i]=q(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?q(e,"neutral"):at(e,1-a/Math.max(1,o.length-1))),r}function Mo(e){return!e||typeof e!="object"||Array.isArray(e)?[]:ge(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function To(e,t){return We(e,t+1,new Set)}var ns=_(Y(),1);var Co=_(j(),1);var rs=26;var Hc=rs*.62;function So(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!jr.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var $e=_(j(),1);function Ao(e,t,n){let r=bt(e);return r?.type==="scatter"&&t?.size!==void 0&&!yt(n)?bt("bubble"):r}function os(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 as(e,t,n,r=!1){let o=Ao(e.type,e.encoding,e.options);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,l=new Set(!r&&qt.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),c=u=>u.filter(m=>!l.has(m.label)),f=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(f.includes(o.type)){let u=ie(i.label,"label"),m=Fe(i.value,"value"),h=o.type==="waffle",d=t.map((k,P)=>({r:k,label:u(k,P),value:h?m(k,P):yo(m(k,P))})),{kept:p,other:M}=h?{kept:d,other:null}:po(d,a.other,(k,P)=>({r:{},label:go(J(n),k),value:P})),b=ye(s,p.map(k=>k.r),p.map(k=>k.label),p.map(k=>k.value),h?"first":"max"),v=M?[...p,M]:p,S=Se(k=>h?de(k,v.length,b):bo(k,v.length,b,a.colorMode)),F=h&&a.shape==="arc";return v.map((k,P)=>({label:k.label,color:S[P],...F&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=ho(Array.isArray(a.ma)?a.ma:void 0,t.length),m=fo[J(n)];return[{label:m.up,color:a.upColor??"accent"},{label:m.down,color:a.downColor??"neutralStrong"},...u.map((h,d)=>({label:m.maLegend(h),color:yn[d],shape:"line"}))]}if(o.type==="network"){let u=Mo(a.groups);if(u.length<2)return[];let m=Se(h=>To(h,u.length));return u.map((h,d)=>({label:h,color:m[d],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let u=ie(i.group,"group"),m=ge(t.map((d,p)=>u(d,p)).filter(Boolean));if(m.length<2)return[];let h=Se(d=>We(d,m.length,new Set));return m.map((d,p)=>({label:d,color:h[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||yt(a))return[];let u=ie(i.series,"series"),m=ge(t.map((p,M)=>u(p,M)));if(m.length<2)return[];let h=mo(s,t,m,u),d=Se(p=>We(p,m.length,h));return c(m.map((p,M)=>({label:p,color:d[M],shape:"circle"})))}if(o.type==="timeline"){let u=typeof i.group!="string",m=u?i.status:i.group;if(typeof m!="string")return[];let h=eo(t,m,u),d=Se(p=>de(p,h.length,So(s,h)));return c(h.map((p,M)=>({label:p,color:d[M],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(i.y))u=i.y;else if(typeof i.series=="string"){let S=ie(i.series,"series");u=ge(t.map((F,k)=>S(F,k)))}let m=Qt(o.type,i,a);if(m.length){let S=ye(s,u,u,u.map(()=>0),"none"),F=Se(P=>de(P,u.length,S)),k=u.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:u.map((P,H)=>({label:P,color:F[H]}));return[...c(k),...m.map((P,H)=>({label:P,color:uo(H),shape:"line"}))]}if(u.length<2)return[];let d=o.type==="bar"&&a.layout==="diverging"&&s===void 0?xr(u.length,Array.isArray(a.negative)?a.negative.map(S=>u.indexOf(String(S))):[],typeof a.neutral=="string"?u.indexOf(a.neutral):-1):-1,p=d>=0?new Set([d]):ye(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((S,F)=>({label:S,color:p.has(F)?"accent":"neutralStrong",shape:"square"})));let M=a.colorMode,b=S=>de(S,u.length,p);if((o.type==="line"||o.type==="area")&&(b=S=>co(S,u.length,p,o.type==="area",M)),o.type==="stream"){let S=Ue(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),F=ko(S.values,a.reorder),k=wo(s,S.series,S.values);b=P=>vo(P,F,k)}let v=Se(b);return c(u.map((S,F)=>({label:S,color:v[F],...o.type==="line"&&{shape:"line"}})))}return[]}function is(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&dr.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function ss(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:l,description:c,...f}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:f,width:o,height:i,highlight:a,syncId:s,title:l,description:c}}function No(e,t){let{spec:n}=e,r=Ao(n.type,n.encoding,n.options),o=(0,qe.useMemo)(()=>to(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=mr(n,e.locale),s=oe(a),l=J(s),c=Gr(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),f=gr(n),u=(0,qe.useMemo)(()=>f?Jr(f,s):void 0,[f,s]),m=n.options?.hidden,h=Array.isArray(m)?m.map(String):[],d=h.join(""),[p,M]=(0,qe.useState)(null);if(!r)return(0,$e.jsx)(Zt,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let b=o??c.data,v=t[r.type],S={...n.options??{}},F={...os(r,n.encoding),...S,...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:a},k=n.card?.legend==="toggle"&&hr(r.type,n.encoding??{},S),P=p&&p.base===d?p.hidden:h;k&&(F.hidden=P);let H=C=>M(A=>{let w=A&&A.base===d?A.hidden:h;return{base:d,hidden:w.includes(C)?w.filter(g=>g!==C):[...w,C]}}),I=F.height??220,G=is(n,r.type),z=i&&!b.length&&(c.loading||c.error||c.empty)?(0,$e.jsx)(Zt,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:I,locale:a}):G?(0,$e.jsx)(Hr,{chart:v,...ss(r.type,G,F)}):(0,$e.jsx)(v,{...F});if(n.card){let C=n.card,A=C.legend==="auto"||C.legend==="toggle"?as(n,b,s,k):C.legend,w=A?.length?k?(0,$e.jsx)(Jt,{items:A,hidden:P,onToggle:H,locale:a}):A:void 0,g=C.download?(0,$e.jsx)(Yr,{data:b,columns:pr(n),filename:C.title??r.type,formats:Array.isArray(C.download)?C.download:void 0,locale:a}):void 0;z=(0,$e.jsx)(ir,{number:C.number,title:C.title??ur(r,l),subtitle:C.subtitle,legend:w,actions:g,source:C.source||void 0,note:C.note||void 0,accent:C.accent,takeaway:C.takeaway,level:C.level,sample:C.sample,replay:C.replay!==!1,className:e.className,locale:a,children:z})}let D=e.theme??n.theme;return D&&(z=(0,$e.jsx)(mt,{theme:D,children:z})),z}function ls({cfg:e,components:t}){let n=Be();return No({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Fo(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Ro.hydrateRoot)(r,(0,kn.createElement)(mt,{theme:o.theme,cssVars:!0},(0,kn.createElement)(ls,{cfg:o,components:{[e]:t}})))}Fo("sankey",xn);})();