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