@skdx/web-components-charts 0.38.0 → 0.39.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 (81) hide show
  1. package/dist/area.cjs +31 -31
  2. package/dist/area.js +11 -11
  3. package/dist/bar.cjs +31 -31
  4. package/dist/bar.js +11 -11
  5. package/dist/boxplot.cjs +8 -8
  6. package/dist/boxplot.js +9 -9
  7. package/dist/bubble.cjs +9 -9
  8. package/dist/bubble.js +10 -10
  9. package/dist/bullet.cjs +12 -12
  10. package/dist/bullet.js +13 -13
  11. package/dist/bump.cjs +7 -7
  12. package/dist/bump.js +8 -8
  13. package/dist/candlestick.cjs +34 -34
  14. package/dist/candlestick.js +34 -34
  15. package/dist/chord.cjs +35 -35
  16. package/dist/chord.js +21 -21
  17. package/dist/circle-packing.cjs +16 -16
  18. package/dist/circle-packing.js +30 -30
  19. package/dist/combo.cjs +31 -31
  20. package/dist/combo.js +11 -11
  21. package/dist/dumbbell.cjs +21 -21
  22. package/dist/dumbbell.js +24 -24
  23. package/dist/funnel.cjs +7 -7
  24. package/dist/funnel.js +7 -7
  25. package/dist/gantt.cjs +7 -7
  26. package/dist/gantt.js +8 -8
  27. package/dist/gauge.cjs +6 -6
  28. package/dist/gauge.js +6 -6
  29. package/dist/heatmap.cjs +9 -9
  30. package/dist/heatmap.js +10 -10
  31. package/dist/histogram.cjs +30 -30
  32. package/dist/histogram.js +11 -11
  33. package/dist/icicle.cjs +16 -16
  34. package/dist/icicle.js +16 -16
  35. package/dist/index.cjs +33 -33
  36. package/dist/index.js +17 -17
  37. package/dist/line.cjs +31 -31
  38. package/dist/line.js +11 -11
  39. package/dist/linear-gauge.cjs +12 -12
  40. package/dist/linear-gauge.js +13 -13
  41. package/dist/map.cjs +6 -6
  42. package/dist/map.js +6 -6
  43. package/dist/marimekko.cjs +17 -17
  44. package/dist/marimekko.js +20 -20
  45. package/dist/network.cjs +14 -14
  46. package/dist/network.js +13 -13
  47. package/dist/organization.cjs +10 -10
  48. package/dist/organization.js +14 -14
  49. package/dist/parallel.cjs +6 -6
  50. package/dist/parallel.js +6 -6
  51. package/dist/pareto.cjs +30 -30
  52. package/dist/pareto.js +12 -12
  53. package/dist/pie.cjs +6 -6
  54. package/dist/pie.js +6 -6
  55. package/dist/polar-area.cjs +7 -7
  56. package/dist/polar-area.js +7 -7
  57. package/dist/radar.cjs +7 -7
  58. package/dist/radar.js +6 -6
  59. package/dist/radial.cjs +6 -6
  60. package/dist/radial.js +6 -6
  61. package/dist/range.cjs +31 -31
  62. package/dist/range.js +15 -15
  63. package/dist/sankey.cjs +10 -10
  64. package/dist/sankey.js +15 -15
  65. package/dist/scatter.cjs +31 -31
  66. package/dist/scatter.js +12 -12
  67. package/dist/sunburst.cjs +28 -28
  68. package/dist/sunburst.js +8 -8
  69. package/dist/swarm.cjs +16 -16
  70. package/dist/swarm.js +17 -17
  71. package/dist/timeline.cjs +6 -6
  72. package/dist/timeline.js +6 -6
  73. package/dist/tree.cjs +10 -10
  74. package/dist/tree.js +13 -13
  75. package/dist/treemap.cjs +7 -7
  76. package/dist/treemap.js +7 -7
  77. package/dist/waffle.cjs +31 -31
  78. package/dist/waffle.js +31 -31
  79. package/dist/waterfall.cjs +14 -14
  80. package/dist/waterfall.js +18 -18
  81. package/package.json +3 -3
package/dist/sunburst.cjs CHANGED
@@ -1,61 +1,61 @@
1
- "use strict";var ue=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var on=Object.prototype.hasOwnProperty;var an=(e,n)=>{for(var t in n)ue(e,t,{get:n[t],enumerable:!0})},sn=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of rn(n))!on.call(e,o)&&o!==t&&ue(e,o,{get:()=>n[o],enumerable:!(r=At(n,o))||r.enumerable});return e};var ln=e=>sn(ue({},"__esModule",{value:!0}),e),d=(e,n,t,r)=>{for(var o=r>1?void 0:r?At(n,t):n,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(n,t,o):a(o))||o);return r&&o&&ue(n,t,o),o};var In={};an(In,{SkdxSunburstChart:()=>z});module.exports=ln(In);var N=require("lit/decorators.js");var Ot=e=>Number(e.toPrecision(12)),cn,dn=e=>(cn??(cn=new Intl.NumberFormat)).format(Ot(e)),un=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),o=Math.floor(n%3600/60),i=a=>String(a).padStart(2,"0");return r>0?`${t}${r}h ${i(o)}m`:o>0?`${t}${o}m ${i(n%60)}s`:`${t}${n}s`};function Lt(e){if(e===void 0)return dn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:o="",timeZone:i}=e,a=u=>o?m=>u(m)+o:u,s=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let m=new Intl.NumberFormat(t,u);return a(b=>m.format(Ot(b)))},c=u=>{let m=new Intl.DateTimeFormat(t,i?{...u,timeZone:i}:u);return b=>m.format(b)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(s(2));case"percent":return l({style:"percent",...s(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...s()});case"compact":return l({notation:"compact",...s(1)});case"scientific":return l({notation:"scientific",...s(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return a(un)}}var y=e=>Number(e.toFixed(2)),me=e=>typeof e=="number"&&Number.isFinite(e);function ze(e){let n=1/0,t=-1/0;for(let r of e)me(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}var ee=1e3,te=60*ee,ne=60*te,he=24*ne,Ln=[ee,5*ee,15*ee,30*ee,te,5*te,15*te,30*te,ne,3*ne,6*ne,12*ne,he,2*he,7*he,14*he];var hn=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,mn=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,pn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function fn(e,n,t){return e.replace(mn,(r,o,i)=>{let a=pn[o];if(a===void 0)return o+i;let l=(i.match(hn)??[]).map((c,u)=>{let m=Number(c);if(a===-1)return String(m+n);if(a===-2)return String(m+t);let b=u%a;return a===7?b===5?String(m+n):b===6?String(m+t):c:String(b%2===0?m+n:m+t)});return o+l.join(" ")})}var zt=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:fn(r.d,n,t)}}});var Ne=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),M={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"};var Nt=(e,n)=>n??Ne[e%Ne.length];function re(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Pt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var pe=20,bn=120,Rt=e=>{let n=re(e);return n&&(n.position==="left"||n.position==="right")?n.width??bn:0},fe=(e,n=600,t=300)=>({width:(e.width??n)-Rt(e),height:(e.height??t)-(re(e)?.position==="bottom"?pe:0)}),be=e=>{let n=re(e);return n&&(n.position===void 0||n.position==="top")?pe:0},B=6.5,oe=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Nt(n)),Re=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Pe(e,n,t=[],r={},o=10,i=8,a=!1){let s=[],l=r.maxItems,c=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,u=e.length-c.length,m=r.interactive??!0,b=i,$=o,C=(S,f,x,k)=>{let A=(f?18:4)+S.length*B;b>i&&(a||b+A>n-8)&&(b=i,$+=pe),f&&s.push({kind:"rect",part:"legend-swatch",x:b,y:$-5,width:10,height:10,fill:f,opacity:k?.3:void 0,item:x}),s.push({kind:"text",part:"legend-label",x:b+(f?14:0),y:$,text:S,baseline:"middle",fill:k?M.grid:M.label,item:x}),b+=A+12};for(let S of c){let f=t.includes(S.name),x=m?{label:S.name,series:S.name,legend:!0}:void 0;C(r.formatter?.(S.name)??S.name,S.color,x,f)}return u>0&&C(`+${u} more`,void 0,void 0,!1),r.align==="end"?gn(s,n):s}function gn(e,n){let t=new Map;for(let o of e){let i=o.kind==="rect"?o.y+5:o.y;t.set(i,[...t.get(i)??[],o])}let r=[];for(let o of t.values()){let i=Math.max(...o.map(s=>s.kind==="rect"?s.x+s.width:s.x+s.text.length*B)),a=n-8-i;for(let s of o)r.push({...s,x:s.x+a})}return r}var xn=(e,n,t={})=>new Set(Pe(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function ge(e,n,t,r=[]){let o=re(e),i=o&&e.direction==="rtl"&&o.align===void 0?{...o,align:"end"}:o,a=Pt(e),s=i?.position==="bottom",l=Rt(e),c=e.hiddenSeries??[],u=i?l?Pe(r,1/0,c,i,10,(i.position==="right"?n:0)+8,!0):Pe(r,n,c,i,s?t+10:10):[],m=s?xn(r,n,i):0;return{width:n+l,height:s?t+Math.max(1,m)*pe:t,legendOffset:i?.position==="left"?l:void 0,tooltip:a.enabled,tooltipFormatter:a.formatter,axisTooltipFormatter:a.axisFormatter,tooltipPortal:a.portal,tooltipPlacement:a.placement,tooltipAnchored:a.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function Be(e){let n=e.legendOffset;if(!n)return e;let t=[...zt(e.shapes.filter(l=>!l.part.startsWith("legend-")),n,0),...e.shapes.filter(l=>l.part.startsWith("legend-"))],r=l=>({...l,x:l.x+n}),o=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(l=>l+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,i=e.edit,a=i?{...i,scale:l=>i.scale(l)+n,invert:l=>i.invert(l-n),bars:i.bars.map(l=>({...l,x0:l.x0+n,x1:l.x1+n}))}:void 0,s=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:o,edit:a,map:s,legendOffset:void 0}}function xe(e,n,t,r,o,i="auto"){let a=Array.isArray(t)?t:[t],s=Math.max(...a.map(b=>b.length))*B+12,l=6+a.length*16,c=i==="top"?{x:e-s/2,y:n-l-8}:i==="bottom"?{x:e-s/2,y:n+8}:i==="left"?{x:e-s-8,y:n-l/2}:i==="right"?{x:e+8,y:n-l/2}:{x:e+12,y:n-l-6},u=Math.max(0,Math.min(r-s,c.x)),m=Math.max(0,Math.min(o-l,c.y));return[{kind:"rect",part:"tooltip",x:y(u),y:y(m),width:y(s),height:l,fill:"var(--skdx-color-surface-raised)",stroke:M.axis,rx:3},...a.map((b,$)=>({kind:"text",part:"tooltip-label",x:y(u+6),y:y(m+11+$*16),text:b,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:a.length>1&&$===0?"bold":void 0}))]}function De(e,n,t,r){let o=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!o)return null;let{width:i,height:a}=fe(e,t,r),s=o==="error"?e.error:o==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return o==="loading"&&l.push({kind:"rect",part:"skeleton",x:0,y:0,width:i,height:a,fill:"var(--skdx-color-surface-sunken)",rx:4}),l.push({kind:"text",part:`state-${o}`,x:y(i/2),y:y(a/2),text:s,anchor:"middle",baseline:"middle",fill:o==="error"?"var(--skdx-color-text-danger)":M.label}),{...ge(e,i,a),shapes:l,tooltip:!1}}var K=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:M.label,...r});var ie=e=>Math.max(0,Math.min(1,e));function Bt(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],o=r.length===3?r.split("").map(i=>i+i).join(""):r;return[0,2,4].map(i=>parseInt(o.slice(i,i+2),16))}let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:void 0}function Dt(e,n){if(e.length===0)return M.axis;if(e.length===1)return e[0];let t=ie(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),o=t-r,i=Bt(e[r]),a=Bt(e[r+1]);if(!i||!a)return e[Math.round(t)];let s=l=>Math.round(i[l]+(a[l]-i[l])*o);return`rgb(${s(0)}, ${s(1)}, ${s(2)})`}var Ft=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(ie(e)*n))/(n-1):ie(e);function Gt(e,n,t,r=M.negative,o=String){let[i,a]=ze(n),s=e??{type:"sequential"},l=f=>y(.15+.85*f);if(s.type==="threshold"){let{thresholds:f,colors:x,labels:k}=s,A=P=>{if(typeof P!="number"||!Number.isFinite(P))return;let I=0;for(;I<f.length&&P>=f[I];)I++;return{fill:x[Math.min(I,x.length-1)]??t,opacity:1}},E=x.map((P,I)=>({fill:P,opacity:1,label:k?.[I]??(I===0?`< ${o(f[0]??0)}`:I===f.length?`\u2265 ${o(f[I-1])}`:`${o(f[I-1])} \u2013 ${o(f[I])}`)}));return{color:A,domain:[i,a],swatches:E,kind:"threshold"}}if(s.type==="ordinal"){let f=s.colors?.length?s.colors:[t];return{color:k=>typeof k=="number"&&Number.isFinite(k)?{fill:f[Math.abs(Math.round(k))%f.length],opacity:1}:void 0,domain:[i,a],swatches:f.map((k,A)=>({fill:k,opacity:1,label:String(A)})),kind:"ordinal"}}if(s.type==="diverging"){let[f,x,k]=s.domain??[-Math.max(Math.abs(i),Math.abs(a)),0,Math.max(Math.abs(i),Math.abs(a))],A=s.colors,E=T=>T<x?.5*(T-f)/Math.max(1e-12,x-f):.5+.5*(T-x)/Math.max(1e-12,k-x),P=T=>{let G=Ft(s.reversed?1-ie(T):T,s.steps);if(A&&A.length>=2)return{fill:Dt(A,G),opacity:1};let D=G<.5?r:t,O=Math.abs(G-.5)*2;return{fill:D,opacity:l(O)}},I=T=>typeof T=="number"&&Number.isFinite(T)?P(E(T)):void 0,V=s.steps??5,W=Array.from({length:V},(T,G)=>{let D=V===1?.5:G/(V-1),O=D<.5?f+(x-f)*(D*2):x+(k-x)*((D-.5)*2);return{...P(D),label:o(O)}});return{color:I,domain:[f,k],swatches:W,kind:"diverging"}}let[c,u]=s.domain??[i,a],m=s.colors,b=f=>{let x=Ft(s.reversed?1-ie(f):f,s.steps);return m&&m.length>=2?{fill:Dt(m,x),opacity:1}:{fill:m?.[0]??t,opacity:l(x)}},$=f=>typeof f!="number"||!Number.isFinite(f)?void 0:b(u===c?1:(f-c)/(u-c)),C=s.steps??5,S=Array.from({length:C},(f,x)=>{let k=C===1?1:x/(C-1);return{...b(k),label:o(c+(u-c)*k)}});return{color:$,domain:[c,u],swatches:S,kind:"sequential"}}function ye(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Fe=e=>e.id??e.name??e.series,Ht=e=>e.seriesId??e.series;function H(e,n){let t=!1;return n.id!==void 0&&(t=!0,Fe(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Ht(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}function _(e){let n={},t=Fe(e);t!==void 0&&(n.id=t);let r=Ht(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ge=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function He(e,n,t){let r=ye(e),o=_(n),i=r.some(a=>H(n,a));return t==="single"?i?[]:[o]:i?r.filter(a=>!H(n,a)):[...r,o]}var yn=.2;function vn(e){let n=M.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var Mn=(e,n)=>e.kind==="text"?{...e,fill:M.grid}:{...e,opacity:(e.opacity??1)*n};function je(e,n){let t=ye(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:ye(n.highlighted),o=r[0];if(t.length===0&&!o)return e;let i={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},a=[],s=u=>!o||r.some(m=>H(u,m))?!0:i.highlighted==="series"?r.some(m=>m.series!==void 0&&H(u,{series:m.series})):!1,l=u=>{if(!o||i.faded==="none"||s(u))return!1;if(i.faded==="series"){let m=o.series;return m!==void 0&&H(u,{series:m})}return!0},c=e.shapes.map(u=>{let m=u.item;if(!m||m.legend)return u;if(t.some(b=>H(m,b))){let b=vn(u);b&&a.push(b)}return l(m)?Mn(u,yn):u});return a.length?{...e,shapes:[...c,...a]}:{...e,shapes:c}}var jt=2*Math.PI;function ve(e,n,t,r,o,i){let a=(c,u)=>`${y(e+c*Math.sin(u))} ${y(n-c*Math.cos(u))}`;if(i-o>=jt-1e-9){let c=o+jt/2;return`${ve(e,n,t,r,o,c)}${ve(e,n,t,r,c,i)}`}let s=i-o>Math.PI?1:0,l=`M${a(t,o)}A${t} ${t} 0 ${s} 1 ${a(t,i)}`;return r>0?`${l}L${a(r,i)}A${r} ${r} 0 ${s} 0 ${a(r,o)}Z`:`${l}L${y(e)} ${y(n)}Z`}function Q(e,n,t,r,o){let i=e.getBoundingClientRect();return{x:i.width?(n-i.left)*r/i.width:n,y:i.height?(t-i.top)*o/i.height:t}}var Ve=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Vt(e,n){let t=0,r=1/0;return e.xs.forEach((o,i)=>{let a=Math.abs(o-n);a<r&&(r=a,t=i)}),t}function ae(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Vt(t,n),o=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(o,r)??o}}function _e(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Vt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:M.axis,dash:"3 3"}}function Ze(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Ve(r.plot,n,t))return[];let o=_e(e,n),{rows:i}=ae(e,n),a=e.tooltipAnchored?r.plot.y+8:t;return[o,...xe(o.x1,a,i,e.width,e.height,e.tooltipPlacement)]}function Ee(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(i=>i[0]===n);if(r<0)return[];let o=t.xs[r];return Ze(e,o,t.plot.y+8)}function We(e,n,t,r,o){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=Q(t,r,o,e.width,e.height);if(Ve(e.hit.plot,l,c)){let u=ae(e,l),m=_e(e,l);if(u&&m)return{lines:u.rows,shapes:[m]}}}let i=n?.closest?.("[data-skdx-part]"),a=e.tooltipFormatter?Z(e,n)?.item:void 0,s=a&&e.tooltipFormatter?.(a)||i&&Array.from(i.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return s?{lines:Array.isArray(s)?s:[s],shapes:[]}:{lines:[],shapes:[]}}function _t(e,n,t,r,o,i,a){let s=e?.closest?.("[data-skdx-part]"),l=a&&a.tooltipFormatter?Z(a,e)?.item:void 0,c=l&&a?.tooltipFormatter?.(l)||s&&Array.from(s.children).find(C=>C.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let u=a?.tooltipAnchored?Z(a,e):void 0,m=u?a?.shapes[u.index]:void 0,{x:b,y:$}=m?se(m):Q(n,t,r,o,i);return xe(b,$,c,o,i,a?.tooltipPlacement)}function Ue(e,n,t,r,o){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:i,y:a}=Q(t,r,o,e.width,e.height),s=Ze(e,i,a);if(s.length>0)return s}return _t(n,t,r,o,e.width,e.height,e)}function qe(e,n){let t=Z(e,n);return t&&!t.item.legend?_(t.item):null}var wn=(e,n)=>{let{x:t,y:r}=se(e),o=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&o>=n.y&&o<=n.y+n.height};function Ke(e,n){let t=new Set,r=[];for(let o of e.shapes){if(!o.item||o.item.legend||o.part==="anchor"||!wn(o,n))continue;let i=_(o.item),a=JSON.stringify(i);t.has(a)||(t.add(a),r.push(i))}return r}var Ye=e=>({kind:"rect",part:"selection-box",x:y(e.x),y:y(e.y),width:y(e.width),height:y(e.height),fill:M.focus,opacity:.12,stroke:M.focus}),we=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function Zt(e,n,t){let r=!1;for(let o=0,i=e.length-1;o<e.length;i=o++){let a=e[o],s=e[i];a.y>t!=s.y>t&&n<(s.x-a.x)*(t-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function Xe(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let o of e.shapes){if(!o.item||o.item.legend||o.part==="anchor")continue;let{x:i,y:a}=se(o),s=o.kind==="circle"?o.cy:o.kind==="rect"?o.y+o.height/2:a;if(!Zt(n,i,s))continue;let l=_(o.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Qe=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${y(n.x)} ${y(n.y)}`).join("L")}`:"",fill:M.focus,fillOpacity:.12,stroke:M.focus,dash:"4 3"}),Me=6;function Je(e,n,t){let r=e.edit;if(r){for(let o of r.bars)if(!(t<o.y||t>o.y+o.height||n<o.x0-Me||n>o.x1+Me))return Math.abs(n-o.x0)<=Me?{bar:o,mode:"start"}:Math.abs(n-o.x1)<=Me?{bar:o,mode:"end"}:{bar:o,mode:"move"}}}function et(e,n,t){let r=e.edit;return Et(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function tt(e,n,t){let r=e.edit,o=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!o||!(t.shiftKey||t.altKey))return;let i=r.bars.find(l=>l.index===n);if(!i)return;let a=t.altKey?t.shiftKey?"start":"end":"move",s=r.snap??r.invert(i.x0+10)-r.invert(i.x0);return Et(r,{bar:i,mode:a},o*s)}function Et(e,{bar:n,mode:t},r){let o=s=>e.snap?Math.round(s/e.snap)*e.snap:s,i=n.start,a=n.end;return t==="move"?(i=o(n.start+r),a=i+(n.end-n.start)):t==="start"?i=Math.min(o(n.start+r),n.end):a=Math.max(o(n.end+r),n.start),{id:n.id,name:n.name,start:i,end:a}}function nt(e,n,t){let r=e.edit,o=r.scale(t.start),i=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:y(Math.min(o,i)),y:y(n.bar.y),width:y(Math.max(1,Math.abs(i-o))),height:y(n.bar.height),fill:M.focus,opacity:.25,stroke:M.focus,rx:2}}var $n=64,kn=e=>Math.max(1,Math.min($n,e));function rt(e,n,t,r){let o=n>0?.8:1.25,i=kn(e.view.zoom*o);if(i===e.view.zoom)return e.view;let{plot:a,scale:s}=e,[l,c]=e.view.center,u=(t-(a.x+a.width/2))/s,m=(r-(a.y+a.height/2))/s,b=e.view.zoom/i;return{center:[l+u*(1-b),e.fromY(e.toY(c)-m*(1-b))],zoom:i}}function ot(e,n,t,r){let{scale:o}=e;return{center:[n.center[0]-t/o,e.fromY(e.toY(n.center[1])+r/o)],zoom:n.zoom}}function Z(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),o=Number.isInteger(r)?e.shapes[r]?.item:void 0;return o?{index:r,item:o}:void 0}var $e=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function se(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function it(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=M.focus,o;switch(t.kind){case"rect":o={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":o={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":o={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":o={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*B+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":o={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:i,y:a}=se(t),s=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[o,...s?xe(y(i),y(a),s,e.width,e.height):[]]}function at(e,n,t){let r=$e(e);if(r.length===0)return;let o=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,o+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,o<=0?0:o-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var Y=2,X=(e,n,t)=>{let r=Math.max(Y,Math.min(t,Math.round(n))),o=Math.max(0,Math.min(t-r,Math.round(e)));return{start:o,end:o+r}},Wt=(e,n)=>!e||e.start<=0&&e.end>=n;function st(e,n,t){if(e.count<=Y||!e.plot.width)return;let{start:r,end:o}=e.zoom,i=o-r,a=n>0?1.25:.8,s=Math.max(Y,Math.min(e.count,Math.round(i*a)));if(s===i)return n>0&&!Wt(e.zoom,e.count)?X(r,s,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+l*i;return X(c-l*s,s,e.count)}function lt(e,n,t,r){let o=n.end-n.start,i=Math.max(Y,Math.min(e.count,Math.round(o/Math.max(.05,t)))),a=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return X(n.start+a*o-a*i,i,e.count)}function ct(e,n,t){let r=n.end-n.start,o=e.plot.width/Math.max(1,r);return X(n.start-t/o,r,e.count)}function dt(e,n,t){let r=e.brush;if(!r||!Ve(r.box,n,t))return;let o=r.window;if(Math.abs(n-o.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(o.x+o.width))<=6)return{grab:"right",zoom:e.zoom};if(n>o.x&&n<o.x+o.width)return{grab:"move",zoom:e.zoom};let i=e.zoom.end-e.zoom.start,a=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:X(a-i/2,i,e.count)}}function ut(e,n,t,r){let o=e.brush;if(!o)return t;let i=r/Math.max(1,o.box.width)*e.count;if(n==="move")return X(t.start+i,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-Y,Math.round(t.start+i))),end:t.end};let a=Math.min(e.count,Math.max(t.start+Y,Math.round(t.end+i)));return{start:t.start,end:a}}function mt(e,n){switch(n.type){case"svg":return Promise.resolve(ht(e,n.label,n.resolve));case"csv":return Promise.resolve(Yt(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=ht(e,n.label,n.resolve);return Kt(t,e.width,e.height,n.scale,n.background)}}}var j=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),le=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${j(String(t))}"`).join("");function Ut(e){let n=e.title?`<title>${j(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${le([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${le([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${le([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${le([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${le([t,["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${j(e.text)}</text>`}}function qt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${j(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${j(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function ht(e,n,t){let r=qt(e)+e.shapes.map(Ut).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(o,i)=>t(i).trim()||o)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${j(n)}" font-family="${j(M.fontFamily)}" font-size="${j(M.fontSize)}"><title>${j(n)}</title>${r}</svg>`}function Kt(e,n,t,r=2,o){return new Promise((i,a)=>{let s=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(s);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let u=c.getContext("2d");if(!u)return a(new Error("canvas 2d context unavailable"));o&&(u.fillStyle=o,u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),c.toBlob(m=>m?i(m):a(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(s),a(new Error("svg could not be decoded"))},l.src=s})}function Yt(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
2
- `)}var F=e=>me(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+F(t),0),pt=e=>e.length===0?0:1+Math.max(...e.map(n=>pt(n.children??[]))),ce=e=>e.id??e.name;function Xt(e,n){for(let t of e){if(ce(t)===n||t.name===n)return[t];let r=Xt(t.children??[],n);if(r)return[t,...r]}}var ft=(e,n)=>n==="asc"||n==="desc"?[...e].sort((t,r)=>n==="asc"?F(t)-F(r):F(r)-F(t)):[...e];function ke(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:F(r),children:void 0}:{...r,children:r.children?ke(r.children,n,t+1):void 0})}function bt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Xt(e,n);if(!t)return{nodes:[...e],path:[]};let r=t[t.length-1];return{nodes:r.children?.length?r.children:[r],path:t}}function gt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let s=r.rows[0];if(r.rows.length>t)return;let l=["",...s.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],c=r.rows.map(u=>[u[0],...u.slice(1).map(m=>m.slice(m.lastIndexOf(": ")+2))]);return[l,...c]}let o=e.shapes.flatMap(s=>s.item&&!s.item.legend&&!(s.part==="anchor"&&!s.title)?[s.item]:[]);if(o.length===0||o.length>t)return;let i=["series","name","category","value"].filter(s=>o.some(l=>l[s]!==void 0)),a=(s,l)=>s[l]===void 0?"":String(s[l]);return[i.map(s=>s[0]?.toUpperCase()+s.slice(1)),...o.map(s=>i.map(l=>a(s,l)))]}var xt=new Map;function Ce(e){let n=xt.get(e);if(n)return n.group;let t=new Set,r={},o={current:r,subscribe(i){return t.add(i),()=>{t.delete(i),t.size===0&&xt.delete(e)}},publish(i,a){Object.assign(r,i);for(let s of t)s(i,a)}};return xt.set(e,{group:o,listeners:t}),o}var Qt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',yt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Qt}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${Qt}{animation:none;transition:none}}`;function vt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Mt(e,n,t){let r=[],o=n;return e.forEach((i,a)=>{a>0&&(r.push(K(y(o),t,"\u203A",{part:"breadcrumb-separator",baseline:"middle"})),o+=B+6),r.push(K(y(o),t,i.name,{part:"breadcrumb",baseline:"middle",fill:"var(--skdx-color-text-default)",title:i.name,item:{label:i.name,id:ce(i),name:i.name}})),o+=i.name.length*B+6}),r}var wt=e=>e*Math.PI/180;function $t(e){let{nodes:n,path:t}=bt(e.data,e.rootId),r=ke(n,e.maxDepth),o=De(e,!r.some(O=>F(O)>0),300,300);if(o)return o;let i=Lt(e.format),{width:a,height:s}=fe(e,300,300),l=Math.min(.9,Math.max(0,e.innerRadius??0)),c=e.breadcrumbs&&t.length>0,u=c&&l===0,m=be(e)+(u?20:0),b=a/2,$=m+(s-m)/2,C=Math.max(0,Math.min(a,s-m)/2-8),S=C*l,f=(C-S)/Math.max(1,pt(r)),x=wt(e.startAngle??0),k=wt(e.endAngle??(e.startAngle??0)+360),A=Math.max(0,wt(e.padAngle??0)),E=e.sort??"none",P=[],I=O=>{for(let R of O)R.children?.length?I(R.children):P.push(F(R))};I(r);let V=e.colorScale?Gt(e.colorScale,P,oe(e,0),void 0,i):void 0,W=[],T=[],G=(O,R,Ie,Jt,en)=>{let Te=L=>R===0&&Re(e,L.name)?0:Math.max(0,F(L)),Ae=ft(O,E),kt=Ae.reduce((L,U)=>L+Te(U),0),tn=Math.max(0,Ae.filter(L=>Te(L)>0).length-1),nn=Math.max(0,Jt-tn*A),J=Ie;Ae.forEach(L=>{let U=Te(L),q=kt>0?U/kt*nn:0,Oe=!((L.children?.length??0)>0)&&V?V.color(U):void 0,Ct=Oe?.fill??L.color??en??oe(e,O.indexOf(L));if(q>0){let de=S+f*R,Le=de+f;if(e.labels&&q*((de+Le)/2)>L.name.length*B+4){let It=J+q/2,Tt=(de+Le)/2;T.push(K(y(b+Tt*Math.sin(It)),y($-Tt*Math.cos(It)),L.name,{part:"arc-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}let St=`${L.name}: ${i(U)}`;W.push({kind:"path",part:"arc",d:ve(b,$,Le,de,J,J+q),fill:Ct,opacity:Oe?Oe.opacity:1-R*.2,stroke:"var(--skdx-color-surface-default)",title:St,item:{label:St,id:ce(L),name:L.name,value:U}}),G(L.children??[],R+1,J,q,Ct),J+=q+A}})};if(G(r,0,x,Math.max(0,Math.min(2*Math.PI,k-x)),void 0),e.centerLabel&&T.push(K(y(b),y(c&&!u?$-8:$),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),c){let O=t.reduce((R,Ie)=>R+Ie.name.length*B+6,0)+(t.length-1)*(B+6);T.push(...u?Mt(t,8,be(e)+10):Mt(t,b-O/2,e.centerLabel?$+8:$))}let D=ge(e,a,s,r.map((O,R)=>({name:O.name,color:oe(e,R,O.color)})));return{...D,shapes:[...W,...T,...D.shapes]}}var p=require("lit"),h=require("lit/decorators.js"),v=require("lit/directives/if-defined.js");var Cn={fromAttribute:()=>!1},g=class extends p.LitElement{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let o=this.drag;if(o?.grab==="select"){let{x:i,y:a}=this.viewBox(t,r);this.overlay=[Ye(we(o.x,o.y,i,a))];return}if(o?.grab==="lasso"){let{x:i,y:a}=this.viewBox(t,r);o.points=[...o.points??[],{x:i,y:a}],this.overlay=[Qe(o.points)];return}if(o?.grab==="edit"){if(!o.gantt)return;let{x:i}=this.viewBox(t,r);o.change=et(r,o.gantt,i-o.x),this.overlay=[nt(r,o.gantt,o.change)];return}if(o?.grab==="map"){if(!r.map||!o.view)return;let{x:i,y:a}=this.viewBox(t,r);this.setView(ot(r.map,o.view,i-o.x,a-o.y));return}if(o&&r.hit){if(o.grab==="pinch"){let[a,s]=[...this.pointers.values()];if(a===void 0||s===void 0||!o.distance)return;this.setZoom(lt(r.hit,o.zoom,Math.abs(a-s)/o.distance,(a+s)/2));return}let{x:i}=this.viewBox(t,r);this.setZoom(o.grab==="pan"?ct(r.hit,o.zoom,i-o.x):ut(r.hit,o.grab,o.zoom,i-o.x));return}if(r.tooltipPortal){let{lines:i,shapes:a}=We(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=a,this.portal=i.length?{x:t.clientX,y:t.clientY,lines:i}:null}else{let i=Ue(r,t.target,t.currentTarget,t.clientX,t.clientY);(i.length>0||this.tip.length>0)&&(this.tip=i)}if(this.highlight(qe(r,t.target)),this.syncId&&r.hit?.crosshair){let i=ae(r,this.viewBox(t,r).x);this.shareCrosshair(i?r.hit.rows[i.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:o,y:i}=this.viewBox(t,r),a=Z(r,t.target)?.item.legend,s=this.canEdit(r)?Je(r,o,i):void 0;if(s){this.drag={x:o,y:i,zoom:{start:0,end:0},grab:"edit",gantt:s},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!a){this.drag={x:o,y:i,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:o,y:i}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(o<c.x||o>c.x+c.width||i<c.y||i>c.y+c.height)return;this.drag={x:o,y:i,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let l=r.hit;if(!(!l||!this.canZoom(r))){if(this.pointers.set(t.pointerId,o),this.pointers.size===2){let[c,u]=[...this.pointers.values()];this.drag={x:(c+u)/2,y:i,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-u)||1}}else{let c=dt(l,o,i);if(c)this.drag={x:o,y:i,zoom:c.zoom,grab:c.grab},c.zoom!==l.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&o>=l.plot.x&&o<=l.plot.x+l.plot.width&&i>=l.plot.y&&i<=l.plot.y+l.plot.height)this.drag={x:o,y:i,zoom:l.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let o=this.drag,i=this.layout;if(i&&(o?.grab==="select"||o?.grab==="lasso"||o?.grab==="edit"||o?.grab==="map")){this.overlay=[];let{x:a,y:s}=this.viewBox(t,i);if(Math.abs(a-o.x)>2||Math.abs(s-o.y)>2){o.grab==="select"?this.setSelected(Ke(i,we(o.x,o.y,a,s))):o.grab==="lasso"?this.setSelected(Xe(i,o.points??[])):o.grab==="edit"&&o.change&&this.emit("skdx-task-change",o.change),this.drag={...o,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:o,y:i}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(o<l.x||o>l.x+l.width||i<l.y||i>l.y+l.height)return;t.preventDefault(),this.setView(rt(r.map,t.deltaY,o,i));return}let a=r.hit;if(!a||!this.canZoom(r)||i<a.plot.y||i>a.plot.y+a.plot.height)return;let s=st(a,t.deltaY,o);s&&(t.preventDefault(),this.setZoom(s))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=Z(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let s=r.shapes[this.focused]?.item;s&&(t.preventDefault(),this.select(s),this.emit("skdx-item-click",s));return}let o=this.canEdit(r)?tt(r,this.focused,t):void 0;if(o){t.preventDefault(),this.emit("skdx-task-change",o);return}let i=at(r,this.focused,t.key);if(i===void 0)return;t.preventDefault(),this.focused=i;let a=i===null?void 0:r.shapes[i]?.item;this.highlight(a?_(a):null)}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:o,tooltip:i,format:a,palette:s,loading:l,error:c,emptyMessage:u,description:m,decorative:b,animated:$,responsive:C,highlighted:S,highlightScope:f,accessibleTable:x}=this;return{...typeof C=="object"&&this.measured!==void 0&&this.measured<(C.breakpoint??480)?C.compact:void 0,width:C&&this.measured?this.measured:t,height:r,animate:$,responsive:C,legend:o,tooltip:i,format:a,palette:s,loading:l,error:c,emptyMessage:u,description:m,decorative:b,highlighted:S===void 0?this.highlightState:S,highlightScope:f,accessibleTable:x,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&Ce(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=Ce(this.syncId),r=o=>{"highlighted"in o&&(this.highlightState=o.highlighted??null),o.selected&&(this.selectedState=o.selected,this.crossFilter&&(this.highlightState=o.selected.length?o.selected:null)),"zoom"in o&&(this.zoomState=o.zoom),o.hiddenSeries&&(this.hiddenState=o.hiddenSeries),"crosshair"in o&&(this.crossState=o.crosshair??null)};r(t.current),this.leave=t.subscribe((o,i)=>{i!==this.token&&r(o)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,o=r.includes(t)?r.filter(i=>i!==t):[...r,t];this.hiddenState=o,this.emit("skdx-hidden-series-change",o),this.publish({hiddenSeries:o})}highlight(t){let r=this.hover;r===t||r&&t&&Ge(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(He(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return Q(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let o=r.shapes.findIndex(i=>i.item&&!i.item.legend&&H(i.item,t));return o<0?!1:(this.getSvgElement()?.focus(),this.focused=o,!0)}export(t){let r=this.layout;return r?mt(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,o){this.join();let i=je(Be(t),this.sized());if(this.layout=i,i.issues!==this.reported){this.reported=i.issues;for(let x of i.issues??[])this.emit("skdx-data-issue",x)}let a=this.canZoom(i),s=this.canPan(i),l=this.canEdit(i),c=this.brushing(),u=a||s||l||c,m=!i.decorative&&$e(i).length>0,b=i.description?`${r}-desc`:void 0,$=vt(i),C=gt(i,this.accessibleTable),S=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||o,f=this.portal;return p.html`<svg
1
+ "use strict";var he=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var an=Object.prototype.hasOwnProperty;var sn=(e,n)=>{for(var t in n)he(e,t,{get:n[t],enumerable:!0})},ln=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of on(n))!an.call(e,o)&&o!==t&&he(e,o,{get:()=>n[o],enumerable:!(r=At(n,o))||r.enumerable});return e};var cn=e=>ln(he({},"__esModule",{value:!0}),e),d=(e,n,t,r)=>{for(var o=r>1?void 0:r?At(n,t):n,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(n,t,o):a(o))||o);return r&&o&&he(n,t,o),o};var In={};sn(In,{SkdxSunburstChart:()=>z});module.exports=cn(In);var N=require("lit/decorators.js");var Ot=e=>Number(e.toPrecision(12)),dn,un=e=>(dn??(dn=new Intl.NumberFormat)).format(Ot(e)),hn=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),o=Math.floor(n%3600/60),i=a=>String(a).padStart(2,"0");return r>0?`${t}${r}h ${i(o)}m`:o>0?`${t}${o}m ${i(n%60)}s`:`${t}${n}s`};function Lt(e){if(e===void 0)return un;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:o="",timeZone:i}=e,a=u=>o?m=>u(m)+o:u,s=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let m=new Intl.NumberFormat(t,u);return a(b=>m.format(Ot(b)))},c=u=>{let m=new Intl.DateTimeFormat(t,i?{...u,timeZone:i}:u);return b=>m.format(b)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(s(2));case"percent":return l({style:"percent",...s(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...s()});case"compact":return l({notation:"compact",...s(1)});case"scientific":return l({notation:"scientific",...s(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return a(hn)}}var y=e=>Number(e.toFixed(2)),fe=e=>typeof e=="number"&&Number.isFinite(e);function ze(e){let n=1/0,t=-1/0;for(let r of e)fe(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}var ee=1e3,te=60*ee,ne=60*te,me=24*ne,Ln=[ee,5*ee,15*ee,30*ee,te,5*te,15*te,30*te,ne,3*ne,6*ne,12*ne,me,2*me,7*me,14*me];var mn=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,fn=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,pn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function bn(e,n,t){return e.replace(fn,(r,o,i)=>{let a=pn[o];if(a===void 0)return o+i;let l=(i.match(mn)??[]).map((c,u)=>{let m=Number(c);if(a===-1)return String(m+n);if(a===-2)return String(m+t);let b=u%a;return a===7?b===5?String(m+n):b===6?String(m+t):c:String(b%2===0?m+n:m+t)});return o+l.join(" ")})}var zt=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:bn(r.d,n,t)}}});var Ne=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),M={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"};var Nt=(e,n)=>n??Ne[e%Ne.length];function re(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Pt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var pe=20,gn=120,Rt=e=>{let n=re(e);return n&&(n.position==="left"||n.position==="right")?n.width??gn:0},oe=(e,n=600,t=300)=>({width:(e.width??n)-Rt(e),height:(e.height??t)-(re(e)?.position==="bottom"?pe:0)}),be=(e,n,t)=>{let r=re(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Bt(n,t??oe(e).width,r)):1)*pe},B=6.5,ie=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Nt(n)),Re=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Pe(e,n,t=[],r={},o=10,i=8,a=!1){let s=[],l=r.maxItems,c=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,u=e.length-c.length,m=r.interactive??!0,b=i,$=o,C=(S,p,x,k)=>{let A=(p?18:4)+S.length*B;b>i&&(a||b+A>n-8)&&(b=i,$+=pe),p&&s.push({kind:"rect",part:"legend-swatch",x:b,y:$-5,width:10,height:10,fill:p,opacity:k?.3:void 0,item:x}),s.push({kind:"text",part:"legend-label",x:b+(p?14:0),y:$,text:S,baseline:"middle",fill:k?M.grid:M.label,item:x}),b+=A+12};for(let S of c){let p=t.includes(S.name),x=m?{label:S.name,series:S.name,legend:!0}:void 0;C(r.formatter?.(S.name)??S.name,S.color,x,p)}return u>0&&C(`+${u} more`,void 0,void 0,!1),r.align==="end"?xn(s,n):s}function xn(e,n){let t=new Map;for(let o of e){let i=o.kind==="rect"?o.y+5:o.y;t.set(i,[...t.get(i)??[],o])}let r=[];for(let o of t.values()){let i=Math.max(...o.map(s=>s.kind==="rect"?s.x+s.width:s.x+s.text.length*B)),a=n-8-i;for(let s of o)r.push({...s,x:s.x+a})}return r}var Bt=(e,n,t={})=>new Set(Pe(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function ge(e,n,t,r=[]){let o=re(e),i=o&&e.direction==="rtl"&&o.align===void 0?{...o,align:"end"}:o,a=Pt(e),s=i?.position==="bottom",l=Rt(e),c=e.hiddenSeries??[],u=i?l?Pe(r,1/0,c,i,10,(i.position==="right"?n:0)+8,!0):Pe(r,n,c,i,s?t+10:10):[],m=s?Bt(r,n,i):0;return{width:n+l,height:s?t+Math.max(1,m)*pe:t,legendOffset:i?.position==="left"?l:void 0,tooltip:a.enabled,tooltipFormatter:a.formatter,axisTooltipFormatter:a.axisFormatter,tooltipPortal:a.portal,tooltipPlacement:a.placement,tooltipAnchored:a.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function Be(e){let n=e.legendOffset;if(!n)return e;let t=[...zt(e.shapes.filter(l=>!l.part.startsWith("legend-")),n,0),...e.shapes.filter(l=>l.part.startsWith("legend-"))],r=l=>({...l,x:l.x+n}),o=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(l=>l+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,i=e.edit,a=i?{...i,scale:l=>i.scale(l)+n,invert:l=>i.invert(l-n),bars:i.bars.map(l=>({...l,x0:l.x0+n,x1:l.x1+n}))}:void 0,s=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:o,edit:a,map:s,legendOffset:void 0}}function xe(e,n,t,r,o,i="auto"){let a=Array.isArray(t)?t:[t],s=Math.max(...a.map(b=>b.length))*B+12,l=6+a.length*16,c=i==="top"?{x:e-s/2,y:n-l-8}:i==="bottom"?{x:e-s/2,y:n+8}:i==="left"?{x:e-s-8,y:n-l/2}:i==="right"?{x:e+8,y:n-l/2}:{x:e+12,y:n-l-6},u=Math.max(0,Math.min(r-s,c.x)),m=Math.max(0,Math.min(o-l,c.y));return[{kind:"rect",part:"tooltip",x:y(u),y:y(m),width:y(s),height:l,fill:"var(--skdx-color-surface-raised)",stroke:M.axis,rx:3},...a.map((b,$)=>({kind:"text",part:"tooltip-label",x:y(u+6),y:y(m+11+$*16),text:b,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:a.length>1&&$===0?"bold":void 0}))]}function De(e,n,t,r){let o=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!o)return null;let{width:i,height:a}=oe(e,t,r),s=o==="error"?e.error:o==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return o==="loading"&&l.push({kind:"rect",part:"skeleton",x:0,y:0,width:i,height:a,fill:"var(--skdx-color-surface-sunken)",rx:4}),l.push({kind:"text",part:`state-${o}`,x:y(i/2),y:y(a/2),text:s,anchor:"middle",baseline:"middle",fill:o==="error"?"var(--skdx-color-text-danger)":M.label}),{...ge(e,i,a),shapes:l,tooltip:!1}}var K=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:M.label,...r});var ae=e=>Math.max(0,Math.min(1,e));function Dt(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],o=r.length===3?r.split("").map(i=>i+i).join(""):r;return[0,2,4].map(i=>parseInt(o.slice(i,i+2),16))}let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:void 0}function Ft(e,n){if(e.length===0)return M.axis;if(e.length===1)return e[0];let t=ae(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),o=t-r,i=Dt(e[r]),a=Dt(e[r+1]);if(!i||!a)return e[Math.round(t)];let s=l=>Math.round(i[l]+(a[l]-i[l])*o);return`rgb(${s(0)}, ${s(1)}, ${s(2)})`}var Gt=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(ae(e)*n))/(n-1):ae(e);function Ht(e,n,t,r=M.negative,o=String){let[i,a]=ze(n),s=e??{type:"sequential"},l=p=>y(.15+.85*p);if(s.type==="threshold"){let{thresholds:p,colors:x,labels:k}=s,A=P=>{if(typeof P!="number"||!Number.isFinite(P))return;let I=0;for(;I<p.length&&P>=p[I];)I++;return{fill:x[Math.min(I,x.length-1)]??t,opacity:1}},E=x.map((P,I)=>({fill:P,opacity:1,label:k?.[I]??(I===0?`< ${o(p[0]??0)}`:I===p.length?`\u2265 ${o(p[I-1])}`:`${o(p[I-1])} \u2013 ${o(p[I])}`)}));return{color:A,domain:[i,a],swatches:E,kind:"threshold"}}if(s.type==="ordinal"){let p=s.colors?.length?s.colors:[t];return{color:k=>typeof k=="number"&&Number.isFinite(k)?{fill:p[Math.abs(Math.round(k))%p.length],opacity:1}:void 0,domain:[i,a],swatches:p.map((k,A)=>({fill:k,opacity:1,label:String(A)})),kind:"ordinal"}}if(s.type==="diverging"){let[p,x,k]=s.domain??[-Math.max(Math.abs(i),Math.abs(a)),0,Math.max(Math.abs(i),Math.abs(a))],A=s.colors,E=T=>T<x?.5*(T-p)/Math.max(1e-12,x-p):.5+.5*(T-x)/Math.max(1e-12,k-x),P=T=>{let G=Gt(s.reversed?1-ae(T):T,s.steps);if(A&&A.length>=2)return{fill:Ft(A,G),opacity:1};let D=G<.5?r:t,O=Math.abs(G-.5)*2;return{fill:D,opacity:l(O)}},I=T=>typeof T=="number"&&Number.isFinite(T)?P(E(T)):void 0,V=s.steps??5,W=Array.from({length:V},(T,G)=>{let D=V===1?.5:G/(V-1),O=D<.5?p+(x-p)*(D*2):x+(k-x)*((D-.5)*2);return{...P(D),label:o(O)}});return{color:I,domain:[p,k],swatches:W,kind:"diverging"}}let[c,u]=s.domain??[i,a],m=s.colors,b=p=>{let x=Gt(s.reversed?1-ae(p):p,s.steps);return m&&m.length>=2?{fill:Ft(m,x),opacity:1}:{fill:m?.[0]??t,opacity:l(x)}},$=p=>typeof p!="number"||!Number.isFinite(p)?void 0:b(u===c?1:(p-c)/(u-c)),C=s.steps??5,S=Array.from({length:C},(p,x)=>{let k=C===1?1:x/(C-1);return{...b(k),label:o(c+(u-c)*k)}});return{color:$,domain:[c,u],swatches:S,kind:"sequential"}}function ye(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Fe=e=>e.id??e.name??e.series,jt=e=>e.seriesId??e.series;function H(e,n){let t=!1;return n.id!==void 0&&(t=!0,Fe(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,jt(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}function _(e){let n={},t=Fe(e);t!==void 0&&(n.id=t);let r=jt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ge=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function He(e,n,t){let r=ye(e),o=_(n),i=r.some(a=>H(n,a));return t==="single"?i?[]:[o]:i?r.filter(a=>!H(n,a)):[...r,o]}var yn=.2;function vn(e){let n=M.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var Mn=(e,n)=>e.kind==="text"?{...e,fill:M.grid}:{...e,opacity:(e.opacity??1)*n};function je(e,n){let t=ye(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:ye(n.highlighted),o=r[0];if(t.length===0&&!o)return e;let i={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},a=[],s=u=>!o||r.some(m=>H(u,m))?!0:i.highlighted==="series"?r.some(m=>m.series!==void 0&&H(u,{series:m.series})):!1,l=u=>{if(!o||i.faded==="none"||s(u))return!1;if(i.faded==="series"){let m=o.series;return m!==void 0&&H(u,{series:m})}return!0},c=e.shapes.map(u=>{let m=u.item;if(!m||m.legend)return u;if(t.some(b=>H(m,b))){let b=vn(u);b&&a.push(b)}return l(m)?Mn(u,yn):u});return a.length?{...e,shapes:[...c,...a]}:{...e,shapes:c}}var Vt=2*Math.PI;function ve(e,n,t,r,o,i){let a=(c,u)=>`${y(e+c*Math.sin(u))} ${y(n-c*Math.cos(u))}`;if(i-o>=Vt-1e-9){let c=o+Vt/2;return`${ve(e,n,t,r,o,c)}${ve(e,n,t,r,c,i)}`}let s=i-o>Math.PI?1:0,l=`M${a(t,o)}A${t} ${t} 0 ${s} 1 ${a(t,i)}`;return r>0?`${l}L${a(r,i)}A${r} ${r} 0 ${s} 0 ${a(r,o)}Z`:`${l}L${y(e)} ${y(n)}Z`}function Q(e,n,t,r,o){let i=e.getBoundingClientRect();return{x:i.width?(n-i.left)*r/i.width:n,y:i.height?(t-i.top)*o/i.height:t}}var Ve=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function _t(e,n){let t=0,r=1/0;return e.xs.forEach((o,i)=>{let a=Math.abs(o-n);a<r&&(r=a,t=i)}),t}function se(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=_t(t,n),o=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(o,r)??o}}function _e(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[_t(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:M.axis,dash:"3 3"}}function Ze(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Ve(r.plot,n,t))return[];let o=_e(e,n),{rows:i}=se(e,n),a=e.tooltipAnchored?r.plot.y+8:t;return[o,...xe(o.x1,a,i,e.width,e.height,e.tooltipPlacement)]}function Ee(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(i=>i[0]===n);if(r<0)return[];let o=t.xs[r];return Ze(e,o,t.plot.y+8)}function We(e,n,t,r,o){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=Q(t,r,o,e.width,e.height);if(Ve(e.hit.plot,l,c)){let u=se(e,l),m=_e(e,l);if(u&&m)return{lines:u.rows,shapes:[m]}}}let i=n?.closest?.("[data-skdx-part]"),a=e.tooltipFormatter?Z(e,n)?.item:void 0,s=a&&e.tooltipFormatter?.(a)||i&&Array.from(i.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return s?{lines:Array.isArray(s)?s:[s],shapes:[]}:{lines:[],shapes:[]}}function Zt(e,n,t,r,o,i,a){let s=e?.closest?.("[data-skdx-part]"),l=a&&a.tooltipFormatter?Z(a,e)?.item:void 0,c=l&&a?.tooltipFormatter?.(l)||s&&Array.from(s.children).find(C=>C.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let u=a?.tooltipAnchored?Z(a,e):void 0,m=u?a?.shapes[u.index]:void 0,{x:b,y:$}=m?le(m):Q(n,t,r,o,i);return xe(b,$,c,o,i,a?.tooltipPlacement)}function Ue(e,n,t,r,o){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:i,y:a}=Q(t,r,o,e.width,e.height),s=Ze(e,i,a);if(s.length>0)return s}return Zt(n,t,r,o,e.width,e.height,e)}function qe(e,n){let t=Z(e,n);return t&&!t.item.legend?_(t.item):null}var wn=(e,n)=>{let{x:t,y:r}=le(e),o=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&o>=n.y&&o<=n.y+n.height};function Ke(e,n){let t=new Set,r=[];for(let o of e.shapes){if(!o.item||o.item.legend||o.part==="anchor"||!wn(o,n))continue;let i=_(o.item),a=JSON.stringify(i);t.has(a)||(t.add(a),r.push(i))}return r}var Ye=e=>({kind:"rect",part:"selection-box",x:y(e.x),y:y(e.y),width:y(e.width),height:y(e.height),fill:M.focus,opacity:.12,stroke:M.focus}),we=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function Et(e,n,t){let r=!1;for(let o=0,i=e.length-1;o<e.length;i=o++){let a=e[o],s=e[i];a.y>t!=s.y>t&&n<(s.x-a.x)*(t-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function Xe(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let o of e.shapes){if(!o.item||o.item.legend||o.part==="anchor")continue;let{x:i,y:a}=le(o),s=o.kind==="circle"?o.cy:o.kind==="rect"?o.y+o.height/2:a;if(!Et(n,i,s))continue;let l=_(o.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Qe=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${y(n.x)} ${y(n.y)}`).join("L")}`:"",fill:M.focus,fillOpacity:.12,stroke:M.focus,dash:"4 3"}),Me=6;function Je(e,n,t){let r=e.edit;if(r){for(let o of r.bars)if(!(t<o.y||t>o.y+o.height||n<o.x0-Me||n>o.x1+Me))return Math.abs(n-o.x0)<=Me?{bar:o,mode:"start"}:Math.abs(n-o.x1)<=Me?{bar:o,mode:"end"}:{bar:o,mode:"move"}}}function et(e,n,t){let r=e.edit;return Wt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function tt(e,n,t){let r=e.edit,o=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!o||!(t.shiftKey||t.altKey))return;let i=r.bars.find(l=>l.index===n);if(!i)return;let a=t.altKey?t.shiftKey?"start":"end":"move",s=r.snap??r.invert(i.x0+10)-r.invert(i.x0);return Wt(r,{bar:i,mode:a},o*s)}function Wt(e,{bar:n,mode:t},r){let o=s=>e.snap?Math.round(s/e.snap)*e.snap:s,i=n.start,a=n.end;return t==="move"?(i=o(n.start+r),a=i+(n.end-n.start)):t==="start"?i=Math.min(o(n.start+r),n.end):a=Math.max(o(n.end+r),n.start),{id:n.id,name:n.name,start:i,end:a}}function nt(e,n,t){let r=e.edit,o=r.scale(t.start),i=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:y(Math.min(o,i)),y:y(n.bar.y),width:y(Math.max(1,Math.abs(i-o))),height:y(n.bar.height),fill:M.focus,opacity:.25,stroke:M.focus,rx:2}}var $n=64,kn=e=>Math.max(1,Math.min($n,e));function rt(e,n,t,r){let o=n>0?.8:1.25,i=kn(e.view.zoom*o);if(i===e.view.zoom)return e.view;let{plot:a,scale:s}=e,[l,c]=e.view.center,u=(t-(a.x+a.width/2))/s,m=(r-(a.y+a.height/2))/s,b=e.view.zoom/i;return{center:[l+u*(1-b),e.fromY(e.toY(c)-m*(1-b))],zoom:i}}function ot(e,n,t,r){let{scale:o}=e;return{center:[n.center[0]-t/o,e.fromY(e.toY(n.center[1])+r/o)],zoom:n.zoom}}function Z(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),o=Number.isInteger(r)?e.shapes[r]?.item:void 0;return o?{index:r,item:o}:void 0}var $e=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function le(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function it(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=M.focus,o;switch(t.kind){case"rect":o={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":o={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":o={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":o={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*B+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":o={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:i,y:a}=le(t),s=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[o,...s?xe(y(i),y(a),s,e.width,e.height):[]]}function at(e,n,t){let r=$e(e);if(r.length===0)return;let o=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,o+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,o<=0?0:o-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var Y=2,X=(e,n,t)=>{let r=Math.max(Y,Math.min(t,Math.round(n))),o=Math.max(0,Math.min(t-r,Math.round(e)));return{start:o,end:o+r}},Ut=(e,n)=>!e||e.start<=0&&e.end>=n;function st(e,n,t){if(e.count<=Y||!e.plot.width)return;let{start:r,end:o}=e.zoom,i=o-r,a=n>0?1.25:.8,s=Math.max(Y,Math.min(e.count,Math.round(i*a)));if(s===i)return n>0&&!Ut(e.zoom,e.count)?X(r,s,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+l*i;return X(c-l*s,s,e.count)}function lt(e,n,t,r){let o=n.end-n.start,i=Math.max(Y,Math.min(e.count,Math.round(o/Math.max(.05,t)))),a=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return X(n.start+a*o-a*i,i,e.count)}function ct(e,n,t){let r=n.end-n.start,o=e.plot.width/Math.max(1,r);return X(n.start-t/o,r,e.count)}function dt(e,n,t){let r=e.brush;if(!r||!Ve(r.box,n,t))return;let o=r.window;if(Math.abs(n-o.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(o.x+o.width))<=6)return{grab:"right",zoom:e.zoom};if(n>o.x&&n<o.x+o.width)return{grab:"move",zoom:e.zoom};let i=e.zoom.end-e.zoom.start,a=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:X(a-i/2,i,e.count)}}function ut(e,n,t,r){let o=e.brush;if(!o)return t;let i=r/Math.max(1,o.box.width)*e.count;if(n==="move")return X(t.start+i,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-Y,Math.round(t.start+i))),end:t.end};let a=Math.min(e.count,Math.max(t.start+Y,Math.round(t.end+i)));return{start:t.start,end:a}}function mt(e,n){switch(n.type){case"svg":return Promise.resolve(ht(e,n.label,n.resolve));case"csv":return Promise.resolve(Xt(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=ht(e,n.label,n.resolve);return Yt(t,e.width,e.height,n.scale,n.background)}}}var j=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),ce=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${j(String(t))}"`).join("");function qt(e){let n=e.title?`<title>${j(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${ce([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${ce([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${ce([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${ce([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${ce([t,["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${j(e.text)}</text>`}}function Kt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${j(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${j(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function ht(e,n,t){let r=Kt(e)+e.shapes.map(qt).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(o,i)=>t(i).trim()||o)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${j(n)}" font-family="${j(M.fontFamily)}" font-size="${j(M.fontSize)}"><title>${j(n)}</title>${r}</svg>`}function Yt(e,n,t,r=2,o){return new Promise((i,a)=>{let s=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(s);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let u=c.getContext("2d");if(!u)return a(new Error("canvas 2d context unavailable"));o&&(u.fillStyle=o,u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),c.toBlob(m=>m?i(m):a(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(s),a(new Error("svg could not be decoded"))},l.src=s})}function Xt(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
2
+ `)}var F=e=>fe(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+F(t),0);var ft=e=>e.length===0?0:1+Math.max(...e.map(n=>ft(n.children??[]))),de=e=>e.id??e.name;function Qt(e,n){for(let t of e){if(de(t)===n||t.name===n)return[t];let r=Qt(t.children??[],n);if(r)return[t,...r]}}var pt=(e,n)=>n==="asc"||n==="desc"?[...e].sort((t,r)=>n==="asc"?F(t)-F(r):F(r)-F(t)):[...e];function ke(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:F(r),children:void 0}:{...r,children:r.children?ke(r.children,n,t+1):void 0})}function bt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Qt(e,n);if(!t)return{nodes:[...e],path:[]};let r=t[t.length-1];return{nodes:r.children?.length?r.children:[r],path:t}}function gt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let s=r.rows[0];if(r.rows.length>t)return;let l=["",...s.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],c=r.rows.map(u=>[u[0],...u.slice(1).map(m=>m.slice(m.lastIndexOf(": ")+2))]);return[l,...c]}let o=e.shapes.flatMap(s=>s.item&&!s.item.legend&&!(s.part==="anchor"&&!s.title)?[s.item]:[]);if(o.length===0||o.length>t)return;let i=["series","name","category","value"].filter(s=>o.some(l=>l[s]!==void 0)),a=(s,l)=>s[l]===void 0?"":String(s[l]);return[i.map(s=>s[0]?.toUpperCase()+s.slice(1)),...o.map(s=>i.map(l=>a(s,l)))]}var xt=new Map;function Ce(e){let n=xt.get(e);if(n)return n.group;let t=new Set,r={},o={current:r,subscribe(i){return t.add(i),()=>{t.delete(i),t.size===0&&xt.delete(e)}},publish(i,a){Object.assign(r,i);for(let s of t)s(i,a)}};return xt.set(e,{group:o,listeners:t}),o}var Jt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',yt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Jt}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${Jt}{animation:none;transition:none}}`;function vt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Mt(e,n,t){let r=[],o=n;return e.forEach((i,a)=>{a>0&&(r.push(K(y(o),t,"\u203A",{part:"breadcrumb-separator",baseline:"middle"})),o+=B+6),r.push(K(y(o),t,i.name,{part:"breadcrumb",baseline:"middle",fill:"var(--skdx-color-text-default)",title:i.name,item:{label:i.name,id:de(i),name:i.name}})),o+=i.name.length*B+6}),r}var wt=e=>e*Math.PI/180;function $t(e){let{nodes:n,path:t}=bt(e.data,e.rootId),r=ke(n,e.maxDepth),o=De(e,!r.some(O=>F(O)>0),300,300);if(o)return o;let i=Lt(e.format),{width:a,height:s}=oe(e,300,300),l=Math.min(.9,Math.max(0,e.innerRadius??0)),c=e.breadcrumbs&&t.length>0,u=c&&l===0,m=be(e)+(u?20:0),b=a/2,$=m+(s-m)/2,C=Math.max(0,Math.min(a,s-m)/2-8),S=C*l,p=(C-S)/Math.max(1,ft(r)),x=wt(e.startAngle??0),k=wt(e.endAngle??(e.startAngle??0)+360),A=Math.max(0,wt(e.padAngle??0)),E=e.sort??"none",P=[],I=O=>{for(let R of O)R.children?.length?I(R.children):P.push(F(R))};I(r);let V=e.colorScale?Ht(e.colorScale,P,ie(e,0),void 0,i):void 0,W=[],T=[],G=(O,R,Ie,en,tn)=>{let Te=L=>R===0&&Re(e,L.name)?0:Math.max(0,F(L)),Ae=pt(O,E),kt=Ae.reduce((L,U)=>L+Te(U),0),nn=Math.max(0,Ae.filter(L=>Te(L)>0).length-1),rn=Math.max(0,en-nn*A),J=Ie;Ae.forEach(L=>{let U=Te(L),q=kt>0?U/kt*rn:0,Oe=!((L.children?.length??0)>0)&&V?V.color(U):void 0,Ct=Oe?.fill??L.color??tn??ie(e,O.indexOf(L));if(q>0){let ue=S+p*R,Le=ue+p;if(e.labels&&q*((ue+Le)/2)>L.name.length*B+4){let It=J+q/2,Tt=(ue+Le)/2;T.push(K(y(b+Tt*Math.sin(It)),y($-Tt*Math.cos(It)),L.name,{part:"arc-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}let St=`${L.name}: ${i(U)}`;W.push({kind:"path",part:"arc",d:ve(b,$,Le,ue,J,J+q),fill:Ct,opacity:Oe?Oe.opacity:1-R*.2,stroke:"var(--skdx-color-surface-default)",title:St,item:{label:St,id:de(L),name:L.name,value:U}}),G(L.children??[],R+1,J,q,Ct),J+=q+A}})};if(G(r,0,x,Math.max(0,Math.min(2*Math.PI,k-x)),void 0),e.centerLabel&&T.push(K(y(b),y(c&&!u?$-8:$),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),c){let O=t.reduce((R,Ie)=>R+Ie.name.length*B+6,0)+(t.length-1)*(B+6);T.push(...u?Mt(t,8,be(e)+10):Mt(t,b-O/2,e.centerLabel?$+8:$))}let D=ge(e,a,s,r.map((O,R)=>({name:O.name,color:ie(e,R,O.color)})));return{...D,shapes:[...W,...T,...D.shapes]}}var f=require("lit"),h=require("lit/decorators.js"),v=require("lit/directives/if-defined.js");var Cn={fromAttribute:()=>!1},g=class extends f.LitElement{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let o=this.drag;if(o?.grab==="select"){let{x:i,y:a}=this.viewBox(t,r);this.overlay=[Ye(we(o.x,o.y,i,a))];return}if(o?.grab==="lasso"){let{x:i,y:a}=this.viewBox(t,r);o.points=[...o.points??[],{x:i,y:a}],this.overlay=[Qe(o.points)];return}if(o?.grab==="edit"){if(!o.gantt)return;let{x:i}=this.viewBox(t,r);o.change=et(r,o.gantt,i-o.x),this.overlay=[nt(r,o.gantt,o.change)];return}if(o?.grab==="map"){if(!r.map||!o.view)return;let{x:i,y:a}=this.viewBox(t,r);this.setView(ot(r.map,o.view,i-o.x,a-o.y));return}if(o&&r.hit){if(o.grab==="pinch"){let[a,s]=[...this.pointers.values()];if(a===void 0||s===void 0||!o.distance)return;this.setZoom(lt(r.hit,o.zoom,Math.abs(a-s)/o.distance,(a+s)/2));return}let{x:i}=this.viewBox(t,r);this.setZoom(o.grab==="pan"?ct(r.hit,o.zoom,i-o.x):ut(r.hit,o.grab,o.zoom,i-o.x));return}if(r.tooltipPortal){let{lines:i,shapes:a}=We(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=a,this.portal=i.length?{x:t.clientX,y:t.clientY,lines:i}:null}else{let i=Ue(r,t.target,t.currentTarget,t.clientX,t.clientY);(i.length>0||this.tip.length>0)&&(this.tip=i)}if(this.highlight(qe(r,t.target)),this.syncId&&r.hit?.crosshair){let i=se(r,this.viewBox(t,r).x);this.shareCrosshair(i?r.hit.rows[i.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:o,y:i}=this.viewBox(t,r),a=Z(r,t.target)?.item.legend,s=this.canEdit(r)?Je(r,o,i):void 0;if(s){this.drag={x:o,y:i,zoom:{start:0,end:0},grab:"edit",gantt:s},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!a){this.drag={x:o,y:i,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:o,y:i}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(o<c.x||o>c.x+c.width||i<c.y||i>c.y+c.height)return;this.drag={x:o,y:i,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let l=r.hit;if(!(!l||!this.canZoom(r))){if(this.pointers.set(t.pointerId,o),this.pointers.size===2){let[c,u]=[...this.pointers.values()];this.drag={x:(c+u)/2,y:i,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-u)||1}}else{let c=dt(l,o,i);if(c)this.drag={x:o,y:i,zoom:c.zoom,grab:c.grab},c.zoom!==l.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&o>=l.plot.x&&o<=l.plot.x+l.plot.width&&i>=l.plot.y&&i<=l.plot.y+l.plot.height)this.drag={x:o,y:i,zoom:l.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let o=this.drag,i=this.layout;if(i&&(o?.grab==="select"||o?.grab==="lasso"||o?.grab==="edit"||o?.grab==="map")){this.overlay=[];let{x:a,y:s}=this.viewBox(t,i);if(Math.abs(a-o.x)>2||Math.abs(s-o.y)>2){o.grab==="select"?this.setSelected(Ke(i,we(o.x,o.y,a,s))):o.grab==="lasso"?this.setSelected(Xe(i,o.points??[])):o.grab==="edit"&&o.change&&this.emit("skdx-task-change",o.change),this.drag={...o,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:o,y:i}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(o<l.x||o>l.x+l.width||i<l.y||i>l.y+l.height)return;t.preventDefault(),this.setView(rt(r.map,t.deltaY,o,i));return}let a=r.hit;if(!a||!this.canZoom(r)||i<a.plot.y||i>a.plot.y+a.plot.height)return;let s=st(a,t.deltaY,o);s&&(t.preventDefault(),this.setZoom(s))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=Z(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let s=r.shapes[this.focused]?.item;s&&(t.preventDefault(),this.select(s),this.emit("skdx-item-click",s));return}let o=this.canEdit(r)?tt(r,this.focused,t):void 0;if(o){t.preventDefault(),this.emit("skdx-task-change",o);return}let i=at(r,this.focused,t.key);if(i===void 0)return;t.preventDefault(),this.focused=i;let a=i===null?void 0:r.shapes[i]?.item;this.highlight(a?_(a):null)}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:o,tooltip:i,format:a,palette:s,loading:l,error:c,emptyMessage:u,description:m,decorative:b,animated:$,responsive:C,highlighted:S,highlightScope:p,accessibleTable:x}=this;return{...typeof C=="object"&&this.measured!==void 0&&this.measured<(C.breakpoint??480)?C.compact:void 0,width:C&&this.measured?this.measured:t,height:r,animate:$,responsive:C,legend:o,tooltip:i,format:a,palette:s,loading:l,error:c,emptyMessage:u,description:m,decorative:b,highlighted:S===void 0?this.highlightState:S,highlightScope:p,accessibleTable:x,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&Ce(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=Ce(this.syncId),r=o=>{"highlighted"in o&&(this.highlightState=o.highlighted??null),o.selected&&(this.selectedState=o.selected,this.crossFilter&&(this.highlightState=o.selected.length?o.selected:null)),"zoom"in o&&(this.zoomState=o.zoom),o.hiddenSeries&&(this.hiddenState=o.hiddenSeries),"crosshair"in o&&(this.crossState=o.crosshair??null)};r(t.current),this.leave=t.subscribe((o,i)=>{i!==this.token&&r(o)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,o=r.includes(t)?r.filter(i=>i!==t):[...r,t];this.hiddenState=o,this.emit("skdx-hidden-series-change",o),this.publish({hiddenSeries:o})}highlight(t){let r=this.hover;r===t||r&&t&&Ge(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(He(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return Q(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let o=r.shapes.findIndex(i=>i.item&&!i.item.legend&&H(i.item,t));return o<0?!1:(this.getSvgElement()?.focus(),this.focused=o,!0)}export(t){let r=this.layout;return r?mt(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,o){this.join();let i=je(Be(t),this.sized());if(this.layout=i,i.issues!==this.reported){this.reported=i.issues;for(let x of i.issues??[])this.emit("skdx-data-issue",x)}let a=this.canZoom(i),s=this.canPan(i),l=this.canEdit(i),c=this.brushing(),u=a||s||l||c,m=!i.decorative&&$e(i).length>0,b=i.description?`${r}-desc`:void 0,$=vt(i),C=gt(i,this.accessibleTable),S=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||o,p=this.portal;return f.html`<svg
3
3
  xmlns="http://www.w3.org/2000/svg"
4
4
  viewBox="0 0 ${i.width} ${i.height}"
5
5
  width=${i.width}
6
6
  height=${i.height}
7
7
  role=${i.decorative?"presentation":"img"}
8
- aria-hidden=${i.decorative?"true":p.nothing}
9
- aria-label=${i.decorative?p.nothing:o}
8
+ aria-hidden=${i.decorative?"true":f.nothing}
9
+ aria-label=${i.decorative?f.nothing:o}
10
10
  aria-describedby=${(0,v.ifDefined)(b)}
11
- tabindex=${m?0:p.nothing}
11
+ tabindex=${m?0:f.nothing}
12
12
  data-skdx-chart=${r}
13
- data-zoomable=${a||s?"":p.nothing}
14
- data-brushing=${c&&!(a||s)?"":p.nothing}
15
- data-editable=${l?"":p.nothing}
16
- style=${$?`--skdx-chart-duration:${$}`:p.nothing}
13
+ data-zoomable=${a||s?"":f.nothing}
14
+ data-brushing=${c&&!(a||s)?"":f.nothing}
15
+ data-editable=${l?"":f.nothing}
16
+ style=${$?`--skdx-chart-duration:${$}`:f.nothing}
17
17
  font-family=${M.fontFamily}
18
18
  font-size=${M.fontSize}
19
- @pointermove=${i.tooltip||u?this.onPointerMove:p.nothing}
19
+ @pointermove=${i.tooltip||u?this.onPointerMove:f.nothing}
20
20
  @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
21
- @pointerdown=${u?this.onPointerDown:p.nothing}
22
- @pointerup=${u?this.onPointerUp:p.nothing}
23
- @pointercancel=${u?this.onPointerUp:p.nothing}
24
- @wheel=${a||s?this.onWheel:p.nothing}
25
- @dblclick=${a||s?()=>s?this.setView(void 0):this.setZoom(void 0):p.nothing}
21
+ @pointerdown=${u?this.onPointerDown:f.nothing}
22
+ @pointerup=${u?this.onPointerUp:f.nothing}
23
+ @pointercancel=${u?this.onPointerUp:f.nothing}
24
+ @wheel=${a||s?this.onWheel:f.nothing}
25
+ @dblclick=${a||s?()=>s?this.setView(void 0):this.setZoom(void 0):f.nothing}
26
26
  @click=${this.onClick}
27
- @keydown=${m?this.onKeyDown:p.nothing}
27
+ @keydown=${m?this.onKeyDown:f.nothing}
28
28
  @blur=${()=>{this.focused=null,this.highlight(null)}}
29
29
  >
30
30
  <title>${o}</title>
31
- ${i.description?p.svg`<desc id=${(0,v.ifDefined)(b)}>${i.description}</desc>`:p.nothing}
32
- ${$?p.svg`<style>${yt}</style>`:p.nothing} ${Sn(i)}
31
+ ${i.description?f.svg`<desc id=${(0,v.ifDefined)(b)}>${i.description}</desc>`:f.nothing}
32
+ ${$?f.svg`<style>${yt}</style>`:f.nothing} ${Sn(i)}
33
33
  ${Se(i.shapes)}
34
34
  ${Se(this.tip.length||!this.crossState?this.tip:Ee(i,this.crossState))}
35
35
  ${Se(it(i,this.focused))} ${Se(this.overlay)}
36
36
  </svg>
37
- ${f?p.html`<div
37
+ ${p?f.html`<div
38
38
  role="tooltip"
39
39
  data-skdx-tooltip=${r}
40
- style="left:${f.x+12}px;top:${f.y+12}px"
40
+ style="left:${p.x+12}px;top:${p.y+12}px"
41
41
  >
42
- ${f.lines.map(x=>p.html`<div>${x}</div>`)}
43
- </div>`:p.nothing}
44
- ${C?p.html`<table data-skdx-table=${r}>
42
+ ${p.lines.map(x=>f.html`<div>${x}</div>`)}
43
+ </div>`:f.nothing}
44
+ ${C?f.html`<table data-skdx-table=${r}>
45
45
  <caption>
46
46
  ${S}
47
47
  </caption>
48
48
  <thead>
49
49
  <tr>
50
- ${(C[0]??[]).map(x=>p.html`<th scope="col">${x}</th>`)}
50
+ ${(C[0]??[]).map(x=>f.html`<th scope="col">${x}</th>`)}
51
51
  </tr>
52
52
  </thead>
53
53
  <tbody>
54
- ${C.slice(1).map(x=>p.html`<tr>
55
- ${x.map((k,A)=>A===0?p.html`<th scope="row">${k}</th>`:p.html`<td>${k}</td>`)}
54
+ ${C.slice(1).map(x=>f.html`<tr>
55
+ ${x.map((k,A)=>A===0?f.html`<th scope="row">${k}</th>`:f.html`<td>${k}</td>`)}
56
56
  </tr>`)}
57
57
  </tbody>
58
- </table>`:p.nothing}`}};g.styles=p.css`
58
+ </table>`:f.nothing}`}};g.styles=f.css`
59
59
  :host {
60
60
  display: inline-block;
61
61
  }
@@ -106,4 +106,4 @@
106
106
  [role='tooltip'] > :first-child:not(:only-child) {
107
107
  font-weight: bold;
108
108
  }
109
- `,d([(0,h.property)({type:Number})],g.prototype,"width",2),d([(0,h.property)({type:Number})],g.prototype,"height",2),d([(0,h.property)()],g.prototype,"label",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"legend",2),d([(0,h.property)({type:Boolean,attribute:"no-tooltip",converter:Cn})],g.prototype,"tooltip",2),d([(0,h.property)({attribute:!1})],g.prototype,"format",2),d([(0,h.property)({attribute:!1})],g.prototype,"palette",2),d([(0,h.property)({attribute:!1})],g.prototype,"hiddenSeries",2),d([(0,h.property)({attribute:!1})],g.prototype,"selected",2),d([(0,h.property)({attribute:"selection-mode"})],g.prototype,"selectionMode",2),d([(0,h.property)({attribute:!1})],g.prototype,"highlighted",2),d([(0,h.property)({attribute:!1})],g.prototype,"highlightScope",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"loading",2),d([(0,h.property)()],g.prototype,"error",2),d([(0,h.property)({attribute:"empty-message"})],g.prototype,"emptyMessage",2),d([(0,h.property)()],g.prototype,"description",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"decorative",2),d([(0,h.property)({type:Boolean,attribute:"accessible-table"})],g.prototype,"accessibleTable",2),d([(0,h.property)({attribute:!1})],g.prototype,"zoom",2),d([(0,h.property)({attribute:!1})],g.prototype,"view",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"zoomable",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"editable",2),d([(0,h.property)({attribute:"sync-id"})],g.prototype,"syncId",2),d([(0,h.property)({type:Boolean,attribute:"cross-filter"})],g.prototype,"crossFilter",2),d([(0,h.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],g.prototype,"animated",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"responsive",2),d([(0,h.state)()],g.prototype,"tip",2),d([(0,h.state)()],g.prototype,"overlay",2),d([(0,h.state)()],g.prototype,"portal",2),d([(0,h.state)()],g.prototype,"measured",2),d([(0,h.state)()],g.prototype,"viewState",2),d([(0,h.state)()],g.prototype,"highlightState",2),d([(0,h.state)()],g.prototype,"crossState",2),d([(0,h.state)()],g.prototype,"focused",2),d([(0,h.state)()],g.prototype,"hiddenState",2),d([(0,h.state)()],g.prototype,"zoomState",2),d([(0,h.state)()],g.prototype,"selectedState",2);var w=class extends g{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:o,yAxis:i,rightAxis:a,references:s,annotations:l,labels:c,curve:u,connectNulls:m,nulls:b,stacked:$,stackOffset:C,orientation:S,radius:f,barGap:x,barWidth:k,sort:A,transform:E,transforms:P,bins:I,binWidth:V,binDomain:W,binMode:T,sampling:G,brush:D,crosshair:O}=this;return{...this.sized(),series:t,categories:r,xAxis:o,yAxis:i,rightAxis:a,references:s,annotations:l,labels:c,curve:u,connectNulls:m,nulls:b,stacked:$,stackOffset:C,orientation:S,radius:f,barGap:x,barWidth:k,sort:A,transform:E,transforms:P,bins:I,binWidth:V,binDomain:W,binMode:T,sampling:G,brush:D,crosshair:O}}};d([(0,h.property)({attribute:!1})],w.prototype,"series",2),d([(0,h.property)({attribute:!1})],w.prototype,"categories",2),d([(0,h.property)({attribute:!1})],w.prototype,"xAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"yAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"rightAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"references",2),d([(0,h.property)({attribute:!1})],w.prototype,"annotations",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"labels",2),d([(0,h.property)()],w.prototype,"curve",2),d([(0,h.property)({type:Boolean,attribute:"connect-nulls"})],w.prototype,"connectNulls",2),d([(0,h.property)()],w.prototype,"nulls",2),d([(0,h.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],w.prototype,"stacked",2),d([(0,h.property)({attribute:"stack-offset"})],w.prototype,"stackOffset",2),d([(0,h.property)()],w.prototype,"orientation",2),d([(0,h.property)({type:Number})],w.prototype,"radius",2),d([(0,h.property)({type:Number,attribute:"bar-gap"})],w.prototype,"barGap",2),d([(0,h.property)({type:Number,attribute:"bar-width"})],w.prototype,"barWidth",2),d([(0,h.property)()],w.prototype,"sort",2),d([(0,h.property)()],w.prototype,"transform",2),d([(0,h.property)({attribute:!1})],w.prototype,"transforms",2),d([(0,h.property)({type:Number})],w.prototype,"bins",2),d([(0,h.property)({type:Number,attribute:"bin-width"})],w.prototype,"binWidth",2),d([(0,h.property)({attribute:!1})],w.prototype,"binDomain",2),d([(0,h.property)({attribute:"bin-mode"})],w.prototype,"binMode",2),d([(0,h.property)({attribute:!1})],w.prototype,"sampling",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"brush",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"crosshair",2);var Sn=e=>e.defs&&e.defs.length?p.svg`<defs>${e.defs.map(n=>p.svg`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>p.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,v.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:p.nothing,Se=e=>p.svg`${e.map((n,t)=>{let r=n.title?p.svg`<title>${n.title}</title>`:p.nothing,o=n.item?t:void 0;switch(n.kind){case"path":return p.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,v.ifDefined)(n.stroke)} stroke-width=${(0,v.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,v.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,v.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,v.ifDefined)(n.dash)} opacity=${(0,v.ifDefined)(n.opacity)} fill-opacity=${(0,v.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return p.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,v.ifDefined)(n.rx)} fill=${n.fill} stroke=${(0,v.ifDefined)(n.stroke)} fill-opacity=${(0,v.ifDefined)(n.opacity)}>${r}</rect>`;case"line":return p.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,v.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,v.ifDefined)(n.dash)} opacity=${(0,v.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return p.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,v.ifDefined)(n.stroke)} opacity=${(0,v.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return p.svg`<text data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} x=${n.x} y=${n.y} text-anchor=${(0,v.ifDefined)(n.anchor)} dominant-baseline=${(0,v.ifDefined)(n.baseline)} fill=${(0,v.ifDefined)(n.fill)} font-weight=${(0,v.ifDefined)(n.weight)} pointer-events=${(0,v.ifDefined)(o===void 0?"none":void 0)} transform=${(0,v.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var z=class extends g{constructor(){super(...arguments);this.data=[];this.labels=!1;this.breadcrumbs=!1}render(){let{data:t,innerRadius:r,centerLabel:o,labels:i,rootId:a,breadcrumbs:s,maxDepth:l,sort:c,startAngle:u,endAngle:m,padAngle:b,colorScale:$}=this;return this.root($t({...this.sized(),data:t,innerRadius:r,centerLabel:o,labels:i,rootId:a,breadcrumbs:s,maxDepth:l,sort:c,startAngle:u,endAngle:m,padAngle:b,colorScale:$}),"sunburst",this.label??"Sunburst chart")}};d([(0,N.property)({attribute:!1})],z.prototype,"data",2),d([(0,N.property)({type:Number,attribute:"inner-radius"})],z.prototype,"innerRadius",2),d([(0,N.property)({attribute:"center-label"})],z.prototype,"centerLabel",2),d([(0,N.property)({type:Boolean,reflect:!0})],z.prototype,"labels",2),d([(0,N.property)({attribute:!1})],z.prototype,"rootId",2),d([(0,N.property)({type:Boolean,reflect:!0})],z.prototype,"breadcrumbs",2),d([(0,N.property)({type:Number,attribute:"max-depth"})],z.prototype,"maxDepth",2),d([(0,N.property)()],z.prototype,"sort",2),d([(0,N.property)({type:Number,attribute:"start-angle"})],z.prototype,"startAngle",2),d([(0,N.property)({type:Number,attribute:"end-angle"})],z.prototype,"endAngle",2),d([(0,N.property)({type:Number,attribute:"pad-angle"})],z.prototype,"padAngle",2),d([(0,N.property)({attribute:!1})],z.prototype,"colorScale",2),z=d([(0,N.customElement)("skdx-sunburst-chart")],z);0&&(module.exports={SkdxSunburstChart});
109
+ `,d([(0,h.property)({type:Number})],g.prototype,"width",2),d([(0,h.property)({type:Number})],g.prototype,"height",2),d([(0,h.property)()],g.prototype,"label",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"legend",2),d([(0,h.property)({type:Boolean,attribute:"no-tooltip",converter:Cn})],g.prototype,"tooltip",2),d([(0,h.property)({attribute:!1})],g.prototype,"format",2),d([(0,h.property)({attribute:!1})],g.prototype,"palette",2),d([(0,h.property)({attribute:!1})],g.prototype,"hiddenSeries",2),d([(0,h.property)({attribute:!1})],g.prototype,"selected",2),d([(0,h.property)({attribute:"selection-mode"})],g.prototype,"selectionMode",2),d([(0,h.property)({attribute:!1})],g.prototype,"highlighted",2),d([(0,h.property)({attribute:!1})],g.prototype,"highlightScope",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"loading",2),d([(0,h.property)()],g.prototype,"error",2),d([(0,h.property)({attribute:"empty-message"})],g.prototype,"emptyMessage",2),d([(0,h.property)()],g.prototype,"description",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"decorative",2),d([(0,h.property)({type:Boolean,attribute:"accessible-table"})],g.prototype,"accessibleTable",2),d([(0,h.property)({attribute:!1})],g.prototype,"zoom",2),d([(0,h.property)({attribute:!1})],g.prototype,"view",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"zoomable",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"editable",2),d([(0,h.property)({attribute:"sync-id"})],g.prototype,"syncId",2),d([(0,h.property)({type:Boolean,attribute:"cross-filter"})],g.prototype,"crossFilter",2),d([(0,h.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],g.prototype,"animated",2),d([(0,h.property)({type:Boolean,reflect:!0})],g.prototype,"responsive",2),d([(0,h.state)()],g.prototype,"tip",2),d([(0,h.state)()],g.prototype,"overlay",2),d([(0,h.state)()],g.prototype,"portal",2),d([(0,h.state)()],g.prototype,"measured",2),d([(0,h.state)()],g.prototype,"viewState",2),d([(0,h.state)()],g.prototype,"highlightState",2),d([(0,h.state)()],g.prototype,"crossState",2),d([(0,h.state)()],g.prototype,"focused",2),d([(0,h.state)()],g.prototype,"hiddenState",2),d([(0,h.state)()],g.prototype,"zoomState",2),d([(0,h.state)()],g.prototype,"selectedState",2);var w=class extends g{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:o,yAxis:i,rightAxis:a,references:s,annotations:l,labels:c,curve:u,connectNulls:m,nulls:b,stacked:$,stackOffset:C,orientation:S,radius:p,barGap:x,barWidth:k,sort:A,transform:E,transforms:P,bins:I,binWidth:V,binDomain:W,binMode:T,sampling:G,brush:D,crosshair:O}=this;return{...this.sized(),series:t,categories:r,xAxis:o,yAxis:i,rightAxis:a,references:s,annotations:l,labels:c,curve:u,connectNulls:m,nulls:b,stacked:$,stackOffset:C,orientation:S,radius:p,barGap:x,barWidth:k,sort:A,transform:E,transforms:P,bins:I,binWidth:V,binDomain:W,binMode:T,sampling:G,brush:D,crosshair:O}}};d([(0,h.property)({attribute:!1})],w.prototype,"series",2),d([(0,h.property)({attribute:!1})],w.prototype,"categories",2),d([(0,h.property)({attribute:!1})],w.prototype,"xAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"yAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"rightAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"references",2),d([(0,h.property)({attribute:!1})],w.prototype,"annotations",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"labels",2),d([(0,h.property)()],w.prototype,"curve",2),d([(0,h.property)({type:Boolean,attribute:"connect-nulls"})],w.prototype,"connectNulls",2),d([(0,h.property)()],w.prototype,"nulls",2),d([(0,h.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],w.prototype,"stacked",2),d([(0,h.property)({attribute:"stack-offset"})],w.prototype,"stackOffset",2),d([(0,h.property)()],w.prototype,"orientation",2),d([(0,h.property)({type:Number})],w.prototype,"radius",2),d([(0,h.property)({type:Number,attribute:"bar-gap"})],w.prototype,"barGap",2),d([(0,h.property)({type:Number,attribute:"bar-width"})],w.prototype,"barWidth",2),d([(0,h.property)()],w.prototype,"sort",2),d([(0,h.property)()],w.prototype,"transform",2),d([(0,h.property)({attribute:!1})],w.prototype,"transforms",2),d([(0,h.property)({type:Number})],w.prototype,"bins",2),d([(0,h.property)({type:Number,attribute:"bin-width"})],w.prototype,"binWidth",2),d([(0,h.property)({attribute:!1})],w.prototype,"binDomain",2),d([(0,h.property)({attribute:"bin-mode"})],w.prototype,"binMode",2),d([(0,h.property)({attribute:!1})],w.prototype,"sampling",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"brush",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"crosshair",2);var Sn=e=>e.defs&&e.defs.length?f.svg`<defs>${e.defs.map(n=>f.svg`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>f.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,v.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:f.nothing,Se=e=>f.svg`${e.map((n,t)=>{let r=n.title?f.svg`<title>${n.title}</title>`:f.nothing,o=n.item?t:void 0;switch(n.kind){case"path":return f.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,v.ifDefined)(n.stroke)} stroke-width=${(0,v.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,v.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,v.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,v.ifDefined)(n.dash)} opacity=${(0,v.ifDefined)(n.opacity)} fill-opacity=${(0,v.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return f.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,v.ifDefined)(n.rx)} fill=${n.fill} stroke=${(0,v.ifDefined)(n.stroke)} fill-opacity=${(0,v.ifDefined)(n.opacity)}>${r}</rect>`;case"line":return f.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,v.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,v.ifDefined)(n.dash)} opacity=${(0,v.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return f.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,v.ifDefined)(n.stroke)} opacity=${(0,v.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return f.svg`<text data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(o)} x=${n.x} y=${n.y} text-anchor=${(0,v.ifDefined)(n.anchor)} dominant-baseline=${(0,v.ifDefined)(n.baseline)} fill=${(0,v.ifDefined)(n.fill)} font-weight=${(0,v.ifDefined)(n.weight)} pointer-events=${(0,v.ifDefined)(o===void 0?"none":void 0)} transform=${(0,v.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var z=class extends g{constructor(){super(...arguments);this.data=[];this.labels=!1;this.breadcrumbs=!1}render(){let{data:t,innerRadius:r,centerLabel:o,labels:i,rootId:a,breadcrumbs:s,maxDepth:l,sort:c,startAngle:u,endAngle:m,padAngle:b,colorScale:$}=this;return this.root($t({...this.sized(),data:t,innerRadius:r,centerLabel:o,labels:i,rootId:a,breadcrumbs:s,maxDepth:l,sort:c,startAngle:u,endAngle:m,padAngle:b,colorScale:$}),"sunburst",this.label??"Sunburst chart")}};d([(0,N.property)({attribute:!1})],z.prototype,"data",2),d([(0,N.property)({type:Number,attribute:"inner-radius"})],z.prototype,"innerRadius",2),d([(0,N.property)({attribute:"center-label"})],z.prototype,"centerLabel",2),d([(0,N.property)({type:Boolean,reflect:!0})],z.prototype,"labels",2),d([(0,N.property)({attribute:!1})],z.prototype,"rootId",2),d([(0,N.property)({type:Boolean,reflect:!0})],z.prototype,"breadcrumbs",2),d([(0,N.property)({type:Number,attribute:"max-depth"})],z.prototype,"maxDepth",2),d([(0,N.property)()],z.prototype,"sort",2),d([(0,N.property)({type:Number,attribute:"start-angle"})],z.prototype,"startAngle",2),d([(0,N.property)({type:Number,attribute:"end-angle"})],z.prototype,"endAngle",2),d([(0,N.property)({type:Number,attribute:"pad-angle"})],z.prototype,"padAngle",2),d([(0,N.property)({attribute:!1})],z.prototype,"colorScale",2),z=d([(0,N.customElement)("skdx-sunburst-chart")],z);0&&(module.exports={SkdxSunburstChart});