@kong-ui-public/analytics-chart 5.7.0 → 5.7.1
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/dist/vitals-chart.es.js
CHANGED
|
@@ -14744,7 +14744,7 @@ Rt.FIFTEEN_MIN, new Ne({
|
|
|
14744
14744
|
dataGranularity: "hourly",
|
|
14745
14745
|
isRelative: !0,
|
|
14746
14746
|
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
14747
|
-
allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely"]
|
|
14747
|
+
allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
|
|
14748
14748
|
}), Rt.TWELVE_HOUR, new Ne({
|
|
14749
14749
|
key: Rt.TWELVE_HOUR,
|
|
14750
14750
|
display: "Last 12 hours",
|
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Released under the MIT License
|
|
16
16
|
*/class Ig{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Uo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Fe=new Ig;const Ml="transparent",Ng={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Jo(n||Ml),s=i.valid&&Jo(t||Ml);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Fg{constructor(t,e,i,s){const r=e[i];s=wi([t.to,s,r,t.from]);const a=wi([t.from,r,s]);this._active=!0,this._fn=t.fn||Ng[t.type||typeof a],this._easing=mi[t.easing]||mi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=wi([t.to,e,s,t.from]),this._from=wi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Vr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!it(t))return;const e=Object.keys(xt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!it(r))return;const a={};for(const o of e)a[o]=r[o];(ct(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=Bg(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&zg(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,o);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new Fg(h,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Fe.add(this._chart,i),!0}}function zg(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Bg(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function kl(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function Hg(n,t,e){if(e===!1)return!1;const i=kl(n,e),s=kl(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Wg(n){let t,e,i,s;return it(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function Sl(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function Dl(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t!==null){for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(i.all)continue;break}c=n.values[l],Mt(c)&&(r||t===0||De(t)===De(c))&&(t+=c)}return t}}function Yg(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function jr(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Vg(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function jg(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function $g(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Tl(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function Cl(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Vg(r,a,i),d=t.length;let h;for(let g=0;g<d;++g){const p=t[g],{[l]:b,[c]:_}=p,w=p._stacks||(p._stacks={});h=w[c]=$g(s,u,b),h[o]=_,h._top=Tl(h,a,!0,i.type),h._bottom=Tl(h,a,!1,i.type);const M=h._visualValues||(h._visualValues={});M[o]=_}}function $r(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function qg(n,t){return nn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ug(n,t,e){return nn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function vi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const qr=n=>n==="reset"||n==="none",Pl=(n,t)=>t?n:Object.assign({},n),Xg=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Sl(e,!0),values:null};class _e{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=jr(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&vi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,h,g,p)=>d==="x"?h:d==="r"?p:g,r=e.xAxisID=K(i.xAxisID,$r(t,"x")),a=e.yAxisID=K(i.yAxisID,$r(t,"y")),o=e.rAxisID=K(i.rAxisID,$r(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&$o(this._data,this),t._stacked&&vi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(it(e)){const s=this._cachedMeta;this._data=Yg(e,s)}else if(i!==e){if(i){$o(i,this);const s=this._cachedMeta;vi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Rf(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=jr(e.vScale,e),e.stack!==i.stack&&(s=!0,vi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Cl(this,e._parsed),e._stacked=jr(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:a}=i,o=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{ct(s[t])?h=this.parseArrayData(i,s,t,e):it(s[t])?h=this.parseObjectData(i,s,t,e):h=this.parsePrimitiveData(i,s,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=h[u],l&&(g()&&(l=!1),c=d);i._sorted=l}a&&Cl(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,d=new Array(s);let h,g,p;for(h=0,g=s;h<g;++h)p=h+i,d[h]={[o]:u||r.parse(c[p],p),[l]:a.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],o[l]={x:r.parse(d[0],u),y:a.parse(d[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,h,g;for(u=0,d=s;u<d;++u)h=u+i,g=e[h],c[u]={x:r.parse(Qe(g,o),h),y:a.parse(Qe(g,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,a=e[t.axis],o={keys:Sl(s,!0),values:e._stacks[t.axis]._visualValues};return Dl(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=Dl(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=Xg(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=jg(o);let h,g;function p(){g=s[h];const b=g[o.axis];return!Mt(g[t.axis])||u>b||d<b}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++h);if(r){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],Mt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Wg(K(this.options.clip,Hg(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const d=s[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,r))}for(u=0;u<a.length;++u)a[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];r=a.$context||(a.$context=Ug(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=qg(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&Qt(i);if(o)return Pl(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(xt.elements[t]),p=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(h,g,p,d);return b.$shared&&(b.$shared=l,r[a]=Object.freeze(Pl(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new Vr(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||qr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){qr(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!qr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&vi(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(_e,"defaults",{}),P(_e,"datasetElementType",null),P(_e,"dataElementType",null);function Gg(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=qo(i.sort((s,r)=>s-r))}return n._cache.$bar}function Kg(n){const t=n.iScale,e=Gg(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(Qt(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function Zg(n,t,e,i){const s=e.barThickness;let r,a;return J(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function Qg(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function Jg(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function Ol(n,t,e,i){return ct(n)?Jg(n,t,e,i):t[e.axis]=e.parse(n,i),t}function El(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[s.axis]=o||s.parse(a[c],c),l.push(Ol(h,d,r,c));return l}function Ur(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function tp(n,t,e){return n!==0?De(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function ep(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function np(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:l,top:c,bottom:u}=ep(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[Al(u,a,o,l)]=!0,s=c)),r[Al(s,a,o,l)]=!0,n.borderSkipped=r}function Al(n,t,e,i){return i?(n=ip(n,t,e),n=Rl(n,e,t)):n=Rl(n,t,e),n}function ip(n,t,e){return n===t?e:n===e?t:n}function Rl(n,t,e){return n==="start"?t:n==="end"?e:n}function sp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Mi extends _e{parsePrimitiveData(t,e,i,s){return El(t,e,i,s)}parseArrayData(t,e,i,s){return El(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,d=[];let h,g,p,b;for(h=i,g=i+s;h<g;++h)b=e[h],p={},p[r.axis]=r.parse(Qe(b,c),h),d.push(Ol(Qe(b,u),p,a,h));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),a=r._custom,o=Ur(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),b=r||J(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),_=this._calculateBarIndexPixels(g,u),w=(p._stacks||{})[o.axis],M={horizontal:c,base:b.base,enableBorderRadius:!w||Ur(p._custom)||a===w._top||a===w._bottom,x:c?b.head:_.center,y:c?_.center:b.head,height:c?_.size:Math.abs(b.size),width:c?Math.abs(b.size):_.size};h&&(M.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const k=M.options||t[g].options;np(M,k,w,a),sp(M,k,u.ratio),this.updateElement(t[g],g,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),l=o&&o[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),h=d&&d[u.vScale.axis];if(J(h)||isNaN(h))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||Kg(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=Ur(c);let d=l[e.axis],h=0,g=i?this.applyStack(e,l,i):d,p,b;g!==d&&(h=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&De(d)!==De(c.barEnd)&&(h=0),h+=d);const _=!J(r)&&!u?r:h;let w=e.getPixelForValue(_);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(h+g):p=w,b=p-w,Math.abs(b)<a){b=tp(b,e,o)*a,d===o&&(w-=b/2);const M=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),C=Math.min(M,k),S=Math.max(M,k);w=Math.max(Math.min(w,S),C),p=w+b,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(w))}if(w===e.getPixelForValue(o)){const M=De(b)*e.getLineWidthForValue(o)/2;w+=M,b-=M}return{size:b,base:w,head:p,center:p+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=K(s.maxBarThickness,1/0);let o,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?Qg(t,e,s,c):Zg(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}P(Mi,"id","bar"),P(Mi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Mi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class vs extends _e{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=K(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=K(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,d=o.axis;for(let h=e;h<e+i;h++){const g=t[h],p=!r&&this.getParsed(h),b={},_=b[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(p[u]),w=b[d]=r?o.getBasePixel():o.getPixelForValue(p[d]);b.skip=isNaN(_)||isNaN(w),c&&(b.options=l||this.resolveDataElementOptions(h,g.active?"active":s),r&&(b.options.radius=0)),this.updateElement(g,h,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=K(i&&i._custom,r),s}}P(vs,"id","bubble"),P(vs,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(vs,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function rp(n,t,e){let i=1,s=1,r=0,a=0;if(t<yt){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),h=Math.sin(l),g=(k,C,S)=>pi(k,o,l,!0)?1:Math.max(C,C*e,S,S*e),p=(k,C,S)=>pi(k,o,l,!0)?-1:Math.min(C,C*e,S,S*e),b=g(0,c,d),_=g(bt,u,h),w=p(rt,c,d),M=p(rt+bt,u,h);i=(b-w)/2,s=(_-M)/2,r=-(b+w)/2,a=-(_+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class ze extends _e{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(it(i[t])){const{key:l="value"}=this._parsing;r=c=>+Qe(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return Nt(this.options.rotation-90)}_getCircumference(){return Nt(this.options.circumference)}_getRotationExtents(){let t=yt,e=-yt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(_f(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:p,offsetY:b}=rp(d,u,l),_=(i.width-a)/h,w=(i.height-a)/g,M=Math.max(Math.min(_,w)/2,0),k=Fo(this.options.radius,M),C=Math.max(k*l,0),S=(k-C)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=b*k,s.total=this.calculateTotal(),this.outerRadius=k-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/yt)}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,h=r&&c.animateScale,g=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:b,includeOptions:_}=this._getSharedOptions(e,s);let w=this._getRotation(),M;for(M=0;M<e;++M)w+=this._circumference(M,r);for(M=e;M<e+i;++M){const k=this._circumference(M,r),C=t[M],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:w,endAngle:w+k,circumference:k,outerRadius:p,innerRadius:g};_&&(S.options=b||this.resolveDataElementOptions(M,C.active?"active":s)),w+=k,this.updateElement(C,M,S,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?yt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=yi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(K(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(ze,"id","doughnut"),P(ze,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(ze,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(ze,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ki extends _e{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=Go(e,s,a);this._drawStart=o,this._drawCount=l,Ko(e)&&(o=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),h=a.axis,g=o.axis,{spanGaps:p,segment:b}=this.options,_=tn(p)?p:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||r||s==="none",M=e+i,k=t.length;let C=e>0&&this.getParsed(e-1);for(let S=0;S<k;++S){const O=t[S],D=w?O:{};if(S<e||S>=M){D.skip=!0;continue}const y=this.getParsed(S),x=J(y[g]),T=D[h]=a.getPixelForValue(y[h],S),A=D[g]=r||x?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,y,l):y[g],S);D.skip=isNaN(T)||isNaN(A)||x,D.stop=S>0&&Math.abs(y[h]-C[h])>_,b&&(D.parsed=y,D.raw=c.data[S]),d&&(D.options=u||this.resolveDataElementOptions(S,O.active?"active":s)),w||this.updateElement(O,S,D,s),C=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(ki,"id","line"),P(ki,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(ki,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Si extends _e{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=yi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return dl.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*rt;let g=h,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,b);for(p=e;p<e+i;p++){const _=t[p];let w=g,M=g+this._computeAngle(p,s,b),k=a.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=M,r&&(l.animateScale&&(k=0),l.animateRotate&&(w=M=h));const C={x:u,y:d,innerRadius:0,outerRadius:k,startAngle:w,endAngle:M,options:this.resolveDataElementOptions(p,_.active?"active":s)};this.updateElement(_,p,C,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Nt(this.resolveDataElementOptions(t,e).angle||i):0}}P(Si,"id","polarArea"),P(Si,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(Si,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Xr extends ze{}P(Xr,"id","pie"),P(Xr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ms extends _e{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return dl.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),d=a?r.xCenter:u.x,h=a?r.yCenter:u.y,g={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,o,g,s)}}}P(Ms,"id","radar"),P(Ms,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(Ms,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ks extends _e{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=Go(e,i,s);if(this._drawStart=r,this._drawCount=a,Ko(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),h=this.includeOptions(s,d),g=a.axis,p=o.axis,{spanGaps:b,segment:_}=this.options,w=tn(b)?b:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let k=e>0&&this.getParsed(e-1);for(let C=e;C<e+i;++C){const S=t[C],O=this.getParsed(C),D=M?S:{},y=J(O[p]),x=D[g]=a.getPixelForValue(O[g],C),T=D[p]=r||y?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,O,l):O[p],C);D.skip=isNaN(x)||isNaN(T)||y,D.stop=C>0&&Math.abs(O[g]-k[g])>w,_&&(D.parsed=O,D.raw=c.data[C]),h&&(D.options=d||this.resolveDataElementOptions(C,S.active?"active":s)),M||this.updateElement(S,C,D,s),k=O}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}P(ks,"id","scatter"),P(ks,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(ks,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var ap=Object.freeze({__proto__:null,BarController:Mi,BubbleController:vs,DoughnutController:ze,LineController:ki,PieController:Xr,PolarAreaController:Si,RadarController:Ms,ScatterController:ks});function Mn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gr{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(Gr.prototype,t)}init(){}formats(){return Mn()}parse(){return Mn()}format(){return Mn()}add(){return Mn()}diff(){return Mn()}startOf(){return Mn()}endOf(){return Mn()}}var Ll={_date:Gr};function op(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const l=o._reversePixels?Ef:Ie;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),h=l(r,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Di(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:d,hi:h}=op(r[o],t,a,s);for(let g=d;g<=h;++g){const p=u[g];p.skip||i(p,c,g)}}}function lp(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function Kr(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||Di(n,e,t,function(o,l,c){!s&&!Ne(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function cp(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:d}=gs(a,{x:t.x,y:t.y});pi(d,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return Di(n,e,t,r),s}function up(n,t,e,i,s,r){let a=[];const o=lp(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const _=o(t,p);_<l?(a=[{element:u,datasetIndex:d,index:h}],l=_):_===l&&a.push({element:u,datasetIndex:d,index:h})}return Di(n,e,t,c),a}function Zr(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?cp(n,t,e,s):up(n,t,e,i,s,r)}function Il(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return Di(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var Qr={evaluateInteractionItems:Di,modes:{index(n,t,e,i){const s=sn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?Kr(n,s,r,i,a):Zr(n,s,r,!1,i,a),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?Kr(n,s,r,i,a):Zr(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return Kr(n,s,r,i,a)},nearest(n,t,e,i){const s=sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return Zr(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=sn(t,n);return Il(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=sn(t,n);return Il(n,s,"y",e.intersect,i)}}};const Nl=["left","top","right","bottom"];function Ti(n,t){return n.filter(e=>e.pos===t)}function Fl(n,t){return n.filter(e=>Nl.indexOf(e.pos)===-1&&e.box.axis===t)}function Ci(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function dp(n){const t=[];let e,i,s,r,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function hp(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Nl.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function fp(n,t){const e=hp(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function gp(n){const t=dp(n),e=Ci(t.filter(c=>c.box.fullSize),!0),i=Ci(Ti(t,"left"),!0),s=Ci(Ti(t,"right")),r=Ci(Ti(t,"top"),!0),a=Ci(Ti(t,"bottom")),o=Fl(t,"x"),l=Fl(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:Ti(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function zl(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Bl(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function pp(n,t,e,i){const{pos:s,box:r}=e,a=n.maxPadding;if(!it(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&Bl(a,r.getPadding());const o=Math.max(0,t.outerWidth-zl(a,n,"left","right")),l=Math.max(0,t.outerHeight-zl(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function mp(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function yp(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function Pi(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,yp(o.horizontal,t));const{same:d,other:h}=pp(t,e,o,i);c|=d&&s.length,u=u||h,l.fullSize||s.push(o)}return c&&Pi(s,t,e,i)||u}function Ss(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Hl(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,h=c.size||l.height;Qt(c.start)&&(a=c.start),l.fullSize?Ss(l,s.left,a,e.outerWidth-s.right-s.left,h):Ss(l,t.left+c.placed,a,d,h),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,h=c.size||l.width;Qt(c.start)&&(r=c.start),l.fullSize?Ss(l,r,s.top,h,e.outerHeight-s.bottom-s.top):Ss(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=a}var $t={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Ft(n.options.layout.padding),r=Math.max(t-s.width,0),a=Math.max(e-s.height,0),o=gp(n.boxes),l=o.vertical,c=o.horizontal;ht(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,_)=>_.box.options&&_.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},s);Bl(h,Ft(i));const g=Object.assign({maxPadding:h,w:r,h:a,x:s.left,y:s.top},s),p=fp(l.concat(c),d);Pi(o.fullSize,g,d,p),Pi(l,g,d,p),Pi(c,g,d,p)&&Pi(l,g,d,p),mp(g),Hl(o.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Hl(o.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},ht(o.chartArea,b=>{const _=b.box;Object.assign(_,n.chartArea),_.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Wl{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class bp extends Wl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ds="$chartjs",xp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Yl=n=>n===null||n==="";function _p(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Ds]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Yl(s)){const r=gl(n,"width");r!==void 0&&(n.width=r)}if(Yl(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=gl(n,"height");r!==void 0&&(n.height=r)}return n}const Vl=kg?{passive:!0}:!1;function wp(n,t,e){n&&n.addEventListener(t,e,Vl)}function vp(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Vl)}function Mp(n,t){const e=xp[n.type]||n.type,{x:i,y:s}=sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Ts(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function kp(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Ts(o.addedNodes,i),a=a&&!Ts(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Sp(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Ts(o.removedNodes,i),a=a&&!Ts(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oi=new Map;let jl=0;function $l(){const n=window.devicePixelRatio;n!==jl&&(jl=n,Oi.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Dp(n,t){Oi.size||window.addEventListener("resize",$l),Oi.set(n,t)}function Tp(n){Oi.delete(n),Oi.size||window.removeEventListener("resize",$l)}function Cp(n,t,e){const i=n.canvas,s=i&&Yr(i);if(!s)return;const r=Xo((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),Dp(n,r),a}function Jr(n,t,e){e&&e.disconnect(),t==="resize"&&Tp(n)}function Pp(n,t,e){const i=n.canvas,s=Xo(r=>{n.ctx!==null&&e(Mp(r,n))},n);return wp(i,t,s),s}class Op extends Wl{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(_p(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ds])return!1;const i=e[Ds].initial;["height","width"].forEach(r=>{const a=i[r];J(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Ds],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:kp,detach:Sp,resize:Cp}[e]||Pp;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Jr,detach:Jr,resize:Jr}[e]||vp)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Mg(t,e,i,s)}isAttached(t){const e=t&&Yr(t);return!!(e&&e.isConnected)}}function Ep(n){return!Wr()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?bp:Op}class Wt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return tn(this.x)&&tn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}P(Wt,"defaults",{}),P(Wt,"defaultRoutes");function Ap(n,t){const e=n.options.ticks,i=Rp(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Ip(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return Np(t,c,r,a/s),c;const u=Lp(r,t,s);if(a>0){let d,h;const g=a>1?Math.round((l-o)/(a-1)):null;for(Cs(t,c,u,J(g)?0:o-g,o),d=0,h=a-1;d<h;d++)Cs(t,c,u,r[d],r[d+1]);return Cs(t,c,u,l,J(g)?t.length:l+g),c}return Cs(t,c,u),c}function Rp(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Lp(n,t,e){const i=Fp(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Tf(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function Ip(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Np(n,t,e,i){let s=0,r=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function Cs(n,t,e,i,s){const r=K(i,0),a=Math.min(K(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*e))}function Fp(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const zp=n=>n==="left"?"right":n==="right"?"left":n,ql=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Ul=(n,t)=>Math.min(t||n,n);function Xl(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function Bp(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function Hp(n,t){ht(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function Ei(n){return n.drawTicks?n.tickLength:0}function Gl(n,t){if(!n.display)return 0;const e=kt(n.font,t),i=Ft(n.padding);return(ct(n.text)?n.text.length:1)*e.lineHeight+i.height}function Wp(n,t){return nn(n,{scale:t,type:"scale"})}function Yp(n,t,e){return nn(n,{tick:e,index:t,type:"tick"})}function Vp(n,t,e){let i=Er(n);return(e&&t!=="right"||!e&&t==="right")&&(i=zp(i)),i}function jp(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,g,p;const b=a-s,_=o-r;if(n.isHorizontal()){if(g=jt(i,r,o),it(e)){const w=Object.keys(e)[0],M=e[w];p=u[w].getPixelForValue(M)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=ql(n,e,t);h=o-r}else{if(it(e)){const w=Object.keys(e)[0],M=e[w];g=u[w].getPixelForValue(M)-_+t}else e==="center"?g=(c.left+c.right)/2-_+t:g=ql(n,e,t);p=jt(i,a,s),d=e==="left"?-bt:bt}return{titleX:g,titleY:p,maxWidth:h,rotation:d}}class kn extends Wt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=ce(t,Number.POSITIVE_INFINITY),e=ce(e,Number.NEGATIVE_INFINITY),i=ce(i,Number.POSITIVE_INFINITY),s=ce(s,Number.NEGATIVE_INFINITY),{min:ce(t,i),max:ce(e,s),minDefined:Mt(t),maxDefined:Mt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:ce(e,ce(i,e)),max:ce(i,ce(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){dt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=eg(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Xl(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Ap(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){dt(this.options.afterUpdate,[this])}beforeSetDimensions(){dt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){dt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),dt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){dt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=dt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Ul(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=Ht(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/i:g/(i-1),d+6>o&&(o=g/(i-(t.offset?.5:1)),l=this.maxHeight-Ei(t.grid)-e.padding-Gl(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),a=fs(Math.min(Math.asin(Ht((u.highest.height+6)/o,-1,1)),Math.asin(Ht(l/c,-1,1))-Math.asin(Ht(h/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){dt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=Gl(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=Ei(r)+l):(t.height=this.maxHeight,t.width=Ei(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=i.padding*2,p=Nt(this.labelRotation),b=Math.cos(p),_=Math.sin(p);if(o){const w=i.mirror?0:_*d.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+w+g)}else{const w=i.mirror?0:b*d.width+_*h.height;t.width=Math.min(this.maxWidth,t.width+w+g)}this._calculatePadding(c,u,_,b)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:a},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,g=0;l?c?(h=s*t.width,g=i*e.height):(h=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,g=e.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+a)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){dt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)J(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Xl(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,a=[],o=[],l=Math.floor(e/Ul(e,i));let c=0,u=0,d,h,g,p,b,_,w,M,k,C,S;for(d=0;d<e;d+=l){if(p=t[d].label,b=this._resolveTickFontOptions(d),s.font=_=b.string,w=r[_]=r[_]||{data:{},gc:[]},M=b.lineHeight,k=C=0,!J(p)&&!ct(p))k=ys(s,w.data,w.gc,k,p),C=M;else if(ct(p))for(h=0,g=p.length;h<g;++h)S=p[h],!J(S)&&!ct(S)&&(k=ys(s,w.data,w.gc,k,S),C+=M);a.push(k),o.push(C),c=Math.max(k,c),u=Math.max(C,u)}Hp(r,e);const O=a.indexOf(c),D=o.indexOf(u),y=x=>({width:a[x]||0,height:o[x]||0});return{first:y(0),last:y(e-1),widest:y(O),highest:y(D),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Of(this._alignToPixels?xn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Yp(this.getContext(),t,i))}return this.$context||(this.$context=Wp(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Nt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:a,border:o}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=Ei(r),g=[],p=o.setContext(this.getContext()),b=p.display?p.width:0,_=b/2,w=function(j){return xn(i,j,b)};let M,k,C,S,O,D,y,x,T,A,R,L;if(a==="top")M=w(this.bottom),D=this.bottom-h,x=M-_,A=w(t.top)+_,L=t.bottom;else if(a==="bottom")M=w(this.top),A=t.top,L=w(t.bottom)-_,D=M+_,x=this.top+h;else if(a==="left")M=w(this.right),O=this.right-h,y=M-_,T=w(t.left)+_,R=t.right;else if(a==="right")M=w(this.left),T=t.left,R=w(t.right)-_,O=M+_,y=this.left+h;else if(e==="x"){if(a==="center")M=w((t.top+t.bottom)/2+.5);else if(it(a)){const j=Object.keys(a)[0],N=a[j];M=w(this.chart.scales[j].getPixelForValue(N))}A=t.top,L=t.bottom,D=M+_,x=D+h}else if(e==="y"){if(a==="center")M=w((t.left+t.right)/2);else if(it(a)){const j=Object.keys(a)[0],N=a[j];M=w(this.chart.scales[j].getPixelForValue(N))}O=M-_,y=O-h,T=t.left,R=t.right}const F=K(s.ticks.maxTicksLimit,d),q=Math.max(1,Math.ceil(d/F));for(k=0;k<d;k+=q){const j=this.getContext(k),N=r.setContext(j),st=o.setContext(j),B=N.lineWidth,At=N.color,_t=st.dash||[],W=st.dashOffset,I=N.tickWidth,H=N.tickColor,$=N.tickBorderDash||[],X=N.tickBorderDashOffset;C=Bp(this,k,l),C!==void 0&&(S=xn(i,C,B),c?O=y=T=R=S:D=x=A=L=S,g.push({tx1:O,ty1:D,tx2:y,ty2:x,x1:T,y1:A,x2:R,y2:L,width:B,color:At,borderDash:_t,borderDashOffset:W,tickWidth:I,tickColor:H,tickBorderDash:$,tickBorderDashOffset:X}))}return this._ticksLength=d,this._borderValue=M,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,h=Ei(i.grid),g=h+u,p=d?-u:g,b=-Nt(this.labelRotation),_=[];let w,M,k,C,S,O,D,y,x,T,A,R,L="middle";if(s==="top")O=this.bottom-p,D=this._getXAxisLabelAlignment();else if(s==="bottom")O=this.top+p,D=this._getXAxisLabelAlignment();else if(s==="left"){const q=this._getYAxisLabelAlignment(h);D=q.textAlign,S=q.x}else if(s==="right"){const q=this._getYAxisLabelAlignment(h);D=q.textAlign,S=q.x}else if(e==="x"){if(s==="center")O=(t.top+t.bottom)/2+g;else if(it(s)){const q=Object.keys(s)[0],j=s[q];O=this.chart.scales[q].getPixelForValue(j)+g}D=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")S=(t.left+t.right)/2-g;else if(it(s)){const q=Object.keys(s)[0],j=s[q];S=this.chart.scales[q].getPixelForValue(j)}D=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const F=this._getLabelSizes();for(w=0,M=o.length;w<M;++w){k=o[w],C=k.label;const q=r.setContext(this.getContext(w));y=this.getPixelForTick(w)+r.labelOffset,x=this._resolveTickFontOptions(w),T=x.lineHeight,A=ct(C)?C.length:1;const j=A/2,N=q.color,st=q.textStrokeColor,B=q.textStrokeWidth;let At=D;a?(S=y,D==="inner"&&(w===M-1?At=this.options.reverse?"left":"right":w===0?At=this.options.reverse?"right":"left":At="center"),s==="top"?c==="near"||b!==0?R=-A*T+T/2:c==="center"?R=-F.highest.height/2-j*T+T:R=-F.highest.height+T/2:c==="near"||b!==0?R=T/2:c==="center"?R=F.highest.height/2-j*T:R=F.highest.height-A*T,d&&(R*=-1),b!==0&&!q.showLabelBackdrop&&(S+=T/2*Math.sin(b))):(O=y,R=(1-A)*T/2);let _t;if(q.showLabelBackdrop){const W=Ft(q.backdropPadding),I=F.heights[w],H=F.widths[w];let $=R-W.top,X=0-W.left;switch(L){case"middle":$-=I/2;break;case"bottom":$-=I;break}switch(D){case"center":X-=H/2;break;case"right":X-=H;break;case"inner":w===M-1?X-=H:w>0&&(X-=H/2);break}_t={left:X,top:$,width:H+W.width,height:I+W.height,color:q.backdropColor}}_.push({label:C,font:x,textOffset:R,options:{rotation:b,color:N,strokeColor:st,strokeWidth:B,textAlign:At,textBaseline:L,translation:[S,O],backdrop:_t}})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Nt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,a=this._getLabelSizes(),o=t+r,l=a.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,a;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=xn(t,this.left,a)-a/2,u=xn(t,this.right,o)+o/2,d=h=l):(d=xn(t,this.top,a)-a/2,h=xn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&xi(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;_n(i,c,0,u,l,o)}s&&_i(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=kt(i.font),a=Ft(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||it(e)?(l+=a.bottom,ct(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=jp(this,l,e,o);_n(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:h,textAlign:Vp(o,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=K(t.grid&&t.grid.z,-1),s=K(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==kn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return kt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ps{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Up(e)&&(i=this.register(e));const s=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,$p(t,a,i),this.override&&xt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in xt[s]&&(delete xt[s][i],this.override&&delete bn[i])}}function $p(n,t,e){const i=hi(Object.create(null),[e?xt.get(e):{},xt.get(t),n.defaults]);xt.set(t,i),n.defaultRoutes&&qp(t,n.defaultRoutes),n.descriptors&&xt.describe(t,n.descriptors)}function qp(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),a=t[e].split("."),o=a.pop(),l=a.join(".");xt.route(r,s,l,o)})}function Up(n){return"id"in n&&"defaults"in n}class Xp{constructor(){this.controllers=new Ps(_e,"datasets",!0),this.elements=new Ps(Wt,"elements"),this.plugins=new Ps(Object,"plugins"),this.scales=new Ps(kn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):ht(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=Cr(t);dt(i["before"+s],[],i),e[t](i),dt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Te=new Xp;class Gp{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(dt(o,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){J(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=K(i.options&&i.options.plugins,{}),r=Kp(i);return s===!1&&!e?[]:Qp(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Kp(n){const t={},e=[],i=Object.keys(Te.plugins.items);for(let r=0;r<i.length;r++)e.push(Te.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Zp(n,t){return!t&&n===!1?null:n===!0?{}:n}function Qp(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=Zp(i[l],s);c!==null&&r.push({plugin:o,options:Jp(n.config,{plugin:o,local:e[l]},c,a)})}return r}function Jp(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ta(n,t){const e=xt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function tm(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function em(n,t){return n===t?"_index_":"_value_"}function Kl(n){if(n==="x"||n==="y"||n==="r")return n}function nm(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ea(n,...t){if(Kl(n))return n;for(const e of t){const i=e.axis||nm(e.position)||n.length>1&&Kl(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Zl(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function im(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Zl(n,"x",e[0])||Zl(n,"y",e[0])}return{}}function sm(n,t){const e=bn[n.type]||{scales:{}},i=t.scales||{},s=ta(n.type,t),r=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!it(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=ea(a,o,im(a,n),xt.scales[o.type]),c=em(l,s),u=e.scales||{};r[a]=fi(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||ta(o,t),u=(bn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const h=tm(d,l),g=a[h+"AxisID"]||h;r[g]=r[g]||Object.create(null),fi(r[g],[{axis:h},i[g],u[d]])})}),Object.keys(r).forEach(a=>{const o=r[a];fi(o,[xt.scales[o.type],xt.scale])}),r}function Ql(n){const t=n.options||(n.options={});t.plugins=K(t.plugins,{}),t.scales=sm(n,t)}function Jl(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function rm(n){return n=n||{},n.data=Jl(n.data),Ql(n),n}const tc=new Map,ec=new Set;function Os(n,t){let e=tc.get(n);return e||(e=t(),tc.set(n,e),ec.add(e)),e}const Ai=(n,t,e)=>{const i=Qe(t,e);i!==void 0&&n.add(i)};class am{constructor(t){this._config=rm(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Jl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ql(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Os(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Os(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Os(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Os(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ai(l,t,d))),u.forEach(d=>Ai(l,s,d)),u.forEach(d=>Ai(l,bn[r]||{},d)),u.forEach(d=>Ai(l,xt,d)),u.forEach(d=>Ai(l,Lr,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ec.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,bn[e]||{},xt.datasets[e]||{},{type:e},xt,Lr]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=nc(this._resolverCache,t,s);let l=a;if(lm(a,e)){r.$shared=!1,i=Jt(i)?i():i;const c=this.createResolver(t,i,o);l=Yn(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=nc(this._resolverCache,t,i);return it(e)?Yn(r,e,void 0,s):r}}function nc(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:zr(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const om=n=>it(n)&&Object.getOwnPropertyNames(n).some(t=>Jt(n[t]));function lm(n,t){const{isScriptable:e,isIndexable:i}=rl(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(Jt(o)||om(o))||a&&ct(o))return!0}return!1}var cm="4.4.5";const um=["top","bottom","left","right","chartArea"];function ic(n,t){return n==="top"||n==="bottom"||um.indexOf(n)===-1&&t==="x"}function sc(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function rc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),dt(e&&e.onComplete,[n],t)}function dm(n){const t=n.chart,e=t.options.animation;dt(e&&e.onProgress,[n],t)}function ac(n){return Wr()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Es={},oc=n=>{const t=ac(n);return Object.values(Es).filter(e=>e.canvas===t).pop()};function hm(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function fm(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function As(n,t,e){return n.options.clip?n[e]:t[e]}function gm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:As(e,t,"left"),right:As(e,t,"right"),top:As(i,t,"top"),bottom:As(i,t,"bottom")}:t}let ge=(fn=class{static register(...t){Te.add(...t),lc()}static unregister(...t){Te.remove(...t),lc()}constructor(t,e){const i=this.config=new am(e),s=ac(t),r=oc(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Ep(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=xf(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Gp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Lf(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Es[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Fe.listen(this,"complete",rc),Fe.listen(this,"progress",dm),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return J(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Te}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():fl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nl(this.canvas,this.ctx),this}stop(){return Fe.stop(this),this}resize(t,e){Fe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,fl(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),dt(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};ht(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=ea(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),ht(r,a=>{const o=a.options,l=o.id,c=ea(l,o),u=K(o.type,a.dtype);(o.position===void 0||ic(o.position,c)!==ic(a.dposition))&&(o.position=a.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=Te.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),ht(s,(a,o)=>{a||delete i[o]}),ht(i,a=>{$t.configure(this,a,a.options),$t.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(sc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||ta(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Te.getController(o),{datasetElementType:c,dataElementType:u}=xt.datasets[o];Object.assign(l,{dataElementType:Te.getElement(u),datasetElementType:c&&Te.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){ht(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||ht(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sc("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){ht(this.scales,t=>{$t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ho(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const a=i==="_removeElements"?-r:r;hm(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Ho(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$t.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],ht(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Jt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Fe.has(this)?this.attached&&!Fe.running(this)&&Fe.start(this):(this.draw(),rc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const a=e[s];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=gm(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&xi(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&_i(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Ne(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Qr.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=nn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);Qt(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Fe.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),nl(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Es[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};ht(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){ht(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},ht(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!cs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,a=e,o=this._getActiveElements(t,s,i,a),l=Sf(t),c=fm(t,this._lastEvent,i,l);i&&(this._lastEvent=null,dt(r.onHover,[t,o,this],this),l&&dt(r.onClick,[t,o,this],this));const u=!cs(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},P(fn,"defaults",xt),P(fn,"instances",Es),P(fn,"overrides",bn),P(fn,"registry",Te),P(fn,"version",cm),P(fn,"getChart",oc),fn);function lc(){return ht(ge.instances,n=>n._plugins.invalidate())}function pm(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+bt,i-bt),n.closePath(),n.clip()}function mm(n){return Fr(n,["outerStart","outerEnd","innerStart","innerEnd"])}function ym(n,t,e,i){const s=mm(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Ht(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Ht(s.innerStart,0,a),innerEnd:Ht(s.innerEnd,0,a)}}function $n(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Rs(n,t,e,i,s,r){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),h=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const q=u>0?u-i:0,j=d>0?d-i:0,N=(q+j)/2,st=N!==0?p*N/(N+i):p;g=(p-st)/2}const b=Math.max(.001,p*d-e/rt)/d,_=(p-b)/2,w=l+_+g,M=s-_-g,{outerStart:k,outerEnd:C,innerStart:S,innerEnd:O}=ym(t,h,d,M-w),D=d-k,y=d-C,x=w+k/D,T=M-C/y,A=h+S,R=h+O,L=w+S/A,F=M-O/R;if(n.beginPath(),r){const q=(x+T)/2;if(n.arc(a,o,d,x,q),n.arc(a,o,d,q,T),C>0){const B=$n(y,T,a,o);n.arc(B.x,B.y,C,T,M+bt)}const j=$n(R,M,a,o);if(n.lineTo(j.x,j.y),O>0){const B=$n(R,F,a,o);n.arc(B.x,B.y,O,M+bt,F+Math.PI)}const N=(M-O/h+(w+S/h))/2;if(n.arc(a,o,h,M-O/h,N,!0),n.arc(a,o,h,N,w+S/h,!0),S>0){const B=$n(A,L,a,o);n.arc(B.x,B.y,S,L+Math.PI,w-bt)}const st=$n(D,w,a,o);if(n.lineTo(st.x,st.y),k>0){const B=$n(D,x,a,o);n.arc(B.x,B.y,k,w-bt,x)}}else{n.moveTo(a,o);const q=Math.cos(x)*d+a,j=Math.sin(x)*d+o;n.lineTo(q,j);const N=Math.cos(T)*d+a,st=Math.sin(T)*d+o;n.lineTo(N,st)}n.closePath()}function bm(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Rs(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%yt||yt))}return Rs(n,t,e,i,l,s),n.fill(),l}function xm(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){Rs(n,t,e,i,p,s);for(let b=0;b<r;++b)n.stroke();isNaN(o)||(p=a+(o%yt||yt))}g&&pm(n,t,p),r||(Rs(n,t,e,i,p,s),n.stroke())}class Ri extends Wt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:a,distance:o}=gs(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=K(h,c-l),b=pi(a,l,c)&&l!==c,_=p>=yt||b,w=Le(o,u+g,d+g);return _&&w}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+a)/2,h=(o+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>yt?Math.floor(s/yt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(rt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,bm(e,this,u,a,o),xm(e,this,u,a,o),e.restore()}}P(Ri,"id","arc"),P(Ri,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(Ri,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(Ri,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function cc(n,t,e=t){n.lineCap=K(e.borderCapStyle,t.borderCapStyle),n.setLineDash(K(e.borderDash,t.borderDash)),n.lineDashOffset=K(e.borderDashOffset,t.borderDashOffset),n.lineJoin=K(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=K(e.borderWidth,t.borderWidth),n.strokeStyle=K(e.borderColor,t.borderColor)}function _m(n,t,e){n.lineTo(e.x,e.y)}function wm(n){return n.stepped?qf:n.tension||n.cubicInterpolationMode==="monotone"?Uf:_m}function uc(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function vm(n,t,e,i){const{points:s,options:r}=t,{count:a,start:o,loop:l,ilen:c}=uc(s,e,i),u=wm(r);let{move:d=!0,reverse:h}=i||{},g,p,b;for(g=0;g<=c;++g)p=s[(o+(h?c-g:g))%a],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,b,p,h,r.stepped),b=p);return l&&(p=s[(o+(h?c:0))%a],u(n,b,p,h,r.stepped)),!!l}function Mm(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=uc(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,g,p,b,_,w;const M=C=>(a+(c?o-C:C))%r,k=()=>{b!==_&&(n.lineTo(u,_),n.lineTo(u,b),n.lineTo(u,w))};for(l&&(g=s[M(0)],n.moveTo(g.x,g.y)),h=0;h<=o;++h){if(g=s[M(h)],g.skip)continue;const C=g.x,S=g.y,O=C|0;O===p?(S<b?b=S:S>_&&(_=S),u=(d*u+C)/++d):(k(),n.lineTo(C,S),p=O,d=0,b=_=S),w=S}k()}function na(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Mm:vm}function km(n){return n.stepped?Sg:n.tension||n.cubicInterpolationMode==="monotone"?Dg:vn}function Sm(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),cc(n,t.options),n.stroke(s)}function Dm(n,t,e,i){const{segments:s,options:r}=t,a=na(t);for(const o of s)cc(n,r,o.style),n.beginPath(),a(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Tm=typeof Path2D=="function";function Cm(n,t,e,i){Tm&&!t.options.segment?Sm(n,t,e,i):Dm(n,t,e,i)}class rn extends Wt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;yg(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ag(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,a=_l(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=km(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:h}=a[c],g=r[d],p=r[h];if(g===p){o.push(g);continue}const b=Math.abs((s-g[e])/(p[e]-g[e])),_=l(g,p,b,i.stepped);_[e]=t[e],o.push(_)}return o.length===1?o[0]:o}pathSegment(t,e,i){return na(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=na(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Cm(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(rn,"id","line"),P(rn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(rn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function dc(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Ls extends Wt{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return dc(this,e,"x",i)}inYRange(e,i){return dc(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Ne(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Nr(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(Ls,"id","point"),P(Ls,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(Ls,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function hc(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,o=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function an(n,t,e,i){return n?0:Ht(t,e,i)}function Pm(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=sl(i);return{t:an(s.top,r.top,0,e),r:an(s.right,r.right,0,t),b:an(s.bottom,r.bottom,0,e),l:an(s.left,r.left,0,t)}}function Om(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=en(s),a=Math.min(t,e),o=n.borderSkipped,l=i||it(s);return{topLeft:an(!l||o.top||o.left,r.topLeft,0,a),topRight:an(!l||o.top||o.right,r.topRight,0,a),bottomLeft:an(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:an(!l||o.bottom||o.right,r.bottomRight,0,a)}}function Em(n){const t=hc(n),e=t.right-t.left,i=t.bottom-t.top,s=Pm(n,e/2,i/2),r=Om(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function ia(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&hc(n,i);return o&&(s||Le(t,o.left,o.right))&&(r||Le(e,o.top,o.bottom))}function Am(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Rm(n,t){n.rect(t.x,t.y,t.w,t.h)}function sa(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+a,radius:n.radius}}class Is extends Wt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:a}=Em(this),o=Am(a.radius)?Wn:Rm;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,sa(a,e,r)),t.clip(),o(t,sa(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,sa(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ia(this,t,e,i)}inXRange(t,e){return ia(this,t,null,e)}inYRange(t,e){return ia(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(Is,"id","bar"),P(Is,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(Is,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Lm=Object.freeze({__proto__:null,ArcElement:Ri,BarElement:Is,LineElement:rn,PointElement:Ls});const ra=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],fc=ra.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function gc(n){return ra[n%ra.length]}function pc(n){return fc[n%fc.length]}function Im(n,t){return n.borderColor=gc(t),n.backgroundColor=pc(t),++t}function Nm(n,t){return n.backgroundColor=n.data.map(()=>gc(t++)),t}function Fm(n,t){return n.backgroundColor=n.data.map(()=>pc(t++)),t}function zm(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof ze?t=Nm(e,t):s instanceof Si?t=Fm(e,t):s&&(t=Im(e,t))}}function mc(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Bm(n){return n&&(n.borderColor||n.backgroundColor)}function Hm(){return xt.borderColor!=="rgba(0,0,0,0.1)"||xt.backgroundColor!=="rgba(0,0,0,0.1)"}var Wm={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,a=mc(i)||Bm(s)||r&&mc(r)||Hm();if(!e.forceOverride&&a)return;const o=zm(n);i.forEach(o)}};function Ym(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,h,g,p,b;for(a[l++]=n[u],d=0;d<r-2;d++){let _=0,w=0,M;const k=Math.floor((d+1)*o)+1+t,C=Math.min(Math.floor((d+2)*o)+1,e)+t,S=C-k;for(M=k;M<C;M++)_+=n[M].x,w+=n[M].y;_/=S,w/=S;const O=Math.floor(d*o)+1+t,D=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:y,y:x}=n[u];for(g=p=-1,M=O;M<D;M++)p=.5*Math.abs((y-_)*(n[M].y-x)-(y-n[M].x)*(w-x)),p>g&&(g=p,h=n[M],b=M);a[l++]=h,u=b}return a[l++]=n[c],a}function Vm(n,t,e,i){let s=0,r=0,a,o,l,c,u,d,h,g,p,b;const _=[],w=t+e-1,M=n[t].x,C=n[w].x-M;for(a=t;a<t+e;++a){o=n[a],l=(o.x-M)/C*i,c=o.y;const S=l|0;if(S===u)c<p?(p=c,d=a):c>b&&(b=c,h=a),s=(r*s+o.x)/++r;else{const O=a-1;if(!J(d)&&!J(h)){const D=Math.min(d,h),y=Math.max(d,h);D!==g&&D!==O&&_.push({...n[D],x:s}),y!==g&&y!==O&&_.push({...n[y],x:s})}a>0&&O!==g&&_.push(n[O]),_.push(o),u=S,r=0,p=b=c,d=h=g=a}}return _}function yc(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function bc(n){n.data.datasets.forEach(t=>{yc(t)})}function jm(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Ht(Ie(t,r.axis,a).lo,0,e-1)),c?s=Ht(Ie(t,r.axis,o).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var $m={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){bc(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(wi([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:h}=jm(l,c);const g=e.threshold||4*i;if(h<=g){yc(s);return}J(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let p;switch(e.algorithm){case"lttb":p=Ym(c,d,h,i,e);break;case"min-max":p=Vm(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){bc(n)}};function qm(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=oa(l,c,s);const u=aa(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const d=_l(t,u);for(const h of d){const g=aa(e,r[h.start],r[h.end],h.loop),p=xl(o,s,g);for(const b of p)a.push({source:b,target:h,start:{[e]:xc(u,g,"start",Math.max)},end:{[e]:xc(u,g,"end",Math.min)}})}}return a}function aa(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=ue(s),r=ue(r)),{property:n,start:s,end:r}}function Um(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:o})=>{o=oa(a,o,s);const l=s[a],c=s[o];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function oa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function xc(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function _c(n,t){let e=[],i=!1;return ct(n)?(i=!0,e=n):e=Um(n,t),e.length?new rn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function wc(n){return n&&n.fill!==!1}function Xm(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Mt(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function Gm(n,t,e){const i=Jm(n);if(it(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Mt(s)&&Math.floor(s)===s?Km(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Km(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Zm(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:it(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Qm(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:it(n)?i=n.value:i=t.getBaseValue(),i}function Jm(n){const t=n.options,e=t.fill;let i=K(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function ty(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=ey(t,e);o.push(_c({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)ny(s,a[u],o)}return new rn({points:s,options:{}})}function ey(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function ny(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:a,last:o,point:l}=iy(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function iy(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=a[u.start][e],h=a[u.end][e];if(Le(s,d,h)){o=s===d,l=s===h;break}}return{first:o,last:l,point:i}}class vc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:yt},t.arc(s,r,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function sy(n){const{chart:t,fill:e,line:i}=n;if(Mt(e))return ry(t,e);if(e==="stack")return ty(n);if(e==="shape")return!0;const s=ay(n);return s instanceof vc?s:_c(s,i)}function ry(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function ay(n){return(n.scale||{}).getPointPositionForValue?ly(n):oy(n)}function oy(n){const{scale:t={},fill:e}=n,i=Zm(e,t);if(Mt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function ly(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=Qm(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new vc({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function la(n,t,e){const i=sy(t),{line:s,scale:r,axis:a}=t,o=s.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(xi(n,e),cy(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:a}),_i(n))}function cy(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&(Mc(n,i,a.top),kc(n,{line:e,target:i,color:s,scale:o,property:l}),n.restore(),n.save(),Mc(n,i,a.bottom)),kc(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore()}function Mc(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],d=s[oa(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function kc(n,t){const{line:e,target:i,property:s,color:r,scale:a}=t,o=qm(e,i,s);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:h=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=h,uy(n,a,g&&aa(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let b;if(g){p?n.closePath():Sc(n,i,d,s);const _=!!i.pathSegment(n,c,{move:p,reverse:!0});b=p&&_,b||Sc(n,i,u,s)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function uy(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:a,end:o}=e||{};r==="x"&&(n.beginPath(),n.rect(a,i,o-a,s-i),n.clip())}function Sc(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var dy={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof rn&&(l={visible:n.isDatasetVisible(a),index:a,fill:Gm(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Xm(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&la(n.ctx,o,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;wc(r)&&la(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!wc(i)||e.drawTime!=="beforeDatasetDraw"||la(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Dc=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},hy=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Tc extends Wt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=dt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=kt(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=Dc(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,g=-u;return this.legendItems.forEach((p,b)=>{const _=i+e/2+r.measureText(p.text).width;(b===0||c[c.length-1]+_+2*o>a)&&(d+=u,c[c.length-(b>0?0:1)]=0,g+=u,h++),l[b]={left:0,top:g,row:h,width:_,height:s},c[c.length-1]+=_+o}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=o,h=0,g=0,p=0,b=0;return this.legendItems.forEach((_,w)=>{const{itemWidth:M,itemHeight:k}=fy(i,e,r,_,s);w>0&&g+k+2*o>u&&(d+=h+o,c.push({width:h,height:g}),p+=h+o,b++,h=g=0),l[w]={left:p,top:g,col:b,width:M,height:k},h=Math.max(h,M),g+=k+o}),d+=h,c.push({width:h,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,a=jn(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=jt(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=jt(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=jt(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=jt(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;xi(t,this),this._draw(),_i(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=xt.color,l=jn(t.rtl,this.left,this.width),c=kt(a.font),{padding:u}=a,d=c.size,h=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:b,itemHeight:_}=Dc(a,d),w=function(O,D,y){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const x=K(y.lineWidth,1);if(s.fillStyle=K(y.fillStyle,o),s.lineCap=K(y.lineCap,"butt"),s.lineDashOffset=K(y.lineDashOffset,0),s.lineJoin=K(y.lineJoin,"miter"),s.lineWidth=x,s.strokeStyle=K(y.strokeStyle,o),s.setLineDash(K(y.lineDash,[])),a.usePointStyle){const T={radius:b*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:x},A=l.xPlus(O,p/2),R=D+h;il(s,T,A,R,a.pointStyleWidth&&p)}else{const T=D+Math.max((d-b)/2,0),A=l.leftForLtr(O,p),R=en(y.borderRadius);s.beginPath(),Object.values(R).some(L=>L!==0)?Wn(s,{x:A,y:T,w:p,h:b,radius:R}):s.rect(A,T,p,b),s.fill(),x!==0&&s.stroke()}s.restore()},M=function(O,D,y){_n(s,y.text,O,D+_/2,c,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},k=this.isHorizontal(),C=this._computeTitleHeight();k?g={x:jt(r,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:g={x:this.left+u,y:jt(r,this.top+C+u,this.bottom-e[0].height),line:0},pl(this.ctx,t.textDirection);const S=_+u;this.legendItems.forEach((O,D)=>{s.strokeStyle=O.fontColor,s.fillStyle=O.fontColor;const y=s.measureText(O.text).width,x=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),T=p+h+y;let A=g.x,R=g.y;l.setWidth(this.width),k?D>0&&A+T+u>this.right&&(R=g.y+=S,g.line++,A=g.x=jt(r,this.left+u,this.right-i[g.line])):D>0&&R+S>this.bottom&&(A=g.x=A+e[g.line].width+u,g.line++,R=g.y=jt(r,this.top+C+u,this.bottom-e[g.line].height));const L=l.x(A);if(w(L,R,O),A=If(x,A+p+h,k?A+T:this.right,t.rtl),M(l.x(A),R,O),k)g.x+=T+u;else if(typeof O.text!="string"){const F=c.lineHeight;g.y+=Cc(O,F)+u}else g.y+=S}),ml(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=kt(e.font),s=Ft(e.padding);if(!e.display)return;const r=jn(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=jt(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((b,_)=>Math.max(b,_.height),0);u=c+jt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=jt(o,d,d+h);a.textAlign=r.textAlign(Er(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,_n(a,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=kt(t.font),i=Ft(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Le(t,this.left,this.right)&&Le(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Le(t,s.left,s.left+s.width)&&Le(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!my(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=hy(s,i);s&&!r&&dt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&dt(e.onHover,[t,i,this],this)}else i&&dt(e.onClick,[t,i,this],this)}}function fy(n,t,e,i,s){const r=gy(i,n,t,e),a=py(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function gy(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function py(n,t,e){let i=n;return typeof t.text!="string"&&(i=Cc(t,e)),i}function Cc(n,t){const e=n.text?n.text.length:0;return t*e}function my(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var yy={id:"legend",_element:Tc,start(n,t,e){const i=n.legend=new Tc({ctx:n.ctx,options:e,chart:n});$t.configure(n,i,e),$t.addBox(n,i)},stop(n){$t.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;$t.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Ft(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ca extends Wt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=ct(i.text)?i.text.length:1;this._padding=Ft(i.padding);const r=s*kt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:a}=this,o=a.align;let l=0,c,u,d;return this.isHorizontal()?(u=jt(o,i,r),d=e+t,c=r-i):(a.position==="left"?(u=i+t,d=jt(o,s,e),l=rt*-.5):(u=r-t,d=jt(o,e,s),l=rt*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=kt(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);_n(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Er(e.align),textBaseline:"middle",translation:[a,o]})}}function by(n,t){const e=new ca({ctx:n.ctx,options:t,chart:n});$t.configure(n,e,t),$t.addBox(n,e),n.titleBlock=e}var xy={id:"title",_element:ca,start(n,t,e){by(n,e)},stop(n){const t=n.titleBlock;$t.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;$t.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ns=new WeakMap;var _y={id:"subtitle",start(n,t,e){const i=new ca({ctx:n.ctx,options:e,chart:n});$t.configure(n,i,e),$t.addBox(n,i),Ns.set(n,i)},stop(n){$t.removeBox(n,Ns.get(n)),Ns.delete(n)},beforeUpdate(n,t,e){const i=Ns.get(n);$t.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Li={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Hn(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ce(n,t){return t&&(ct(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Be(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function wy(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Pc(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=kt(t.bodyFont),c=kt(t.titleFont),u=kt(t.footerFont),d=r.length,h=s.length,g=i.length,p=Ft(t.padding);let b=p.height,_=0,w=i.reduce((C,S)=>C+S.before.length+S.lines.length+S.after.length,0);if(w+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){const C=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;b+=g*C+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let M=0;const k=function(C){_=Math.max(_,e.measureText(C).width+M)};return e.save(),e.font=c.string,ht(n.title,k),e.font=l.string,ht(n.beforeBody.concat(n.afterBody),k),M=t.displayColors?a+2+t.boxPadding:0,ht(i,C=>{ht(C.before,k),ht(C.lines,k),ht(C.after,k)}),M=0,e.font=u.string,ht(n.footer,k),e.restore(),_+=p.width,{width:_,height:b}}function vy(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function My(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function ky(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),My(c,n,t,e)&&(c="center"),c}function Oc(n,t,e){const i=e.yAlign||t.yAlign||vy(n,e);return{xAlign:e.xAlign||t.xAlign||ky(n,t,e,i),yAlign:i}}function Sy(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Dy(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ec(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=en(a);let p=Sy(t,o);const b=Dy(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,h)+s:o==="right"&&(p+=Math.max(d,g)+s),{x:Ht(p,0,i.width-t.width),y:Ht(b,0,i.height-t.height)}}function Fs(n,t,e){const i=Ft(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ac(n){return Ce([],Be(n))}function Ty(n,t,e){return nn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Rc(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Lc={beforeTitle:Re,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Re,beforeBody:Re,beforeLabel:Re,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return J(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Re,afterBody:Re,beforeFooter:Re,footer:Re,afterFooter:Re};function te(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Lc[t].call(e,i):s}class ua extends Wt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Vr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Ty(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=te(i,"beforeTitle",this,t),r=te(i,"title",this,t),a=te(i,"afterTitle",this,t);let o=[];return o=Ce(o,Be(s)),o=Ce(o,Be(r)),o=Ce(o,Be(a)),o}getBeforeBody(t,e){return Ac(te(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return ht(t,r=>{const a={before:[],lines:[],after:[]},o=Rc(i,r);Ce(a.before,Be(te(o,"beforeLabel",this,r))),Ce(a.lines,te(o,"label",this,r)),Ce(a.after,Be(te(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Ac(te(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=te(i,"beforeFooter",this,t),r=te(i,"footer",this,t),a=te(i,"afterFooter",this,t);let o=[];return o=Ce(o,Be(s)),o=Ce(o,Be(r)),o=Ce(o,Be(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(wy(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),ht(o,u=>{const d=Rc(t.callbacks,u);s.push(te(d,"labelColor",this,u)),r.push(te(d,"labelPointStyle",this,u)),a.push(te(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=Li[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=Pc(this,i),c=Object.assign({},o,l),u=Oc(this.chart,i,c),d=Ec(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=en(o),{x:h,y:g}=t,{width:p,height:b}=e;let _,w,M,k,C,S;return r==="center"?(C=g+b/2,s==="left"?(_=h,w=_-a,k=C+a,S=C-a):(_=h+p,w=_+a,k=C-a,S=C+a),M=_):(s==="left"?w=h+Math.max(l,u)+a:s==="right"?w=h+p-Math.max(c,d)-a:w=this.caretX,r==="top"?(k=g,C=k-a,_=w-a,M=w+a):(k=g+b,C=k+a,_=w+a,M=w-a),S=k),{x1:_,x2:w,x3:M,y1:k,y2:C,y3:S}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=jn(i.rtl,this.x,this.width);for(t.x=Fs(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=kt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=kt(r.bodyFont),d=Fs(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},_=s.leftForLtr(h,c)+c/2,w=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Nr(t,b,_,w),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Nr(t,b,_,w)}else{t.lineWidth=it(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const b=s.leftForLtr(h,c),_=s.leftForLtr(s.xPlus(h,1),c-2),w=en(a.borderRadius);Object.values(w).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Wn(t,{x:b,y:p,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Wn(t,{x:_,y:p+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(_,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=kt(i.bodyFont);let h=d.lineHeight,g=0;const p=jn(i.rtl,this.x,this.width),b=function(y){e.fillText(y,p.x(t.x+g),t.y+h/2),t.y+=h+r},_=p.textAlign(a);let w,M,k,C,S,O,D;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=Fs(this,_,i),e.fillStyle=i.bodyColor,ht(this.beforeBody,b),g=o&&_!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,O=s.length;C<O;++C){for(w=s[C],M=this.labelTextColors[C],e.fillStyle=M,ht(w.before,b),k=w.lines,o&&k.length&&(this._drawColorBox(e,t,C,p,i),h=Math.max(d.lineHeight,l)),S=0,D=k.length;S<D;++S)b(k[S]),h=d.lineHeight;ht(w.after,b)}g=0,h=d.lineHeight,ht(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=jn(i.rtl,this.x,this.width);for(t.x=Fs(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=kt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:g,bottomRight:p}=en(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+d,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-h,l),e.quadraticCurveTo(o+c,l,o+c,l+h),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const a=Li[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Pc(this,t),l=Object.assign({},a,this._size),c=Oc(e,t,l),u=Ec(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ft(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),pl(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ml(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!cs(i,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!cs(a,r)||o;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=Li[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}P(ua,"positioners",Li);var zs={id:"tooltip",_element:ua,positioners:Li,afterInit(n,t,e){e&&(n.tooltip=new ua({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Lc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Cy=Object.freeze({__proto__:null,Colors:Wm,Decimation:$m,Filler:dy,Legend:yy,SubTitle:_y,Title:xy,Tooltip:zs});const Py=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Oy(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Py(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Ey=(n,t)=>n===null?null:Ht(Math.round(n),0,t);function Ic(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class da extends kn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(J(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Oy(i,t,K(e,t),this._addedLabels),Ey(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Ic.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(da,"id","category"),P(da,"defaults",{ticks:{callback:Ic}});function Ay(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,p=u-1,{min:b,max:_}=t,w=!J(a),M=!J(o),k=!J(c),C=(_-b)/(d+1);let S=Wo((_-b)/p/g)*g,O,D,y,x;if(S<1e-14&&!w&&!M)return[{value:b},{value:_}];x=Math.ceil(_/S)-Math.floor(b/S),x>p&&(S=Wo(x*S/p/g)*g),J(l)||(O=Math.pow(10,l),S=Math.ceil(S*O)/O),s==="ticks"?(D=Math.floor(b/S)*S,y=Math.ceil(_/S)*S):(D=b,y=_),w&&M&&r&&Cf((o-a)/r,S/1e3)?(x=Math.round(Math.min((o-a)/S,u)),S=(o-a)/x,D=a,y=o):k?(D=w?a:D,y=M?o:y,x=c-1,S=(y-D)/x):(x=(y-D)/S,gi(x,Math.round(x),S/1e3)?x=Math.round(x):x=Math.ceil(x));const T=Math.max(Vo(S),Vo(D));O=Math.pow(10,J(l)?T:l),D=Math.round(D*O)/O,y=Math.round(y*O)/O;let A=0;for(w&&(h&&D!==a?(e.push({value:a}),D<a&&A++,gi(Math.round((D+A*S)*O)/O,a,Nc(a,C,n))&&A++):D<a&&A++);A<x;++A){const R=Math.round((D+A*S)*O)/O;if(M&&R>o)break;e.push({value:R})}return M&&h&&y!==o?e.length&&gi(e[e.length-1].value,o,Nc(o,C,n))?e[e.length-1].value=o:e.push({value:o}):(!M||y===o)&&e.push({value:y}),e}function Nc(n,t,{horizontal:e,minRotation:i}){const s=Nt(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Bs extends kn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=De(s),c=De(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=Ay(s,r);return t.bounds==="ticks"&&Yo(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return yi(t,this.chart.options.locale,this.options.ticks.format)}}class ha extends Bs{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?t:0,this.max=Mt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Nt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(ha,"id","linear"),P(ha,"defaults",{ticks:{callback:ms.formatters.numeric}});const Ii=n=>Math.floor(Je(n)),Sn=(n,t)=>Math.pow(10,Ii(n)+t);function Fc(n){return n/Math.pow(10,Ii(n))===1}function zc(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Ry(n,t){const e=t-n;let i=Ii(e);for(;zc(n,t,i)>10;)i++;for(;zc(n,t,i)<10;)i--;return Math.min(i,Ii(n))}function Ly(n,{min:t,max:e}){t=ce(n.min,t);const i=[],s=Ii(t);let r=Ry(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=ce(n.min,Math.round((l+u+d*Math.pow(10,r))*a)/a);for(;h<e;)i.push({value:h,major:Fc(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,a=r>=0?1:a),h=Math.round((l+u+d*Math.pow(10,r))*a)/a;const g=ce(n.max,h);return i.push({value:g,major:Fc(g),significand:d}),i}class fa extends kn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Bs.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Mt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?Math.max(0,t):null,this.max=Mt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Mt(this._userMin)&&(this.min=t===Sn(this.min,0)?Sn(this.min,-1):Sn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(Sn(i,-1)),a(Sn(s,1)))),i<=0&&r(Sn(s,-1)),s<=0&&a(Sn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Ly(e,this);return t.bounds==="ticks"&&Yo(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":yi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Je(t),this._valueRange=Je(this.max)-Je(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Je(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(fa,"id","logarithmic"),P(fa,"defaults",{ticks:{callback:ms.formatters.logarithmic,major:{enabled:!0}}});function ga(n){const t=n.ticks;if(t.display&&n.display){const e=Ft(t.backdropPadding);return K(t.font&&t.font.size,xt.font.size)+e.height}return 0}function Iy(n,t,e){return e=ct(e)?e:[e],{w:$f(n,t.string,e),h:e.length*t.lineHeight}}function Bc(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Ny(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,a=n.options.pointLabels,o=a.centerPointLabels?rt/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),d=kt(c.font),h=Iy(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=ue(n.getIndexAngle(l)+o),p=Math.round(fs(g)),b=Bc(p,u.x,h.w,0,180),_=Bc(p,u.y,h.h,90,270);Fy(e,t,g,b,_)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Hy(n,i,s)}function Fy(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function zy(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(fs(ue(l.angle+bt))),u=Vy(l.y,o.h,c),d=Wy(c),h=Yy(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+o.w,bottom:u+o.h}}function By(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Ne({x:e,y:i},t)||Ne({x:e,y:r},t)||Ne({x:s,y:i},t)||Ne({x:s,y:r},t))}function Hy(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:ga(r)/2,additionalAngle:a?rt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=zy(n,u,l);i.push(d),o==="auto"&&(d.visible=By(d,c),d.visible&&(c=d))}return i}function Wy(n){return n===0||n===180?"center":n<180?"left":"right"}function Yy(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Vy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function jy(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!J(o)){const l=en(t.borderRadius),c=Ft(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=a-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Wn(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function $y(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const a=i.setContext(n.getPointLabelContext(s));jy(e,a,r);const o=kt(a.font),{x:l,y:c,textAlign:u}=r;_n(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Hc(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,yt);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function qy(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Hc(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function Uy(n,t,e){return nn(n,{label:e,index:t,type:"pointLabel"})}class Ni extends Bs{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ft(ga(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Mt(t)&&!isNaN(t)?t:0,this.max=Mt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ga(this.options))}generateTickLabels(t){Bs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=dt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Ny(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=yt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ue(t*e+Nt(i))}getDistanceFromCenterForValue(t){if(J(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(J(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Uy(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-bt+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Hc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&$y(this,a),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),p=r.setContext(h);qy(this,g,l,a,p)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=kt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Ft(c.backdropPadding);t.fillRect(-a/2-d.left,-r-u.size/2-d.top,a+d.width,u.size+d.height)}_n(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(Ni,"id","radialLinear"),P(Ni,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ms.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(Ni,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(Ni,"descriptors",{angleLines:{_fallback:"grid"}});const Hs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ee=Object.keys(Hs);function Wc(n,t){return n-t}function Yc(n,t){if(J(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),Mt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(tn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Vc(n,t,e,i){const s=ee.length;for(let r=ee.indexOf(n);r<s-1;++r){const a=Hs[ee[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return ee[r]}return ee[s-1]}function Xy(n,t,e,i,s){for(let r=ee.length-1;r>=ee.indexOf(e);r--){const a=ee[r];if(Hs[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return ee[e?ee.indexOf(e):0]}function Gy(n){for(let t=ee.indexOf(n)+1,e=ee.length;t<e;++t)if(Hs[ee[t]].common)return ee[t]}function jc(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Or(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function Ky(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function $c(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:Ky(n,i,s,e)}class Fi extends kn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Ll._date(t.adapters.date);s.init(e),fi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Yc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Mt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Mt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,a=this.max,o=Af(s,r,a);return this._unit=e.unit||(i.autoSkip?Vc(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Xy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Gy(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),$c(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ht(e,0,a),i=Ht(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||Vc(r.minUnit,e,i,this._getLabelCapacity(e)),o=K(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=tn(l)||l===!0,u={};let d=e,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h<i;h=+t.add(h,o,a),g++)jc(u,h,p);return(h===i||s.bounds==="ticks"||g===1)&&jc(u,h,p),Object.keys(u).sort(Wc).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return dt(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],h=i[e],g=c&&d&&h&&h.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Nt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,$c(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Yc(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qo(t.sort(Wc))}}P(Fi,"id","time"),P(Fi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ws(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Ie(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Ie(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class pa extends Fi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ws(e,this.min),this._tableRange=Ws(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ws(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ws(this._table,i*this._tableRange+this._minPos,!0)}}P(pa,"id","timeseries"),P(pa,"defaults",Fi.defaults);var Zy=Object.freeze({__proto__:null,CategoryScale:da,LinearScale:ha,LogarithmicScale:fa,RadialLinearScale:Ni,TimeScale:Fi,TimeSeriesScale:pa});const Qy=[ap,Lm,Cy,Zy],Jy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],tb=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],eb=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],nb=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],qc=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function ma(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?nb:eb:t.binary?tb:Jy,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let a;if(t.minimumFractionDigits!==void 0&&(a={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(a={maximumFractionDigits:t.maximumFractionDigits,...a}),n<1){const u=qc(n,t.locale,a);return r+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,a||(n=n.toPrecision(3));const l=qc(Number(n),t.locale,a),c=e[o];return r+l+i+c}const Uc=6048e5,ib=864e5,zi=6e4,qn=36e5,sb=1e3,Xc=Symbol.for("constructDateFrom");function Ot(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Xc in n?n[Xc](t):n instanceof Date?new n.constructor(t):new Date(t)}function tt(n,t){return Ot(t||n,n)}function Ys(n,t,e){const i=tt(n,e==null?void 0:e.in);return isNaN(t)?Ot((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ya(n,t,e){const i=tt(n,e==null?void 0:e.in);if(isNaN(t))return Ot(n,NaN);if(!t)return i;const s=i.getDate(),r=Ot(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ba(n,t,e){return Ot(n,+tt(n)+t)}function rb(n,t,e){return ba(n,t*qn)}let ab={};function Dn(){return ab}function Pe(n,t){var o,l,c,u;const e=Dn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=tt(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Un(n,t){return Pe(n,{...t,weekStartsOn:1})}function Gc(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ot(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Un(s),a=Ot(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Un(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Vs(n){const t=tt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Tn(n,...t){const e=Ot.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function xa(n,t){const e=tt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Kc(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=xa(i),a=xa(s),o=+r-Vs(r),l=+a-Vs(a);return Math.round((o-l)/ib)}function ob(n,t){const e=Gc(n,t),i=Ot(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Un(i)}function lb(n,t,e){const i=tt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*zi),i}function cb(n,t,e){return ya(n,t*3,e)}function ub(n,t,e){return ba(n,t*1e3)}function db(n,t,e){return Ys(n,t*7,e)}function hb(n,t,e){return ya(n,t*12,e)}function Bi(n,t){const e=+tt(n)-+tt(t);return e<0?-1:e>0?1:e}function fb(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function _a(n){return!(!fb(n)&&typeof n!="number"||isNaN(+tt(n)))}function gb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function pb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Zc(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=Qc(i,s),a=Math.abs(Kc(i,s));i.setDate(i.getDate()-r*a);const o=+(Qc(i,s)===-r),l=r*(a-o);return l===0?0:l}function Qc(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Hi(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function mb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=(+i-+s)/qn;return Hi(e==null?void 0:e.roundingMethod)(r)}function wa(n,t){return+tt(n)-+tt(t)}function yb(n,t,e){const i=wa(n,t)/zi;return Hi(e==null?void 0:e.roundingMethod)(i)}function Jc(n,t){const e=tt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function tu(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function bb(n,t){const e=tt(n,t==null?void 0:t.in);return+Jc(e,t)==+tu(e,t)}function eu(n,t,e){const[i,s,r]=Tn(e==null?void 0:e.in,n,n,t),a=Bi(s,r),o=Math.abs(gb(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=Bi(s,r)===-a;bb(i)&&o===1&&Bi(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function xb(n,t,e){const i=eu(n,t,e)/3;return Hi(e==null?void 0:e.roundingMethod)(i)}function _b(n,t,e){const i=wa(n,t)/1e3;return Hi(e==null?void 0:e.roundingMethod)(i)}function wb(n,t,e){const i=Zc(n,t,e)/7;return Hi(e==null?void 0:e.roundingMethod)(i)}function vb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=Bi(i,s),a=Math.abs(pb(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=Bi(i,s)===-r,l=r*(a-+o);return l===0?0:l}function Mb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function kb(n,t){const e=tt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Sb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function nu(n,t){const e=tt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Db(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function Tb(n,t){var o,l;const e=Dn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=tt(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Cb(n,t){const e=tt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Pb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function Ob(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const Eb={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ab=(n,t,e)=>{let i;const s=Eb[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function va(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Rb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ib={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Nb={date:va({formats:Rb,defaultWidth:"full"}),time:va({formats:Lb,defaultWidth:"full"}),dateTime:va({formats:Ib,defaultWidth:"full"})},Fb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zb=(n,t,e,i)=>Fb[n];function Wi(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Bb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Yb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Vb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},jb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},$b={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Wi({values:Bb,defaultWidth:"wide"}),quarter:Wi({values:Hb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Wi({values:Wb,defaultWidth:"wide"}),day:Wi({values:Yb,defaultWidth:"wide"}),dayPeriod:Wi({values:Vb,defaultWidth:"wide",formattingValues:jb,defaultFormattingWidth:"wide"})};function Yi(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Ub(o,d=>d.test(a)):qb(o,d=>d.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function qb(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ub(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Xb(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const Gb=/^(\d+)(th|st|nd|rd)?/i,Kb=/\d+/i,Zb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Qb={any:[/^b/i,/^(a|c)/i]},Jb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},t0={any:[/1/i,/2/i,/3/i,/4/i]},e0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},n0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},i0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},s0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},r0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},a0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},o0={ordinalNumber:Xb({matchPattern:Gb,parsePattern:Kb,valueCallback:n=>parseInt(n,10)}),era:Yi({matchPatterns:Zb,defaultMatchWidth:"wide",parsePatterns:Qb,defaultParseWidth:"any"}),quarter:Yi({matchPatterns:Jb,defaultMatchWidth:"wide",parsePatterns:t0,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Yi({matchPatterns:e0,defaultMatchWidth:"wide",parsePatterns:n0,defaultParseWidth:"any"}),day:Yi({matchPatterns:i0,defaultMatchWidth:"wide",parsePatterns:s0,defaultParseWidth:"any"}),dayPeriod:Yi({matchPatterns:r0,defaultMatchWidth:"any",parsePatterns:a0,defaultParseWidth:"any"})},iu={code:"en-US",formatDistance:Ab,formatLong:Nb,formatRelative:zb,localize:$b,match:o0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function l0(n,t){const e=tt(n,t==null?void 0:t.in);return Kc(e,nu(e))+1}function su(n,t){const e=tt(n,t==null?void 0:t.in),i=+Un(e)-+ob(e);return Math.round(i/Uc)+1}function Ma(n,t){var u,d,h,g;const e=tt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Dn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,a=Ot((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=Pe(a,t),l=Ot((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Pe(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function c0(n,t){var o,l,c,u;const e=Dn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Ma(n,t),r=Ot((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Pe(r,t)}function ru(n,t){const e=tt(n,t==null?void 0:t.in),i=+Pe(e,t)-+c0(e,t);return Math.round(i/Uc)+1}function ft(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const on={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return ft(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):ft(e+1,2)},d(n,t){return ft(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return ft(n.getHours()%12||12,t.length)},H(n,t){return ft(n.getHours(),t.length)},m(n,t){return ft(n.getMinutes(),t.length)},s(n,t){return ft(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return ft(s,t.length)}},Xn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},au={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return on.y(n,t)},Y:function(n,t,e,i){const s=Ma(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return ft(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):ft(r,t.length)},R:function(n,t){const e=Gc(n);return ft(e,t.length)},u:function(n,t){const e=n.getFullYear();return ft(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ft(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ft(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return on.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return ft(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ru(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):ft(s,t.length)},I:function(n,t,e){const i=su(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ft(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):on.d(n,t)},D:function(n,t,e){const i=l0(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ft(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return ft(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return ft(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ft(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Xn.noon:i===0?s=Xn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Xn.evening:i>=12?s=Xn.afternoon:i>=4?s=Xn.morning:s=Xn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return on.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):on.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):on.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):on.s(n,t)},S:function(n,t){return on.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return lu(i);case"XXXX":case"XX":return Cn(i);case"XXXXX":case"XXX":default:return Cn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return lu(i);case"xxxx":case"xx":return Cn(i);case"xxxxx":case"xxx":default:return Cn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ou(i,":");case"OOOO":default:return"GMT"+Cn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ou(i,":");case"zzzz":default:return"GMT"+Cn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return ft(i,t.length)},T:function(n,t,e){return ft(+n,t.length)}};function ou(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+ft(r,2)}function lu(n,t){return n%60===0?(n>0?"-":"+")+ft(Math.abs(n)/60,2):Cn(n,t)}function Cn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=ft(Math.trunc(i/60),2),r=ft(i%60,2);return e+s+t+r}const cu=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},uu=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ka={p:uu,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return cu(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",cu(i,t)).replace("{{time}}",uu(s,t))}},u0=/^D+$/,d0=/^Y+$/,h0=["D","DD","YY","YYYY"];function du(n){return u0.test(n)}function hu(n){return d0.test(n)}function Sa(n,t,e){const i=f0(n,t,e);if(console.warn(i),h0.includes(n))throw new RangeError(i)}function f0(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const g0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,p0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,m0=/^'([^]*?)'?$/,y0=/''/g,b0=/[a-zA-Z]/;function fu(n,t,e){var u,d,h,g,p,b,_,w;const i=Dn(),s=(e==null?void 0:e.locale)??i.locale??iu,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,a=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((w=(_=i.locale)==null?void 0:_.options)==null?void 0:w.weekStartsOn)??0,o=tt(n,e==null?void 0:e.in);if(!_a(o))throw new RangeError("Invalid time value");let l=t.match(p0).map(M=>{const k=M[0];if(k==="p"||k==="P"){const C=ka[k];return C(M,s.formatLong)}return M}).join("").match(g0).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:x0(M)};if(au[k])return{isToken:!0,value:M};if(k.match(b0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&hu(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&du(k))&&Sa(k,t,String(n));const C=au[k[0]];return C(o,k,s.localize,c)}).join("")}function x0(n){const t=n.match(m0);return t?t[1].replace(y0,"'"):n}function gu(){return Object.assign({},Dn())}function _0(n,t){const e=tt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function w0(n,t){const e=v0(t)?new t(0):Ot(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function v0(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const M0=10;class pu{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class k0 extends pu{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class S0 extends pu{constructor(e,i){super();P(this,"priority",M0);P(this,"subPriority",-1);this.context=e||(s=>Ot(i,s))}set(e,i){return i.timestampIsSet?e:Ot(e,w0(e,this.context))}}class ot{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new k0(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class D0 extends ot{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Lt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Oe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function It(n,t){return n&&{value:t(n.value),rest:n.rest}}function Tt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ee(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*qn+r*zi+a*sb),rest:t.slice(e[0].length)}}function mu(n){return Tt(Lt.anyDigitsSigned,n)}function Et(n,t){switch(n){case 1:return Tt(Lt.singleDigit,t);case 2:return Tt(Lt.twoDigits,t);case 3:return Tt(Lt.threeDigits,t);case 4:return Tt(Lt.fourDigits,t);default:return Tt(new RegExp("^\\d{1,"+n+"}"),t)}}function js(n,t){switch(n){case 1:return Tt(Lt.singleDigitSigned,t);case 2:return Tt(Lt.twoDigitsSigned,t);case 3:return Tt(Lt.threeDigitsSigned,t);case 4:return Tt(Lt.fourDigitsSigned,t);default:return Tt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Da(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function yu(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function bu(n){return n%400===0||n%4===0&&n%100!==0}class T0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return It(Et(4,e),r);case"yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Et(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const o=yu(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class C0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return It(Et(4,e),r);case"Yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Et(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Ma(e,r);if(s.isTwoDigitYear){const l=yu(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Pe(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Pe(e,r)}}class P0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return js(i==="R"?4:i.length,e)}set(e,i,s){const r=Ot(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Un(r)}}class O0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return js(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class E0 extends ot{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Et(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class A0 extends ot{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Et(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class R0 extends ot{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return It(Tt(Lt.month,e),r);case"MM":return It(Et(2,e),r);case"Mo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class L0 extends ot{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return It(Tt(Lt.month,e),r);case"LL":return It(Et(2,e),r);case"Lo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function I0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=ru(i,e)-t;return i.setDate(i.getDate()-s*7),tt(i,e==null?void 0:e.in)}class N0 extends ot{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Tt(Lt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Pe(I0(e,s,r),r)}}function F0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=su(i,e)-t;return i.setDate(i.getDate()-s*7),i}class z0 extends ot{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Tt(Lt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return Un(F0(e,s))}}const B0=[31,28,31,30,31,30,31,31,30,31,30,31],H0=[31,29,31,30,31,30,31,31,30,31,30,31];class W0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Tt(Lt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Et(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=bu(s),a=e.getMonth();return r?i>=1&&i<=H0[a]:i>=1&&i<=B0[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Y0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Tt(Lt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Et(i.length,e)}}validate(e,i){const s=e.getFullYear();return bu(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Ta(n,t,e){var d,h,g,p;const i=Dn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=tt(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Ys(r,u,e)}class V0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}class j0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return It(Et(i.length,e),a);case"eo":return It(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}class $0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return It(Et(i.length,e),a);case"co":return It(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}function q0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=_0(i,e),r=t-s;return Ys(i,r,e)}class U0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Et(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return It(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return It(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return It(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return It(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=q0(e,s),e.setHours(0,0,0,0),e}}class X0 extends ot{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class G0 extends ot{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class K0 extends ot{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class Z0 extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Tt(Lt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class Q0 extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Tt(Lt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class J0 extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Tt(Lt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class tx extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Tt(Lt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class ex extends ot{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Tt(Lt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class nx extends ot{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Tt(Lt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class ix extends ot{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return It(Et(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class sx extends ot{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ee(Oe.basicOptionalMinutes,e);case"XX":return Ee(Oe.basic,e);case"XXXX":return Ee(Oe.basicOptionalSeconds,e);case"XXXXX":return Ee(Oe.extendedOptionalSeconds,e);case"XXX":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ot(e,e.getTime()-Vs(e)-s)}}class rx extends ot{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ee(Oe.basicOptionalMinutes,e);case"xx":return Ee(Oe.basic,e);case"xxxx":return Ee(Oe.basicOptionalSeconds,e);case"xxxxx":return Ee(Oe.extendedOptionalSeconds,e);case"xxx":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ot(e,e.getTime()-Vs(e)-s)}}class ax extends ot{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return mu(e)}set(e,i,s){return[Ot(e,s*1e3),{timestampIsSet:!0}]}}class ox extends ot{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return mu(e)}set(e,i,s){return[Ot(e,s),{timestampIsSet:!0}]}}const lx={G:new D0,y:new T0,Y:new C0,R:new P0,u:new O0,Q:new E0,q:new A0,M:new R0,L:new L0,w:new N0,I:new z0,d:new W0,D:new Y0,E:new V0,e:new j0,c:new $0,i:new U0,a:new X0,b:new G0,B:new K0,h:new Z0,H:new Q0,K:new J0,k:new tx,m:new ex,s:new nx,S:new ix,X:new sx,x:new rx,t:new ax,T:new ox},cx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ux=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dx=/^'([^]*?)'?$/,hx=/''/g,fx=/\S/,gx=/[a-zA-Z]/;function px(n,t,e,i){var _,w,M,k,C,S,O,D;const s=()=>Ot((i==null?void 0:i.in)||e,NaN),r=gu(),a=(i==null?void 0:i.locale)??r.locale??iu,o=(i==null?void 0:i.firstWeekContainsDate)??((w=(_=i==null?void 0:i.locale)==null?void 0:_.options)==null?void 0:w.firstWeekContainsDate)??r.firstWeekContainsDate??((k=(M=r.locale)==null?void 0:M.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((S=(C=i==null?void 0:i.locale)==null?void 0:C.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((D=(O=r.locale)==null?void 0:O.options)==null?void 0:D.weekStartsOn)??0;if(!t)return n?s():tt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new S0(i==null?void 0:i.in,e)],d=t.match(ux).map(y=>{const x=y[0];if(x in ka){const T=ka[x];return T(y,a.formatLong)}return y}).join("").match(cx),h=[];for(let y of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&hu(y)&&Sa(y,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&du(y)&&Sa(y,t,n);const x=y[0],T=lx[x];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const L=h.find(F=>A.includes(F.token)||F.token===x);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${y}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);h.push({token:x,fullToken:y});const R=T.run(n,y,a.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(x.match(gx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");if(y==="''"?y="'":x==="'"&&(y=mx(y)),n.indexOf(y)===0)n=n.slice(y.length);else return s()}}if(n.length>0&&fx.test(n))return s();const g=u.map(y=>y.priority).sort((y,x)=>x-y).filter((y,x,T)=>T.indexOf(y)===x).map(y=>u.filter(x=>x.priority===y).sort((x,T)=>T.subPriority-x.subPriority)).map(y=>y[0]);let p=tt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const y of g){if(!y.validate(p,c))return s();const x=y.set(p,b,c);Array.isArray(x)?(p=x[0],Object.assign(b,x[1])):p=x}return p}function mx(n){return n.match(dx)[1].replace(hx,"'")}function yx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function bx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function xx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function _x(n){const t=n/qn;return Math.trunc(t)}function xu(n,t){const e=()=>Ot(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=kx(n);let r;if(s.date){const c=Sx(s.date,i);r=Dx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=Tx(s.time),isNaN(o)))return e();if(s.timezone){if(l=Cx(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=tt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return tt(a+o+l,t==null?void 0:t.in)}const $s={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},wx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Mx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function kx(n){const t={},e=n.split($s.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],$s.timeZoneDelimiter.test(t.date)&&(t.date=n.split($s.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=$s.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Sx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Dx(n,t){if(t===null)return new Date(NaN);const e=n.match(wx);if(!e)return new Date(NaN);const i=!!e[4],s=Vi(e[1]),r=Vi(e[2])-1,a=Vi(e[3]),o=Vi(e[4]),l=Vi(e[5])-1;if(i)return Rx(t,o,l)?Px(t,o,l):new Date(NaN);{const c=new Date(0);return!Ex(t,r,a)||!Ax(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Vi(n){return n?parseInt(n):1}function Tx(n){const t=n.match(vx);if(!t)return NaN;const e=Ca(t[1]),i=Ca(t[2]),s=Ca(t[3]);return Lx(e,i,s)?e*qn+i*zi+s*1e3:NaN}function Ca(n){return n&&parseFloat(n.replace(",","."))||0}function Cx(n){if(n==="Z")return 0;const t=n.match(Mx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Ix(i,s)?e*(i*qn+s*zi):NaN}function Px(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Ox=[31,null,31,30,31,30,31,31,30,31,30,31];function _u(n){return n%400===0||n%4===0&&n%100!==0}function Ex(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Ox[t]||(_u(n)?29:28))}function Ax(n,t){return t>=1&&t<=(_u(n)?366:365)}function Rx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Lx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Ix(n,t){return t>=0&&t<=59}const Pa=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((a,o)=>o.rawValue-a.rawValue);if(e.body&&!n.locked){const a=e.labelColors,o=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","doughnut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(h)?h:ma(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?qs.format(h):qs.format(Number(h.toFixed(vu)))} ${b}`}const p=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:a[d].backgroundColor,borderColor:a[d].borderColor,label:p,value:g,rawValue:h}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Nx=n=>n&&n.datasets&&n.datasets.length,Fx=n=>Nx(n)&&n.datasets.some(t=>t.data.length),zx=n=>Fx(n)&&n.datasets.some(t=>t.data.length>1),Bx=n=>zx(n)&&n.datasets.some(t=>t.data[0]&&_a(t.data[0].x)),Hx=n=>Bx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Oa=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},Wx=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function wu(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const vu=2,Mu=10,ku=12,qs=new Intl.NumberFormat(((Lh=document==null?void 0:document.documentElement)==null?void 0:Lh.lang)||"en-US"),Us=10,Su={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},He=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Gn=(n,t)=>(t||He)[n%He.length],Du=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},Tu="#6f7787",Cu={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},Yx=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Cu[t])==null?void 0:e.background)||"#fafafa"},Vx={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},jx={"4XX":"#FFBA81","5XX":"#FF8484"},$x={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},qx="#dad4c7",Ux=n=>{const t=Object.entries(Su).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Su.standard},Xx={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Gx=2,Kx=0,Ea=new Map,Aa=(n,t)=>t==="bytes"?ma(n):t==="count/minute"?n.toFixed(2):qs.format(n),Pu=n=>{const e=document.createElement("canvas").getContext("2d"),i=kt({});return e.font=i.string,e.measureText(n).width},Zx=()=>{const n="label_height";if(!Ea.has(n)){const t=kt({});Ea.set(n,t.lineHeight)}return Ea.get(n)},Qx=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),Ou=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),Eu=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ra="#e0e4ea",Jx={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},ji=(n,t)=>{let e=1;const i=Jx[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},Au=new Map([[100,ji("100",[100,101,102,103])],[200,ji("200",[200,201,202,203,204,205,206,207,208,226])],[300,ji("300",[300,301,302,303,304,305,307,308])],[400,ji("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,ji("500",[500,501,502,503,504,505,506,507,508,510,511])]]),La=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=Au.get(e);return i===void 0?Ra:i.get(t)??i.get(-1)??Ra},t_=n=>{const t=La(n);return{solid:t,light:t}},Xs={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=La(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function e_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};zs.positioners.barChartTooltipPosition=function(s,r){if(!s.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=a.width/2,c=Oa(r,o,l),u=r.y,d=r.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},Qr.modes.customInteractionMode=function(s,r){const a=sn(r,s),o=[];return Qr.evaluateInteractionItems(s,s.options.indexAxis||"x",a,(l,c,u)=>{s.options.indexAxis==="y"&&l.inYRange(a.y,!0)&&s.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),s.options.indexAxis==="x"&&l.inXRange(a.x,!0)&&s.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?Mu:ku;return f.computed(()=>{var s,r,a,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(h,g){const p=this;if(p.chart.options.indexAxis===p.axis){h=p.getLabelForValue(g);const b=10;return h&&h.length>b?h.slice(0,b)+"...":h}return p.getLabelForValue(Number(h))}},title:{display:n.indexAxis==="y"?!J((s=n.metricAxesTitle)==null?void 0:s.value):!J((r=n.dimensionAxesTitle)==null?void 0:r.value),text:n.indexAxis==="y"?(a=n.metricAxesTitle)==null?void 0:a.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(h,g){const p=this;return p.chart.options.indexAxis===p.axis?(h=p.getLabelForValue(g),h&&h.length>Us?h.slice(0,Us)+"...":h):p.getLabelForValue(Number(h))}},title:{display:n.indexAxis==="x"?!J((l=n.metricAxesTitle)==null?void 0:l.value):!J((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:h=>{Pa(n.tooltipState,h)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}ge.register(...Qy);const n_=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function i_(n,t,e,i,s){const r=f.shallowRef(null),a=(o,l)=>{if(t.value)return new ge(t.value,{type:n,data:o,plugins:i,options:l})};return f.onMounted(()=>{r.value=a(e.value,s.value)}),f.onBeforeUnmount(()=>{J(r.value)||r.value.destroy()}),f.watch(e,(o,l)=>{if(n_(l,o)&&!J(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else J(r.value)||r.value.destroy(),r.value=a(o,s.value)}),f.watch(t,()=>{J(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),f.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(J(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ia(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ru={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,b){b&&b%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<a?d=e(c,r,u)+"m":c<o?d=t(e(c,a,u),u)+"b":d=t(e(c,o,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Ru);var s_=Ru.exports;const $i=Ia(s_);function r_(n,t,e){const{i18n:i}=ut.useI18n(),{translateUnit:s}=ut.useTranslatedUnits();return{legendValues:f.computed(()=>n.value.datasets.reduce((a,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":ma(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:$i(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${$i(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...a,[o.label]:{raw:l,formatted:c,isThreshold:o.isThreshold}}},{}))}}var a_=Object.defineProperty,o_=(n,t,e)=>t in n?a_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,we=(n,t,e)=>o_(n,typeof t!="symbol"?t+"":t,e),Ct=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(Ct||{});const l_=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],qi=n=>n.filter(t=>t!=="time"),Lu=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],c_=qi(Lu),u_=[...Lu,"application","consumer","iso_code"],d_=qi(u_),h_=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],f_=qi(h_);qi(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),qi(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(c_),new Set(d_),new Set(f_);const Iu=6048e5,g_=864e5,p_=60,m_=3600,Nu=Symbol.for("constructDateFrom");function pe(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Nu in n?n[Nu](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ut(n,t){return pe(t||n,n)}function Fu(n,t,e){const i=Ut(n,void 0);return isNaN(t)?pe(n,NaN):(i.setDate(i.getDate()+t),i)}function y_(n,t,e){const i=Ut(n,void 0);if(isNaN(t))return pe(n,NaN);const s=i.getDate(),r=pe(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let b_={};function Ui(){return b_}function We(n,t){var e,i,s,r;const a=Ui(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=Ut(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Gs(n,t){return We(n,{...t,weekStartsOn:1})}function zu(n,t){const e=Ut(n,void 0),i=e.getFullYear(),s=pe(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Gs(s),a=pe(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Gs(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Bu(n){const t=Ut(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function x_(n,...t){const e=pe.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ks(n,t){const e=Ut(n,void 0);return e.setHours(0,0,0,0),e}function __(n,t,e){const[i,s]=x_(void 0,n,t),r=Ks(i),a=Ks(s),o=+r-Bu(r),l=+a-Bu(a);return Math.round((o-l)/g_)}function w_(n,t){const e=zu(n),i=pe(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Gs(i)}function v_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function M_(n){return!(!v_(n)&&typeof n!="number"||isNaN(+Ut(n)))}function Kn(n,t){const e=Ut(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function k_(n,t){const e=Ut(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const S_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},D_=(n,t,e)=>{let i;const s=S_[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Na(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const T_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},C_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},P_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},O_={date:Na({formats:T_,defaultWidth:"full"}),time:Na({formats:C_,defaultWidth:"full"}),dateTime:Na({formats:P_,defaultWidth:"full"})},E_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},A_=(n,t,e,i)=>E_[n];function Xi(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const R_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},L_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},I_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},N_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},F_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},z_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},B_=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},H_={ordinalNumber:B_,era:Xi({values:R_,defaultWidth:"wide"}),quarter:Xi({values:L_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Xi({values:I_,defaultWidth:"wide"}),day:Xi({values:N_,defaultWidth:"wide"}),dayPeriod:Xi({values:F_,defaultWidth:"wide",formattingValues:z_,defaultFormattingWidth:"wide"})};function Gi(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Y_(o,d=>d.test(a)):W_(o,d=>d.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function W_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Y_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function V_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const j_=/^(\d+)(th|st|nd|rd)?/i,$_=/\d+/i,q_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},U_={any:[/^b/i,/^(a|c)/i]},X_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},G_={any:[/1/i,/2/i,/3/i,/4/i]},K_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Z_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Q_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},J_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},tw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ew={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nw={ordinalNumber:V_({matchPattern:j_,parsePattern:$_,valueCallback:n=>parseInt(n,10)}),era:Gi({matchPatterns:q_,defaultMatchWidth:"wide",parsePatterns:U_,defaultParseWidth:"any"}),quarter:Gi({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:G_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Gi({matchPatterns:K_,defaultMatchWidth:"wide",parsePatterns:Z_,defaultParseWidth:"any"}),day:Gi({matchPatterns:Q_,defaultMatchWidth:"wide",parsePatterns:J_,defaultParseWidth:"any"}),dayPeriod:Gi({matchPatterns:tw,defaultMatchWidth:"any",parsePatterns:ew,defaultParseWidth:"any"})},iw={code:"en-US",formatDistance:D_,formatLong:O_,formatRelative:A_,localize:H_,match:nw,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sw(n,t){const e=Ut(n,void 0);return __(e,k_(e))+1}function rw(n,t){const e=Ut(n,void 0),i=+Gs(e)-+w_(e);return Math.round(i/Iu)+1}function Hu(n,t){var e,i,s,r;const a=Ut(n,t==null?void 0:t.in),o=a.getFullYear(),l=Ui(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=pe((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=We(u,t),h=pe((t==null?void 0:t.in)||n,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const g=We(h,t);return+a>=+d?o+1:+a>=+g?o:o-1}function aw(n,t){var e,i,s,r;const a=Ui(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Hu(n,t),c=pe((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),We(c,t)}function ow(n,t){const e=Ut(n,t==null?void 0:t.in),i=+We(e,t)-+aw(e,t);return Math.round(i/Iu)+1}function gt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const ln={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return gt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):gt(e+1,2)},d(n,t){return gt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return gt(n.getHours()%12||12,t.length)},H(n,t){return gt(n.getHours(),t.length)},m(n,t){return gt(n.getMinutes(),t.length)},s(n,t){return gt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return gt(s,t.length)}},Zn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wu={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return ln.y(n,t)},Y:function(n,t,e,i){const s=Hu(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return gt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):gt(r,t.length)},R:function(n,t){const e=zu(n);return gt(e,t.length)},u:function(n,t){const e=n.getFullYear();return gt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return gt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return gt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return ln.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return gt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ow(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):gt(s,t.length)},I:function(n,t,e){const i=rw(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):gt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):ln.d(n,t)},D:function(n,t,e){const i=sw(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):gt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return gt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return gt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return gt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Zn.noon:i===0?s=Zn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Zn.evening:i>=12?s=Zn.afternoon:i>=4?s=Zn.morning:s=Zn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return ln.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):ln.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):gt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):gt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):ln.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):ln.s(n,t)},S:function(n,t){return ln.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Vu(i);case"XXXX":case"XX":return Pn(i);case"XXXXX":case"XXX":default:return Pn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Vu(i);case"xxxx":case"xx":return Pn(i);case"xxxxx":case"xxx":default:return Pn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Yu(i,":");case"OOOO":default:return"GMT"+Pn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Yu(i,":");case"zzzz":default:return"GMT"+Pn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return gt(i,t.length)},T:function(n,t,e){return gt(+n,t.length)}};function Yu(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+gt(r,2)}function Vu(n,t){return n%60===0?(n>0?"-":"+")+gt(Math.abs(n)/60,2):Pn(n,t)}function Pn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=gt(Math.trunc(i/60),2),r=gt(i%60,2);return e+s+t+r}const ju=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$u=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lw=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return ju(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",ju(i,t)).replace("{{time}}",$u(s,t))},cw={p:$u,P:lw},uw=/^D+$/,dw=/^Y+$/,hw=["D","DD","YY","YYYY"];function fw(n){return uw.test(n)}function gw(n){return dw.test(n)}function pw(n,t,e){const i=mw(n,t,e);if(console.warn(i),hw.includes(n))throw new RangeError(i)}function mw(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const yw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xw=/^'([^]*?)'?$/,_w=/''/g,ww=/[a-zA-Z]/;function vw(n,t,e){var i,s,r,a,o,l,c,u;const d=Ui(),h=(e==null?void 0:e.locale)??d.locale??iw,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(r=d.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,b=Ut(n,e==null?void 0:e.in);if(!M_(b))throw new RangeError("Invalid time value");let _=t.match(bw).map(M=>{const k=M[0];if(k==="p"||k==="P"){const C=cw[k];return C(M,h.formatLong)}return M}).join("").match(yw).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:Mw(M)};if(Wu[k])return{isToken:!0,value:M};if(k.match(ww))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});h.localize.preprocessor&&(_=h.localize.preprocessor(b,_));const w={firstWeekContainsDate:g,weekStartsOn:p,locale:h};return _.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&gw(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&fw(k))&&pw(k,t,String(n));const C=Wu[k[0]];return C(b,k,h.localize,w)}).join("")}function Mw(n){const t=n.match(xw);return t?t[1].replace(_w,"'"):n}function kw(n,t){const e=Ut(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=pe(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function Sw(){return Object.assign({},Ui())}function Dw(n){return Math.trunc(n*m_)}function Tw(n){const t=n/p_;return Math.trunc(t)}function qu(n,t,e){return y_(n,-t)}function Uu(n,t,e){const i=Sw(),s=Ow(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Cw(s,t):Pw(s,t)}function Cw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Pw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Ow(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Ew(n,t){const e=Nw(t);return"formatToParts"in e?Rw(e,n):Lw(e,n)}const Aw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Rw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Aw[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Lw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Fa={},Xu=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Iw=Xu==="06/25/2014, 00:00:00"||Xu==="06/25/2014 00:00:00";function Nw(n){return Fa[n]||(Fa[n]=Iw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Fa[n]}function za(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Gu=36e5,Fw=6e4,Ba={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ki(n,t,e){if(!n)return 0;let i=Ba.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ba.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ku(s)?-(s*Gu):NaN;if(i=Ba.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Ku(s,a)?(r=Math.abs(s)*Gu+a*Fw,i[1]==="+"?-r:r):NaN}if(Hw(n)){t=new Date(t||Date.now());const a=e?t:zw(t),o=Ha(a,n);return-(e?o:Bw(t,o,n))}return NaN}function zw(n){return za(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ha(n,t){const e=Ew(n,t),i=za(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Bw(n,t,e){let i=n.getTime()-t;const s=Ha(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ha(new Date(i),e);return s===r?s:Math.max(s,r)}function Ku(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Zu={};function Hw(n){if(Zu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Zu[n]=!0,!0}catch{return!1}}const Ww=60*1e3,Yw={X:function(n,t,e){const i=Wa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Qu(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=Wa(e.timeZone,n);switch(t){case"x":return Qu(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=Wa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Vw(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Uu("short",n,e);case"zzzz":default:return Uu("long",n,e)}}};function Wa(n,t){const e=n?Ki(n,t,!0)/Ww:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Zs(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Zs(Math.floor(i/60),2),r=Zs(Math.floor(i%60),2);return e+s+t+r}function Qu(n,t){return n%60===0?(n>0?"-":"+")+Zs(Math.abs(n)/60,2):Qn(n,t)}function Vw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Zs(r,2)}function Ju(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const td=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ya=36e5,ed=6e4,jw=2,Xt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:td};function Qs(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?jw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=$w(n),{year:s,restDateString:r}=qw(i.date,e),a=Uw(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=Xw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ki(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Ju(new Date(o+l)),c=Ju(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function $w(n){const t={};let e=Xt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Xt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function qw(n,t){if(n){const e=Xt.YYY[t],i=Xt.YYYYY[t];let s=Xt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Xt.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Uw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=Xt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,sd(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Xt.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return Zw(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=Xt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return sd(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=Xt.Www.exec(n),r)return s=parseInt(r[1],10)-1,rd(s)?nd(t,s):new Date(NaN);if(r=Xt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return rd(s,a)?nd(t,s,a):new Date(NaN)}return null}function Xw(n){let t,e,i=Xt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Va(t)?t%24*Ya:NaN;if(i=Xt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Va(t,e)?t%24*Ya+e*ed:NaN;if(i=Xt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Va(t,e,s)?t%24*Ya+e*ed+s*1e3:NaN}return null}function nd(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Gw=[31,28,31,30,31,30,31,31,30,31,30,31],Kw=[31,29,31,30,31,30,31,31,30,31,30,31];function id(n){return n%400===0||n%4===0&&n%100!==0}function sd(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=id(n);if(i&&e>Kw[t]||!i&&e>Gw[t])return!1}return!0}function Zw(n,t){if(t<1)return!1;const e=id(n);return!(e&&t>366||!e&&t>365)}function rd(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Va(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Qw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Jw(n,t,e={}){t=String(t);const i=t.match(Qw);if(i){const s=Qs(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+Yw[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return vw(n,t,e)}function ad(n,t,e){n=Qs(n,e);const i=Ki(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function t1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Jw(ad(n,t,{timeZone:i.timeZone}),e,i)}function e1(n,t,e){if(typeof n=="string"&&!n.match(td))return Qs(n,{...e,timeZone:t});n=Qs(n,e);const i=za(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ki(t,new Date(i));return new Date(i+s)}function n1(n,t){return-Ki(n,t)}function ja(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return t1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const i1={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function $a(n){return n&&l_.find(t=>n<=i1[t])||null}const Jn=(n,t)=>new Date(n.getTime()-n1(t,n));class ve{constructor(t){we(this,"timeframeText"),we(this,"key"),we(this,"display"),we(this,"timeframeLength"),we(this,"allowedTiers"),we(this,"defaultResponseGranularity"),we(this,"dataGranularity"),we(this,"isRelative"),we(this,"_startCustom"),we(this,"_endCustom"),we(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=e1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return ad(e,t)}}class s1 extends ve{rawStart(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Jn(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class r1 extends ve{rawStart(t){let e=Kn(this.tzAdjustedDate(t));return t&&(e=Jn(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class a1 extends ve{rawEnd(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Jn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=We(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Jn(i,t)),i}}class o1 extends ve{rawEnd(t){let e=Kn(this.tzAdjustedDate(t));return t&&(e=Jn(e,t)),e}rawStart(t){let e=Kn(qu(this.tzAdjustedDate(t),1));return t&&(e=Jn(e,t)),e}}Ct.FIFTEEN_MIN,new ve({key:Ct.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),Ct.ONE_HOUR,new ve({key:Ct.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),Ct.SIX_HOUR,new ve({key:Ct.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely"]}),Ct.TWELVE_HOUR,new ve({key:Ct.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.ONE_DAY,new ve({key:Ct.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.SEVEN_DAY,new ve({key:Ct.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Ct.THIRTY_DAY,new ve({key:Ct.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Ct.CURRENT_WEEK,new s1({key:Ct.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=We(new Date,{weekStartsOn:1});return(Ks(Fu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Ct.CURRENT_MONTH,new r1({key:Ct.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Kn(new Date);return(Ks(Fu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Ct.PREVIOUS_WEEK,new a1({key:Ct.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Ct.PREVIOUS_MONTH,new o1({key:Ct.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Kn(new Date),e=Kn(qu(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=l1(t,e)),60*60*24*kw(new Date().setMonth(new Date().getMonth()-1))+Dw(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function l1(n,t){return Tw(n.getTimezoneOffset()-t.getTimezoneOffset())}function c1(n){return f.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${ja(e)} - ${ja(i,{includeTZ:!0})}`:""})}function u1(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return zs.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),a=n.tooltipState.width||this.width,o=r.width/2,l=Oa(s,a,o),c=s.y,u=s.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Pa(n.tooltipState,i)}}}}))}}function d1(n){const t=f.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!J((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}}}}),e=f.computed(()=>{var l,c;return{title:{display:!J((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};zs.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,h=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,b=Oa(c,d,g);let _=Wx(c,h,p);const w=c.y<p?"top":"bottom",M=c.x<g?"left":"center";return h>u.height&&(_=0),{x:b,y:_,xAlign:M,yAlign:w}};const s=f.computed(()=>{switch(n.granularity.value){case"minutely":return"minute";case"hourly":return"hour";case"daily":return"day";default:return"day"}}),r=f.computed(()=>_x(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),a=f.computed(()=>["daily","weekly"].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:f.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:s.value,displayFormats:{minute:"h:mm:ss a",hour:r.value,day:a.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{Pa(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function h1(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=ut.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Gn(i.indexOf(u),He),data:a.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h={},g=Array.isArray(o)?Gn(d,o):o[u.name]||Gn(d);return h[u.name]=g,{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:g,data:a.map(p=>r[`${p.id},${u.id}`]||null)}})}function f1(n,t){const{i18n:e}=ut.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0;if(!s.length||!a)return{datasets:[],labels:[]};const u=c&&o||a,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(D=>a.map((y,x)=>{const T=D.event[d],A=c?`${T},${y}`:`${x},${y}`,R=D.event[y];return[A,R]})):s.map(D=>{const y=c?`${D.event[d]},${D.event[h]}`:`${d},${h}`,x=D.event[a[0]];return[y,x]})),p=Object.keys(g).reduce((D,y)=>{const[x]=y.split(","),T=g[y];return D[x]?D[x]+=T:D[x]=T,D},{}),b=Object.entries(p).sort(([,D],[,y])=>Number(y)-Number(D)).map(([D])=>D),_=r[d],w=r[h],M=c&&_&&Object.entries(_).map(([D,y])=>({id:D,name:y.name}))||a.map(D=>({id:D,name:D})),k=c&&w&&Object.entries(w).map(([D,y])=>({id:D,name:y.name}))||a.map(D=>({id:D,name:D}));if(d!=="status_code"&&d!=="status_code_grouped"&&(M.sort((D,y)=>b.indexOf(D.id)-b.indexOf(y.id)),k.sort((D,y)=>b.indexOf(D.id)-b.indexOf(y.id))),!M||!k)return{labels:[],datasets:[]};const C=h1({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:u,barSegmentLabels:k,pivotRecords:g,rowLabels:M,colorPalette:n.colorPalette||He});return{labels:c?M.map(D=>e&&e.te(`chartLabels.${D.name}`)&&e.t(`chartLabels.${D.name}`)||D.name):a.map(D=>e&&e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||D),datasets:C}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const g1="#6c7489",p1="#6c7489",m1="#995c00",y1="20px",od="24px",b1="40px",x1="48px",_1=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),w1=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return xu(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},v1=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return _1(o,l,e)};function M1(n,t){const{i18n:e}=ut.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],d=r[u],h=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||a.map(S=>({id:S,name:S})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=w1(o),b=v1(o,l,g,p,s),_=new Set,w=s!=null&&s.length?s.reduce((S,O)=>{const D=new Date(O.timestamp).valueOf(),y=O.event;for(const x of a)_.add(x),D in S||(S[D]={}),x in S[D]||(S[D][x]={});for(const x of a)h.forEach(T=>{y[u]===T.id||x===T.id?(S[D][x]||(S[D][x]={}),S[D][x][T.name]=Math.round(Number(y[x])*1e3)/1e3):c.length||(S[D][x]||(S[D][x]={}),S[D][x][T.name]=Math.round(Number(y[T.id])*1e3)/1e3)});return S},{}):{},M=a.length===1?a.flatMap(S=>h.map(O=>[S,O.name])):h.map(S=>[S.name,S.name]),k={},C=[...M].map(([S,O],D)=>{const y=b.map(R=>R in w&&S in w[R]?{x:R,y:w[R][S][O]||0}:{x:R,y:0});let{colorPalette:x,fill:T}=n;J(x)&&(x=He);const A=Array.isArray(x)?Gn(D,x):x[O]||Gn(D);return k[O]=A,{rawDimension:O,rawMetric:S,label:e&&e.te(`chartLabels.${O}`)&&e.t(`chartLabels.${O}`)||O,borderColor:A,backgroundColor:A,data:y,total:y.reduce((R,{y:L})=>R+Number(L),0),...Xx,fill:T,borderWidth:T?Kx:Gx}});if(C.sort((S,O)=>Number(S.total)<Number(O.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const O=n.threshold[S];O&&C.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:g1,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(D=>({x:D,y:O}))})}return{datasets:C,colorMap:k}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const k1=(n,t)=>{f.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function S1(){const{i18n:n}=ut.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const D1="analytics-query-provider";function T1(){const n=f.inject(D1);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const ut={useBarChartOptions:e_,useChartJSCommon:i_,useChartLegendValues:r_,useChartSelectedRange:c1,useExploreResultToDatasets:f1,useExploreResultToTimeDataset:M1,useDoughnutChartOptions:u1,useLinechartOptions:d1,useI18n:Gh,useReportChartDataForSynthetics:k1,useTranslatedUnits:S1,useEvaluateFeatureFlag:T1};var Pt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Pt||{}),ti=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ti||{});/*!
|
|
18
|
+
`):n}function wy(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Pc(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=kt(t.bodyFont),c=kt(t.titleFont),u=kt(t.footerFont),d=r.length,h=s.length,g=i.length,p=Ft(t.padding);let b=p.height,_=0,w=i.reduce((C,S)=>C+S.before.length+S.lines.length+S.after.length,0);if(w+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){const C=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;b+=g*C+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let M=0;const k=function(C){_=Math.max(_,e.measureText(C).width+M)};return e.save(),e.font=c.string,ht(n.title,k),e.font=l.string,ht(n.beforeBody.concat(n.afterBody),k),M=t.displayColors?a+2+t.boxPadding:0,ht(i,C=>{ht(C.before,k),ht(C.lines,k),ht(C.after,k)}),M=0,e.font=u.string,ht(n.footer,k),e.restore(),_+=p.width,{width:_,height:b}}function vy(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function My(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function ky(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),My(c,n,t,e)&&(c="center"),c}function Oc(n,t,e){const i=e.yAlign||t.yAlign||vy(n,e);return{xAlign:e.xAlign||t.xAlign||ky(n,t,e,i),yAlign:i}}function Sy(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Dy(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ec(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=en(a);let p=Sy(t,o);const b=Dy(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,h)+s:o==="right"&&(p+=Math.max(d,g)+s),{x:Ht(p,0,i.width-t.width),y:Ht(b,0,i.height-t.height)}}function Fs(n,t,e){const i=Ft(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ac(n){return Ce([],Be(n))}function Ty(n,t,e){return nn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Rc(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Lc={beforeTitle:Re,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Re,beforeBody:Re,beforeLabel:Re,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return J(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Re,afterBody:Re,beforeFooter:Re,footer:Re,afterFooter:Re};function te(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Lc[t].call(e,i):s}class ua extends Wt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Vr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Ty(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=te(i,"beforeTitle",this,t),r=te(i,"title",this,t),a=te(i,"afterTitle",this,t);let o=[];return o=Ce(o,Be(s)),o=Ce(o,Be(r)),o=Ce(o,Be(a)),o}getBeforeBody(t,e){return Ac(te(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return ht(t,r=>{const a={before:[],lines:[],after:[]},o=Rc(i,r);Ce(a.before,Be(te(o,"beforeLabel",this,r))),Ce(a.lines,te(o,"label",this,r)),Ce(a.after,Be(te(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Ac(te(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=te(i,"beforeFooter",this,t),r=te(i,"footer",this,t),a=te(i,"afterFooter",this,t);let o=[];return o=Ce(o,Be(s)),o=Ce(o,Be(r)),o=Ce(o,Be(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(wy(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),ht(o,u=>{const d=Rc(t.callbacks,u);s.push(te(d,"labelColor",this,u)),r.push(te(d,"labelPointStyle",this,u)),a.push(te(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=Li[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=Pc(this,i),c=Object.assign({},o,l),u=Oc(this.chart,i,c),d=Ec(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=en(o),{x:h,y:g}=t,{width:p,height:b}=e;let _,w,M,k,C,S;return r==="center"?(C=g+b/2,s==="left"?(_=h,w=_-a,k=C+a,S=C-a):(_=h+p,w=_+a,k=C-a,S=C+a),M=_):(s==="left"?w=h+Math.max(l,u)+a:s==="right"?w=h+p-Math.max(c,d)-a:w=this.caretX,r==="top"?(k=g,C=k-a,_=w-a,M=w+a):(k=g+b,C=k+a,_=w+a,M=w-a),S=k),{x1:_,x2:w,x3:M,y1:k,y2:C,y3:S}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=jn(i.rtl,this.x,this.width);for(t.x=Fs(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=kt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=kt(r.bodyFont),d=Fs(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},_=s.leftForLtr(h,c)+c/2,w=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Nr(t,b,_,w),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Nr(t,b,_,w)}else{t.lineWidth=it(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const b=s.leftForLtr(h,c),_=s.leftForLtr(s.xPlus(h,1),c-2),w=en(a.borderRadius);Object.values(w).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Wn(t,{x:b,y:p,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Wn(t,{x:_,y:p+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(_,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=kt(i.bodyFont);let h=d.lineHeight,g=0;const p=jn(i.rtl,this.x,this.width),b=function(y){e.fillText(y,p.x(t.x+g),t.y+h/2),t.y+=h+r},_=p.textAlign(a);let w,M,k,C,S,O,D;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=Fs(this,_,i),e.fillStyle=i.bodyColor,ht(this.beforeBody,b),g=o&&_!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,O=s.length;C<O;++C){for(w=s[C],M=this.labelTextColors[C],e.fillStyle=M,ht(w.before,b),k=w.lines,o&&k.length&&(this._drawColorBox(e,t,C,p,i),h=Math.max(d.lineHeight,l)),S=0,D=k.length;S<D;++S)b(k[S]),h=d.lineHeight;ht(w.after,b)}g=0,h=d.lineHeight,ht(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=jn(i.rtl,this.x,this.width);for(t.x=Fs(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=kt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:g,bottomRight:p}=en(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+d,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-h,l),e.quadraticCurveTo(o+c,l,o+c,l+h),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const a=Li[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Pc(this,t),l=Object.assign({},a,this._size),c=Oc(e,t,l),u=Ec(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ft(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),pl(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ml(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!cs(i,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!cs(a,r)||o;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=Li[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}P(ua,"positioners",Li);var zs={id:"tooltip",_element:ua,positioners:Li,afterInit(n,t,e){e&&(n.tooltip=new ua({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Lc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Cy=Object.freeze({__proto__:null,Colors:Wm,Decimation:$m,Filler:dy,Legend:yy,SubTitle:_y,Title:xy,Tooltip:zs});const Py=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Oy(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Py(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Ey=(n,t)=>n===null?null:Ht(Math.round(n),0,t);function Ic(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class da extends kn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(J(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Oy(i,t,K(e,t),this._addedLabels),Ey(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Ic.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(da,"id","category"),P(da,"defaults",{ticks:{callback:Ic}});function Ay(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,p=u-1,{min:b,max:_}=t,w=!J(a),M=!J(o),k=!J(c),C=(_-b)/(d+1);let S=Wo((_-b)/p/g)*g,O,D,y,x;if(S<1e-14&&!w&&!M)return[{value:b},{value:_}];x=Math.ceil(_/S)-Math.floor(b/S),x>p&&(S=Wo(x*S/p/g)*g),J(l)||(O=Math.pow(10,l),S=Math.ceil(S*O)/O),s==="ticks"?(D=Math.floor(b/S)*S,y=Math.ceil(_/S)*S):(D=b,y=_),w&&M&&r&&Cf((o-a)/r,S/1e3)?(x=Math.round(Math.min((o-a)/S,u)),S=(o-a)/x,D=a,y=o):k?(D=w?a:D,y=M?o:y,x=c-1,S=(y-D)/x):(x=(y-D)/S,gi(x,Math.round(x),S/1e3)?x=Math.round(x):x=Math.ceil(x));const T=Math.max(Vo(S),Vo(D));O=Math.pow(10,J(l)?T:l),D=Math.round(D*O)/O,y=Math.round(y*O)/O;let A=0;for(w&&(h&&D!==a?(e.push({value:a}),D<a&&A++,gi(Math.round((D+A*S)*O)/O,a,Nc(a,C,n))&&A++):D<a&&A++);A<x;++A){const R=Math.round((D+A*S)*O)/O;if(M&&R>o)break;e.push({value:R})}return M&&h&&y!==o?e.length&&gi(e[e.length-1].value,o,Nc(o,C,n))?e[e.length-1].value=o:e.push({value:o}):(!M||y===o)&&e.push({value:y}),e}function Nc(n,t,{horizontal:e,minRotation:i}){const s=Nt(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Bs extends kn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=De(s),c=De(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=Ay(s,r);return t.bounds==="ticks"&&Yo(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return yi(t,this.chart.options.locale,this.options.ticks.format)}}class ha extends Bs{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?t:0,this.max=Mt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Nt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(ha,"id","linear"),P(ha,"defaults",{ticks:{callback:ms.formatters.numeric}});const Ii=n=>Math.floor(Je(n)),Sn=(n,t)=>Math.pow(10,Ii(n)+t);function Fc(n){return n/Math.pow(10,Ii(n))===1}function zc(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Ry(n,t){const e=t-n;let i=Ii(e);for(;zc(n,t,i)>10;)i++;for(;zc(n,t,i)<10;)i--;return Math.min(i,Ii(n))}function Ly(n,{min:t,max:e}){t=ce(n.min,t);const i=[],s=Ii(t);let r=Ry(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=ce(n.min,Math.round((l+u+d*Math.pow(10,r))*a)/a);for(;h<e;)i.push({value:h,major:Fc(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,a=r>=0?1:a),h=Math.round((l+u+d*Math.pow(10,r))*a)/a;const g=ce(n.max,h);return i.push({value:g,major:Fc(g),significand:d}),i}class fa extends kn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Bs.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Mt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?Math.max(0,t):null,this.max=Mt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Mt(this._userMin)&&(this.min=t===Sn(this.min,0)?Sn(this.min,-1):Sn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(Sn(i,-1)),a(Sn(s,1)))),i<=0&&r(Sn(s,-1)),s<=0&&a(Sn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Ly(e,this);return t.bounds==="ticks"&&Yo(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":yi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Je(t),this._valueRange=Je(this.max)-Je(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Je(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(fa,"id","logarithmic"),P(fa,"defaults",{ticks:{callback:ms.formatters.logarithmic,major:{enabled:!0}}});function ga(n){const t=n.ticks;if(t.display&&n.display){const e=Ft(t.backdropPadding);return K(t.font&&t.font.size,xt.font.size)+e.height}return 0}function Iy(n,t,e){return e=ct(e)?e:[e],{w:$f(n,t.string,e),h:e.length*t.lineHeight}}function Bc(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Ny(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,a=n.options.pointLabels,o=a.centerPointLabels?rt/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),d=kt(c.font),h=Iy(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=ue(n.getIndexAngle(l)+o),p=Math.round(fs(g)),b=Bc(p,u.x,h.w,0,180),_=Bc(p,u.y,h.h,90,270);Fy(e,t,g,b,_)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Hy(n,i,s)}function Fy(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function zy(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(fs(ue(l.angle+bt))),u=Vy(l.y,o.h,c),d=Wy(c),h=Yy(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+o.w,bottom:u+o.h}}function By(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Ne({x:e,y:i},t)||Ne({x:e,y:r},t)||Ne({x:s,y:i},t)||Ne({x:s,y:r},t))}function Hy(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:ga(r)/2,additionalAngle:a?rt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=zy(n,u,l);i.push(d),o==="auto"&&(d.visible=By(d,c),d.visible&&(c=d))}return i}function Wy(n){return n===0||n===180?"center":n<180?"left":"right"}function Yy(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Vy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function jy(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!J(o)){const l=en(t.borderRadius),c=Ft(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=a-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Wn(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function $y(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const a=i.setContext(n.getPointLabelContext(s));jy(e,a,r);const o=kt(a.font),{x:l,y:c,textAlign:u}=r;_n(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Hc(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,yt);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function qy(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Hc(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function Uy(n,t,e){return nn(n,{label:e,index:t,type:"pointLabel"})}class Ni extends Bs{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ft(ga(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Mt(t)&&!isNaN(t)?t:0,this.max=Mt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ga(this.options))}generateTickLabels(t){Bs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=dt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Ny(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=yt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ue(t*e+Nt(i))}getDistanceFromCenterForValue(t){if(J(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(J(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Uy(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-bt+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Hc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&$y(this,a),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),p=r.setContext(h);qy(this,g,l,a,p)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=kt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Ft(c.backdropPadding);t.fillRect(-a/2-d.left,-r-u.size/2-d.top,a+d.width,u.size+d.height)}_n(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(Ni,"id","radialLinear"),P(Ni,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ms.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(Ni,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(Ni,"descriptors",{angleLines:{_fallback:"grid"}});const Hs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ee=Object.keys(Hs);function Wc(n,t){return n-t}function Yc(n,t){if(J(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),Mt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(tn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Vc(n,t,e,i){const s=ee.length;for(let r=ee.indexOf(n);r<s-1;++r){const a=Hs[ee[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return ee[r]}return ee[s-1]}function Xy(n,t,e,i,s){for(let r=ee.length-1;r>=ee.indexOf(e);r--){const a=ee[r];if(Hs[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return ee[e?ee.indexOf(e):0]}function Gy(n){for(let t=ee.indexOf(n)+1,e=ee.length;t<e;++t)if(Hs[ee[t]].common)return ee[t]}function jc(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Or(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function Ky(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function $c(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:Ky(n,i,s,e)}class Fi extends kn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Ll._date(t.adapters.date);s.init(e),fi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Yc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Mt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Mt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,a=this.max,o=Af(s,r,a);return this._unit=e.unit||(i.autoSkip?Vc(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Xy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Gy(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),$c(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ht(e,0,a),i=Ht(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||Vc(r.minUnit,e,i,this._getLabelCapacity(e)),o=K(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=tn(l)||l===!0,u={};let d=e,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h<i;h=+t.add(h,o,a),g++)jc(u,h,p);return(h===i||s.bounds==="ticks"||g===1)&&jc(u,h,p),Object.keys(u).sort(Wc).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return dt(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],h=i[e],g=c&&d&&h&&h.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Nt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,$c(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Yc(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qo(t.sort(Wc))}}P(Fi,"id","time"),P(Fi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ws(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Ie(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Ie(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class pa extends Fi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ws(e,this.min),this._tableRange=Ws(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ws(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ws(this._table,i*this._tableRange+this._minPos,!0)}}P(pa,"id","timeseries"),P(pa,"defaults",Fi.defaults);var Zy=Object.freeze({__proto__:null,CategoryScale:da,LinearScale:ha,LogarithmicScale:fa,RadialLinearScale:Ni,TimeScale:Fi,TimeSeriesScale:pa});const Qy=[ap,Lm,Cy,Zy],Jy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],tb=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],eb=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],nb=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],qc=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function ma(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?nb:eb:t.binary?tb:Jy,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let a;if(t.minimumFractionDigits!==void 0&&(a={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(a={maximumFractionDigits:t.maximumFractionDigits,...a}),n<1){const u=qc(n,t.locale,a);return r+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,a||(n=n.toPrecision(3));const l=qc(Number(n),t.locale,a),c=e[o];return r+l+i+c}const Uc=6048e5,ib=864e5,zi=6e4,qn=36e5,sb=1e3,Xc=Symbol.for("constructDateFrom");function Ot(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Xc in n?n[Xc](t):n instanceof Date?new n.constructor(t):new Date(t)}function tt(n,t){return Ot(t||n,n)}function Ys(n,t,e){const i=tt(n,e==null?void 0:e.in);return isNaN(t)?Ot((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ya(n,t,e){const i=tt(n,e==null?void 0:e.in);if(isNaN(t))return Ot(n,NaN);if(!t)return i;const s=i.getDate(),r=Ot(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ba(n,t,e){return Ot(n,+tt(n)+t)}function rb(n,t,e){return ba(n,t*qn)}let ab={};function Dn(){return ab}function Pe(n,t){var o,l,c,u;const e=Dn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=tt(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Un(n,t){return Pe(n,{...t,weekStartsOn:1})}function Gc(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ot(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Un(s),a=Ot(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Un(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Vs(n){const t=tt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Tn(n,...t){const e=Ot.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function xa(n,t){const e=tt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Kc(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=xa(i),a=xa(s),o=+r-Vs(r),l=+a-Vs(a);return Math.round((o-l)/ib)}function ob(n,t){const e=Gc(n,t),i=Ot(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Un(i)}function lb(n,t,e){const i=tt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*zi),i}function cb(n,t,e){return ya(n,t*3,e)}function ub(n,t,e){return ba(n,t*1e3)}function db(n,t,e){return Ys(n,t*7,e)}function hb(n,t,e){return ya(n,t*12,e)}function Bi(n,t){const e=+tt(n)-+tt(t);return e<0?-1:e>0?1:e}function fb(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function _a(n){return!(!fb(n)&&typeof n!="number"||isNaN(+tt(n)))}function gb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function pb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Zc(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=Qc(i,s),a=Math.abs(Kc(i,s));i.setDate(i.getDate()-r*a);const o=+(Qc(i,s)===-r),l=r*(a-o);return l===0?0:l}function Qc(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Hi(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function mb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=(+i-+s)/qn;return Hi(e==null?void 0:e.roundingMethod)(r)}function wa(n,t){return+tt(n)-+tt(t)}function yb(n,t,e){const i=wa(n,t)/zi;return Hi(e==null?void 0:e.roundingMethod)(i)}function Jc(n,t){const e=tt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function tu(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function bb(n,t){const e=tt(n,t==null?void 0:t.in);return+Jc(e,t)==+tu(e,t)}function eu(n,t,e){const[i,s,r]=Tn(e==null?void 0:e.in,n,n,t),a=Bi(s,r),o=Math.abs(gb(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=Bi(s,r)===-a;bb(i)&&o===1&&Bi(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function xb(n,t,e){const i=eu(n,t,e)/3;return Hi(e==null?void 0:e.roundingMethod)(i)}function _b(n,t,e){const i=wa(n,t)/1e3;return Hi(e==null?void 0:e.roundingMethod)(i)}function wb(n,t,e){const i=Zc(n,t,e)/7;return Hi(e==null?void 0:e.roundingMethod)(i)}function vb(n,t,e){const[i,s]=Tn(e==null?void 0:e.in,n,t),r=Bi(i,s),a=Math.abs(pb(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=Bi(i,s)===-r,l=r*(a-+o);return l===0?0:l}function Mb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function kb(n,t){const e=tt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Sb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function nu(n,t){const e=tt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Db(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function Tb(n,t){var o,l;const e=Dn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=tt(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Cb(n,t){const e=tt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Pb(n,t){const e=tt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function Ob(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const Eb={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ab=(n,t,e)=>{let i;const s=Eb[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function va(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Rb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ib={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Nb={date:va({formats:Rb,defaultWidth:"full"}),time:va({formats:Lb,defaultWidth:"full"}),dateTime:va({formats:Ib,defaultWidth:"full"})},Fb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zb=(n,t,e,i)=>Fb[n];function Wi(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Bb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Yb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Vb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},jb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},$b={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Wi({values:Bb,defaultWidth:"wide"}),quarter:Wi({values:Hb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Wi({values:Wb,defaultWidth:"wide"}),day:Wi({values:Yb,defaultWidth:"wide"}),dayPeriod:Wi({values:Vb,defaultWidth:"wide",formattingValues:jb,defaultFormattingWidth:"wide"})};function Yi(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Ub(o,d=>d.test(a)):qb(o,d=>d.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function qb(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ub(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Xb(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const Gb=/^(\d+)(th|st|nd|rd)?/i,Kb=/\d+/i,Zb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Qb={any:[/^b/i,/^(a|c)/i]},Jb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},t0={any:[/1/i,/2/i,/3/i,/4/i]},e0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},n0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},i0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},s0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},r0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},a0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},o0={ordinalNumber:Xb({matchPattern:Gb,parsePattern:Kb,valueCallback:n=>parseInt(n,10)}),era:Yi({matchPatterns:Zb,defaultMatchWidth:"wide",parsePatterns:Qb,defaultParseWidth:"any"}),quarter:Yi({matchPatterns:Jb,defaultMatchWidth:"wide",parsePatterns:t0,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Yi({matchPatterns:e0,defaultMatchWidth:"wide",parsePatterns:n0,defaultParseWidth:"any"}),day:Yi({matchPatterns:i0,defaultMatchWidth:"wide",parsePatterns:s0,defaultParseWidth:"any"}),dayPeriod:Yi({matchPatterns:r0,defaultMatchWidth:"any",parsePatterns:a0,defaultParseWidth:"any"})},iu={code:"en-US",formatDistance:Ab,formatLong:Nb,formatRelative:zb,localize:$b,match:o0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function l0(n,t){const e=tt(n,t==null?void 0:t.in);return Kc(e,nu(e))+1}function su(n,t){const e=tt(n,t==null?void 0:t.in),i=+Un(e)-+ob(e);return Math.round(i/Uc)+1}function Ma(n,t){var u,d,h,g;const e=tt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Dn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,a=Ot((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=Pe(a,t),l=Ot((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Pe(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function c0(n,t){var o,l,c,u;const e=Dn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Ma(n,t),r=Ot((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Pe(r,t)}function ru(n,t){const e=tt(n,t==null?void 0:t.in),i=+Pe(e,t)-+c0(e,t);return Math.round(i/Uc)+1}function ft(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const on={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return ft(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):ft(e+1,2)},d(n,t){return ft(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return ft(n.getHours()%12||12,t.length)},H(n,t){return ft(n.getHours(),t.length)},m(n,t){return ft(n.getMinutes(),t.length)},s(n,t){return ft(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return ft(s,t.length)}},Xn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},au={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return on.y(n,t)},Y:function(n,t,e,i){const s=Ma(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return ft(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):ft(r,t.length)},R:function(n,t){const e=Gc(n);return ft(e,t.length)},u:function(n,t){const e=n.getFullYear();return ft(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ft(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ft(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return on.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return ft(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ru(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):ft(s,t.length)},I:function(n,t,e){const i=su(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ft(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):on.d(n,t)},D:function(n,t,e){const i=l0(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ft(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return ft(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return ft(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ft(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Xn.noon:i===0?s=Xn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Xn.evening:i>=12?s=Xn.afternoon:i>=4?s=Xn.morning:s=Xn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return on.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):on.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):on.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):on.s(n,t)},S:function(n,t){return on.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return lu(i);case"XXXX":case"XX":return Cn(i);case"XXXXX":case"XXX":default:return Cn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return lu(i);case"xxxx":case"xx":return Cn(i);case"xxxxx":case"xxx":default:return Cn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ou(i,":");case"OOOO":default:return"GMT"+Cn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ou(i,":");case"zzzz":default:return"GMT"+Cn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return ft(i,t.length)},T:function(n,t,e){return ft(+n,t.length)}};function ou(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+ft(r,2)}function lu(n,t){return n%60===0?(n>0?"-":"+")+ft(Math.abs(n)/60,2):Cn(n,t)}function Cn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=ft(Math.trunc(i/60),2),r=ft(i%60,2);return e+s+t+r}const cu=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},uu=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ka={p:uu,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return cu(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",cu(i,t)).replace("{{time}}",uu(s,t))}},u0=/^D+$/,d0=/^Y+$/,h0=["D","DD","YY","YYYY"];function du(n){return u0.test(n)}function hu(n){return d0.test(n)}function Sa(n,t,e){const i=f0(n,t,e);if(console.warn(i),h0.includes(n))throw new RangeError(i)}function f0(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const g0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,p0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,m0=/^'([^]*?)'?$/,y0=/''/g,b0=/[a-zA-Z]/;function fu(n,t,e){var u,d,h,g,p,b,_,w;const i=Dn(),s=(e==null?void 0:e.locale)??i.locale??iu,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,a=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((w=(_=i.locale)==null?void 0:_.options)==null?void 0:w.weekStartsOn)??0,o=tt(n,e==null?void 0:e.in);if(!_a(o))throw new RangeError("Invalid time value");let l=t.match(p0).map(M=>{const k=M[0];if(k==="p"||k==="P"){const C=ka[k];return C(M,s.formatLong)}return M}).join("").match(g0).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:x0(M)};if(au[k])return{isToken:!0,value:M};if(k.match(b0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&hu(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&du(k))&&Sa(k,t,String(n));const C=au[k[0]];return C(o,k,s.localize,c)}).join("")}function x0(n){const t=n.match(m0);return t?t[1].replace(y0,"'"):n}function gu(){return Object.assign({},Dn())}function _0(n,t){const e=tt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function w0(n,t){const e=v0(t)?new t(0):Ot(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function v0(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const M0=10;class pu{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class k0 extends pu{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class S0 extends pu{constructor(e,i){super();P(this,"priority",M0);P(this,"subPriority",-1);this.context=e||(s=>Ot(i,s))}set(e,i){return i.timestampIsSet?e:Ot(e,w0(e,this.context))}}class ot{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new k0(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class D0 extends ot{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Lt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Oe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function It(n,t){return n&&{value:t(n.value),rest:n.rest}}function Tt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ee(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*qn+r*zi+a*sb),rest:t.slice(e[0].length)}}function mu(n){return Tt(Lt.anyDigitsSigned,n)}function Et(n,t){switch(n){case 1:return Tt(Lt.singleDigit,t);case 2:return Tt(Lt.twoDigits,t);case 3:return Tt(Lt.threeDigits,t);case 4:return Tt(Lt.fourDigits,t);default:return Tt(new RegExp("^\\d{1,"+n+"}"),t)}}function js(n,t){switch(n){case 1:return Tt(Lt.singleDigitSigned,t);case 2:return Tt(Lt.twoDigitsSigned,t);case 3:return Tt(Lt.threeDigitsSigned,t);case 4:return Tt(Lt.fourDigitsSigned,t);default:return Tt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Da(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function yu(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function bu(n){return n%400===0||n%4===0&&n%100!==0}class T0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return It(Et(4,e),r);case"yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Et(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const o=yu(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class C0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return It(Et(4,e),r);case"Yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Et(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Ma(e,r);if(s.isTwoDigitYear){const l=yu(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Pe(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Pe(e,r)}}class P0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return js(i==="R"?4:i.length,e)}set(e,i,s){const r=Ot(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Un(r)}}class O0 extends ot{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return js(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class E0 extends ot{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Et(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class A0 extends ot{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Et(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class R0 extends ot{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return It(Tt(Lt.month,e),r);case"MM":return It(Et(2,e),r);case"Mo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class L0 extends ot{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return It(Tt(Lt.month,e),r);case"LL":return It(Et(2,e),r);case"Lo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function I0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=ru(i,e)-t;return i.setDate(i.getDate()-s*7),tt(i,e==null?void 0:e.in)}class N0 extends ot{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Tt(Lt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Pe(I0(e,s,r),r)}}function F0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=su(i,e)-t;return i.setDate(i.getDate()-s*7),i}class z0 extends ot{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Tt(Lt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return Un(F0(e,s))}}const B0=[31,28,31,30,31,30,31,31,30,31,30,31],H0=[31,29,31,30,31,30,31,31,30,31,30,31];class W0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Tt(Lt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Et(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=bu(s),a=e.getMonth();return r?i>=1&&i<=H0[a]:i>=1&&i<=B0[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Y0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Tt(Lt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Et(i.length,e)}}validate(e,i){const s=e.getFullYear();return bu(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Ta(n,t,e){var d,h,g,p;const i=Dn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=tt(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Ys(r,u,e)}class V0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}class j0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return It(Et(i.length,e),a);case"eo":return It(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}class $0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return It(Et(i.length,e),a);case"co":return It(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ta(e,s,r),e.setHours(0,0,0,0),e}}function q0(n,t,e){const i=tt(n,e==null?void 0:e.in),s=_0(i,e),r=t-s;return Ys(i,r,e)}class U0 extends ot{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Et(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return It(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return It(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return It(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return It(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=q0(e,s),e.setHours(0,0,0,0),e}}class X0 extends ot{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class G0 extends ot{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class K0 extends ot{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Da(s),0,0,0),e}}class Z0 extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Tt(Lt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class Q0 extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Tt(Lt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class J0 extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Tt(Lt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class tx extends ot{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Tt(Lt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Et(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class ex extends ot{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Tt(Lt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class nx extends ot{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Tt(Lt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Et(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class ix extends ot{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return It(Et(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class sx extends ot{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ee(Oe.basicOptionalMinutes,e);case"XX":return Ee(Oe.basic,e);case"XXXX":return Ee(Oe.basicOptionalSeconds,e);case"XXXXX":return Ee(Oe.extendedOptionalSeconds,e);case"XXX":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ot(e,e.getTime()-Vs(e)-s)}}class rx extends ot{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ee(Oe.basicOptionalMinutes,e);case"xx":return Ee(Oe.basic,e);case"xxxx":return Ee(Oe.basicOptionalSeconds,e);case"xxxxx":return Ee(Oe.extendedOptionalSeconds,e);case"xxx":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ot(e,e.getTime()-Vs(e)-s)}}class ax extends ot{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return mu(e)}set(e,i,s){return[Ot(e,s*1e3),{timestampIsSet:!0}]}}class ox extends ot{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return mu(e)}set(e,i,s){return[Ot(e,s),{timestampIsSet:!0}]}}const lx={G:new D0,y:new T0,Y:new C0,R:new P0,u:new O0,Q:new E0,q:new A0,M:new R0,L:new L0,w:new N0,I:new z0,d:new W0,D:new Y0,E:new V0,e:new j0,c:new $0,i:new U0,a:new X0,b:new G0,B:new K0,h:new Z0,H:new Q0,K:new J0,k:new tx,m:new ex,s:new nx,S:new ix,X:new sx,x:new rx,t:new ax,T:new ox},cx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ux=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dx=/^'([^]*?)'?$/,hx=/''/g,fx=/\S/,gx=/[a-zA-Z]/;function px(n,t,e,i){var _,w,M,k,C,S,O,D;const s=()=>Ot((i==null?void 0:i.in)||e,NaN),r=gu(),a=(i==null?void 0:i.locale)??r.locale??iu,o=(i==null?void 0:i.firstWeekContainsDate)??((w=(_=i==null?void 0:i.locale)==null?void 0:_.options)==null?void 0:w.firstWeekContainsDate)??r.firstWeekContainsDate??((k=(M=r.locale)==null?void 0:M.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((S=(C=i==null?void 0:i.locale)==null?void 0:C.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((D=(O=r.locale)==null?void 0:O.options)==null?void 0:D.weekStartsOn)??0;if(!t)return n?s():tt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new S0(i==null?void 0:i.in,e)],d=t.match(ux).map(y=>{const x=y[0];if(x in ka){const T=ka[x];return T(y,a.formatLong)}return y}).join("").match(cx),h=[];for(let y of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&hu(y)&&Sa(y,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&du(y)&&Sa(y,t,n);const x=y[0],T=lx[x];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const L=h.find(F=>A.includes(F.token)||F.token===x);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${y}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);h.push({token:x,fullToken:y});const R=T.run(n,y,a.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(x.match(gx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");if(y==="''"?y="'":x==="'"&&(y=mx(y)),n.indexOf(y)===0)n=n.slice(y.length);else return s()}}if(n.length>0&&fx.test(n))return s();const g=u.map(y=>y.priority).sort((y,x)=>x-y).filter((y,x,T)=>T.indexOf(y)===x).map(y=>u.filter(x=>x.priority===y).sort((x,T)=>T.subPriority-x.subPriority)).map(y=>y[0]);let p=tt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const y of g){if(!y.validate(p,c))return s();const x=y.set(p,b,c);Array.isArray(x)?(p=x[0],Object.assign(b,x[1])):p=x}return p}function mx(n){return n.match(dx)[1].replace(hx,"'")}function yx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function bx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function xx(n,t){const e=tt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function _x(n){const t=n/qn;return Math.trunc(t)}function xu(n,t){const e=()=>Ot(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=kx(n);let r;if(s.date){const c=Sx(s.date,i);r=Dx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=Tx(s.time),isNaN(o)))return e();if(s.timezone){if(l=Cx(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=tt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return tt(a+o+l,t==null?void 0:t.in)}const $s={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},wx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Mx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function kx(n){const t={},e=n.split($s.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],$s.timeZoneDelimiter.test(t.date)&&(t.date=n.split($s.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=$s.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Sx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Dx(n,t){if(t===null)return new Date(NaN);const e=n.match(wx);if(!e)return new Date(NaN);const i=!!e[4],s=Vi(e[1]),r=Vi(e[2])-1,a=Vi(e[3]),o=Vi(e[4]),l=Vi(e[5])-1;if(i)return Rx(t,o,l)?Px(t,o,l):new Date(NaN);{const c=new Date(0);return!Ex(t,r,a)||!Ax(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Vi(n){return n?parseInt(n):1}function Tx(n){const t=n.match(vx);if(!t)return NaN;const e=Ca(t[1]),i=Ca(t[2]),s=Ca(t[3]);return Lx(e,i,s)?e*qn+i*zi+s*1e3:NaN}function Ca(n){return n&&parseFloat(n.replace(",","."))||0}function Cx(n){if(n==="Z")return 0;const t=n.match(Mx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Ix(i,s)?e*(i*qn+s*zi):NaN}function Px(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Ox=[31,null,31,30,31,30,31,31,30,31,30,31];function _u(n){return n%400===0||n%4===0&&n%100!==0}function Ex(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Ox[t]||(_u(n)?29:28))}function Ax(n,t){return t>=1&&t<=(_u(n)?366:365)}function Rx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Lx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Ix(n,t){return t>=0&&t<=59}const Pa=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((a,o)=>o.rawValue-a.rawValue);if(e.body&&!n.locked){const a=e.labelColors,o=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","doughnut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(h)?h:ma(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?qs.format(h):qs.format(Number(h.toFixed(vu)))} ${b}`}const p=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:a[d].backgroundColor,borderColor:a[d].borderColor,label:p,value:g,rawValue:h}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Nx=n=>n&&n.datasets&&n.datasets.length,Fx=n=>Nx(n)&&n.datasets.some(t=>t.data.length),zx=n=>Fx(n)&&n.datasets.some(t=>t.data.length>1),Bx=n=>zx(n)&&n.datasets.some(t=>t.data[0]&&_a(t.data[0].x)),Hx=n=>Bx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Oa=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},Wx=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function wu(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const vu=2,Mu=10,ku=12,qs=new Intl.NumberFormat(((Lh=document==null?void 0:document.documentElement)==null?void 0:Lh.lang)||"en-US"),Us=10,Su={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},He=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Gn=(n,t)=>(t||He)[n%He.length],Du=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},Tu="#6f7787",Cu={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},Yx=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Cu[t])==null?void 0:e.background)||"#fafafa"},Vx={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},jx={"4XX":"#FFBA81","5XX":"#FF8484"},$x={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},qx="#dad4c7",Ux=n=>{const t=Object.entries(Su).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Su.standard},Xx={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Gx=2,Kx=0,Ea=new Map,Aa=(n,t)=>t==="bytes"?ma(n):t==="count/minute"?n.toFixed(2):qs.format(n),Pu=n=>{const e=document.createElement("canvas").getContext("2d"),i=kt({});return e.font=i.string,e.measureText(n).width},Zx=()=>{const n="label_height";if(!Ea.has(n)){const t=kt({});Ea.set(n,t.lineHeight)}return Ea.get(n)},Qx=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),Ou=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),Eu=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ra="#e0e4ea",Jx={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},ji=(n,t)=>{let e=1;const i=Jx[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},Au=new Map([[100,ji("100",[100,101,102,103])],[200,ji("200",[200,201,202,203,204,205,206,207,208,226])],[300,ji("300",[300,301,302,303,304,305,307,308])],[400,ji("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,ji("500",[500,501,502,503,504,505,506,507,508,510,511])]]),La=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=Au.get(e);return i===void 0?Ra:i.get(t)??i.get(-1)??Ra},t_=n=>{const t=La(n);return{solid:t,light:t}},Xs={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=La(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function e_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};zs.positioners.barChartTooltipPosition=function(s,r){if(!s.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=a.width/2,c=Oa(r,o,l),u=r.y,d=r.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},Qr.modes.customInteractionMode=function(s,r){const a=sn(r,s),o=[];return Qr.evaluateInteractionItems(s,s.options.indexAxis||"x",a,(l,c,u)=>{s.options.indexAxis==="y"&&l.inYRange(a.y,!0)&&s.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),s.options.indexAxis==="x"&&l.inXRange(a.x,!0)&&s.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?Mu:ku;return f.computed(()=>{var s,r,a,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(h,g){const p=this;if(p.chart.options.indexAxis===p.axis){h=p.getLabelForValue(g);const b=10;return h&&h.length>b?h.slice(0,b)+"...":h}return p.getLabelForValue(Number(h))}},title:{display:n.indexAxis==="y"?!J((s=n.metricAxesTitle)==null?void 0:s.value):!J((r=n.dimensionAxesTitle)==null?void 0:r.value),text:n.indexAxis==="y"?(a=n.metricAxesTitle)==null?void 0:a.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(h,g){const p=this;return p.chart.options.indexAxis===p.axis?(h=p.getLabelForValue(g),h&&h.length>Us?h.slice(0,Us)+"...":h):p.getLabelForValue(Number(h))}},title:{display:n.indexAxis==="x"?!J((l=n.metricAxesTitle)==null?void 0:l.value):!J((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:h=>{Pa(n.tooltipState,h)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}ge.register(...Qy);const n_=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function i_(n,t,e,i,s){const r=f.shallowRef(null),a=(o,l)=>{if(t.value)return new ge(t.value,{type:n,data:o,plugins:i,options:l})};return f.onMounted(()=>{r.value=a(e.value,s.value)}),f.onBeforeUnmount(()=>{J(r.value)||r.value.destroy()}),f.watch(e,(o,l)=>{if(n_(l,o)&&!J(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else J(r.value)||r.value.destroy(),r.value=a(o,s.value)}),f.watch(t,()=>{J(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),f.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(J(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ia(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ru={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,b){b&&b%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<a?d=e(c,r,u)+"m":c<o?d=t(e(c,a,u),u)+"b":d=t(e(c,o,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Ru);var s_=Ru.exports;const $i=Ia(s_);function r_(n,t,e){const{i18n:i}=ut.useI18n(),{translateUnit:s}=ut.useTranslatedUnits();return{legendValues:f.computed(()=>n.value.datasets.reduce((a,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":ma(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:$i(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${$i(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...a,[o.label]:{raw:l,formatted:c,isThreshold:o.isThreshold}}},{}))}}var a_=Object.defineProperty,o_=(n,t,e)=>t in n?a_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,we=(n,t,e)=>o_(n,typeof t!="symbol"?t+"":t,e),Ct=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(Ct||{});const l_=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],qi=n=>n.filter(t=>t!=="time"),Lu=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],c_=qi(Lu),u_=[...Lu,"application","consumer","iso_code"],d_=qi(u_),h_=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],f_=qi(h_);qi(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),qi(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(c_),new Set(d_),new Set(f_);const Iu=6048e5,g_=864e5,p_=60,m_=3600,Nu=Symbol.for("constructDateFrom");function pe(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Nu in n?n[Nu](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ut(n,t){return pe(t||n,n)}function Fu(n,t,e){const i=Ut(n,void 0);return isNaN(t)?pe(n,NaN):(i.setDate(i.getDate()+t),i)}function y_(n,t,e){const i=Ut(n,void 0);if(isNaN(t))return pe(n,NaN);const s=i.getDate(),r=pe(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let b_={};function Ui(){return b_}function We(n,t){var e,i,s,r;const a=Ui(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=Ut(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Gs(n,t){return We(n,{...t,weekStartsOn:1})}function zu(n,t){const e=Ut(n,void 0),i=e.getFullYear(),s=pe(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Gs(s),a=pe(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Gs(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Bu(n){const t=Ut(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function x_(n,...t){const e=pe.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ks(n,t){const e=Ut(n,void 0);return e.setHours(0,0,0,0),e}function __(n,t,e){const[i,s]=x_(void 0,n,t),r=Ks(i),a=Ks(s),o=+r-Bu(r),l=+a-Bu(a);return Math.round((o-l)/g_)}function w_(n,t){const e=zu(n),i=pe(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Gs(i)}function v_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function M_(n){return!(!v_(n)&&typeof n!="number"||isNaN(+Ut(n)))}function Kn(n,t){const e=Ut(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function k_(n,t){const e=Ut(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const S_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},D_=(n,t,e)=>{let i;const s=S_[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Na(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const T_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},C_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},P_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},O_={date:Na({formats:T_,defaultWidth:"full"}),time:Na({formats:C_,defaultWidth:"full"}),dateTime:Na({formats:P_,defaultWidth:"full"})},E_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},A_=(n,t,e,i)=>E_[n];function Xi(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const R_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},L_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},I_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},N_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},F_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},z_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},B_=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},H_={ordinalNumber:B_,era:Xi({values:R_,defaultWidth:"wide"}),quarter:Xi({values:L_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Xi({values:I_,defaultWidth:"wide"}),day:Xi({values:N_,defaultWidth:"wide"}),dayPeriod:Xi({values:F_,defaultWidth:"wide",formattingValues:z_,defaultFormattingWidth:"wide"})};function Gi(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Y_(o,d=>d.test(a)):W_(o,d=>d.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function W_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Y_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function V_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const j_=/^(\d+)(th|st|nd|rd)?/i,$_=/\d+/i,q_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},U_={any:[/^b/i,/^(a|c)/i]},X_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},G_={any:[/1/i,/2/i,/3/i,/4/i]},K_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Z_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Q_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},J_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},tw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ew={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nw={ordinalNumber:V_({matchPattern:j_,parsePattern:$_,valueCallback:n=>parseInt(n,10)}),era:Gi({matchPatterns:q_,defaultMatchWidth:"wide",parsePatterns:U_,defaultParseWidth:"any"}),quarter:Gi({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:G_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Gi({matchPatterns:K_,defaultMatchWidth:"wide",parsePatterns:Z_,defaultParseWidth:"any"}),day:Gi({matchPatterns:Q_,defaultMatchWidth:"wide",parsePatterns:J_,defaultParseWidth:"any"}),dayPeriod:Gi({matchPatterns:tw,defaultMatchWidth:"any",parsePatterns:ew,defaultParseWidth:"any"})},iw={code:"en-US",formatDistance:D_,formatLong:O_,formatRelative:A_,localize:H_,match:nw,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sw(n,t){const e=Ut(n,void 0);return __(e,k_(e))+1}function rw(n,t){const e=Ut(n,void 0),i=+Gs(e)-+w_(e);return Math.round(i/Iu)+1}function Hu(n,t){var e,i,s,r;const a=Ut(n,t==null?void 0:t.in),o=a.getFullYear(),l=Ui(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=pe((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=We(u,t),h=pe((t==null?void 0:t.in)||n,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const g=We(h,t);return+a>=+d?o+1:+a>=+g?o:o-1}function aw(n,t){var e,i,s,r;const a=Ui(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Hu(n,t),c=pe((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),We(c,t)}function ow(n,t){const e=Ut(n,t==null?void 0:t.in),i=+We(e,t)-+aw(e,t);return Math.round(i/Iu)+1}function gt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const ln={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return gt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):gt(e+1,2)},d(n,t){return gt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return gt(n.getHours()%12||12,t.length)},H(n,t){return gt(n.getHours(),t.length)},m(n,t){return gt(n.getMinutes(),t.length)},s(n,t){return gt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return gt(s,t.length)}},Zn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wu={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return ln.y(n,t)},Y:function(n,t,e,i){const s=Hu(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return gt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):gt(r,t.length)},R:function(n,t){const e=zu(n);return gt(e,t.length)},u:function(n,t){const e=n.getFullYear();return gt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return gt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return gt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return ln.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return gt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ow(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):gt(s,t.length)},I:function(n,t,e){const i=rw(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):gt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):ln.d(n,t)},D:function(n,t,e){const i=sw(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):gt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return gt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return gt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return gt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Zn.noon:i===0?s=Zn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Zn.evening:i>=12?s=Zn.afternoon:i>=4?s=Zn.morning:s=Zn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return ln.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):ln.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):gt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):gt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):ln.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):ln.s(n,t)},S:function(n,t){return ln.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Vu(i);case"XXXX":case"XX":return Pn(i);case"XXXXX":case"XXX":default:return Pn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Vu(i);case"xxxx":case"xx":return Pn(i);case"xxxxx":case"xxx":default:return Pn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Yu(i,":");case"OOOO":default:return"GMT"+Pn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Yu(i,":");case"zzzz":default:return"GMT"+Pn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return gt(i,t.length)},T:function(n,t,e){return gt(+n,t.length)}};function Yu(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+gt(r,2)}function Vu(n,t){return n%60===0?(n>0?"-":"+")+gt(Math.abs(n)/60,2):Pn(n,t)}function Pn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=gt(Math.trunc(i/60),2),r=gt(i%60,2);return e+s+t+r}const ju=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$u=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lw=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return ju(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",ju(i,t)).replace("{{time}}",$u(s,t))},cw={p:$u,P:lw},uw=/^D+$/,dw=/^Y+$/,hw=["D","DD","YY","YYYY"];function fw(n){return uw.test(n)}function gw(n){return dw.test(n)}function pw(n,t,e){const i=mw(n,t,e);if(console.warn(i),hw.includes(n))throw new RangeError(i)}function mw(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const yw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xw=/^'([^]*?)'?$/,_w=/''/g,ww=/[a-zA-Z]/;function vw(n,t,e){var i,s,r,a,o,l,c,u;const d=Ui(),h=(e==null?void 0:e.locale)??d.locale??iw,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(r=d.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,b=Ut(n,e==null?void 0:e.in);if(!M_(b))throw new RangeError("Invalid time value");let _=t.match(bw).map(M=>{const k=M[0];if(k==="p"||k==="P"){const C=cw[k];return C(M,h.formatLong)}return M}).join("").match(yw).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:Mw(M)};if(Wu[k])return{isToken:!0,value:M};if(k.match(ww))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});h.localize.preprocessor&&(_=h.localize.preprocessor(b,_));const w={firstWeekContainsDate:g,weekStartsOn:p,locale:h};return _.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&gw(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&fw(k))&&pw(k,t,String(n));const C=Wu[k[0]];return C(b,k,h.localize,w)}).join("")}function Mw(n){const t=n.match(xw);return t?t[1].replace(_w,"'"):n}function kw(n,t){const e=Ut(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=pe(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function Sw(){return Object.assign({},Ui())}function Dw(n){return Math.trunc(n*m_)}function Tw(n){const t=n/p_;return Math.trunc(t)}function qu(n,t,e){return y_(n,-t)}function Uu(n,t,e){const i=Sw(),s=Ow(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Cw(s,t):Pw(s,t)}function Cw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Pw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Ow(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Ew(n,t){const e=Nw(t);return"formatToParts"in e?Rw(e,n):Lw(e,n)}const Aw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Rw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Aw[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Lw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Fa={},Xu=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Iw=Xu==="06/25/2014, 00:00:00"||Xu==="06/25/2014 00:00:00";function Nw(n){return Fa[n]||(Fa[n]=Iw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Fa[n]}function za(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Gu=36e5,Fw=6e4,Ba={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ki(n,t,e){if(!n)return 0;let i=Ba.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ba.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ku(s)?-(s*Gu):NaN;if(i=Ba.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Ku(s,a)?(r=Math.abs(s)*Gu+a*Fw,i[1]==="+"?-r:r):NaN}if(Hw(n)){t=new Date(t||Date.now());const a=e?t:zw(t),o=Ha(a,n);return-(e?o:Bw(t,o,n))}return NaN}function zw(n){return za(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ha(n,t){const e=Ew(n,t),i=za(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Bw(n,t,e){let i=n.getTime()-t;const s=Ha(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ha(new Date(i),e);return s===r?s:Math.max(s,r)}function Ku(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Zu={};function Hw(n){if(Zu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Zu[n]=!0,!0}catch{return!1}}const Ww=60*1e3,Yw={X:function(n,t,e){const i=Wa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Qu(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=Wa(e.timeZone,n);switch(t){case"x":return Qu(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=Wa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Vw(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Uu("short",n,e);case"zzzz":default:return Uu("long",n,e)}}};function Wa(n,t){const e=n?Ki(n,t,!0)/Ww:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Zs(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Zs(Math.floor(i/60),2),r=Zs(Math.floor(i%60),2);return e+s+t+r}function Qu(n,t){return n%60===0?(n>0?"-":"+")+Zs(Math.abs(n)/60,2):Qn(n,t)}function Vw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Zs(r,2)}function Ju(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const td=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ya=36e5,ed=6e4,jw=2,Xt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:td};function Qs(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?jw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=$w(n),{year:s,restDateString:r}=qw(i.date,e),a=Uw(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=Xw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ki(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Ju(new Date(o+l)),c=Ju(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function $w(n){const t={};let e=Xt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Xt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function qw(n,t){if(n){const e=Xt.YYY[t],i=Xt.YYYYY[t];let s=Xt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Xt.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Uw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=Xt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,sd(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Xt.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return Zw(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=Xt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return sd(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=Xt.Www.exec(n),r)return s=parseInt(r[1],10)-1,rd(s)?nd(t,s):new Date(NaN);if(r=Xt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return rd(s,a)?nd(t,s,a):new Date(NaN)}return null}function Xw(n){let t,e,i=Xt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Va(t)?t%24*Ya:NaN;if(i=Xt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Va(t,e)?t%24*Ya+e*ed:NaN;if(i=Xt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Va(t,e,s)?t%24*Ya+e*ed+s*1e3:NaN}return null}function nd(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Gw=[31,28,31,30,31,30,31,31,30,31,30,31],Kw=[31,29,31,30,31,30,31,31,30,31,30,31];function id(n){return n%400===0||n%4===0&&n%100!==0}function sd(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=id(n);if(i&&e>Kw[t]||!i&&e>Gw[t])return!1}return!0}function Zw(n,t){if(t<1)return!1;const e=id(n);return!(e&&t>366||!e&&t>365)}function rd(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Va(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Qw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Jw(n,t,e={}){t=String(t);const i=t.match(Qw);if(i){const s=Qs(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+Yw[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return vw(n,t,e)}function ad(n,t,e){n=Qs(n,e);const i=Ki(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function t1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Jw(ad(n,t,{timeZone:i.timeZone}),e,i)}function e1(n,t,e){if(typeof n=="string"&&!n.match(td))return Qs(n,{...e,timeZone:t});n=Qs(n,e);const i=za(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ki(t,new Date(i));return new Date(i+s)}function n1(n,t){return-Ki(n,t)}function ja(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return t1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const i1={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function $a(n){return n&&l_.find(t=>n<=i1[t])||null}const Jn=(n,t)=>new Date(n.getTime()-n1(t,n));class ve{constructor(t){we(this,"timeframeText"),we(this,"key"),we(this,"display"),we(this,"timeframeLength"),we(this,"allowedTiers"),we(this,"defaultResponseGranularity"),we(this,"dataGranularity"),we(this,"isRelative"),we(this,"_startCustom"),we(this,"_endCustom"),we(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=e1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return ad(e,t)}}class s1 extends ve{rawStart(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Jn(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class r1 extends ve{rawStart(t){let e=Kn(this.tzAdjustedDate(t));return t&&(e=Jn(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class a1 extends ve{rawEnd(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Jn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=We(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Jn(i,t)),i}}class o1 extends ve{rawEnd(t){let e=Kn(this.tzAdjustedDate(t));return t&&(e=Jn(e,t)),e}rawStart(t){let e=Kn(qu(this.tzAdjustedDate(t),1));return t&&(e=Jn(e,t)),e}}Ct.FIFTEEN_MIN,new ve({key:Ct.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),Ct.ONE_HOUR,new ve({key:Ct.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),Ct.SIX_HOUR,new ve({key:Ct.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.TWELVE_HOUR,new ve({key:Ct.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.ONE_DAY,new ve({key:Ct.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Ct.SEVEN_DAY,new ve({key:Ct.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Ct.THIRTY_DAY,new ve({key:Ct.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Ct.CURRENT_WEEK,new s1({key:Ct.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=We(new Date,{weekStartsOn:1});return(Ks(Fu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Ct.CURRENT_MONTH,new r1({key:Ct.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Kn(new Date);return(Ks(Fu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Ct.PREVIOUS_WEEK,new a1({key:Ct.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Ct.PREVIOUS_MONTH,new o1({key:Ct.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Kn(new Date),e=Kn(qu(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=l1(t,e)),60*60*24*kw(new Date().setMonth(new Date().getMonth()-1))+Dw(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function l1(n,t){return Tw(n.getTimezoneOffset()-t.getTimezoneOffset())}function c1(n){return f.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${ja(e)} - ${ja(i,{includeTZ:!0})}`:""})}function u1(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return zs.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),a=n.tooltipState.width||this.width,o=r.width/2,l=Oa(s,a,o),c=s.y,u=s.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Pa(n.tooltipState,i)}}}}))}}function d1(n){const t=f.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!J((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}}}}),e=f.computed(()=>{var l,c;return{title:{display:!J((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};zs.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,h=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,b=Oa(c,d,g);let _=Wx(c,h,p);const w=c.y<p?"top":"bottom",M=c.x<g?"left":"center";return h>u.height&&(_=0),{x:b,y:_,xAlign:M,yAlign:w}};const s=f.computed(()=>{switch(n.granularity.value){case"minutely":return"minute";case"hourly":return"hour";case"daily":return"day";default:return"day"}}),r=f.computed(()=>_x(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),a=f.computed(()=>["daily","weekly"].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:f.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:s.value,displayFormats:{minute:"h:mm:ss a",hour:r.value,day:a.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{Pa(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function h1(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=ut.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Gn(i.indexOf(u),He),data:a.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h={},g=Array.isArray(o)?Gn(d,o):o[u.name]||Gn(d);return h[u.name]=g,{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:g,data:a.map(p=>r[`${p.id},${u.id}`]||null)}})}function f1(n,t){const{i18n:e}=ut.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0;if(!s.length||!a)return{datasets:[],labels:[]};const u=c&&o||a,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(D=>a.map((y,x)=>{const T=D.event[d],A=c?`${T},${y}`:`${x},${y}`,R=D.event[y];return[A,R]})):s.map(D=>{const y=c?`${D.event[d]},${D.event[h]}`:`${d},${h}`,x=D.event[a[0]];return[y,x]})),p=Object.keys(g).reduce((D,y)=>{const[x]=y.split(","),T=g[y];return D[x]?D[x]+=T:D[x]=T,D},{}),b=Object.entries(p).sort(([,D],[,y])=>Number(y)-Number(D)).map(([D])=>D),_=r[d],w=r[h],M=c&&_&&Object.entries(_).map(([D,y])=>({id:D,name:y.name}))||a.map(D=>({id:D,name:D})),k=c&&w&&Object.entries(w).map(([D,y])=>({id:D,name:y.name}))||a.map(D=>({id:D,name:D}));if(d!=="status_code"&&d!=="status_code_grouped"&&(M.sort((D,y)=>b.indexOf(D.id)-b.indexOf(y.id)),k.sort((D,y)=>b.indexOf(D.id)-b.indexOf(y.id))),!M||!k)return{labels:[],datasets:[]};const C=h1({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:u,barSegmentLabels:k,pivotRecords:g,rowLabels:M,colorPalette:n.colorPalette||He});return{labels:c?M.map(D=>e&&e.te(`chartLabels.${D.name}`)&&e.t(`chartLabels.${D.name}`)||D.name):a.map(D=>e&&e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||D),datasets:C}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const g1="#6c7489",p1="#6c7489",m1="#995c00",y1="20px",od="24px",b1="40px",x1="48px",_1=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),w1=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return xu(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},v1=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return _1(o,l,e)};function M1(n,t){const{i18n:e}=ut.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],d=r[u],h=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||a.map(S=>({id:S,name:S})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=w1(o),b=v1(o,l,g,p,s),_=new Set,w=s!=null&&s.length?s.reduce((S,O)=>{const D=new Date(O.timestamp).valueOf(),y=O.event;for(const x of a)_.add(x),D in S||(S[D]={}),x in S[D]||(S[D][x]={});for(const x of a)h.forEach(T=>{y[u]===T.id||x===T.id?(S[D][x]||(S[D][x]={}),S[D][x][T.name]=Math.round(Number(y[x])*1e3)/1e3):c.length||(S[D][x]||(S[D][x]={}),S[D][x][T.name]=Math.round(Number(y[T.id])*1e3)/1e3)});return S},{}):{},M=a.length===1?a.flatMap(S=>h.map(O=>[S,O.name])):h.map(S=>[S.name,S.name]),k={},C=[...M].map(([S,O],D)=>{const y=b.map(R=>R in w&&S in w[R]?{x:R,y:w[R][S][O]||0}:{x:R,y:0});let{colorPalette:x,fill:T}=n;J(x)&&(x=He);const A=Array.isArray(x)?Gn(D,x):x[O]||Gn(D);return k[O]=A,{rawDimension:O,rawMetric:S,label:e&&e.te(`chartLabels.${O}`)&&e.t(`chartLabels.${O}`)||O,borderColor:A,backgroundColor:A,data:y,total:y.reduce((R,{y:L})=>R+Number(L),0),...Xx,fill:T,borderWidth:T?Kx:Gx}});if(C.sort((S,O)=>Number(S.total)<Number(O.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const O=n.threshold[S];O&&C.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:g1,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(D=>({x:D,y:O}))})}return{datasets:C,colorMap:k}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const k1=(n,t)=>{f.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function S1(){const{i18n:n}=ut.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const D1="analytics-query-provider";function T1(){const n=f.inject(D1);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const ut={useBarChartOptions:e_,useChartJSCommon:i_,useChartLegendValues:r_,useChartSelectedRange:c1,useExploreResultToDatasets:f1,useExploreResultToTimeDataset:M1,useDoughnutChartOptions:u1,useLinechartOptions:d1,useI18n:Gh,useReportChartDataForSynthetics:k1,useTranslatedUnits:S1,useEvaluateFeatureFlag:T1};var Pt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Pt||{}),ti=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ti||{});/*!
|
|
19
19
|
* chartjs-plugin-annotation v3.1.0
|
|
20
20
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
21
21
|
* (c) 2024 chartjs-plugin-annotation Contributors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/analytics-chart",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/vitals-chart.umd.js",
|
|
6
6
|
"module": "./dist/vitals-chart.es.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"pretty-bytes": "^6.1.1",
|
|
66
66
|
"uuid": "^10.0.0",
|
|
67
67
|
"vue-chartjs": "^5.3.1",
|
|
68
|
-
"@kong-ui-public/analytics-utilities": "^5.8.
|
|
68
|
+
"@kong-ui-public/analytics-utilities": "^5.8.1"
|
|
69
69
|
},
|
|
70
70
|
"distSizeChecker": {
|
|
71
71
|
"warningLimit": "1.35MB",
|