/* esm.sh - chart.js@4.5.1/dist/chunks/helpers.dataset */ import{Color as pe}from"/public/js/@kurkle/color@^0.3.0?target=denonext";function Xt(){}var Zt=(()=>{let e=0;return()=>e++})();function v(e){return e==null}function M(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function _(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function be(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Vt(e,t){return be(e)?e:t}function T(e,t){return typeof e>"u"?t:e}var en=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Le=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function tn(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function nn(e,t,n,o){let r,i,s;if(M(e))if(i=e.length,o)for(r=i-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;re,x:e=>e.x,y:e=>e.y};function Fe(e){let t=e.split("."),n=[],o="";for(let r of t)o+=r,o.endsWith("\\")?o=o.slice(0,-1)+".":(n.push(o),o="");return n}function ze(e){let t=Fe(e);return n=>{for(let o of t){if(o==="")break;n=n&&n[o]}return n}}function _e(e,t){return(ne[t]||(ne[t]=ze(t)))(e)}function Me(e){return e.charAt(0).toUpperCase()+e.slice(1)}var sn=e=>typeof e<"u",z=e=>typeof e=="function",an=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function cn(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var y=Math.PI,S=2*y,He=S+y,H=Number.POSITIVE_INFINITY,qe=y/180,O=y/2,x=y/4,oe=y*2/3,Y=Math.log10,re=Math.sign;function Se(e,t,n){return Math.abs(e-t)r-i).pop(),t}function Ke(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function fn(e){return!Ke(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function dn(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function hn(e,t,n){let o,r,i;for(o=0,r=e.length;oc&&l=Math.min(t,n)-o&&e<=Math.max(t,n)+o}function Oe(e,t,n){n=n||(s=>e[s]1;)i=r+o>>1,n(i)?r=i:o=i;return{lo:r,hi:o}}var D=(e,t,n,o)=>Oe(e,n,o?r=>{let i=e[r][t];return ie[r][t]Oe(e,n,o=>e[o][t]>=n);function Mn(e,t,n){let o=0,r=e.length;for(;oo&&e[r-1]>n;)r--;return o>0||r{let o="_onData"+Me(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){let s=r.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[o]=="function"&&a[o](...i)}),s}})})}function On(e,t){let n=e._chartjs;if(!n)return;let o=n.listeners,r=o.indexOf(t);r!==-1&&o.splice(r,1),!(o.length>0)&&(we.forEach(i=>{delete e[i]}),delete e._chartjs)}function wn(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function Pn(e,t,n){return t+" "+e+"px "+n}var Ue=(function(){return typeof globalThis>"u"?function(e){return e()}:globalThis.requestAnimationFrame})();function xn(e,t){let n=[],o=!1;return function(...r){n=r,o||(o=!0,Ue.call(globalThis,()=>{o=!1,e.apply(t,n)}))}}function Tn(e,t){let n;return function(...o){return t?(clearTimeout(n),n=setTimeout(e,t,o)):e.apply(this,o),t}}var Cn=e=>e==="start"?"left":e==="end"?"right":"center",kn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,In=(e,t,n,o)=>e===(o?"left":"right")?n:e==="center"?(t+n)/2:t;function Rn(e,t,n){let o=t.length,r=0,i=o;if(e._sorted){let{iScale:s,vScale:a,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=s.axis,{min:d,max:g,minDefined:m,maxDefined:p}=s.getUserBounds();if(m){if(r=Math.min(D(c,u,d).lo,n?o:D(t,u,s.getPixelForValue(d)).lo),l){let h=c.slice(0,r+1).reverse().findIndex(f=>!v(f[a.axis]));r-=Math.max(0,h)}r=J(r,0,o-1)}if(p){let h=Math.max(D(c,s.axis,g,!0).hi+1,n?0:D(t,u,s.getPixelForValue(g),!0).hi+1);if(l){let f=c.slice(h-1).findIndex(b=>!v(b[a.axis]));h+=Math.max(0,f)}i=J(h,r,o)-r}else i=o-r}return{start:r,count:i}}function vn(e){let{xScale:t,yScale:n,_scaleRanges:o}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!o)return e._scaleRanges=r,!0;let i=o.xmin!==t.min||o.xmax!==t.max||o.ymin!==n.min||o.ymax!==n.max;return Object.assign(o,r),i}var L=e=>e===0||e===1,se=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*S/n)),ae=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*S/n)+1,Q={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*O)+1,easeOutSine:e=>Math.sin(e*O),easeInOutSine:e=>-.5*(Math.cos(y*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>L(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>L(e)?e:se(e,.075,.3),easeOutElastic:e=>L(e)?e:ae(e,.075,.3),easeInOutElastic(e){return L(e)?e:e<.5?.5*se(e*2,.1125,.45):.5+.5*ae(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Q.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Q.easeInBounce(e*2)*.5:Q.easeOutBounce(e*2-1)*.5+.5};function Z(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function An(e){return Z(e)?e:new pe(e)}function $(e){return Z(e)?e:new pe(e).saturate(.5).darken(.1).hexString()}var Ye=["x","y","borderWidth","radius","tension"],Je=["color","borderColor","backgroundColor"];function Xe(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Je},numbers:{type:"number",properties:Ye}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ze(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var ce=new Map;function Ve(e,t){t=t||{};let n=e+JSON.stringify(t),o=ce.get(n);return o||(o=new Intl.NumberFormat(e,t),ce.set(n,o)),o}function et(e,t,n){return Ve(t,n).format(e)}var Pe={values(e){return M(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let o=this.chart.options.locale,r,i=e;if(n.length>1){let l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(r="scientific"),i=tt(e,n)}let s=Y(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),et(e,o,c)},logarithmic(e,t,n){if(e===0)return"0";let o=n[t].significand||e/Math.pow(10,Math.floor(Y(e)));return[1,2,3,5,10,15].includes(o)||t>.8*n.length?Pe.numeric.call(this,e,t,n):""}};function tt(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var nt={formatters:Pe};function ot(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:nt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}var rt=Object.create(null),it=Object.create(null);function j(e,t){if(!t)return e;let n=t.split(".");for(let o=0,r=n.length;oo.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(o,r)=>$(r.backgroundColor),this.hoverBorderColor=(o,r)=>$(r.borderColor),this.hoverColor=(o,r)=>$(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return U(this,t,n)}get(t){return j(this,t)}describe(t,n){return U(it,t,n)}override(t,n){return U(rt,t,n)}route(t,n,o,r){let i=j(this,t),s=j(this,o),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){let c=this[a],l=s[r];return _(c)?Object.assign({},l,c):T(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(n=>n(this))}},st=new X({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xe,Ze,ot]);function at(e){return!e||v(e.size)||v(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function le(e,t,n,o,r){let i=t[r];return i||(i=t[r]=e.measureText(r).width,n.push(r)),i>o&&(o=i),o}function Bn(e,t,n,o){o=o||{};let r=o.data=o.data||{},i=o.garbageCollect=o.garbageCollect||[];o.font!==t&&(r=o.data={},i=o.garbageCollect=[],o.font=t),e.save(),e.font=t;let s=0,a=n.length,c,l,u,d,g;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function ue(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&i.strokeColor!=="",c,l;for(e.save(),e.font=r.string,lt(e,i),c=0;c+e||0;function xe(e,t){let n={},o=_(t),r=o?Object.keys(t):t,i=_(e)?o?s=>T(e[s],e[t[s]]):s=>e[s]:()=>e;for(let s of r)n[s]=mt(i(s));return n}function pt(e){return xe(e,{top:"y",right:"x",bottom:"y",left:"x"})}function qn(e){return xe(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Kn(e){let t=pt(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Gn(e,t){e=e||{},t=t||st.font;let n=T(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let o=T(e.style,t.style);o&&!(""+o).match(ht)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);let r={family:T(e.family,t.family),lineHeight:gt(T(e.lineHeight,t.lineHeight),n),size:n,style:o,weight:T(e.weight,t.weight),string:""};return r.string=at(r),r}function Qn(e,t,n,o){let r=!0,i,s,a;for(i=0,s=e.length;in&&a===0?0:a+c;return{min:s(o,-Math.abs(i)),max:s(r,i)}}function bt(e,t){return Object.assign(Object.create(e),t)}function Te(e,t=[""],n,o,r=()=>e[0]){let i=n||e;typeof o>"u"&&(o=Ie("_fallback",e));let s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:o,_getTarget:r,override:a=>Te([a,...e],t,i,o)};return new Proxy(s,{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return Ce(a,c,()=>Tt(c,t,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return de(a).includes(c)},ownKeys(a){return de(a)},set(a,c,l){let u=a._storage||(a._storage=r());return a[c]=u[c]=l,delete a._keys,!0}})}function q(e,t,n,o){let r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:yt(e,o),setContext:i=>q(e,i,n,o),override:i=>q(e.override(i),t,n,o)};return new Proxy(r,{deleteProperty(i,s){return delete i[s],delete e[s],!0},get(i,s,a){return Ce(i,s,()=>Mt(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(i,s,a){return e[s]=a,delete i[s],!0}})}function yt(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:o=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:o,isScriptable:z(n)?n:()=>n,isIndexable:z(o)?o:()=>o}}var _t=(e,t)=>e?e+Me(t):t,V=(e,t)=>_(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ce(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let o=n();return e[t]=o,o}function Mt(e,t,n){let{_proxy:o,_context:r,_subProxy:i,_descriptors:s}=e,a=o[t];return z(a)&&s.isScriptable(t)&&(a=St(t,a,e,n)),M(a)&&a.length&&(a=Ot(t,a,e,s.isIndexable)),V(t,a)&&(a=q(a,r,i&&i[t],s)),a}function St(e,t,n,o){let{_proxy:r,_context:i,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let c=t(i,s||o);return a.delete(e),V(e,c)&&(c=ee(r._scopes,r,e,c)),c}function Ot(e,t,n,o){let{_proxy:r,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&o(e))return t[i.index%t.length];if(_(t[0])){let c=t,l=r._scopes.filter(u=>u!==c);t=[];for(let u of c){let d=ee(l,r,e,u);t.push(q(d,i,s&&s[e],a))}}return t}function ke(e,t,n){return z(e)?e(t,n):e}var wt=(e,t)=>e===!0?t:typeof e=="string"?_e(t,e):void 0;function Pt(e,t,n,o,r){for(let i of t){let s=wt(n,i);if(s){e.add(s);let a=ke(s._fallback,n,r);if(typeof a<"u"&&a!==n&&a!==o)return a}else if(s===!1&&typeof o<"u"&&n!==o)return null}return!1}function ee(e,t,n,o){let r=t._rootScopes,i=ke(t._fallback,n,o),s=[...e,...r],a=new Set;a.add(o);let c=fe(a,s,n,i||n,o);return c===null||typeof i<"u"&&i!==n&&(c=fe(a,s,i,c,o),c===null)?!1:Te(Array.from(a),[""],r,i,()=>xt(t,n,o))}function fe(e,t,n,o,r){for(;n;)n=Pt(e,t,n,o,r);return n}function xt(e,t,n){let o=e._getTarget();t in o||(o[t]={});let r=o[t];return M(r)&&_(n)?n:r||{}}function Tt(e,t,n,o){let r;for(let i of t)if(r=Ie(_t(i,e),n),typeof r<"u")return V(e,r)?ee(n,o,e,r):r}function Ie(e,t){for(let n of t){if(!n)continue;let o=n[e];if(typeof o<"u")return o}}function de(e){let t=e._keys;return t||(t=e._keys=Ct(e._scopes)),t}function Ct(e){let t=new Set;for(let n of e)for(let o of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(o);return Array.from(t)}function Un(e,t,n,o){let{iScale:r}=e,{key:i="r"}=this._parsing,s=new Array(o),a,c,l,u;for(a=0,c=o;ate==="x"?"y":"x";function It(e,t,n,o){let r=e.skip?t:e,i=t,s=n.skip?t:n,a=ie(i,r),c=ie(s,i),l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=o*l,g=o*u;return{previous:{x:i.x-d*(s.x-r.x),y:i.y-d*(s.y-r.y)},next:{x:i.x+g*(s.x-r.x),y:i.y+g*(s.y-r.y)}}}function Rt(e,t,n){let o=e.length,r,i,s,a,c,l=A(e,0);for(let u=0;u!l.skip)),t.cubicInterpolationMode==="monotone")At(e,r);else{let l=o?e[e.length-1]:e[0];for(i=0,s=e.length;ie.ownerDocument.defaultView.getComputedStyle(e,null);function Lt(e,t){return G(e).getPropertyValue(t)}var Wt=["top","right","bottom","left"];function C(e,t,n){let o={};n=n?"-"+n:"";for(let r=0;r<4;r++){let i=Wt[r];o[i]=parseFloat(e[t+"-"+i+n])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}var Nt=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Et(e,t){let n=e.touches,o=n&&n.length?n[0]:e,{offsetX:r,offsetY:i}=o,s=!1,a,c;if(Nt(r,i,e.target))a=r,c=i;else{let l=t.getBoundingClientRect();a=o.clientX-l.left,c=o.clientY-l.top,s=!0}return{x:a,y:c,box:s}}function Jn(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:o}=t,r=G(n),i=r.boxSizing==="border-box",s=C(r,"padding"),a=C(r,"border","width"),{x:c,y:l,box:u}=Et(e,n),d=s.left+(u&&a.left),g=s.top+(u&&a.top),{width:m,height:p}=t;return i&&(m-=s.width+a.width,p-=s.height+a.height),{x:Math.round((c-d)/m*n.width/o),y:Math.round((l-g)/p*n.height/o)}}function Ft(e,t,n){let o,r;if(t===void 0||n===void 0){let i=e&&Dt(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{let s=i.getBoundingClientRect(),a=G(i),c=C(a,"border","width"),l=C(a,"padding");t=s.width-l.width-c.width,n=s.height-l.height-c.height,o=K(a.maxWidth,i,"clientWidth"),r=K(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:o||H,maxHeight:r||H}}var P=e=>Math.round(e*10)/10;function Xn(e,t,n,o){let r=G(e),i=C(r,"margin"),s=K(r.maxWidth,e,"clientWidth")||H,a=K(r.maxHeight,e,"clientHeight")||H,c=Ft(e,t,n),{width:l,height:u}=c;if(r.boxSizing==="content-box"){let g=C(r,"border","width"),m=C(r,"padding");l-=m.width+g.width,u-=m.height+g.height}return l=Math.max(0,l-i.width),u=Math.max(0,o?l/o:u-i.height),l=P(Math.min(l,s,c.maxWidth)),u=P(Math.min(u,a,c.maxHeight)),l&&!u&&(u=P(l/2)),(t!==void 0||n!==void 0)&&o&&c.height&&u>c.height&&(u=c.height,l=P(Math.floor(u*o))),{width:l,height:u}}function Zn(e,t,n){let o=t||1,r=P(e.height*o),i=P(e.width*o);e.height=P(e.height),e.width=P(e.width);let s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==o||s.height!==r||s.width!==i?(e.currentDevicePixelRatio=o,s.height=r,s.width=i,e.ctx.setTransform(o,0,0,o,0,0),!0):!1}var Vn=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};jt()&&(globalThis.addEventListener("test",null,t),globalThis.removeEventListener("test",null,t))}catch{}return e})();function eo(e,t){let n=Lt(e,t),o=n&&n.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function R(e,t,n,o){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function to(e,t,n,o){return{x:e.x+n*(t.x-e.x),y:o==="middle"?n<.5?e.y:t.y:o==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function no(e,t,n,o){let r={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=R(e,r,n),a=R(r,i,n),c=R(i,t,n),l=R(s,a,n),u=R(a,c,n);return R(l,u,n)}var zt=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,o){return n-o},leftForLtr(n,o){return n-o}}},Ht=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function oo(e,t,n){return e?zt(t,n):Ht()}function ro(e,t){let n,o;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,o=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=o)}function io(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ve(e){return e==="angle"?{between:Qe,compare:Ge,normalize:w}:{between:$e,compare:(t,n)=>t-n,normalize:t=>t}}function he({start:e,end:t,count:n,loop:o,style:r}){return{start:e%n,end:t%n,loop:o&&(t-e+1)%n===0,style:r}}function qt(e,t,n){let{property:o,start:r,end:i}=n,{between:s,normalize:a}=ve(o),c=t.length,{start:l,end:u,loop:d}=e,g,m;if(d){for(l+=c,u+=c,g=0,m=c;gc(r,B,b)&&a(r,B)!==0,Be=()=>a(i,b)===0||c(i,B,b),je=()=>h||Ae(),De=()=>!h||Be();for(let I=u,te=u;I<=d;++I)k=t[I%s],!k.skip&&(b=l(k[o]),b!==B&&(h=c(b,r,i),f===null&&je()&&(f=a(b,r)===0?I:te),f!==null&&De()&&(p.push(he({start:f,end:I,loop:g,count:s,style:m})),f=null),te=I,B=b));return f!==null&&p.push(he({start:f,end:d,loop:g,count:s,style:m})),p}function so(e,t){let n=[],o=e.segments;for(let r=0;rr&&e[i%t].skip;)i--;return i%=t,{start:r,end:i}}function Qt(e,t,n,o){let r=e.length,i=[],s=t,a=e[t],c;for(c=t+1;c<=n;++c){let l=e[c%r];l.skip||l.stop?a.skip||(o=!1,i.push({start:t%r,end:(c-1)%r,loop:o}),t=s=l.stop?c:null):(s=c,a.skip&&(t=c)),a=l}return s!==null&&i.push({start:t%r,end:s%r,loop:o}),i}function ao(e,t){let n=e.points,o=e.options.spanGaps,r=n.length;if(!r)return[];let i=!!e._loop,{start:s,end:a}=Gt(n,r,i,o);if(o===!0)return ge(e,[{start:s,end:a,loop:i}],n,t);let c=a