@skdx/web-components-charts 0.45.0 → 0.49.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 (176) hide show
  1. package/dist/area.cjs +29 -29
  2. package/dist/area.d.cts +2 -1
  3. package/dist/area.d.ts +2 -1
  4. package/dist/area.js +31 -31
  5. package/dist/bar.cjs +29 -29
  6. package/dist/bar.d.cts +2 -1
  7. package/dist/bar.d.ts +2 -1
  8. package/dist/bar.js +33 -33
  9. package/dist/boxplot.cjs +35 -35
  10. package/dist/boxplot.d.cts +2 -1
  11. package/dist/boxplot.d.ts +2 -1
  12. package/dist/boxplot.js +38 -38
  13. package/dist/bubble.cjs +39 -39
  14. package/dist/bubble.d.cts +2 -1
  15. package/dist/bubble.d.ts +2 -1
  16. package/dist/bubble.js +38 -38
  17. package/dist/bullet.cjs +38 -38
  18. package/dist/bullet.d.cts +2 -1
  19. package/dist/bullet.d.ts +2 -1
  20. package/dist/bullet.js +40 -40
  21. package/dist/bump.cjs +37 -37
  22. package/dist/bump.d.cts +2 -1
  23. package/dist/bump.d.ts +2 -1
  24. package/dist/bump.js +37 -37
  25. package/dist/candlestick.cjs +34 -34
  26. package/dist/candlestick.d.cts +2 -1
  27. package/dist/candlestick.d.ts +2 -1
  28. package/dist/candlestick.js +35 -35
  29. package/dist/chord.cjs +37 -37
  30. package/dist/chord.d.cts +2 -1
  31. package/dist/chord.d.ts +2 -1
  32. package/dist/chord.js +39 -39
  33. package/dist/circle-packing.cjs +37 -37
  34. package/dist/circle-packing.d.cts +2 -1
  35. package/dist/circle-packing.d.ts +2 -1
  36. package/dist/circle-packing.js +37 -37
  37. package/dist/combo.cjs +29 -29
  38. package/dist/combo.d.cts +2 -1
  39. package/dist/combo.d.ts +2 -1
  40. package/dist/combo.js +33 -33
  41. package/dist/contracts.json +17886 -0
  42. package/dist/dumbbell.cjs +40 -40
  43. package/dist/dumbbell.d.cts +2 -1
  44. package/dist/dumbbell.d.ts +2 -1
  45. package/dist/dumbbell.js +39 -39
  46. package/dist/funnel.cjs +38 -38
  47. package/dist/funnel.d.cts +2 -1
  48. package/dist/funnel.d.ts +2 -1
  49. package/dist/funnel.js +38 -38
  50. package/dist/gantt.cjs +37 -37
  51. package/dist/gantt.d.cts +2 -1
  52. package/dist/gantt.d.ts +2 -1
  53. package/dist/gantt.js +40 -40
  54. package/dist/gauge.cjs +36 -36
  55. package/dist/gauge.d.cts +2 -1
  56. package/dist/gauge.d.ts +2 -1
  57. package/dist/gauge.js +35 -35
  58. package/dist/heatmap.cjs +38 -38
  59. package/dist/heatmap.d.cts +2 -1
  60. package/dist/heatmap.d.ts +2 -1
  61. package/dist/heatmap.js +39 -39
  62. package/dist/histogram.cjs +30 -30
  63. package/dist/histogram.d.cts +2 -1
  64. package/dist/histogram.d.ts +2 -1
  65. package/dist/histogram.js +34 -34
  66. package/dist/icicle.cjs +40 -40
  67. package/dist/icicle.d.cts +2 -1
  68. package/dist/icicle.d.ts +2 -1
  69. package/dist/icicle.js +40 -40
  70. package/dist/{index-H-_fLjtt.d.cts → index-BkR4iVqI.d.ts} +11 -1071
  71. package/dist/{index-H-_fLjtt.d.ts → index-DjnBT-5R.d.cts} +11 -1071
  72. package/dist/index.cjs +37 -37
  73. package/dist/index.d.cts +24 -3
  74. package/dist/index.d.ts +24 -3
  75. package/dist/index.js +38 -38
  76. package/dist/line.cjs +29 -29
  77. package/dist/line.d.cts +2 -1
  78. package/dist/line.d.ts +2 -1
  79. package/dist/line.js +31 -31
  80. package/dist/linear-gauge.cjs +33 -33
  81. package/dist/linear-gauge.d.cts +2 -1
  82. package/dist/linear-gauge.d.ts +2 -1
  83. package/dist/linear-gauge.js +40 -40
  84. package/dist/map.cjs +39 -39
  85. package/dist/map.d.cts +2 -1
  86. package/dist/map.d.ts +2 -1
  87. package/dist/map.js +37 -37
  88. package/dist/marimekko.cjs +40 -40
  89. package/dist/marimekko.d.cts +2 -1
  90. package/dist/marimekko.d.ts +2 -1
  91. package/dist/marimekko.js +38 -38
  92. package/dist/network.cjs +38 -38
  93. package/dist/network.d.cts +2 -1
  94. package/dist/network.d.ts +2 -1
  95. package/dist/network.js +39 -39
  96. package/dist/organization.cjs +38 -38
  97. package/dist/organization.d.cts +2 -1
  98. package/dist/organization.d.ts +2 -1
  99. package/dist/organization.js +38 -38
  100. package/dist/parallel.cjs +38 -38
  101. package/dist/parallel.d.cts +2 -1
  102. package/dist/parallel.d.ts +2 -1
  103. package/dist/parallel.js +40 -40
  104. package/dist/pareto.cjs +25 -25
  105. package/dist/pareto.d.cts +2 -1
  106. package/dist/pareto.d.ts +2 -1
  107. package/dist/pareto.js +24 -24
  108. package/dist/pie.cjs +38 -38
  109. package/dist/pie.d.cts +2 -1
  110. package/dist/pie.d.ts +2 -1
  111. package/dist/pie.js +38 -38
  112. package/dist/polar-area.cjs +38 -38
  113. package/dist/polar-area.d.cts +2 -1
  114. package/dist/polar-area.d.ts +2 -1
  115. package/dist/polar-area.js +40 -40
  116. package/dist/portable-runtime.js +1 -0
  117. package/dist/portable.cjs +1 -0
  118. package/dist/portable.d.cts +25 -0
  119. package/dist/portable.d.ts +25 -0
  120. package/dist/portable.js +1 -0
  121. package/dist/radar.cjs +39 -39
  122. package/dist/radar.d.cts +2 -1
  123. package/dist/radar.d.ts +2 -1
  124. package/dist/radar.js +37 -37
  125. package/dist/radial.cjs +36 -36
  126. package/dist/radial.d.cts +2 -1
  127. package/dist/radial.d.ts +2 -1
  128. package/dist/radial.js +37 -37
  129. package/dist/range.cjs +27 -27
  130. package/dist/range.d.cts +2 -1
  131. package/dist/range.d.ts +2 -1
  132. package/dist/range.js +27 -27
  133. package/dist/sankey.cjs +38 -38
  134. package/dist/sankey.d.cts +2 -1
  135. package/dist/sankey.d.ts +2 -1
  136. package/dist/sankey.js +36 -36
  137. package/dist/scatter.cjs +40 -40
  138. package/dist/scatter.d.cts +2 -1
  139. package/dist/scatter.d.ts +2 -1
  140. package/dist/scatter.js +39 -39
  141. package/dist/sparkline.cjs +36 -36
  142. package/dist/sparkline.d.cts +2 -1
  143. package/dist/sparkline.d.ts +2 -1
  144. package/dist/sparkline.js +37 -37
  145. package/dist/sunburst.cjs +37 -37
  146. package/dist/sunburst.d.cts +2 -1
  147. package/dist/sunburst.d.ts +2 -1
  148. package/dist/sunburst.js +40 -40
  149. package/dist/swarm.cjs +40 -40
  150. package/dist/swarm.d.cts +2 -1
  151. package/dist/swarm.d.ts +2 -1
  152. package/dist/swarm.js +39 -39
  153. package/dist/timeline.cjs +38 -38
  154. package/dist/timeline.d.cts +2 -1
  155. package/dist/timeline.d.ts +2 -1
  156. package/dist/timeline.js +40 -40
  157. package/dist/tree.cjs +38 -38
  158. package/dist/tree.d.cts +2 -1
  159. package/dist/tree.d.ts +2 -1
  160. package/dist/tree.js +38 -38
  161. package/dist/treemap.cjs +40 -40
  162. package/dist/treemap.d.cts +2 -1
  163. package/dist/treemap.d.ts +2 -1
  164. package/dist/treemap.js +38 -38
  165. package/dist/types-5xXhTghj.d.cts +1168 -0
  166. package/dist/types-5xXhTghj.d.ts +1168 -0
  167. package/dist/waffle.cjs +40 -40
  168. package/dist/waffle.d.cts +2 -1
  169. package/dist/waffle.d.ts +2 -1
  170. package/dist/waffle.js +39 -39
  171. package/dist/waterfall.cjs +37 -37
  172. package/dist/waterfall.d.cts +2 -1
  173. package/dist/waterfall.d.ts +2 -1
  174. package/dist/waterfall.js +38 -38
  175. package/dist/wrapper-api.json +1849 -0
  176. package/package.json +9 -5
@@ -1,59 +1,59 @@
1
- "use strict";var ue=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var Qt=Object.prototype.hasOwnProperty;var Jt=(e,n)=>{for(var t in n)ue(e,t,{get:n[t],enumerable:!0})},en=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Xt(n))!Qt.call(e,i)&&i!==t&&ue(e,i,{get:()=>n[i],enumerable:!(r=xt(n,i))||r.enumerable});return e};var tn=e=>en(ue({},"__esModule",{value:!0}),e),u=(e,n,t,r)=>{for(var i=r>1?void 0:r?xt(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&ue(n,t,i),i};var yn={};Jt(yn,{SkdxCirclePackingChart:()=>B});module.exports=tn(yn);var j=require("lit/decorators.js");var yt=e=>Number(e.toPrecision(12)),nn,rn=e=>(nn??(nn=new Intl.NumberFormat)).format(yt(e)),on=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function vt(e){if(e===void 0)return rn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=d=>i?h=>d(h)+i:d,a=d=>r===void 0?d===void 0?{}:{maximumFractionDigits:d}:{minimumFractionDigits:r,maximumFractionDigits:r},l=d=>{let h=new Intl.NumberFormat(t,d);return s(p=>h.format(yt(p)))},c=d=>{let h=new Intl.DateTimeFormat(t,o?{...d,timeZone:o}:d);return p=>h.format(p)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(a(2));case"percent":return l({style:"percent",...a(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...a()});case"compact":return l({notation:"compact",...a(1)});case"scientific":return l({notation:"scientific",...a(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return s(on)}}var I=e=>Number(e.toFixed(2)),Ie=e=>typeof e=="number"&&Number.isFinite(e);function $e(e){let n=1/0,t=-1/0;for(let r of e)Ie(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}var J=1e3,ee=60*J,te=60*ee,he=24*te,Mn=[J,5*J,15*J,30*J,ee,5*ee,15*ee,30*ee,te,3*te,6*te,12*te,he,2*he,7*he,14*he];var sn=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,an=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,ln={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function cn(e,n,t){return e.replace(an,(r,i,o)=>{let s=ln[i];if(s===void 0)return i+o;let l=(o.match(sn)??[]).map((c,d)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let p=d%s;return s===7?p===5?String(h+n):p===6?String(h+t):c:String(p%2===0?h+n:h+t)});return i+l.join(" ")})}var wt=(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:cn(r.d,n,t)}}});var Te=["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)"))),k={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 Mt=(e,n)=>n??Te[e%Te.length];function ne(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function kt(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,dn=120,St=e=>{let n=ne(e);return n&&(n.position==="left"||n.position==="right")?n.width??dn:0},fe=(e,n=600,t=300)=>({width:(e.width??n)-St(e),height:(e.height??t)-(ne(e)?.position==="bottom"?pe:0)}),Ct=(e,n,t)=>{let r=ne(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Tt(n,t??fe(e).width,r)):1)*pe},R=6.5;function It(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/R));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var me=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Mt(n)),$t=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Oe(e,n,t=[],r={},i=10,o=8,s=!1){let a=[],l=r.maxItems,c=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,d=e.length-c.length,h=r.interactive??!0,p=o,$=i,C=(M,m,g,y)=>{let T=(m?18:4)+M.length*R;p>o&&(s||p+T>n-8)&&(p=o,$+=pe),m&&a.push({kind:"rect",part:"legend-swatch",x:p,y:$-5,width:10,height:10,fill:m,opacity:y?.3:void 0,item:g}),a.push({kind:"text",part:"legend-label",x:p+(m?14:0),y:$,text:M,baseline:"middle",fill:y?k.grid:k.label,item:g}),p+=T+12};for(let M of c){let m=t.includes(M.name),g=h?{label:M.name,series:M.name,legend:!0}:void 0;C(r.formatter?.(M.name)??M.name,M.color,g,m)}return d>0&&C(`+${d} more`,void 0,void 0,!1),r.align==="end"?un(a,n):a}function un(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(a=>a.kind==="rect"?a.x+a.width:a.x+a.text.length*R)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var Tt=(e,n,t={})=>new Set(Oe(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Ae(e,n,t,r=[]){let i=ne(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=kt(e),a=o?.position==="bottom",l=St(e),c=e.hiddenSeries??[],d=o?l?Oe(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):Oe(r,n,c,o,a?t+10:10):[],h=a?Tt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,h)*pe:t,legendOffset:o?.position==="left"?l:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:d}}function Le(e){let n=e.legendOffset;if(!n)return e;let t=[...wt(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}),i=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,o=e.edit,s=o?{...o,scale:l=>o.scale(l)+n,invert:l=>o.invert(l-n),bars:o.bars.map(l=>({...l,x0:l.x0+n,x1:l.x1+n}))}:void 0,a=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:a,legendOffset:void 0}}function be(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/R)),l=s.flatMap(m=>{let g=[],y=Array.from(m);for(;y.length>a;){let T=y.slice(0,a+1).lastIndexOf(" ");T<1&&(T=a),g.push(y.slice(0,T).join("")),y=y.slice(T),y[0]===" "&&y.shift()}return g.push(y.join("")),g}),c=Math.max(1,Math.floor((i-6)/16)),d=l.slice(0,c);l.length>c&&(d[c-1]=It(`${d[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...d.map(m=>Array.from(m).length))*R+12),p=Math.min(i,6+d.length*16),$=o==="top"?{x:e-h/2,y:n-p-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-p/2}:o==="right"?{x:e+8,y:n-p/2}:{x:e+12,y:n-p-6},C=Math.max(0,Math.min(r-h,$.x)),M=Math.max(0,Math.min(i-p,$.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
- `),x:I(C),y:I(M),width:I(h),height:p,fill:"var(--skdx-color-surface-raised)",stroke:k.axis,rx:8},...d.map((m,g)=>({kind:"text",part:"tooltip-label",x:I(C+6),y:I(M+11+g*16),text:m,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:d.length>1&&g===0?"bold":void 0}))]}function Ot(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=fe(e,t,r),a=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return i==="loading"&&l.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:8}),l.push({kind:"text",part:`state-${i}`,x:I(o/2),y:I(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":k.label}),{...Ae(e,o,s),shapes:l,tooltip:!1}}var ze=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:k.label,...r});function At(e){return e.flatMap(n=>{if(n.kind!=="text"||n.fill!=="var(--skdx-color-text-on-accent)"&&n.part!=="reference-label")return[n];let t=n.text.length*R+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),i=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:i,width:t,height:18,rx:8,fill:"var(--skdx-color-surface-raised)"},{...n,fill:n.part==="reference-label"?n.fill:"var(--skdx-color-text-default)"}]})}var re=e=>Math.max(0,Math.min(1,e));function Lt(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],i=r.length===3?r.split("").map(o=>o+o).join(""):r;return[0,2,4].map(o=>parseInt(i.slice(o,o+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 zt(e,n){if(e.length===0)return k.axis;if(e.length===1)return e[0];let t=re(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),i=t-r,o=Lt(e[r]),s=Lt(e[r+1]);if(!o||!s)return e[Math.round(t)];let a=l=>Math.round(o[l]+(s[l]-o[l])*i);return`rgb(${a(0)}, ${a(1)}, ${a(2)})`}var Nt=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(re(e)*n))/(n-1):re(e);function Rt(e,n,t,r=k.negative,i=String){let[o,s]=$e(n),a=e??{type:"sequential"},l=m=>I(.15+.85*m);if(a.type==="threshold"){let{thresholds:m,colors:g,labels:y}=a,T=A=>{if(typeof A!="number"||!Number.isFinite(A))return;let w=0;for(;w<m.length&&A>=m[w];)w++;return{fill:g[Math.min(w,g.length-1)]??t,opacity:1}},z=g.map((A,w)=>({fill:A,opacity:1,label:y?.[w]??(w===0?`< ${i(m[0]??0)}`:w===m.length?`\u2265 ${i(m[w-1])}`:`${i(m[w-1])} \u2013 ${i(m[w])}`)}));return{color:T,domain:[o,s],swatches:z,kind:"threshold"}}if(a.type==="ordinal"){let m=a.colors?.length?a.colors:[t];return{color:y=>typeof y=="number"&&Number.isFinite(y)?{fill:m[Math.abs(Math.round(y))%m.length],opacity:1}:void 0,domain:[o,s],swatches:m.map((y,T)=>({fill:y,opacity:1,label:String(T)})),kind:"ordinal"}}if(a.type==="diverging"){let[m,g,y]=a.domain??[-Math.max(Math.abs(o),Math.abs(s)),0,Math.max(Math.abs(o),Math.abs(s))],T=a.colors,z=L=>L<g?.5*(L-m)/Math.max(1e-12,g-m):.5+.5*(L-g)/Math.max(1e-12,y-g),A=L=>{let D=Nt(a.reversed?1-re(L):L,a.steps);if(T&&T.length>=2)return{fill:zt(T,D),opacity:1};let N=D<.5?r:t,V=Math.abs(D-.5)*2;return{fill:N,opacity:l(V)}},w=L=>typeof L=="number"&&Number.isFinite(L)?A(z(L)):void 0,P=a.steps??5,Y=Array.from({length:P},(L,D)=>{let N=P===1?.5:D/(P-1),V=N<.5?m+(g-m)*(N*2):g+(y-g)*((N-.5)*2);return{...A(N),label:i(V)}});return{color:w,domain:[m,y],swatches:Y,kind:"diverging"}}let[c,d]=a.domain??[o,s],h=a.colors,p=m=>{let g=Nt(a.reversed?1-re(m):m,a.steps);return h&&h.length>=2?{fill:zt(h,g),opacity:1}:{fill:h?.[0]??t,opacity:l(g)}},$=m=>typeof m!="number"||!Number.isFinite(m)?void 0:p(d===c?1:(m-c)/(d-c)),C=a.steps??5,M=Array.from({length:C},(m,g)=>{let y=C===1?1:g/(C-1);return{...p(y),label:i(c+(d-c)*y)}});return{color:$,domain:[c,d],swatches:M,kind:"sequential"}}function ge(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ne=e=>e.id??e.name??e.series,Bt=e=>e.seriesId??e.series;function F(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ne(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Bt(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(e){let n={},t=Ne(e);t!==void 0&&(n.id=t);let r=Bt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Re=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Be(e,n,t){let r=ge(e),i=E(n),o=r.some(s=>F(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!F(n,s)):[...r,i]}var hn=.2;function pn(e){let n=k.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 fn=(e,n)=>e.kind==="text"?{...e,fill:k.grid}:{...e,opacity:(e.opacity??1)*n};function Pe(e,n){let t=ge(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:ge(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],a=d=>!i||r.some(h=>F(d,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&F(d,{series:h.series})):!1,l=d=>{if(!i||o.faded==="none"||a(d))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&F(d,{series:h})}return!0},c=e.shapes.map(d=>{let h=d.item;if(!h||h.legend)return d;if(t.some(p=>F(h,p))){let p=pn(d);p&&s.push(p)}return l(h)?fn(d,hn):d});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var Pt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function xe(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Pt:void 0}function q(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var De=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Dt(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function ie(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Dt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Fe(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Dt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:k.axis,dash:"3 3"}}function Ge(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!De(r.plot,n,t))return[];let i=Fe(e,n),{rows:o}=ie(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...be(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function je(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(o=>o[0]===n);if(r<0)return[];let i=t.xs[r];return Ge(e,i,t.plot.y+8)}function Ee(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=q(t,r,i,e.width,e.height);if(De(e.hit.plot,l,c)){let d=ie(e,l),h=Fe(e,l);if(d&&h)return{lines:d.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?H(e,n)?.item:void 0,a=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return a?{lines:Array.isArray(a)?a:[a],shapes:[]}:{lines:[],shapes:[]}}function Ft(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?H(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find(C=>C.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let d=s?.tooltipAnchored?H(s,e):void 0,h=d?s?.shapes[d.index]:void 0,{x:p,y:$}=h?oe(h):q(n,t,r,i,o);return be(p,$,c,i,o,s?.tooltipPlacement)}function He(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=q(t,r,i,e.width,e.height),a=Ge(e,o,s);if(a.length>0)return a}return Ft(n,t,r,i,e.width,e.height,e)}function _e(e,n){let t=H(e,n);return t&&!t.item.legend?E(t.item):null}var mn=(e,n)=>{let{x:t,y:r}=oe(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function Ve(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!mn(i,n))continue;let o=E(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Ze=e=>({kind:"rect",part:"selection-box",x:I(e.x),y:I(e.y),width:I(e.width),height:I(e.height),fill:k.focus,opacity:.12,stroke:k.focus}),ve=(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 Gt(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],a=e[o];s.y>t!=a.y>t&&n<(a.x-s.x)*(t-s.y)/(a.y-s.y)+s.x&&(r=!r)}return r}function We(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=oe(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Gt(n,o,a))continue;let l=E(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Ue=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${I(n.x)} ${I(n.y)}`).join("L")}`:"",fill:k.focus,fillOpacity:.12,stroke:k.focus,dash:"4 3"}),ye=6;function Ke(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-ye||n>i.x1+ye))return Math.abs(n-i.x0)<=ye?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=ye?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function qe(e,n,t){let r=e.edit;return jt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function Ye(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(l=>l.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",a=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return jt(r,{bar:o,mode:s},i*a)}function jt(e,{bar:n,mode:t},r){let i=a=>e.snap?Math.round(a/e.snap)*e.snap:a,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function Xe(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:I(Math.min(i,o)),y:I(n.bar.y),width:I(Math.max(1,Math.abs(o-i))),height:I(n.bar.height),fill:k.focus,opacity:.25,stroke:k.focus,rx:2}}var bn=64,gn=e=>Math.max(1,Math.min(bn,e));function Qe(e,n,t,r){let i=n>0?.8:1.25,o=gn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[l,c]=e.view.center,d=(t-(s.x+s.width/2))/a,h=(r-(s.y+s.height/2))/a,p=e.view.zoom/o;return{center:[l+d*(1-p),e.fromY(e.toY(c)-h*(1-p))],zoom:o}}function Je(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function H(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var we=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function oe(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 et(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=k.focus,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*R+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=oe(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?be(I(o),I(s),a,e.width,e.height):[]]}function tt(e,n,t){let r=we(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var U=2,K=(e,n,t)=>{let r=Math.max(U,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Et=(e,n)=>!e||e.start<=0&&e.end>=n;function nt(e,n,t){if(e.count<=U||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(U,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!Et(e.zoom,e.count)?K(r,a,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+l*o;return K(c-l*a,a,e.count)}function rt(e,n,t,r){let i=n.end-n.start,o=Math.max(U,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return K(n.start+s*i-s*o,o,e.count)}function it(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return K(n.start-t/i,r,e.count)}function ot(e,n,t){let r=e.brush;if(!r||!De(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,s=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:K(s-o/2,o,e.count)}}function st(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return K(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-U,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+U,Math.round(t.end+o)));return{start:t.start,end:s}}function lt(e,n){switch(n.type){case"svg":return Promise.resolve(at(e,n.label,n.resolve));case"csv":return Promise.resolve(Zt(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=at(e,n.label,n.resolve);return Vt(t,e.width,e.height,n.scale,n.background)}}}var G=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),se=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${G(String(t))}"`).join("");function Ht(e){let n=e.title?`<title>${G(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${se([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${se([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${se([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${se([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${se([t,["aria-label",e.title],["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]])}>${G(e.text)}</text>`}}function _t(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${G(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="${G(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function at(e,n,t){let r=_t(e)+e.shapes.map(Ht).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(i,o)=>t(o).trim()||i)),`<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="${G(n)}" font-family="${G(k.fontFamily)}" font-size="${G(k.fontSize)}"><title>${G(n)}</title>${r}</svg>`}function Vt(e,n,t,r=2,i){return new Promise((o,s)=>{let a=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(a);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let d=c.getContext("2d");if(!d)return s(new Error("canvas 2d context unavailable"));i&&(d.fillStyle=i,d.fillRect(0,0,c.width,c.height)),d.drawImage(l,0,0,c.width,c.height),c.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function Zt(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
3
- `)}var _=e=>Ie(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+_(t),0);var W=e=>e.id??e.name;function Wt(e,n){for(let t of e){if(W(t)===n||t.name===n)return[t];let r=Wt(t.children??[],n);if(r)return[t,...r]}}function ct(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:_(r),children:void 0}:{...r,children:r.children?ct(r.children,n,t+1):void 0})}function Ut(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Wt(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 dt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let a=r.rows[0];if(r.rows.length>t)return;let l=["",...a.slice(1).map(d=>d.replace(/:\s[^:]*$/,""))],c=r.rows.map(d=>[d[0],...d.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[l,...c]}let i=e.shapes.flatMap(a=>a.item&&!a.item.legend&&!(a.part==="anchor"&&!a.title)?[a.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(a=>i.some(l=>l[a]!==void 0)),s=(a,l)=>a[l]===void 0?"":String(a[l]);return[o.map(a=>a[0]?.toUpperCase()+a.slice(1)),...i.map(a=>o.map(l=>s(a,l)))]}var ut=new Map;function Me(e){let n=ut.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&ut.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return ut.set(e,{group:i,listeners:t}),i}var Kt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',ht=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Kt}{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){${Kt}{animation:none;transition:none}}`;function pt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function qt(e,n){let t=[],r=e.map((p,$)=>({r:p,i:$})).sort((p,$)=>$.r-p.r),i=new Array(e.length);for(let{r:p,i:$}of r){let C;if(t.length===0)C={x:0,y:0,r:p};else{let m=Math.max(1,p/4);e:for(let g=0;g<1e6;g+=m)for(let y=0;y<24;y++){let T=y/24*2*Math.PI+g*.05,z={x:g*Math.cos(T),y:g*Math.sin(T),r:p};if(t.every(A=>Math.hypot(A.x-z.x,A.y-z.y)>=A.r+z.r+n)){C=z;break e}}}let M=C??{x:0,y:0,r:p};t.push(M),i[$]=M}let o=1/0,s=-1/0,a=1/0,l=-1/0;for(let p of t)o=Math.min(o,p.x-p.r),s=Math.max(s,p.x+p.r),a=Math.min(a,p.y-p.r),l=Math.max(l,p.y+p.r);let c=(o+s)/2,d=(a+l)/2,h=0;for(let p of i)p.x-=c,p.y-=d,h=Math.max(h,Math.hypot(p.x,p.y)+p.r);return{circles:i,enclosing:h}}function ft(e){let n=[],{nodes:t}=Ut(e.data,e.rootId),r=ct(t,e.maxDepth),i=new Map(r.map((w,P)=>[W(w),me(e,P,w.color)])),o=r.filter(w=>!$t(e,w.name)),s=Ot(e,!o.some(w=>_(w)>0),300,300);if(s)return{...s,issues:n};let a=vt(e.format),{width:l,height:c}=fe(e,300,300),d=r.map(w=>({name:w.name,color:i.get(W(w))})),h=Ct(e,d,l),p=e.padding??2,$=e.labels??!0,C=[],M=w=>{w.children?.length?w.children.forEach(M):C.push(_(w))};o.forEach(M);let m=Rt(e.colorScale,C,me(e,0),void 0,a),g=[],y=[],T=(w,P,Y,L,D)=>{let N=w.filter(O=>{let X=_(O)>0;return X||n.push({code:"invalid-value",severity:"warning",message:`"${O.name}" has no positive value and was dropped.`,itemId:W(O)}),X});if(N.length===0)return;let{circles:V,enclosing:bt}=qt(N.map(O=>Math.sqrt(_(O))),0),Se=bt>0?(L-p)/bt:0;N.forEach((O,X)=>{let Ce=V[X],ae=I(P+Ce.x*Se),le=I(Y+Ce.y*Se),Q=Math.max(0,Ce.r*Se-p/2),ce=_(O),Z=(O.children?.length??0)>0,de=O.color??D??i.get(W(O))??me(e,X),Yt=Z?de:e.colorScale?m.color(ce)?.fill??de:de,gt=`${O.name}: ${a(ce)}`;g.push({kind:"circle",part:Z?"branch":"leaf",cx:ae,cy:le,r:I(Q),fill:Yt,opacity:Z?.15:e.colorScale&&!Z?m.color(ce)?.opacity:void 0,stroke:"var(--skdx-color-surface-default)",title:gt,item:{label:gt,id:W(O),name:O.name,value:ce}}),$&&!Z&&Q*2>O.name.length*R+4&&y.push(ze(ae,le,O.name,{part:"leaf-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),$&&Z&&Q*2>O.name.length*R+4&&y.push(ze(ae,I(le-Q+10),O.name,{part:"branch-label",anchor:"middle",baseline:"middle"})),Z&&T(O.children,ae,le,Q,de)})},z=Math.max(0,Math.min(l,c-h)/2-8);T(o,l/2,h+(c-h)/2,z,void 0);let A=Ae(e,l,c,d);return{...A,shapes:At([...g,...y,...A.shapes]),issues:n}}var b=require("lit"),f=require("lit/decorators.js"),v=require("lit/directives/if-defined.js");var mt={fromAttribute:()=>!1},x=class extends b.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 i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[Ze(ve(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[Ue(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=qe(r,i.gantt,o-i.x),this.overlay=[Xe(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(Je(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,a]=[...this.pointers.values()];if(s===void 0||a===void 0||!i.distance)return;this.setZoom(rt(r.hit,i.zoom,Math.abs(s-a)/i.distance,(s+a)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?it(r.hit,i.zoom,o-i.x):st(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Ee(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=s,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=He(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(_e(r,t.target)),this.syncId&&r.hit?.crosshair){let o=ie(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:i,y:o}=this.viewBox(t,r),s=H(r,t.target)?.item.legend,a=this.canEdit(r)?Ke(r,i,o):void 0;if(a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:a},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;this.drag={x:i,y:o,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,i),this.pointers.size===2){let[c,d]=[...this.pointers.values()];this.drag={x:(c+d)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-d)||1}}else{let c=ot(l,i,o);if(c)this.drag={x:i,y:o,zoom:c.zoom,grab:c.grab},c.zoom!==l.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&i>=l.plot.x&&i<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:i,y:o,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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:a}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(a-i.y)>2){i.grab==="select"?this.setSelected(Ve(o,ve(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(We(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(i<l.x||i>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(Qe(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let a=nt(s,t.deltaY,i);a&&(t.preventDefault(),this.setZoom(a))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=H(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=>{if(t.key==="Escape"){t.preventDefault(),this.focused=null,this.clearTip(),this.crossState=null,this.highlight(null);return}let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let a=r.shapes[this.focused]?.item;a&&(t.preventDefault(),this.select(a),this.emit("skdx-item-click",a));return}let i=this.canEdit(r)?Ye(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=tt(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let s=o===null?void 0:r.shapes[o]?.item;this.highlight(s?E(s):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:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:d,description:h,decorative:p,animated:$,responsive:C,highlighted:M,highlightScope:m,accessibleTable:g}=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:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:d,description:h,decorative:p,highlighted:M===void 0?this.highlightState:M,highlightScope:m,accessibleTable:g,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&&Me(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=Me(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&Re(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.highlightState=t,this.syncId&&this.publish({highlighted:t}))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Be(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&F(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?lt(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Pe(Le(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let m of o.issues??[])this.emit("skdx-data-issue",m)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),d=s||a||l||c,h=!o.decorative&&we(o).length>0,p=pt(o),$=dt(o,this.accessibleTable),C=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,M=this.portal;return b.html`<svg
1
+ "use strict";var ue=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var on=Object.prototype.hasOwnProperty;var sn=(e,n)=>{for(var t in n)ue(e,t,{get:n[t],enumerable:!0})},an=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of rn(n))!on.call(e,i)&&i!==t&&ue(e,i,{get:()=>n[i],enumerable:!(r=St(n,i))||r.enumerable});return e};var cn=e=>an(ue({},"__esModule",{value:!0}),e),p=(e,n,t,r)=>{for(var i=r>1?void 0:r?St(n,t):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(n,t,i):a(i))||i);return r&&i&&ue(n,t,i),i};var Mn={};sn(Mn,{SkdxCirclePackingChart:()=>E});module.exports=cn(Mn);var F=require("lit/decorators.js");var kt=new Set(["__proto__","constructor","prototype"]),Ie="skdx-chart-snapshot-request-v1";function Te(e,n){let t=r=>{if(r.target!==e)return;let i=r.detail;if(!(!i||typeof i.receive!="function"))try{i.receive(n())}catch(o){i.receive(void 0,o instanceof Error?o.message:String(o))}};return e.addEventListener(Ie,t),()=>e.removeEventListener(Ie,t)}function j(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function Oe(e,n,t){let r=[],i=0,o=new Set,a=(s,l,d=0)=>{if(++i>1e5||d>64)throw new Error("Chart snapshot exceeds bounded input size/depth");if(s===null||typeof s=="boolean"||typeof s=="string")return s;if(typeof s=="number")return Number.isFinite(s)?s:{$number:String(s)};if(s===void 0)return;if(typeof s=="function"){r.push({code:"unserializable-chart-callback",path:l,message:"Callback omitted; captured geometry retains its actual output. Do not reconstruct this configuration as a literal renderer input."});return}if(s instanceof Date)return Number.isFinite(s.getTime())?{$date:s.toISOString()}:{$date:"Invalid Date"};if(!Array.isArray(s)&&!j(s))throw new Error(`Unsupported chart snapshot value at ${l}`);if(o.has(s))throw new Error(`Cyclic chart input at ${l}`);o.add(s);let h;if(Array.isArray(s))h=s.map((u,w)=>a(u,`${l}[${w}]`,d+1)??null);else{let u=[];for(let[w,C]of Object.entries(s)){if(kt.has(w))throw new Error("Unsafe chart snapshot key");let k=a(C,`${l}.${w}`,d+1);k!==void 0&&u.push([w,k])}h=Object.fromEntries(u)}return o.delete(s),h},c={width:t.width,height:t.height,shapes:t.shapes,...t.defs?{defs:t.defs}:{},...t.issues?{issues:t.issues}:{},...t.table?{table:t.table}:{}};return Ct({schemaVersion:"1.0.0",kind:e,configuration:a(n,"input"),canvas:a(c,"canvas"),diagnostics:r})}function Ct(e){let n=0,t=(s,l=0)=>{if(++n>1e5||l>64)throw new Error("Chart snapshot exceeds bounded input size/depth");if(!(s===null||typeof s=="boolean"||typeof s=="string")&&!(typeof s=="number"&&Number.isFinite(s))){if(Array.isArray(s)){s.forEach(d=>t(d,l+1));return}if(!j(s))throw new Error("Chart snapshot must contain plain JSON only");for(let[d,h]of Object.entries(s)){if(kt.has(d))throw new Error("Unsafe chart snapshot key");t(h,l+1)}}};if(t(e),new TextEncoder().encode(JSON.stringify(e)).byteLength>8388608)throw new Error("Chart snapshot exceeds 8MB");if(!j(e)||Object.keys(e).some(s=>!["schemaVersion","kind","configuration","canvas","diagnostics"].includes(s))||e.schemaVersion!=="1.0.0"||typeof e.kind!="string"||!/^[a-z][a-z0-9-]*$/.test(e.kind)||!j(e.configuration)||!j(e.canvas)||!Array.isArray(e.diagnostics))throw new Error("Unsupported chart snapshot envelope");let r=e.canvas;if(Object.keys(r).some(s=>!["width","height","shapes","defs","issues","table"].includes(s)))throw new Error("Unsupported runtime geometry field");let i=(s,l=-1e5)=>typeof s=="number"&&Number.isFinite(s)&&s>=l&&s<=1e5;if(!i(r.width,.01)||!i(r.height,.01)||!Array.isArray(r.shapes)||!r.shapes.length||r.shapes.length>2e4)throw new Error("Invalid chart snapshot viewport/geometry");let o={path:["d","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","opacity","fillOpacity","dash"],rect:["x","y","width","height","fill","stroke","opacity","rx"],line:["x1","y1","x2","y2","stroke","dash","strokeWidth","opacity"],circle:["cx","cy","r","fill","stroke","opacity"],text:["x","y","text","anchor","baseline","fill","weight","rotate"]},a={path:["d"],rect:["x","y","width","height","fill"],line:["x1","y1","x2","y2","stroke"],circle:["cx","cy","r","fill"],text:["x","y","text"]},c=new Set(["x","y","x1","y1","x2","y2","width","height","cx","cy","r","strokeWidth","opacity","fillOpacity","rx","rotate"]);for(let s of r.shapes){if(!j(s)||typeof s.kind!="string"||!Object.hasOwn(o,s.kind)||typeof s.part!="string"||!s.part||Object.keys(s).some(l=>!["kind","part","title","item",...o[s.kind]??[]].includes(l)))throw new Error("Unsupported owner shape");for(let l of a[s.kind]??[])if(!(l in s))throw new Error("Missing owner geometry field");for(let[l,d]of Object.entries(s)){if(c.has(l)&&!i(d,["width","height","r","strokeWidth","rx","opacity","fillOpacity"].includes(l)?0:-1e5))throw new Error("Invalid owner geometry number");if(["opacity","fillOpacity"].includes(l)&&Number(d)>1)throw new Error("Invalid owner paint opacity");if(!c.has(l)&&l!=="item"&&typeof d!="string")throw new Error("Invalid owner shape field")}if(s.kind==="path"&&(typeof s.d!="string"||!/^\s*[Mm][MmLlHhVvCcSsQqTtAaZz0-9eE+.,\s-]*$/.test(s.d)||(s.d.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g)??[]).some(l=>!i(Number(l)))))throw new Error("Invalid owner path geometry");for(let[l,d]of Object.entries({anchor:["start","middle","end"],baseline:["middle","hanging"],weight:["bold"],strokeLinecap:["round"],strokeLinejoin:["round"]}))if(s[l]!==void 0&&(typeof s[l]!="string"||!d.includes(s[l])))throw new Error("Invalid owner shape enum")}if(r.defs!==void 0){if(!Array.isArray(r.defs)||r.defs.length>1e3)throw new Error("Invalid owner gradient list");let s=new Set;for(let l of r.defs){if(!j(l)||typeof l.id!="string"||!/^[A-Za-z][\w-]*$/.test(l.id)||s.has(l.id)||Object.keys(l).some(h=>!["id","vertical","stops"].includes(h))||l.vertical!==void 0&&typeof l.vertical!="boolean"||!Array.isArray(l.stops)||l.stops.length<2||l.stops.length>64)throw new Error("Invalid owner gradient");s.add(l.id);let d=-1;for(let h of l.stops){if(!j(h)||Object.keys(h).some(u=>!["offset","color","opacity"].includes(u))||!i(h.offset,0)||h.offset>1||h.offset<d||typeof h.color!="string"||h.opacity!==void 0&&(!i(h.opacity,0)||h.opacity>1))throw new Error("Invalid owner gradient stop");d=h.offset}}}for(let s of e.diagnostics)if(!j(s)||Object.keys(s).some(l=>!["code","path","message"].includes(l))||[s.code,s.path,s.message].some(l=>typeof l!="string"||!l))throw new Error("Invalid snapshot diagnostic");return e}var Mt=e=>Number(e.toPrecision(12)),ln,dn=e=>(ln??(ln=new Intl.NumberFormat)).format(Mt(e)),hn=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=a=>String(a).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function $t(e){if(e===void 0)return dn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,a=d=>i?h=>d(h)+i:d,c=d=>r===void 0?d===void 0?{}:{maximumFractionDigits:d}:{minimumFractionDigits:r,maximumFractionDigits:r},s=d=>{let h=new Intl.NumberFormat(t,d);return a(u=>h.format(Mt(u)))},l=d=>{let h=new Intl.DateTimeFormat(t,o?{...d,timeZone:o}:d);return u=>h.format(u)};switch(n){case"integer":return s({maximumFractionDigits:0});case"decimal":return s(c(2));case"percent":return s({style:"percent",...c(0)});case"currency":return s({style:"currency",currency:e.currency??"USD",...c()});case"compact":return s({notation:"compact",...c(1)});case"scientific":return s({notation:"scientific",...c(2)});case"date":return l({dateStyle:"medium"});case"time":return l({timeStyle:"short"});case"datetime":return l({dateStyle:"medium",timeStyle:"short"});case"duration":return a(hn)}}var I=e=>Number(e.toFixed(2)),Ae=e=>typeof e=="number"&&Number.isFinite(e);function Le(e){let n=1/0,t=-1/0;for(let r of e)Ae(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,pe=24*ne,On=[ee,5*ee,15*ee,30*ee,te,5*te,15*te,30*te,ne,3*ne,6*ne,12*ne,pe,2*pe,7*pe,14*pe];var un=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,pn=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,fn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function mn(e,n,t){return e.replace(pn,(r,i,o)=>{let a=fn[i];if(a===void 0)return i+o;let s=(o.match(un)??[]).map((l,d)=>{let h=Number(l);if(a===-1)return String(h+n);if(a===-2)return String(h+t);let u=d%a;return a===7?u===5?String(h+n):u===6?String(h+t):l:String(u%2===0?h+n:h+t)});return i+s.join(" ")})}var It=(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:mn(r.d,n,t)}}});var ze=["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 Tt=(e,n)=>n??ze[e%ze.length];function re(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Ot(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var fe=20,gn=120,At=e=>{let n=re(e);return n&&(n.position==="left"||n.position==="right")?n.width??gn:0},me=(e,n=600,t=300)=>({width:(e.width??n)-At(e),height:(e.height??t)-(re(e)?.position==="bottom"?fe:0)}),Lt=(e,n,t)=>{let r=re(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Nt(n,t??me(e).width,r)):1)*fe},N=6.5;function zt(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/N));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ge=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Tt(n)),Rt=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Re(e,n,t=[],r={},i=10,o=8,a=!1){let c=[],s=r.maxItems,l=s!==void 0&&s>=0&&e.length>s?e.slice(0,s):e,d=e.length-l.length,h=r.interactive??!0,u=o,w=i,C=(k,m,g,y)=>{let T=(m?18:4)+k.length*N;u>o&&(a||u+T>n-8)&&(u=o,w+=fe),m&&c.push({kind:"rect",part:"legend-swatch",x:u,y:w-5,width:10,height:10,fill:m,opacity:y?.3:void 0,item:g}),c.push({kind:"text",part:"legend-label",x:u+(m?14:0),y:w,text:k,baseline:"middle",fill:y?M.grid:M.label,item:g}),u+=T+12};for(let k of l){let m=t.includes(k.name),g=h?{label:k.name,series:k.name,legend:!0}:void 0;C(r.formatter?.(k.name)??k.name,k.color,g,m)}return d>0&&C(`+${d} more`,void 0,void 0,!1),r.align==="end"?bn(c,n):c}function bn(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(c=>c.kind==="rect"?c.x+c.width:c.x+c.text.length*N)),a=n-8-o;for(let c of i)r.push({...c,x:c.x+a})}return r}var Nt=(e,n,t={})=>new Set(Re(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Ne(e,n,t,r=[]){let i=re(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,a=Ot(e),c=o?.position==="bottom",s=At(e),l=e.hiddenSeries??[],d=o?s?Re(r,1/0,l,o,10,(o.position==="right"?n:0)+8,!0):Re(r,n,l,o,c?t+10:10):[],h=c?Nt(r,n,o):0;return{width:n+s,height:c?t+Math.max(1,h)*fe:t,legendOffset:o?.position==="left"?s: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:d}}function Ee(e){let n=e.legendOffset;if(!n)return e;let t=[...It(e.shapes.filter(s=>!s.part.startsWith("legend-")),n,0),...e.shapes.filter(s=>s.part.startsWith("legend-"))],r=s=>({...s,x:s.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(s=>s+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,a=o?{...o,scale:s=>o.scale(s)+n,invert:s=>o.invert(s-n),bars:o.bars.map(s=>({...s,x0:s.x0+n,x1:s.x1+n}))}:void 0,c=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:a,map:c,legendOffset:void 0}}function be(e,n,t,r,i,o="auto"){let a=Array.isArray(t)?t:[t],c=Math.max(1,Math.floor((r-12)/N)),s=a.flatMap(m=>{let g=[],y=Array.from(m);for(;y.length>c;){let T=y.slice(0,c+1).lastIndexOf(" ");T<1&&(T=c),g.push(y.slice(0,T).join("")),y=y.slice(T),y[0]===" "&&y.shift()}return g.push(y.join("")),g}),l=Math.max(1,Math.floor((i-6)/16)),d=s.slice(0,l);s.length>l&&(d[l-1]=zt(`${d[l-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...d.map(m=>Array.from(m).length))*N+12),u=Math.min(i,6+d.length*16),w=o==="top"?{x:e-h/2,y:n-u-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-u/2}:o==="right"?{x:e+8,y:n-u/2}:{x:e+12,y:n-u-6},C=Math.max(0,Math.min(r-h,w.x)),k=Math.max(0,Math.min(i-u,w.y));return[{kind:"rect",part:"tooltip",title:a.join(`
2
+ `),x:I(C),y:I(k),width:I(h),height:u,fill:"var(--skdx-color-surface-raised)",stroke:M.axis,rx:8},...d.map((m,g)=>({kind:"text",part:"tooltip-label",x:I(C+6),y:I(k+11+g*16),text:m,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:d.length>1&&g===0?"bold":void 0}))]}function Et(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:a}=me(e,t,r),c=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",s=[];return i==="loading"&&s.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:a,fill:"var(--skdx-color-surface-sunken)",rx:8}),s.push({kind:"text",part:`state-${i}`,x:I(o/2),y:I(a/2),text:c,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":M.label}),{...Ne(e,o,a),shapes:s,tooltip:!1}}var Pe=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:M.label,...r});function Pt(e){return e.flatMap(n=>{if(n.kind!=="text"||n.fill!=="var(--skdx-color-text-on-accent)"&&n.part!=="reference-label")return[n];let t=n.text.length*N+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),i=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:i,width:t,height:18,rx:8,fill:"var(--skdx-color-surface-raised)"},{...n,fill:n.part==="reference-label"?n.fill:"var(--skdx-color-text-default)"}]})}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],i=r.length===3?r.split("").map(o=>o+o).join(""):r;return[0,2,4].map(o=>parseInt(i.slice(o,o+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)),i=t-r,o=Bt(e[r]),a=Bt(e[r+1]);if(!o||!a)return e[Math.round(t)];let c=s=>Math.round(o[s]+(a[s]-o[s])*i);return`rgb(${c(0)}, ${c(1)}, ${c(2)})`}var jt=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(ie(e)*n))/(n-1):ie(e);function _t(e,n,t,r=M.negative,i=String){let[o,a]=Le(n),c=e??{type:"sequential"},s=m=>I(.15+.85*m);if(c.type==="threshold"){let{thresholds:m,colors:g,labels:y}=c,T=A=>{if(typeof A!="number"||!Number.isFinite(A))return;let S=0;for(;S<m.length&&A>=m[S];)S++;return{fill:g[Math.min(S,g.length-1)]??t,opacity:1}},z=g.map((A,S)=>({fill:A,opacity:1,label:y?.[S]??(S===0?`< ${i(m[0]??0)}`:S===m.length?`\u2265 ${i(m[S-1])}`:`${i(m[S-1])} \u2013 ${i(m[S])}`)}));return{color:T,domain:[o,a],swatches:z,kind:"threshold"}}if(c.type==="ordinal"){let m=c.colors?.length?c.colors:[t];return{color:y=>typeof y=="number"&&Number.isFinite(y)?{fill:m[Math.abs(Math.round(y))%m.length],opacity:1}:void 0,domain:[o,a],swatches:m.map((y,T)=>({fill:y,opacity:1,label:String(T)})),kind:"ordinal"}}if(c.type==="diverging"){let[m,g,y]=c.domain??[-Math.max(Math.abs(o),Math.abs(a)),0,Math.max(Math.abs(o),Math.abs(a))],T=c.colors,z=L=>L<g?.5*(L-m)/Math.max(1e-12,g-m):.5+.5*(L-g)/Math.max(1e-12,y-g),A=L=>{let D=jt(c.reversed?1-ie(L):L,c.steps);if(T&&T.length>=2)return{fill:Dt(T,D),opacity:1};let R=D<.5?r:t,Z=Math.abs(D-.5)*2;return{fill:R,opacity:s(Z)}},S=L=>typeof L=="number"&&Number.isFinite(L)?A(z(L)):void 0,B=c.steps??5,Y=Array.from({length:B},(L,D)=>{let R=B===1?.5:D/(B-1),Z=R<.5?m+(g-m)*(R*2):g+(y-g)*((R-.5)*2);return{...A(R),label:i(Z)}});return{color:S,domain:[m,y],swatches:Y,kind:"diverging"}}let[l,d]=c.domain??[o,a],h=c.colors,u=m=>{let g=jt(c.reversed?1-ie(m):m,c.steps);return h&&h.length>=2?{fill:Dt(h,g),opacity:1}:{fill:h?.[0]??t,opacity:s(g)}},w=m=>typeof m!="number"||!Number.isFinite(m)?void 0:u(d===l?1:(m-l)/(d-l)),C=c.steps??5,k=Array.from({length:C},(m,g)=>{let y=C===1?1:g/(C-1);return{...u(y),label:i(l+(d-l)*y)}});return{color:w,domain:[l,d],swatches:k,kind:"sequential"}}function xe(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Be=e=>e.id??e.name??e.series,Ft=e=>e.seriesId??e.series;function _(e,n){let t=!1;return n.id!==void 0&&(t=!0,Be(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Ft(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 G(e){let n={},t=Be(e);t!==void 0&&(n.id=t);let r=Ft(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var De=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function je(e,n,t){let r=xe(e),i=G(n),o=r.some(a=>_(n,a));return t==="single"?o?[]:[i]:o?r.filter(a=>!_(n,a)):[...r,i]}var xn=.2;function yn(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 wn=(e,n)=>e.kind==="text"?{...e,fill:M.grid}:{...e,opacity:(e.opacity??1)*n};function _e(e,n){let t=xe(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:xe(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},a=[],c=d=>!i||r.some(h=>_(d,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&_(d,{series:h.series})):!1,s=d=>{if(!i||o.faded==="none"||c(d))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&_(d,{series:h})}return!0},l=e.shapes.map(d=>{let h=d.item;if(!h||h.legend)return d;if(t.some(u=>_(h,u))){let u=yn(d);u&&a.push(u)}return s(h)?wn(d,xn):d});return a.length?{...e,shapes:[...l,...a]}:{...e,shapes:l}}var Gt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function ye(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Gt:void 0}function X(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var Fe=(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((i,o)=>{let a=Math.abs(i-n);a<r&&(r=a,t=o)}),t}function oe(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Vt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Ge(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 Ve(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Fe(r.plot,n,t))return[];let i=Ge(e,n),{rows:o}=oe(e,n),a=e.tooltipAnchored?r.plot.y+8:t;return[i,...be(i.x1,a,o,e.width,e.height,e.tooltipPlacement)]}function He(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(o=>o[0]===n);if(r<0)return[];let i=t.xs[r];return Ve(e,i,t.plot.y+8)}function Ze(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:s,y:l}=X(t,r,i,e.width,e.height);if(Fe(e.hit.plot,s,l)){let d=oe(e,s),h=Ge(e,s);if(d&&h)return{lines:d.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),a=e.tooltipFormatter?V(e,n)?.item:void 0,c=a&&e.tooltipFormatter?.(a)||o&&Array.from(o.children).find(s=>s.tagName.toLowerCase()==="title")?.textContent;return c?{lines:Array.isArray(c)?c:[c],shapes:[]}:{lines:[],shapes:[]}}function Ht(e,n,t,r,i,o,a){let c=e?.closest?.("[data-skdx-part]"),s=a&&a.tooltipFormatter?V(a,e)?.item:void 0,l=s&&a?.tooltipFormatter?.(s)||c&&Array.from(c.children).find(C=>C.tagName.toLowerCase()==="title")?.textContent;if(!l)return[];let d=a?.tooltipAnchored?V(a,e):void 0,h=d?a?.shapes[d.index]:void 0,{x:u,y:w}=h?se(h):X(n,t,r,i,o);return be(u,w,l,i,o,a?.tooltipPlacement)}function We(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:a}=X(t,r,i,e.width,e.height),c=Ve(e,o,a);if(c.length>0)return c}return Ht(n,t,r,i,e.width,e.height,e)}function Ue(e,n){let t=V(e,n);return t&&!t.item.legend?G(t.item):null}var vn=(e,n)=>{let{x:t,y:r}=se(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function qe(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!vn(i,n))continue;let o=G(i.item),a=JSON.stringify(o);t.has(a)||(t.add(a),r.push(o))}return r}var Ke=e=>({kind:"rect",part:"selection-box",x:I(e.x),y:I(e.y),width:I(e.width),height:I(e.height),fill:M.focus,opacity:.12,stroke:M.focus}),ve=(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 i=0,o=e.length-1;i<e.length;o=i++){let a=e[i],c=e[o];a.y>t!=c.y>t&&n<(c.x-a.x)*(t-a.y)/(c.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 i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:a}=se(i),c=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:a;if(!Zt(n,o,c))continue;let s=G(i.item),l=JSON.stringify(s);t.has(l)||(t.add(l),r.push(s))}return r}var Ye=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${I(n.x)} ${I(n.y)}`).join("L")}`:"",fill:M.focus,fillOpacity:.12,stroke:M.focus,dash:"4 3"}),we=6;function Je(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-we||n>i.x1+we))return Math.abs(n-i.x0)<=we?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=we?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function Qe(e,n,t){let r=e.edit;return Wt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function et(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(s=>s.index===n);if(!o)return;let a=t.altKey?t.shiftKey?"start":"end":"move",c=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Wt(r,{bar:o,mode:a},i*c)}function Wt(e,{bar:n,mode:t},r){let i=c=>e.snap?Math.round(c/e.snap)*e.snap:c,o=n.start,a=n.end;return t==="move"?(o=i(n.start+r),a=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):a=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:a}}function tt(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:I(Math.min(i,o)),y:I(n.bar.y),width:I(Math.max(1,Math.abs(o-i))),height:I(n.bar.height),fill:M.focus,opacity:.25,stroke:M.focus,rx:2}}var Sn=64,kn=e=>Math.max(1,Math.min(Sn,e));function nt(e,n,t,r){let i=n>0?.8:1.25,o=kn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:a,scale:c}=e,[s,l]=e.view.center,d=(t-(a.x+a.width/2))/c,h=(r-(a.y+a.height/2))/c,u=e.view.zoom/o;return{center:[s+d*(1-u),e.fromY(e.toY(l)-h*(1-u))],zoom:o}}function rt(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function V(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var Se=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,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*N+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:a}=se(t),c=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...c?be(I(o),I(a),c,e.width,e.height):[]]}function ot(e,n,t){let r=Se(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var q=2,K=(e,n,t)=>{let r=Math.max(q,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Ut=(e,n)=>!e||e.start<=0&&e.end>=n;function st(e,n,t){if(e.count<=q||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,a=n>0?1.25:.8,c=Math.max(q,Math.min(e.count,Math.round(o*a)));if(c===o)return n>0&&!Ut(e.zoom,e.count)?K(r,c,e.count):void 0;let s=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),l=r+s*o;return K(l-s*c,c,e.count)}function at(e,n,t,r){let i=n.end-n.start,o=Math.max(q,Math.min(e.count,Math.round(i/Math.max(.05,t)))),a=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return K(n.start+a*i-a*o,o,e.count)}function ct(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return K(n.start-t/i,r,e.count)}function lt(e,n,t){let r=e.brush;if(!r||!Fe(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,a=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:K(a-o/2,o,e.count)}}function dt(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return K(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-q,Math.round(t.start+o))),end:t.end};let a=Math.min(e.count,Math.max(t.start+q,Math.round(t.end+o)));return{start:t.start,end:a}}function ut(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 Xt(t,e.width,e.height,n.scale,n.background)}}}var P=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),ae=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${P(String(t))}"`).join("");function qt(e){let n=e.title?`<title>${P(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${ae([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${ae([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${ae([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${ae([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${ae([t,["aria-label",e.title],["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]])}>${P(e.text)}</text>`}}function Kt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${P(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="${P(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("");t&&(r=r.replace(/var\((--[\w-]+)\)/g,(a,c)=>t(c).trim()||a));let i=e.decorative?'aria-hidden="true"':`role="img" aria-label="${P(n)}"`,o=e.description?`<desc>${P(e.description)}</desc>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" ${i} font-family="${P(M.fontFamily)}" font-size="${P(M.fontSize)}"><title>${P(n)}</title>${o}${r}</svg>`}function Xt(e,n,t,r=2,i){return new Promise((o,a)=>{let c=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),s=new Image;s.onload=()=>{URL.revokeObjectURL(c);let l=document.createElement("canvas");l.width=Math.round(n*r),l.height=Math.round(t*r);let d=l.getContext("2d");if(!d)return a(new Error("canvas 2d context unavailable"));i&&(d.fillStyle=i,d.fillRect(0,0,l.width,l.height)),d.drawImage(s,0,0,l.width,l.height),l.toBlob(h=>h?o(h):a(new Error("toBlob failed")),"image/png")},s.onerror=()=>{URL.revokeObjectURL(c),a(new Error("svg could not be decoded"))},s.src=c})}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
3
+ `)}var H=e=>Ae(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+H(t),0);var U=e=>e.id??e.name;function Jt(e,n){for(let t of e){if(U(t)===n||t.name===n)return[t];let r=Jt(t.children??[],n);if(r)return[t,...r]}}function pt(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:H(r),children:void 0}:{...r,children:r.children?pt(r.children,n,t+1):void 0})}function Qt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Jt(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 ft(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let c=r.rows[0];if(r.rows.length>t)return;let s=["",...c.slice(1).map(d=>d.replace(/:\s[^:]*$/,""))],l=r.rows.map(d=>[d[0],...d.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[s,...l]}let i=e.shapes.flatMap(c=>c.item&&!c.item.legend&&!(c.part==="anchor"&&!c.title)?[c.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(c=>i.some(s=>s[c]!==void 0)),a=(c,s)=>c[s]===void 0?"":String(c[s]);return[o.map(c=>c[0]?.toUpperCase()+c.slice(1)),...i.map(c=>o.map(s=>a(c,s)))]}var mt=new Map;function ke(e){let n=mt.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&mt.delete(e)}},publish(o,a){Object.assign(r,o);for(let c of t)c(o,a)}};return mt.set(e,{group:i,listeners:t}),i}var en='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',gt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${en}{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){${en}{animation:none;transition:none}}`;function bt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function tn(e,n){let t=[],r=e.map((u,w)=>({r:u,i:w})).sort((u,w)=>w.r-u.r),i=new Array(e.length);for(let{r:u,i:w}of r){let C;if(t.length===0)C={x:0,y:0,r:u};else{let m=Math.max(1,u/4);e:for(let g=0;g<1e6;g+=m)for(let y=0;y<24;y++){let T=y/24*2*Math.PI+g*.05,z={x:g*Math.cos(T),y:g*Math.sin(T),r:u};if(t.every(A=>Math.hypot(A.x-z.x,A.y-z.y)>=A.r+z.r+n)){C=z;break e}}}let k=C??{x:0,y:0,r:u};t.push(k),i[w]=k}let o=1/0,a=-1/0,c=1/0,s=-1/0;for(let u of t)o=Math.min(o,u.x-u.r),a=Math.max(a,u.x+u.r),c=Math.min(c,u.y-u.r),s=Math.max(s,u.y+u.r);let l=(o+a)/2,d=(c+s)/2,h=0;for(let u of i)u.x-=l,u.y-=d,h=Math.max(h,Math.hypot(u.x,u.y)+u.r);return{circles:i,enclosing:h}}function xt(e){let n=[],{nodes:t}=Qt(e.data,e.rootId),r=pt(t,e.maxDepth),i=new Map(r.map((S,B)=>[U(S),ge(e,B,S.color)])),o=r.filter(S=>!Rt(e,S.name)),a=Et(e,!o.some(S=>H(S)>0),300,300);if(a)return{...a,issues:n};let c=$t(e.format),{width:s,height:l}=me(e,300,300),d=r.map(S=>({name:S.name,color:i.get(U(S))})),h=Lt(e,d,s),u=e.padding??2,w=e.labels??!0,C=[],k=S=>{S.children?.length?S.children.forEach(k):C.push(H(S))};o.forEach(k);let m=_t(e.colorScale,C,ge(e,0),void 0,c),g=[],y=[],T=(S,B,Y,L,D)=>{let R=S.filter(O=>{let J=H(O)>0;return J||n.push({code:"invalid-value",severity:"warning",message:`"${O.name}" has no positive value and was dropped.`,itemId:U(O)}),J});if(R.length===0)return;let{circles:Z,enclosing:wt}=tn(R.map(O=>Math.sqrt(H(O))),0),Me=wt>0?(L-u)/wt:0;R.forEach((O,J)=>{let $e=Z[J],ce=I(B+$e.x*Me),le=I(Y+$e.y*Me),Q=Math.max(0,$e.r*Me-u/2),de=H(O),W=(O.children?.length??0)>0,he=O.color??D??i.get(U(O))??ge(e,J),nn=W?he:e.colorScale?m.color(de)?.fill??he:he,vt=`${O.name}: ${c(de)}`;g.push({kind:"circle",part:W?"branch":"leaf",cx:ce,cy:le,r:I(Q),fill:nn,opacity:W?.15:e.colorScale&&!W?m.color(de)?.opacity:void 0,stroke:"var(--skdx-color-surface-default)",title:vt,item:{label:vt,id:U(O),name:O.name,value:de}}),w&&!W&&Q*2>O.name.length*N+4&&y.push(Pe(ce,le,O.name,{part:"leaf-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),w&&W&&Q*2>O.name.length*N+4&&y.push(Pe(ce,I(le-Q+10),O.name,{part:"branch-label",anchor:"middle",baseline:"middle"})),W&&T(O.children,ce,le,Q,he)})},z=Math.max(0,Math.min(s,l-h)/2-8);T(o,s/2,h+(l-h)/2,z,void 0);let A=Ne(e,s,l,d);return{...A,shapes:Pt([...g,...y,...A.shapes]),issues:n}}var b=require("lit"),f=require("lit/decorators.js"),v=require("lit/directives/if-defined.js");var yt={fromAttribute:()=>!1},x=class extends b.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.snapshotKind="";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 i=this.drag;if(i?.grab==="select"){let{x:o,y:a}=this.viewBox(t,r);this.overlay=[Ke(ve(i.x,i.y,o,a))];return}if(i?.grab==="lasso"){let{x:o,y:a}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:a}],this.overlay=[Ye(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=Qe(r,i.gantt,o-i.x),this.overlay=[tt(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:a}=this.viewBox(t,r);this.setView(rt(r.map,i.view,o-i.x,a-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[a,c]=[...this.pointers.values()];if(a===void 0||c===void 0||!i.distance)return;this.setZoom(at(r.hit,i.zoom,Math.abs(a-c)/i.distance,(a+c)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?ct(r.hit,i.zoom,o-i.x):dt(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:a}=Ze(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=a,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=We(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ue(r,t.target)),this.syncId&&r.hit?.crosshair){let o=oe(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:i,y:o}=this.viewBox(t,r),a=V(r,t.target)?.item.legend,c=this.canEdit(r)?Je(r,i,o):void 0;if(c){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:c},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let l=r.map.plot;if(i<l.x||i>l.x+l.width||o<l.y||o>l.y+l.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let s=r.hit;if(!(!s||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[l,d]=[...this.pointers.values()];this.drag={x:(l+d)/2,y:o,zoom:s.zoom,grab:"pinch",distance:Math.abs(l-d)||1}}else{let l=lt(s,i,o);if(l)this.drag={x:i,y:o,zoom:l.zoom,grab:l.grab},l.zoom!==s.zoom&&this.setZoom(l.zoom);else if(this.zoomable&&i>=s.plot.x&&i<=s.plot.x+s.plot.width&&o>=s.plot.y&&o<=s.plot.y+s.plot.height)this.drag={x:i,y:o,zoom:s.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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:a,y:c}=this.viewBox(t,o);if(Math.abs(a-i.x)>2||Math.abs(c-i.y)>2){i.grab==="select"?this.setSelected(qe(o,ve(i.x,i.y,a,c))):i.grab==="lasso"?this.setSelected(Xe(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let s=r.map.plot;if(i<s.x||i>s.x+s.width||o<s.y||o>s.y+s.height)return;t.preventDefault(),this.setView(nt(r.map,t.deltaY,i,o));return}let a=r.hit;if(!a||!this.canZoom(r)||o<a.plot.y||o>a.plot.y+a.plot.height)return;let c=st(a,t.deltaY,i);c&&(t.preventDefault(),this.setZoom(c))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=V(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=>{if(t.key==="Escape"){t.preventDefault(),this.focused=null,this.clearTip(),this.crossState=null,this.highlight(null);return}let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let c=r.shapes[this.focused]?.item;c&&(t.preventDefault(),this.select(c),this.emit("skdx-item-click",c));return}let i=this.canEdit(r)?et(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=ot(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let a=o===null?void 0:r.shapes[o]?.item;this.highlight(a?G(a):null)}}updated(){let t=this.renderRoot.querySelector("svg")??void 0;t===this.snapshotSvg&&this.removeSnapshot||(this.removeSnapshot?.(),this.snapshotSvg=t,this.removeSnapshot=t?Te(t,()=>{if(!this.snapshotConfiguration||!this.layout)throw new Error("Actual owner chart configuration unavailable");return Oe(this.snapshotKind,this.snapshotConfiguration,this.layout)}):void 0)}connectedCallback(){super.connectedCallback(),this.requestUpdate(),!(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.removeSnapshot?.(),this.removeSnapshot=void 0,this.snapshotSvg=void 0,this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:i,tooltip:o,format:a,palette:c,loading:s,error:l,emptyMessage:d,description:h,decorative:u,animated:w,responsive:C,highlighted:k,highlightScope:m,accessibleTable:g}=this;return{width:C&&this.measured?this.measured:t,height:r,animate:w,responsive:C,legend:i,tooltip:o,format:a,palette:c,loading:s,error:l,emptyMessage:d,description:h,decorative:u,highlighted:k===void 0?this.highlightState:k,highlightScope:m,accessibleTable:g,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}compactOverrides(){let t=this.responsive;return typeof t=="object"&&this.measured!==void 0&&this.measured<(t.breakpoint??480)?{...t.compact,width:this.measured}:void 0}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&ke(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=ke(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&De(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.highlightState=t,this.syncId&&this.publish({highlighted:t}))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(je(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 X(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&_(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?ut(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i,o){this.join();let a=_e(Ee(t),this.sized());if(this.layout=a,this.snapshotKind=r,this.snapshotConfiguration=o,a.issues!==this.reported){this.reported=a.issues;for(let g of a.issues??[])this.emit("skdx-data-issue",g)}let c=this.canZoom(a),s=this.canPan(a),l=this.canEdit(a),d=this.brushing(),h=c||s||l||d,u=!a.decorative&&Se(a).length>0,w=bt(a),C=ft(a,this.accessibleTable),k=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,m=this.portal;return b.html`<svg
4
4
  xmlns="http://www.w3.org/2000/svg"
5
- viewBox="0 0 ${o.width} ${o.height}"
6
- width=${o.width}
7
- height=${o.height}
8
- role=${o.decorative?"presentation":"img"}
9
- aria-hidden=${o.decorative?"true":b.nothing}
10
- aria-label=${o.decorative?b.nothing:i}
11
- aria-description=${(0,v.ifDefined)(o.description)}
12
- tabindex=${h?0:b.nothing}
5
+ viewBox="0 0 ${a.width} ${a.height}"
6
+ width=${a.width}
7
+ height=${a.height}
8
+ role=${a.decorative?"presentation":"img"}
9
+ aria-hidden=${a.decorative?"true":b.nothing}
10
+ aria-label=${a.decorative?b.nothing:i}
11
+ aria-description=${(0,v.ifDefined)(a.description)}
12
+ tabindex=${u?0:b.nothing}
13
13
  data-skdx-chart=${r}
14
- data-zoomable=${s||a?"":b.nothing}
15
- data-brushing=${c&&!(s||a)?"":b.nothing}
14
+ data-zoomable=${c||s?"":b.nothing}
15
+ data-brushing=${d&&!(c||s)?"":b.nothing}
16
16
  data-editable=${l?"":b.nothing}
17
- style=${p?`--skdx-chart-duration:${p}`:b.nothing}
18
- font-family=${k.fontFamily}
19
- font-size=${k.fontSize}
20
- @pointermove=${o.tooltip||d?this.onPointerMove:b.nothing}
17
+ style=${w?`--skdx-chart-duration:${w}`:b.nothing}
18
+ font-family=${M.fontFamily}
19
+ font-size=${M.fontSize}
20
+ @pointermove=${a.tooltip||h?this.onPointerMove:b.nothing}
21
21
  @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
22
- @pointerdown=${d?this.onPointerDown:b.nothing}
23
- @pointerup=${d?this.onPointerUp:b.nothing}
24
- @pointercancel=${d?this.onPointerUp:b.nothing}
25
- @wheel=${s||a?this.onWheel:b.nothing}
26
- @dblclick=${s||a?()=>a?this.setView(void 0):this.setZoom(void 0):b.nothing}
22
+ @pointerdown=${h?this.onPointerDown:b.nothing}
23
+ @pointerup=${h?this.onPointerUp:b.nothing}
24
+ @pointercancel=${h?this.onPointerUp:b.nothing}
25
+ @wheel=${c||s?this.onWheel:b.nothing}
26
+ @dblclick=${c||s?()=>s?this.setView(void 0):this.setZoom(void 0):b.nothing}
27
27
  @click=${this.onClick}
28
- @keydown=${h?this.onKeyDown:b.nothing}
28
+ @keydown=${u?this.onKeyDown:b.nothing}
29
29
  @blur=${()=>{this.focused=null,this.highlight(null)}}
30
30
  >
31
31
  <title>${i}</title>
32
- ${o.description?b.svg`<desc>${o.description}</desc>`:b.nothing}
33
- ${p?b.svg`<style>${ht}</style>`:b.nothing} ${xn(o)}
34
- ${ke(o.shapes)}
35
- ${ke(this.tip.length||!this.crossState?this.tip:je(o,this.crossState))}
36
- ${ke(et(o,this.focused))} ${ke(this.overlay)}
32
+ ${a.description?b.svg`<desc>${a.description}</desc>`:b.nothing}
33
+ ${w?b.svg`<style>${gt}</style>`:b.nothing} ${Cn(a)}
34
+ ${Ce(a.shapes)}
35
+ ${Ce(this.tip.length||!this.crossState?this.tip:He(a,this.crossState))}
36
+ ${Ce(it(a,this.focused))} ${Ce(this.overlay)}
37
37
  </svg>
38
- ${M?b.html`<div
38
+ ${m?b.html`<div
39
39
  role="tooltip"
40
40
  data-skdx-tooltip=${r}
41
- style="left:${M.x+12}px;top:${M.y+12}px"
41
+ style="left:${m.x+12}px;top:${m.y+12}px"
42
42
  >
43
- ${M.lines.map(m=>b.html`<div>${m}</div>`)}
43
+ ${m.lines.map(g=>b.html`<div>${g}</div>`)}
44
44
  </div>`:b.nothing}
45
- ${$?b.html`<table data-skdx-table=${r}>
45
+ ${C?b.html`<table data-skdx-table=${r}>
46
46
  <caption>
47
- ${C}
47
+ ${k}
48
48
  </caption>
49
49
  <thead>
50
50
  <tr>
51
- ${($[0]??[]).map(m=>b.html`<th scope="col">${m}</th>`)}
51
+ ${(C[0]??[]).map(g=>b.html`<th scope="col">${g}</th>`)}
52
52
  </tr>
53
53
  </thead>
54
54
  <tbody>
55
- ${$.slice(1).map(m=>b.html`<tr>
56
- ${m.map((g,y)=>y===0?b.html`<th scope="row">${g}</th>`:b.html`<td>${g}</td>`)}
55
+ ${C.slice(1).map(g=>b.html`<tr>
56
+ ${g.map((y,T)=>T===0?b.html`<th scope="row">${y}</th>`:b.html`<td>${y}</td>`)}
57
57
  </tr>`)}
58
58
  </tbody>
59
59
  </table>`:b.nothing}`}};x.styles=b.css`
@@ -109,4 +109,4 @@
109
109
  [role='tooltip'] > :first-child:not(:only-child) {
110
110
  font-weight: bold;
111
111
  }
112
- `,u([(0,f.property)({type:Number})],x.prototype,"width",2),u([(0,f.property)({type:Number})],x.prototype,"height",2),u([(0,f.property)()],x.prototype,"label",2),u([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"legend",2),u([(0,f.property)({type:Boolean,attribute:"no-tooltip",converter:mt})],x.prototype,"tooltip",2),u([(0,f.property)({attribute:!1})],x.prototype,"format",2),u([(0,f.property)({attribute:!1})],x.prototype,"palette",2),u([(0,f.property)({attribute:!1})],x.prototype,"hiddenSeries",2),u([(0,f.property)({attribute:!1})],x.prototype,"selected",2),u([(0,f.property)({attribute:"selection-mode"})],x.prototype,"selectionMode",2),u([(0,f.property)({attribute:!1})],x.prototype,"highlighted",2),u([(0,f.property)({attribute:!1})],x.prototype,"highlightScope",2),u([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"loading",2),u([(0,f.property)()],x.prototype,"error",2),u([(0,f.property)({attribute:"empty-message"})],x.prototype,"emptyMessage",2),u([(0,f.property)()],x.prototype,"description",2),u([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"decorative",2),u([(0,f.property)({type:Boolean,attribute:"accessible-table"})],x.prototype,"accessibleTable",2),u([(0,f.property)({attribute:!1})],x.prototype,"zoom",2),u([(0,f.property)({attribute:!1})],x.prototype,"view",2),u([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"zoomable",2),u([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"editable",2),u([(0,f.property)({attribute:"sync-id"})],x.prototype,"syncId",2),u([(0,f.property)({type:Boolean,attribute:"cross-filter"})],x.prototype,"crossFilter",2),u([(0,f.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],x.prototype,"animated",2),u([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"responsive",2),u([(0,f.state)()],x.prototype,"tip",2),u([(0,f.state)()],x.prototype,"overlay",2),u([(0,f.state)()],x.prototype,"portal",2),u([(0,f.state)()],x.prototype,"measured",2),u([(0,f.state)()],x.prototype,"viewState",2),u([(0,f.state)()],x.prototype,"highlightState",2),u([(0,f.state)()],x.prototype,"crossState",2),u([(0,f.state)()],x.prototype,"focused",2),u([(0,f.state)()],x.prototype,"hiddenState",2),u([(0,f.state)()],x.prototype,"zoomState",2),u([(0,f.state)()],x.prototype,"selectedState",2);var S=class extends x{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:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:d,connectNulls:h,nulls:p,stacked:$,stackOffset:C,orientation:M,radius:m,barGap:g,barWidth:y,sort:T,transform:z,transforms:A,bins:w,binWidth:P,binDomain:Y,binMode:L,sampling:D,brush:N,crosshair:V}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:d,connectNulls:h,nulls:p,stacked:$,stackOffset:C,orientation:M,radius:m,barGap:g,barWidth:y,sort:T,transform:z,transforms:A,bins:w,binWidth:P,binDomain:Y,binMode:L,sampling:D,brush:N,crosshair:V}}};u([(0,f.property)({attribute:!1})],S.prototype,"series",2),u([(0,f.property)({attribute:!1})],S.prototype,"categories",2),u([(0,f.property)({attribute:!1})],S.prototype,"xAxis",2),u([(0,f.property)({attribute:!1})],S.prototype,"yAxis",2),u([(0,f.property)({attribute:!1})],S.prototype,"rightAxis",2),u([(0,f.property)({attribute:!1})],S.prototype,"references",2),u([(0,f.property)({attribute:!1})],S.prototype,"annotations",2),u([(0,f.property)({type:Boolean,reflect:!0})],S.prototype,"labels",2),u([(0,f.property)()],S.prototype,"curve",2),u([(0,f.property)({type:Boolean,attribute:"connect-nulls"})],S.prototype,"connectNulls",2),u([(0,f.property)()],S.prototype,"nulls",2),u([(0,f.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],S.prototype,"stacked",2),u([(0,f.property)({attribute:"stack-offset"})],S.prototype,"stackOffset",2),u([(0,f.property)()],S.prototype,"orientation",2),u([(0,f.property)({type:Number})],S.prototype,"radius",2),u([(0,f.property)({type:Number,attribute:"bar-gap"})],S.prototype,"barGap",2),u([(0,f.property)({type:Number,attribute:"bar-width"})],S.prototype,"barWidth",2),u([(0,f.property)()],S.prototype,"sort",2),u([(0,f.property)()],S.prototype,"transform",2),u([(0,f.property)({attribute:!1})],S.prototype,"transforms",2),u([(0,f.property)({type:Number})],S.prototype,"bins",2),u([(0,f.property)({type:Number,attribute:"bin-width"})],S.prototype,"binWidth",2),u([(0,f.property)({attribute:!1})],S.prototype,"binDomain",2),u([(0,f.property)({attribute:"bin-mode"})],S.prototype,"binMode",2),u([(0,f.property)({attribute:!1})],S.prototype,"sampling",2),u([(0,f.property)({type:Boolean,reflect:!0})],S.prototype,"brush",2),u([(0,f.property)({type:Boolean,reflect:!0})],S.prototype,"crosshair",2);var xn=e=>e.defs&&e.defs.length?b.svg`<defs>${e.defs.map(n=>b.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=>b.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,v.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:b.nothing,ke=e=>b.svg`${e.map((n,t)=>{let r=n.title?b.svg`<title>${n.title}</title>`:b.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return b.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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 b.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,v.ifDefined)(n.rx)} style=${(0,v.ifDefined)(xe(n.part)?`rx:${xe(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,v.ifDefined)(n.stroke)} fill-opacity=${(0,v.ifDefined)(n.opacity)} pointer-events=${(0,v.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return b.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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 b.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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 b.svg`<text aria-label=${(0,v.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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)(i===void 0?"none":void 0)} transform=${(0,v.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var B=class extends x{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,rootId:r,maxDepth:i,labels:o,padding:s,colorScale:a}=this;return this.root(ft({...this.sized(),data:t,rootId:r,maxDepth:i,labels:o,padding:s,colorScale:a}),"circle-packing",this.label??"Circle packing chart")}};u([(0,j.property)({attribute:!1})],B.prototype,"data",2),u([(0,j.property)({attribute:!1})],B.prototype,"rootId",2),u([(0,j.property)({type:Number,attribute:"max-depth"})],B.prototype,"maxDepth",2),u([(0,j.property)({type:Boolean,attribute:"no-labels",converter:mt})],B.prototype,"labels",2),u([(0,j.property)({type:Number})],B.prototype,"padding",2),u([(0,j.property)({attribute:!1})],B.prototype,"colorScale",2),B=u([(0,j.customElement)("skdx-circle-packing-chart")],B);0&&(module.exports={SkdxCirclePackingChart});
112
+ `,p([(0,f.property)({type:Number})],x.prototype,"width",2),p([(0,f.property)({type:Number})],x.prototype,"height",2),p([(0,f.property)()],x.prototype,"label",2),p([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"legend",2),p([(0,f.property)({type:Boolean,attribute:"no-tooltip",converter:yt})],x.prototype,"tooltip",2),p([(0,f.property)({attribute:!1})],x.prototype,"format",2),p([(0,f.property)({attribute:!1})],x.prototype,"palette",2),p([(0,f.property)({attribute:!1})],x.prototype,"hiddenSeries",2),p([(0,f.property)({attribute:!1})],x.prototype,"selected",2),p([(0,f.property)({attribute:"selection-mode"})],x.prototype,"selectionMode",2),p([(0,f.property)({attribute:!1})],x.prototype,"highlighted",2),p([(0,f.property)({attribute:!1})],x.prototype,"highlightScope",2),p([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"loading",2),p([(0,f.property)()],x.prototype,"error",2),p([(0,f.property)({attribute:"empty-message"})],x.prototype,"emptyMessage",2),p([(0,f.property)()],x.prototype,"description",2),p([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"decorative",2),p([(0,f.property)({type:Boolean,attribute:"accessible-table"})],x.prototype,"accessibleTable",2),p([(0,f.property)({attribute:!1})],x.prototype,"zoom",2),p([(0,f.property)({attribute:!1})],x.prototype,"view",2),p([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"zoomable",2),p([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"editable",2),p([(0,f.property)({attribute:"sync-id"})],x.prototype,"syncId",2),p([(0,f.property)({type:Boolean,attribute:"cross-filter"})],x.prototype,"crossFilter",2),p([(0,f.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],x.prototype,"animated",2),p([(0,f.property)({type:Boolean,reflect:!0})],x.prototype,"responsive",2),p([(0,f.state)()],x.prototype,"tip",2),p([(0,f.state)()],x.prototype,"overlay",2),p([(0,f.state)()],x.prototype,"portal",2),p([(0,f.state)()],x.prototype,"measured",2),p([(0,f.state)()],x.prototype,"viewState",2),p([(0,f.state)()],x.prototype,"highlightState",2),p([(0,f.state)()],x.prototype,"crossState",2),p([(0,f.state)()],x.prototype,"focused",2),p([(0,f.state)()],x.prototype,"hiddenState",2),p([(0,f.state)()],x.prototype,"zoomState",2),p([(0,f.state)()],x.prototype,"selectedState",2);var $=class extends x{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:i,yAxis:o,rightAxis:a,references:c,annotations:s,labels:l,curve:d,connectNulls:h,nulls:u,stacked:w,stackOffset:C,orientation:k,radius:m,barGap:g,barWidth:y,sort:T,transform:z,transforms:A,bins:S,binWidth:B,binDomain:Y,binMode:L,sampling:D,brush:R,crosshair:Z}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:a,references:c,annotations:s,labels:l,curve:d,connectNulls:h,nulls:u,stacked:w,stackOffset:C,orientation:k,radius:m,barGap:g,barWidth:y,sort:T,transform:z,transforms:A,bins:S,binWidth:B,binDomain:Y,binMode:L,sampling:D,brush:R,crosshair:Z,...this.compactOverrides()}}};p([(0,f.property)({attribute:!1})],$.prototype,"series",2),p([(0,f.property)({attribute:!1})],$.prototype,"categories",2),p([(0,f.property)({attribute:!1})],$.prototype,"xAxis",2),p([(0,f.property)({attribute:!1})],$.prototype,"yAxis",2),p([(0,f.property)({attribute:!1})],$.prototype,"rightAxis",2),p([(0,f.property)({attribute:!1})],$.prototype,"references",2),p([(0,f.property)({attribute:!1})],$.prototype,"annotations",2),p([(0,f.property)({type:Boolean,reflect:!0})],$.prototype,"labels",2),p([(0,f.property)()],$.prototype,"curve",2),p([(0,f.property)({type:Boolean,attribute:"connect-nulls"})],$.prototype,"connectNulls",2),p([(0,f.property)()],$.prototype,"nulls",2),p([(0,f.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],$.prototype,"stacked",2),p([(0,f.property)({attribute:"stack-offset"})],$.prototype,"stackOffset",2),p([(0,f.property)()],$.prototype,"orientation",2),p([(0,f.property)({type:Number})],$.prototype,"radius",2),p([(0,f.property)({type:Number,attribute:"bar-gap"})],$.prototype,"barGap",2),p([(0,f.property)({type:Number,attribute:"bar-width"})],$.prototype,"barWidth",2),p([(0,f.property)()],$.prototype,"sort",2),p([(0,f.property)()],$.prototype,"transform",2),p([(0,f.property)({attribute:!1})],$.prototype,"transforms",2),p([(0,f.property)({type:Number})],$.prototype,"bins",2),p([(0,f.property)({type:Number,attribute:"bin-width"})],$.prototype,"binWidth",2),p([(0,f.property)({attribute:!1})],$.prototype,"binDomain",2),p([(0,f.property)({attribute:"bin-mode"})],$.prototype,"binMode",2),p([(0,f.property)({attribute:!1})],$.prototype,"sampling",2),p([(0,f.property)({type:Boolean,reflect:!0})],$.prototype,"brush",2),p([(0,f.property)({type:Boolean,reflect:!0})],$.prototype,"crosshair",2);var Cn=e=>e.defs&&e.defs.length?b.svg`<defs>${e.defs.map(n=>b.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=>b.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,v.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:b.nothing,Ce=e=>b.svg`${e.map((n,t)=>{let r=n.title?b.svg`<title>${n.title}</title>`:b.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return b.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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 b.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,v.ifDefined)(n.rx)} style=${(0,v.ifDefined)(ye(n.part)?`rx:${ye(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,v.ifDefined)(n.stroke)} fill-opacity=${(0,v.ifDefined)(n.opacity)} pointer-events=${(0,v.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return b.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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 b.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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 b.svg`<text aria-label=${(0,v.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,v.ifDefined)(i)} 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)(i===void 0?"none":void 0)} transform=${(0,v.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var E=class extends x{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,rootId:r,maxDepth:i,labels:o,padding:a,colorScale:c}=this,s={...this.sized(),data:t,rootId:r,maxDepth:i,labels:o,padding:a,colorScale:c,...this.compactOverrides()};return this.root(xt(s),"circle-packing",this.label??"Circle packing chart",s)}};p([(0,F.property)({attribute:!1})],E.prototype,"data",2),p([(0,F.property)({attribute:!1})],E.prototype,"rootId",2),p([(0,F.property)({type:Number,attribute:"max-depth"})],E.prototype,"maxDepth",2),p([(0,F.property)({type:Boolean,attribute:"no-labels",converter:yt})],E.prototype,"labels",2),p([(0,F.property)({type:Number})],E.prototype,"padding",2),p([(0,F.property)({attribute:!1})],E.prototype,"colorScale",2),E=p([(0,F.customElement)("skdx-circle-packing-chart")],E);0&&(module.exports={SkdxCirclePackingChart});
@@ -1,2 +1,3 @@
1
1
  import 'lit';
2
- export { ak as SkdxCirclePackingChart } from './index-H-_fLjtt.cjs';
2
+ import './types-5xXhTghj.cjs';
3
+ export { j as SkdxCirclePackingChart } from './index-DjnBT-5R.cjs';
@@ -1,2 +1,3 @@
1
1
  import 'lit';
2
- export { ak as SkdxCirclePackingChart } from './index-H-_fLjtt.js';
2
+ import './types-5xXhTghj.js';
3
+ export { j as SkdxCirclePackingChart } from './index-BkR4iVqI.js';