bezel-charts 1.2.0 → 1.4.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.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![Python](https://github.com/ShazMoghaddam/bezel-charts/actions/workflows/python.yml/badge.svg)](https://github.com/ShazMoghaddam/bezel-charts/actions/workflows/python.yml)
10
10
  [![MIT licence](https://img.shields.io/badge/licence-MIT-D99A0E)](LICENSE)
11
11
 
12
- Bezel Charts is a set of free, open-source web components: ten chart tiles drawn in pure SVG, so they stay sharp on a phone, a 4K screen or a printed report. Build one in the Studio, paste one line of HTML into any site, or save any chart as a static SVG for a README, Notion page or slide, where JavaScript can't run.
12
+ Bezel Charts is a set of free, open-source web components: eleven chart tiles drawn in pure SVG, so they stay sharp on a phone, a 4K screen or a printed report. Build one in the Studio, paste one line of HTML into any site, or save any chart as a static SVG for a README, Notion page or slide, where JavaScript can't run.
13
13
 
14
14
  ![Bezel Charts: a sparkline, rings, a gauge, a line chart with a launch day note, a donut, a bar chart with a target, a scatter plot with a trend line and a year-long activity heatmap, in light and dark tiles](docs/bezel-charts.png)
15
15
 
@@ -20,7 +20,7 @@ Bezel Charts is a set of free, open-source web components: ten chart tiles drawn
20
20
  - **Made for READMEs.** Every chart exports as a clean static SVG, so a GitHub README can show a real chart.
21
21
  - **Data science friendly.** Scatter plots with a least-squares trend line and Pearson's r, grouped series, goal lines and notes on key points.
22
22
  - **Speaks your language.** Numbers and dates follow any locale, including Persian.
23
- - **Light.** About 16 kB gzipped for all ten charts, with no dependencies and no build step.
23
+ - **Light.** About 17 kB gzipped for all eleven charts, or 7 to 10 kB for a page that loads just one. No dependencies and no build step.
24
24
  - **Accessible.** Tab to any chart and step through its values with the arrow keys. Screen readers hear each value and get a hidden table of the data. Dashes, shapes and patterns tell series apart without relying on colour, and animation respects reduced-motion settings.
25
25
  - **Python too.** `pip install bezel-charts` draws the same charts straight from a pandas DataFrame, for notebooks, reports and READMEs.
26
26
 
@@ -29,6 +29,7 @@ A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calenda
29
29
  ## Contents
30
30
 
31
31
  - [Quick start](#quick-start)
32
+ - [Load only the charts you use](#load-only-the-charts-you-use)
32
33
  - [The Studio](#the-studio)
33
34
  - [The charts](#the-charts)
34
35
  - [Options for every chart](#options-for-every-chart)
@@ -48,7 +49,7 @@ A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calenda
48
49
  <bezel-bars heading="Commits this week" values="4,9,6,3,8,5,3" labels="M,T,W,T,F,S,S" stat="total"></bezel-bars>
49
50
  ```
50
51
 
51
- `@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.2.0` instead.
52
+ `@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.4.0` instead.
52
53
 
53
54
  That's all. Charts fill the width of whatever they sit in and redraw when it changes, so they work in a sidebar, a card grid or a full-width section without extra CSS.
54
55
 
@@ -65,6 +66,30 @@ import 'bezel-charts'; // registers every element
65
66
  import { render, toSVG } from 'bezel-charts'; // draw charts as SVG strings, even in Node
66
67
  ```
67
68
 
69
+ ## Load only the charts you use
70
+
71
+ Each chart also comes as its own file, so a page with a single chart loads less than half the full bundle. The files share their common code, so a page with two or three charts downloads that part once.
72
+
73
+ ```html
74
+ <script type="module" src="https://cdn.jsdelivr.net/gh/ShazMoghaddam/bezel-charts@1/dist/charts/line.js"></script>
75
+ <script type="module" src="https://cdn.jsdelivr.net/gh/ShazMoghaddam/bezel-charts@1/dist/charts/bars.js"></script>
76
+ ```
77
+
78
+ ```js
79
+ import 'bezel-charts/line';
80
+ import 'bezel-charts/bars';
81
+ import { toSVG } from 'bezel-charts/line'; // render and toSVG work for every chart loaded so far
82
+ ```
83
+
84
+ | Page | Gzipped |
85
+ | --- | --- |
86
+ | One sparkline, ring, donut, gauge, progress bar or heatmap | 7.2 to 7.4 kB |
87
+ | One line, area, scatter or bar chart | 9.5 to 10.3 kB |
88
+ | A line and a bar chart | 12.6 kB |
89
+ | Every chart: the full bundle | 17.3 kB |
90
+
91
+ Once a page needs four or five different charts, load the full bundle instead. `<bezel-chart type="…">` works with whichever charts are loaded, and tells you which file to add if its type isn't one of them. The classic `iife.js` script always has every chart, because a classic script can't load the shared file.
92
+
68
93
  ## The Studio
69
94
 
70
95
  The [Studio](https://shazmoghaddam.github.io/bezel-charts/site/#studio) is the easiest way to make a chart. No data to hand? Press one of the three sample files under **Import a file** to see a finished chart straight away, or download them from [`site/samples`](site/samples). Then pick a chart type then work through the tabs while the preview updates beside them:
@@ -139,6 +164,28 @@ One or more lines over time, with an axis, a legend and notes on key moments. Se
139
164
  | `dash` | a line style per series: `solid`, `dashed`, `dotted`, `dashdot`. On its own, gives each series the next style | off |
140
165
  | `markers` | a shape on each point, per series: `circle`, `square`, `triangle`, `diamond`, `none`. On its own, gives each series the next shape | off |
141
166
 
167
+ ### `<bezel-area>`
168
+
169
+ Filled areas over time. Several series overlap as see-through fills, or add `stacked` to pile them up so the top edge is the total, or `stacked="percent"` to show how each total splits. The axis always starts at zero, since an area's height reads as an amount.
170
+
171
+ ```html
172
+ <bezel-area heading="Energy mix · GWh" values="120,130,125,140,150,160|80,85,90,88,95,100|40,45,60,70,85,110"
173
+ series="Gas,Nuclear,Wind" labels="2021,2022,2023,2024,2025,2026" stacked></bezel-area>
174
+ ```
175
+
176
+ | Attribute | Values | Default |
177
+ | ------------- | -------------------------------------------------------- | ------- |
178
+ | `values` | numbers, series separated by `\|` | |
179
+ | `series` | series names for the legend | |
180
+ | `labels` | one per point, along the bottom | |
181
+ | `stacked` | with several series: on its own to pile them up, or `percent` to scale each column to 100% | off |
182
+ | `height` | chart height in px | `170` |
183
+ | `straight` | boolean, straight edges instead of curves | off |
184
+ | `dash`, `markers` | styles for each series' top edge, as on line charts | off |
185
+ | `patterns` | a fill per series, as on bars | off |
186
+
187
+ The tooltip lists every series, plus the total when stacked, and each series' share in a percent stack. `show-values` writes each value, or the total above each column of a stack. Negative values stack below zero, as stacked bars do, but stacks read best when every value is positive: bands that swing between positive and negative cross over each other.
188
+
142
189
  ### `<bezel-bars>`
143
190
 
144
191
  Bars, vertical or horizontal. Give it more than one series and you get **grouped bars**, side by side with a legend, or add `stacked` to pile each group's series into one bar.
@@ -306,7 +353,7 @@ Any of the above, picked with `type`: `<bezel-chart type="donut" values="3,2,1">
306
353
  | `no-tooltips` | boolean, turns off hover, tap and keyboard values, and leaves the chart out of the Tab order | off |
307
354
  | `static` | boolean, skips the entrance animation | off |
308
355
 
309
- Not every option suits every chart: `notes` works on spark, line and scatter; `show-values` on spark, line and bars; `goal-label` on spark, line, bars and scatter; `stat` on everything except the gauge and scatter. The Studio only shows what applies.
356
+ Not every option suits every chart: `notes` works on spark, line, area and scatter; `show-values` on spark, line, area and bars; `goal-label` on spark, line, area, bars and scatter; `stat` on everything except the gauge and scatter. The Studio only shows what applies.
310
357
 
311
358
  ## Colours and dark mode
312
359
 
@@ -400,7 +447,7 @@ bc.line(df, x="month", y=["sales", "costs"], heading="Sales", prefix="£")
400
447
  bc.spark(df["signups"], heading="Signups").save("docs/signups.svg")
401
448
  ```
402
449
 
403
- All ten charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. `chart.alt` gives ready-made alt text for the saved image. See the [Python README](python/README.md).
450
+ All eleven charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. `chart.alt` gives ready-made alt text for the saved image. See the [Python README](python/README.md).
404
451
 
405
452
  ## Frameworks
406
453
 
@@ -433,17 +480,19 @@ npm run test:browser # click through every Studio control in a real browser (nee
433
480
 
434
481
  ```
435
482
  src/
436
- core/ shared helpers, the bezel frame and the colour themes
483
+ core/ shared helpers, the bezel frame and the colour themes; series.js has the extras for line, area, bars
484
+ and scatter, and xy.js the axis frame line and area charts share
437
485
  charts/ one file per chart type: options in, SVG string out
438
486
  render.js picks the chart and returns its SVG
439
- element.js the custom element: sizing, theme, tooltips and export
487
+ element.js the custom element: sizing, theme, tooltips, keyboard and export
488
+ entries/ one file per chart that registers it and defines its tag, for per-chart imports
440
489
  site/ the website and Studio, with sample files in site/samples
441
490
  python/ the Python package, with parity tests against the JavaScript
442
491
  docs/ the README image and social preview, with the pages that render them
443
492
  test/ node:test suites, plus a Playwright browser test
444
493
  ```
445
494
 
446
- Each chart is a pure function that takes its options and a theme and returns an SVG string, which keeps them easy to test and lets the same code run in Node. The bundle has a 16 kB gzip budget, checked in CI. See [CONTRIBUTING.md](CONTRIBUTING.md).
495
+ Each chart is a pure function that takes its options and a theme and returns an SVG string, which keeps them easy to test and lets the same code run in Node. The full bundle has a 20 kB gzip budget and each chart file its own, checked in CI by `npm run size`. See [CONTRIBUTING.md](CONTRIBUTING.md).
447
496
 
448
497
  ## Security
449
498
 
@@ -1,9 +1,11 @@
1
- /*! Bezel Charts v1.2.0 | MIT | github.com/ShazMoghaddam/bezel-charts */
2
- var BezelCharts=(()=>{var Se=Object.defineProperty;var tr=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var rr=Object.prototype.hasOwnProperty;var ar=(t,e)=>{for(var r in e)Se(t,r,{get:e[r],enumerable:!0})},nr=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of er(e))!rr.call(t,i)&&i!==r&&Se(t,i,{get:()=>e[i],enumerable:!(l=tr(e,i))||l.enumerable});return t};var ir=t=>nr(Se({},"__esModule",{value:!0}),t);var vr={};ar(vr,{BezelChart:()=>Jt,render:()=>Qt,themes:()=>Gt,toSVG:()=>We,types:()=>_e,version:()=>gr});var Gt={dark:{tile:"#15151d",bezel:"#000000",fg:"#f2f1f7",muted:"#8c8aa0",grid:"#2a2935",up:"#5EE6C8",down:"#F675A8",palette:["#9FA1FF","#F675A8","#5EE6C8","#FFC857","#7CC4FF","#FF8A5B"]},light:{tile:"#ffffff",bezel:"#000000",fg:"#17161f",muted:"#6b6980",grid:"#e8e6ef",up:"#12a383",down:"#d63f7c",palette:["#6E70F0","#E2508C","#16A884","#D99A0E","#2F8FE0","#EE6431"]}};var it="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",dt="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",lr=0;function Ht(t){return"bzc"+t+(++lr).toString(36)+Math.random().toString(36).slice(2,6)}function at(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]})}function a(t){return Math.round(t*100)/100}function _(t,e,r){return Math.max(e,Math.min(r,t))}function I(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function v(t){return t!=null&&t!==""}function K(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):v(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function U(t){return Array.isArray(t)?t.map(String):v(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function Et(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(K):[K(t)]:v(t)?String(t).split("|").map(K).filter(function(e){return e.length}):[]}function zt(t){return t.reduce(function(e,r){return e+r},0)}function bt(t,e,r){return String(t).length*e*(r?.6:.56)}function Bt(t,e){return t=String(t),t.length>e?t.slice(0,Math.max(1,e-1))+"\u2026":t}function j(t){return t===!0||t===""||t==="true"||t==="1"}function h(t,e,r){if(!isFinite(t))return"\u2013";var l=Math.abs(t),i;v(e.decimals)?i=_(parseInt(e.decimals,10)||0,0,6):i=t%1===0?0:l<10?2:l<100?1:0;var n={maximumFractionDigits:i,minimumFractionDigits:v(e.decimals)?i:0};(j(e.compact)||r)&&l>=1e4&&(n={notation:"compact",maximumFractionDigits:1});var s;try{s=new Intl.NumberFormat(e.lang||"en-GB",n).format(l)}catch{s=String(a(l))}return(t<0?"\u2212":"")+(e.prefix||"")+s+(e.suffix||"")}function ae(t,e,r){if(t===e)if(t===0)e=1;else{var l=Math.abs(t)*.1;t-=l,e+=l}for(var i=(e-t)/(r||4),n=Math.pow(10,Math.floor(Math.log10(i))),s=i/n,o=(s<=1?1:s<=2?2:s<=5?5:10)*n,c=Math.floor(t/o)*o,x=Math.ceil(e/o)*o,g=[],d=c;d<=x+o/2;d+=o)g.push(+d.toFixed(10));return{lo:c,hi:x,ticks:g}}function ie(t,e){if(!t.length)return"";for(var r="M"+a(t[0][0])+","+a(t[0][1]),l=1;l<t.length;l++){var i=t[l-1],n=t[l];if(e)r+="L"+a(n[0])+","+a(n[1]);else{var s=(i[0]+n[0])/2;r+="C"+a(s)+","+a(i[1])+" "+a(s)+","+a(n[1])+" "+a(n[0])+","+a(n[1])}}return r}function S(t,e,r,l){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(l||"")+">"+at(r)+"</text>"}function G(t,e,r,l){return'fill="'+(l||t.muted)+'" font-family="'+dt+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function vt(t,e,r,l,i){return'<rect class="bzc-hit" x="'+a(t)+'" y="'+a(e)+'" width="'+a(Math.max(1,r))+'" height="'+a(Math.max(1,l))+'" fill="#000" fill-opacity="0" data-tip="'+at(i)+'"/>'}function lt(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function ut(t,e){var r=U(t.color).filter(Boolean);return r.length?r:e.palette}function ht(t,e,r,l,i){return S(e+l/2,r+i/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+it+'" font-size="13"')}function Xt(t,e){return v(t.notes)?String(t.notes).split(";").map(function(r){var l=r.indexOf(":");if(l<0)return null;var i=r.slice(0,l).trim(),n=r.slice(l+1).trim(),s=e.map(String).indexOf(i);return s<0&&String(parseInt(i,10))===i&&(s=parseInt(i,10)),s>=0&&n?{i:s,text:n}:null}).filter(Boolean):[]}function Dt(t,e,r,l,i){var n=(v(t.goalLabel)?t.goalLabel:"Goal")+" "+h(I(t.goal,0),t);return'<line x1="'+a(r)+'" x2="'+a(l)+'" y1="'+a(i)+'" y2="'+a(i)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-width="1.25" stroke-dasharray="4 4"/>'+S(l,i-5,n,G(e,10,'text-anchor="end"'))}function kt(t,e,r){var l=String(v(e.stat)?e.stat:r||"").toLowerCase();if(!l||l==="none"||!t.length)return null;var i=zt(t),n={last:t[t.length-1],total:i,sum:i,average:i/t.length,avg:i/t.length,max:Math.max.apply(null,t),min:Math.min.apply(null,t)};if(!(l in n))return null;var s=null;return l==="last"&&t.length>1&&e.delta!=="none"&&(s=t[t.length-1]-t[0]),{val:n[l],delta:s}}function Ut(t,e,r,l,i,n,s,o){var c=l,x=i,g="",d=o||13;return t.forEach(function(f,C){var E=d+bt(f,12)+16;c>l&&c+E-16>l+n&&(c=l,x+=20),g+=(s?s(C,c,x):'<circle cx="'+a(c+4)+'" cy="'+a(x+6)+'" r="4" fill="'+e[C%e.length]+'"/>')+S(c+d,x+10,f,'fill="'+r.fg+'" font-family="'+it+'" font-size="12"'),c+=E}),{svg:g,height:x-i+24}}var le={solid:"",dashed:"7 5",dotted:"1 5",dashdot:"9 4 1 4"},oe=["circle","square","triangle","diamond"],De=["solid","stripes","dots","grid"];function Vt(t,e,r){if(t==null||t===!1||t==="none"||t==="false")return null;var l=t===!0||t===""||t==="auto"?e:U(t).map(function(i){return e.indexOf(i)<0?r:i});return l.length?function(i){return l[i%l.length]}:null}function _t(t,e,r,l,i){var n=l*1.15,s=l*.85;return t==="square"?'<rect x="'+a(e-s)+'" y="'+a(r-s)+'" width="'+a(2*s)+'" height="'+a(2*s)+'" rx="1"'+i+"/>":t==="triangle"?'<path d="M'+a(e)+","+a(r-n)+"L"+a(e+n)+","+a(r+s)+"L"+a(e-n)+","+a(r+s)+'Z"'+i+"/>":t==="diamond"?'<path d="M'+a(e)+","+a(r-n*1.1)+"L"+a(e+n)+","+a(r)+"L"+a(e)+","+a(r+n*1.1)+"L"+a(e-n)+","+a(r)+'Z"'+i+"/>":'<circle cx="'+a(e)+'" cy="'+a(r)+'" r="'+a(l)+'"'+i+"/>"}function Pe(t,e,r,l){var i=' stroke="'+l+'" stroke-opacity=".55" stroke-width="1.5"';return'<pattern id="'+t+'" width="6" height="6" patternUnits="userSpaceOnUse"'+(e==="dots"?"":' patternTransform="rotate(45)"')+'><rect width="6" height="6" fill="'+r+'"/>'+(e==="dots"?'<circle cx="3" cy="3" r="1.3" fill="'+l+'" fill-opacity=".55"/>':'<path d="M3,0V6'+(e==="grid"?"M0,3H6":"")+'"'+i+"/>")+"</pattern>"}function $e(t){return Math.max.apply(null,t.map(function(e){return bt(e,10,!0)}))+10}function se(t,e){for(var r=Et(t.values),l=U(t.series),i=U(t.labels),n=[],s=Math.max.apply(null,[0].concat(r.map(function(d){return d.length}))),o=0;o<s;o++){var c=[i[o]||"#"+(o+1)],x=0;r.forEach(function(d){c.push(o<d.length?h(d[o],t):""),x+=o<d.length?d[o]:0}),e&&c.push(h(x,t)),n.push(c)}var g=r.length>1||l.length?r.map(function(d,f){return l[f]||"Series "+(f+1)}):["Value"];return{head:["Label"].concat(g,e?["Total"]:[]),rows:n}}function It(t){var e=Math.round(_(I(t.width,360),160,2400)),r=t.frame==="none"?0:4,l=t.frame==="none"?8:20;return{W:e,b:r,P:l,w:e-2*(r+l)}}var or=".bzc-a{animation:bzc-in .6s ease both}.bzc-d{animation:bzc-draw 1.1s cubic-bezier(.3,.7,.2,1) both}.bzc-g{transform-box:fill-box;transform-origin:50% 100%;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gn{transform-box:fill-box;transform-origin:50% 0;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gx{transform-box:fill-box;transform-origin:0 50%;animation:bzc-growx .8s cubic-bezier(.2,.8,.2,1) both}.bzc-s{animation:bzc-sweep 1.1s cubic-bezier(.2,.8,.2,1) both}@keyframes bzc-in{from{opacity:0}}@keyframes bzc-draw{from{stroke-dashoffset:1}}@keyframes bzc-grow{from{transform:scaleY(0)}}@keyframes bzc-growx{from{transform:scaleX(0)}}@keyframes bzc-sweep{from{stroke-dasharray:0 100}}@media (prefers-reduced-motion:reduce){[class^=bzc-]{animation:none!important}}";function mt(t,e,r,l,i){var n=It(t),s=n.W,o=n.b,c=n.P,x=n.w,g=_(I(t.corners,22),0,60),d=o+c,f="";v(t.heading)&&(f+=S(o+c,d+10,String(t.heading).toUpperCase(),G(e,11,'font-weight="600" letter-spacing="1.3"')),d+=24);var C=i&&i.stat;if(C){if(f+=S(o+c,d+30,h(C.val,t),'fill="'+e.fg+'" font-family="'+it+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),C.delta!=null){var E=C.delta>0,R=C.delta===0,F=t.delta==="inverse"?!E:E,y=R?e.muted:F?e.up:e.down,L=(R?"\u25CF ":E?"\u25B2 ":"\u25BC ")+h(Math.abs(C.delta),t)+" "+(v(t.deltaLabel)?t.deltaLabel:"since start");f+=S(o+c+x,d+28,L,'text-anchor="end" fill="'+y+'" font-family="'+dt+'" font-size="11" font-weight="600"')}d+=44}var m=l(o+c,d,x,r),A=Math.round(d+r+c+o),z="";t.frame!=="none"?z='<rect width="'+s+'" height="'+A+'" rx="'+g+'" fill="'+e.bezel+'"/><rect x="'+o+'" y="'+o+'" width="'+(s-2*o)+'" height="'+(A-2*o)+'" rx="'+Math.max(0,g-o)+'" fill="'+(t.background||e.tile)+'"/>':v(t.background)&&(z='<rect width="'+s+'" height="'+A+'" rx="'+g+'" fill="'+t.background+'"/>');var b=(v(t.heading)?t.heading+": ":"")+(i&&i.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s+" "+A+'" width="'+s+'" height="'+A+'" role="img" aria-label="'+at(b)+'"><title>'+at(b)+"</title>"+(t.animate?"<style>"+or+"</style>":"")+z+f+m+"</svg>"}function fe(t,e){var r=K(t.values),l=ut(t,e)[0],i=I(t.height,64),n=U(t.labels),s=Xt(t,n),o=kt(r,t,"last");return mt(t,e,i,function(c,x,g,d){if(!r.length)return ht(e,c,x,g,d);var f=r.length===1?[r[0],r[0]]:r,C=Math.min.apply(null,f),E=Math.max.apply(null,f);v(t.goal)&&(C=Math.min(C,+t.goal),E=Math.max(E,+t.goal));var R=(E-C||Math.abs(E)||1)*.12;C-=R,E+=R;var F=function(k){return c+k*g/(f.length-1)},y=function(k){return x+d-(k-C)/(E-C)*d},L=f.map(function(k,p){return[F(p),y(k)]}),m=ie(L,j(t.straight)),A=Ht("g"),z=L[L.length-1],b='<defs><linearGradient id="'+A+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+l+'" stop-opacity=".32"/><stop offset="1" stop-color="'+l+'" stop-opacity="0"/></linearGradient></defs>';[1/3,2/3].forEach(function(k){b+='<line x1="'+c+'" x2="'+(c+g)+'" y1="'+a(x+d*k)+'" y2="'+a(x+d*k)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),b+='<path d="'+m+"L"+a(z[0])+","+(x+d)+"L"+c+","+(x+d)+'Z" fill="url(#'+A+')"'+lt(t,"bzc-a")+"/>",b+='<path d="'+m+'" fill="none" stroke="'+l+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+lt(t,"bzc-d")+"/>",v(t.goal)&&(b+=Dt(t,e,c,c+g,y(+t.goal))),s.forEach(function(k){if(!(k.i>=r.length)){var p=L[k.i];b+='<circle cx="'+a(p[0])+'" cy="'+a(p[1])+'" r="3.5" fill="'+e.fg+'"/>'+S(_(p[0],c+30,c+g-30),p[1]-9,k.text,G(e,10,'text-anchor="middle"',e.fg))}}),b+='<circle cx="'+a(z[0])+'" cy="'+a(z[1])+'" r="9" fill="'+l+'" fill-opacity=".25"/><circle cx="'+a(z[0])+'" cy="'+a(z[1])+'" r="4.5" fill="'+l+'"/>',j(t.showValues)&&L.forEach(function(k,p){p<r.length&&(b+=S(k[0],k[1]-8,h(r[p],t,!0),G(e,9,'text-anchor="middle"')))});var O=r.length>1?g/(r.length-1):g;return r.forEach(function(k,p){b+=vt(F(p)-O/2,x-6,O,d+12,(n[p]||"#"+(p+1))+": "+h(k,t))}),b},{stat:o,summary:r.length?"latest "+h(r[r.length-1],t):"no data"})}fe.table=function(t){var e=U(t.labels);return{head:["Label","Value"],rows:K(t.values).map(function(r,l){return[e[l]||"#"+(l+1),h(r,t)]})}};function ce(t,e){var r=Et(t.values),l=U(t.series),i=U(t.labels),n=ut(t,e),s=I(t.height,170),o=Math.max.apply(null,[0].concat(r.map(function(R){return R.length}))),c=Xt(t,i),x=r.length>1||l.length>0,g=kt(r[0]||[],t,""),d=Vt(t.dash,Object.keys(le),"solid"),f=Vt(t.markers,oe,"none"),C=t.background||e.tile,E=(d||f)&&function(R,F,y){var L=n[R%n.length],m=d?le[d(R)]:"",A=f?f(R):"none";return'<line x1="'+a(F)+'" x2="'+a(F+18)+'" y1="'+a(y+6)+'" y2="'+a(y+6)+'" stroke="'+L+'" stroke-width="2.5" stroke-linecap="round"'+(m?' stroke-dasharray="'+m+'"':"")+"/>"+(A!=="none"?_t(A,F+9,y+6,3.5,' fill="'+L+'" stroke="'+C+'" stroke-width="1.5"'):"")};return mt(t,e,s,function(R,F,y,L){if(!o)return ht(e,R,F,y,L);var m="",A=F;if(x){var z=Ut(r.map(function(D,u){return l[u]||"Series "+(u+1)}),n,e,R,A,y,E,E&&24);m+=z.svg,A+=z.height}var b=[].concat.apply([],r),O=Math.min.apply(null,b),k=Math.max.apply(null,b);v(t.goal)&&(O=Math.min(O,+t.goal),k=Math.max(k,+t.goal)),j(t.zero)&&(O=Math.min(0,O),k=Math.max(0,k));var p=ae(O,k,4),B=p.ticks.map(function(D){return h(D,t,!0)}),M=Math.max.apply(null,B.map(function(D){return bt(D,10,!0)}))+10,w=i.length?20:4,T=R+M,V=y-M,Y=L-(A-F)-w,tt=function(D){return o===1?T+V/2:T+D*V/(o-1)},Q=function(D){return A+Y-(D-p.lo)/(p.hi-p.lo)*Y};if(p.ticks.forEach(function(D,u){var H=Q(D);m+='<line x1="'+a(T)+'" x2="'+a(T+V)+'" y1="'+a(H)+'" y2="'+a(H)+'" stroke="'+e.grid+'"'+(D===0?"":' stroke-dasharray="2 4"')+"/>"+S(T-8,H+3.5,B[u],G(e,10,'text-anchor="end"'))}),i.length){for(var ot=Math.max(1,Math.ceil(o*(Math.max.apply(null,i.map(function(D){return bt(D,10,!0)}))+10)/V)),q=0;q<o;q+=ot)if(i[q]!=null){var J=o>1&&q===0?"start":o>1&&q===o-1?"end":"middle";m+=S(tt(q),A+Y+15,i[q],G(e,10,'text-anchor="'+J+'"'))}}c.forEach(function(D){if(!(D.i>=o)){var u=tt(D.i);m+='<line x1="'+a(u)+'" x2="'+a(u)+'" y1="'+a(A+12)+'" y2="'+a(A+Y)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+S(_(u,T+30,T+V-30),A+8,D.text,G(e,10,'text-anchor="middle"',e.fg))}}),r.forEach(function(D,u){var H=n[u%n.length],N=D.map(function(X,ft){return[tt(ft),Q(X)]});N.length===1&&(N=[[T,N[0][1]],[T+V,N[0][1]]]);var et=ie(N,j(t.straight));if(u===0){var W=Ht("g"),gt=N[N.length-1];m+='<defs><linearGradient id="'+W+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+H+'" stop-opacity=".26"/><stop offset="1" stop-color="'+H+'" stop-opacity="0"/></linearGradient></defs><path d="'+et+"L"+a(gt[0])+","+a(A+Y)+"L"+a(N[0][0])+","+a(A+Y)+'Z" fill="url(#'+W+')"'+lt(t,"bzc-a")+"/>"}var xt=d?le[d(u)]:"",Mt=f?f(u):"none";if(m+=xt?'<path d="'+et+'" fill="none" stroke="'+H+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="'+xt+'"'+lt(t,"bzc-a",u*.15)+"/>":'<path d="'+et+'" fill="none" stroke="'+H+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+u*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>",Mt!=="none"){var P=Math.ceil(D.length/40);D.forEach(function(X,ft){(ft%P===0||ft===D.length-1)&&(m+=_t(Mt,tt(ft),Q(X),3.5,' fill="'+H+'" stroke="'+C+'" stroke-width="1.5"'+lt(t,"bzc-a",.6+u*.15)))})}else{var Z=N[N.length-1];m+='<circle cx="'+a(Z[0])+'" cy="'+a(Z[1])+'" r="4" fill="'+H+'" stroke="'+C+'" stroke-width="2"/>'}j(t.showValues)&&D.forEach(function(X,ft){m+=S(tt(ft),Q(X)-8,h(X,t,!0),G(e,9,'text-anchor="middle"'))})}),v(t.goal)&&(m+=Dt(t,e,T,T+V,Q(+t.goal)));for(var Lt=o>1?V/(o-1):V,st=0;st<o;st++){var pt=i[st]||"#"+(st+1);r.forEach(function(D,u){st<D.length&&(pt+=`
3
- `+(x?(l[u]||"Series "+(u+1))+": ":"")+h(D[st],t))}),m+=vt(tt(st)-Lt/2,A,Lt,Y,pt)}return m},{stat:g,summary:r.length+" series over "+o+" points"})}ce.table=function(t){return se(t)};var Ge=40,Be=24;function ue(t,e){for(var r=Et(t.values),l=U(t.series),i=U(t.labels),n=ut(t,e),s=r.length,o=Math.max.apply(null,[0].concat(r.map(function(u){return u.length}))),c=s>1,x=j(t.horizontal),g=c&&j(t.stacked),d=!c&&U(t.color).filter(Boolean).length>1,f=r[0]||[],C=[].concat.apply([],r),E=function(u,H){return r.reduce(function(N,et){return u<et.length&&et[u]*H>0?N+et[u]:N},0)},R=[],F=[],y=[],L=0;g&&L<o;L++)F.push(E(L,1)),y.push(E(L,-1)),R.push(F[L]+y[L]);for(var m=g?F.concat(y):C,A=m.length?Math.max.apply(null,m):0,z=function(u){return l[u]||"Series "+(u+1)},b=c?Vt(t.patterns,De,"solid"):null,O="",k=[],p=0;b&&p<s;p++)if(b(p)!=="solid"){var B=Ht("g");O+=Pe(B,b(p),n[p%n.length],t.background||e.tile),k[p]="url(#"+B+")"}var M=function(u,H){return c?k[u]||n[u%n.length]:d?n[H%n.length]:n[0]},w=b&&function(u,H,N){return'<rect x="'+a(H)+'" y="'+a(N+1)+'" width="10" height="10" rx="2" fill="'+M(u)+'"/>'},T=function(u){return c||d||t.highlight==="none"||u===A?1:.5},V=function(u){return i[u]||"#"+(u+1)},Y=function(u){return c?V(u)+r.map(function(H,N){return u<H.length?`
4
- `+z(N)+": "+h(H[u],t):""}).join("")+(g?`
5
- Total: `+h(R[u],t):""):V(u)+": "+h(f[u],t)},tt=It(t),Q=c||l.length?Ut(r.map(function(u,H){return z(H)}),n,e,0,0,tt.w,w,w&&15).height:0,ot=g?1:s,q=c&&!g,J=q?10:14,Lt=3,st=x?ot*J+(ot-1)*Lt+(q?14:16):0,pt=x?Q+Math.max(1,o)*st-6:I(t.height,140)+Q,D=f.indexOf(Math.max.apply(null,f.length?f:[0]));return mt(t,e,pt,function(u,H,N,et){if(!o)return ht(e,u,H,N,et);var W=O?"<defs>"+O+"</defs>":"",gt=H;Q&&(W+=Ut(r.map(function($,rt){return z(rt)}),n,e,u,H,N,w,w&&15).svg,gt+=Q);var xt=Math.min(0,Math.min.apply(null,m)),Mt=Math.max(0,A);if(v(t.goal)&&(xt=Math.min(xt,+t.goal),Mt=Math.max(Mt,+t.goal)),Mt===xt&&(Mt=xt+1),x){for(var P=i.length?Math.min(N*.4,Math.max.apply(null,i.map(function($){return bt($,12)}))+10):0,Z=g?[R.map(function($){return h($,t)})]:r.map(function($){return $.map(function(rt){return h(rt,t)})}),X=Math.max.apply(null,[].concat.apply([],Z).map(function($){return bt($,q?10:11,!0)}))+10,ft=u+P,St=N-P-X,Rt=Math.max(Mt,0)||1,nt=0;nt<o;nt++){var At=gt+nt*st;i[nt]!=null&&(W+=S(u,At+(st-6)/2+4,Bt(i[nt],Math.floor(P/6.7)),'fill="'+e.fg+'" font-family="'+it+'" font-size="12"')),g?(W+=Ze(nt,ft,At+5,St,Rt),W+=S(u+N,At+5+J/2+3.8,Z[0][nt],'text-anchor="end" fill="'+e.fg+'" font-family="'+dt+'" font-size="11" font-weight="600"')):r.forEach(function($,rt){if(!(nt>=$.length)){var ct=$[nt],wt=At+(c?2:5)+rt*(J+Lt),Tt=Math.max(0,ct)/Rt*St;c||(W+='<rect x="'+a(ft)+'" y="'+a(wt)+'" width="'+a(St)+'" height="'+J+'" rx="'+J/2+'" fill="'+e.grid+'" fill-opacity=".6"/>'),Tt>0&&(W+='<rect x="'+a(ft)+'" y="'+a(wt)+'" width="'+a(Math.max(J,Tt))+'" height="'+J+'" rx="'+J/2+'" fill="'+M(rt,nt)+'" fill-opacity="'+T(ct)+'"'+lt(t,"bzc-gx",nt*.06+rt*.03)+"/>"),W+=S(u+N,wt+J/2+3.8,Z[rt][nt],'text-anchor="end" fill="'+e.fg+'" font-family="'+dt+'" font-size="'+(c?10:11)+'" font-weight="600"')}}),W+=vt(u,At,N,st-6,Y(nt))}if(v(t.goal)&&+t.goal>0){var Le=ft+ +t.goal/Rt*St;W+='<line x1="'+a(Le)+'" x2="'+a(Le)+'" y1="'+a(gt-2)+'" y2="'+a(H+et+2)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="3 3"/>'}return W}function Ze($,rt,ct,wt,Tt){var Ct='<rect x="'+a(rt)+'" y="'+a(ct)+'" width="'+a(wt)+'" height="'+J+'" rx="'+J/2+'" fill="'+e.grid+'" fill-opacity=".6"/>',qt=0;return r.forEach(function(ee,Ft){var Wt=$<ee.length?ee[$]:0,Nt=Math.max(0,Wt)/Tt*wt;if(!(Nt<=0)){var $t=qt>0?1.5:0;Ct+='<rect x="'+a(rt+qt+$t)+'" y="'+a(ct)+'" width="'+a(Math.max(2,Nt-$t))+'" height="'+J+'" rx="'+a(Math.min(3,Nt/2))+'" fill="'+M(Ft,$)+'"'+lt(t,"bzc-gx",$*.06+Ft*.03)+"/>",qt+=Nt}}),Ct}var Ae=i.length?Math.max.apply(null,i.map(function($){return bt($,10,!0)})):0,xe=i.length?Math.max(1,Math.ceil(o*(Ae+8)/N)):1,Kt=j(t.angleLabels)&&xe>1,Oe=Ge*Math.PI/180,Te=function($){return Kt?Bt($,Be):$};if(Kt){var Qe=N/o,Yt=0;i.forEach(function($,rt){Yt=Math.max(Yt,Math.cos(Oe)*bt(Te($),10,!0)+4-(rt+.5)*Qe)}),Yt=Math.min(Yt,N*.25),u+=Yt,N-=Yt,xe=1}var Ce=j(t.showValues)&&xt<0?14:0,Je=Kt?Math.ceil(Math.sin(Oe)*Math.min(Ae,bt("x".repeat(Be),10,!0)))+18:20,Ke=(i.length?Je:2)+Ce,Fe=j(t.showValues)?16:4,ye=et-(gt-H)-Ke-Fe,Ne=gt+Fe,Ot=function($){return Ne+ye-($-xt)/(Mt-xt)*ye},jt=N/o,te=Math.min(jt*(q?.78:.62),q?s*30:56),Re=q?Math.min(3,te/s*.15):0,Pt=g?te:(te-Re*(s-1))/s,ne=Ot(0);W+='<line x1="'+u+'" x2="'+(u+N)+'" y1="'+a(ne)+'" y2="'+a(ne)+'" stroke="'+e.grid+'"/>';for(var yt=0;yt<o;yt++){var be=u+yt*jt+(jt-te)/2;if(g?W+=je(yt,be):r.forEach(function($,rt){if(!(yt>=$.length)){var ct=$[yt],wt=be+rt*(Pt+Re),Tt=Math.min(Ot(ct),ne),Ct=Math.abs(Ot(ct)-ne);Ct>.5&&(W+='<rect x="'+a(wt)+'" y="'+a(Tt)+'" width="'+a(Pt)+'" height="'+a(Ct)+'" rx="'+a(Math.min(6,Pt/2,Ct/2))+'" fill="'+M(rt,yt)+'" fill-opacity="'+T(ct)+'"'+lt(t,ct<0?"bzc-gn":"bzc-g",yt*.05+rt*.03)+"/>"),j(t.showValues)&&(W+=S(wt+Pt/2,ct<0?Ot(ct)+12:Ot(ct)-5,h(ct,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+dt+'" font-size="'+(c?9:10)+'" font-weight="600"'))}}),i[yt]!=null&&yt%xe===0){var ke=be+te/2,Me=Ne+ye+Ce+(Kt?12:15);W+=Kt?S(ke,Me,Te(i[yt]),G(e,10,'text-anchor="end" transform="rotate(-'+Ge+" "+a(ke)+" "+a(Me)+')"')):S(ke,Me,i[yt],G(e,10,'text-anchor="middle"'))}W+=vt(u+yt*jt,gt,jt,et-(gt-H),Y(yt))}return v(t.goal)&&(W+=Dt(t,e,u,u+N,Ot(+t.goal))),W;function je($,rt){var ct="",wt=0,Tt=0;if(r.forEach(function(qt,ee){var Ft=$<qt.length?qt[$]:0;if(Ft){var Wt=Ft>0?wt:Tt,Nt=Wt+Ft;Ft>0?wt=Nt:Tt=Nt;var $t=Ot(Math.max(Wt,Nt)),we=Ot(Math.min(Wt,Nt)),re=we-$t,He=Wt!==0?Math.min(1.5,re/2):0;Ft>0?we-=He:$t+=He,re=we-$t,re>.5&&(ct+='<rect x="'+a(rt)+'" y="'+a($t)+'" width="'+a(Pt)+'" height="'+a(re)+'" rx="'+a(Math.min(3,Pt/2,re/2))+'" fill="'+M(ee,$)+'"'+lt(t,Ft<0?"bzc-gn":"bzc-g",$*.05+ee*.03)+"/>")}}),j(t.showValues)){var Ct=R[$];ct+=S(rt+Pt/2,Ct<0?Ot(y[$])+12:Ot(F[$])-5,h(Ct,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+dt+'" font-size="10" font-weight="600"')}return ct}},{stat:kt(f,t,""),summary:o?g?s+" series stacked across "+o+" groups":c?s+" series across "+o+" groups":"highest "+(i[D]||"")+" "+h(f[D],t):"no data"})}ue.table=function(t){return se(t,Et(t.values).length>1&&j(t.stacked))};function he(t,e){var r=K(t.values),l=U(t.labels),i=ut(t,e),n=I(t.max,100)||100,s=I(t.height,140),o=!v(t.prefix)&&!v(t.suffix)&&n===100,c=function(g){return h(g,t)+(o?"%":"")},x=kt(r,t,"");return mt(t,e,s,function(g,d,f,C){if(!r.length)return ht(e,g,d,f,C);var E="",R=r.length===1,F=Math.min(C,R?f:f*.55),y=R?g+f/2:g+F/2,L=d+C/2,m=R?F*.12:_(F*.42/(r.length*1.35),5,16),A=m*.38;if(r.forEach(function(k,p){var B=F/2-m/2-p*(m+A);if(!(B<=m/2)){var M=_(k/n*100,0,100),w=i[p%i.length];E+='<circle cx="'+a(y)+'" cy="'+a(L)+'" r="'+a(B)+'" fill="none" stroke="'+w+'" stroke-opacity=".16" stroke-width="'+a(m)+'"/>',M>0&&(E+='<circle cx="'+a(y)+'" cy="'+a(L)+'" r="'+a(B)+'" fill="none" stroke="'+w+'" stroke-width="'+a(m)+'" stroke-linecap="round" pathLength="100" transform="rotate(-90 '+a(y)+" "+a(L)+')" style="stroke-dasharray:'+a(M)+" 100"+(t.animate?";animation-delay:"+p*.12+"s":"")+'"'+(t.animate?' class="bzc-s"':"")+"/>"),E+='<circle cx="'+a(y)+'" cy="'+a(L)+'" r="'+a(B+m/2)+'" fill="#000" fill-opacity="0" class="bzc-hit" data-tip="'+at((l[p]||"#"+(p+1))+": "+c(k)+(o?"":" of "+h(n,t)))+'"/>'}}),R)E+=S(y,L+F*.08,c(r[0]),'text-anchor="middle" fill="'+e.fg+'" font-family="'+it+'" font-size="'+a(F*.22)+'" font-weight="800"'),l[0]&&(E+=S(y,L+F*.08+16,l[0],G(e,10,'text-anchor="middle"')));else{var z=g+F+22,b=Math.min(26,C/r.length),O=L-b*r.length/2;r.forEach(function(k,p){var B=O+p*b+b/2;E+='<circle cx="'+a(z+4)+'" cy="'+a(B)+'" r="4" fill="'+i[p%i.length]+'"/>'+S(z+14,B+4,Bt(l[p]||"#"+(p+1),Math.floor((g+f-z-60)/6.7)),'fill="'+e.fg+'" font-family="'+it+'" font-size="12"')+S(g+f,B+4,c(k),'text-anchor="end" fill="'+e.fg+'" font-family="'+dt+'" font-size="11" font-weight="600"')})}return E},{stat:x,summary:r.map(function(g,d){return(l[d]?l[d]+" ":"")+c(g)}).join(", ")})}he.table=function(t){var e=U(t.labels),r=I(t.max,100)||100,l=!v(t.prefix)&&!v(t.suffix)&&r===100;return{head:["Label","Value"],rows:K(t.values).map(function(i,n){return[e[n]||"#"+(n+1),h(i,t)+(l?"%":" of "+h(r,t))]})}};function me(t,e){var r=K(t.values).map(function(f){return Math.max(0,f)}),l=U(t.labels),i=ut(t,e),n=r.slice(),s=l.slice();if(n.length>6){var o=n.map(function(f,C){return C}).sort(function(f,C){return r[C]-r[f]}),c=o.slice(0,5).sort(function(f,C){return f-C});n=c.map(function(f){return r[f]}),s=c.map(function(f){return l[f]||"#"+(f+1)}),n.push(zt(o.slice(5).map(function(f){return r[f]}))),s.push("Other")}var x=zt(n),g=I(t.height,150),d=kt(n,t,"");return mt(t,e,g,function(f,C,E,R){if(!x)return ht(e,f,C,E,R);var F="",y=Math.min(R,E*.5),L=f+y/2,m=C+R/2,A=y*.16,z=(y-A)/2,b=0,O=n.filter(Boolean).length>1?.9:0;n.forEach(function(M,w){var T=M/x*100;if(!(T<=0)){var V=Math.max(.01,T-O);F+='<circle cx="'+a(L)+'" cy="'+a(m)+'" r="'+a(z)+'" fill="none" stroke="'+i[w%i.length]+'" stroke-width="'+a(A)+'" pathLength="100" stroke-dasharray="'+a(V)+" "+a(100-V)+'" stroke-dashoffset="'+a(-b)+'" transform="rotate(-90 '+a(L)+" "+a(m)+')"'+lt(t,"bzc-a",w*.08)+"/>",b+=T}}),F+=S(L,m+2,h(x,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+it+'" font-size="'+a(y*.17)+'" font-weight="800"'),F+=S(L,m+2+14,(v(t.centerLabel)?t.centerLabel:"Total").toUpperCase(),G(e,9,'text-anchor="middle" letter-spacing="1"'));var k=f+y+22,p=Math.min(24,R/n.length),B=m-p*n.length/2;return n.forEach(function(M,w){var T=B+w*p+p/2,V=Math.round(M/x*100),Y=(s[w]||"#"+(w+1))+": "+h(M,t)+" ("+V+"%)";F+='<circle cx="'+a(k+4)+'" cy="'+a(T)+'" r="4" fill="'+i[w%i.length]+'"/>'+S(k+14,T+4,Bt(s[w]||"#"+(w+1),Math.floor((f+E-k-50)/6.7)),'fill="'+e.fg+'" font-family="'+it+'" font-size="12"')+S(f+E,T+4,V+"%",'text-anchor="end" fill="'+e.muted+'" font-family="'+dt+'" font-size="11" font-weight="600"')+vt(k,T-p/2,f+E-k,p,Y)}),b=0,n.forEach(function(M,w){var T=M/x*100;T<=0||(F+='<circle cx="'+a(L)+'" cy="'+a(m)+'" r="'+a(z)+'" fill="none" stroke="#000" stroke-opacity="0" stroke-width="'+a(A)+'" pathLength="100" stroke-dasharray="'+a(T)+" "+a(100-T)+'" stroke-dashoffset="'+a(-b)+'" transform="rotate(-90 '+a(L)+" "+a(m)+')" class="bzc-hit" data-skip="" data-tip="'+at((s[w]||"#"+(w+1))+": "+h(M,t)+" ("+Math.round(T)+"%)")+'"/>',b+=T)}),F},{stat:d,summary:"total "+h(x,t)+" across "+n.length+" parts"})}me.table=function(t){var e=K(t.values).map(function(i){return Math.max(0,i)}),r=U(t.labels),l=zt(e);return{head:["Label","Value","Share"],rows:e.map(function(i,n){return[r[n]||"#"+(n+1),h(i,t),(l?Math.round(i/l*100):0)+"%"]})}};function pe(t,e){var r=K(t.values),l=r.length?r[0]:I(t.value,NaN),i=U(t.labels),n=I(t.min,0),s=I(t.max,100),o=I(t.height,130);s===n&&(s=n+1);var c=K(t.zones),x=ut(t,e),g=U(t.color).filter(Boolean).length>1?x:[e.up,e.palette[3],e.down],d=x[0];if(c.length&&isFinite(l)){for(var f=0;f<c.length&&l>=c[f];)f++;d=g[Math.min(f,g.length-1)]}var C=!v(t.prefix)&&!v(t.suffix)&&n===0&&s===100,E=function(R){return h(R,t)+(C?"%":"")};return mt(t,e,o,function(R,F,y,L){if(!isFinite(l))return ht(e,R,F,y,L);var m=Math.min(y/2,L-22),A=m*.16,z=m-A/2,b=R+y/2,O=F+m,k=_((l-n)/(s-n),0,1),p=function(tt,Q){var ot=Math.PI*(1-tt);return[b+Q*Math.cos(ot),O-Q*Math.sin(ot)]},B="M"+a(b-z)+","+a(O)+"A"+a(z)+","+a(z)+" 0 0 1 "+a(b+z)+","+a(O),M='<path d="'+B+'" fill="none" stroke="'+d+'" stroke-opacity=".16" stroke-width="'+a(A)+'" stroke-linecap="round"/>';c.length&&c.forEach(function(tt){var Q=_((tt-n)/(s-n),0,1),ot=p(Q,z-A/2-3),q=p(Q,z-A/2-8);M+='<line x1="'+a(ot[0])+'" y1="'+a(ot[1])+'" x2="'+a(q[0])+'" y2="'+a(q[1])+'" stroke="'+e.muted+'" stroke-width="1.5"/>'}),k>0&&(M+='<path d="'+B+'" fill="none" stroke="'+d+'" stroke-width="'+a(A)+'" stroke-linecap="round" pathLength="100" style="stroke-dasharray:'+a(k*100)+' 100"'+lt(t,"bzc-s")+"/>");var w=p(k,z);if(M+='<circle cx="'+a(w[0])+'" cy="'+a(w[1])+'" r="'+a(A*.26)+'" fill="'+(t.background||e.tile)+'"'+lt(t,"bzc-a",.9)+"/>",v(t.goal)){var T=_((+t.goal-n)/(s-n),0,1),V=p(T,z+A/2+4),Y=p(T,z-A/2-4);M+='<line x1="'+a(V[0])+'" y1="'+a(V[1])+'" x2="'+a(Y[0])+'" y2="'+a(Y[1])+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return M+=S(b,O-m*.12,E(l),'text-anchor="middle" fill="'+e.fg+'" font-family="'+it+'" font-size="'+a(m*.34)+'" font-weight="800"'),i[0]&&(M+=S(b,O-m*.12+16,i[0],G(e,10,'text-anchor="middle"'))),M+=S(b-z,O+18,h(n,t,!0),G(e,10,'text-anchor="middle"'))+S(b+z,O+18,h(s,t,!0),G(e,10,'text-anchor="middle"')),M+=vt(b-m,O-m,m*2,m,(i[0]?i[0]+": ":"")+E(l)+" (range "+h(n,t)+" to "+h(s,t)+")"+(v(t.goal)?`
6
- Goal: `+h(+t.goal,t):"")),M},{summary:isFinite(l)?E(l)+" on a scale of "+h(n,t)+" to "+h(s,t):"no data"})}pe.table=function(t){var e=K(t.values),r=e.length?e[0]:I(t.value,NaN),l=U(t.labels),i=I(t.min,0),n=I(t.max,100),s=!v(t.prefix)&&!v(t.suffix)&&i===0&&n===100;return isFinite(r)?{head:["Label","Value"],rows:[[l[0]||"Reading",h(r,t)+(s?"%":"")],["Lowest",h(i,t)],["Highest",h(n,t)]].concat(v(t.goal)?[["Goal",h(+t.goal,t)]]:[])}:{head:["Label","Value"],rows:[]}};function de(t,e){var r=K(t.values).map(function(y){return Math.max(0,y)}),l=U(t.labels),i=ut(t,e),n=r.length===1,s=zt(r),o=v(t.max)?I(t.max,100):n?100:s;o>0||(o=1);var c=!v(t.prefix)&&!v(t.suffix)&&o===100&&n,x=function(y){return h(y,t)+(c?"%":"")},g=It(t),d=g.w,f=0,C=[];if(!n&&r.length){var E=0;f=1,r.forEach(function(y,L){var m=l[L]||"#"+(L+1),A=14+bt(m,12)+6+bt(h(y,t),11,!0)+18;E>0&&E+A>d&&(E=0,f++),C.push({x:E,row:f-1,l:m}),E+=A})}var R=36+(f?12+f*20:0),F=kt(r,t,"");return mt(t,e,R,function(y,L,m,A){if(!r.length)return ht(e,y,L,m,A);var z="",b=L+22,O=Ht("c"),k=n?x(r[0])+(c?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t);n&&l[0]&&(z+=S(y,L+11,l[0],'fill="'+e.fg+'" font-family="'+it+'" font-size="12"')),z+=S(y+m,L+11,k,'text-anchor="end" fill="'+e.fg+'" font-family="'+dt+'" font-size="11" font-weight="600"'),z+='<rect x="'+y+'" y="'+b+'" width="'+m+'" height="14" rx="7" fill="'+e.grid+'" fill-opacity=".7"/>',z+='<clipPath id="'+O+'"><rect x="'+y+'" y="'+b+'" width="'+m+'" height="14" rx="7"/></clipPath><g clip-path="url(#'+O+')"><g'+lt(t,"bzc-gx")+">";var p=0;if(r.forEach(function(M,w){var T=Math.min(M,Math.max(0,o-p))/o*m;T>0&&(z+='<rect x="'+a(y+p/o*m)+'" y="'+b+'" width="'+a(T)+'" height="14" fill="'+i[w%i.length]+'"/>'),w>0&&T>0&&(z+='<rect x="'+a(y+p/o*m-1)+'" y="'+b+'" width="2" height="14" fill="'+(t.background||e.tile)+'"/>'),p+=M}),z+="</g></g>",v(t.goal)){var B=y+_(+t.goal/o,0,1)*m;z+='<line x1="'+a(B)+'" x2="'+a(B)+'" y1="'+(b-4)+'" y2="'+(b+18)+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return p=0,r.forEach(function(M,w){var T=Math.min(M,Math.max(0,o-p))/o*m;T>0&&(z+=vt(y+p/o*m,b-4,T,22,(l[w]||(n?"Progress":"#"+(w+1)))+": "+x(M)+(n?"":" ("+Math.round(M/o*100)+"%)"))),p+=M}),C.forEach(function(M,w){var T=y+M.x,V=b+14+12+M.row*20+8;z+='<circle cx="'+a(T+4)+'" cy="'+a(V)+'" r="4" fill="'+i[w%i.length]+'"/><text x="'+a(T+14)+'" y="'+a(V+4)+'" fill="'+e.fg+'" font-family="'+it+'" font-size="12">'+at(M.l)+'<tspan dx="6" fill="'+e.muted+'" font-family="'+dt+'" font-size="11">'+at(h(r[w],t))+"</tspan></text>"}),z},{stat:F,summary:n?x(r[0])+(c?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t)})}de.table=function(t){var e=K(t.values).map(function(s){return Math.max(0,s)}),r=U(t.labels),l=e.length===1,i=v(t.max)?I(t.max,100):l?100:zt(e);i>0||(i=1);var n=!v(t.prefix)&&!v(t.suffix)&&i===100&&l;return l?{head:["Label","Value"],rows:[[r[0]||"Progress",h(e[0],t)+(n?"%":" of "+h(i,t))]]}:{head:["Label","Value","Share"],rows:e.map(function(s,o){return[r[o]||"#"+(o+1),h(s,t),Math.round(s/i*100)+"%"]})}};var Ue={weekday:"short",day:"numeric",month:"short",year:"numeric"};function Ve(t,e){if(v(t.start)&&/^\d{4}-\d{2}-\d{2}$/.test(String(t.start)))return new Date(String(t.start)+"T00:00:00Z");var r=new Date;return new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Math.max(0,e-1)*864e5)}function Ie(t,e){try{return new Intl.DateTimeFormat(t,Object.assign({timeZone:"UTC"},e))}catch{return new Intl.DateTimeFormat("en-GB",Object.assign({timeZone:"UTC"},e))}}function ge(t,e){var r=K(t.values),l=ut(t,e)[0],i=t.lang||"en-GB",n=Ve(t,r.length),s=(n.getUTCDay()+6)%7,o=Math.max(1,Math.ceil((s+r.length)/7)),c=It(t),x=28,g=Math.max(1,Math.floor((c.w-x)/10));if(o>g){var d=(o-g)*7-s;r=r.slice(d),n=new Date(n.getTime()+d*864e5),s=0,o=g}var f=Math.min(18,(c.w-x)/o),C=f<8?1:3,E=f-C,R=16+7*f+26,F=r.length?Math.max.apply(null,r):0,y=function(b){return Ie(i,b)},L=y({month:"short"}),m=y({weekday:"short"}),A=y(Ue),z=kt(r,t,"");return mt(t,e,R,function(b,O,k,p){if(!r.length)return ht(e,b,O,k,p);var B="",M=b+x,w=O+16,T=-99,V=[.28,.5,.75,1];f>=9&&[0,2,4].forEach(function(W){var gt=new Date(Date.UTC(2024,0,1+W));B+=S(b,w+W*f+E/2+3.5,m.format(gt),G(e,9))});for(var Y=0;Y<r.length;Y++){var tt=s+Y,Q=Math.floor(tt/7),ot=tt%7,q=new Date(n.getTime()+Y*864e5),J=M+Q*f,Lt=w+ot*f;(q.getUTCDate()===1||Y===0)&&J-T>30&&(B+=S(J,O+9,L.format(q),G(e,9)),T=J);var st=r[Y]<=0||!F?0:Math.ceil(r[Y]/F*4),pt=st?l:e.grid,D=st?V[st-1]:.7;B+='<rect x="'+a(J)+'" y="'+a(Lt)+'" width="'+a(E)+'" height="'+a(E)+'" rx="'+a(E*.24)+'" fill="'+pt+'" fill-opacity="'+D+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Q*.012)+'s"':"")+' data-tip="'+at(A.format(q)+": "+h(r[Y],t))+'"/>'}var u=w+7*f+14,H=10,N=b+k-5*(H+3)-30;B+=S(b,u+8,h(zt(r),t,!0)+" in "+r.length+" days",G(e,10)),B+=S(N-6,u+8,"Less",G(e,9,'text-anchor="end"'));for(var et=0;et<5;et++)B+='<rect x="'+a(N+et*(H+3))+'" y="'+u+'" width="'+H+'" height="'+H+'" rx="2.5" fill="'+(et?l:e.grid)+'" fill-opacity="'+(et?V[et-1]:.7)+'"/>';return B+=S(N+5*(H+3)+3,u+8,"More",G(e,9)),B},{stat:z,summary:h(zt(r),t)+" across "+r.length+" days"})}ge.table=function(t){var e=K(t.values),r=Ve(t,e.length),l=Ie(t.lang||"en-GB",Ue);return{head:["Date","Value"],rows:e.map(function(i,n){return[l.format(new Date(r.getTime()+n*864e5)),h(i,t)]})}};function sr(t,e){var r=Math.min(t.length,e.length);if(r<2)return null;var l=0,i=0,n;for(n=0;n<r;n++)l+=t[n],i+=e[n];l/=r,i/=r;var s=0,o=0,c=0;for(n=0;n<r;n++)s+=(t[n]-l)*(t[n]-l),o+=(e[n]-i)*(e[n]-i),c+=(t[n]-l)*(e[n]-i);if(!s)return null;var x=c/s;return{slope:x,intercept:i-x*l,r:o?c/Math.sqrt(s*o):0}}function ve(t,e){for(var r=Et(t.x),l=Et(t.y),i=U(t.series),n=U(t.labels),s=ut(t,e),o=[],c=0;c<Math.max(r.length,l.length);c++){var x=r[c]||[],g=l[c]||[],d=Math.min(x.length,g.length);o.push({xs:x.slice(0,d),ys:g.slice(0,d)})}o=o.filter(function(O){return O.xs.length});var f=o.reduce(function(O,k){return O+k.xs.length},0),C=I(t.height,210),E=o.length>1||i.length>0,R=j(t.trend),F=function(O){return i[O]||"Group "+(O+1)},y={decimals:t.decimals,compact:t.compact,lang:t.lang},L=Xt(t,n),m=Vt(t.markers,oe,"circle"),A=t.background||e.tile,z=function(O){var k=m?m(O):"circle";return k==="none"?"circle":k},b=m&&function(O,k,p){return _t(z(O),k+4,p+6,4,' fill="'+s[O%s.length]+'"')};return mt(t,e,C,function(O,k,p,B){if(!f)return ht(e,O,k,p,B);var M="",w=k;if(E){var T=Ut(o.map(function(P,Z){return F(Z)}),s,e,O,w,p,b);M+=T.svg,w+=T.height}var V=[].concat.apply([],o.map(function(P){return P.xs})),Y=[].concat.apply([],o.map(function(P){return P.ys})),tt=Math.min.apply(null,Y),Q=Math.max.apply(null,Y);v(t.goal)&&(tt=Math.min(tt,+t.goal),Q=Math.max(Q,+t.goal)),j(t.zero)&&(tt=Math.min(0,tt),Q=Math.max(0,Q));var ot=ae(tt,Q,4),q=ae(Math.min.apply(null,V),Math.max.apply(null,V),5),J=ot.ticks.map(function(P){return h(P,t,!0)}),Lt=$e(J)+(v(t.yLabel)?14:0),st=20+(v(t.xLabel)?16:0),pt=O+Lt,D=p-Lt,u=B-(w-k)-st,H=function(P){return pt+6+(P-q.lo)/(q.hi-q.lo)*(D-12)},N=function(P){return w+6+u-6-(P-ot.lo)/(ot.hi-ot.lo)*(u-6)};ot.ticks.forEach(function(P,Z){var X=N(P);M+='<line x1="'+a(pt)+'" x2="'+a(pt+D)+'" y1="'+a(X)+'" y2="'+a(X)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+S(pt-8,X+3.5,J[Z],G(e,10,'text-anchor="end"'))});var et=Math.max(1,Math.ceil(q.ticks.length*44/D));if(q.ticks.forEach(function(P,Z){if(!(Z%et)){var X=H(P);M+='<line x1="'+a(X)+'" x2="'+a(X)+'" y1="'+a(w)+'" y2="'+a(w+u)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+S(X,w+u+15,h(P,y,!0),G(e,10,'text-anchor="middle"'))}}),v(t.xLabel)&&(M+=S(pt+D/2,w+u+32,t.xLabel,G(e,10,'text-anchor="middle" font-weight="600"'))),v(t.yLabel)){var W=w+u/2;M+='<text x="'+a(O+4)+'" y="'+a(W)+'" transform="rotate(-90 '+a(O+4)+" "+a(W)+')" text-anchor="middle" '+G(e,10,'font-weight="600"')+' dominant-baseline="hanging">'+String(t.yLabel).replace(/[&<>"]/g,function(P){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[P]})+"</text>"}v(t.goal)&&(M+=Dt(t,e,pt,pt+D,N(+t.goal))),R&&o.forEach(function(P,Z){var X=sr(P.xs,P.ys);if(X){var ft=Math.min.apply(null,P.xs),St=Math.max.apply(null,P.xs),Rt=X.slope*ft+X.intercept,nt=X.slope*St+X.intercept,At=s[Z%s.length];M+='<line x1="'+a(H(ft))+'" y1="'+a(_(N(Rt),w,w+u))+'" x2="'+a(H(St))+'" y2="'+a(_(N(nt),w,w+u))+'" stroke="'+At+'" stroke-width="2" stroke-dasharray="6 4" stroke-linecap="round" stroke-opacity=".9"/>',M+=S(Math.min(H(St),pt+D)-2,_(N(nt),w+10,w+u)-7,"r = "+X.r.toFixed(2),G(e,10,'text-anchor="end" font-weight="600"',At))}});var gt=0,xt=f>150?3:4.5;o.forEach(function(P,Z){var X=s[Z%s.length];P.xs.forEach(function(ft,St){var Rt=H(ft),nt=N(P.ys[St]),At=(n[gt]?n[gt]+`
7
- `:E?F(Z)+`
8
- `:"")+(v(t.xLabel)?t.xLabel:"x")+": "+h(ft,y)+`
9
- `+(v(t.yLabel)?t.yLabel:"y")+": "+h(P.ys[St],t);M+=_t(z(Z),Rt,nt,xt,' fill="'+X+'" fill-opacity=".85" stroke="'+A+'" stroke-width="1.5"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Math.min(.8,gt*.012))+'s"':"")),M+=vt(Rt-8,nt-8,16,16,At),gt++})});var Mt=[];return o.forEach(function(P){P.xs.forEach(function(Z,X){Mt.push([H(Z),N(P.ys[X])])})}),L.forEach(function(P){var Z=Mt[P.i];Z&&(M+='<circle cx="'+a(Z[0])+'" cy="'+a(Z[1])+'" r="'+(xt+4)+'" fill="none" stroke="'+e.fg+'" stroke-width="1.5"/>'+S(_(Z[0],pt+30,pt+D-30),Z[1]-xt-9,P.text,G(e,10,'text-anchor="middle"',e.fg)))}),M},{summary:f+" points"+(E?" in "+o.length+" groups":"")})}ve.table=function(t){var e=Et(t.x),r=Et(t.y),l=U(t.series),i=U(t.labels),n=e.length>1||l.length>0,s={decimals:t.decimals,compact:t.compact,lang:t.lang},o=[],c=0;return e.forEach(function(x,g){for(var d=r[g]||[],f=0;f<Math.min(x.length,d.length);f++,c++)o.push([i[c]||"#"+(c+1)].concat(n?[l[g]||"Group "+(g+1)]:[],[h(x[f],s),h(d[f],t)]))}),{head:["Point"].concat(n?["Group"]:[],[v(t.xLabel)?t.xLabel:"x",v(t.yLabel)?t.yLabel:"y"]),rows:o}};var Zt={spark:fe,line:ce,bars:ue,scatter:ve,ring:he,donut:me,gauge:pe,progress:de,heatmap:ge},fr=t=>t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase());function Ye(t,e){if(!Zt[t])throw new Error(`Bezel Charts: unknown chart type "${t}". Choose one of: ${Object.keys(Zt).join(", ")}.`);let r={};for(let[l,i]of Object.entries(e))r[fr(l)]=i;return r}function Qt(t,e={}){let r=Ye(t,e);r.animate=j(r.animate),r.frame=r.frame==="none"?"none":"bezel";let l=r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme||"dark";return Zt[t](r,Gt[l])}function qe(t,e={}){return Zt[t].table(Ye(t,e))}function Ee(t){return t.replace(/<rect class="bzc-hit"[^>]*\/>/g,"").replace(/<circle[^>]* class="bzc-hit"[^>]*\/>/g,"").replace(/ data-tip="[^"]*"/g,"")}function We(t,e={}){return Ee(Qt(t,{...e,animate:!1}))}var Xe=["type","values","labels","series","heading","prefix","suffix","decimals","compact","color","theme","frame","width","height","goal","goal-label","notes","show-values","stat","delta","delta-label","max","min","value","zones","horizontal","straight","zero","start","lang","corners","background","center-label","highlight","x","y","x-label","y-label","trend","static","no-tooltips","stacked","angle-labels","dash","markers","patterns"],cr=`:host{display:block;position:relative;max-width:100%}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto;overflow:visible}.tip{position:absolute;left:0;top:0;pointer-events:none;background:#0b0b10;color:#f2f1f7;font:600 12px/1.5 ${dt};padding:7px 10px;border-radius:10px;white-space:pre;opacity:0;transform:translate(-50%,calc(-100% - 12px));transition:opacity .12s;z-index:3;border:1px solid #2a2935;box-shadow:0 8px 24px rgba(0,0,0,.35)}.tip.on{opacity:1}.c{outline:none}.c:focus-visible{outline:2px solid #fff;outline-offset:3px;box-shadow:0 0 0 7px #000}.k{stroke:currentColor;stroke-width:2;stroke-opacity:1}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (forced-colors:active){.c:focus-visible{outline-color:Highlight}}`,ur={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1},hr=()=>typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null,mr=()=>{let t=typeof document<"u"&&document.documentElement?.getAttribute?.("data-theme");return t==="light"||t==="dark"?t:null},ze=new Set;typeof MutationObserver=="function"&&typeof document<"u"&&document.documentElement&&new MutationObserver(()=>ze.forEach(t=>t.refresh())).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var pr=typeof HTMLElement>"u"?class{}:HTMLElement,Jt=class extends pr{static get observedAttributes(){return Xe}static get themes(){return Gt}get resolvedTheme(){let e=this.getAttribute("theme");return e==="light"||e==="dark"?e:this.options.autoTheme}get chartType(){return this.getAttribute("type")||"spark"}connectedCallback(){this.shadowRoot||(this.attachShadow({mode:"open"}).innerHTML=`<style>${cr}</style><div class="c" role="group" aria-roledescription="chart"></div><p class="sr" id="h">Use the arrow keys to step through the values.</p><div class="tip" aria-hidden="true"></div><div class="sr" aria-live="polite"></div><div class="sr"></div>`,[,this.#t,,this.#r,this.#o,this.#c]=this.shadowRoot.children,this.shadowRoot.addEventListener("pointermove",e=>this.#h(e)),this.shadowRoot.addEventListener("pointerdown",e=>this.#h(e)),this.addEventListener("pointerleave",()=>this.#r.classList.remove("on")),this.#t.addEventListener("keydown",e=>this.#v(e)),this.#t.addEventListener("blur",()=>this.#g())),ze.add(this),this.#a=hr(),this.#a?.addEventListener?.("change",this.#u),typeof ResizeObserver=="function"?(this.#l=new ResizeObserver(([e])=>{let r=Math.round(e.contentRect.width);(!this.#n||!this.hasAttribute("width")&&r>0&&Math.abs(r-this.#s)>1)&&this.#i()}),this.#l.observe(this)):this.#i()}disconnectedCallback(){ze.delete(this),this.#l?.disconnect(),this.#a?.removeEventListener?.("change",this.#u)}attributeChangedCallback(){!this.#n||this.#f||(this.#f=!0,queueMicrotask(()=>{this.#f=!1,this.#i()}))}get options(){let e={};for(let r of Xe)this.hasAttribute(r)&&(e[r]=this.getAttribute(r));return e.width||(e.width=this.#s||360),e.autoTheme=mr()||(this.#a?this.#a.matches?"dark":"light":"dark"),e}refresh(){this.#n&&this.#i()}toSVG(e={}){return Ee(Qt(this.chartType,{...this.options,...e,animate:!1}))}download(e){let r=URL.createObjectURL(new Blob([this.toSVG()],{type:"image/svg+xml"})),l=Object.assign(document.createElement("a"),{href:r,download:`${(e||this.getAttribute("heading")||this.chartType).replace(/[^\w-]+/g,"-").toLowerCase()}.svg`});document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}#l=null;#t=null;#r=null;#o=null;#c=null;#e=-1;#a=null;#s=0;#n=!1;#f=!1;#u=()=>{let e=this.getAttribute("theme");(!e||e==="auto")&&this.refresh()};#i(){if(!this.shadowRoot)return;let e=Math.round(this.getBoundingClientRect?.().width||0);this.#s=e>0?e:360;let r=this.options;r.animate=!this.#n&&!this.hasAttribute("static");let l,i=null;try{l=Qt(this.chartType,r),i=qe(this.chartType,r)}catch(c){l=`<p style="font:13px ${it};color:#d63f7c">${at(c.message)}</p>`}let n=this.#t;n.innerHTML=l.replace(/<title>[\s\S]*?<\/title>/,"");let s=n.querySelector("svg");s?(n.setAttribute("aria-label",s.getAttribute("aria-label")),s.removeAttribute("role"),s.removeAttribute("aria-label"),s.setAttribute("aria-hidden","true")):n.removeAttribute("aria-label");let o=!!s&&!this.hasAttribute("no-tooltips");o?(n.setAttribute("tabindex","0"),n.setAttribute("aria-describedby","h")):(n.removeAttribute("tabindex"),n.removeAttribute("aria-describedby")),n.style.color=Gt[r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme].fg,n.style.borderRadius=`${r.frame==="none"?4:_(+r.corners||22,0,60)}px`,this.#c.innerHTML=i&&i.rows.length?dr(r.heading,i):"",this.#e>=0&&o&&this.shadowRoot.activeElement===n?this.#d(this.#e):this.#e=-1,this.#n=!0,this.dispatchEvent(new CustomEvent("bezel-render",{bubbles:!0}))}#h(e){if(this.hasAttribute("no-tooltips"))return;let r=e.target?.closest?.("[data-tip]");if(!r){this.#r.classList.remove("on");return}this.#m(r,e.clientX,e.clientY)}#m(e,r,l){let i=this.#r;i.textContent=e.getAttribute("data-tip");let n=this.getBoundingClientRect?.()||{left:0,top:0,width:0},s=i.offsetWidth/2;i.style.left=`${_(r-n.left,s,Math.max(s,n.width-s))}px`,i.style.top=`${l-n.top}px`,i.classList.add("on")}#p(){return[...this.#t.querySelectorAll("[data-tip]:not([data-skip])")]}#v(e){let r=this.#p(),l=r.length;if(!l)return;let i=this.#e,n=ur[e.key];if(n)this.chartType==="heatmap"&&/Left|Right/.test(e.key)&&(n*=7),i=i<0?n>0?0:l-1:_(i+n,0,l-1);else if(e.key==="Home"||e.key==="End")i=e.key==="Home"?0:l-1;else{e.key==="Escape"&&this.#g();return}e.preventDefault(),this.#d(i,!0)}#d(e,r){let l=this.#p();if(!l.length)return;e=_(e,0,l.length-1),this.#t.querySelector(".k")?.classList.remove("k");let i=l[e],n=i.getBoundingClientRect?.()||{left:0,top:0,width:0};i.classList.add("k"),this.#e=e,this.#m(i,n.left+n.width/2,n.top),r&&(this.#o.textContent=`${i.getAttribute("data-tip").replace(/\n/g,", ")}. ${e+1} of ${l.length}`)}#g(){this.#t.querySelector(".k")?.classList.remove("k"),this.#r.classList.remove("on"),this.#o.textContent="",this.#e=-1}};function dr(t,{head:e,rows:r}){let l=i=>i.map((n,s)=>s?`<td>${at(n)}</td>`:`<th scope="row">${at(n)}</th>`).join("");return`<table><caption>${at(t||"Chart data")}</caption><thead><tr>${e.map(i=>`<th scope="col">${at(i)}</th>`).join("")}</tr></thead><tbody>${r.map(i=>`<tr>${l(i)}</tr>`).join("")}</tbody></table>`}var gr="1.2.0",_e=Object.keys(Zt);if(typeof customElements<"u"&&typeof HTMLElement<"u"){for(let t of _e){let e=`bezel-${t}`;customElements.get(e)||customElements.define(e,class extends Jt{get chartType(){return t}})}customElements.get("bezel-chart")||customElements.define("bezel-chart",class extends Jt{})}return ir(vr);})();
1
+ /*! Bezel Charts v1.4.0 | MIT | github.com/ShazMoghaddam/bezel-charts */
2
+ var BezelCharts=(()=>{var Ge=Object.defineProperty;var sr=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var cr=Object.prototype.hasOwnProperty;var ur=(t,e)=>{for(var r in e)Ge(t,r,{get:e[r],enumerable:!0})},hr=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fr(e))!cr.call(t,i)&&i!==r&&Ge(t,i,{get:()=>e[i],enumerable:!(l=sr(e,i))||l.enumerable});return t};var mr=t=>hr(Ge({},"__esModule",{value:!0}),t);var Er={};ur(Er,{BezelChart:()=>wt,render:()=>Mt,themes:()=>Kt,toSVG:()=>Ct,types:()=>zr,version:()=>Sr});var ft="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",xt="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",pr=0;function Ht(t){return"bzc"+t+(++pr).toString(36)+Math.random().toString(36).slice(2,6)}function ct(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]})}function a(t){return Math.round(t*100)/100}function Q(t,e,r){return Math.max(e,Math.min(r,t))}function W(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function A(t){return t!=null&&t!==""}function rt(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):A(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function U(t){return Array.isArray(t)?t.map(String):A(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function zt(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(rt):[rt(t)]:A(t)?String(t).split("|").map(rt).filter(function(e){return e.length}):[]}function Nt(t){return t.reduce(function(e,r){return e+r},0)}function Et(t,e,r){return String(t).length*e*(r?.6:.56)}function Zt(t,e){return t=String(t),t.length>e?t.slice(0,Math.max(1,e-1))+"\u2026":t}function K(t){return t===!0||t===""||t==="true"||t==="1"}function h(t,e,r){if(!isFinite(t))return"\u2013";var l=Math.abs(t),i;A(e.decimals)?i=Q(parseInt(e.decimals,10)||0,0,6):i=t%1===0?0:l<10?2:l<100?1:0;var n={maximumFractionDigits:i,minimumFractionDigits:A(e.decimals)?i:0};(K(e.compact)||r)&&l>=1e4&&(n={notation:"compact",maximumFractionDigits:1});var s;try{s=new Intl.NumberFormat(e.lang||"en-GB",n).format(l)}catch{s=String(a(l))}return(t<0?"\u2212":"")+(e.prefix||"")+s+(e.suffix||"")}function Ut(t,e){if(!t.length)return"";for(var r="M"+a(t[0][0])+","+a(t[0][1]),l=1;l<t.length;l++){var i=t[l-1],n=t[l];if(e)r+="L"+a(n[0])+","+a(n[1]);else{var s=(i[0]+n[0])/2;r+="C"+a(s)+","+a(i[1])+" "+a(s)+","+a(n[1])+" "+a(n[0])+","+a(n[1])}}return r}function O(t,e,r,l){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(l||"")+">"+ct(r)+"</text>"}function H(t,e,r,l){return'fill="'+(l||t.muted)+'" font-family="'+xt+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function Lt(t,e,r,l,i){return'<rect class="bzc-hit" x="'+a(t)+'" y="'+a(e)+'" width="'+a(Math.max(1,r))+'" height="'+a(Math.max(1,l))+'" fill="#000" fill-opacity="0" data-tip="'+ct(i)+'"/>'}function ut(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function ht(t,e){var r=U(t.color).filter(Boolean);return r.length?r:e.palette}function mt(t,e,r,l,i){return O(e+l/2,r+i/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+ft+'" font-size="13"')}function Yt(t,e){return A(t.notes)?String(t.notes).split(";").map(function(r){var l=r.indexOf(":");if(l<0)return null;var i=r.slice(0,l).trim(),n=r.slice(l+1).trim(),s=e.map(String).indexOf(i);return s<0&&String(parseInt(i,10))===i&&(s=parseInt(i,10)),s>=0&&n?{i:s,text:n}:null}).filter(Boolean):[]}function It(t,e,r,l,i){var n=(A(t.goalLabel)?t.goalLabel:"Goal")+" "+h(W(t.goal,0),t);return'<line x1="'+a(r)+'" x2="'+a(l)+'" y1="'+a(i)+'" y2="'+a(i)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-width="1.25" stroke-dasharray="4 4"/>'+O(l,i-5,n,H(e,10,'text-anchor="end"'))}function kt(t,e,r){var l=String(A(e.stat)?e.stat:r||"").toLowerCase();if(!l||l==="none"||!t.length)return null;var i=Nt(t),n={last:t[t.length-1],total:i,sum:i,average:i/t.length,avg:i/t.length,max:Math.max.apply(null,t),min:Math.min.apply(null,t)};if(!(l in n))return null;var s=null;return l==="last"&&t.length>1&&e.delta!=="none"&&(s=t[t.length-1]-t[0]),{val:n[l],delta:s}}function qt(t){var e=Math.round(Q(W(t.width,360),160,2400)),r=t.frame==="none"?0:4,l=t.frame==="none"?8:20;return{W:e,b:r,P:l,w:e-2*(r+l)}}var dr=".bzc-a{animation:bzc-in .6s ease both}.bzc-d{animation:bzc-draw 1.1s cubic-bezier(.3,.7,.2,1) both}.bzc-g{transform-box:fill-box;transform-origin:50% 100%;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gn{transform-box:fill-box;transform-origin:50% 0;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gx{transform-box:fill-box;transform-origin:0 50%;animation:bzc-growx .8s cubic-bezier(.2,.8,.2,1) both}.bzc-s{animation:bzc-sweep 1.1s cubic-bezier(.2,.8,.2,1) both}@keyframes bzc-in{from{opacity:0}}@keyframes bzc-draw{from{stroke-dashoffset:1}}@keyframes bzc-grow{from{transform:scaleY(0)}}@keyframes bzc-growx{from{transform:scaleX(0)}}@keyframes bzc-sweep{from{stroke-dasharray:0 100}}@media (prefers-reduced-motion:reduce){[class^=bzc-]{animation:none!important}}";function pt(t,e,r,l,i){var n=qt(t),s=n.W,o=n.b,f=n.P,u=n.w,p=Q(W(t.corners,22),0,60),m=o+f,c="";A(t.heading)&&(c+=O(o+f,m+10,String(t.heading).toUpperCase(),H(e,11,'font-weight="600" letter-spacing="1.3"')),m+=24);var T=i&&i.stat;if(T){if(c+=O(o+f,m+30,h(T.val,t),'fill="'+e.fg+'" font-family="'+ft+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),T.delta!=null){var w=T.delta>0,B=T.delta===0,N=t.delta==="inverse"?!w:w,L=B?e.muted:N?e.up:e.down,z=(B?"\u25CF ":w?"\u25B2 ":"\u25BC ")+h(Math.abs(T.delta),t)+" "+(A(t.deltaLabel)?t.deltaLabel:"since start");c+=O(o+f+u,m+28,z,'text-anchor="end" fill="'+L+'" font-family="'+xt+'" font-size="11" font-weight="600"')}m+=44}var g=l(o+f,m,u,r),V=Math.round(m+r+f+o),k="";t.frame!=="none"?k='<rect width="'+s+'" height="'+V+'" rx="'+p+'" fill="'+e.bezel+'"/><rect x="'+o+'" y="'+o+'" width="'+(s-2*o)+'" height="'+(V-2*o)+'" rx="'+Math.max(0,p-o)+'" fill="'+(t.background||e.tile)+'"/>':A(t.background)&&(k='<rect width="'+s+'" height="'+V+'" rx="'+p+'" fill="'+t.background+'"/>');var d=(A(t.heading)?t.heading+": ":"")+(i&&i.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s+" "+V+'" width="'+s+'" height="'+V+'" role="img" aria-label="'+ct(d)+'"><title>'+ct(d)+"</title>"+(t.animate?"<style>"+dr+"</style>":"")+k+c+g+"</svg>"}function ue(t,e){var r=rt(t.values),l=ht(t,e)[0],i=W(t.height,64),n=U(t.labels),s=Yt(t,n),o=kt(r,t,"last");return pt(t,e,i,function(f,u,p,m){if(!r.length)return mt(e,f,u,p,m);var c=r.length===1?[r[0],r[0]]:r,T=Math.min.apply(null,c),w=Math.max.apply(null,c);A(t.goal)&&(T=Math.min(T,+t.goal),w=Math.max(w,+t.goal));var B=(w-T||Math.abs(w)||1)*.12;T-=B,w+=B;var N=function(v){return f+v*p/(c.length-1)},L=function(v){return u+m-(v-T)/(w-T)*m},z=c.map(function(v,x){return[N(x),L(v)]}),g=Ut(z,K(t.straight)),V=Ht("g"),k=z[z.length-1],d='<defs><linearGradient id="'+V+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+l+'" stop-opacity=".32"/><stop offset="1" stop-color="'+l+'" stop-opacity="0"/></linearGradient></defs>';[1/3,2/3].forEach(function(v){d+='<line x1="'+f+'" x2="'+(f+p)+'" y1="'+a(u+m*v)+'" y2="'+a(u+m*v)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),d+='<path d="'+g+"L"+a(k[0])+","+(u+m)+"L"+f+","+(u+m)+'Z" fill="url(#'+V+')"'+ut(t,"bzc-a")+"/>",d+='<path d="'+g+'" fill="none" stroke="'+l+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+ut(t,"bzc-d")+"/>",A(t.goal)&&(d+=It(t,e,f,f+p,L(+t.goal))),s.forEach(function(v){if(!(v.i>=r.length)){var x=z[v.i];d+='<circle cx="'+a(x[0])+'" cy="'+a(x[1])+'" r="3.5" fill="'+e.fg+'"/>'+O(Q(x[0],f+30,f+p-30),x[1]-9,v.text,H(e,10,'text-anchor="middle"',e.fg))}}),d+='<circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="9" fill="'+l+'" fill-opacity=".25"/><circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="4.5" fill="'+l+'"/>',K(t.showValues)&&z.forEach(function(v,x){x<r.length&&(d+=O(v[0],v[1]-8,h(r[x],t,!0),H(e,9,'text-anchor="middle"')))});var b=r.length>1?p/(r.length-1):p;return r.forEach(function(v,x){d+=Lt(N(x)-b/2,u-6,b,m+12,(n[x]||"#"+(x+1))+": "+h(v,t))}),d},{stat:o,summary:r.length?"latest "+h(r[r.length-1],t):"no data"})}ue.table=function(t){var e=U(t.labels);return{head:["Label","Value"],rows:rt(t.values).map(function(r,l){return[e[l]||"#"+(l+1),h(r,t)]})}};var Kt={dark:{tile:"#15151d",bezel:"#000000",fg:"#f2f1f7",muted:"#8c8aa0",grid:"#2a2935",up:"#5EE6C8",down:"#F675A8",palette:["#9FA1FF","#F675A8","#5EE6C8","#FFC857","#7CC4FF","#FF8A5B"]},light:{tile:"#ffffff",bezel:"#000000",fg:"#17161f",muted:"#6b6980",grid:"#e8e6ef",up:"#12a383",down:"#d63f7c",palette:["#6E70F0","#E2508C","#16A884","#D99A0E","#2F8FE0","#EE6431"]}};var he=["spark","line","area","bars","scatter","ring","donut","gauge","progress","heatmap"],me={};function dt(t,e){me[t]=e}var gr=t=>t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase());function Ze(t,e){if(!me[t])throw new Error(he.includes(t)?`Bezel Charts: the ${t} chart isn't loaded. Add import 'bezel-charts/${t}', or load dist/charts/${t}.js.`:`Bezel Charts: unknown chart type "${t}". Choose one of: ${he.join(", ")}.`);let r={};for(let[l,i]of Object.entries(e))r[gr(l)]=i;return r}function Mt(t,e={}){let r=Ze(t,e);r.animate=K(r.animate),r.frame=r.frame==="none"?"none":"bezel";let l=r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme||"dark";return me[t](r,Kt[l])}function qe(t,e={}){return me[t].table(Ze(t,e))}function He(t){return t.replace(/<rect class="bzc-hit"[^>]*\/>/g,"").replace(/<circle[^>]* class="bzc-hit"[^>]*\/>/g,"").replace(/ data-tip="[^"]*"/g,"")}function Ct(t,e={}){return He(Mt(t,{...e,animate:!1}))}var Ke=["type","values","labels","series","heading","prefix","suffix","decimals","compact","color","theme","frame","width","height","goal","goal-label","notes","show-values","stat","delta","delta-label","max","min","value","zones","horizontal","straight","zero","start","lang","corners","background","center-label","highlight","x","y","x-label","y-label","trend","static","no-tooltips","stacked","angle-labels","dash","markers","patterns"],vr=`:host{display:block;position:relative;max-width:100%}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto;overflow:visible}.tip{position:absolute;left:0;top:0;pointer-events:none;background:#0b0b10;color:#f2f1f7;font:600 12px/1.5 ${xt};padding:7px 10px;border-radius:10px;white-space:pre;opacity:0;transform:translate(-50%,calc(-100% - 12px));transition:opacity .12s;z-index:3;border:1px solid #2a2935;box-shadow:0 8px 24px rgba(0,0,0,.35)}.tip.on{opacity:1}.c{outline:none}.c:focus-visible{outline:2px solid #fff;outline-offset:3px;box-shadow:0 0 0 7px #000}.k{stroke:currentColor;stroke-width:2;stroke-opacity:1}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (forced-colors:active){.c:focus-visible{outline-color:Highlight}}`,xr={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1},yr=()=>typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null,br=()=>{let t=typeof document<"u"&&document.documentElement?.getAttribute?.("data-theme");return t==="light"||t==="dark"?t:null},Re=new Set;typeof MutationObserver=="function"&&typeof document<"u"&&document.documentElement&&new MutationObserver(()=>Re.forEach(t=>t.refresh())).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var kr=typeof HTMLElement>"u"?class{}:HTMLElement,wt=class extends kr{static get observedAttributes(){return Ke}static get themes(){return Kt}get resolvedTheme(){let e=this.getAttribute("theme");return e==="light"||e==="dark"?e:this.options.autoTheme}get chartType(){return this.getAttribute("type")||"spark"}connectedCallback(){this.shadowRoot||(this.attachShadow({mode:"open"}).innerHTML=`<style>${vr}</style><div class="c" role="group" aria-roledescription="chart"></div><p class="sr" id="h">Use the arrow keys to step through the values.</p><div class="tip" aria-hidden="true"></div><div class="sr" aria-live="polite"></div><div class="sr"></div>`,[,this.#t,,this.#r,this.#o,this.#c]=this.shadowRoot.children,this.shadowRoot.addEventListener("pointermove",e=>this.#h(e)),this.shadowRoot.addEventListener("pointerdown",e=>this.#h(e)),this.addEventListener("pointerleave",()=>this.#r.classList.remove("on")),this.#t.addEventListener("keydown",e=>this.#v(e)),this.#t.addEventListener("blur",()=>this.#g())),Re.add(this),this.#a=yr(),this.#a?.addEventListener?.("change",this.#u),typeof ResizeObserver=="function"?(this.#l=new ResizeObserver(([e])=>{let r=Math.round(e.contentRect.width);(!this.#n||!this.hasAttribute("width")&&r>0&&Math.abs(r-this.#s)>1)&&this.#i()}),this.#l.observe(this)):this.#i()}disconnectedCallback(){Re.delete(this),this.#l?.disconnect(),this.#a?.removeEventListener?.("change",this.#u)}attributeChangedCallback(){!this.#n||this.#f||(this.#f=!0,queueMicrotask(()=>{this.#f=!1,this.#i()}))}get options(){let e={};for(let r of Ke)this.hasAttribute(r)&&(e[r]=this.getAttribute(r));return e.width||(e.width=this.#s||360),e.autoTheme=br()||(this.#a?this.#a.matches?"dark":"light":"dark"),e}refresh(){this.#n&&this.#i()}toSVG(e={}){return He(Mt(this.chartType,{...this.options,...e,animate:!1}))}download(e){let r=URL.createObjectURL(new Blob([this.toSVG()],{type:"image/svg+xml"})),l=Object.assign(document.createElement("a"),{href:r,download:`${(e||this.getAttribute("heading")||this.chartType).replace(/[^\w-]+/g,"-").toLowerCase()}.svg`});document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}#l=null;#t=null;#r=null;#o=null;#c=null;#e=-1;#a=null;#s=0;#n=!1;#f=!1;#u=()=>{let e=this.getAttribute("theme");(!e||e==="auto")&&this.refresh()};#i(){if(!this.shadowRoot)return;let e=Math.round(this.getBoundingClientRect?.().width||0);this.#s=e>0?e:360;let r=this.options;r.animate=!this.#n&&!this.hasAttribute("static");let l,i=null;try{l=Mt(this.chartType,r),i=qe(this.chartType,r)}catch(f){l=`<p style="font:13px ${ft};color:#d63f7c">${ct(f.message)}</p>`}let n=this.#t;n.innerHTML=l.replace(/<title>[\s\S]*?<\/title>/,"");let s=n.querySelector("svg");s?(n.setAttribute("aria-label",s.getAttribute("aria-label")),s.removeAttribute("role"),s.removeAttribute("aria-label"),s.setAttribute("aria-hidden","true")):n.removeAttribute("aria-label");let o=!!s&&!this.hasAttribute("no-tooltips");o?(n.setAttribute("tabindex","0"),n.setAttribute("aria-describedby","h")):(n.removeAttribute("tabindex"),n.removeAttribute("aria-describedby")),n.style.color=Kt[r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme].fg,n.style.borderRadius=`${r.frame==="none"?4:Q(+r.corners||22,0,60)}px`,this.#c.innerHTML=i&&i.rows.length?Mr(r.heading,i):"",this.#e>=0&&o&&this.shadowRoot.activeElement===n?this.#d(this.#e):this.#e=-1,this.#n=!0,this.dispatchEvent(new CustomEvent("bezel-render",{bubbles:!0}))}#h(e){if(this.hasAttribute("no-tooltips"))return;let r=e.target?.closest?.("[data-tip]");if(!r){this.#r.classList.remove("on");return}this.#m(r,e.clientX,e.clientY)}#m(e,r,l){let i=this.#r;i.textContent=e.getAttribute("data-tip");let n=this.getBoundingClientRect?.()||{left:0,top:0,width:0},s=i.offsetWidth/2;i.style.left=`${Q(r-n.left,s,Math.max(s,n.width-s))}px`,i.style.top=`${l-n.top}px`,i.classList.add("on")}#p(){return[...this.#t.querySelectorAll("[data-tip]:not([data-skip])")]}#v(e){let r=this.#p(),l=r.length;if(!l)return;let i=this.#e,n=xr[e.key];if(n)this.chartType==="heatmap"&&/Left|Right/.test(e.key)&&(n*=7),i=i<0?n>0?0:l-1:Q(i+n,0,l-1);else if(e.key==="Home"||e.key==="End")i=e.key==="Home"?0:l-1;else{e.key==="Escape"&&this.#g();return}e.preventDefault(),this.#d(i,!0)}#d(e,r){let l=this.#p();if(!l.length)return;e=Q(e,0,l.length-1),this.#t.querySelector(".k")?.classList.remove("k");let i=l[e],n=i.getBoundingClientRect?.()||{left:0,top:0,width:0};i.classList.add("k"),this.#e=e,this.#m(i,n.left+n.width/2,n.top),r&&(this.#o.textContent=`${i.getAttribute("data-tip").replace(/\n/g,", ")}. ${e+1} of ${l.length}`)}#g(){this.#t.querySelector(".k")?.classList.remove("k"),this.#r.classList.remove("on"),this.#o.textContent="",this.#e=-1}};function Mr(t,{head:e,rows:r}){let l=i=>i.map((n,s)=>s?`<td>${ct(n)}</td>`:`<th scope="row">${ct(n)}</th>`).join("");return`<table><caption>${ct(t||"Chart data")}</caption><thead><tr>${e.map(i=>`<th scope="col">${ct(i)}</th>`).join("")}</tr></thead><tbody>${r.map(i=>`<tr>${l(i)}</tr>`).join("")}</tbody></table>`}function gt(t){typeof customElements>"u"||typeof HTMLElement>"u"||(customElements.get(`bezel-${t}`)||customElements.define(`bezel-${t}`,class extends wt{get chartType(){return t}}),customElements.get("bezel-chart")||customElements.define("bezel-chart",class extends wt{}))}dt("spark",ue);gt("spark");function fe(t,e,r){if(t===e)if(t===0)e=1;else{var l=Math.abs(t)*.1;t-=l,e+=l}for(var i=(e-t)/(r||4),n=Math.pow(10,Math.floor(Math.log10(i))),s=i/n,o=(s<=1?1:s<=2?2:s<=5?5:10)*n,f=Math.floor(t/o)*o,u=Math.ceil(e/o)*o,p=[],m=f;m<=u+o/2;m+=o)p.push(+m.toFixed(10));return{lo:f,hi:u,ticks:p}}function Qt(t,e,r,l,i,n,s,o){var f=l,u=i,p="",m=o||13;return t.forEach(function(c,T){var w=m+Et(c,12)+16;f>l&&f+w-16>l+n&&(f=l,u+=20),p+=(s?s(T,f,u):'<circle cx="'+a(f+4)+'" cy="'+a(u+6)+'" r="4" fill="'+e[T%e.length]+'"/>')+O(f+m,u+10,c,'fill="'+r.fg+'" font-family="'+ft+'" font-size="12"'),f+=w}),{svg:p,height:u-i+24}}var Xt={solid:"",dashed:"7 5",dotted:"1 5",dashdot:"9 4 1 4"},ee=["circle","square","triangle","diamond"],pe=["solid","stripes","dots","grid"];function Vt(t,e,r){if(t==null||t===!1||t==="none"||t==="false")return null;var l=t===!0||t===""||t==="auto"?e:U(t).map(function(i){return e.indexOf(i)<0?r:i});return l.length?function(i){return l[i%l.length]}:null}function re(t,e,r,l,i){var n=l*1.15,s=l*.85;return t==="square"?'<rect x="'+a(e-s)+'" y="'+a(r-s)+'" width="'+a(2*s)+'" height="'+a(2*s)+'" rx="1"'+i+"/>":t==="triangle"?'<path d="M'+a(e)+","+a(r-n)+"L"+a(e+n)+","+a(r+s)+"L"+a(e-n)+","+a(r+s)+'Z"'+i+"/>":t==="diamond"?'<path d="M'+a(e)+","+a(r-n*1.1)+"L"+a(e+n)+","+a(r)+"L"+a(e)+","+a(r+n*1.1)+"L"+a(e-n)+","+a(r)+'Z"'+i+"/>":'<circle cx="'+a(e)+'" cy="'+a(r)+'" r="'+a(l)+'"'+i+"/>"}function de(t,e,r,l){var i=' stroke="'+l+'" stroke-opacity=".55" stroke-width="1.5"';return'<pattern id="'+t+'" width="6" height="6" patternUnits="userSpaceOnUse"'+(e==="dots"?"":' patternTransform="rotate(45)"')+'><rect width="6" height="6" fill="'+r+'"/>'+(e==="dots"?'<circle cx="3" cy="3" r="1.3" fill="'+l+'" fill-opacity=".55"/>':'<path d="M3,0V6'+(e==="grid"?"M0,3H6":"")+'"'+i+"/>")+"</pattern>"}function Qe(t){return Math.max.apply(null,t.map(function(e){return Et(e,10,!0)}))+10}function ae(t,e){for(var r=zt(t.values),l=U(t.series),i=U(t.labels),n=[],s=Math.max.apply(null,[0].concat(r.map(function(m){return m.length}))),o=0;o<s;o++){var f=[i[o]||"#"+(o+1)],u=0;r.forEach(function(m){f.push(o<m.length?h(m[o],t):""),u+=o<m.length?m[o]:0}),e&&f.push(h(u,t)),n.push(f)}var p=r.length>1||l.length?r.map(function(m,c){return l[c]||"Series "+(c+1)}):["Value"];return{head:["Label"].concat(p,e?["Total"]:[]),rows:n}}function ge(t,e,r,l,i,n,s){var o="",f=i,u=r.n,p=r.labels;if(r.names){var m=Qt(r.names,r.pal,e,l,f,n,r.key,r.kw);o+=m.svg,f+=m.height}var c=r.lo,T=r.hi;A(t.goal)&&(c=Math.min(c,+t.goal),T=Math.max(T,+t.goal)),r.zero&&(c=Math.min(0,c),T=Math.max(0,T));var w=fe(c,T,4),B=w.ticks.map(r.tick),N=Math.max.apply(null,B.map(function(C){return Et(C,10,!0)}))+10,L=p.length?20:4,z=l+N,g=n-N,V=s-(f-i)-L,k=function(C){return u===1?z+g/2:z+C*g/(u-1)},d=function(C){return f+V-(C-w.lo)/(w.hi-w.lo)*V};if(w.ticks.forEach(function(C,y){var M=d(C);o+='<line x1="'+a(z)+'" x2="'+a(z+g)+'" y1="'+a(M)+'" y2="'+a(M)+'" stroke="'+e.grid+'"'+(C===0?"":' stroke-dasharray="2 4"')+"/>"+O(z-8,M+3.5,B[y],H(e,10,'text-anchor="end"'))}),p.length){for(var b=Math.max(1,Math.ceil(u*(Math.max.apply(null,p.map(function(C){return Et(C,10,!0)}))+10)/g)),v=0;v<u;v+=b)if(p[v]!=null){var x=u>1&&v===0?"start":u>1&&v===u-1?"end":"middle";o+=O(k(v),f+V+15,p[v],H(e,10,'text-anchor="'+x+'"'))}}return r.notes.forEach(function(C){if(!(C.i>=u)){var y=k(C.i);o+='<line x1="'+a(y)+'" x2="'+a(y)+'" y1="'+a(f+12)+'" y2="'+a(f+V)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+O(Q(y,z+30,z+g-30),f+8,C.text,H(e,10,'text-anchor="middle"',e.fg))}}),{svg:o,X:k,Y:d,px:z,pw:g,top:f,ph:V}}function ve(t,e,r,l,i){for(var n=A(t.goal)?It(t,e,r.px,r.px+r.pw,r.Y(+t.goal)):"",s=l>1?r.pw/(l-1):r.pw,o=0;o<l;o++)n+=Lt(r.X(o)-s/2,r.top,s,r.ph,i(o));return n}function xe(t,e,r,l){return function(i,n,s){var o=t[i%t.length],f=e?Xt[e(i)]:"",u=r?r(i):"none";return'<line x1="'+a(n)+'" x2="'+a(n+18)+'" y1="'+a(s+6)+'" y2="'+a(s+6)+'" stroke="'+o+'" stroke-width="2.5" stroke-linecap="round"'+(f?' stroke-dasharray="'+f+'"':"")+"/>"+(u!=="none"?re(u,n+9,s+6,3.5,' fill="'+o+'" stroke="'+l+'" stroke-width="1.5"'):"")}}function ye(t,e,r,l,i){return i?'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="'+i+'"'+ut(t,"bzc-a",l*.15)+"/>":'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+l*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>"}function be(t,e,r,l,i,n,s,o){var f="",u=Math.ceil(r.length/40);return r.forEach(function(p,m){(m%u===0||m===r.length-1)&&(f+=re(e,l(m),i(p),3.5,' fill="'+n+'" stroke="'+s+'" stroke-width="1.5"'+ut(t,"bzc-a",.6+o*.15)))}),f}function ke(t,e){var r=zt(t.values),l=U(t.series),i=U(t.labels),n=ht(t,e),s=W(t.height,170),o=Math.max.apply(null,[0].concat(r.map(function(N){return N.length}))),f=Yt(t,i),u=r.length>1||l.length>0,p=kt(r[0]||[],t,""),m=Vt(t.dash,Object.keys(Xt),"solid"),c=Vt(t.markers,ee,"none"),T=t.background||e.tile,w=(m||c)&&xe(n,m,c,T),B=function(N){return l[N]||"Series "+(N+1)};return pt(t,e,s,function(N,L,z,g){if(!o)return mt(e,N,L,z,g);var V=[].concat.apply([],r),k=ge(t,e,{n:o,names:u?r.map(function(F,P){return B(P)}):null,pal:n,key:w,kw:w&&24,lo:Math.min.apply(null,V),hi:Math.max.apply(null,V),zero:K(t.zero),labels:i,notes:f,tick:function(F){return h(F,t,!0)}},N,L,z,g),d=k.svg,b=k.X,v=k.Y,x=k.px,C=k.pw,y=k.top,M=k.ph;return r.forEach(function(F,P){var _=n[P%n.length],I=F.map(function(lt,at){return[b(at),v(lt)]});I.length===1&&(I=[[x,I[0][1]],[x+C,I[0][1]]]);var J=Ut(I,K(t.straight));if(P===0){var tt=Ht("g"),j=I[I.length-1];d+='<defs><linearGradient id="'+tt+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+_+'" stop-opacity=".26"/><stop offset="1" stop-color="'+_+'" stop-opacity="0"/></linearGradient></defs><path d="'+J+"L"+a(j[0])+","+a(y+M)+"L"+a(I[0][0])+","+a(y+M)+'Z" fill="url(#'+tt+')"'+ut(t,"bzc-a")+"/>"}var G=c?c(P):"none";if(d+=ye(t,J,_,P,m?Xt[m(P)]:""),G!=="none")d+=be(t,G,F,b,v,_,T,P);else{var et=I[I.length-1];d+='<circle cx="'+a(et[0])+'" cy="'+a(et[1])+'" r="4" fill="'+_+'" stroke="'+T+'" stroke-width="2"/>'}K(t.showValues)&&F.forEach(function(lt,at){d+=O(b(at),v(lt)-8,h(lt,t,!0),H(e,9,'text-anchor="middle"'))})}),d+ve(t,e,k,o,function(F){var P=i[F]||"#"+(F+1);return r.forEach(function(_,I){F<_.length&&(P+=`
3
+ `+(u?B(I)+": ":"")+h(_[F],t))}),P})},{stat:p,summary:r.length+" series over "+o+" points"})}ke.table=function(t){return ae(t)};dt("line",ke);gt("line");function Me(t,e){for(var r=zt(t.values),l=U(t.series),i=U(t.labels),n=ht(t,e),s=W(t.height,170),o=r.length,f=Math.max.apply(null,[0].concat(r.map(function(G){return G.length}))),u=o>1?t.stacked==="percent"?"percent":K(t.stacked)?"stack":"":"",p=Yt(t,i),m=o>1||l.length>0,c=function(G){return l[G]||"Series "+(G+1)},T=function(G,et){return et<r[G].length?r[G][et]:0},w=r.map(function(){return[]}),B=r.map(function(){return[]}),N=[],L=[],z=0;z<f;z++){for(var g=0,V=0,k=0,d=0,b=0;b<o;b++)k+=T(b,z),d+=Math.max(0,T(b,z));for(N.push(k),L.push(d),b=0;b<o;b++){var v=u==="percent"?d?Math.max(0,T(b,z))/d*100:0:T(b,z);u?v>=0?(w[b].push(g),g+=v,B[b].push(g)):(w[b].push(V),V+=v,B[b].push(V)):(w[b].push(0),B[b].push(v))}}for(var x=[].concat.apply([],w.concat(B)),C=Vt(t.dash,Object.keys(Xt),"solid"),y=Vt(t.markers,ee,"none"),M=o>1?Vt(t.patterns,pe,"solid"):null,F=t.background||e.tile,P="",_=[],I=0;M&&I<o;I++)if(M(I)!=="solid"){var J=Ht("g");P+=de(J,M(I),n[I%n.length],F),_[I]="url(#"+J+")"}var tt=M?function(G,et,lt){return'<rect x="'+a(et)+'" y="'+a(lt+1)+'" width="10" height="10" rx="2" fill="'+(_[G]||n[G%n.length])+'"/>'}:(C||y)&&xe(n,C,y,F),j=function(G,et){return L[et]?Math.round(Math.max(0,T(G,et))/L[et]*100):0};return pt(t,e,s,function(G,et,lt,at){if(!f)return mt(e,G,et,lt,at);var ot=ge(t,e,{n:f,names:m?r.map(function(Z,E){return c(E)}):null,pal:n,key:tt,kw:tt&&(M?15:24),lo:Math.min.apply(null,x),hi:Math.max.apply(null,x),zero:!0,labels:i,notes:p,tick:u==="percent"?function(Z){return h(Z,{lang:t.lang},!0)+"%"}:function(Z){return h(Z,t,!0)}},G,et,lt,at),S=(P?"<defs>"+P+"</defs>":"")+ot.svg,Y=ot.X,R=ot.Y,nt=function(Z){var E=Z.map(function(D,X){return[Y(X),R(D)]});return E.length===1?[[ot.px,E[0][1]],[ot.px+ot.pw,E[0][1]]]:E},q=K(t.straight),yt=u?".8":".22",St=function(Z){return u?B[Z]:r[Z]};return r.forEach(function(Z,E){var D=nt(St(E)),X=nt(u?w[E]:St(E).map(function(){return 0})).reverse();S+='<path d="'+Ut(D,q)+Ut(X,q).replace(/^M/,"L")+'Z" fill="'+(_[E]||n[E%n.length])+'" fill-opacity="'+yt+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(E*.1)+'s"':"")+"/>"}),r.forEach(function(Z,E){var D=n[E%n.length],X=St(E),bt=nt(X),At=y?y(E):"none";S+=ye(t,Ut(bt,q),D,E,C?Xt[C(E)]:""),At!=="none"?S+=be(t,At,X,Y,R,D,F,E):u||(S+='<circle cx="'+a(bt[bt.length-1][0])+'" cy="'+a(bt[bt.length-1][1])+'" r="4" fill="'+D+'" stroke="'+F+'" stroke-width="2"/>'),K(t.showValues)&&!u&&X.forEach(function(Ft,it){S+=O(Y(it),R(Ft)-8,h(Ft,t,!0),H(e,9,'text-anchor="middle"'))})}),K(t.showValues)&&u==="stack"&&N.forEach(function(Z,E){var D=Math.max.apply(null,B.map(function(X){return X[E]}).concat([0]));S+=O(Y(E),R(D)-8,h(Z,t,!0),H(e,9,'text-anchor="middle"'))}),S+ve(t,e,ot,f,function(Z){var E=i[Z]||"#"+(Z+1);return r.forEach(function(D,X){Z<D.length&&(E+=`
4
+ `+(m?c(X)+": ":"")+h(D[Z],t)+(u==="percent"?" ("+j(X,Z)+"%)":""))}),E+(u?`
5
+ Total: `+h(N[Z],t):"")})},{stat:kt(u?N:r[0]||[],t,""),summary:o+" series "+(u==="percent"?"as shares of each total":u?"stacked":"filled")+" over "+f+" points"})}Me.table=function(t){var e=zt(t.values);return ae(t,e.length>1&&(t.stacked==="percent"||K(t.stacked)))};dt("area",Me);gt("area");var Je=40,je=24;function we(t,e){for(var r=zt(t.values),l=U(t.series),i=U(t.labels),n=ht(t,e),s=r.length,o=Math.max.apply(null,[0].concat(r.map(function(S){return S.length}))),f=s>1,u=K(t.horizontal),p=f&&K(t.stacked),m=!f&&U(t.color).filter(Boolean).length>1,c=r[0]||[],T=[].concat.apply([],r),w=function(S,Y){return r.reduce(function(R,nt){return S<nt.length&&nt[S]*Y>0?R+nt[S]:R},0)},B=[],N=[],L=[],z=0;p&&z<o;z++)N.push(w(z,1)),L.push(w(z,-1)),B.push(N[z]+L[z]);for(var g=p?N.concat(L):T,V=g.length?Math.max.apply(null,g):0,k=function(S){return l[S]||"Series "+(S+1)},d=f?Vt(t.patterns,pe,"solid"):null,b="",v=[],x=0;d&&x<s;x++)if(d(x)!=="solid"){var C=Ht("g");b+=de(C,d(x),n[x%n.length],t.background||e.tile),v[x]="url(#"+C+")"}var y=function(S,Y){return f?v[S]||n[S%n.length]:m?n[Y%n.length]:n[0]},M=d&&function(S,Y,R){return'<rect x="'+a(Y)+'" y="'+a(R+1)+'" width="10" height="10" rx="2" fill="'+y(S)+'"/>'},F=function(S){return f||m||t.highlight==="none"||S===V?1:.5},P=function(S){return i[S]||"#"+(S+1)},_=function(S){return f?P(S)+r.map(function(Y,R){return S<Y.length?`
6
+ `+k(R)+": "+h(Y[S],t):""}).join("")+(p?`
7
+ Total: `+h(B[S],t):""):P(S)+": "+h(c[S],t)},I=qt(t),J=f||l.length?Qt(r.map(function(S,Y){return k(Y)}),n,e,0,0,I.w,M,M&&15).height:0,tt=p?1:s,j=f&&!p,G=j?10:14,et=3,lt=u?tt*G+(tt-1)*et+(j?14:16):0,at=u?J+Math.max(1,o)*lt-6:W(t.height,140)+J,ot=c.indexOf(Math.max.apply(null,c.length?c:[0]));return pt(t,e,at,function(S,Y,R,nt){if(!o)return mt(e,S,Y,R,nt);var q=b?"<defs>"+b+"</defs>":"",yt=Y;J&&(q+=Qt(r.map(function($,st){return k(st)}),n,e,S,Y,R,M,M&&15).svg,yt+=J);var St=Math.min(0,Math.min.apply(null,g)),Z=Math.max(0,V);if(A(t.goal)&&(St=Math.min(St,+t.goal),Z=Math.max(Z,+t.goal)),Z===St&&(Z=St+1),u){for(var E=i.length?Math.min(R*.4,Math.max.apply(null,i.map(function($){return Et($,12)}))+10):0,D=p?[B.map(function($){return h($,t)})]:r.map(function($){return $.map(function(st){return h(st,t)})}),X=Math.max.apply(null,[].concat.apply([],D).map(function($){return Et($,j?10:11,!0)}))+10,bt=S+E,At=R-E-X,Ft=Math.max(Z,0)||1,it=0;it<o;it++){var Bt=yt+it*lt;i[it]!=null&&(q+=O(S,Bt+(lt-6)/2+4,Zt(i[it],Math.floor(E/6.7)),'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')),p?(q+=ar(it,bt,Bt+5,At,Ft),q+=O(S+R,Bt+5+G/2+3.8,D[0][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="11" font-weight="600"')):r.forEach(function($,st){if(!(it>=$.length)){var vt=$[it],Tt=Bt+(f?2:5)+st*(G+et),Rt=Math.max(0,vt)/Ft*At;f||(q+='<rect x="'+a(bt)+'" y="'+a(Tt)+'" width="'+a(At)+'" height="'+G+'" rx="'+G/2+'" fill="'+e.grid+'" fill-opacity=".6"/>'),Rt>0&&(q+='<rect x="'+a(bt)+'" y="'+a(Tt)+'" width="'+a(Math.max(G,Rt))+'" height="'+G+'" rx="'+G/2+'" fill="'+y(st,it)+'" fill-opacity="'+F(vt)+'"'+ut(t,"bzc-gx",it*.06+st*.03)+"/>"),q+=O(S+R,Tt+G/2+3.8,D[st][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="'+(f?10:11)+'" font-weight="600"')}}),q+=Lt(S,Bt,R,lt-6,_(it))}if(A(t.goal)&&+t.goal>0){var Pe=bt+ +t.goal/Ft*At;q+='<line x1="'+a(Pe)+'" x2="'+a(Pe)+'" y1="'+a(yt-2)+'" y2="'+a(Y+nt+2)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="3 3"/>'}return q}function ar($,st,vt,Tt,Rt){var Pt='<rect x="'+a(st)+'" y="'+a(vt)+'" width="'+a(Tt)+'" height="'+G+'" rx="'+G/2+'" fill="'+e.grid+'" fill-opacity=".6"/>',jt=0;return r.forEach(function(oe,Dt){var te=$<oe.length?oe[$]:0,$t=Math.max(0,te)/Rt*Tt;if(!($t<=0)){var Wt=jt>0?1.5:0;Pt+='<rect x="'+a(st+jt+Wt)+'" y="'+a(vt)+'" width="'+a(Math.max(2,$t-Wt))+'" height="'+G+'" rx="'+a(Math.min(3,$t/2))+'" fill="'+y(Dt,$)+'"'+ut(t,"bzc-gx",$*.06+Dt*.03)+"/>",jt+=$t}}),Pt}var De=i.length?Math.max.apply(null,i.map(function($){return Et($,10,!0)})):0,Te=i.length?Math.max(1,Math.ceil(o*(De+8)/R)):1,ne=K(t.angleLabels)&&Te>1,$e=Je*Math.PI/180,Ue=function($){return ne?Zt($,je):$};if(ne){var nr=R/o,Jt=0;i.forEach(function($,st){Jt=Math.max(Jt,Math.cos($e)*Et(Ue($),10,!0)+4-(st+.5)*nr)}),Jt=Math.min(Jt,R*.25),S+=Jt,R-=Jt,Te=1}var Ye=K(t.showValues)&&St<0?14:0,ir=ne?Math.ceil(Math.sin($e)*Math.min(De,Et("x".repeat(je),10,!0)))+18:20,lr=(i.length?ir:2)+Ye,Ie=K(t.showValues)?16:4,Ce=nt-(yt-Y)-lr-Ie,Xe=yt+Ie,Gt=function($){return Xe+Ce-($-St)/(Z-St)*Ce},ie=R/o,le=Math.min(ie*(j?.78:.62),j?s*30:56),_e=j?Math.min(3,le/s*.15):0,_t=p?le:(le-_e*(s-1))/s,ce=Gt(0);q+='<line x1="'+S+'" x2="'+(S+R)+'" y1="'+a(ce)+'" y2="'+a(ce)+'" stroke="'+e.grid+'"/>';for(var Ot=0;Ot<o;Ot++){var Fe=S+Ot*ie+(ie-le)/2;if(p?q+=or(Ot,Fe):r.forEach(function($,st){if(!(Ot>=$.length)){var vt=$[Ot],Tt=Fe+st*(_t+_e),Rt=Math.min(Gt(vt),ce),Pt=Math.abs(Gt(vt)-ce);Pt>.5&&(q+='<rect x="'+a(Tt)+'" y="'+a(Rt)+'" width="'+a(_t)+'" height="'+a(Pt)+'" rx="'+a(Math.min(6,_t/2,Pt/2))+'" fill="'+y(st,Ot)+'" fill-opacity="'+F(vt)+'"'+ut(t,vt<0?"bzc-gn":"bzc-g",Ot*.05+st*.03)+"/>"),K(t.showValues)&&(q+=O(Tt+_t/2,vt<0?Gt(vt)+12:Gt(vt)-5,h(vt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+xt+'" font-size="'+(f?9:10)+'" font-weight="600"'))}}),i[Ot]!=null&&Ot%Te===0){var Ne=Fe+le/2,Ve=Xe+Ce+Ye+(ne?12:15);q+=ne?O(Ne,Ve,Ue(i[Ot]),H(e,10,'text-anchor="end" transform="rotate(-'+Je+" "+a(Ne)+" "+a(Ve)+')"')):O(Ne,Ve,i[Ot],H(e,10,'text-anchor="middle"'))}q+=Lt(S+Ot*ie,yt,ie,nt-(yt-Y),_(Ot))}return A(t.goal)&&(q+=It(t,e,S,S+R,Gt(+t.goal))),q;function or($,st){var vt="",Tt=0,Rt=0;if(r.forEach(function(jt,oe){var Dt=$<jt.length?jt[$]:0;if(Dt){var te=Dt>0?Tt:Rt,$t=te+Dt;Dt>0?Tt=$t:Rt=$t;var Wt=Gt(Math.max(te,$t)),Be=Gt(Math.min(te,$t)),se=Be-Wt,We=te!==0?Math.min(1.5,se/2):0;Dt>0?Be-=We:Wt+=We,se=Be-Wt,se>.5&&(vt+='<rect x="'+a(st)+'" y="'+a(Wt)+'" width="'+a(_t)+'" height="'+a(se)+'" rx="'+a(Math.min(3,_t/2,se/2))+'" fill="'+y(oe,$)+'"'+ut(t,Dt<0?"bzc-gn":"bzc-g",$*.05+oe*.03)+"/>")}}),K(t.showValues)){var Pt=B[$];vt+=O(st+_t/2,Pt<0?Gt(L[$])+12:Gt(N[$])-5,h(Pt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+xt+'" font-size="10" font-weight="600"')}return vt}},{stat:kt(c,t,""),summary:o?p?s+" series stacked across "+o+" groups":f?s+" series across "+o+" groups":"highest "+(i[ot]||"")+" "+h(c[ot],t):"no data"})}we.table=function(t){return ae(t,zt(t.values).length>1&&K(t.stacked))};dt("bars",we);gt("bars");function wr(t,e){var r=Math.min(t.length,e.length);if(r<2)return null;var l=0,i=0,n;for(n=0;n<r;n++)l+=t[n],i+=e[n];l/=r,i/=r;var s=0,o=0,f=0;for(n=0;n<r;n++)s+=(t[n]-l)*(t[n]-l),o+=(e[n]-i)*(e[n]-i),f+=(t[n]-l)*(e[n]-i);if(!s)return null;var u=f/s;return{slope:u,intercept:i-u*l,r:o?f/Math.sqrt(s*o):0}}function Se(t,e){for(var r=zt(t.x),l=zt(t.y),i=U(t.series),n=U(t.labels),s=ht(t,e),o=[],f=0;f<Math.max(r.length,l.length);f++){var u=r[f]||[],p=l[f]||[],m=Math.min(u.length,p.length);o.push({xs:u.slice(0,m),ys:p.slice(0,m)})}o=o.filter(function(b){return b.xs.length});var c=o.reduce(function(b,v){return b+v.xs.length},0),T=W(t.height,210),w=o.length>1||i.length>0,B=K(t.trend),N=function(b){return i[b]||"Group "+(b+1)},L={decimals:t.decimals,compact:t.compact,lang:t.lang},z=Yt(t,n),g=Vt(t.markers,ee,"circle"),V=t.background||e.tile,k=function(b){var v=g?g(b):"circle";return v==="none"?"circle":v},d=g&&function(b,v,x){return re(k(b),v+4,x+6,4,' fill="'+s[b%s.length]+'"')};return pt(t,e,T,function(b,v,x,C){if(!c)return mt(e,b,v,x,C);var y="",M=v;if(w){var F=Qt(o.map(function(E,D){return N(D)}),s,e,b,M,x,d);y+=F.svg,M+=F.height}var P=[].concat.apply([],o.map(function(E){return E.xs})),_=[].concat.apply([],o.map(function(E){return E.ys})),I=Math.min.apply(null,_),J=Math.max.apply(null,_);A(t.goal)&&(I=Math.min(I,+t.goal),J=Math.max(J,+t.goal)),K(t.zero)&&(I=Math.min(0,I),J=Math.max(0,J));var tt=fe(I,J,4),j=fe(Math.min.apply(null,P),Math.max.apply(null,P),5),G=tt.ticks.map(function(E){return h(E,t,!0)}),et=Qe(G)+(A(t.yLabel)?14:0),lt=20+(A(t.xLabel)?16:0),at=b+et,ot=x-et,S=C-(M-v)-lt,Y=function(E){return at+6+(E-j.lo)/(j.hi-j.lo)*(ot-12)},R=function(E){return M+6+S-6-(E-tt.lo)/(tt.hi-tt.lo)*(S-6)};tt.ticks.forEach(function(E,D){var X=R(E);y+='<line x1="'+a(at)+'" x2="'+a(at+ot)+'" y1="'+a(X)+'" y2="'+a(X)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+O(at-8,X+3.5,G[D],H(e,10,'text-anchor="end"'))});var nt=Math.max(1,Math.ceil(j.ticks.length*44/ot));if(j.ticks.forEach(function(E,D){if(!(D%nt)){var X=Y(E);y+='<line x1="'+a(X)+'" x2="'+a(X)+'" y1="'+a(M)+'" y2="'+a(M+S)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+O(X,M+S+15,h(E,L,!0),H(e,10,'text-anchor="middle"'))}}),A(t.xLabel)&&(y+=O(at+ot/2,M+S+32,t.xLabel,H(e,10,'text-anchor="middle" font-weight="600"'))),A(t.yLabel)){var q=M+S/2;y+='<text x="'+a(b+4)+'" y="'+a(q)+'" transform="rotate(-90 '+a(b+4)+" "+a(q)+')" text-anchor="middle" '+H(e,10,'font-weight="600"')+' dominant-baseline="hanging">'+String(t.yLabel).replace(/[&<>"]/g,function(E){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[E]})+"</text>"}A(t.goal)&&(y+=It(t,e,at,at+ot,R(+t.goal))),B&&o.forEach(function(E,D){var X=wr(E.xs,E.ys);if(X){var bt=Math.min.apply(null,E.xs),At=Math.max.apply(null,E.xs),Ft=X.slope*bt+X.intercept,it=X.slope*At+X.intercept,Bt=s[D%s.length];y+='<line x1="'+a(Y(bt))+'" y1="'+a(Q(R(Ft),M,M+S))+'" x2="'+a(Y(At))+'" y2="'+a(Q(R(it),M,M+S))+'" stroke="'+Bt+'" stroke-width="2" stroke-dasharray="6 4" stroke-linecap="round" stroke-opacity=".9"/>',y+=O(Math.min(Y(At),at+ot)-2,Q(R(it),M+10,M+S)-7,"r = "+X.r.toFixed(2),H(e,10,'text-anchor="end" font-weight="600"',Bt))}});var yt=0,St=c>150?3:4.5;o.forEach(function(E,D){var X=s[D%s.length];E.xs.forEach(function(bt,At){var Ft=Y(bt),it=R(E.ys[At]),Bt=(n[yt]?n[yt]+`
8
+ `:w?N(D)+`
9
+ `:"")+(A(t.xLabel)?t.xLabel:"x")+": "+h(bt,L)+`
10
+ `+(A(t.yLabel)?t.yLabel:"y")+": "+h(E.ys[At],t);y+=re(k(D),Ft,it,St,' fill="'+X+'" fill-opacity=".85" stroke="'+V+'" stroke-width="1.5"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Math.min(.8,yt*.012))+'s"':"")),y+=Lt(Ft-8,it-8,16,16,Bt),yt++})});var Z=[];return o.forEach(function(E){E.xs.forEach(function(D,X){Z.push([Y(D),R(E.ys[X])])})}),z.forEach(function(E){var D=Z[E.i];D&&(y+='<circle cx="'+a(D[0])+'" cy="'+a(D[1])+'" r="'+(St+4)+'" fill="none" stroke="'+e.fg+'" stroke-width="1.5"/>'+O(Q(D[0],at+30,at+ot-30),D[1]-St-9,E.text,H(e,10,'text-anchor="middle"',e.fg)))}),y},{summary:c+" points"+(w?" in "+o.length+" groups":"")})}Se.table=function(t){var e=zt(t.x),r=zt(t.y),l=U(t.series),i=U(t.labels),n=e.length>1||l.length>0,s={decimals:t.decimals,compact:t.compact,lang:t.lang},o=[],f=0;return e.forEach(function(u,p){for(var m=r[p]||[],c=0;c<Math.min(u.length,m.length);c++,f++)o.push([i[f]||"#"+(f+1)].concat(n?[l[p]||"Group "+(p+1)]:[],[h(u[c],s),h(m[c],t)]))}),{head:["Point"].concat(n?["Group"]:[],[A(t.xLabel)?t.xLabel:"x",A(t.yLabel)?t.yLabel:"y"]),rows:o}};dt("scatter",Se);gt("scatter");function ze(t,e){var r=rt(t.values),l=U(t.labels),i=ht(t,e),n=W(t.max,100)||100,s=W(t.height,140),o=!A(t.prefix)&&!A(t.suffix)&&n===100,f=function(p){return h(p,t)+(o?"%":"")},u=kt(r,t,"");return pt(t,e,s,function(p,m,c,T){if(!r.length)return mt(e,p,m,c,T);var w="",B=r.length===1,N=Math.min(T,B?c:c*.55),L=B?p+c/2:p+N/2,z=m+T/2,g=B?N*.12:Q(N*.42/(r.length*1.35),5,16),V=g*.38;if(r.forEach(function(v,x){var C=N/2-g/2-x*(g+V);if(!(C<=g/2)){var y=Q(v/n*100,0,100),M=i[x%i.length];w+='<circle cx="'+a(L)+'" cy="'+a(z)+'" r="'+a(C)+'" fill="none" stroke="'+M+'" stroke-opacity=".16" stroke-width="'+a(g)+'"/>',y>0&&(w+='<circle cx="'+a(L)+'" cy="'+a(z)+'" r="'+a(C)+'" fill="none" stroke="'+M+'" stroke-width="'+a(g)+'" stroke-linecap="round" pathLength="100" transform="rotate(-90 '+a(L)+" "+a(z)+')" style="stroke-dasharray:'+a(y)+" 100"+(t.animate?";animation-delay:"+x*.12+"s":"")+'"'+(t.animate?' class="bzc-s"':"")+"/>"),w+='<circle cx="'+a(L)+'" cy="'+a(z)+'" r="'+a(C+g/2)+'" fill="#000" fill-opacity="0" class="bzc-hit" data-tip="'+ct((l[x]||"#"+(x+1))+": "+f(v)+(o?"":" of "+h(n,t)))+'"/>'}}),B)w+=O(L,z+N*.08,f(r[0]),'text-anchor="middle" fill="'+e.fg+'" font-family="'+ft+'" font-size="'+a(N*.22)+'" font-weight="800"'),l[0]&&(w+=O(L,z+N*.08+16,l[0],H(e,10,'text-anchor="middle"')));else{var k=p+N+22,d=Math.min(26,T/r.length),b=z-d*r.length/2;r.forEach(function(v,x){var C=b+x*d+d/2;w+='<circle cx="'+a(k+4)+'" cy="'+a(C)+'" r="4" fill="'+i[x%i.length]+'"/>'+O(k+14,C+4,Zt(l[x]||"#"+(x+1),Math.floor((p+c-k-60)/6.7)),'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')+O(p+c,C+4,f(v),'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="11" font-weight="600"')})}return w},{stat:u,summary:r.map(function(p,m){return(l[m]?l[m]+" ":"")+f(p)}).join(", ")})}ze.table=function(t){var e=U(t.labels),r=W(t.max,100)||100,l=!A(t.prefix)&&!A(t.suffix)&&r===100;return{head:["Label","Value"],rows:rt(t.values).map(function(i,n){return[e[n]||"#"+(n+1),h(i,t)+(l?"%":" of "+h(r,t))]})}};dt("ring",ze);gt("ring");function Ee(t,e){var r=rt(t.values).map(function(c){return Math.max(0,c)}),l=U(t.labels),i=ht(t,e),n=r.slice(),s=l.slice();if(n.length>6){var o=n.map(function(c,T){return T}).sort(function(c,T){return r[T]-r[c]}),f=o.slice(0,5).sort(function(c,T){return c-T});n=f.map(function(c){return r[c]}),s=f.map(function(c){return l[c]||"#"+(c+1)}),n.push(Nt(o.slice(5).map(function(c){return r[c]}))),s.push("Other")}var u=Nt(n),p=W(t.height,150),m=kt(n,t,"");return pt(t,e,p,function(c,T,w,B){if(!u)return mt(e,c,T,w,B);var N="",L=Math.min(B,w*.5),z=c+L/2,g=T+B/2,V=L*.16,k=(L-V)/2,d=0,b=n.filter(Boolean).length>1?.9:0;n.forEach(function(y,M){var F=y/u*100;if(!(F<=0)){var P=Math.max(.01,F-b);N+='<circle cx="'+a(z)+'" cy="'+a(g)+'" r="'+a(k)+'" fill="none" stroke="'+i[M%i.length]+'" stroke-width="'+a(V)+'" pathLength="100" stroke-dasharray="'+a(P)+" "+a(100-P)+'" stroke-dashoffset="'+a(-d)+'" transform="rotate(-90 '+a(z)+" "+a(g)+')"'+ut(t,"bzc-a",M*.08)+"/>",d+=F}}),N+=O(z,g+2,h(u,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+ft+'" font-size="'+a(L*.17)+'" font-weight="800"'),N+=O(z,g+2+14,(A(t.centerLabel)?t.centerLabel:"Total").toUpperCase(),H(e,9,'text-anchor="middle" letter-spacing="1"'));var v=c+L+22,x=Math.min(24,B/n.length),C=g-x*n.length/2;return n.forEach(function(y,M){var F=C+M*x+x/2,P=Math.round(y/u*100),_=(s[M]||"#"+(M+1))+": "+h(y,t)+" ("+P+"%)";N+='<circle cx="'+a(v+4)+'" cy="'+a(F)+'" r="4" fill="'+i[M%i.length]+'"/>'+O(v+14,F+4,Zt(s[M]||"#"+(M+1),Math.floor((c+w-v-50)/6.7)),'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')+O(c+w,F+4,P+"%",'text-anchor="end" fill="'+e.muted+'" font-family="'+xt+'" font-size="11" font-weight="600"')+Lt(v,F-x/2,c+w-v,x,_)}),d=0,n.forEach(function(y,M){var F=y/u*100;F<=0||(N+='<circle cx="'+a(z)+'" cy="'+a(g)+'" r="'+a(k)+'" fill="none" stroke="#000" stroke-opacity="0" stroke-width="'+a(V)+'" pathLength="100" stroke-dasharray="'+a(F)+" "+a(100-F)+'" stroke-dashoffset="'+a(-d)+'" transform="rotate(-90 '+a(z)+" "+a(g)+')" class="bzc-hit" data-skip="" data-tip="'+ct((s[M]||"#"+(M+1))+": "+h(y,t)+" ("+Math.round(F)+"%)")+'"/>',d+=F)}),N},{stat:m,summary:"total "+h(u,t)+" across "+n.length+" parts"})}Ee.table=function(t){var e=rt(t.values).map(function(i){return Math.max(0,i)}),r=U(t.labels),l=Nt(e);return{head:["Label","Value","Share"],rows:e.map(function(i,n){return[r[n]||"#"+(n+1),h(i,t),(l?Math.round(i/l*100):0)+"%"]})}};dt("donut",Ee);gt("donut");function Le(t,e){var r=rt(t.values),l=r.length?r[0]:W(t.value,NaN),i=U(t.labels),n=W(t.min,0),s=W(t.max,100),o=W(t.height,130);s===n&&(s=n+1);var f=rt(t.zones),u=ht(t,e),p=U(t.color).filter(Boolean).length>1?u:[e.up,e.palette[3],e.down],m=u[0];if(f.length&&isFinite(l)){for(var c=0;c<f.length&&l>=f[c];)c++;m=p[Math.min(c,p.length-1)]}var T=!A(t.prefix)&&!A(t.suffix)&&n===0&&s===100,w=function(B){return h(B,t)+(T?"%":"")};return pt(t,e,o,function(B,N,L,z){if(!isFinite(l))return mt(e,B,N,L,z);var g=Math.min(L/2,z-22),V=g*.16,k=g-V/2,d=B+L/2,b=N+g,v=Q((l-n)/(s-n),0,1),x=function(I,J){var tt=Math.PI*(1-I);return[d+J*Math.cos(tt),b-J*Math.sin(tt)]},C="M"+a(d-k)+","+a(b)+"A"+a(k)+","+a(k)+" 0 0 1 "+a(d+k)+","+a(b),y='<path d="'+C+'" fill="none" stroke="'+m+'" stroke-opacity=".16" stroke-width="'+a(V)+'" stroke-linecap="round"/>';f.length&&f.forEach(function(I){var J=Q((I-n)/(s-n),0,1),tt=x(J,k-V/2-3),j=x(J,k-V/2-8);y+='<line x1="'+a(tt[0])+'" y1="'+a(tt[1])+'" x2="'+a(j[0])+'" y2="'+a(j[1])+'" stroke="'+e.muted+'" stroke-width="1.5"/>'}),v>0&&(y+='<path d="'+C+'" fill="none" stroke="'+m+'" stroke-width="'+a(V)+'" stroke-linecap="round" pathLength="100" style="stroke-dasharray:'+a(v*100)+' 100"'+ut(t,"bzc-s")+"/>");var M=x(v,k);if(y+='<circle cx="'+a(M[0])+'" cy="'+a(M[1])+'" r="'+a(V*.26)+'" fill="'+(t.background||e.tile)+'"'+ut(t,"bzc-a",.9)+"/>",A(t.goal)){var F=Q((+t.goal-n)/(s-n),0,1),P=x(F,k+V/2+4),_=x(F,k-V/2-4);y+='<line x1="'+a(P[0])+'" y1="'+a(P[1])+'" x2="'+a(_[0])+'" y2="'+a(_[1])+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return y+=O(d,b-g*.12,w(l),'text-anchor="middle" fill="'+e.fg+'" font-family="'+ft+'" font-size="'+a(g*.34)+'" font-weight="800"'),i[0]&&(y+=O(d,b-g*.12+16,i[0],H(e,10,'text-anchor="middle"'))),y+=O(d-k,b+18,h(n,t,!0),H(e,10,'text-anchor="middle"'))+O(d+k,b+18,h(s,t,!0),H(e,10,'text-anchor="middle"')),y+=Lt(d-g,b-g,g*2,g,(i[0]?i[0]+": ":"")+w(l)+" (range "+h(n,t)+" to "+h(s,t)+")"+(A(t.goal)?`
11
+ Goal: `+h(+t.goal,t):"")),y},{summary:isFinite(l)?w(l)+" on a scale of "+h(n,t)+" to "+h(s,t):"no data"})}Le.table=function(t){var e=rt(t.values),r=e.length?e[0]:W(t.value,NaN),l=U(t.labels),i=W(t.min,0),n=W(t.max,100),s=!A(t.prefix)&&!A(t.suffix)&&i===0&&n===100;return isFinite(r)?{head:["Label","Value"],rows:[[l[0]||"Reading",h(r,t)+(s?"%":"")],["Lowest",h(i,t)],["Highest",h(n,t)]].concat(A(t.goal)?[["Goal",h(+t.goal,t)]]:[])}:{head:["Label","Value"],rows:[]}};dt("gauge",Le);gt("gauge");function Ae(t,e){var r=rt(t.values).map(function(L){return Math.max(0,L)}),l=U(t.labels),i=ht(t,e),n=r.length===1,s=Nt(r),o=A(t.max)?W(t.max,100):n?100:s;o>0||(o=1);var f=!A(t.prefix)&&!A(t.suffix)&&o===100&&n,u=function(L){return h(L,t)+(f?"%":"")},p=qt(t),m=p.w,c=0,T=[];if(!n&&r.length){var w=0;c=1,r.forEach(function(L,z){var g=l[z]||"#"+(z+1),V=14+Et(g,12)+6+Et(h(L,t),11,!0)+18;w>0&&w+V>m&&(w=0,c++),T.push({x:w,row:c-1,l:g}),w+=V})}var B=36+(c?12+c*20:0),N=kt(r,t,"");return pt(t,e,B,function(L,z,g,V){if(!r.length)return mt(e,L,z,g,V);var k="",d=z+22,b=Ht("c"),v=n?u(r[0])+(f?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t);n&&l[0]&&(k+=O(L,z+11,l[0],'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')),k+=O(L+g,z+11,v,'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="11" font-weight="600"'),k+='<rect x="'+L+'" y="'+d+'" width="'+g+'" height="14" rx="7" fill="'+e.grid+'" fill-opacity=".7"/>',k+='<clipPath id="'+b+'"><rect x="'+L+'" y="'+d+'" width="'+g+'" height="14" rx="7"/></clipPath><g clip-path="url(#'+b+')"><g'+ut(t,"bzc-gx")+">";var x=0;if(r.forEach(function(y,M){var F=Math.min(y,Math.max(0,o-x))/o*g;F>0&&(k+='<rect x="'+a(L+x/o*g)+'" y="'+d+'" width="'+a(F)+'" height="14" fill="'+i[M%i.length]+'"/>'),M>0&&F>0&&(k+='<rect x="'+a(L+x/o*g-1)+'" y="'+d+'" width="2" height="14" fill="'+(t.background||e.tile)+'"/>'),x+=y}),k+="</g></g>",A(t.goal)){var C=L+Q(+t.goal/o,0,1)*g;k+='<line x1="'+a(C)+'" x2="'+a(C)+'" y1="'+(d-4)+'" y2="'+(d+18)+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return x=0,r.forEach(function(y,M){var F=Math.min(y,Math.max(0,o-x))/o*g;F>0&&(k+=Lt(L+x/o*g,d-4,F,22,(l[M]||(n?"Progress":"#"+(M+1)))+": "+u(y)+(n?"":" ("+Math.round(y/o*100)+"%)"))),x+=y}),T.forEach(function(y,M){var F=L+y.x,P=d+14+12+y.row*20+8;k+='<circle cx="'+a(F+4)+'" cy="'+a(P)+'" r="4" fill="'+i[M%i.length]+'"/><text x="'+a(F+14)+'" y="'+a(P+4)+'" fill="'+e.fg+'" font-family="'+ft+'" font-size="12">'+ct(y.l)+'<tspan dx="6" fill="'+e.muted+'" font-family="'+xt+'" font-size="11">'+ct(h(r[M],t))+"</tspan></text>"}),k},{stat:N,summary:n?u(r[0])+(f?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t)})}Ae.table=function(t){var e=rt(t.values).map(function(s){return Math.max(0,s)}),r=U(t.labels),l=e.length===1,i=A(t.max)?W(t.max,100):l?100:Nt(e);i>0||(i=1);var n=!A(t.prefix)&&!A(t.suffix)&&i===100&&l;return l?{head:["Label","Value"],rows:[[r[0]||"Progress",h(e[0],t)+(n?"%":" of "+h(i,t))]]}:{head:["Label","Value","Share"],rows:e.map(function(s,o){return[r[o]||"#"+(o+1),h(s,t),Math.round(s/i*100)+"%"]})}};dt("progress",Ae);gt("progress");var tr={weekday:"short",day:"numeric",month:"short",year:"numeric"};function er(t,e){if(A(t.start)&&/^\d{4}-\d{2}-\d{2}$/.test(String(t.start)))return new Date(String(t.start)+"T00:00:00Z");var r=new Date;return new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Math.max(0,e-1)*864e5)}function rr(t,e){try{return new Intl.DateTimeFormat(t,Object.assign({timeZone:"UTC"},e))}catch{return new Intl.DateTimeFormat("en-GB",Object.assign({timeZone:"UTC"},e))}}function Oe(t,e){var r=rt(t.values),l=ht(t,e)[0],i=t.lang||"en-GB",n=er(t,r.length),s=(n.getUTCDay()+6)%7,o=Math.max(1,Math.ceil((s+r.length)/7)),f=qt(t),u=28,p=Math.max(1,Math.floor((f.w-u)/10));if(o>p){var m=(o-p)*7-s;r=r.slice(m),n=new Date(n.getTime()+m*864e5),s=0,o=p}var c=Math.min(18,(f.w-u)/o),T=c<8?1:3,w=c-T,B=16+7*c+26,N=r.length?Math.max.apply(null,r):0,L=function(d){return rr(i,d)},z=L({month:"short"}),g=L({weekday:"short"}),V=L(tr),k=kt(r,t,"");return pt(t,e,B,function(d,b,v,x){if(!r.length)return mt(e,d,b,v,x);var C="",y=d+u,M=b+16,F=-99,P=[.28,.5,.75,1];c>=9&&[0,2,4].forEach(function(q){var yt=new Date(Date.UTC(2024,0,1+q));C+=O(d,M+q*c+w/2+3.5,g.format(yt),H(e,9))});for(var _=0;_<r.length;_++){var I=s+_,J=Math.floor(I/7),tt=I%7,j=new Date(n.getTime()+_*864e5),G=y+J*c,et=M+tt*c;(j.getUTCDate()===1||_===0)&&G-F>30&&(C+=O(G,b+9,z.format(j),H(e,9)),F=G);var lt=r[_]<=0||!N?0:Math.ceil(r[_]/N*4),at=lt?l:e.grid,ot=lt?P[lt-1]:.7;C+='<rect x="'+a(G)+'" y="'+a(et)+'" width="'+a(w)+'" height="'+a(w)+'" rx="'+a(w*.24)+'" fill="'+at+'" fill-opacity="'+ot+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(J*.012)+'s"':"")+' data-tip="'+ct(V.format(j)+": "+h(r[_],t))+'"/>'}var S=M+7*c+14,Y=10,R=d+v-5*(Y+3)-30;C+=O(d,S+8,h(Nt(r),t,!0)+" in "+r.length+" days",H(e,10)),C+=O(R-6,S+8,"Less",H(e,9,'text-anchor="end"'));for(var nt=0;nt<5;nt++)C+='<rect x="'+a(R+nt*(Y+3))+'" y="'+S+'" width="'+Y+'" height="'+Y+'" rx="2.5" fill="'+(nt?l:e.grid)+'" fill-opacity="'+(nt?P[nt-1]:.7)+'"/>';return C+=O(R+5*(Y+3)+3,S+8,"More",H(e,9)),C},{stat:k,summary:h(Nt(r),t)+" across "+r.length+" days"})}Oe.table=function(t){var e=rt(t.values),r=er(t,e.length),l=rr(t.lang||"en-GB",tr);return{head:["Date","Value"],rows:e.map(function(i,n){return[l.format(new Date(r.getTime()+n*864e5)),h(i,t)]})}};dt("heatmap",Oe);gt("heatmap");var Sr="1.4.0",zr=he.slice();return mr(Er);})();