@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/parallel.js CHANGED
@@ -1,62 +1,62 @@
1
- var Pt=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var u=(e,n,t,r)=>{for(var i=r>1?void 0:r?Bt(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&&Pt(n,t,i),i};import{customElement as on,property as K}from"lit/decorators.js";var st=e=>Number(e.toPrecision(12)),Dt,Nt=e=>(Dt??(Dt=new Intl.NumberFormat)).format(st(e)),Gt=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 at(e){if(e===void 0)return Nt;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=d=>i?h=>d(h)+i:d,a=d=>r===void 0?d===void 0?{}:{maximumFractionDigits:d}:{minimumFractionDigits:r,maximumFractionDigits:r},l=d=>{let h=new Intl.NumberFormat(t,d);return s(p=>h.format(st(p)))},c=d=>{let h=new Intl.DateTimeFormat(t,o?{...d,timeZone:o}:d);return p=>h.format(p)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(a(2));case"percent":return l({style:"percent",...a(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...a()});case"compact":return l({notation:"compact",...a(1)});case"scientific":return l({notation:"scientific",...a(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Gt)}}function ge([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function be(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),i=10**Math.floor(Math.log10(r)),o=r/i,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*i,a=Math.floor(e/s)*s,l=Math.ceil(n/s)*s,c=[];for(let d=a;d<=l+s/2;d+=s)c.push(Ft(d));return c}var Ft=e=>Number(e.toPrecision(12)),x=e=>Number(e.toFixed(2)),xe=e=>typeof e=="number"&&Number.isFinite(e);function ye(e){let n=1/0,t=-1/0;for(let r of e)xe(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function lt(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let c=`M${t.x} ${t.y}`;for(let d=1;d<e.length;d++){let h=e[d-1],p=e[d];n==="stepAfter"?c+=`H${p.x}V${p.y}`:n==="stepBefore"?c+=`V${p.y}H${p.x}`:c+=`H${x((h.x+p.x)/2)}V${p.y}H${p.x}`}return c}if(n==="linear"||e.length<3)return`M${e.map(c=>`${c.x} ${c.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((c,d)=>c.x-e[d].x),o=e.slice(1).map((c,d)=>c.y-e[d].y),s=i.map((c,d)=>c===0?0:o[d]/c),a=[s[0]];for(let c=1;c<r-1;c++){let d=s[c-1],h=s[c];a.push(d*h<=0?0:(d+h)/2)}a.push(s[r-2]);for(let c=0;c<r-1;c++){let d=s[c];if(d===0){a[c]=0,a[c+1]=0;continue}let h=a[c]/d,p=a[c+1]/d,M=Math.hypot(h,p);M>3&&(a[c]=3*h*d/M,a[c+1]=3*p*d/M)}let l=`M${t.x} ${t.y}`;for(let c=0;c<r-1;c++){let d=e[c],h=e[c+1],p=i[c]/3;l+=`C${x(d.x+p)} ${x(d.y+p*a[c])} ${x(h.x-p)} ${x(h.y-p*a[c+1])} ${h.x} ${h.y}`}return l}var Y=1e3,q=60*Y,X=60*q,re=24*X,ln=[Y,5*Y,15*Y,30*Y,q,5*q,15*q,30*q,X,3*X,6*X,12*X,re,2*re,7*re,14*re];var jt=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Ht=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,_t={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Et(e,n,t){return e.replace(Ht,(r,i,o)=>{let s=_t[i];if(s===void 0)return i+o;let l=(o.match(jt)??[]).map((c,d)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let p=d%s;return s===7?p===5?String(h+n):p===6?String(h+t):c:String(p%2===0?h+n:h+t)});return i+l.join(" ")})}var 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:Et(r.d,n,t)}}});var ve=["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)"))),v={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 dt=(e,n)=>n??ve[e%ve.length];var Vt={top:16,right:16,bottom:32,left:48};function ut(e,n,t=Vt){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 Q(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function ht(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var ie=20,Zt=120,pt=e=>{let n=Q(e);return n&&(n.position==="left"||n.position==="right")?n.width??Zt:0},oe=(e,n=600,t=300)=>({width:(e.width??n)-pt(e),height:(e.height??t)-(Q(e)?.position==="bottom"?ie:0)}),ft=(e,n,t)=>{let r=Q(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,gt(n,t??oe(e).width,r)):1)*ie},F=6.5;function Wt(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 se=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:dt(n)),mt=(e,n)=>e.hiddenSeries?.includes(n)??!1;function we(e,n,t=[],r={},i=10,o=8,s=!1){let a=[],l=r.maxItems,c=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,d=e.length-c.length,h=r.interactive??!0,p=o,M=i,S=(w,k,$,T)=>{let R=(k?18:4)+w.length*F;p>o&&(s||p+R>n-8)&&(p=o,M+=ie),k&&a.push({kind:"rect",part:"legend-swatch",x:p,y:M-5,width:10,height:10,fill:k,opacity:T?.3:void 0,item:$}),a.push({kind:"text",part:"legend-label",x:p+(k?14:0),y:M,text:w,baseline:"middle",fill:T?v.grid:v.label,item:$}),p+=R+12};for(let w of c){let k=t.includes(w.name),$=h?{label:w.name,series:w.name,legend:!0}:void 0;S(r.formatter?.(w.name)??w.name,w.color,$,k)}return d>0&&S(`+${d} more`,void 0,void 0,!1),r.align==="end"?Ut(a,n):a}function Ut(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*F)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var gt=(e,n,t={})=>new Set(we(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function ke(e,n,t,r=[]){let i=Q(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=ht(e),a=o?.position==="bottom",l=pt(e),c=e.hiddenSeries??[],d=o?l?we(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):we(r,n,c,o,a?t+10:10):[],h=a?gt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,h)*ie:t,legendOffset:o?.position==="left"?l:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:d}}function Me(e){let n=e.legendOffset;if(!n)return e;let t=[...ct(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 ae(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/F)),l=s.flatMap(k=>{let $=[],T=Array.from(k);for(;T.length>a;){let R=T.slice(0,a+1).lastIndexOf(" ");R<1&&(R=a),$.push(T.slice(0,R).join("")),T=T.slice(R),T[0]===" "&&T.shift()}return $.push(T.join("")),$}),c=Math.max(1,Math.floor((i-6)/16)),d=l.slice(0,c);l.length>c&&(d[c-1]=Wt(`${d[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...d.map(k=>Array.from(k).length))*F+12),p=Math.min(i,6+d.length*16),M=o==="top"?{x:e-h/2,y:n-p-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-p/2}:o==="right"?{x:e+8,y:n-p/2}:{x:e+12,y:n-p-6},S=Math.max(0,Math.min(r-h,M.x)),w=Math.max(0,Math.min(i-p,M.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
- `),x:x(S),y:x(w),width:x(h),height:p,fill:"var(--skdx-color-surface-raised)",stroke:v.axis,rx:8},...d.map((k,$)=>({kind:"text",part:"tooltip-label",x:x(S+6),y:x(w+11+$*16),text:k,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:d.length>1&&$===0?"bold":void 0}))]}function bt(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}=oe(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)":v.label}),{...ke(e,o,s),shapes:l,tooltip:!1}}var Se=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:v.label,...r});function le(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var $e=e=>e.id??e.name??e.series,xt=e=>e.seriesId??e.series;function j(e,n){let t=!1;return n.id!==void 0&&(t=!0,$e(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,xt(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=$e(e);t!==void 0&&(n.id=t);let r=xt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ce=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Ie(e,n,t){let r=le(e),i=H(n),o=r.some(s=>j(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!j(n,s)):[...r,i]}var Kt=.2;function Yt(e){let n=v.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 qt=(e,n)=>e.kind==="text"?{...e,fill:v.grid}:{...e,opacity:(e.opacity??1)*n};function Te(e,n){let t=le(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:le(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],a=d=>!i||r.some(h=>j(d,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&j(d,{series:h.series})):!1,l=d=>{if(!i||o.faded==="none"||a(d))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&j(d,{series:h})}return!0},c=e.shapes.map(d=>{let h=d.item;if(!h||h.legend)return d;if(t.some(p=>j(h,p))){let p=Yt(d);p&&s.push(p)}return l(h)?qt(d,Kt):d});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var yt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function ce(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?yt:void 0}function U(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 Oe=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function vt(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function J(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=vt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Ae(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[vt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:v.axis,dash:"3 3"}}function ze(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Oe(r.plot,n,t))return[];let i=Ae(e,n),{rows:o}=J(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...ae(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Le(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 ze(e,i,t.plot.y+8)}function Re(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=U(t,r,i,e.width,e.height);if(Oe(e.hit.plot,l,c)){let d=J(e,l),h=Ae(e,l);if(d&&h)return{lines:d.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?_(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 wt(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?_(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find(S=>S.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let d=s?.tooltipAnchored?_(s,e):void 0,h=d?s?.shapes[d.index]:void 0,{x:p,y:M}=h?ee(h):U(n,t,r,i,o);return ae(p,M,c,i,o,s?.tooltipPlacement)}function Pe(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=U(t,r,i,e.width,e.height),a=ze(e,o,s);if(a.length>0)return a}return wt(n,t,r,i,e.width,e.height,e)}function Be(e,n){let t=_(e,n);return t&&!t.item.legend?H(t.item):null}var Xt=(e,n)=>{let{x:t,y:r}=ee(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 De(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!Xt(i,n))continue;let o=H(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Ne=e=>({kind:"rect",part:"selection-box",x:x(e.x),y:x(e.y),width:x(e.width),height:x(e.height),fill:v.focus,opacity:.12,stroke:v.focus}),ue=(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 kt(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 Ge(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}=ee(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!kt(n,o,a))continue;let l=H(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Fe=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${x(n.x)} ${x(n.y)}`).join("L")}`:"",fill:v.focus,fillOpacity:.12,stroke:v.focus,dash:"4 3"}),de=6;function je(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-de||n>i.x1+de))return Math.abs(n-i.x0)<=de?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=de?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function He(e,n,t){let r=e.edit;return Mt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function _e(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 Mt(r,{bar:o,mode:s},i*a)}function Mt(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 Ee(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:v.focus,opacity:.25,stroke:v.focus,rx:2}}var Qt=64,Jt=e=>Math.max(1,Math.min(Qt,e));function Ve(e,n,t,r){let i=n>0?.8:1.25,o=Jt(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[l,c]=e.view.center,d=(t-(s.x+s.width/2))/a,h=(r-(s.y+s.height/2))/a,p=e.view.zoom/o;return{center:[l+d*(1-p),e.fromY(e.toY(c)-h*(1-p))],zoom:o}}function Ze(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 _(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 he=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function ee(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 We(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=v.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:s}=ee(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?ae(x(o),x(s),a,e.width,e.height):[]]}function Ue(e,n,t){let r=he(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 Z=2,W=(e,n,t)=>{let r=Math.max(Z,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},St=(e,n)=>!e||e.start<=0&&e.end>=n;function Ke(e,n,t){if(e.count<=Z||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(Z,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!St(e.zoom,e.count)?W(r,a,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+l*o;return W(c-l*a,a,e.count)}function Ye(e,n,t,r){let i=n.end-n.start,o=Math.max(Z,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 W(n.start+s*i-s*o,o,e.count)}function qe(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return W(n.start-t/i,r,e.count)}function Xe(e,n,t){let r=e.brush;if(!r||!Oe(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:W(s-o/2,o,e.count)}}function Qe(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 W(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-Z,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+Z,Math.round(t.end+o)));return{start:t.start,end:s}}function et(e,n){switch(n.type){case"svg":return Promise.resolve(Je(e,n.label,n.resolve));case"csv":return Promise.resolve(Tt(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=Je(e,n.label,n.resolve);return It(t,e.width,e.height,n.scale,n.background)}}}var D=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),te=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${D(String(t))}"`).join("");function $t(e){let n=e.title?`<title>${D(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${te([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${te([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${te([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${te([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${te([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]])}>${D(e.text)}</text>`}}function Ct(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${D(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="${D(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function Je(e,n,t){let r=Ct(e)+e.shapes.map($t).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="${D(n)}"`,o=e.description?`<desc>${D(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="${D(v.fontFamily)}" font-size="${D(v.fontSize)}"><title>${D(n)}</title>${o}${r}</svg>`}function It(e,n,t,r=2,i){return new Promise((o,s)=>{let a=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(a);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let d=c.getContext("2d");if(!d)return s(new Error("canvas 2d context unavailable"));i&&(d.fillStyle=i,d.fillRect(0,0,c.width,c.height)),d.drawImage(l,0,0,c.width,c.height),c.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function Tt(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 tt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let a=r.rows[0];if(r.rows.length>t)return;let l=["",...a.slice(1).map(d=>d.replace(/:\s[^:]*$/,""))],c=r.rows.map(d=>[d[0],...d.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[l,...c]}let i=e.shapes.flatMap(a=>a.item&&!a.item.legend&&!(a.part==="anchor"&&!a.title)?[a.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(a=>i.some(l=>l[a]!==void 0)),s=(a,l)=>a[l]===void 0?"":String(a[l]);return[o.map(a=>a[0]?.toUpperCase()+a.slice(1)),...i.map(a=>o.map(l=>s(a,l)))]}var nt=new Map;function pe(e){let n=nt.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&&nt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return nt.set(e,{group:i,listeners:t}),i}var Ot='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',rt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Ot}{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){${Ot}{animation:none;transition:none}}`;function it(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var At=500;function ot(e){let n=[],t=e.dimensions,r=e.data.filter(m=>!(m.group!==void 0&&mt(e,m.group))),i=bt(e,t.length===0||r.length===0);if(i)return{...i,issues:n};let{width:o,height:s}=oe(e),a=[...new Set(e.data.map(m=>m.group).filter(m=>m!==void 0))],l=t[0],c=t[t.length-1],d=m=>(m.label??m.key).length*F/2+8,h=a.map((m,O)=>({name:m,color:se(e,O)})),p=ut(o,s,{top:28+ft(e,h,o),right:Math.max(16,d(c)),bottom:16,left:Math.max(48,d(l))}),M=(m,O)=>{let I=m.values[O];return I==null?null:xe(I)?I:(n.push({code:"invalid-value",severity:"warning",message:`"${m.name}" has a value on "${O}" that is not a number; drawn as a gap.`,itemId:m.id??m.name}),null)},S=t.map((m,O)=>{let[I,z]=ye(r.map(V=>M(V,m.key))),G=be(m.min??I,m.max??z),A=m.min??G[0],P=m.max??G[G.length-1],me=m.reversed?[p.y,p.y+p.height]:[p.y+p.height,p.y],zt=ge([A,P],me),Lt=x(t.length===1?p.x+p.width/2:p.x+O*p.width/(t.length-1)),Rt=at(m.format??e.format);return{d:m,x:Lt,scale:V=>x(zt(Math.max(A,Math.min(P,V)))),format:Rt,ticks:G.filter(V=>V>=A-1e-9&&V<=P+1e-9)}}),w=[];S.forEach((m,O)=>{w.push({kind:"line",part:"axis",x1:m.x,x2:m.x,y1:p.y,y2:p.y+p.height,stroke:v.axis});let I=O===S.length-1&&S.length>1?"start":"end";for(let z of m.ticks)w.push(Se(x(I==="end"?m.x-6:m.x+6),m.scale(z),m.format(z),{part:"y-label",anchor:I,baseline:"middle"}));w.push(Se(m.x,p.y-12,m.d.label??m.d.key,{part:"axis-title",anchor:"middle"}))});let k=r.length<=At,$=e.opacity??(r.length>200?.25:.6),T=m=>(e.filters??[]).every(O=>{let I=M(m,O.key);return I!==null&&I>=(O.min??-1/0)&&I<=(O.max??1/0)}),R=r.map((m,O)=>{let I=[],z=[];for(let A of S){let P=M(m,A.d.key);if(P===null){!e.connectNulls&&z.length&&(I.push(z),z=[]);continue}z.push({x:A.x,y:A.scale(P)})}z.length&&I.push(z);let G=`${m.name}: ${S.map(A=>{let P=M(m,A.d.key);return`${A.d.label??A.d.key} ${P===null?"\u2014":A.format(P)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:I.map(A=>lt(A,e.curve)).join(""),stroke:m.color??(m.group!==void 0?se(e,a.indexOf(m.group)):se(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:T(m)?$:.08,title:k?G:void 0,item:k?{label:G,id:m.id??m.name,name:m.name,category:m.group,index:O}:void 0}}),ne=ke(e,o,s,h);return{...ne,shapes:[...w,...R,...ne.shapes],issues:n}}import{css as en,html as E,LitElement as tn,nothing as C,svg as L}from"lit";import{property as f,state as B}from"lit/decorators.js";import{ifDefined as b}from"lit/directives/if-defined.js";var nn={fromAttribute:()=>!1},g=class extends tn{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=[Ne(ue(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=[Fe(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=He(r,i.gantt,o-i.x),this.overlay=[Ee(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(Ze(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(Ye(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"?qe(r.hit,i.zoom,o-i.x):Qe(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Re(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=Pe(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Be(r,t.target)),this.syncId&&r.hit?.crosshair){let o=J(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=_(r,t.target)?.item.legend,a=this.canEdit(r)?je(r,i,o):void 0;if(a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:a},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let l=r.hit;if(!(!l||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[c,d]=[...this.pointers.values()];this.drag={x:(c+d)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-d)||1}}else{let c=Xe(l,i,o);if(c)this.drag={x:i,y:o,zoom:c.zoom,grab:c.grab},c.zoom!==l.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&i>=l.plot.x&&i<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:i,y:o,zoom:l.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:a}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(a-i.y)>2){i.grab==="select"?this.setSelected(De(o,ue(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(Ge(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(Ve(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=Ke(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=_(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)?_e(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=Ue(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:c,emptyMessage:d,description:h,decorative:p,animated:M,responsive:S,highlighted:w,highlightScope:k,accessibleTable:$}=this;return{width:S&&this.measured?this.measured:t,height:r,animate:M,responsive:S,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:d,description:h,decorative:p,highlighted:w===void 0?this.highlightState:w,highlightScope:k,accessibleTable:$,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&&pe(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=pe(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&&Ce(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(Ie(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 U(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&&j(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?et(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Te(Me(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let k of o.issues??[])this.emit("skdx-data-issue",k)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),d=s||a||l||c,h=!o.decorative&&he(o).length>0,p=it(o),M=tt(o,this.accessibleTable),S=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,w=this.portal;return E`<svg
1
+ var _t=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var p=(e,n,t,r)=>{for(var i=r>1?void 0:r?Gt(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&&_t(n,t,i),i};import{customElement as hn,property as q}from"lit/decorators.js";var dt=new Set(["__proto__","constructor","prototype"]),be="skdx-chart-snapshot-request-v1";function xe(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(be,t),()=>e.removeEventListener(be,t)}function j(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function ye(e,n,t){let r=[],i=0,o=new Set,s=(a,c,d=0)=>{if(++i>1e5||d>64)throw new Error("Chart snapshot exceeds bounded input size/depth");if(a===null||typeof a=="boolean"||typeof a=="string")return a;if(typeof a=="number")return Number.isFinite(a)?a:{$number:String(a)};if(a===void 0)return;if(typeof a=="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(a instanceof Date)return Number.isFinite(a.getTime())?{$date:a.toISOString()}:{$date:"Invalid Date"};if(!Array.isArray(a)&&!j(a))throw new Error(`Unsupported chart snapshot value at ${c}`);if(o.has(a))throw new Error(`Cyclic chart input at ${c}`);o.add(a);let h;if(Array.isArray(a))h=a.map((u,b)=>s(u,`${c}[${b}]`,d+1)??null);else{let u=[];for(let[b,C]of Object.entries(a)){if(dt.has(b))throw new Error("Unsafe chart snapshot key");let k=s(C,`${c}.${b}`,d+1);k!==void 0&&u.push([b,k])}h=Object.fromEntries(u)}return o.delete(a),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 ht({schemaVersion:"1.0.0",kind:e,configuration:s(n,"input"),canvas:s(l,"canvas"),diagnostics:r})}function ht(e){let n=0,t=(a,c=0)=>{if(++n>1e5||c>64)throw new Error("Chart snapshot exceeds bounded input size/depth");if(!(a===null||typeof a=="boolean"||typeof a=="string")&&!(typeof a=="number"&&Number.isFinite(a))){if(Array.isArray(a)){a.forEach(d=>t(d,c+1));return}if(!j(a))throw new Error("Chart snapshot must contain plain JSON only");for(let[d,h]of Object.entries(a)){if(dt.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(!j(e)||Object.keys(e).some(a=>!["schemaVersion","kind","configuration","canvas","diagnostics"].includes(a))||e.schemaVersion!=="1.0.0"||typeof e.kind!="string"||!/^[a-z][a-z0-9-]*$/.test(e.kind)||!j(e.configuration)||!j(e.canvas)||!Array.isArray(e.diagnostics))throw new Error("Unsupported chart snapshot envelope");let r=e.canvas;if(Object.keys(r).some(a=>!["width","height","shapes","defs","issues","table"].includes(a)))throw new Error("Unsupported runtime geometry field");let i=(a,c=-1e5)=>typeof a=="number"&&Number.isFinite(a)&&a>=c&&a<=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"]},s={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 a of r.shapes){if(!j(a)||typeof a.kind!="string"||!Object.hasOwn(o,a.kind)||typeof a.part!="string"||!a.part||Object.keys(a).some(c=>!["kind","part","title","item",...o[a.kind]??[]].includes(c)))throw new Error("Unsupported owner shape");for(let c of s[a.kind]??[])if(!(c in a))throw new Error("Missing owner geometry field");for(let[c,d]of Object.entries(a)){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(a.kind==="path"&&(typeof a.d!="string"||!/^\s*[Mm][MmLlHhVvCcSsQqTtAaZz0-9eE+.,\s-]*$/.test(a.d)||(a.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(a[c]!==void 0&&(typeof a[c]!="string"||!d.includes(a[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 a=new Set;for(let c of r.defs){if(!j(c)||typeof c.id!="string"||!/^[A-Za-z][\w-]*$/.test(c.id)||a.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");a.add(c.id);let d=-1;for(let h of c.stops){if(!j(h)||Object.keys(h).some(u=>!["offset","color","opacity"].includes(u))||!i(h.offset,0)||h.offset>1||h.offset<d||typeof h.color!="string"||h.opacity!==void 0&&(!i(h.opacity,0)||h.opacity>1))throw new Error("Invalid owner gradient stop");d=h.offset}}}for(let a of e.diagnostics)if(!j(a)||Object.keys(a).some(c=>!["code","path","message"].includes(c))||[a.code,a.path,a.message].some(c=>typeof c!="string"||!c))throw new Error("Invalid snapshot diagnostic");return e}var ut=e=>Number(e.toPrecision(12)),Ft,Vt=e=>(Ft??(Ft=new Intl.NumberFormat)).format(ut(e)),Ht=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 pt(e){if(e===void 0)return Vt;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=d=>i?h=>d(h)+i:d,l=d=>r===void 0?d===void 0?{}:{maximumFractionDigits:d}:{minimumFractionDigits:r,maximumFractionDigits:r},a=d=>{let h=new Intl.NumberFormat(t,d);return s(u=>h.format(ut(u)))},c=d=>{let h=new Intl.DateTimeFormat(t,o?{...d,timeZone:o}:d);return u=>h.format(u)};switch(n){case"integer":return a({maximumFractionDigits:0});case"decimal":return a(l(2));case"percent":return a({style:"percent",...l(0)});case"currency":return a({style:"currency",currency:e.currency??"USD",...l()});case"compact":return a({notation:"compact",...l(1)});case"scientific":return a({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 s(Ht)}}function ve([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function we(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),i=10**Math.floor(Math.log10(r)),o=r/i,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*i,l=Math.floor(e/s)*s,a=Math.ceil(n/s)*s,c=[];for(let d=l;d<=a+s/2;d+=s)c.push(Zt(d));return c}var Zt=e=>Number(e.toPrecision(12)),y=e=>Number(e.toFixed(2)),ke=e=>typeof e=="number"&&Number.isFinite(e);function Se(e){let n=1/0,t=-1/0;for(let r of e)ke(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function ft(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let c=`M${t.x} ${t.y}`;for(let d=1;d<e.length;d++){let h=e[d-1],u=e[d];n==="stepAfter"?c+=`H${u.x}V${u.y}`:n==="stepBefore"?c+=`V${u.y}H${u.x}`:c+=`H${y((h.x+u.x)/2)}V${u.y}H${u.x}`}return c}if(n==="linear"||e.length<3)return`M${e.map(c=>`${c.x} ${c.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((c,d)=>c.x-e[d].x),o=e.slice(1).map((c,d)=>c.y-e[d].y),s=i.map((c,d)=>c===0?0:o[d]/c),l=[s[0]];for(let c=1;c<r-1;c++){let d=s[c-1],h=s[c];l.push(d*h<=0?0:(d+h)/2)}l.push(s[r-2]);for(let c=0;c<r-1;c++){let d=s[c];if(d===0){l[c]=0,l[c+1]=0;continue}let h=l[c]/d,u=l[c+1]/d,b=Math.hypot(h,u);b>3&&(l[c]=3*h*d/b,l[c+1]=3*u*d/b)}let a=`M${t.x} ${t.y}`;for(let c=0;c<r-1;c++){let d=e[c],h=e[c+1],u=i[c]/3;a+=`C${y(d.x+u)} ${y(d.y+u*l[c])} ${y(h.x-u)} ${y(h.y-u*l[c+1])} ${h.x} ${h.y}`}return a}var X=1e3,Y=60*X,J=60*Y,ie=24*J,mn=[X,5*X,15*X,30*X,Y,5*Y,15*Y,30*Y,J,3*J,6*J,12*J,ie,2*ie,7*ie,14*ie];var Wt=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Ut=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,Kt={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function qt(e,n,t){return e.replace(Ut,(r,i,o)=>{let s=Kt[i];if(s===void 0)return i+o;let a=(o.match(Wt)??[]).map((c,d)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let u=d%s;return s===7?u===5?String(h+n):u===6?String(h+t):c:String(u%2===0?h+n:h+t)});return i+a.join(" ")})}var mt=(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:qt(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)"))),w={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 gt=(e,n)=>n??Ce[e%Ce.length];var Xt={top:16,right:16,bottom:32,left:48};function bt(e,n,t=Xt){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 Q(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function xt(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,Yt=120,yt=e=>{let n=Q(e);return n&&(n.position==="left"||n.position==="right")?n.width??Yt:0},se=(e,n=600,t=300)=>({width:(e.width??n)-yt(e),height:(e.height??t)-(Q(e)?.position==="bottom"?oe:0)}),vt=(e,n,t)=>{let r=Q(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,kt(n,t??se(e).width,r)):1)*oe},_=6.5;function Jt(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/_));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ae=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:gt(n)),wt=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Me(e,n,t=[],r={},i=10,o=8,s=!1){let l=[],a=r.maxItems,c=a!==void 0&&a>=0&&e.length>a?e.slice(0,a):e,d=e.length-c.length,h=r.interactive??!0,u=o,b=i,C=(k,M,S,T)=>{let z=(M?18:4)+k.length*_;u>o&&(s||u+z>n-8)&&(u=o,b+=oe),M&&l.push({kind:"rect",part:"legend-swatch",x:u,y:b-5,width:10,height:10,fill:M,opacity:T?.3:void 0,item:S}),l.push({kind:"text",part:"legend-label",x:u+(M?14:0),y:b,text:k,baseline:"middle",fill:T?w.grid:w.label,item:S}),u+=z+12};for(let k of c){let M=t.includes(k.name),S=h?{label:k.name,series:k.name,legend:!0}:void 0;C(r.formatter?.(k.name)??k.name,k.color,S,M)}return d>0&&C(`+${d} more`,void 0,void 0,!1),r.align==="end"?Qt(l,n):l}function Qt(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*_)),s=n-8-o;for(let l of i)r.push({...l,x:l.x+s})}return r}var kt=(e,n,t={})=>new Set(Me(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function $e(e,n,t,r=[]){let i=Q(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=xt(e),l=o?.position==="bottom",a=yt(e),c=e.hiddenSeries??[],d=o?a?Me(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):Me(r,n,c,o,l?t+10:10):[],h=l?kt(r,n,o):0;return{width:n+a,height:l?t+Math.max(1,h)*oe:t,legendOffset:o?.position==="left"?a:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:d}}function Ie(e){let n=e.legendOffset;if(!n)return e;let t=[...mt(e.shapes.filter(a=>!a.part.startsWith("legend-")),n,0),...e.shapes.filter(a=>a.part.startsWith("legend-"))],r=a=>({...a,x:a.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(a=>a+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:a=>o.scale(a)+n,invert:a=>o.invert(a-n),bars:o.bars.map(a=>({...a,x0:a.x0+n,x1:a.x1+n}))}:void 0,l=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:l,legendOffset:void 0}}function ce(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],l=Math.max(1,Math.floor((r-12)/_)),a=s.flatMap(M=>{let S=[],T=Array.from(M);for(;T.length>l;){let z=T.slice(0,l+1).lastIndexOf(" ");z<1&&(z=l),S.push(T.slice(0,z).join("")),T=T.slice(z),T[0]===" "&&T.shift()}return S.push(T.join("")),S}),c=Math.max(1,Math.floor((i-6)/16)),d=a.slice(0,c);a.length>c&&(d[c-1]=Jt(`${d[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...d.map(M=>Array.from(M).length))*_+12),u=Math.min(i,6+d.length*16),b=o==="top"?{x:e-h/2,y:n-u-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-u/2}:o==="right"?{x:e+8,y:n-u/2}:{x:e+12,y:n-u-6},C=Math.max(0,Math.min(r-h,b.x)),k=Math.max(0,Math.min(i-u,b.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
+ `),x:y(C),y:y(k),width:y(h),height:u,fill:"var(--skdx-color-surface-raised)",stroke:w.axis,rx:8},...d.map((M,S)=>({kind:"text",part:"tooltip-label",x:y(C+6),y:y(k+11+S*16),text:M,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:d.length>1&&S===0?"bold":void 0}))]}function St(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}=se(e,t,r),l=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",a=[];return i==="loading"&&a.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:8}),a.push({kind:"text",part:`state-${i}`,x:y(o/2),y:y(s/2),text:l,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":w.label}),{...$e(e,o,s),shapes:a,tooltip:!1}}var Te=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:w.label,...r});function le(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,Ct=e=>e.seriesId??e.series;function G(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,Ct(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 F(e){let n={},t=Oe(e);t!==void 0&&(n.id=t);let r=Ct(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 ze(e,n,t){let r=le(e),i=F(n),o=r.some(s=>G(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!G(n,s)):[...r,i]}var en=.2;function tn(e){let n=w.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 nn=(e,n)=>e.kind==="text"?{...e,fill:w.grid}:{...e,opacity:(e.opacity??1)*n};function Le(e,n){let t=le(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:le(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=[],l=d=>!i||r.some(h=>G(d,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&G(d,{series:h.series})):!1,a=d=>{if(!i||o.faded==="none"||l(d))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&G(d,{series:h})}return!0},c=e.shapes.map(d=>{let h=d.item;if(!h||h.legend)return d;if(t.some(u=>G(h,u))){let u=tn(d);u&&s.push(u)}return a(h)?nn(d,en):d});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var Mt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function de(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Mt:void 0}function K(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 Re=(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 s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function ee(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 Ee(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:w.axis,dash:"3 3"}}function Pe(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Re(r.plot,n,t))return[];let i=Ee(e,n),{rows:o}=ee(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...ce(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Be(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 Pe(e,i,t.plot.y+8)}function Ne(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:a,y:c}=K(t,r,i,e.width,e.height);if(Re(e.hit.plot,a,c)){let d=ee(e,a),h=Ee(e,a);if(d&&h)return{lines:d.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?V(e,n)?.item:void 0,l=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(a=>a.tagName.toLowerCase()==="title")?.textContent;return l?{lines:Array.isArray(l)?l:[l],shapes:[]}:{lines:[],shapes:[]}}function It(e,n,t,r,i,o,s){let l=e?.closest?.("[data-skdx-part]"),a=s&&s.tooltipFormatter?V(s,e)?.item:void 0,c=a&&s?.tooltipFormatter?.(a)||l&&Array.from(l.children).find(C=>C.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let d=s?.tooltipAnchored?V(s,e):void 0,h=d?s?.shapes[d.index]:void 0,{x:u,y:b}=h?te(h):K(n,t,r,i,o);return ce(u,b,c,i,o,s?.tooltipPlacement)}function De(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=K(t,r,i,e.width,e.height),l=Pe(e,o,s);if(l.length>0)return l}return It(n,t,r,i,e.width,e.height,e)}function je(e,n){let t=V(e,n);return t&&!t.item.legend?F(t.item):null}var rn=(e,n)=>{let{x:t,y:r}=te(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 _e(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!rn(i,n))continue;let o=F(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Ge=e=>({kind:"rect",part:"selection-box",x:y(e.x),y:y(e.y),width:y(e.width),height:y(e.height),fill:w.focus,opacity:.12,stroke:w.focus}),ue=(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 Tt(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],l=e[o];s.y>t!=l.y>t&&n<(l.x-s.x)*(t-s.y)/(l.y-s.y)+s.x&&(r=!r)}return r}function Fe(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}=te(i),l=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Tt(n,o,l))continue;let a=F(i.item),c=JSON.stringify(a);t.has(c)||(t.add(c),r.push(a))}return r}var Ve=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${y(n.x)} ${y(n.y)}`).join("L")}`:"",fill:w.focus,fillOpacity:.12,stroke:w.focus,dash:"4 3"}),he=6;function He(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-he||n>i.x1+he))return Math.abs(n-i.x0)<=he?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=he?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function Ze(e,n,t){let r=e.edit;return Ot(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function We(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(a=>a.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",l=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Ot(r,{bar:o,mode:s},i*l)}function Ot(e,{bar:n,mode:t},r){let i=l=>e.snap?Math.round(l/e.snap)*e.snap:l,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 Ue(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:w.focus,opacity:.25,stroke:w.focus,rx:2}}var on=64,sn=e=>Math.max(1,Math.min(on,e));function Ke(e,n,t,r){let i=n>0?.8:1.25,o=sn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:l}=e,[a,c]=e.view.center,d=(t-(s.x+s.width/2))/l,h=(r-(s.y+s.height/2))/l,u=e.view.zoom/o;return{center:[a+d*(1-u),e.fromY(e.toY(c)-h*(1-u))],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 V(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var pe=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function te(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 Xe(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=w.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*_+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}=te(t),l=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...l?ce(y(o),y(s),l,e.width,e.height):[]]}function Ye(e,n,t){let r=pe(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 W=2,U=(e,n,t)=>{let r=Math.max(W,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},At=(e,n)=>!e||e.start<=0&&e.end>=n;function Je(e,n,t){if(e.count<=W||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,l=Math.max(W,Math.min(e.count,Math.round(o*s)));if(l===o)return n>0&&!At(e.zoom,e.count)?U(r,l,e.count):void 0;let a=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+a*o;return U(c-a*l,l,e.count)}function Qe(e,n,t,r){let i=n.end-n.start,o=Math.max(W,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 U(n.start+s*i-s*o,o,e.count)}function et(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return U(n.start-t/i,r,e.count)}function tt(e,n,t){let r=e.brush;if(!r||!Re(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:U(s-o/2,o,e.count)}}function nt(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 U(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-W,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+W,Math.round(t.end+o)));return{start:t.start,end:s}}function it(e,n){switch(n.type){case"svg":return Promise.resolve(rt(e,n.label,n.resolve));case"csv":return Promise.resolve(Et(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=rt(e,n.label,n.resolve);return Rt(t,e.width,e.height,n.scale,n.background)}}}var B=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),ne=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${B(String(t))}"`).join("");function zt(e){let n=e.title?`<title>${B(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${ne([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${ne([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${ne([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${ne([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${ne([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]])}>${B(e.text)}</text>`}}function Lt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${B(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="${B(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function rt(e,n,t){let r=Lt(e)+e.shapes.map(zt).join("");t&&(r=r.replace(/var\((--[\w-]+)\)/g,(s,l)=>t(l).trim()||s));let i=e.decorative?'aria-hidden="true"':`role="img" aria-label="${B(n)}"`,o=e.description?`<desc>${B(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="${B(w.fontFamily)}" font-size="${B(w.fontSize)}"><title>${B(n)}</title>${o}${r}</svg>`}function Rt(e,n,t,r=2,i){return new Promise((o,s)=>{let l=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),a=new Image;a.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 s(new Error("canvas 2d context unavailable"));i&&(d.fillStyle=i,d.fillRect(0,0,c.width,c.height)),d.drawImage(a,0,0,c.width,c.height),c.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},a.onerror=()=>{URL.revokeObjectURL(l),s(new Error("svg could not be decoded"))},a.src=l})}function Et(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 ot(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 a=["",...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[a,...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(a=>a[l]!==void 0)),s=(l,a)=>l[a]===void 0?"":String(l[a]);return[o.map(l=>l[0]?.toUpperCase()+l.slice(1)),...i.map(l=>o.map(a=>s(l,a)))]}var st=new Map;function fe(e){let n=st.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&&st.delete(e)}},publish(o,s){Object.assign(r,o);for(let l of t)l(o,s)}};return st.set(e,{group:i,listeners:t}),i}var Pt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',at=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Pt}{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){${Pt}{animation:none;transition:none}}`;function ct(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var Bt=500;function lt(e){let n=[],t=e.dimensions,r=e.data.filter(m=>!(m.group!==void 0&&wt(e,m.group))),i=St(e,t.length===0||r.length===0);if(i)return{...i,issues:n};let{width:o,height:s}=se(e),l=[...new Set(e.data.map(m=>m.group).filter(m=>m!==void 0))],a=t[0],c=t[t.length-1],d=m=>(m.label??m.key).length*_/2+8,h=l.map((m,O)=>({name:m,color:ae(e,O)})),u=bt(o,s,{top:28+vt(e,h,o),right:Math.max(16,d(c)),bottom:16,left:Math.max(48,d(a))}),b=(m,O)=>{let I=m.values[O];return I==null?null:ke(I)?I:(n.push({code:"invalid-value",severity:"warning",message:`"${m.name}" has a value on "${O}" that is not a number; drawn as a gap.`,itemId:m.id??m.name}),null)},C=t.map((m,O)=>{let[I,L]=Se(r.map(Z=>b(Z,m.key))),D=we(m.min??I,m.max??L),A=m.min??D[0],E=m.max??D[D.length-1],ge=m.reversed?[u.y,u.y+u.height]:[u.y+u.height,u.y],Nt=ve([A,E],ge),Dt=y(t.length===1?u.x+u.width/2:u.x+O*u.width/(t.length-1)),jt=pt(m.format??e.format);return{d:m,x:Dt,scale:Z=>y(Nt(Math.max(A,Math.min(E,Z)))),format:jt,ticks:D.filter(Z=>Z>=A-1e-9&&Z<=E+1e-9)}}),k=[];C.forEach((m,O)=>{k.push({kind:"line",part:"axis",x1:m.x,x2:m.x,y1:u.y,y2:u.y+u.height,stroke:w.axis});let I=O===C.length-1&&C.length>1?"start":"end";for(let L of m.ticks)k.push(Te(y(I==="end"?m.x-6:m.x+6),m.scale(L),m.format(L),{part:"y-label",anchor:I,baseline:"middle"}));k.push(Te(m.x,u.y-12,m.d.label??m.d.key,{part:"axis-title",anchor:"middle"}))});let M=r.length<=Bt,S=e.opacity??(r.length>200?.25:.6),T=m=>(e.filters??[]).every(O=>{let I=b(m,O.key);return I!==null&&I>=(O.min??-1/0)&&I<=(O.max??1/0)}),z=r.map((m,O)=>{let I=[],L=[];for(let A of C){let E=b(m,A.d.key);if(E===null){!e.connectNulls&&L.length&&(I.push(L),L=[]);continue}L.push({x:A.x,y:A.scale(E)})}L.length&&I.push(L);let D=`${m.name}: ${C.map(A=>{let E=b(m,A.d.key);return`${A.d.label??A.d.key} ${E===null?"\u2014":A.format(E)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:I.map(A=>ft(A,e.curve)).join(""),stroke:m.color??(m.group!==void 0?ae(e,l.indexOf(m.group)):ae(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:T(m)?S:.08,title:M?D:void 0,item:M?{label:D,id:m.id??m.name,name:m.name,category:m.group,index:O}:void 0}}),re=$e(e,o,s,h);return{...re,shapes:[...k,...z,...re.shapes],issues:n}}import{css as an,html as H,LitElement as cn,nothing as $,svg as R}from"lit";import{property as f,state as P}from"lit/decorators.js";import{ifDefined as x}from"lit/directives/if-defined.js";var ln={fromAttribute:()=>!1},g=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:s}=this.viewBox(t,r);this.overlay=[Ge(ue(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=[Ve(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=Ze(r,i.gantt,o-i.x),this.overlay=[Ue(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,l]=[...this.pointers.values()];if(s===void 0||l===void 0||!i.distance)return;this.setZoom(Qe(r.hit,i.zoom,Math.abs(s-l)/i.distance,(s+l)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?et(r.hit,i.zoom,o-i.x):nt(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Ne(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=De(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(je(r,t.target)),this.syncId&&r.hit?.crosshair){let o=ee(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=V(r,t.target)?.item.legend,l=this.canEdit(r)?He(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()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let a=r.hit;if(!(!a||!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:a.zoom,grab:"pinch",distance:Math.abs(c-d)||1}}else{let c=tt(a,i,o);if(c)this.drag={x:i,y:o,zoom:c.zoom,grab:c.grab},c.zoom!==a.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&i>=a.plot.x&&i<=a.plot.x+a.plot.width&&o>=a.plot.y&&o<=a.plot.y+a.plot.height)this.drag={x:i,y:o,zoom:a.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:l}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(l-i.y)>2){i.grab==="select"?this.setSelected(_e(o,ue(i.x,i.y,s,l))):i.grab==="lasso"?this.setSelected(Fe(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 a=r.map.plot;if(i<a.x||i>a.x+a.width||o<a.y||o>a.y+a.height)return;t.preventDefault(),this.setView(Ke(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 l=Je(s,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=V(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{if(t.key==="Escape"){t.preventDefault(),this.focused=null,this.clearTip(),this.crossState=null,this.highlight(null);return}let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let l=r.shapes[this.focused]?.item;l&&(t.preventDefault(),this.select(l),this.emit("skdx-item-click",l));return}let i=this.canEdit(r)?We(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=Ye(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?F(s):null)}}updated(){let t=this.renderRoot.querySelector("svg")??void 0;t===this.snapshotSvg&&this.removeSnapshot||(this.removeSnapshot?.(),this.snapshotSvg=t,this.removeSnapshot=t?xe(t,()=>{if(!this.snapshotConfiguration||!this.layout)throw new Error("Actual owner chart configuration unavailable");return ye(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:s,palette:l,loading:a,error:c,emptyMessage:d,description:h,decorative:u,animated:b,responsive:C,highlighted:k,highlightScope:M,accessibleTable:S}=this;return{width:C&&this.measured?this.measured:t,height:r,animate:b,responsive:C,legend:i,tooltip:o,format:s,palette:l,loading:a,error:c,emptyMessage:d,description:h,decorative:u,highlighted:k===void 0?this.highlightState:k,highlightScope:M,accessibleTable:S,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&&fe(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=fe(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(ze(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 K(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&&G(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?it(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i,o){this.join();let s=Le(Ie(t),this.sized());if(this.layout=s,this.snapshotKind=r,this.snapshotConfiguration=o,s.issues!==this.reported){this.reported=s.issues;for(let S of s.issues??[])this.emit("skdx-data-issue",S)}let l=this.canZoom(s),a=this.canPan(s),c=this.canEdit(s),d=this.brushing(),h=l||a||c||d,u=!s.decorative&&pe(s).length>0,b=ct(s),C=ot(s,this.accessibleTable),k=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,M=this.portal;return H`<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":C}
10
- aria-label=${o.decorative?C:i}
11
- aria-description=${b(o.description)}
12
- tabindex=${h?0:C}
5
+ viewBox="0 0 ${s.width} ${s.height}"
6
+ width=${s.width}
7
+ height=${s.height}
8
+ role=${s.decorative?"presentation":"img"}
9
+ aria-hidden=${s.decorative?"true":$}
10
+ aria-label=${s.decorative?$:i}
11
+ aria-description=${x(s.description)}
12
+ tabindex=${u?0:$}
13
13
  data-skdx-chart=${r}
14
- data-zoomable=${s||a?"":C}
15
- data-brushing=${c&&!(s||a)?"":C}
16
- data-editable=${l?"":C}
17
- style=${p?`--skdx-chart-duration:${p}`:C}
18
- font-family=${v.fontFamily}
19
- font-size=${v.fontSize}
20
- @pointermove=${o.tooltip||d?this.onPointerMove:C}
14
+ data-zoomable=${l||a?"":$}
15
+ data-brushing=${d&&!(l||a)?"":$}
16
+ data-editable=${c?"":$}
17
+ style=${b?`--skdx-chart-duration:${b}`:$}
18
+ font-family=${w.fontFamily}
19
+ font-size=${w.fontSize}
20
+ @pointermove=${s.tooltip||h?this.onPointerMove:$}
21
21
  @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
22
- @pointerdown=${d?this.onPointerDown:C}
23
- @pointerup=${d?this.onPointerUp:C}
24
- @pointercancel=${d?this.onPointerUp:C}
25
- @wheel=${s||a?this.onWheel:C}
26
- @dblclick=${s||a?()=>a?this.setView(void 0):this.setZoom(void 0):C}
22
+ @pointerdown=${h?this.onPointerDown:$}
23
+ @pointerup=${h?this.onPointerUp:$}
24
+ @pointercancel=${h?this.onPointerUp:$}
25
+ @wheel=${l||a?this.onWheel:$}
26
+ @dblclick=${l||a?()=>a?this.setView(void 0):this.setZoom(void 0):$}
27
27
  @click=${this.onClick}
28
- @keydown=${h?this.onKeyDown:C}
28
+ @keydown=${u?this.onKeyDown:$}
29
29
  @blur=${()=>{this.focused=null,this.highlight(null)}}
30
30
  >
31
31
  <title>${i}</title>
32
- ${o.description?L`<desc>${o.description}</desc>`:C}
33
- ${p?L`<style>${rt}</style>`:C} ${rn(o)}
34
- ${fe(o.shapes)}
35
- ${fe(this.tip.length||!this.crossState?this.tip:Le(o,this.crossState))}
36
- ${fe(We(o,this.focused))} ${fe(this.overlay)}
32
+ ${s.description?R`<desc>${s.description}</desc>`:$}
33
+ ${b?R`<style>${at}</style>`:$} ${dn(s)}
34
+ ${me(s.shapes)}
35
+ ${me(this.tip.length||!this.crossState?this.tip:Be(s,this.crossState))}
36
+ ${me(Xe(s,this.focused))} ${me(this.overlay)}
37
37
  </svg>
38
- ${w?E`<div
38
+ ${M?H`<div
39
39
  role="tooltip"
40
40
  data-skdx-tooltip=${r}
41
- style="left:${w.x+12}px;top:${w.y+12}px"
41
+ style="left:${M.x+12}px;top:${M.y+12}px"
42
42
  >
43
- ${w.lines.map(k=>E`<div>${k}</div>`)}
44
- </div>`:C}
45
- ${M?E`<table data-skdx-table=${r}>
43
+ ${M.lines.map(S=>H`<div>${S}</div>`)}
44
+ </div>`:$}
45
+ ${C?H`<table data-skdx-table=${r}>
46
46
  <caption>
47
- ${S}
47
+ ${k}
48
48
  </caption>
49
49
  <thead>
50
50
  <tr>
51
- ${(M[0]??[]).map(k=>E`<th scope="col">${k}</th>`)}
51
+ ${(C[0]??[]).map(S=>H`<th scope="col">${S}</th>`)}
52
52
  </tr>
53
53
  </thead>
54
54
  <tbody>
55
- ${M.slice(1).map(k=>E`<tr>
56
- ${k.map(($,T)=>T===0?E`<th scope="row">${$}</th>`:E`<td>${$}</td>`)}
55
+ ${C.slice(1).map(S=>H`<tr>
56
+ ${S.map((T,z)=>z===0?H`<th scope="row">${T}</th>`:H`<td>${T}</td>`)}
57
57
  </tr>`)}
58
58
  </tbody>
59
- </table>`:C}`}};g.styles=en`
59
+ </table>`:$}`}};g.styles=an`
60
60
  :host {
61
61
  display: inline-block;
62
62
  }
@@ -109,4 +109,4 @@ var Pt=Object.defineProperty;var Bt=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([f({type:Number})],g.prototype,"width",2),u([f({type:Number})],g.prototype,"height",2),u([f()],g.prototype,"label",2),u([f({type:Boolean,reflect:!0})],g.prototype,"legend",2),u([f({type:Boolean,attribute:"no-tooltip",converter:nn})],g.prototype,"tooltip",2),u([f({attribute:!1})],g.prototype,"format",2),u([f({attribute:!1})],g.prototype,"palette",2),u([f({attribute:!1})],g.prototype,"hiddenSeries",2),u([f({attribute:!1})],g.prototype,"selected",2),u([f({attribute:"selection-mode"})],g.prototype,"selectionMode",2),u([f({attribute:!1})],g.prototype,"highlighted",2),u([f({attribute:!1})],g.prototype,"highlightScope",2),u([f({type:Boolean,reflect:!0})],g.prototype,"loading",2),u([f()],g.prototype,"error",2),u([f({attribute:"empty-message"})],g.prototype,"emptyMessage",2),u([f()],g.prototype,"description",2),u([f({type:Boolean,reflect:!0})],g.prototype,"decorative",2),u([f({type:Boolean,attribute:"accessible-table"})],g.prototype,"accessibleTable",2),u([f({attribute:!1})],g.prototype,"zoom",2),u([f({attribute:!1})],g.prototype,"view",2),u([f({type:Boolean,reflect:!0})],g.prototype,"zoomable",2),u([f({type:Boolean,reflect:!0})],g.prototype,"editable",2),u([f({attribute:"sync-id"})],g.prototype,"syncId",2),u([f({type:Boolean,attribute:"cross-filter"})],g.prototype,"crossFilter",2),u([f({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],g.prototype,"animated",2),u([f({type:Boolean,reflect:!0})],g.prototype,"responsive",2),u([B()],g.prototype,"tip",2),u([B()],g.prototype,"overlay",2),u([B()],g.prototype,"portal",2),u([B()],g.prototype,"measured",2),u([B()],g.prototype,"viewState",2),u([B()],g.prototype,"highlightState",2),u([B()],g.prototype,"crossState",2),u([B()],g.prototype,"focused",2),u([B()],g.prototype,"hiddenState",2),u([B()],g.prototype,"zoomState",2),u([B()],g.prototype,"selectedState",2);var y=class extends g{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:d,connectNulls:h,nulls:p,stacked:M,stackOffset:S,orientation:w,radius:k,barGap:$,barWidth:T,sort:R,transform:ne,transforms:m,bins:O,binWidth:I,binDomain:z,binMode:G,sampling:A,brush:P,crosshair:me}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:d,connectNulls:h,nulls:p,stacked:M,stackOffset:S,orientation:w,radius:k,barGap:$,barWidth:T,sort:R,transform:ne,transforms:m,bins:O,binWidth:I,binDomain:z,binMode:G,sampling:A,brush:P,crosshair:me,...this.compactOverrides()}}};u([f({attribute:!1})],y.prototype,"series",2),u([f({attribute:!1})],y.prototype,"categories",2),u([f({attribute:!1})],y.prototype,"xAxis",2),u([f({attribute:!1})],y.prototype,"yAxis",2),u([f({attribute:!1})],y.prototype,"rightAxis",2),u([f({attribute:!1})],y.prototype,"references",2),u([f({attribute:!1})],y.prototype,"annotations",2),u([f({type:Boolean,reflect:!0})],y.prototype,"labels",2),u([f()],y.prototype,"curve",2),u([f({type:Boolean,attribute:"connect-nulls"})],y.prototype,"connectNulls",2),u([f()],y.prototype,"nulls",2),u([f({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],y.prototype,"stacked",2),u([f({attribute:"stack-offset"})],y.prototype,"stackOffset",2),u([f()],y.prototype,"orientation",2),u([f({type:Number})],y.prototype,"radius",2),u([f({type:Number,attribute:"bar-gap"})],y.prototype,"barGap",2),u([f({type:Number,attribute:"bar-width"})],y.prototype,"barWidth",2),u([f()],y.prototype,"sort",2),u([f()],y.prototype,"transform",2),u([f({attribute:!1})],y.prototype,"transforms",2),u([f({type:Number})],y.prototype,"bins",2),u([f({type:Number,attribute:"bin-width"})],y.prototype,"binWidth",2),u([f({attribute:!1})],y.prototype,"binDomain",2),u([f({attribute:"bin-mode"})],y.prototype,"binMode",2),u([f({attribute:!1})],y.prototype,"sampling",2),u([f({type:Boolean,reflect:!0})],y.prototype,"brush",2),u([f({type:Boolean,reflect:!0})],y.prototype,"crosshair",2);var rn=e=>e.defs&&e.defs.length?L`<defs>${e.defs.map(n=>L`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>L`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${b(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:C,fe=e=>L`${e.map((n,t)=>{let r=n.title?L`<title>${n.title}</title>`:C,i=n.item?t:void 0;switch(n.kind){case"path":return L`<path data-skdx-part=${n.part} data-skdx-i=${b(i)} d=${n.d} fill=${n.fill??"none"} stroke=${b(n.stroke)} stroke-width=${b(n.strokeWidth)} stroke-linecap=${b(n.strokeLinecap)} stroke-linejoin=${b(n.strokeLinejoin)} stroke-dasharray=${b(n.dash)} opacity=${b(n.opacity)} fill-opacity=${b(n.fillOpacity)}>${r}</path>`;case"rect":return L`<rect data-skdx-part=${n.part} data-skdx-i=${b(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${b(n.rx)} style=${b(ce(n.part)?`rx:${ce(n.part)}`:void 0)} fill=${n.fill} stroke=${b(n.stroke)} fill-opacity=${b(n.opacity)} pointer-events=${b(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return L`<line data-skdx-part=${n.part} data-skdx-i=${b(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${b(n.strokeWidth)} stroke-dasharray=${b(n.dash)} opacity=${b(n.opacity)}>${r}</line>`;case"circle":return L`<circle data-skdx-part=${n.part} data-skdx-i=${b(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${b(n.stroke)} opacity=${b(n.opacity)}>${r}</circle>`;case"text":return L`<text aria-label=${b(n.title)} data-skdx-part=${n.part} data-skdx-i=${b(i)} x=${n.x} y=${n.y} text-anchor=${b(n.anchor)} dominant-baseline=${b(n.baseline)} fill=${b(n.fill)} font-weight=${b(n.weight)} pointer-events=${b(i===void 0?"none":void 0)} transform=${b(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var N=class extends g{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:a}=this;return this.root(ot({...this.sized(),dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:a,...this.compactOverrides()}),"parallel",this.label??"Parallel coordinates chart")}};u([K({attribute:!1})],N.prototype,"dimensions",2),u([K({attribute:!1})],N.prototype,"data",2),u([K({type:Number})],N.prototype,"opacity",2),u([K()],N.prototype,"curve",2),u([K({type:Boolean,reflect:!0,attribute:"connect-nulls"})],N.prototype,"connectNulls",2),u([K({attribute:!1})],N.prototype,"filters",2),N=u([on("skdx-parallel-coordinates-chart")],N);export{N as SkdxParallelCoordinatesChart};
112
+ `,p([f({type:Number})],g.prototype,"width",2),p([f({type:Number})],g.prototype,"height",2),p([f()],g.prototype,"label",2),p([f({type:Boolean,reflect:!0})],g.prototype,"legend",2),p([f({type:Boolean,attribute:"no-tooltip",converter:ln})],g.prototype,"tooltip",2),p([f({attribute:!1})],g.prototype,"format",2),p([f({attribute:!1})],g.prototype,"palette",2),p([f({attribute:!1})],g.prototype,"hiddenSeries",2),p([f({attribute:!1})],g.prototype,"selected",2),p([f({attribute:"selection-mode"})],g.prototype,"selectionMode",2),p([f({attribute:!1})],g.prototype,"highlighted",2),p([f({attribute:!1})],g.prototype,"highlightScope",2),p([f({type:Boolean,reflect:!0})],g.prototype,"loading",2),p([f()],g.prototype,"error",2),p([f({attribute:"empty-message"})],g.prototype,"emptyMessage",2),p([f()],g.prototype,"description",2),p([f({type:Boolean,reflect:!0})],g.prototype,"decorative",2),p([f({type:Boolean,attribute:"accessible-table"})],g.prototype,"accessibleTable",2),p([f({attribute:!1})],g.prototype,"zoom",2),p([f({attribute:!1})],g.prototype,"view",2),p([f({type:Boolean,reflect:!0})],g.prototype,"zoomable",2),p([f({type:Boolean,reflect:!0})],g.prototype,"editable",2),p([f({attribute:"sync-id"})],g.prototype,"syncId",2),p([f({type:Boolean,attribute:"cross-filter"})],g.prototype,"crossFilter",2),p([f({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],g.prototype,"animated",2),p([f({type:Boolean,reflect:!0})],g.prototype,"responsive",2),p([P()],g.prototype,"tip",2),p([P()],g.prototype,"overlay",2),p([P()],g.prototype,"portal",2),p([P()],g.prototype,"measured",2),p([P()],g.prototype,"viewState",2),p([P()],g.prototype,"highlightState",2),p([P()],g.prototype,"crossState",2),p([P()],g.prototype,"focused",2),p([P()],g.prototype,"hiddenState",2),p([P()],g.prototype,"zoomState",2),p([P()],g.prototype,"selectedState",2);var v=class extends g{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:l,annotations:a,labels:c,curve:d,connectNulls:h,nulls:u,stacked:b,stackOffset:C,orientation:k,radius:M,barGap:S,barWidth:T,sort:z,transform:re,transforms:m,bins:O,binWidth:I,binDomain:L,binMode:D,sampling:A,brush:E,crosshair:ge}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:l,annotations:a,labels:c,curve:d,connectNulls:h,nulls:u,stacked:b,stackOffset:C,orientation:k,radius:M,barGap:S,barWidth:T,sort:z,transform:re,transforms:m,bins:O,binWidth:I,binDomain:L,binMode:D,sampling:A,brush:E,crosshair:ge,...this.compactOverrides()}}};p([f({attribute:!1})],v.prototype,"series",2),p([f({attribute:!1})],v.prototype,"categories",2),p([f({attribute:!1})],v.prototype,"xAxis",2),p([f({attribute:!1})],v.prototype,"yAxis",2),p([f({attribute:!1})],v.prototype,"rightAxis",2),p([f({attribute:!1})],v.prototype,"references",2),p([f({attribute:!1})],v.prototype,"annotations",2),p([f({type:Boolean,reflect:!0})],v.prototype,"labels",2),p([f()],v.prototype,"curve",2),p([f({type:Boolean,attribute:"connect-nulls"})],v.prototype,"connectNulls",2),p([f()],v.prototype,"nulls",2),p([f({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],v.prototype,"stacked",2),p([f({attribute:"stack-offset"})],v.prototype,"stackOffset",2),p([f()],v.prototype,"orientation",2),p([f({type:Number})],v.prototype,"radius",2),p([f({type:Number,attribute:"bar-gap"})],v.prototype,"barGap",2),p([f({type:Number,attribute:"bar-width"})],v.prototype,"barWidth",2),p([f()],v.prototype,"sort",2),p([f()],v.prototype,"transform",2),p([f({attribute:!1})],v.prototype,"transforms",2),p([f({type:Number})],v.prototype,"bins",2),p([f({type:Number,attribute:"bin-width"})],v.prototype,"binWidth",2),p([f({attribute:!1})],v.prototype,"binDomain",2),p([f({attribute:"bin-mode"})],v.prototype,"binMode",2),p([f({attribute:!1})],v.prototype,"sampling",2),p([f({type:Boolean,reflect:!0})],v.prototype,"brush",2),p([f({type:Boolean,reflect:!0})],v.prototype,"crosshair",2);var dn=e=>e.defs&&e.defs.length?R`<defs>${e.defs.map(n=>R`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>R`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${x(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:$,me=e=>R`${e.map((n,t)=>{let r=n.title?R`<title>${n.title}</title>`:$,i=n.item?t:void 0;switch(n.kind){case"path":return R`<path data-skdx-part=${n.part} data-skdx-i=${x(i)} d=${n.d} fill=${n.fill??"none"} stroke=${x(n.stroke)} stroke-width=${x(n.strokeWidth)} stroke-linecap=${x(n.strokeLinecap)} stroke-linejoin=${x(n.strokeLinejoin)} stroke-dasharray=${x(n.dash)} opacity=${x(n.opacity)} fill-opacity=${x(n.fillOpacity)}>${r}</path>`;case"rect":return R`<rect data-skdx-part=${n.part} data-skdx-i=${x(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${x(n.rx)} style=${x(de(n.part)?`rx:${de(n.part)}`:void 0)} fill=${n.fill} stroke=${x(n.stroke)} fill-opacity=${x(n.opacity)} pointer-events=${x(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return R`<line data-skdx-part=${n.part} data-skdx-i=${x(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${x(n.strokeWidth)} stroke-dasharray=${x(n.dash)} opacity=${x(n.opacity)}>${r}</line>`;case"circle":return R`<circle data-skdx-part=${n.part} data-skdx-i=${x(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${x(n.stroke)} opacity=${x(n.opacity)}>${r}</circle>`;case"text":return R`<text aria-label=${x(n.title)} data-skdx-part=${n.part} data-skdx-i=${x(i)} x=${n.x} y=${n.y} text-anchor=${x(n.anchor)} dominant-baseline=${x(n.baseline)} fill=${x(n.fill)} font-weight=${x(n.weight)} pointer-events=${x(i===void 0?"none":void 0)} transform=${x(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var N=class extends g{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:l}=this,a={...this.sized(),dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:l,...this.compactOverrides()};return this.root(lt(a),"parallel",this.label??"Parallel coordinates chart",a)}};p([q({attribute:!1})],N.prototype,"dimensions",2),p([q({attribute:!1})],N.prototype,"data",2),p([q({type:Number})],N.prototype,"opacity",2),p([q()],N.prototype,"curve",2),p([q({type:Boolean,reflect:!0,attribute:"connect-nulls"})],N.prototype,"connectNulls",2),p([q({attribute:!1})],N.prototype,"filters",2),N=p([hn("skdx-parallel-coordinates-chart")],N);export{N as SkdxParallelCoordinatesChart};