@deskhero/dh_ui 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dh_ui.es.js +2 -2
- package/dist/dh_ui.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/dh_ui.umd.js
CHANGED
|
@@ -16,4 +16,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
16
16
|
* Released under the MIT License
|
|
17
17
|
*/class x0{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,i,a){const r=n.listeners[a],o=n.duration;r.forEach(l=>l({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=$u.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,a)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,l=!1,M;for(;o>=0;--o)M=r[o],M._active?(M._total>i.duration&&(i.duration=M._total),M.tick(e),l=!0):(r[o]=r[r.length-1],r.pop());l&&(a.draw(),this._notify(a,i,e,"progress")),r.length||(i.running=!1,this._notify(a,i,e,"complete"),i.initial=!1),n+=r.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);!n||(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,a)=>Math.max(i,a._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const i=n.items;let a=i.length-1;for(;a>=0;--a)i[a].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ot=new x0;const Ec="transparent",O0={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=Mc(t||Ec),a=i.valid&&Mc(e||Ec);return a&&a.valid?a.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class S0{constructor(e,n,i,a){const r=n[i];a=Ja([e.to,a,r,e.from]);const o=Ja([e.from,r,a]);this._active=!0,this._fn=e.fn||O0[e.type||typeof o],this._easing=Rn[e.easing]||Rn.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=i,this._from=o,this._to=a,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const a=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=Ja([e.to,n,a,e.from]),this._from=Ja([e.from,a,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,a=this._prop,r=this._from,o=this._loop,l=this._to;let M;if(this._active=r!==l&&(o||n<i),!this._active){this._target[a]=l,this._notify(!0);return}if(n<0){this._target[a]=r;return}M=n/i%2,M=o&&M>1?2-M:M,M=this._easing(Math.min(1,Math.max(0,M))),this._target[a]=this._fn(r,l,M)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let a=0;a<i.length;a++)i[a][n]()}}const E0=["x","y","borderWidth","radius","tension"],b0=["color","borderColor","backgroundColor"];oe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const C0=Object.keys(oe.animation);oe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),oe.set("animations",{colors:{type:"color",properties:b0},numbers:{type:"number",properties:E0}}),oe.describe("animations",{_fallback:"animation"}),oe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}});class bc{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!le(e))return;const n=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const a=e[i];if(!le(a))return;const r={};for(const o of C0)r[o]=a[o];(Te(a.properties)&&a.properties||[i]).forEach(o=>{(o===i||!n.has(o))&&n.set(o,r)})})}_animateOptions(e,n){const i=n.options,a=k0(e,i);if(!a)return[];const r=this._createAnimations(a,i);return i.$shared&&w0(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,n){const i=this._properties,a=[],r=e.$animations||(e.$animations={}),o=Object.keys(n),l=Date.now();let M;for(M=o.length-1;M>=0;--M){const u=o[M];if(u.charAt(0)==="$")continue;if(u==="options"){a.push(...this._animateOptions(e,n));continue}const c=n[u];let g=r[u];const y=i.get(u);if(g)if(y&&g.active()){g.update(y,c,l);continue}else g.cancel();if(!y||!y.duration){e[u]=c;continue}r[u]=g=new S0(y,e,u,c),a.push(g)}return a}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const i=this._createAnimations(e,n);if(i.length)return Ot.add(this._chart,i),!0}}function w0(t,e){const n=[],i=Object.keys(e);for(let a=0;a<i.length;a++){const r=t[i[a]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}function k0(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Cc(t,e){const n=t&&t.options||{},i=n.reverse,a=n.min===void 0?e:0,r=n.max===void 0?e:0;return{start:i?r:a,end:i?a:r}}function v0(t,e,n){if(n===!1)return!1;const i=Cc(t,n),a=Cc(e,n);return{top:a.end,right:i.end,bottom:a.start,left:i.start}}function Q0(t){let e,n,i,a;return le(t)?(e=t.top,n=t.right,i=t.bottom,a=t.left):e=n=i=a=t,{top:e,right:n,bottom:i,left:a,disabled:t===!1}}function wc(t,e){const n=[],i=t._getSortedDatasetMetas(e);let a,r;for(a=0,r=i.length;a<r;++a)n.push(i[a].index);return n}function kc(t,e,n,i={}){const a=t.keys,r=i.mode==="single";let o,l,M,u;if(e!==null){for(o=0,l=a.length;o<l;++o){if(M=+a[o],M===n){if(i.all)continue;break}u=t.values[M],Re(u)&&(r||e===0||ft(e)===ft(u))&&(e+=u)}return e}}function _0(t){const e=Object.keys(t),n=new Array(e.length);let i,a,r;for(i=0,a=e.length;i<a;++i)r=e[i],n[i]={x:r,y:t[r]};return n}function vc(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function Y0(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function U0(t){const{min:e,max:n,minDefined:i,maxDefined:a}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}function P0(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Qc(t,e,n,i){for(const a of e.getMatchingVisibleMetas(i).reverse()){const r=t[a.index];if(n&&r>0||!n&&r<0)return a.index}return null}function _c(t,e){const{chart:n,_cachedMeta:i}=t,a=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:l}=i,M=r.axis,u=o.axis,c=Y0(r,o,i),g=e.length;let y;for(let d=0;d<g;++d){const j=e[d],{[M]:f,[u]:I}=j,N=j._stacks||(j._stacks={});y=N[u]=P0(a,c,f),y[l]=I,y._top=Qc(y,o,!0,i.type),y._bottom=Qc(y,o,!1,i.type)}}function Vs(t,e){const n=t.scales;return Object.keys(n).filter(i=>n[i].axis===e).shift()}function R0(t,e){return Vt(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Z0(t,e,n){return Vt(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function $n(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(!!i){e=e||t._parsed;for(const a of e){const r=a._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n]}}}const Gs=t=>t==="reset"||t==="none",Yc=(t,e)=>e?t:Object.assign({},t),B0=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:wc(n,!0),values:null};class gt{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,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.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=vc(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&$n(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,i=this.getDataset(),a=(g,y,d,j)=>g==="x"?y:g==="r"?j:d,r=n.xAxisID=Me(i.xAxisID,Vs(e,"x")),o=n.yAxisID=Me(i.yAxisID,Vs(e,"y")),l=n.rAxisID=Me(i.rAxisID,Vs(e,"r")),M=n.indexAxis,u=n.iAxisID=a(M,r,o,l),c=n.vAxisID=a(M,o,r,l);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Gu(this._data,this),e._stacked&&$n(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),i=this._data;if(le(n))this._data=_0(n);else if(i!==n){if(i){Gu(i,this);const a=this._cachedMeta;$n(a),a._parsed=[]}n&&Object.isExtensible(n)&&rz(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,i=this.getDataset();let a=!1;this._dataCheck();const r=n._stacked;n._stacked=vc(n.vScale,n),n.stack!==i.stack&&(a=!0,$n(n),n.stack=i.stack),this._resyncElements(e),(a||r!==n._stacked)&&_c(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:i,_data:a}=this,{iScale:r,_stacked:o}=i,l=r.axis;let M=e===0&&n===a.length?!0:i._sorted,u=e>0&&i._parsed[e-1],c,g,y;if(this._parsing===!1)i._parsed=a,i._sorted=!0,y=a;else{Te(a[e])?y=this.parseArrayData(i,a,e,n):le(a[e])?y=this.parseObjectData(i,a,e,n):y=this.parsePrimitiveData(i,a,e,n);const d=()=>g[l]===null||u&&g[l]<u[l];for(c=0;c<n;++c)i._parsed[c+e]=g=y[c],M&&(d()&&(M=!1),u=g);i._sorted=M}o&&_c(this,y)}parsePrimitiveData(e,n,i,a){const{iScale:r,vScale:o}=e,l=r.axis,M=o.axis,u=r.getLabels(),c=r===o,g=new Array(a);let y,d,j;for(y=0,d=a;y<d;++y)j=y+i,g[y]={[l]:c||r.parse(u[j],j),[M]:o.parse(n[j],j)};return g}parseArrayData(e,n,i,a){const{xScale:r,yScale:o}=e,l=new Array(a);let M,u,c,g;for(M=0,u=a;M<u;++M)c=M+i,g=n[c],l[M]={x:r.parse(g[0],c),y:o.parse(g[1],c)};return l}parseObjectData(e,n,i,a){const{xScale:r,yScale:o}=e,{xAxisKey:l="x",yAxisKey:M="y"}=this._parsing,u=new Array(a);let c,g,y,d;for(c=0,g=a;c<g;++c)y=c+i,d=n[y],u[c]={x:r.parse(Pt(d,l),y),y:o.parse(Pt(d,M),y)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,i){const a=this.chart,r=this._cachedMeta,o=n[e.axis],l={keys:wc(a,!0),values:n._stacks[e.axis]};return kc(l,o,r.index,{mode:i})}updateRangeFromParsed(e,n,i,a){const r=i[n.axis];let o=r===null?NaN:r;const l=a&&i._stacks[n.axis];a&&l&&(a.values=l,o=kc(a,r,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const i=this._cachedMeta,a=i._parsed,r=i._sorted&&e===i.iScale,o=a.length,l=this._getOtherScale(e),M=B0(n,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:g}=U0(l);let y,d;function j(){d=a[y];const f=d[l.axis];return!Re(d[e.axis])||c>f||g<f}for(y=0;y<o&&!(!j()&&(this.updateRangeFromParsed(u,e,d,M),r));++y);if(r){for(y=o-1;y>=0;--y)if(!j()){this.updateRangeFromParsed(u,e,d,M);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,i=[];let a,r,o;for(a=0,r=n.length;a<r;++a)o=n[a][e.axis],Re(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,i=n.iScale,a=n.vScale,r=this.getParsed(e);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:a?""+a.getLabelForValue(r[a.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=Q0(Me(this.options.clip,v0(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,i=this._cachedMeta,a=i.data||[],r=n.chartArea,o=[],l=this._drawStart||0,M=this._drawCount||a.length-l,u=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(e,r,l,M),c=l;c<l+M;++c){const g=a[c];g.hidden||(g.active&&u?o.push(g):g.draw(e,r))}for(c=0;c<o.length;++c)o[c].draw(e,r)}getStyle(e,n){const i=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,n,i){const a=this.getDataset();let r;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];r=o.$context||(o.$context=Z0(this.getContext(),e,o)),r.parsed=this.getParsed(e),r.raw=a.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=R0(this.chart.getContext(),this.index)),r.dataset=a,r.index=r.datasetIndex=this.index;return r.active=!!n,r.mode=i,r}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",i){const a=n==="active",r=this._cachedDataOpts,o=e+"-"+n,l=r[o],M=this.enableOptionSharing&&nt(i);if(l)return Yc(l,M);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,e),g=a?[`${e}Hover`,"hover",e,""]:[e,""],y=u.getOptionScopes(this.getDataset(),c),d=Object.keys(oe.elements[e]),j=()=>this.getContext(i,a),f=u.resolveNamedOptions(y,d,j,g);return f.$shared&&(f.$shared=M,r[o]=Object.freeze(Yc(f,M))),f}_resolveAnimations(e,n,i){const a=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,l=r[o];if(l)return l;let M;if(a.options.animation!==!1){const c=this.chart.config,g=c.datasetAnimationScopeKeys(this._type,n),y=c.getOptionScopes(this.getDataset(),g);M=c.createResolver(y,this.getContext(e,i,n))}const u=new bc(a,M&&M.animations);return M&&M._cacheable&&(r[o]=Object.freeze(u)),u}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Gs(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const i=this.resolveDataElementOptions(e,n),a=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==a;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(e,n,i,a){Gs(a)?Object.assign(e,i):this._resolveAnimations(n,a).update(e,i)}updateSharedOptions(e,n,i){e&&!Gs(n)&&this._resolveAnimations(void 0,n).update(e,i)}_setStyle(e,n,i,a){e.active=a;const r=this.getStyle(n,a);this._resolveAnimations(n,i,a).update(e,{options:!a&&this.getSharedOptions(r)||r})}removeHoverStyle(e,n,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,n,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,i=this._cachedMeta.data;for(const[l,M,u]of this._syncList)this[l](M,u);this._syncList=[];const a=i.length,r=n.length,o=Math.min(r,a);o&&this.parse(0,o),r>a?this._insertElements(a,r-a,e):r<a&&this._removeElements(r,a-r)}_insertElements(e,n,i=!0){const a=this._cachedMeta,r=a.data,o=e+n;let l;const M=u=>{for(u.length+=n,l=u.length-1;l>=o;l--)u[l]=u[l-n]};for(M(r),l=e;l<o;++l)r[l]=new this.dataElementType;this._parsing&&M(a._parsed),this.parse(e,n),i&&this.updateElements(r,e,n,"reset")}updateElements(e,n,i,a){}_removeElements(e,n){const i=this._cachedMeta;if(this._parsing){const a=i._parsed.splice(e,n);i._stacked&&$n(i,a)}i.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,i,a]=e;this[n](i,a)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}gt.defaults={},gt.prototype.datasetElementType=null,gt.prototype.dataElementType=null;function V0(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let a=0,r=n.length;a<r;a++)i=i.concat(n[a].controller.getAllParsedValues(t));t._cache.$bar=Wu(i.sort((a,r)=>a-r))}return t._cache.$bar}function G0(t){const e=t.iScale,n=V0(e,t.type);let i=e._length,a,r,o,l;const M=()=>{o===32767||o===-32768||(nt(l)&&(i=Math.min(i,Math.abs(o-l)||i)),l=o)};for(a=0,r=n.length;a<r;++a)o=e.getPixelForValue(n[a]),M();for(l=void 0,a=0,r=e.ticks.length;a<r;++a)o=e.getPixelForTick(a),M();return i}function W0(t,e,n,i){const a=n.barThickness;let r,o;return Ne(a)?(r=e.min*n.categoryPercentage,o=n.barPercentage):(r=a*i,o=1),{chunk:r/i,ratio:o,start:e.pixels[t]-r/2}}function $0(t,e,n,i){const a=e.pixels,r=a[t];let o=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const M=n.categoryPercentage;o===null&&(o=r-(l===null?e.end-e.start:l-r)),l===null&&(l=r+r-o);const u=r-(r-Math.min(o,l))/2*M;return{chunk:Math.abs(l-o)/2*M/i,ratio:n.barPercentage,start:u}}function H0(t,e,n,i){const a=n.parse(t[0],i),r=n.parse(t[1],i),o=Math.min(a,r),l=Math.max(a,r);let M=o,u=l;Math.abs(o)>Math.abs(l)&&(M=l,u=o),e[n.axis]=u,e._custom={barStart:M,barEnd:u,start:a,end:r,min:o,max:l}}function Uc(t,e,n,i){return Te(t)?H0(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Pc(t,e,n,i){const a=t.iScale,r=t.vScale,o=a.getLabels(),l=a===r,M=[];let u,c,g,y;for(u=n,c=n+i;u<c;++u)y=e[u],g={},g[a.axis]=l||a.parse(o[u],u),M.push(Uc(y,g,r,u));return M}function Ws(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function F0(t,e,n){return t!==0?ft(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function J0(t){let e,n,i,a,r;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(a="end",r="start"):(a="start",r="end"),{start:n,end:i,reverse:e,top:a,bottom:r}}function X0(t,e,n,i){let a=e.borderSkipped;const r={};if(!a){t.borderSkipped=r;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:l,reverse:M,top:u,bottom:c}=J0(t);a==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?a=u:(n._bottom||0)===i?a=c:(r[Rc(c,o,l,M)]=!0,a=u)),r[Rc(a,o,l,M)]=!0,t.borderSkipped=r}function Rc(t,e,n,i){return i?(t=K0(t,e,n),t=Zc(t,n,e)):t=Zc(t,e,n),t}function K0(t,e,n){return t===e?n:t===n?e:t}function Zc(t,e,n){return t==="start"?e:t==="end"?n:t}function q0(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class er extends gt{parsePrimitiveData(e,n,i,a){return Pc(e,n,i,a)}parseArrayData(e,n,i,a){return Pc(e,n,i,a)}parseObjectData(e,n,i,a){const{iScale:r,vScale:o}=e,{xAxisKey:l="x",yAxisKey:M="y"}=this._parsing,u=r.axis==="x"?l:M,c=o.axis==="x"?l:M,g=[];let y,d,j,f;for(y=i,d=i+a;y<d;++y)f=n[y],j={},j[r.axis]=r.parse(Pt(f,u),y),g.push(Uc(Pt(f,c),j,o,y));return g}updateRangeFromParsed(e,n,i,a){super.updateRangeFromParsed(e,n,i,a);const r=i._custom;r&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:i,vScale:a}=n,r=this.getParsed(e),o=r._custom,l=Ws(o)?"["+o.start+", "+o.end+"]":""+a.getLabelForValue(r[a.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,i,a){const r=a==="reset",{index:o,_cachedMeta:{vScale:l}}=this,M=l.getBasePixel(),u=l.isHorizontal(),c=this._getRuler(),{sharedOptions:g,includeOptions:y}=this._getSharedOptions(n,a);for(let d=n;d<n+i;d++){const j=this.getParsed(d),f=r||Ne(j[l.axis])?{base:M,head:M}:this._calculateBarValuePixels(d),I=this._calculateBarIndexPixels(d,c),N=(j._stacks||{})[l.axis],D={horizontal:u,base:f.base,enableBorderRadius:!N||Ws(j._custom)||o===N._top||o===N._bottom,x:u?f.head:I.center,y:u?I.center:f.head,height:u?I.size:Math.abs(f.size),width:u?Math.abs(f.size):I.size};y&&(D.options=g||this.resolveDataElementOptions(d,e[d].active?"active":a));const A=D.options||e[d].options;X0(D,A,N,o),q0(D,A,c.ratio),this.updateElement(e[d],d,D,a)}}_getStacks(e,n){const{iScale:i}=this._cachedMeta,a=i.getMatchingVisibleMetas(this._type).filter(M=>M.controller.options.grouped),r=i.options.stacked,o=[],l=M=>{const u=M.controller.getParsed(n),c=u&&u[M.vScale.axis];if(Ne(c)||isNaN(c))return!0};for(const M of a)if(!(n!==void 0&&l(M))&&((r===!1||o.indexOf(M.stack)===-1||r===void 0&&M.stack===void 0)&&o.push(M.stack),M.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,i){const a=this._getStacks(e,i),r=n!==void 0?a.indexOf(n):-1;return r===-1?a.length-1:r}_getRuler(){const e=this.options,n=this._cachedMeta,i=n.iScale,a=[];let r,o;for(r=0,o=n.data.length;r<o;++r)a.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const l=e.barThickness;return{min:l||G0(n),pixels:a,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:i},options:{base:a,minBarLength:r}}=this,o=a||0,l=this.getParsed(e),M=l._custom,u=Ws(M);let c=l[n.axis],g=0,y=i?this.applyStack(n,l,i):c,d,j;y!==c&&(g=y-c,y=c),u&&(c=M.barStart,y=M.barEnd-M.barStart,c!==0&&ft(c)!==ft(M.barEnd)&&(g=0),g+=c);const f=!Ne(a)&&!u?a:g;let I=n.getPixelForValue(f);if(this.chart.getDataVisibility(e)?d=n.getPixelForValue(g+y):d=I,j=d-I,Math.abs(j)<r){j=F0(j,n,o)*r,c===o&&(I-=j/2);const N=n.getPixelForDecimal(0),D=n.getPixelForDecimal(1),A=Math.min(N,D),p=Math.max(N,D);I=Math.max(Math.min(I,p),A),d=I+j}if(I===n.getPixelForValue(o)){const N=ft(j)*n.getLineWidthForValue(o)/2;I+=N,j-=N}return{size:j,base:I,head:d,center:d+j/2}}_calculateBarIndexPixels(e,n){const i=n.scale,a=this.options,r=a.skipNull,o=Me(a.maxBarThickness,1/0);let l,M;if(n.grouped){const u=r?this._getStackCount(e):n.stackCount,c=a.barThickness==="flex"?$0(e,n,a,u):W0(e,n,a,u),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0);l=c.start+c.chunk*g+c.chunk/2,M=Math.min(o,c.chunk*c.ratio)}else l=i.getPixelForValue(this.getParsed(e)[i.axis],e),M=Math.min(o,n.min*n.ratio);return{base:l-M/2,head:l+M/2,center:l,size:M}}draw(){const e=this._cachedMeta,n=e.vScale,i=e.data,a=i.length;let r=0;for(;r<a;++r)this.getParsed(r)[n.axis]!==null&&i[r].draw(this._ctx)}}er.id="bar",er.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},er.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class $s extends gt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,i,a){const r=super.parsePrimitiveData(e,n,i,a);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(e,n,i,a){const r=super.parseArrayData(e,n,i,a);for(let o=0;o<r.length;o++){const l=n[i+o];r[o]._custom=Me(l[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(e,n,i,a){const r=super.parseObjectData(e,n,i,a);for(let o=0;o<r.length;o++){const l=n[i+o];r[o]._custom=Me(l&&l.r&&+l.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let i=e.length-1;i>=0;--i)n=Math.max(n,e[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,{xScale:i,yScale:a}=n,r=this.getParsed(e),o=i.getLabelForValue(r.x),l=a.getLabelForValue(r.y),M=r._custom;return{label:n.label,value:"("+o+", "+l+(M?", "+M:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,i,a){const r=a==="reset",{iScale:o,vScale:l}=this._cachedMeta,{sharedOptions:M,includeOptions:u}=this._getSharedOptions(n,a),c=o.axis,g=l.axis;for(let y=n;y<n+i;y++){const d=e[y],j=!r&&this.getParsed(y),f={},I=f[c]=r?o.getPixelForDecimal(.5):o.getPixelForValue(j[c]),N=f[g]=r?l.getBasePixel():l.getPixelForValue(j[g]);f.skip=isNaN(I)||isNaN(N),u&&(f.options=M||this.resolveDataElementOptions(y,d.active?"active":a),r&&(f.options.radius=0)),this.updateElement(d,y,f,a)}}resolveDataElementOptions(e,n){const i=this.getParsed(e);let a=super.resolveDataElementOptions(e,n);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const r=a.radius;return n!=="active"&&(a.radius=0),a.radius+=Me(i&&i._custom,r),a}}$s.id="bubble",$s.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},$s.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function ep(t,e,n){let i=1,a=1,r=0,o=0;if(e<De){const l=t,M=l+e,u=Math.cos(l),c=Math.sin(l),g=Math.cos(M),y=Math.sin(M),d=(A,p,m)=>Pn(A,l,M,!0)?1:Math.max(p,p*n,m,m*n),j=(A,p,m)=>Pn(A,l,M,!0)?-1:Math.min(p,p*n,m,m*n),f=d(0,u,g),I=d(be,c,y),N=j(Ee,u,g),D=j(Ee+be,c,y);i=(f-N)/2,a=(I-D)/2,r=-(f+N)/2,o=-(I+D)/2}return{ratioX:i,ratioY:a,offsetX:r,offsetY:o}}class Hn extends gt{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const i=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=i;else{let r=M=>+i[M];if(le(i[e])){const{key:M="value"}=this._parsing;r=u=>+Pt(i[u],M)}let o,l;for(o=e,l=e+n;o<l;++o)a._parsed[o]=r(o)}}_getRotation(){return ut(this.options.rotation-90)}_getCircumference(){return ut(this.options.circumference)}_getRotationExtents(){let e=De,n=-De;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const a=this.chart.getDatasetMeta(i).controller,r=a._getRotation(),o=a._getCircumference();e=Math.min(e,r),n=Math.max(n,r+o)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:i}=n,a=this._cachedMeta,r=a.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-o)/2,0),M=Math.min(GA(this.options.cutout,l),1),u=this._getRingWeight(this.index),{circumference:c,rotation:g}=this._getRotationExtents(),{ratioX:y,ratioY:d,offsetX:j,offsetY:f}=ep(g,c,M),I=(i.width-o)/y,N=(i.height-o)/d,D=Math.max(Math.min(I,N)/2,0),A=vu(this.options.radius,D),p=Math.max(A*M,0),m=(A-p)/this._getVisibleDatasetWeightTotal();this.offsetX=j*A,this.offsetY=f*A,a.total=this.calculateTotal(),this.outerRadius=A-m*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-m*u,0),this.updateElements(r,0,r.length,e)}_circumference(e,n){const i=this.options,a=this._cachedMeta,r=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||a._parsed[e]===null||a.data[e].hidden?0:this.calculateCircumference(a._parsed[e]*r/De)}updateElements(e,n,i,a){const r=a==="reset",o=this.chart,l=o.chartArea,u=o.options.animation,c=(l.left+l.right)/2,g=(l.top+l.bottom)/2,y=r&&u.animateScale,d=y?0:this.innerRadius,j=y?0:this.outerRadius,{sharedOptions:f,includeOptions:I}=this._getSharedOptions(n,a);let N=this._getRotation(),D;for(D=0;D<n;++D)N+=this._circumference(D,r);for(D=n;D<n+i;++D){const A=this._circumference(D,r),p=e[D],m={x:c+this.offsetX,y:g+this.offsetY,startAngle:N,endAngle:N+A,circumference:A,outerRadius:j,innerRadius:d};I&&(m.options=f||this.resolveDataElementOptions(D,p.active?"active":a)),N+=A,this.updateElement(p,D,m,a)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let i=0,a;for(a=0;a<n.length;a++){const r=e._parsed[a];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(a)&&!n[a].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?De*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,a=i.data.labels||[],r=Wn(n._parsed[e],i.options.locale);return{label:a[e]||"",value:r}}getMaxBorderWidth(e){let n=0;const i=this.chart;let a,r,o,l,M;if(!e){for(a=0,r=i.data.datasets.length;a<r;++a)if(i.isDatasetVisible(a)){o=i.getDatasetMeta(a),e=o.data,l=o.controller;break}}if(!e)return 0;for(a=0,r=e.length;a<r;++a)M=l.resolveDataElementOptions(a),M.borderAlign!=="inner"&&(n=Math.max(n,M.borderWidth||0,M.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let i=0,a=e.length;i<a;++i){const r=this.resolveDataElementOptions(i);n=Math.max(n,r.offset||0,r.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(e){return Math.max(Me(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Hn.id="doughnut",Hn.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"},Hn.descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"},Hn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map((i,a)=>{const o=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;const n=": "+t.formattedValue;return Te(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class Hs extends gt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:i,data:a=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:l,count:M}=Ju(n,a,o);this._drawStart=l,this._drawCount=M,Xu(n)&&(l=0,M=a.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=a;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(a,l,M,e)}updateElements(e,n,i,a){const r=a==="reset",{iScale:o,vScale:l,_stacked:M,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:g}=this._getSharedOptions(n,a),y=o.axis,d=l.axis,{spanGaps:j,segment:f}=this.options,I=Dn(j)?j:Number.POSITIVE_INFINITY,N=this.chart._animationsDisabled||r||a==="none";let D=n>0&&this.getParsed(n-1);for(let A=n;A<n+i;++A){const p=e[A],m=this.getParsed(A),z=N?p:{},k=Ne(m[d]),v=z[y]=o.getPixelForValue(m[y],A),Y=z[d]=r||k?l.getBasePixel():l.getPixelForValue(M?this.applyStack(l,m,M):m[d],A);z.skip=isNaN(v)||isNaN(Y)||k,z.stop=A>0&&Math.abs(m[y]-D[y])>I,f&&(z.parsed=m,z.raw=u.data[A]),g&&(z.options=c||this.resolveDataElementOptions(A,p.active?"active":a)),N||this.updateElement(p,A,z,a),D=m}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,a=e.data||[];if(!a.length)return i;const r=a[0].size(this.resolveDataElementOptions(0)),o=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(i,r,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Hs.id="line",Hs.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Hs.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Fs extends gt{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,a=i.data.labels||[],r=Wn(n._parsed[e].r,i.options.locale);return{label:a[e]||"",value:r}}parseObjectData(e,n,i,a){return hc.bind(this)(e,n,i,a)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,a)=>{const r=this.getParsed(a).r;!isNaN(r)&&this.chart.getDataVisibility(a)&&(r<n.min&&(n.min=r),r>n.max&&(n.max=r))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,i=e.options,a=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(a/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),l=(r-o)/e.getVisibleDatasetCount();this.outerRadius=r-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,n,i,a){const r=a==="reset",o=this.chart,M=o.options.animation,u=this._cachedMeta.rScale,c=u.xCenter,g=u.yCenter,y=u.getIndexAngle(0)-.5*Ee;let d=y,j;const f=360/this.countVisibleElements();for(j=0;j<n;++j)d+=this._computeAngle(j,a,f);for(j=n;j<n+i;j++){const I=e[j];let N=d,D=d+this._computeAngle(j,a,f),A=o.getDataVisibility(j)?u.getDistanceFromCenterForValue(this.getParsed(j).r):0;d=D,r&&(M.animateScale&&(A=0),M.animateRotate&&(N=D=y));const p={x:c,y:g,innerRadius:0,outerRadius:A,startAngle:N,endAngle:D,options:this.resolveDataElementOptions(j,I.active?"active":a)};this.updateElement(I,j,p,a)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((i,a)=>{!isNaN(this.getParsed(a).r)&&this.chart.getDataVisibility(a)&&n++}),n}_computeAngle(e,n,i){return this.chart.getDataVisibility(e)?ut(this.resolveDataElementOptions(e,n).angle||i):0}}Fs.id="polarArea",Fs.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Fs.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map((i,a)=>{const o=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Bc extends Hn{}Bc.id="pie",Bc.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Js extends gt{getLabelAndValue(e){const n=this._cachedMeta.vScale,i=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(e,n,i,a){return hc.bind(this)(e,n,i,a)}update(e){const n=this._cachedMeta,i=n.dataset,a=n.data||[],r=n.iScale.getLabels();if(i.points=a,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const l={_loop:!0,_fullLoop:r.length===a.length,options:o};this.updateElement(i,void 0,l,e)}this.updateElements(a,0,a.length,e)}updateElements(e,n,i,a){const r=this._cachedMeta.rScale,o=a==="reset";for(let l=n;l<n+i;l++){const M=e[l],u=this.resolveDataElementOptions(l,M.active?"active":a),c=r.getPointPositionForValue(l,this.getParsed(l).r),g=o?r.xCenter:c.x,y=o?r.yCenter:c.y,d={x:g,y,angle:c.angle,skip:isNaN(g)||isNaN(y),options:u};this.updateElement(M,l,d,a)}}}Js.id="radar",Js.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Js.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class St{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}hasValue(){return Dn(this.x)&&Dn(this.y)}getProps(e,n){const i=this.$animations;if(!n||!i)return this;const a={};return e.forEach(r=>{a[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),a}}St.defaults={},St.defaultRoutes=void 0;const Vc={values(t){return Te(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const i=this.chart.options.locale;let a,r=t;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(a="scientific"),r=tp(t,n)}const o=it(Math.abs(r)),l=Math.max(Math.min(-1*Math.floor(o),20),0),M={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(M,this.options.ticks.format),Wn(t,i,M)},logarithmic(t,e,n){if(t===0)return"0";const i=t/Math.pow(10,Math.floor(it(t)));return i===1||i===2||i===5?Vc.numeric.call(this,t,e,n):""}};function tp(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var tr={formatters:Vc};oe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:tr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),oe.route("scale.ticks","color","","color"),oe.route("scale.grid","color","","borderColor"),oe.route("scale.grid","borderColor","","borderColor"),oe.route("scale.title","color","","color"),oe.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"}),oe.describe("scales",{_fallback:"scale"}),oe.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"});function np(t,e){const n=t.options.ticks,i=n.maxTicksLimit||ip(t),a=n.major.enabled?rp(e):[],r=a.length,o=a[0],l=a[r-1],M=[];if(r>i)return op(e,M,a,r/i),M;const u=ap(a,e,i);if(r>0){let c,g;const y=r>1?Math.round((l-o)/(r-1)):null;for(nr(e,M,u,Ne(y)?0:o-y,o),c=0,g=r-1;c<g;c++)nr(e,M,u,a[c],a[c+1]);return nr(e,M,u,l,Ne(y)?e.length:l+y),M}return nr(e,M,u),M}function ip(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),a=t._maxLength/n;return Math.floor(Math.min(i,a))}function ap(t,e,n){const i=sp(t),a=e.length/n;if(!i)return Math.max(a,1);const r=qA(i);for(let o=0,l=r.length-1;o<l;o++){const M=r[o];if(M>a)return M}return Math.max(a,1)}function rp(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}function op(t,e,n,i){let a=0,r=n[0],o;for(i=Math.ceil(i),o=0;o<t.length;o++)o===r&&(e.push(t[o]),a++,r=n[a*i])}function nr(t,e,n,i,a){const r=Me(i,0),o=Math.min(Me(a,t.length),t.length);let l=0,M,u,c;for(n=Math.ceil(n),a&&(M=a-i,n=M/Math.floor(M/n)),c=r;c<0;)l++,c=Math.round(r+l*n);for(u=Math.max(r,0);u<o;u++)u===c&&(e.push(t[u]),l++,c=Math.round(r+l*n))}function sp(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}const lp=t=>t==="left"?"right":t==="right"?"left":t,Gc=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n;function Wc(t,e){const n=[],i=t.length/e,a=t.length;let r=0;for(;r<a;r+=i)n.push(t[Math.floor(r)]);return n}function Mp(t,e,n){const i=t.ticks.length,a=Math.min(e,i-1),r=t._startPixel,o=t._endPixel,l=1e-6;let M=t.getPixelForTick(a),u;if(!(n&&(i===1?u=Math.max(M-r,o-M):e===0?u=(t.getPixelForTick(1)-M)/2:u=(M-t.getPixelForTick(a-1))/2,M+=a<e?u:-u,M<r-l||M>o+l)))return M}function up(t,e){de(t,n=>{const i=n.gc,a=i.length/2;let r;if(a>e){for(r=0;r<a;++r)delete n.data[i[r]];i.splice(0,a)}})}function Fn(t){return t.drawTicks?t.tickLength:0}function $c(t,e){if(!t.display)return 0;const n=et(t.font,e),i=rt(t.padding);return(Te(t.text)?t.text.length:1)*n.lineHeight+i.height}function cp(t,e){return Vt(t,{scale:e,type:"scale"})}function gp(t,e,n){return Vt(t,{tick:n,index:e,type:"tick"})}function Np(t,e,n){let i=sz(t);return(n&&e!=="right"||!n&&e==="right")&&(i=lp(i)),i}function yp(t,e,n,i){const{top:a,left:r,bottom:o,right:l,chart:M}=t,{chartArea:u,scales:c}=M;let g=0,y,d,j;const f=o-a,I=l-r;if(t.isHorizontal()){if(d=Fu(i,r,l),le(n)){const N=Object.keys(n)[0],D=n[N];j=c[N].getPixelForValue(D)+f-e}else n==="center"?j=(u.bottom+u.top)/2+f-e:j=Gc(t,n,e);y=l-r}else{if(le(n)){const N=Object.keys(n)[0],D=n[N];d=c[N].getPixelForValue(D)-I+e}else n==="center"?d=(u.left+u.right)/2-I+e:d=Gc(t,n,e);j=Fu(i,o,a),g=n==="left"?-be:be}return{titleX:d,titleY:j,maxWidth:y,rotation:g}}class sn extends St{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:i,_suggestedMax:a}=this;return e=tt(e,Number.POSITIVE_INFINITY),n=tt(n,Number.NEGATIVE_INFINITY),i=tt(i,Number.POSITIVE_INFINITY),a=tt(a,Number.NEGATIVE_INFINITY),{min:tt(e,i),max:tt(n,a),minDefined:Re(e),maxDefined:Re(n)}}getMinMax(e){let{min:n,max:i,minDefined:a,maxDefined:r}=this.getUserBounds(),o;if(a&&r)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let M=0,u=l.length;M<u;++M)o=l[M].controller.getMinMax(this,e),a||(n=Math.min(n,o.min)),r||(i=Math.max(i,o.max));return n=r&&n>i?i:n,i=a&&n>i?n:i,{min:tt(n,tt(i,n)),max:tt(i,tt(n,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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Se(this.options.beforeUpdate,[this])}update(e,n,i){const{beginAtZero:a,grace:r,ticks:o}=this.options,l=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,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=Zz(this,r,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const M=l<this.ticks.length;this._convertTicksToLabels(M?Wc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=np(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),M&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,e=!e),this._startPixel=n,this._endPixel=i,this._reversePixels=e,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Se(this.options.afterUpdate,[this])}beforeSetDimensions(){Se(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(){Se(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Se(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Se(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let i,a,r;for(i=0,a=e.length;i<a;i++)r=e[i],r.label=Se(n.callback,[r.value,i,e],this)}afterTickToLabelConversion(){Se(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Se(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,i=this.ticks.length,a=n.minRotation||0,r=n.maxRotation;let o=a,l,M,u;if(!this._isVisible()||!n.display||a>=r||i<=1||!this.isHorizontal()){this.labelRotation=a;return}const c=this._getLabelSizes(),g=c.widest.width,y=c.highest.height,d=Be(this.chart.width-g,0,this.maxWidth);l=e.offset?this.maxWidth/i:d/(i-1),g+6>l&&(l=d/(i-(e.offset?.5:1)),M=this.maxHeight-Fn(e.grid)-n.padding-$c(e.title,this.chart.options.font),u=Math.sqrt(g*g+y*y),o=Ts(Math.min(Math.asin(Be((c.highest.height+6)/l,-1,1)),Math.asin(Be(M/u,-1,1))-Math.asin(Be(y/u,-1,1)))),o=Math.max(a,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Se(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Se(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:i,title:a,grid:r}}=this,o=this._isVisible(),l=this.isHorizontal();if(o){const M=$c(a,n.options.font);if(l?(e.width=this.maxWidth,e.height=Fn(r)+M):(e.height=this.maxHeight,e.width=Fn(r)+M),i.display&&this.ticks.length){const{first:u,last:c,widest:g,highest:y}=this._getLabelSizes(),d=i.padding*2,j=ut(this.labelRotation),f=Math.cos(j),I=Math.sin(j);if(l){const N=i.mirror?0:I*g.width+f*y.height;e.height=Math.min(this.maxHeight,e.height+N+d)}else{const N=i.mirror?0:f*g.width+I*y.height;e.width=Math.min(this.maxWidth,e.width+N+d)}this._calculatePadding(u,c,I,f)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,i,a){const{ticks:{align:r,padding:o},position:l}=this.options,M=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let y=0,d=0;M?u?(y=a*e.width,d=i*n.height):(y=i*e.height,d=a*n.width):r==="start"?d=n.width:r==="end"?y=e.width:r!=="inner"&&(y=e.width/2,d=n.width/2),this.paddingLeft=Math.max((y-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((d-g+o)*this.width/(this.width-g),0)}else{let c=n.height/2,g=e.height/2;r==="start"?(c=0,g=e.height):r==="end"&&(c=n.height,g=0),this.paddingTop=c+o,this.paddingBottom=g+o}}_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(){Se(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,i;for(n=0,i=e.length;n<i;n++)Ne(e[n].label)&&(e.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=Wc(i,n)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,n){const{ctx:i,_longestTextCache:a}=this,r=[],o=[];let l=0,M=0,u,c,g,y,d,j,f,I,N,D,A;for(u=0;u<n;++u){if(y=e[u].label,d=this._resolveTickFontOptions(u),i.font=j=d.string,f=a[j]=a[j]||{data:{},gc:[]},I=d.lineHeight,N=D=0,!Ne(y)&&!Te(y))N=$a(i,f.data,f.gc,N,y),D=I;else if(Te(y))for(c=0,g=y.length;c<g;++c)A=y[c],!Ne(A)&&!Te(A)&&(N=$a(i,f.data,f.gc,N,A),D+=I);r.push(N),o.push(D),l=Math.max(N,l),M=Math.max(D,M)}up(a,n);const p=r.indexOf(l),m=o.indexOf(M),z=k=>({width:r[k]||0,height:o[k]||0});return{first:z(0),last:z(n-1),widest:z(p),highest:z(m),widths:r,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return nz(this._alignToPixels?nn(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const i=n[e];return i.$context||(i.$context=gp(this.getContext(),e,i))}return this.$context||(this.$context=cp(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=ut(this.labelRotation),i=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),r=this._getLabelSizes(),o=e.autoSkipPadding||0,l=r?r.widest.width+o:0,M=r?r.highest.height+o:0;return this.isHorizontal()?M*i>l*a?l/i:M/a:M*a<l*i?M/i:l/a}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,i=this.chart,a=this.options,{grid:r,position:o}=a,l=r.offset,M=this.isHorizontal(),c=this.ticks.length+(l?1:0),g=Fn(r),y=[],d=r.setContext(this.getContext()),j=d.drawBorder?d.borderWidth:0,f=j/2,I=function(T){return nn(i,T,j)};let N,D,A,p,m,z,k,v,Y,R,w,h;if(o==="top")N=I(this.bottom),z=this.bottom-g,v=N-f,R=I(e.top)+f,h=e.bottom;else if(o==="bottom")N=I(this.top),R=e.top,h=I(e.bottom)-f,z=N+f,v=this.top+g;else if(o==="left")N=I(this.right),m=this.right-g,k=N-f,Y=I(e.left)+f,w=e.right;else if(o==="right")N=I(this.left),Y=e.left,w=I(e.right)-f,m=N+f,k=this.left+g;else if(n==="x"){if(o==="center")N=I((e.top+e.bottom)/2+.5);else if(le(o)){const T=Object.keys(o)[0],Q=o[T];N=I(this.chart.scales[T].getPixelForValue(Q))}R=e.top,h=e.bottom,z=N+f,v=z+g}else if(n==="y"){if(o==="center")N=I((e.left+e.right)/2);else if(le(o)){const T=Object.keys(o)[0],Q=o[T];N=I(this.chart.scales[T].getPixelForValue(Q))}m=N-f,k=m-g,Y=e.left,w=e.right}const E=Me(a.ticks.maxTicksLimit,c),C=Math.max(1,Math.ceil(c/E));for(D=0;D<c;D+=C){const T=r.setContext(this.getContext(D)),Q=T.lineWidth,V=T.color,Z=T.borderDash||[],H=T.borderDashOffset,$=T.tickWidth,O=T.tickColor,P=T.tickBorderDash||[],U=T.tickBorderDashOffset;A=Mp(this,D,l),A!==void 0&&(p=nn(i,A,Q),M?m=k=Y=w=p:z=v=R=h=p,y.push({tx1:m,ty1:z,tx2:k,ty2:v,x1:Y,y1:R,x2:w,y2:h,width:Q,color:V,borderDash:Z,borderDashOffset:H,tickWidth:$,tickColor:O,tickBorderDash:P,tickBorderDashOffset:U}))}return this._ticksLength=c,this._borderValue=N,y}_computeLabelItems(e){const n=this.axis,i=this.options,{position:a,ticks:r}=i,o=this.isHorizontal(),l=this.ticks,{align:M,crossAlign:u,padding:c,mirror:g}=r,y=Fn(i.grid),d=y+c,j=g?-c:d,f=-ut(this.labelRotation),I=[];let N,D,A,p,m,z,k,v,Y,R,w,h,E="middle";if(a==="top")z=this.bottom-j,k=this._getXAxisLabelAlignment();else if(a==="bottom")z=this.top+j,k=this._getXAxisLabelAlignment();else if(a==="left"){const T=this._getYAxisLabelAlignment(y);k=T.textAlign,m=T.x}else if(a==="right"){const T=this._getYAxisLabelAlignment(y);k=T.textAlign,m=T.x}else if(n==="x"){if(a==="center")z=(e.top+e.bottom)/2+d;else if(le(a)){const T=Object.keys(a)[0],Q=a[T];z=this.chart.scales[T].getPixelForValue(Q)+d}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(a==="center")m=(e.left+e.right)/2-d;else if(le(a)){const T=Object.keys(a)[0],Q=a[T];m=this.chart.scales[T].getPixelForValue(Q)}k=this._getYAxisLabelAlignment(y).textAlign}n==="y"&&(M==="start"?E="top":M==="end"&&(E="bottom"));const C=this._getLabelSizes();for(N=0,D=l.length;N<D;++N){A=l[N],p=A.label;const T=r.setContext(this.getContext(N));v=this.getPixelForTick(N)+r.labelOffset,Y=this._resolveTickFontOptions(N),R=Y.lineHeight,w=Te(p)?p.length:1;const Q=w/2,V=T.color,Z=T.textStrokeColor,H=T.textStrokeWidth;let $=k;o?(m=v,k==="inner"&&(N===D-1?$=this.options.reverse?"left":"right":N===0?$=this.options.reverse?"right":"left":$="center"),a==="top"?u==="near"||f!==0?h=-w*R+R/2:u==="center"?h=-C.highest.height/2-Q*R+R:h=-C.highest.height+R/2:u==="near"||f!==0?h=R/2:u==="center"?h=C.highest.height/2-Q*R:h=C.highest.height-w*R,g&&(h*=-1)):(z=v,h=(1-w)*R/2);let O;if(T.showLabelBackdrop){const P=rt(T.backdropPadding),U=C.heights[N],je=C.widths[N];let B=z+h-P.top,X=m-P.left;switch(E){case"middle":B-=U/2;break;case"bottom":B-=U;break}switch(k){case"center":X-=je/2;break;case"right":X-=je;break}O={left:X,top:B,width:je+P.width,height:U+P.height,color:T.backdropColor}}I.push({rotation:f,label:p,font:Y,color:V,strokeColor:Z,strokeWidth:H,textOffset:h,textAlign:$,textBaseline:E,translation:[m,z],backdrop:O})}return I}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-ut(this.labelRotation))return e==="top"?"left":"right";let a="center";return n.align==="start"?a="left":n.align==="end"?a="right":n.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:i,mirror:a,padding:r}}=this.options,o=this._getLabelSizes(),l=e+r,M=o.widest.width;let u,c;return n==="left"?a?(c=this.right+r,i==="near"?u="left":i==="center"?(u="center",c+=M/2):(u="right",c+=M)):(c=this.right-l,i==="near"?u="right":i==="center"?(u="center",c-=M/2):(u="left",c=this.left)):n==="right"?a?(c=this.left+r,i==="near"?u="right":i==="center"?(u="center",c-=M/2):(u="left",c-=M)):(c=this.left+l,i==="near"?u="left":i==="center"?(u="center",c+=M/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:i,top:a,width:r,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(i,a,r,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const a=this.ticks.findIndex(r=>r.value===e);return a>=0?n.setContext(this.getContext(a)).lineWidth:0}drawGrid(e){const n=this.options.grid,i=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,o;const l=(M,u,c)=>{!c.width||!c.color||(i.save(),i.lineWidth=c.width,i.strokeStyle=c.color,i.setLineDash(c.borderDash||[]),i.lineDashOffset=c.borderDashOffset,i.beginPath(),i.moveTo(M.x,M.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=a.length;r<o;++r){const M=a[r];n.drawOnChartArea&&l({x:M.x1,y:M.y1},{x:M.x2,y:M.y2},M),n.drawTicks&&l({x:M.tx1,y:M.ty1},{x:M.tx2,y:M.ty2},{color:M.tickColor,width:M.tickWidth,borderDash:M.tickBorderDash,borderDashOffset:M.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{grid:i}}=this,a=i.setContext(this.getContext()),r=i.drawBorder?a.borderWidth:0;if(!r)return;const o=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let M,u,c,g;this.isHorizontal()?(M=nn(e,this.left,r)-r/2,u=nn(e,this.right,o)+o/2,c=g=l):(c=nn(e,this.top,r)-r/2,g=nn(e,this.bottom,o)+o/2,M=u=l),n.save(),n.lineWidth=a.borderWidth,n.strokeStyle=a.borderColor,n.beginPath(),n.moveTo(M,c),n.lineTo(u,g),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,a=this._computeLabelArea();a&&cc(i,a);const r=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,l;for(o=0,l=r.length;o<l;++o){const M=r[o],u=M.font,c=M.label;M.backdrop&&(i.fillStyle=M.backdrop.color,i.fillRect(M.backdrop.left,M.backdrop.top,M.backdrop.width,M.backdrop.height));let g=M.textOffset;Ha(i,c,0,g,u,M)}a&&gc(i)}drawTitle(){const{ctx:e,options:{position:n,title:i,reverse:a}}=this;if(!i.display)return;const r=et(i.font),o=rt(i.padding),l=i.align;let M=r.lineHeight/2;n==="bottom"||n==="center"||le(n)?(M+=o.bottom,Te(i.text)&&(M+=r.lineHeight*(i.text.length-1))):M+=o.top;const{titleX:u,titleY:c,maxWidth:g,rotation:y}=yp(this,M,n,l);Ha(e,i.text,0,0,r,{color:i.color,maxWidth:g,rotation:y,textAlign:Np(l,n,a),textBaseline:"middle",translation:[u,c]})}draw(e){!this._isVisible()||(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,i=Me(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==sn.prototype.draw?[{z:n,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:n,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",a=[];let r,o;for(r=0,o=n.length;r<o;++r){const l=n[r];l[i]===this.id&&(!e||l.type===e)&&a.push(l)}return a}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return et(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ir{constructor(e,n,i){this.type=e,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let i;Ip(n)&&(i=this.register(n));const a=this.items,r=e.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+e);return r in a||(a[r]=e,dp(e,o,i),this.override&&oe.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,i=e.id,a=this.scope;i in n&&delete n[i],a&&i in oe[a]&&(delete oe[a][i],this.override&&delete tn[i])}}function dp(t,e,n){const i=Qn(Object.create(null),[n?oe.get(n):{},oe.get(e),t.defaults]);oe.set(e,i),t.defaultRoutes&&jp(e,t.defaultRoutes),t.descriptors&&oe.describe(e,t.descriptors)}function jp(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),a=i.pop(),r=[t].concat(i).join("."),o=e[n].split("."),l=o.pop(),M=o.join(".");oe.route(r,a,M,l)})}function Ip(t){return"id"in t&&"defaults"in t}class Dp{constructor(){this.controllers=new ir(gt,"datasets",!0),this.elements=new ir(St,"elements"),this.plugins=new ir(Object,"plugins"),this.scales=new ir(sn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,i){[...n].forEach(a=>{const r=i||this._getRegistryForType(a);i||r.isForType(a)||r===this.plugins&&a.id?this._exec(e,r,a):de(a,o=>{const l=i||this._getRegistryForType(o);this._exec(e,l,o)})})}_exec(e,n,i){const a=ps(e);Se(i["before"+a],[],i),n[e](i),Se(i["after"+a],[],i)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(e))return i}return this.plugins}_get(e,n,i){const a=n.get(e);if(a===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return a}}var ht=new Dp;class Xs extends gt{update(e){const n=this._cachedMeta,{data:i=[]}=n,a=this.chart._animationsDisabled;let{start:r,count:o}=Ju(n,i,a);if(this._drawStart=r,this._drawCount=o,Xu(n)&&(r=0,o=i.length),this.options.showLine){const{dataset:l,_dataset:M}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!M._decimated,l.points=i;const u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(l,void 0,{animated:!a,options:u},e)}this.updateElements(i,r,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=ht.getElement("line")),super.addElements()}updateElements(e,n,i,a){const r=a==="reset",{iScale:o,vScale:l,_stacked:M,_dataset:u}=this._cachedMeta,c=this.resolveDataElementOptions(n,a),g=this.getSharedOptions(c),y=this.includeOptions(a,g),d=o.axis,j=l.axis,{spanGaps:f,segment:I}=this.options,N=Dn(f)?f:Number.POSITIVE_INFINITY,D=this.chart._animationsDisabled||r||a==="none";let A=n>0&&this.getParsed(n-1);for(let p=n;p<n+i;++p){const m=e[p],z=this.getParsed(p),k=D?m:{},v=Ne(z[j]),Y=k[d]=o.getPixelForValue(z[d],p),R=k[j]=r||v?l.getBasePixel():l.getPixelForValue(M?this.applyStack(l,z,M):z[j],p);k.skip=isNaN(Y)||isNaN(R)||v,k.stop=p>0&&Math.abs(z[d]-A[d])>N,I&&(k.parsed=z,k.raw=u.data[p]),y&&(k.options=g||this.resolveDataElementOptions(p,m.active?"active":a)),D||this.updateElement(m,p,k,a),A=z}this.updateSharedOptions(g,a,c)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let l=0;for(let M=n.length-1;M>=0;--M)l=Math.max(l,n[M].size(this.resolveDataElementOptions(M))/2);return l>0&&l}const i=e.dataset,a=i.options&&i.options.borderWidth||0;if(!n.length)return a;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(a,r,o)/2}}Xs.id="scatter",Xs.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Xs.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function ln(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ks{constructor(e){this.options=e||{}}init(e){}formats(){return ln()}parse(e,n){return ln()}format(e,n){return ln()}add(e,n,i){return ln()}diff(e,n,i){return ln()}startOf(e,n,i){return ln()}endOf(e,n){return ln()}}Ks.override=function(t){Object.assign(Ks.prototype,t)};var fp={_date:Ks};function hp(t,e,n,i){const{controller:a,data:r,_sorted:o}=t,l=a._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&o&&r.length){const M=l._reversePixels?iz:en;if(i){if(a._sharedOptions){const u=r[0],c=typeof u.getRange=="function"&&u.getRange(e);if(c){const g=M(r,e,n-c),y=M(r,e,n+c);return{lo:g.lo,hi:y.hi}}}}else return M(r,e,n)}return{lo:0,hi:r.length-1}}function Jn(t,e,n,i,a){const r=t.getSortedVisibleDatasetMetas(),o=n[e];for(let l=0,M=r.length;l<M;++l){const{index:u,data:c}=r[l],{lo:g,hi:y}=hp(r[l],e,o,a);for(let d=g;d<=y;++d){const j=c[d];j.skip||i(j,u,d)}}}function mp(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(i,a){const r=e?Math.abs(i.x-a.x):0,o=n?Math.abs(i.y-a.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function qs(t,e,n,i,a){const r=[];return!a&&!t.isPointInArea(e)||Jn(t,n,e,function(l,M,u){!a&&!Gn(l,t.chartArea,0)||l.inRange(e.x,e.y,i)&&r.push({element:l,datasetIndex:M,index:u})},!0),r}function Ap(t,e,n,i){let a=[];function r(o,l,M){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],i),{angle:g}=Bu(o,{x:e.x,y:e.y});Pn(g,u,c)&&a.push({element:o,datasetIndex:l,index:M})}return Jn(t,n,e,r),a}function zp(t,e,n,i,a,r){let o=[];const l=mp(n);let M=Number.POSITIVE_INFINITY;function u(c,g,y){const d=c.inRange(e.x,e.y,a);if(i&&!d)return;const j=c.getCenterPoint(a);if(!(!!r||t.isPointInArea(j))&&!d)return;const I=l(e,j);I<M?(o=[{element:c,datasetIndex:g,index:y}],M=I):I===M&&o.push({element:c,datasetIndex:g,index:y})}return Jn(t,n,e,u),o}function el(t,e,n,i,a,r){return!r&&!t.isPointInArea(e)?[]:n==="r"&&!i?Ap(t,e,n,a):zp(t,e,n,i,a,r)}function Hc(t,e,n,i,a){const r=[],o=n==="x"?"inXRange":"inYRange";let l=!1;return Jn(t,n,e,(M,u,c)=>{M[o](e[n],a)&&(r.push({element:M,datasetIndex:u,index:c}),l=l||M.inRange(e.x,e.y,a))}),i&&!l?[]:r}var pp={evaluateInteractionItems:Jn,modes:{index(t,e,n,i){const a=rn(e,t),r=n.axis||"x",o=n.includeInvisible||!1,l=n.intersect?qs(t,a,r,i,o):el(t,a,r,!1,i,o),M=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const c=l[0].index,g=u.data[c];g&&!g.skip&&M.push({element:g,datasetIndex:u.index,index:c})}),M):[]},dataset(t,e,n,i){const a=rn(e,t),r=n.axis||"xy",o=n.includeInvisible||!1;let l=n.intersect?qs(t,a,r,i,o):el(t,a,r,!1,i,o);if(l.length>0){const M=l[0].datasetIndex,u=t.getDatasetMeta(M).data;l=[];for(let c=0;c<u.length;++c)l.push({element:u[c],datasetIndex:M,index:c})}return l},point(t,e,n,i){const a=rn(e,t),r=n.axis||"xy",o=n.includeInvisible||!1;return qs(t,a,r,i,o)},nearest(t,e,n,i){const a=rn(e,t),r=n.axis||"xy",o=n.includeInvisible||!1;return el(t,a,r,n.intersect,i,o)},x(t,e,n,i){const a=rn(e,t);return Hc(t,a,"x",n.intersect,i)},y(t,e,n,i){const a=rn(e,t);return Hc(t,a,"y",n.intersect,i)}}};const Fc=["left","top","right","bottom"];function Xn(t,e){return t.filter(n=>n.pos===e)}function Jc(t,e){return t.filter(n=>Fc.indexOf(n.pos)===-1&&n.box.axis===e)}function Kn(t,e){return t.sort((n,i)=>{const a=e?i:n,r=e?n:i;return a.weight===r.weight?a.index-r.index:a.weight-r.weight})}function Tp(t){const e=[];let n,i,a,r,o,l;for(n=0,i=(t||[]).length;n<i;++n)a=t[n],{position:r,options:{stack:o,stackWeight:l=1}}=a,e.push({index:n,box:a,pos:r,horizontal:a.isHorizontal(),weight:a.weight,stack:o&&r+o,stackWeight:l});return e}function Lp(t){const e={};for(const n of t){const{stack:i,pos:a,stackWeight:r}=n;if(!i||!Fc.includes(a))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}function xp(t,e){const n=Lp(t),{vBoxMaxWidth:i,hBoxMaxHeight:a}=e;let r,o,l;for(r=0,o=t.length;r<o;++r){l=t[r];const{fullSize:M}=l.box,u=n[l.stack],c=u&&l.stackWeight/u.weight;l.horizontal?(l.width=c?c*i:M&&e.availableWidth,l.height=a):(l.width=i,l.height=c?c*a:M&&e.availableHeight)}return n}function Op(t){const e=Tp(t),n=Kn(e.filter(u=>u.box.fullSize),!0),i=Kn(Xn(e,"left"),!0),a=Kn(Xn(e,"right")),r=Kn(Xn(e,"top"),!0),o=Kn(Xn(e,"bottom")),l=Jc(e,"x"),M=Jc(e,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:a.concat(M).concat(o).concat(l),chartArea:Xn(e,"chartArea"),vertical:i.concat(a).concat(M),horizontal:r.concat(o).concat(l)}}function Xc(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Kc(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Sp(t,e,n,i){const{pos:a,box:r}=n,o=t.maxPadding;if(!le(a)){n.size&&(t[a]-=n.size);const g=i[n.stack]||{size:0,count:1};g.size=Math.max(g.size,n.horizontal?r.height:r.width),n.size=g.size/g.count,t[a]+=n.size}r.getPadding&&Kc(o,r.getPadding());const l=Math.max(0,e.outerWidth-Xc(o,t,"left","right")),M=Math.max(0,e.outerHeight-Xc(o,t,"top","bottom")),u=l!==t.w,c=M!==t.h;return t.w=l,t.h=M,n.horizontal?{same:u,other:c}:{same:c,other:u}}function Ep(t){const e=t.maxPadding;function n(i){const a=Math.max(e[i]-t[i],0);return t[i]+=a,a}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function bp(t,e){const n=e.maxPadding;function i(a){const r={left:0,top:0,right:0,bottom:0};return a.forEach(o=>{r[o]=Math.max(e[o],n[o])}),r}return i(t?["left","right"]:["top","bottom"])}function qn(t,e,n,i){const a=[];let r,o,l,M,u,c;for(r=0,o=t.length,u=0;r<o;++r){l=t[r],M=l.box,M.update(l.width||e.w,l.height||e.h,bp(l.horizontal,e));const{same:g,other:y}=Sp(e,n,l,i);u|=g&&a.length,c=c||y,M.fullSize||a.push(l)}return u&&qn(a,e,n,i)||c}function ar(t,e,n,i,a){t.top=n,t.left=e,t.right=e+i,t.bottom=n+a,t.width=i,t.height=a}function qc(t,e,n,i){const a=n.padding;let{x:r,y:o}=e;for(const l of t){const M=l.box,u=i[l.stack]||{count:1,placed:0,weight:1},c=l.stackWeight/u.weight||1;if(l.horizontal){const g=e.w*c,y=u.size||M.height;nt(u.start)&&(o=u.start),M.fullSize?ar(M,a.left,o,n.outerWidth-a.right-a.left,y):ar(M,e.left+u.placed,o,g,y),u.start=o,u.placed+=g,o=M.bottom}else{const g=e.h*c,y=u.size||M.width;nt(u.start)&&(r=u.start),M.fullSize?ar(M,r,a.top,y,n.outerHeight-a.bottom-a.top):ar(M,r,e.top+u.placed,y,g),u.start=r,u.placed+=g,r=M.right}}e.x=r,e.y=o}oe.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var rr={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const a=rt(t.options.layout.padding),r=Math.max(e-a.width,0),o=Math.max(n-a.height,0),l=Op(t.boxes),M=l.vertical,u=l.horizontal;de(t.boxes,f=>{typeof f.beforeLayout=="function"&&f.beforeLayout()});const c=M.reduce((f,I)=>I.box.options&&I.box.options.display===!1?f:f+1,0)||1,g=Object.freeze({outerWidth:e,outerHeight:n,padding:a,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/c,hBoxMaxHeight:o/2}),y=Object.assign({},a);Kc(y,rt(i));const d=Object.assign({maxPadding:y,w:r,h:o,x:a.left,y:a.top},a),j=xp(M.concat(u),g);qn(l.fullSize,d,g,j),qn(M,d,g,j),qn(u,d,g,j)&&qn(M,d,g,j),Ep(d),qc(l.leftAndTop,d,g,j),d.x+=d.w,d.y+=d.h,qc(l.rightAndBottom,d,g,j),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},de(l.chartArea,f=>{const I=f.box;Object.assign(I,t.chartArea),I.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})})}};class eg{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,i){}removeEventListener(e,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,i,a){return n=Math.max(0,n||e.width),i=i||e.height,{width:n,height:Math.max(0,a?Math.floor(n/a):i)}}isAttached(e){return!0}updateConfig(e){}}class Cp extends eg{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const or="$chartjs",wp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},tg=t=>t===null||t==="";function kp(t,e){const n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t[or]={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",tg(a)){const r=pc(t,"width");r!==void 0&&(t.width=r)}if(tg(i))if(t.style.height==="")t.height=t.width/(e||2);else{const r=pc(t,"height");r!==void 0&&(t.height=r)}return t}const ng=c0?{passive:!0}:!1;function vp(t,e,n){t.addEventListener(e,n,ng)}function Qp(t,e,n){t.canvas.removeEventListener(e,n,ng)}function _p(t,e){const n=wp[t.type]||t.type,{x:i,y:a}=rn(t,e);return{type:n,chart:e,native:t,x:i!==void 0?i:null,y:a!==void 0?a:null}}function sr(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Yp(t,e,n){const i=t.canvas,a=new MutationObserver(r=>{let o=!1;for(const l of r)o=o||sr(l.addedNodes,i),o=o&&!sr(l.removedNodes,i);o&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function Up(t,e,n){const i=t.canvas,a=new MutationObserver(r=>{let o=!1;for(const l of r)o=o||sr(l.removedNodes,i),o=o&&!sr(l.addedNodes,i);o&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const ei=new Map;let ig=0;function ag(){const t=window.devicePixelRatio;t!==ig&&(ig=t,ei.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Pp(t,e){ei.size||window.addEventListener("resize",ag),ei.set(t,e)}function Rp(t){ei.delete(t),ei.size||window.removeEventListener("resize",ag)}function Zp(t,e,n){const i=t.canvas,a=i&&Rs(i);if(!a)return;const r=Hu((l,M)=>{const u=a.clientWidth;n(l,M),u<a.clientWidth&&n()},window),o=new ResizeObserver(l=>{const M=l[0],u=M.contentRect.width,c=M.contentRect.height;u===0&&c===0||r(u,c)});return o.observe(a),Pp(t,r),o}function tl(t,e,n){n&&n.disconnect(),e==="resize"&&Rp(t)}function Bp(t,e,n){const i=t.canvas,a=Hu(r=>{t.ctx!==null&&n(_p(r,t))},t,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return vp(i,e,a),a}class Vp extends eg{acquireContext(e,n){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(kp(e,n),i):null}releaseContext(e){const n=e.canvas;if(!n[or])return!1;const i=n[or].initial;["height","width"].forEach(r=>{const o=i[r];Ne(o)?n.removeAttribute(r):n.setAttribute(r,o)});const a=i.style||{};return Object.keys(a).forEach(r=>{n.style[r]=a[r]}),n.width=n.width,delete n[or],!0}addEventListener(e,n,i){this.removeEventListener(e,n);const a=e.$proxies||(e.$proxies={}),o={attach:Yp,detach:Up,resize:Zp}[n]||Bp;a[n]=o(e,n,i)}removeEventListener(e,n){const i=e.$proxies||(e.$proxies={}),a=i[n];if(!a)return;({attach:tl,detach:tl,resize:tl}[n]||Qp)(e,n,a),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,i,a){return u0(e,n,i,a)}isAttached(e){const n=Rs(e);return!!(n&&n.isConnected)}}function Gp(t){return!Ac()||typeof OffscreenCanvas!="undefined"&&t instanceof OffscreenCanvas?Cp:Vp}class Wp{constructor(){this._init=[]}notify(e,n,i,a){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const r=a?this._descriptors(e).filter(a):this._descriptors(e),o=this._notify(r,e,n,i);return n==="afterDestroy"&&(this._notify(r,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,n,i,a){a=a||{};for(const r of e){const o=r.plugin,l=o[i],M=[n,a,r.options];if(Se(l,M,o)===!1&&a.cancelable)return!1}return!0}invalidate(){Ne(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const i=e&&e.config,a=Me(i.options&&i.options.plugins,{}),r=$p(i);return a===!1&&!n?[]:Fp(e,r,a,n)}_notifyStateChanges(e){const n=this._oldCache||[],i=this._cache,a=(r,o)=>r.filter(l=>!o.some(M=>l.plugin.id===M.plugin.id));this._notify(a(n,i),e,"stop"),this._notify(a(i,n),e,"start")}}function $p(t){const e={},n=[],i=Object.keys(ht.plugins.items);for(let r=0;r<i.length;r++)n.push(ht.getPlugin(i[r]));const a=t.plugins||[];for(let r=0;r<a.length;r++){const o=a[r];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function Hp(t,e){return!e&&t===!1?null:t===!0?{}:t}function Fp(t,{plugins:e,localIds:n},i,a){const r=[],o=t.getContext();for(const l of e){const M=l.id,u=Hp(i[M],a);u!==null&&r.push({plugin:l,options:Jp(t.config,{plugin:l,local:n[M]},u,o)})}return r}function Jp(t,{plugin:e,local:n},i,a){const r=t.pluginScopeKeys(e),o=t.getOptionScopes(i,r);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function nl(t,e){const n=oe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Xp(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function Kp(t,e){return t===e?"_index_":"_value_"}function qp(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function il(t,e){return t==="x"||t==="y"?t:e.axis||qp(e.position)||t.charAt(0).toLowerCase()}function eT(t,e){const n=tn[t.type]||{scales:{}},i=e.scales||{},a=nl(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(l=>{const M=i[l];if(!le(M))return console.error(`Invalid scale configuration for scale: ${l}`);if(M._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const u=il(l,M),c=Kp(u,a),g=n.scales||{};r[u]=r[u]||l,o[l]=_n(Object.create(null),[{axis:u},M,g[u],g[c]])}),t.data.datasets.forEach(l=>{const M=l.type||t.type,u=l.indexAxis||nl(M,e),g=(tn[M]||{}).scales||{};Object.keys(g).forEach(y=>{const d=Xp(y,u),j=l[d+"AxisID"]||r[d]||d;o[j]=o[j]||Object.create(null),_n(o[j],[{axis:d},i[j],g[y]])})}),Object.keys(o).forEach(l=>{const M=o[l];_n(M,[oe.scales[M.type],oe.scale])}),o}function rg(t){const e=t.options||(t.options={});e.plugins=Me(e.plugins,{}),e.scales=eT(t,e)}function og(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function tT(t){return t=t||{},t.data=og(t.data),rg(t),t}const sg=new Map,lg=new Set;function lr(t,e){let n=sg.get(t);return n||(n=e(),sg.set(t,n),lg.add(n)),n}const ti=(t,e,n)=>{const i=Pt(e,n);i!==void 0&&t.add(i)};class nT{constructor(e){this._config=tT(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=og(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),rg(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return lr(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return lr(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return lr(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,i=this.type;return lr(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const i=this._scopeCache;let a=i.get(e);return(!a||n)&&(a=new Map,i.set(e,a)),a}getOptionScopes(e,n,i){const{options:a,type:r}=this,o=this._cachedScopes(e,i),l=o.get(n);if(l)return l;const M=new Set;n.forEach(c=>{e&&(M.add(e),c.forEach(g=>ti(M,e,g))),c.forEach(g=>ti(M,a,g)),c.forEach(g=>ti(M,tn[r]||{},g)),c.forEach(g=>ti(M,oe,g)),c.forEach(g=>ti(M,ks,g))});const u=Array.from(M);return u.length===0&&u.push(Object.create(null)),lg.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,tn[n]||{},oe.datasets[n]||{},{type:n},oe,ks]}resolveNamedOptions(e,n,i,a=[""]){const r={$shared:!0},{resolver:o,subPrefixes:l}=Mg(this._resolverCache,e,a);let M=o;if(aT(o,n)){r.$shared=!1,i=Rt(i)?i():i;const u=this.createResolver(e,i,l);M=mn(o,i,u)}for(const u of n)r[u]=M[u];return r}createResolver(e,n,i=[""],a){const{resolver:r}=Mg(this._resolverCache,e,i);return le(n)?mn(r,n,void 0,a):r}}function Mg(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const a=n.join();let r=i.get(a);return r||(r={resolver:Ys(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(a,r)),r}const iT=t=>le(t)&&Object.getOwnPropertyNames(t).reduce((e,n)=>e||Rt(t[n]),!1);function aT(t,e){const{isScriptable:n,isIndexable:i}=yc(t);for(const a of e){const r=n(a),o=i(a),l=(o||r)&&t[a];if(r&&(Rt(l)||iT(l))||o&&Te(l))return!0}return!1}var rT="3.9.1";const oT=["top","bottom","left","right","chartArea"];function ug(t,e){return t==="top"||t==="bottom"||oT.indexOf(t)===-1&&e==="x"}function cg(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function gg(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Se(n&&n.onComplete,[t],e)}function sT(t){const e=t.chart,n=e.options.animation;Se(n&&n.onProgress,[t],e)}function Ng(t){return Ac()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Mr={},yg=t=>{const e=Ng(t);return Object.values(Mr).filter(n=>n.canvas===e).pop()};function lT(t,e,n){const i=Object.keys(t);for(const a of i){const r=+a;if(r>=e){const o=t[a];delete t[a],(n>0||r>e)&&(t[r+n]=o)}}}function MT(t,e,n,i){return!n||t.type==="mouseout"?null:i?e:t}class ni{constructor(e,n){const i=this.config=new nT(n),a=Ng(e),r=yg(a);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 o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Gp(a)),this.platform.updateConfig(i);const l=this.platform.acquireContext(a,o.aspectRatio),M=l&&l.canvas,u=M&&M.height,c=M&&M.width;if(this.id=VA(),this.ctx=l,this.canvas=M,this.width=c,this.height=u,this._options=o,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 Wp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=oz(g=>this.update(g),o.resizeDelay||0),this._dataChanges=[],Mr[this.id]=this,!l||!M){console.error("Failed to create chart: can't acquire context from the given item");return}Ot.listen(this,"complete",gg),Ot.listen(this,"progress",sT),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:i,height:a,_aspectRatio:r}=this;return Ne(e)?n&&r?r:a?i/a:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():zc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return uc(this.canvas,this.ctx),this}stop(){return Ot.stop(this),this}resize(e,n){Ot.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const i=this.options,a=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(a,e,n,r),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),M=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,zc(this,l,!0)&&(this.notifyPlugins("resize",{size:o}),Se(i.onResize,[this,o],this),this.attached&&this._doResize(M)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};de(n,(i,a)=>{i.id=a})}buildOrUpdateScales(){const e=this.options,n=e.scales,i=this.scales,a=Object.keys(i).reduce((o,l)=>(o[l]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const l=n[o],M=il(o,l),u=M==="r",c=M==="x";return{options:l,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),de(r,o=>{const l=o.options,M=l.id,u=il(M,l),c=Me(l.type,o.dtype);(l.position===void 0||ug(l.position,u)!==ug(o.dposition))&&(l.position=o.dposition),a[M]=!0;let g=null;if(M in i&&i[M].type===c)g=i[M];else{const y=ht.getScale(c);g=new y({id:M,type:c,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(l,e)}),de(a,(o,l)=>{o||delete i[l]}),de(i,o=>{rr.configure(this,o,o.options),rr.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,i=e.length;if(e.sort((a,r)=>a.index-r.index),i>n){for(let a=n;a<i;++a)this._destroyDatasetMeta(a);e.splice(n,i-n)}this._sortedMetasets=e.slice(0).sort(cg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((i,a)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let i,a;for(this._removeUnreferencedMetasets(),i=0,a=n.length;i<a;i++){const r=n[i];let o=this.getDatasetMeta(i);const l=r.type||this.config.type;if(o.type&&o.type!==l&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=l,o.indexAxis=r.indexAxis||nl(l,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const M=ht.getController(l),{datasetElementType:u,dataElementType:c}=oe.datasets[l];Object.assign(M.prototype,{dataElementType:ht.getElement(c),datasetElementType:u&&ht.getElement(u)}),o.controller=new M(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){de(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:g}=this.getDatasetMeta(u),y=!a&&r.indexOf(g)===-1;g.buildOrUpdateElements(y),o=Math.max(+g.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),a||de(r,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(cg("z","_idx"));const{_active:l,_lastEvent:M}=this;M?this._eventHandler(M,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){de(this.scales,e=>{rr.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Yu(n,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:a,count:r}of n){const o=i==="_removeElements"?-r:r;lT(e,a,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(e.filter(o=>o[0]===r).map((o,l)=>l+","+o.splice(1).join(","))),a=i(0);for(let r=1;r<n;r++)if(!Yu(a,i(r)))return;return Array.from(a).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;rr.update(this,this.width,this.height,e);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],de(this.boxes,a=>{i&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,r)=>{a._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Rt(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const i=this.getDatasetMeta(e),a={meta:i,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(i.controller._update(n),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ot.has(this)?this.attached&&!Ot.running(this)&&Ot.start(this):(this.draw(),gg({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:a}=this._resizeBeforeDraw;this._resize(i,a),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,i=[];let a,r;for(a=0,r=n.length;a<r;++a){const o=n[a];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,i=e._clip,a=!i.disabled,r=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(a&&cc(n,{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}),e.controller.draw(),a&&gc(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Gn(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,i,a){const r=pp.modes[n];return typeof r=="function"?r(this,e,i,a):[]}getDatasetMeta(e){const n=this.data.datasets[e],i=this._metasets;let a=i.filter(r=>r&&r._dataset===n).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},i.push(a)),a}getContext(){return this.$context||(this.$context=Vt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(e,n){const i=this.getDatasetMeta(e);i.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,i){const a=i?"show":"hide",r=this.getDatasetMeta(e),o=r.controller._resolveAnimations(void 0,a);nt(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(r,{visible:i}),this.update(l=>l.datasetIndex===e?a:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Ot.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),uc(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Mr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,i=(r,o)=>{n.addEventListener(this,r,o),e[r]=o},a=(r,o,l)=>{r.offsetX=o,r.offsetY=l,this._eventHandler(r)};de(this.options.events,r=>i(r,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,i=(M,u)=>{n.addEventListener(this,M,u),e[M]=u},a=(M,u)=>{e[M]&&(n.removeEventListener(this,M,u),delete e[M])},r=(M,u)=>{this.canvas&&this.resize(M,u)};let o;const l=()=>{a("attach",l),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,a("resize",r),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():o()}unbindEvents(){de(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},de(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,i){const a=i?"set":"remove";let r,o,l,M;for(n==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+a+"DatasetHoverStyle"]()),l=0,M=e.length;l<M;++l){o=e[l];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[a+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],i=e.map(({datasetIndex:r,index:o})=>{const l=this.getDatasetMeta(r);if(!l)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:l.data[o],index:o}});!Ya(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(e,n,i){return this._plugins.notify(this,e,n,i)}_updateHoverStyles(e,n,i){const a=this.options.hover,r=(M,u)=>M.filter(c=>!u.some(g=>c.datasetIndex===g.datasetIndex&&c.index===g.index)),o=r(n,e),l=i?e:r(e,n);o.length&&this.updateHoverStyle(o,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(e,n){const i={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},a=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,a)===!1)return;const r=this._handleEvent(e,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,a),(r||i.changed)&&this.render(),this}_handleEvent(e,n,i){const{_active:a=[],options:r}=this,o=n,l=this._getActiveElements(e,a,i,o),M=JA(e),u=MT(e,this._lastEvent,i,M);i&&(this._lastEvent=null,Se(r.onHover,[e,l,this],this),M&&Se(r.onClick,[e,l,this],this));const c=!Ya(l,a);return(c||n)&&(this._active=l,this._updateHoverStyles(l,a,n)),this._lastEvent=u,c}_getActiveElements(e,n,i,a){if(e.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,a)}}const dg=()=>de(ni.instances,t=>t._plugins.invalidate()),Gt=!0;Object.defineProperties(ni,{defaults:{enumerable:Gt,value:oe},instances:{enumerable:Gt,value:Mr},overrides:{enumerable:Gt,value:tn},registry:{enumerable:Gt,value:ht},version:{enumerable:Gt,value:rT},getChart:{enumerable:Gt,value:yg},register:{enumerable:Gt,value:(...t)=>{ht.add(...t),dg()}},unregister:{enumerable:Gt,value:(...t)=>{ht.remove(...t),dg()}}});function jg(t,e,n){const{startAngle:i,pixelMargin:a,x:r,y:o,outerRadius:l,innerRadius:M}=e;let u=a/l;t.beginPath(),t.arc(r,o,l,i-u,n+u),M>a?(u=a/M,t.arc(r,o,M,n+u,i-u,!0)):t.arc(r,o,a,n+be,i-be),t.closePath(),t.clip()}function uT(t){return _s(t,["outerStart","outerEnd","innerStart","innerEnd"])}function cT(t,e,n,i){const a=uT(t.options.borderRadius),r=(n-e)/2,o=Math.min(r,i*e/2),l=M=>{const u=(n-Math.min(r,M))*i/2;return Be(M,0,Math.min(r,u))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:Be(a.innerStart,0,o),innerEnd:Be(a.innerEnd,0,o)}}function zn(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function al(t,e,n,i,a,r){const{x:o,y:l,startAngle:M,pixelMargin:u,innerRadius:c}=e,g=Math.max(e.outerRadius+i+n-u,0),y=c>0?c+i+n+u:0;let d=0;const j=a-M;if(i){const T=c>0?c-i:0,Q=g>0?g-i:0,V=(T+Q)/2,Z=V!==0?j*V/(V+i):j;d=(j-Z)/2}const f=Math.max(.001,j*g-n/Ee)/g,I=(j-f)/2,N=M+I+d,D=a-I-d,{outerStart:A,outerEnd:p,innerStart:m,innerEnd:z}=cT(e,y,g,D-N),k=g-A,v=g-p,Y=N+A/k,R=D-p/v,w=y+m,h=y+z,E=N+m/w,C=D-z/h;if(t.beginPath(),r){if(t.arc(o,l,g,Y,R),p>0){const V=zn(v,R,o,l);t.arc(V.x,V.y,p,R,D+be)}const T=zn(h,D,o,l);if(t.lineTo(T.x,T.y),z>0){const V=zn(h,C,o,l);t.arc(V.x,V.y,z,D+be,C+Math.PI)}if(t.arc(o,l,y,D-z/y,N+m/y,!0),m>0){const V=zn(w,E,o,l);t.arc(V.x,V.y,m,E+Math.PI,N-be)}const Q=zn(k,N,o,l);if(t.lineTo(Q.x,Q.y),A>0){const V=zn(k,Y,o,l);t.arc(V.x,V.y,A,N-be,Y)}}else{t.moveTo(o,l);const T=Math.cos(Y)*g+o,Q=Math.sin(Y)*g+l;t.lineTo(T,Q);const V=Math.cos(R)*g+o,Z=Math.sin(R)*g+l;t.lineTo(V,Z)}t.closePath()}function gT(t,e,n,i,a){const{fullCircles:r,startAngle:o,circumference:l}=e;let M=e.endAngle;if(r){al(t,e,n,i,o+De,a);for(let u=0;u<r;++u)t.fill();isNaN(l)||(M=o+l%De,l%De===0&&(M+=De))}return al(t,e,n,i,M,a),t.fill(),M}function NT(t,e,n){const{x:i,y:a,startAngle:r,pixelMargin:o,fullCircles:l}=e,M=Math.max(e.outerRadius-o,0),u=e.innerRadius+o;let c;for(n&&jg(t,e,r+De),t.beginPath(),t.arc(i,a,u,r+De,r,!0),c=0;c<l;++c)t.stroke();for(t.beginPath(),t.arc(i,a,M,r,r+De),c=0;c<l;++c)t.stroke()}function yT(t,e,n,i,a,r){const{options:o}=e,{borderWidth:l,borderJoinStyle:M}=o,u=o.borderAlign==="inner";!l||(u?(t.lineWidth=l*2,t.lineJoin=M||"round"):(t.lineWidth=l,t.lineJoin=M||"bevel"),e.fullCircles&&NT(t,e,u),u&&jg(t,e,a),al(t,e,n,i,a,r),t.stroke())}class rl extends St{constructor(e){super(),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,n,i){const a=this.getProps(["x","y"],i),{angle:r,distance:o}=Bu(a,{x:e,y:n}),{startAngle:l,endAngle:M,innerRadius:u,outerRadius:c,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),y=this.options.spacing/2,j=Me(g,M-l)>=De||Pn(r,l,M),f=Ra(o,u+y,c+y);return j&&f}getCenterPoint(e){const{x:n,y:i,startAngle:a,endAngle:r,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:M,spacing:u}=this.options,c=(a+r)/2,g=(o+l+u+M)/2;return{x:n+Math.cos(c)*g,y:i+Math.sin(c)*g}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:i}=this,a=(n.offset||0)/2,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>De?Math.floor(i/De):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let l=0;if(a){l=a/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*l,Math.sin(u)*l),this.circumference>=Ee&&(l=a)}e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor;const M=gT(e,this,l,r,o);yT(e,this,l,r,M,o),e.restore()}}rl.id="arc",rl.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},rl.defaultRoutes={backgroundColor:"backgroundColor"};function Ig(t,e,n=e){t.lineCap=Me(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Me(n.borderDash,e.borderDash)),t.lineDashOffset=Me(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Me(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Me(n.borderWidth,e.borderWidth),t.strokeStyle=Me(n.borderColor,e.borderColor)}function dT(t,e,n){t.lineTo(n.x,n.y)}function jT(t){return t.stepped?kz:t.tension||t.cubicInterpolationMode==="monotone"?vz:dT}function Dg(t,e,n={}){const i=t.length,{start:a=0,end:r=i-1}=n,{start:o,end:l}=e,M=Math.max(a,o),u=Math.min(r,l),c=a<o&&r<o||a>l&&r>l;return{count:i,start:M,loop:e.loop,ilen:u<M&&!c?i+u-M:u-M}}function IT(t,e,n,i){const{points:a,options:r}=e,{count:o,start:l,loop:M,ilen:u}=Dg(a,n,i),c=jT(r);let{move:g=!0,reverse:y}=i||{},d,j,f;for(d=0;d<=u;++d)j=a[(l+(y?u-d:d))%o],!j.skip&&(g?(t.moveTo(j.x,j.y),g=!1):c(t,f,j,y,r.stepped),f=j);return M&&(j=a[(l+(y?u:0))%o],c(t,f,j,y,r.stepped)),!!M}function DT(t,e,n,i){const a=e.points,{count:r,start:o,ilen:l}=Dg(a,n,i),{move:M=!0,reverse:u}=i||{};let c=0,g=0,y,d,j,f,I,N;const D=p=>(o+(u?l-p:p))%r,A=()=>{f!==I&&(t.lineTo(c,I),t.lineTo(c,f),t.lineTo(c,N))};for(M&&(d=a[D(0)],t.moveTo(d.x,d.y)),y=0;y<=l;++y){if(d=a[D(y)],d.skip)continue;const p=d.x,m=d.y,z=p|0;z===j?(m<f?f=m:m>I&&(I=m),c=(g*c+p)/++g):(A(),t.lineTo(p,m),j=z,g=0,f=I=m),N=m}A()}function ol(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?DT:IT}function fT(t){return t.stepped?g0:t.tension||t.cubicInterpolationMode==="monotone"?N0:on}function hT(t,e,n,i){let a=e._path;a||(a=e._path=new Path2D,e.path(a,n,i)&&a.closePath()),Ig(t,e.options),t.stroke(a)}function mT(t,e,n,i){const{segments:a,options:r}=e,o=ol(e);for(const l of a)Ig(t,r,l.style),t.beginPath(),o(t,e,l,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}const AT=typeof Path2D=="function";function zT(t,e,n,i){AT&&!e.options.segment?hT(t,e,n,i):mT(t,e,n,i)}class ur extends St{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const a=i.spanGaps?this._loop:this._fullLoop;a0(this._points,i,e,a,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=p0(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,i=e.length;return i&&n[e[i-1].end]}interpolate(e,n){const i=this.options,a=e[n],r=this.points,o=m0(this,{property:n,start:a,end:a});if(!o.length)return;const l=[],M=fT(i);let u,c;for(u=0,c=o.length;u<c;++u){const{start:g,end:y}=o[u],d=r[g],j=r[y];if(d===j){l.push(d);continue}const f=Math.abs((a-d[n])/(j[n]-d[n])),I=M(d,j,f,i.stepped);I[n]=e[n],l.push(I)}return l.length===1?l[0]:l}pathSegment(e,n,i){return ol(this)(e,this,n,i)}path(e,n,i){const a=this.segments,r=ol(this);let o=this._loop;n=n||0,i=i||this.points.length-n;for(const l of a)o&=r(e,this,l,{start:n,end:n+i-1});return!!o}draw(e,n,i,a){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),zT(e,this,i,a),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ur.id="line",ur.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},ur.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},ur.descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};function fg(t,e,n,i){const a=t.options,{[n]:r}=t.getProps([n],i);return Math.abs(e-r)<a.radius+a.hitRadius}class sl extends St{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,i){const a=this.options,{x:r,y:o}=this.getProps(["x","y"],i);return Math.pow(e-r,2)+Math.pow(n-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,n){return fg(this,e,"x",n)}inYRange(e,n){return fg(this,e,"y",n)}getCenterPoint(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const i=n&&e.borderWidth||0;return(n+i)*2}draw(e,n){const i=this.options;this.skip||i.radius<.1||!Gn(this,n,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Qs(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}sl.id="point",sl.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},sl.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function hg(t,e){const{x:n,y:i,base:a,width:r,height:o}=t.getProps(["x","y","base","width","height"],e);let l,M,u,c,g;return t.horizontal?(g=o/2,l=Math.min(n,a),M=Math.max(n,a),u=i-g,c=i+g):(g=r/2,l=n-g,M=n+g,u=Math.min(i,a),c=Math.max(i,a)),{left:l,top:u,right:M,bottom:c}}function Wt(t,e,n,i){return t?0:Be(e,n,i)}function pT(t,e,n){const i=t.options.borderWidth,a=t.borderSkipped,r=Nc(i);return{t:Wt(a.top,r.top,0,n),r:Wt(a.right,r.right,0,e),b:Wt(a.bottom,r.bottom,0,n),l:Wt(a.left,r.left,0,e)}}function TT(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,r=hn(a),o=Math.min(e,n),l=t.borderSkipped,M=i||le(a);return{topLeft:Wt(!M||l.top||l.left,r.topLeft,0,o),topRight:Wt(!M||l.top||l.right,r.topRight,0,o),bottomLeft:Wt(!M||l.bottom||l.left,r.bottomLeft,0,o),bottomRight:Wt(!M||l.bottom||l.right,r.bottomRight,0,o)}}function LT(t){const e=hg(t),n=e.right-e.left,i=e.bottom-e.top,a=pT(t,n/2,i/2),r=TT(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:r},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,r.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(a.b,a.r))}}}}function ll(t,e,n,i){const a=e===null,r=n===null,l=t&&!(a&&r)&&hg(t,i);return l&&(a||Ra(e,l.left,l.right))&&(r||Ra(n,l.top,l.bottom))}function xT(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function OT(t,e){t.rect(e.x,e.y,e.w,e.h)}function Ml(t,e,n={}){const i=t.x!==n.x?-e:0,a=t.y!==n.y?-e:0,r=(t.x+t.w!==n.x+n.w?e:0)-i,o=(t.y+t.h!==n.y+n.h?e:0)-a;return{x:t.x+i,y:t.y+a,w:t.w+r,h:t.h+o,radius:t.radius}}class cr extends St{constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:i,backgroundColor:a}}=this,{inner:r,outer:o}=LT(this),l=xT(o.radius)?Fa:OT;e.save(),(o.w!==r.w||o.h!==r.h)&&(e.beginPath(),l(e,Ml(o,n,r)),e.clip(),l(e,Ml(r,-n,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),l(e,Ml(r,n)),e.fillStyle=a,e.fill(),e.restore()}inRange(e,n,i){return ll(this,e,n,i)}inXRange(e,n){return ll(this,e,null,n)}inYRange(e,n){return ll(this,null,e,n)}getCenterPoint(e){const{x:n,y:i,base:a,horizontal:r}=this.getProps(["x","y","base","horizontal"],e);return{x:r?(n+a)/2:n,y:r?i:(i+a)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}cr.id="bar",cr.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},cr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};const ii={average(t){if(!t.length)return!1;let e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){const o=t[e].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i+=l.x,a+=l.y,++r}}return{x:i/r,y:a/r}},nearest(t,e){if(!t.length)return!1;let n=e.x,i=e.y,a=Number.POSITIVE_INFINITY,r,o,l;for(r=0,o=t.length;r<o;++r){const M=t[r].element;if(M&&M.hasValue()){const u=M.getCenterPoint(),c=Ls(e,u);c<a&&(a=c,l=M)}}if(l){const M=l.tooltipPosition();n=M.x,i=M.y}return{x:n,y:i}}};function mt(t,e){return e&&(Te(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Et(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
18
18
|
`)>-1?t.split(`
|
|
19
|
-
`):t}function ST(t,e){const{element:n,datasetIndex:i,index:a}=e,r=t.getDatasetMeta(i).controller,{label:o,value:l}=r.getLabelAndValue(a);return{chart:t,label:o,parsed:r.getParsed(a),raw:t.data.datasets[i].data[a],formattedValue:l,dataset:r.getDataset(),dataIndex:a,datasetIndex:i,element:n}}function mg(t,e){const n=t.chart.ctx,{body:i,footer:a,title:r}=t,{boxWidth:o,boxHeight:l}=e,M=et(e.bodyFont),u=et(e.titleFont),c=et(e.footerFont),g=r.length,y=a.length,d=i.length,j=rt(e.padding);let f=j.height,I=0,N=i.reduce((p,m)=>p+m.before.length+m.lines.length+m.after.length,0);if(N+=t.beforeBody.length+t.afterBody.length,g&&(f+=g*u.lineHeight+(g-1)*e.titleSpacing+e.titleMarginBottom),N){const p=e.displayColors?Math.max(l,M.lineHeight):M.lineHeight;f+=d*p+(N-d)*M.lineHeight+(N-1)*e.bodySpacing}y&&(f+=e.footerMarginTop+y*c.lineHeight+(y-1)*e.footerSpacing);let D=0;const A=function(p){I=Math.max(I,n.measureText(p).width+D)};return n.save(),n.font=u.string,de(t.title,A),n.font=M.string,de(t.beforeBody.concat(t.afterBody),A),D=e.displayColors?o+2+e.boxPadding:0,de(i,p=>{de(p.before,A),de(p.lines,A),de(p.after,A)}),D=0,n.font=c.string,de(t.footer,A),n.restore(),I+=j.width,{width:I,height:f}}function ET(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}function bT(t,e,n,i){const{x:a,width:r}=i,o=n.caretSize+n.caretPadding;if(t==="left"&&a+r+o>e.width||t==="right"&&a-r-o<0)return!0}function CT(t,e,n,i){const{x:a,width:r}=n,{width:o,chartArea:{left:l,right:M}}=t;let u="center";return i==="center"?u=a<=(l+M)/2?"left":"right":a<=r/2?u="left":a>=o-r/2&&(u="right"),bT(u,t,e,n)&&(u="center"),u}function Ag(t,e,n){const i=n.yAlign||e.yAlign||ET(t,n);return{xAlign:n.xAlign||e.xAlign||CT(t,e,n,i),yAlign:i}}function wT(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function kT(t,e,n){let{y:i,height:a}=t;return e==="top"?i+=n:e==="bottom"?i-=a+n:i-=a/2,i}function zg(t,e,n,i){const{caretSize:a,caretPadding:r,cornerRadius:o}=t,{xAlign:l,yAlign:M}=n,u=a+r,{topLeft:c,topRight:g,bottomLeft:y,bottomRight:d}=hn(o);let j=wT(e,l);const f=kT(e,M,u);return M==="center"?l==="left"?j+=u:l==="right"&&(j-=u):l==="left"?j-=Math.max(c,y)+a:l==="right"&&(j+=Math.max(g,d)+a),{x:Be(j,0,i.width-e.width),y:Be(f,0,i.height-e.height)}}function gr(t,e,n){const i=rt(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function pg(t){return mt([],Et(t))}function vT(t,e,n){return Vt(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Tg(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class ul extends St{constructor(e){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=e.chart||e._chart,this._chart=this.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,i=this.options.setContext(this.getContext()),a=i.enabled&&n.options.animation&&i.animations,r=new bc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=vT(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,a=i.beforeTitle.apply(this,[e]),r=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let l=[];return l=mt(l,Et(a)),l=mt(l,Et(r)),l=mt(l,Et(o)),l}getBeforeBody(e,n){return pg(n.callbacks.beforeBody.apply(this,[e]))}getBody(e,n){const{callbacks:i}=n,a=[];return de(e,r=>{const o={before:[],lines:[],after:[]},l=Tg(i,r);mt(o.before,Et(l.beforeLabel.call(this,r))),mt(o.lines,l.label.call(this,r)),mt(o.after,Et(l.afterLabel.call(this,r))),a.push(o)}),a}getAfterBody(e,n){return pg(n.callbacks.afterBody.apply(this,[e]))}getFooter(e,n){const{callbacks:i}=n,a=i.beforeFooter.apply(this,[e]),r=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let l=[];return l=mt(l,Et(a)),l=mt(l,Et(r)),l=mt(l,Et(o)),l}_createItems(e){const n=this._active,i=this.chart.data,a=[],r=[],o=[];let l=[],M,u;for(M=0,u=n.length;M<u;++M)l.push(ST(this.chart,n[M]));return e.filter&&(l=l.filter((c,g,y)=>e.filter(c,g,y,i))),e.itemSort&&(l=l.sort((c,g)=>e.itemSort(c,g,i))),de(l,c=>{const g=Tg(e.callbacks,c);a.push(g.labelColor.call(this,c)),r.push(g.labelPointStyle.call(this,c)),o.push(g.labelTextColor.call(this,c))}),this.labelColors=a,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=l,l}update(e,n){const i=this.options.setContext(this.getContext()),a=this._active;let r,o=[];if(!a.length)this.opacity!==0&&(r={opacity:0});else{const l=ii[i.position].call(this,a,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const M=this._size=mg(this,i),u=Object.assign({},l,M),c=Ag(this.chart,i,u),g=zg(i,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,r={opacity:1,x:g.x,y:g.y,width:M.width,height:M.height,caretX:l.x,caretY:l.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,a){const r=this.getCaretPosition(e,i,a);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(e,n,i){const{xAlign:a,yAlign:r}=this,{caretSize:o,cornerRadius:l}=i,{topLeft:M,topRight:u,bottomLeft:c,bottomRight:g}=hn(l),{x:y,y:d}=e,{width:j,height:f}=n;let I,N,D,A,p,m;return r==="center"?(p=d+f/2,a==="left"?(I=y,N=I-o,A=p+o,m=p-o):(I=y+j,N=I+o,A=p-o,m=p+o),D=I):(a==="left"?N=y+Math.max(M,c)+o:a==="right"?N=y+j-Math.max(u,g)-o:N=this.caretX,r==="top"?(A=d,p=A-o,I=N-o,D=N+o):(A=d+f,p=A+o,I=N+o,D=N-o),m=A),{x1:I,x2:N,x3:D,y1:A,y2:p,y3:m}}drawTitle(e,n,i){const a=this.title,r=a.length;let o,l,M;if(r){const u=Bs(i.rtl,this.x,this.width);for(e.x=gr(this,i.titleAlign,i),n.textAlign=u.textAlign(i.titleAlign),n.textBaseline="middle",o=et(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,M=0;M<r;++M)n.fillText(a[M],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+l,M+1===r&&(e.y+=i.titleMarginBottom-l)}}_drawColorBox(e,n,i,a,r){const o=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:M,boxWidth:u,boxPadding:c}=r,g=et(r.bodyFont),y=gr(this,"left",r),d=a.x(y),j=M<g.lineHeight?(g.lineHeight-M)/2:0,f=n.y+j;if(r.usePointStyle){const I={radius:Math.min(u,M)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},N=a.leftForLtr(d,u)+u/2,D=f+M/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,Qs(e,I,N,D),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Qs(e,I,N,D)}else{e.lineWidth=le(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const I=a.leftForLtr(d,u-c),N=a.leftForLtr(a.xPlus(d,1),u-c-2),D=hn(o.borderRadius);Object.values(D).some(A=>A!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,Fa(e,{x:I,y:f,w:u,h:M,radius:D}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Fa(e,{x:N,y:f+1,w:u-2,h:M-2,radius:D}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(I,f,u,M),e.strokeRect(I,f,u,M),e.fillStyle=o.backgroundColor,e.fillRect(N,f+1,u-2,M-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:a}=this,{bodySpacing:r,bodyAlign:o,displayColors:l,boxHeight:M,boxWidth:u,boxPadding:c}=i,g=et(i.bodyFont);let y=g.lineHeight,d=0;const j=Bs(i.rtl,this.x,this.width),f=function(v){n.fillText(v,j.x(e.x+d),e.y+y/2),e.y+=y+r},I=j.textAlign(o);let N,D,A,p,m,z,k;for(n.textAlign=o,n.textBaseline="middle",n.font=g.string,e.x=gr(this,I,i),n.fillStyle=i.bodyColor,de(this.beforeBody,f),d=l&&I!=="right"?o==="center"?u/2+c:u+2+c:0,p=0,z=a.length;p<z;++p){for(N=a[p],D=this.labelTextColors[p],n.fillStyle=D,de(N.before,f),A=N.lines,l&&A.length&&(this._drawColorBox(n,e,p,j,i),y=Math.max(g.lineHeight,M)),m=0,k=A.length;m<k;++m)f(A[m]),y=g.lineHeight;de(N.after,f)}d=0,y=g.lineHeight,de(this.afterBody,f),e.y-=r}drawFooter(e,n,i){const a=this.footer,r=a.length;let o,l;if(r){const M=Bs(i.rtl,this.x,this.width);for(e.x=gr(this,i.footerAlign,i),e.y+=i.footerMarginTop,n.textAlign=M.textAlign(i.footerAlign),n.textBaseline="middle",o=et(i.footerFont),n.fillStyle=i.footerColor,n.font=o.string,l=0;l<r;++l)n.fillText(a[l],M.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,n,i,a){const{xAlign:r,yAlign:o}=this,{x:l,y:M}=e,{width:u,height:c}=i,{topLeft:g,topRight:y,bottomLeft:d,bottomRight:j}=hn(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(l+g,M),o==="top"&&this.drawCaret(e,n,i,a),n.lineTo(l+u-y,M),n.quadraticCurveTo(l+u,M,l+u,M+y),o==="center"&&r==="right"&&this.drawCaret(e,n,i,a),n.lineTo(l+u,M+c-j),n.quadraticCurveTo(l+u,M+c,l+u-j,M+c),o==="bottom"&&this.drawCaret(e,n,i,a),n.lineTo(l+d,M+c),n.quadraticCurveTo(l,M+c,l,M+c-d),o==="center"&&r==="left"&&this.drawCaret(e,n,i,a),n.lineTo(l,M+g),n.quadraticCurveTo(l,M,l+g,M),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,a=i&&i.x,r=i&&i.y;if(a||r){const o=ii[e.position].call(this,this._active,this._eventPosition);if(!o)return;const l=this._size=mg(this,e),M=Object.assign({},o,this._size),u=Ag(n,e,M),c=zg(e,M,u,n);(a._to!==c.x||r._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=rt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,a,n),I0(e,n.textDirection),r.y+=o.top,this.drawTitle(r,e,n),this.drawBody(r,e,n),this.drawFooter(r,e,n),D0(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,a=e.map(({datasetIndex:l,index:M})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[M],index:M}}),r=!Ya(i,a),o=this._positionChanged(a,n);(r||o)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,r=this._active||[],o=this._getActiveElements(e,r,n,i),l=this._positionChanged(o,e),M=n||!Ya(o,r)||l;return M&&(this._active=o,(a.enabled||a.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),M}_getActiveElements(e,n,i,a){const r=this.options;if(e.type==="mouseout")return[];if(!a)return n;const o=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:i,caretY:a,options:r}=this,o=ii[r.position].call(this,e,n);return o!==!1&&(i!==o.x||a!==o.y)}}ul.positioners=ii;var QT={id:"tooltip",_element:ul,positioners:ii,afterInit(t,e,n){n&&(t.tooltip=new ul({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",n)===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:{beforeTitle:Lt,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Ne(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const _T=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function YT(t,e,n,i){const a=t.indexOf(e);if(a===-1)return _T(t,e,n,i);const r=t.lastIndexOf(e);return a!==r?n:a}const UT=(t,e)=>t===null?null:Be(Math.round(t),0,e);class Nr extends sn{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:a,label:r}of n)i[a]===r&&i.splice(a,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Ne(e))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===e?n:YT(i,e,Me(n,e),this._addedLabels),UT(n,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),n||(a=this.getLabels().length-1)),this.min=i,this.max=a}buildTicks(){const e=this.min,n=this.max,i=this.options.offset,a=[];let r=this.getLabels();r=e===0&&n===r.length-1?r:r.slice(e,n+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=n;o++)a.push({value:o});return a}getLabelForValue(e){const n=this.getLabels();return e>=0&&e<n.length?n[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Nr.id="category",Nr.defaults={ticks:{callback:Nr.prototype.getLabelForValue}};function PT(t,e){const n=[],{bounds:a,step:r,min:o,max:l,precision:M,count:u,maxTicks:c,maxDigits:g,includeBounds:y}=t,d=r||1,j=c-1,{min:f,max:I}=e,N=!Ne(o),D=!Ne(l),A=!Ne(u),p=(I-f)/(g+1);let m=Pu((I-f)/j/d)*d,z,k,v,Y;if(m<1e-14&&!N&&!D)return[{value:f},{value:I}];Y=Math.ceil(I/m)-Math.floor(f/m),Y>j&&(m=Pu(Y*m/j/d)*d),Ne(M)||(z=Math.pow(10,M),m=Math.ceil(m*z)/z),a==="ticks"?(k=Math.floor(f/m)*m,v=Math.ceil(I/m)*m):(k=f,v=I),N&&D&&r&&ez((l-o)/r,m/1e3)?(Y=Math.round(Math.min((l-o)/m,c)),m=(l-o)/Y,k=o,v=l):A?(k=N?o:k,v=D?l:v,Y=u-1,m=(v-k)/Y):(Y=(v-k)/m,Un(Y,Math.round(Y),m/1e3)?Y=Math.round(Y):Y=Math.ceil(Y));const R=Math.max(Zu(m),Zu(k));z=Math.pow(10,Ne(M)?R:M),k=Math.round(k*z)/z,v=Math.round(v*z)/z;let w=0;for(N&&(y&&k!==o?(n.push({value:o}),k<o&&w++,Un(Math.round((k+w*m)*z)/z,o,Lg(o,p,t))&&w++):k<o&&w++);w<Y;++w)n.push({value:Math.round((k+w*m)*z)/z});return D&&y&&v!==l?n.length&&Un(n[n.length-1].value,l,Lg(l,p,t))?n[n.length-1].value=l:n.push({value:l}):(!D||v===l)&&n.push({value:v}),n}function Lg(t,e,{horizontal:n,minRotation:i}){const a=ut(i),r=(n?Math.sin(a):Math.cos(a))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}class yr extends sn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Ne(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:a,max:r}=this;const o=M=>a=n?a:M,l=M=>r=i?r:M;if(e){const M=ft(a),u=ft(r);M<0&&u<0?l(0):M>0&&u>0&&o(0)}if(a===r){let M=1;(r>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(M=Math.abs(r*.05)),l(r+M),e||o(a-M)}this.min=a,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,a;return i?(a=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const a={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=PT(a,r);return e.bounds==="ticks"&&Ru(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const a=(i-n)/Math.max(e.length-1,1)/2;n-=a,i+=a}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Wn(e,this.chart.options.locale,this.options.ticks.format)}}class cl extends yr{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Re(e)?e:0,this.max=Re(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=ut(this.options.ticks.minRotation),a=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/a))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}cl.id="linear",cl.defaults={ticks:{callback:tr.formatters.numeric}};function xg(t){return t/Math.pow(10,Math.floor(it(t)))===1}function RT(t,e){const n=Math.floor(it(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),a=[];let r=tt(t.min,Math.pow(10,Math.floor(it(e.min)))),o=Math.floor(it(r)),l=Math.floor(r/Math.pow(10,o)),M=o<0?Math.pow(10,Math.abs(o)):1;do a.push({value:r,major:xg(r)}),++l,l===10&&(l=1,++o,M=o>=0?1:M),r=Math.round(l*Math.pow(10,o)*M)/M;while(o<n||o===n&&l<i);const u=tt(t.max,r);return a.push({value:u,major:xg(r)}),a}class Og extends sn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=yr.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return Re(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Re(e)?Math.max(0,e):null,this.max=Re(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,a=this.max;const r=M=>i=e?i:M,o=M=>a=n?a:M,l=(M,u)=>Math.pow(10,Math.floor(it(M))+u);i===a&&(i<=0?(r(1),o(10)):(r(l(i,-1)),o(l(a,1)))),i<=0&&r(l(a,-1)),a<=0&&o(l(i,1)),this._zero&&this.min!==this._suggestedMin&&i===l(this.min,0)&&r(l(i,-1)),this.min=i,this.max=a}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=RT(n,this);return e.bounds==="ticks"&&Ru(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Wn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=it(e),this._valueRange=it(this.max)-it(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(it(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}Og.id="logarithmic",Og.defaults={ticks:{callback:tr.formatters.logarithmic,major:{enabled:!0}}};function gl(t){const e=t.ticks;if(e.display&&t.display){const n=rt(e.backdropPadding);return Me(e.font&&e.font.size,oe.font.size)+n.height}return 0}function ZT(t,e,n){return n=Te(n)?n:[n],{w:Cz(t,e.string,n),h:n.length*e.lineHeight}}function Sg(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function BT(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],a=[],r=t._pointLabels.length,o=t.options.pointLabels,l=o.centerPointLabels?Ee/r:0;for(let M=0;M<r;M++){const u=o.setContext(t.getPointLabelContext(M));a[M]=u.padding;const c=t.getPointPosition(M,t.drawingArea+a[M],l),g=et(u.font),y=ZT(t.ctx,g,t._pointLabels[M]);i[M]=y;const d=ct(t.getIndexAngle(M)+l),j=Math.round(Ts(d)),f=Sg(j,c.x,y.w,0,180),I=Sg(j,c.y,y.h,90,270);VT(n,e,d,f,I)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=GT(t,i,a)}function VT(t,e,n,i,a){const r=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let l=0,M=0;i.start<e.l?(l=(e.l-i.start)/r,t.l=Math.min(t.l,e.l-l)):i.end>e.r&&(l=(i.end-e.r)/r,t.r=Math.max(t.r,e.r+l)),a.start<e.t?(M=(e.t-a.start)/o,t.t=Math.min(t.t,e.t-M)):a.end>e.b&&(M=(a.end-e.b)/o,t.b=Math.max(t.b,e.b+M))}function GT(t,e,n){const i=[],a=t._pointLabels.length,r=t.options,o=gl(r)/2,l=t.drawingArea,M=r.pointLabels.centerPointLabels?Ee/a:0;for(let u=0;u<a;u++){const c=t.getPointPosition(u,l+o+n[u],M),g=Math.round(Ts(ct(c.angle+be))),y=e[u],d=HT(c.y,y.h,g),j=WT(g),f=$T(c.x,y.w,j);i.push({x:c.x,y:d,textAlign:j,left:f,top:d,right:f+y.w,bottom:d+y.h})}return i}function WT(t){return t===0||t===180?"center":t<180?"left":"right"}function $T(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function HT(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function FT(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let a=e-1;a>=0;a--){const r=i.setContext(t.getPointLabelContext(a)),o=et(r.font),{x:l,y:M,textAlign:u,left:c,top:g,right:y,bottom:d}=t._pointLabelItems[a],{backdropColor:j}=r;if(!Ne(j)){const f=hn(r.borderRadius),I=rt(r.backdropPadding);n.fillStyle=j;const N=c-I.left,D=g-I.top,A=y-c+I.width,p=d-g+I.height;Object.values(f).some(m=>m!==0)?(n.beginPath(),Fa(n,{x:N,y:D,w:A,h:p,radius:f}),n.fill()):n.fillRect(N,D,A,p)}Ha(n,t._pointLabels[a],l,M+o.lineHeight/2,o,{color:r.color,textAlign:u,textBaseline:"middle"})}}function Eg(t,e,n,i){const{ctx:a}=t;if(n)a.arc(t.xCenter,t.yCenter,e,0,De);else{let r=t.getPointPosition(0,e);a.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=t.getPointPosition(o,e),a.lineTo(r.x,r.y)}}function JT(t,e,n,i){const a=t.ctx,r=e.circular,{color:o,lineWidth:l}=e;!r&&!i||!o||!l||n<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),Eg(t,n,r,i),a.closePath(),a.stroke(),a.restore())}function XT(t,e,n){return Vt(t,{label:n,index:e,type:"pointLabel"})}class dr extends yr{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=rt(gl(this.options)/2),n=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=Re(e)&&!isNaN(e)?e:0,this.max=Re(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/gl(this.options))}generateTickLabels(e){yr.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,i)=>{const a=Se(this.options.pointLabels.callback,[n,i],this);return a||a===0?a:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?BT(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,a){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,a))}getIndexAngle(e){const n=De/(this._pointLabels.length||1),i=this.options.startAngle||0;return ct(e*n+ut(i))}getDistanceFromCenterForValue(e){if(Ne(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(Ne(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const i=n[e];return XT(this.getContext(),e,i)}}getPointPosition(e,n,i=0){const a=this.getIndexAngle(e)-be+i;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:i,right:a,bottom:r}=this._pointLabelItems[e];return{left:n,top:i,right:a,bottom:r}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),Eg(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:i,grid:a}=n,r=this._pointLabels.length;let o,l,M;if(n.pointLabels.display&&FT(this,r),a.display&&this.ticks.forEach((u,c)=>{if(c!==0){l=this.getDistanceFromCenterForValue(u.value);const g=a.setContext(this.getContext(c-1));JT(this,g,l,r)}}),i.display){for(e.save(),o=r-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:c,lineWidth:g}=u;!g||!c||(e.lineWidth=g,e.strokeStyle=c,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),M=this.getPointPosition(o,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(M.x,M.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const a=this.getIndexAngle(0);let r,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,M)=>{if(M===0&&!n.reverse)return;const u=i.setContext(this.getContext(M)),c=et(u.font);if(r=this.getDistanceFromCenterForValue(this.ticks[M].value),u.showLabelBackdrop){e.font=c.string,o=e.measureText(l.label).width,e.fillStyle=u.backdropColor;const g=rt(u.backdropPadding);e.fillRect(-o/2-g.left,-r-c.size/2-g.top,o+g.width,c.size+g.height)}Ha(e,l.label,0,-r,c,{color:u.color})}),e.restore()}drawTitle(){}}dr.id="radialLinear",dr.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:tr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}},dr.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},dr.descriptors={angleLines:{_fallback:"grid"}};const jr={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}},Ke=Object.keys(jr);function KT(t,e){return t-e}function bg(t,e){if(Ne(e))return null;const n=t._adapter,{parser:i,round:a,isoWeekday:r}=t._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Re(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(a&&(o=a==="week"&&(Dn(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,a)),+o)}function Cg(t,e,n,i){const a=Ke.length;for(let r=Ke.indexOf(t);r<a-1;++r){const o=jr[Ke[r]],l=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(l*o.size))<=i)return Ke[r]}return Ke[a-1]}function qT(t,e,n,i,a){for(let r=Ke.length-1;r>=Ke.indexOf(n);r--){const o=Ke[r];if(jr[o].common&&t._adapter.diff(a,i,o)>=e-1)return o}return Ke[n?Ke.indexOf(n):0]}function eL(t){for(let e=Ke.indexOf(t)+1,n=Ke.length;e<n;++e)if(jr[Ke[e]].common)return Ke[e]}function wg(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:i,hi:a}=xs(n,e),r=n[i]>=e?n[i]:n[a];t[r]=!0}}function tL(t,e,n,i){const a=t._adapter,r=+a.startOf(e[0].value,i),o=e[e.length-1].value;let l,M;for(l=r;l<=o;l=+a.add(l,1,i))M=n[l],M>=0&&(e[M].major=!0);return e}function kg(t,e,n){const i=[],a={},r=e.length;let o,l;for(o=0;o<r;++o)l=e[o],a[l]=o,i.push({value:l,major:!1});return r===0||!n?i:tL(t,i,a,n)}class Ir extends sn{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n){const i=e.time||(e.time={}),a=this._adapter=new fp._date(e.adapters.date);a.init(n),_n(i.displayFormats,a.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:bg(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,i=e.time.unit||"day";let{min:a,max:r,minDefined:o,maxDefined:l}=this.getUserBounds();function M(u){!o&&!isNaN(u.min)&&(a=Math.min(a,u.min)),!l&&!isNaN(u.max)&&(r=Math.max(r,u.max))}(!o||!l)&&(M(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&M(this.getMinMax(!1))),a=Re(a)&&!isNaN(a)?a:+n.startOf(Date.now(),i),r=Re(r)&&!isNaN(r)?r:+n.endOf(Date.now(),i)+1,this.min=Math.min(a,r-1),this.max=Math.max(a+1,r)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],i=e[e.length-1]),{min:n,max:i}}buildTicks(){const e=this.options,n=e.time,i=e.ticks,a=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const r=this.min,o=this.max,l=az(a,r,o);return this._unit=n.unit||(i.autoSkip?Cg(n.minUnit,this.min,this.max,this._getLabelCapacity(r)):qT(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:eL(this._unit),this.initOffsets(a),e.reverse&&l.reverse(),kg(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e){let n=0,i=0,a,r;this.options.offset&&e.length&&(a=this.getDecimalForValue(e[0]),e.length===1?n=1-a:n=(this.getDecimalForValue(e[1])-a)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?i=r:i=(r-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Be(n,0,o),i=Be(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,a=this.options,r=a.time,o=r.unit||Cg(r.minUnit,n,i,this._getLabelCapacity(n)),l=Me(r.stepSize,1),M=o==="week"?r.isoWeekday:!1,u=Dn(M)||M===!0,c={};let g=n,y,d;if(u&&(g=+e.startOf(g,"isoWeek",M)),g=+e.startOf(g,u?"day":o),e.diff(i,n,o)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+o);const j=a.ticks.source==="data"&&this.getDataTimestamps();for(y=g,d=0;y<i;y=+e.add(y,l,o),d++)wg(c,y,j);return(y===i||a.bounds==="ticks"||d===1)&&wg(c,y,j),Object.keys(c).sort((f,I)=>f-I).map(f=>+f)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,n,i,a){const r=this.options,o=r.time.displayFormats,l=this._unit,M=this._majorUnit,u=l&&o[l],c=M&&o[M],g=i[n],y=M&&c&&g&&g.major,d=this._adapter.format(e,a||(y?c:u)),j=r.ticks.callback;return j?Se(j,[d,n,i],this):d}generateTickLabels(e){let n,i,a;for(n=0,i=e.length;n<i;++n)a=e[n],a.label=this._tickFormatFunction(a.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,i=this.ctx.measureText(e).width,a=ut(this.isHorizontal()?n.maxRotation:n.minRotation),r=Math.cos(a),o=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:i*r+l*o,h:i*o+l*r}}_getLabelCapacity(e){const n=this.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=this._tickFormatFunction(e,0,kg(this,[e],this._majorUnit),a),o=this._getLabelSize(r),l=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,i=a.length;n<i;++n)e=e.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,i;if(e.length)return e;const a=this.getLabels();for(n=0,i=a.length;n<i;++n)e.push(bg(this,a[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Wu(e.sort(KT))}}Ir.id="time",Ir.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Dr(t,e,n){let i=0,a=t.length-1,r,o,l,M;n?(e>=t[i].pos&&e<=t[a].pos&&({lo:i,hi:a}=en(t,"pos",e)),{pos:r,time:l}=t[i],{pos:o,time:M}=t[a]):(e>=t[i].time&&e<=t[a].time&&({lo:i,hi:a}=en(t,"time",e)),{time:r,pos:l}=t[i],{time:o,pos:M}=t[a]);const u=o-r;return u?l+(M-l)*(e-r)/u:l}class vg extends Ir{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Dr(n,this.min),this._tableRange=Dr(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,a=[],r=[];let o,l,M,u,c;for(o=0,l=e.length;o<l;++o)u=e[o],u>=n&&u<=i&&a.push(u);if(a.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,l=a.length;o<l;++o)c=a[o+1],M=a[o-1],u=a[o],Math.round((c+M)/2)!==u&&r.push({time:u,pos:o/(l-1)});return r}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Dr(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return Dr(this._table,i*this._tableRange+this._minPos,!0)}}vg.id="timeseries",vg.defaults=Ir.defaults;var pn;(function(t){t.ChartRendered="chart:rendered",t.ChartUpdated="chart:updated",t.ChartDestroyed="chart:destroyed",t.LabelsUpdated="labels:updated"})(pn||(pn={}));function fr(t,e,n,i){t(e,n),i!==void 0&&i.emit(pn.ChartRendered)}function nL(t,e){t.update(),e!==void 0&&e.emit(pn.ChartUpdated)}function hr(t,e){t.destroy(),e!==void 0&&e.emit(pn.ChartDestroyed)}function iL(t,e){const n={labels:typeof t.labels=="undefined"?[]:[...t.labels],datasets:[]};return Qg(n,{...t},e),n}function Qg(t,e,n){const i=[];t.datasets=e.datasets.map(a=>{const r=t.datasets.find(o=>o[n]===a[n]);return!r||!a.data||i.includes(r)?{...a}:(i.push(r),Object.assign(r,a),r)})}function aL(t,e,n){t.data.labels=e,n!==void 0&&n.emit(pn.LabelsUpdated)}function rL(t,e){t.options={...e}}function oL(t,e){const n=t.datasets.map(a=>a.label),i=e.datasets.map(a=>a.label);return e.datasets.length===t.datasets.length&&n.every((a,r)=>a===i[r])}const sL="Please remove the <template></template> tags from your chart component. See https://vue-chartjs.org/guide/#vue-single-file-components",lL="Update ERROR: chart instance not found",ML=((t,e,n)=>s.defineComponent({props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>{}},datasetIdKey:{type:String,default:"label"},chartId:{type:String,default:t},width:{type:Number,default:400},height:{type:Number,default:400},cssClasses:{type:String,default:""},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i,a){ni.register(n);const r=s.shallowRef(null),o=s.ref(null);function l(g,y){if(r.value!==null&&hr(s.toRaw(r.value),a),o.value===null)throw new Error(sL);{const d=iL(g,i.datasetIdKey),j=o.value.getContext("2d");j!==null&&(r.value=new ni(j,{type:e,data:s.isProxy(g)?new Proxy(d,{}):d,options:y,plugins:i.plugins}))}}function M(g,y){const d=s.isProxy(g)?s.toRaw(g):{...g},j=s.isProxy(y)?s.toRaw(y):{...y};if(Object.keys(j).length>0){const f=s.toRaw(r.value);oL(d,j)&&f!==null?(Qg(f==null?void 0:f.data,d,i.datasetIdKey),d.labels!==void 0&&aL(f,d.labels,a),c()):(f!==null&&hr(f,a),fr(l,i.chartData,i.chartOptions,a))}else r.value!==null&&hr(s.toRaw(r.value),a),fr(l,i.chartData,i.chartOptions,a)}function u(g){const y=s.toRaw(r.value);y!==null?(rL(y,g),c()):fr(l,i.chartData,i.chartOptions,a)}function c(){const g=s.toRaw(r.value);g!==null?nL(g,a):console.error(lL)}return s.watch(()=>i.chartData,(g,y)=>M(g,y),{deep:!0}),s.watch(()=>i.chartOptions,g=>u(g),{deep:!0}),s.onMounted(()=>{"datasets"in i.chartData&&i.chartData.datasets.length>0&&fr(l,i.chartData,i.chartOptions,a)}),s.onBeforeUnmount(()=>{r.value!==null&&hr(s.toRaw(r.value),a)}),a.expose({chart:r,updateChart:c}),()=>s.h("div",{style:i.styles,class:i.cssClasses},[s.h("canvas",{id:i.chartId,width:i.width,height:i.height,ref:o})])}}))("bar-chart","bar",er);var hO="";const uL={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let t=this.labels||[],e=this.min===void 0?0:this.min,n=t.length?t.length-1:100,i=this.max===void 0?n:this.max,a=this.minValue===void 0?25:this.minValue;t.length&&this.minValue===void 0&&(a=1);let r=this.maxValue||75;if(t.length&&this.maxValue===void 0&&(r=t.length-2),i<=e)throw new Error("Invalid props min or max");if(a>r)throw new Error("Invalid props minValue or maxValue");let o=this.rangeMargin===void 0?this.step:this.rangeMargin,l=o%this.step;return l&&(o=o+this.step-l),{valueMin:a<e?e:a,valueMax:r>i?i:r,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:o}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(t){let e=parseFloat(t.target.value);e<=this.valueMax-this.rangeMarginValue&&e>=this.minimum?this.valueMin=e:t.target.value=this.valueMin},onInputMaxChange(t){let e=parseFloat(t.target.value);e>=this.valueMin+this.rangeMarginValue&&e<=this.maximum?this.valueMax=e:t.target.value=this.valueMax},onLeftThumbMousedown(t){if(t.preventDefault(),this.startX=t.clientX,t.type==="touchstart")if(t.touches.length===1)this.startX=t.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=t.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(t){this.mouseMoveCounter++;let e=t.clientX;t.type==="touchmove"&&(e=t.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,a=this.barValue+(this.maximum-this.minimum)*i;a-=a%this.step,a<this.minimum?a=this.minimum:a>this.valueMax-this.rangeMarginValue&&(a=this.valueMax-this.rangeMarginValue),this.valueMin=a},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(t){if(t.preventDefault(),this.startX=t.clientX,t.type==="touchstart")if(t.touches.length===1)this.startX=t.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=t.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(t){this.mouseMoveCounter++;let e=t.clientX;t.type==="touchmove"&&(e=t.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,a=this.barValue+(this.maximum-this.minimum)*i;a-=a%this.step,a<this.valueMin+this.rangeMarginValue?a=this.valueMin+this.rangeMarginValue:a>this.maximum&&(a=this.maximum),this.valueMax=a},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(t){if(this.preventWheel===!0||!t.shiftKey&&!t.ctrlKey)return;let e=this.step;t.deltaY<0&&(e=-e),t.shiftKey&&t.ctrlKey?this.valueMin+e>=this.minimum&&this.valueMax+e<=this.maximum&&(this.valueMin=this.valueMin+e,this.valueMax=this.valueMax+e):t.ctrlKey?(e=this.valueMax+e,e<this.valueMin+this.rangeMarginValue?e=this.valueMin+this.rangeMarginValue:e>this.maximum&&(e=this.maximum),this.valueMax=e):t.shiftKey&&(e=this.valueMin+e,e<this.minimum?e=this.minimum:e>this.valueMax-this.rangeMarginValue&&(e=this.valueMax-this.rangeMarginValue),this.valueMin=e)},triggerInput(){let t=0;this.step.toString().includes(".")&&(t=2);let e={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(t)),maxValue:parseFloat(this.valueMax.toFixed(t))};this.$emit("input",e)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let t=this.labels||[],e=t.length?t.length-1:100;return this.max===void 0?e:this.max},stepCount(){let t=this.labels||[];return t.length?t.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let t=0;return this.step.toString().includes(".")&&(t=2),(this.valueMin||0).toFixed(t)},barMaxVal(){let t=0;return this.step.toString().includes(".")&&(t=2),(this.valueMax||100).toFixed(t)},scaleLabels(){let t=this.labels||[];return t.length===0&&(t=[],t.push(this.minimum),t.push(this.maximum)),t}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(t){this.valueMin=t<this.minimum?this.minimum:t},maxValue(t){this.valueMax=t>this.maximum?this.maximum:t}},mounted(){}},cL={class:"bar"},gL=["min","max","step","value"],NL={class:"caption"},yL={class:"min-caption"},dL={class:"bar-inner"},jL=["min","max","step","value"],IL={class:"caption"},DL={class:"max-caption"},fL={key:0,class:"ruler"},hL={key:1,class:"sub-ruler"},mL={key:2,class:"labels"};function AL(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([n.baseClassName,a.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:e[10]||(e[10]=s.withModifiers((...o)=>r.onMouseWheel&&r.onMouseWheel(...o),["prevent","stop"]))},[s.createElementVNode("div",cL,[s.createElementVNode("div",{class:"bar-left",style:s.normalizeStyle({width:r.barMin+"%"}),onClick:e[0]||(e[0]=(...o)=>r.onBarLeftClick&&r.onBarLeftClick(...o))},null,4),s.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:r.minimum,max:r.maximum,step:n.step,value:a.valueMin,onInput:e[1]||(e[1]=s.withModifiers((...o)=>r.onInputMinChange&&r.onInputMinChange(...o),["stop","prevent"]))},null,40,gL),s.createElementVNode("div",{class:"thumb thumb-left",onMousedown:e[2]||(e[2]=(...o)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...o)),onTouchstart:e[3]||(e[3]=(...o)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...o))},[s.createElementVNode("div",NL,[s.createElementVNode("span",yL,s.toDisplayString(n.minCaption||r.barMinVal),1)])],32),s.createElementVNode("div",dL,[s.createElementVNode("div",{class:"bar-inner-left",onClick:e[4]||(e[4]=(...o)=>r.onInnerBarLeftClick&&r.onInnerBarLeftClick(...o))}),s.createElementVNode("div",{class:"bar-inner-right",onClick:e[5]||(e[5]=(...o)=>r.onInnerBarRightClick&&r.onInnerBarRightClick(...o))})]),s.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:r.minimum,max:r.maximum,step:n.step,value:a.valueMax,onInput:e[6]||(e[6]=s.withModifiers((...o)=>r.onInputMaxChange&&r.onInputMaxChange(...o),["stop","prevent"]))},null,40,jL),s.createElementVNode("div",{class:"thumb thumb-right",onMousedown:e[7]||(e[7]=(...o)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...o)),onTouchstart:e[8]||(e[8]=(...o)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...o))},[s.createElementVNode("div",IL,[s.createElementVNode("span",DL,s.toDisplayString(n.maxCaption||r.barMaxVal),1)])],32),s.createElementVNode("div",{class:"bar-right",style:s.normalizeStyle({width:r.barMax+"%"}),onClick:e[9]||(e[9]=(...o)=>r.onBarRightClick&&r.onBarRightClick(...o))},null,4)]),n.ruler?(s.openBlock(),s.createElementBlock("div",fL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.stepCount,o=>(s.openBlock(),s.createElementBlock("div",{key:o,class:"ruler-rule"}))),128))])):s.createCommentVNode("",!0),r.subStepCount?(s.openBlock(),s.createElementBlock("div",hL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.subStepCount,o=>(s.openBlock(),s.createElementBlock("div",{key:o,class:"ruler-sub-rule"}))),128))])):s.createCommentVNode("",!0),n.label?(s.openBlock(),s.createElementBlock("div",mL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.scaleLabels,o=>(s.openBlock(),s.createElementBlock("div",{class:"label",key:o},s.toDisplayString(o),1))),128))])):s.createCommentVNode("",!0)],34)}var zL=Ge(uL,[["render",AL]]),mO="";ni.register(QT,cr,Nr,cl);const pL=s.defineComponent({components:{Bar:ML,MultiRangeSlider:zL,DhAdvancedFilter:Dl},props:{numberRange:{type:Array,default:()=>[{key:1,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},steps:{type:Number,default:1},includeForm:{type:Boolean,default:!1}},data(){return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:["#5ea9e5"],borderRadius:1,hoverBackgroundColor:"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},chartLines:{},min:"1",max:this.maxNumber(this.numberRange),rangeMax:this.numberRange.length,chart_dta:[],BarMinValue:1,BarMaxValue:this.numberRange.length,activeFilter:!1,validated:!1,isMatch:!1,isExclude:!1,isDisable:!1}},mounted(){this.isMatch=!0,this.setChartData(this.numberRange),this.highlightChart()},methods:{matchFilter(){if(!this.isDisable){this.isMatch=!0,this.isExclude=!1;var t=this.chartData.datasets[0].data;this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=t.length;e++)t[e]>=this.min&&t[e]<=this.max?this.chartData.datasets[0].backgroundColor.push("#5ea9e5"):this.chartData.datasets[0].backgroundColor.push("#e0e0e0")}},excludeFilter(){if(!this.isDisable){this.isMatch=!1,this.isExclude=!0;var t=this.chartData.datasets[0].data;this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<t.length;e++)t[e]>=this.min&&t[e]<=this.max?this.chartData.datasets[0].backgroundColor.push("#e0e0e0"):this.chartData.datasets[0].backgroundColor.push("#5ea9e5")}},missingFilter(){this.isDisable=!this.isDisable,this.validated=!this.validated;var t=this.chartData.datasets[0].data;if(this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[],this.validated)for(let e=1;e<=t.length;e++)this.chartData.datasets[0].backgroundColor.push("#e0e0e0");else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(t){let e=t.target.value;this.min=e||"1",this.BarMinValue=e?this.getFirstIndex(parseInt(e)):1,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(t){let e=t.target.value;this.BarMaxValue=e&&e>this.maxNumber(this.numberRange)?this.numberRange.length:this.getLastIndex(parseInt(e)),this.max=e&&e>this.maxNumber(this.numberRange)?this.maxNumber(this.numberRange):e,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(t){t=this.sortData(t),this.removeChartData();let e=this.chartData.labels;for(let n=0;n<t.length;n++)e.push(t[n].key),this.chart_dta.push(t[n].count);this.chartData.datasets[0].data=this.chart_dta},highlightChart(){var t=this.chartData.datasets[0].data;this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=t.length;e++)t[e]>=this.min&&t[e]<=this.max?this.chartData.datasets[0].backgroundColor.push("#5ea9e5"):this.chartData.datasets[0].backgroundColor.push("#e0e0e0")},updateBarChart(t){const{minValue:e,maxValue:n}=t;this.BarMinValue=e,this.BarMaxValue=n;var i=this.chartData.datasets[0].data;this.min=i[this.BarMinValue]?i[this.BarMinValue]:"1",this.max=i[this.BarMaxValue]?i[this.BarMaxValue]:this.max,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},toggleFilter(){this.activeFilter=!this.activeFilter},removeChartData(){this.chartData.labels=[],this.chartData.datasets[0].data=[],this.chart_dta=[]},sortData(t){return t.slice().sort(function(e,n){return e.count-n.count})},maxNumber(t){if(t.length!=0)return t.reduce((e,n)=>e=e>n.count?e:n.count,0)},getLastIndex(t){let e=this.chartData.datasets[0].data,n=0;for(let i=t;i>=0;i--)if(e.lastIndexOf(i)!==-1){n=e.lastIndexOf(i);break}else continue;return n},getFirstIndex(t){let e=this.chartData.datasets[0].data,n=0;for(let i=t;i<=this.max;i++)if(e.lastIndexOf(i)!==-1){n=e.lastIndexOf(i);break}else continue;return n}}}),TL={class:"dh-range-container"},LL={class:"bar-chart"},xL={key:0,class:"input-group-section"},OL={class:"input-group sb-input"},SL=["disabled","max","value"],EL={class:"input-group sb-input"},bL=["disabled","max","min","value"];function CL(t,e,n,i,a,r){const o=s.resolveComponent("Bar"),l=s.resolveComponent("MultiRangeSlider"),M=s.resolveComponent("dh-advanced-filter");return s.openBlock(),s.createElementBlock("div",TL,[s.createElementVNode("div",LL,[s.createVNode(o,{"chart-data":t.chartData,"chart-id":t.chartId,"chart-options":t.chartOptions,"dataset-id-key":t.datasetIdKey,height:t.height,width:t.width},null,8,["chart-data","chart-id","chart-options","dataset-id-key","height","width"]),s.createVNode(l,{"base-class-name":`multi-range-slider range-slider ${t.isDisable}`,label:!1,max:t.rangeMax,"max-caption":`${t.max}`,"max-value":t.BarMaxValue,min:1,"min-caption":`${t.min}`,"min-value":t.BarMinValue,"range-margin":0,ruler:!1,step:t.steps,onInput:t.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","step","onInput"])]),t.includeForm?(s.openBlock(),s.createElementBlock("div",xL,[s.createElementVNode("div",OL,[s.createElementVNode("label",{class:s.normalizeClass(`text-2 input-to ${t.validated?"disable":""}`)}," From ",2),s.createElementVNode("input",{class:"form-input text",disabled:!!t.validated,max:`${t.max}`,min:"1",placeholder:"From",type:"number",value:`${t.min}`,onInput:e[0]||(e[0]=u=>t.changeMin(u))},null,40,SL)]),s.createElementVNode("div",EL,[s.createElementVNode("label",{class:s.normalizeClass(`text-2 input-to ${t.validated?"disable":""}`)}," To ",2),s.createElementVNode("input",{class:"form-input text",disabled:!!t.validated,max:`${t.maxNumber(t.numberRange)}`,min:`${t.min}`,placeholder:"To",type:"number",value:`${t.max}`,onInput:e[1]||(e[1]=u=>t.changeMax(u))},null,40,bL)])])):s.createCommentVNode("",!0),s.renderSlot(t.$slots,"default"),s.createVNode(M,{onExclude:t.excludeFilter,onFilter_missing:t.missingFilter,onMatch:t.matchFilter},null,8,["onExclude","onFilter_missing","onMatch"])])}var wL=Ge(pL,[["render",CL]]),AO="";const kL={class:"password__panel"},vL=["placeholder","type"],QL={class:"icon is-right"},_L={key:0,class:"password__tooltip"};var YL=Ge(s.defineComponent({__name:"PasswordField",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""},tipChars:{type:String,default:"12 Characters"},tipNumbers:{type:String,default:"Numbers"},tipSymbols:{type:String,default:"Symbols"},passwordTooltipDisabled:{type:Boolean,default:!1}},emits:["submit","update:modelValue"],setup(t,{emit:e}){const n=t,i=s.ref(""),a=s.ref(!1),r=s.ref(!1),o=s.ref(!1),l=s.ref(!1),M=s.ref(!1),u=s.ref(!1);function c(){e("submit",i.value),e("update:modelValue",i.value)}function g(){a.value=!0,u.value=!0}function y(){a.value=!1,u.value=!1}function d(){M.value=!M.value}return s.onMounted(()=>()=>i.value=n.modelValue||""),s.watch(n,()=>(i.value=n.modelValue||"",r.value=i.value.length>11,o.value=/\d/.test(i.value),l.value=/[!@#$%^&*)(+=._-]/.test(i.value))),(j,f)=>(s.openBlock(),s.createElementBlock("div",kL,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=I=>i.value=I),class:"form__input password__panel_input","data-e2e":"password-input",placeholder:n.placeholder,type:M.value?"text":"password",onFocus:g,onFocusout:y,onKeyup:c},null,40,vL),[[s.vModelDynamic,i.value]]),s.createElementVNode("button",{class:"password__panel_button",type:"button",onClick:d},[s.createElementVNode("span",QL,[s.createVNode(Ie,{active:u.value,"icon-name":M.value?"invisible":"visible",size:20},null,8,["active","icon-name"])])]),a.value&&!n.passwordTooltipDisabled?(s.openBlock(),s.createElementBlock("div",_L,[s.createElementVNode("p",{class:s.normalizeClass(["password__tooltip_text",r.value?"password__tooltip_text--valid":""])},[s.createVNode(Ie,{class:s.normalizeClass(r.value?"password__tooltip_icon--active":"password__tooltip_icon"),"icon-name":r.value?"accept":"close",size:16},null,8,["class","icon-name"]),s.createElementVNode("span",null,s.toDisplayString(n.tipChars),1)],2),s.createElementVNode("p",{class:s.normalizeClass(["password__tooltip_text",o.value?"password__tooltip_text--valid":""])},[s.createVNode(Ie,{class:s.normalizeClass(o.value?"password__tooltip_icon--active":"password__tooltip_icon"),"icon-name":o.value?"accept":"close",size:16},null,8,["class","icon-name"]),s.createElementVNode("span",null,s.toDisplayString(n.tipNumbers),1)],2),s.createElementVNode("p",{class:s.normalizeClass(["password__tooltip_text",l.value?"password__tooltip_text--valid":""])},[s.createVNode(Ie,{class:s.normalizeClass(l.value?"password__tooltip_icon--active":"password__tooltip_icon"),"icon-name":l.value?"accept":"close",size:16},null,8,["class","icon-name"]),s.createElementVNode("span",null,s.toDisplayString(n.tipSymbols),1)],2)])):s.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-3ae35090"]]),pO="";const UL={class:"radio"},PL=["for"],RL=["id","type","value"],ZL={class:"radio__label_txt"};var _g=Ge({__name:"RadioBox",props:{type:{type:String,default:"radio"},value:{type:String,required:!0},label:{type:String,required:!0}},emits:["clickBox"],setup(t,{emit:e}){return(n,i)=>(s.openBlock(),s.createElementBlock("div",UL,[s.createElementVNode("label",{class:"radio__label",for:t.value},[s.createElementVNode("input",{id:t.value,class:"radio__input",name:"radiobox",type:t.type,value:t.value,onClick:i[0]||(i[0]=a=>e("clickBox"))},null,8,RL),s.createElementVNode("span",ZL,s.toDisplayString(t.label),1)],8,PL)]))}},[["__scopeId","data-v-29696bd5"]]),LO="";const BL={__name:"RadioBoxGroup",props:{orientation:{type:String,default:"horizontal"},type:{type:String,default:"radio"},list:{type:Array,required:!0}},setup(t){const e=s.ref(null);function n(){const i=document.querySelectorAll("input");for(let a=0;a<i.length;a++)i[a].checked?i[a].parentNode.parentNode.classList.add("radio--checked"):i[a].parentNode.parentNode.classList.remove("radio--checked")}return(i,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["radio__grp",t.orientation==="vertical"?"radio__vertical":"radio__horizontal"])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.list,r=>(s.openBlock(),s.createBlock(_g,{key:r.key,ref_for:!0,ref_key:"boxes",ref:e,label:r.label,type:t.type,value:r.value,onClickBox:n},null,8,["label","type","value"]))),128))],2))}};var xO="";const VL={class:"search-panel"},GL=["placeholder"];var WL=Ge(s.defineComponent({__name:"SearchInput",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["submit","clean","update:modelValue"],setup(t,{emit:e}){const n=t,i=s.ref("");function a(){e("submit",i.value),e("update:modelValue",i.value)}function r(){i.value="",e("clean"),e("update:modelValue",i.value)}return s.onMounted(()=>()=>i.value=n.modelValue||""),s.watch(n,()=>i.value=n.modelValue||""),(o,l)=>(s.openBlock(),s.createElementBlock("div",VL,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=M=>i.value=M),class:"form-input search-panel-input","data-e2e":"search-input",placeholder:n.placeholder,onKeyup:a},null,40,GL),[[s.vModelText,i.value]]),i.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:0,class:"search-panel-button","data-e2e":"search-submit",onClick:a},[s.createVNode(Ie,{active:!0,"icon-name":"search",size:24})])),i.value?(s.openBlock(),s.createElementBlock("button",{key:1,class:"search-panel-button close","data-e2e":"search-close",onClick:r},[s.createVNode(Ie,{class:"icon","icon-name":"close",size:24})])):s.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-562faa14"]]),SO="";const $L=t=>(s.pushScopeId("data-v-0213b522"),t=t(),s.popScopeId(),t),HL={class:"stepper"},FL=$L(()=>s.createElementVNode("hr",{class:"solid"},null,-1));var JL=Ge(s.defineComponent({__name:"Stepper",props:{maxSteps:{type:Number,default:0},currentStep:{type:Number,default:0}},setup(t){const e=t;function n(){return Array.from(Array(e.maxSteps||0).keys())}return(i,a)=>(s.openBlock(),s.createElementBlock("div",HL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n(),(r,o)=>(s.openBlock(),s.createElementBlock("div",{key:o,class:"step"},[s.createElementVNode("span",{class:s.normalizeClass(["step-number",{active:r===t.currentStep}])},s.toDisplayString(r+1),3),FL]))),128))]))}}),[["__scopeId","data-v-0213b522"]]);const XL=s.defineComponent({props:{data:{type:Boolean,required:!0,default:!1},label:{type:String,default:"Label"}},data(){return{active:this.data}},emits:["change"],computed:{checkedValue:{get(){return this.data},set(t){this.active=t,this.$emit("change",t)}}}}),KL={class:"dp__options"},qL={class:"dp__options_switch"},ex=s.createElementVNode("span",{class:"dp__options_slider"},null,-1);function tx(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("div",KL,[s.createElementVNode("span",null,s.toDisplayString(t.label),1),s.createElementVNode("label",qL,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>t.checkedValue=o),name:"switch",type:"checkbox"},null,512),[[s.vModelCheckbox,t.checkedValue]]),ex])])}var nx=Ge(XL,[["render",tx]]);const ix=s.defineComponent({props:{target:{type:String,required:!0},trigger:{type:String,required:!0},placement:{type:Object,default:()=>({placement:"bottom"}),required:!1},tooltipText:{type:String,required:!0}},data(){return{show:!1}},methods:{showTooltip(){this.show=!this.show},tooltip(){let t=this.$refs.main,e=this.$refs[this.target];["right","left"].includes(this.placement)&&(e.style.top=-(((e==null?void 0:e.offsetHeight)-(t==null?void 0:t.offsetHeight))/2)+"px")}}}),ax=["placement","target","tooltipText","trigger"],rx=["id"],ox={class:"text"};function sx(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("div",{id:"main-contain",ref:"main",class:"dh-tooltip-container tooltip",placement:t.placement,target:t.target,tooltipText:t.tooltipText,trigger:t.trigger,onClick:e[0]||(e[0]=o=>t.trigger=="click"?t.showTooltip():null),onMouseover:e[1]||(e[1]=o=>t.tooltip())},[s.renderSlot(t.$slots,"default"),s.createElementVNode("div",{id:t.target,ref:t.target,class:s.normalizeClass(`tooltiptext ${t.show}`)},[s.createElementVNode("span",ox,s.toDisplayString(t.tooltipText),1)],10,rx)],40,ax)}var lx=Ge(ix,[["render",sx]]),bO="";const Mx={class:"code"};var ux=Ge(s.defineComponent({__name:"VerificationCode",props:{code:{type:String,required:!0}},emits:["submit"],setup(t,{emit:e}){const n=t,i=s.ref(null),a=s.ref(null),r=s.ref(null),o=s.ref(null),l=s.ref(null),M=s.ref(null);async function u(f){var I,N,D,A,p;switch(f){case 1:break;case 2:(I=i.value)==null||I.focus();break;case 3:(N=a.value)==null||N.focus();break;case 4:(D=r.value)==null||D.focus();break;case 5:(A=o.value)==null||A.focus();break;case 6:(p=l.value)==null||p.focus();break}}async function c(f){var I,N,D,A,p;switch(f){case 1:(I=a.value)==null||I.focus();break;case 2:(N=r.value)==null||N.focus();break;case 3:(D=o.value)==null||D.focus();break;case 4:(A=l.value)==null||A.focus();break;case 5:(p=M.value)==null||p.focus();break}}async function g(f,I){const N=f.key;let D=!0;[{_index:1,nextInput:a},{_index:2,nextInput:r},{_index:3,nextInput:o},{_index:4,nextInput:l},{_index:5,nextInput:M}].forEach(({_index:A,nextInput:p})=>{I===A&&(p.value&&N.match(/^[0-9]+$/)&&p.value.focus({}),D=!1),f.preventDefault()}),N.match(/^[0-9]+$/)&&(f.target.value=N),D&&j()}async function y(f){var N;const I=((N=f.clipboardData)==null?void 0:N.getData("text/plain"))||"";d(I),j()}function d(f){const I=f.replace(/\D/g,"");if(I.length!==6)return;const[N,D,A,p,m,z]=I.split("");i.value&&(i.value.value=N),a.value&&(a.value.value=D),r.value&&(r.value.value=A),o.value&&(o.value.value=p),l.value&&(l.value.value=m),M.value&&(M.value.value=z)}async function j(){var I,N,D,A,p,m;const f=`${(I=i.value)==null?void 0:I.value}${(N=a.value)==null?void 0:N.value}${(D=r.value)==null?void 0:D.value}${(A=o.value)==null?void 0:A.value}${(p=l.value)==null?void 0:p.value}${(m=M.value)==null?void 0:m.value}`;e("submit",f)}return s.onMounted(()=>{n.code&&(d(n.code),j())}),(f,I)=>(s.openBlock(),s.createElementBlock("div",Mx,[s.createElementVNode("input",{ref_key:"txtInput1",ref:i,autofocus:"",class:"form-input input-1","data-e2e":"input-1",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[0]||(I[0]=N=>g(N,1)),onKeyup:[I[1]||(I[1]=s.withKeys(N=>u(1),["delete"])),I[2]||(I[2]=s.withKeys(N=>u(1),["left"])),I[3]||(I[3]=s.withKeys(N=>c(1),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput2",ref:a,class:"form-input","data-e2e":"input-2",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[4]||(I[4]=N=>g(N,2)),onKeyup:[I[5]||(I[5]=s.withKeys(N=>u(2),["delete"])),I[6]||(I[6]=s.withKeys(N=>u(2),["left"])),I[7]||(I[7]=s.withKeys(N=>c(2),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput3",ref:r,class:"form-input","data-e2e":"input-3",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[8]||(I[8]=N=>g(N,3)),onKeyup:[I[9]||(I[9]=s.withKeys(N=>u(3),["delete"])),I[10]||(I[10]=s.withKeys(N=>u(3),["left"])),I[11]||(I[11]=s.withKeys(N=>c(3),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput4",ref:o,class:"form-input","data-e2e":"input-4",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[12]||(I[12]=N=>g(N,4)),onKeyup:[I[13]||(I[13]=s.withKeys(N=>u(4),["delete"])),I[14]||(I[14]=s.withKeys(N=>u(4),["left"])),I[15]||(I[15]=s.withKeys(N=>c(4),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput5",ref:l,class:"form-input","data-e2e":"input-5",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[16]||(I[16]=N=>g(N,5)),onKeyup:[I[17]||(I[17]=s.withKeys(N=>u(5),["delete"])),I[18]||(I[18]=s.withKeys(N=>u(5),["left"])),I[19]||(I[19]=s.withKeys(N=>c(5),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput6",ref:M,class:"form-input","data-e2e":"input-6",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[20]||(I[20]=N=>g(N,6)),onKeyup:[I[21]||(I[21]=s.withKeys(N=>u(6),["delete"])),I[22]||(I[22]=s.withKeys(N=>u(6),["left"])),I[23]||(I[23]=s.withKeys(N=>c(6),["right"]))],onPaste:y},null,544)]))}}),[["__scopeId","data-v-7d5513ee"]]);const cx=s.defineComponent({components:{DhIcon:Ie},props:{title:{type:String,default:"Advanced"}},data(){return{isAdvancedSettingsOpen:!1}}}),gx={class:"text-1"},Nx=s.createTextVNode(" Content ");function yx(t,e,n,i,a,r){const o=s.resolveComponent("dh-icon");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",{class:s.normalizeClass(["advanced-panel-header clickable",{opened:t.isAdvancedSettingsOpen,closed:!t.isAdvancedSettingsOpen}]),"data-e2e":"expansion-panel-button",onClick:e[0]||(e[0]=l=>t.isAdvancedSettingsOpen=!t.isAdvancedSettingsOpen)},[s.createElementVNode("h4",gx,s.toDisplayString(t.title),1),s.createVNode(o,{class:"icon","icon-name":t.isAdvancedSettingsOpen?"arrow-up":"arrow-down",size:24},null,8,["icon-name"])],2),t.isAdvancedSettingsOpen?s.renderSlot(t.$slots,"content",{key:0},()=>[Nx]):s.createCommentVNode("",!0)],64)}var dx=Ge(cx,[["render",yx]]),wO="";const jx=["src"],Ix={key:3,class:"menu-item-text-wrapper"};var Dx=Ge(s.defineComponent({__name:"DropdownMenu",props:{items:{type:Object,required:!0},textEllipsis:{type:Boolean,required:!1,default:!1},iconSize:{type:Number,required:!1,default:24},closeOnClickOutside:{type:Boolean,required:!1,default:!0},zIndex:{type:Number,required:!1,default:100},closeOnItemSelected:{type:Boolean,required:!1,default:!0}},emits:["itemSelected","close"],setup(t,{emit:e}){const n=t;s.onMounted(()=>{document.addEventListener("click",r=>{i(r)})});function i(r){const o=r.target,l=document.querySelector("[data-id='dropdown-menu']");l&&!l.contains(r.target)&&!o.classList.contains("dropdown-toggle")&&n.closeOnClickOutside&&e("close")}function a(r){e("itemSelected",r),n.closeOnItemSelected&&e("close")}return(r,o)=>{const l=s.resolveComponent("router-link");return s.openBlock(),s.createElementBlock("div",{class:"dropdown-menu","data-id":"dropdown-menu",style:s.normalizeStyle({"z-index":n.zIndex})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,M=>(s.openBlock(),s.createBlock(l,{key:M.iconName,class:"menu-item","data-e2e":M.dataE2eTag,to:{path:M.url},onClick:u=>a(M)},{default:s.withCtx(()=>[M.iconUrl?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"icon image",class:"icon icon-url",src:M.iconUrl},null,8,jx)):s.createCommentVNode("",!0),M.iconUrl?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(Ie,s.mergeProps({key:1,class:"icon"},{...M,size:n.iconSize}),null,16)),M.subText?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(["text-2",{"text-ellipsis":n.textEllipsis}])},s.toDisplayString(M.text),3)),M.subText?(s.openBlock(),s.createElementBlock("div",Ix,[s.createElementVNode("span",{class:s.normalizeClass(["text-4",{"text-ellipsis":n.textEllipsis}])},s.toDisplayString(M.text),3),s.createElementVNode("span",{class:s.normalizeClass(["text-1",{"text-ellipsis":n.textEllipsis}])},s.toDisplayString(M.subText),3)])):s.createCommentVNode("",!0),M.isSelected?(s.openBlock(),s.createBlock(Ie,{key:4,class:"icon-blue icon-accept","icon-name":"accept",size:16})):s.createCommentVNode("",!0)]),_:2},1032,["data-e2e","to","onClick"]))),128))],4)}}}),[["__scopeId","data-v-3f98d032"]]),vO="";const fx={class:"input__dropdown"},hx={class:"input__dropdown_second"},mx=["tabindex"],Ax=["onClick"],zx={__name:"InputDropdown",props:{list:{type:Array,required:!0},icon:{type:String,required:!0},default:{type:String,required:!1,default:null},tabindex:{type:Number,required:!1,default:0}},emits:["update"],setup(t,{emit:e}){const n=t,i=s.ref(n.default?n.default:n.list.length>0?n.list[0]:null),a=s.ref(!1),r=s.ref(null);s.onMounted(()=>{e("update","",i.value)});function o(){e("update",r.value.value,i.value)}return(l,M)=>(s.openBlock(),s.createElementBlock("div",fx,[s.createElementVNode("input",{ref_key:"name",ref:r,class:"input__dropdown_text",type:"text",onInput:o},null,544),s.createElementVNode("div",hx,[s.createVNode(Ie,{"icon-name":t.icon,size:18},null,8,["icon-name"]),s.createElementVNode("div",{class:"custom__select",tabindex:t.tabindex,onBlur:M[1]||(M[1]=u=>a.value=!1)},[s.createElementVNode("div",{class:s.normalizeClass(["custom__select_selected",{"custom__select--open":a.value}]),onClick:M[0]||(M[0]=u=>a.value=!a.value)},s.toDisplayString(i.value),3),s.createElementVNode("div",{class:s.normalizeClass(["custom__select_items",{"custom__select--hide":!a.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.list,(u,c)=>(s.openBlock(),s.createElementBlock("div",{key:c,onClick:g=>{i.value=u,a.value=!1,o()}},s.toDisplayString(u),9,Ax))),128))],2)],40,mx)])]))}};var px="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAR2SURBVHgBlVVdaFtlGH6+LydJ89OYtHVbf+YyhoPK5uK2G3/oIlTYhRctKApebAiCXowtDLzxIi3sUqnBiiBerF6osGl7J0idqWyD4WSZF3PzZ4tt7Y/NmnRN0yYn5/t8z9e0Ne35Wnwg5Jzzvt/7vO/7vT8MO6BnYDEuPP4TXMi4kIgyxqOrElEAZEZKZLhVHhpJBDPb2WE6wcsDZtwwXEkJGd9G7T9WRJqZ+f6RxONprUp9BDIs3CLJJM7tSLAJkg5xIT6EVSTCSEFLdPKT5ai36hqWzBVj8v+R1IFVM8y0ekcSvuwWop6BfFgaoR8kY0RSf04qRUriSh6l/AzcDY3wRtpgmWUSUhSewFYuITMFwV9MJ5iKzFgTCHfITtcWEhvW/H38NfYpViZ+UZ7Jmn920B3dZxDuPLnljOQsFmYiSY8J+53Xook734nE4v1r+P2rBMoTt1VUqzRC/ThFU85P2m7CCYKxc3bVrhNZRjDpdPHmoxnMXBmErFbgDIncza+RuzGE1QTXQ1k0fElF9OpAJcaZK+5kZuHuKCqlAraDbWzmxmWUJm5pXEH89Y8W49w0cNrBGYWlqTvbFvjTna1oigQoLQKP/ryq0eIooSFOxcCP6AxJaWkkDAEfw/uJ52GaJt658D1yhSmdGdJmJ+iOZEyrQaFeOPss9u3xKXUVHlXN8UO78U2qFx0tbuxv9eOzZDepCr0ZGlsGdUFYR3L04C50H4ugt2s/HkwXsVgqoyXUgLbdQeITtgFFEPK58VR7iFKk81dEuU7m5yWkXmtEo98Ao0jeS12FWeVo3+WnZhT48edJvNl3RTkU8nN8fKoJAWNJE5HdsJJl6SG6WVZhbsyZfuxVlSLwwbtd2NMcUM/2wReOP4Enoy2rVuhbQTRhpep25pGiwBmvZJ2EVcuD8/fewGwloIy1NftUdUlqUkn7glPKWpsblO7flTDO330FFjyORKSd4bBcY9CCYboUXFe3S9UmYmuvNeTJGRrEziTM1q/eJieLaWhAnuDbiQO12cZgLa0Ay1UI+7eyUfqjMwehWymMHHNXqxc57Y003W5aR3YrfwCXsp3KkCvgAfd7wX3073PRLAOGxztxbWqfrudtpC/R9uWrrGa/1KjS6MSXfxzFFxNdsJhXxUmOQbj8+Py35zB07xilh2kyAoom328/K6KRM740mUxtHoz2fRTmBKYfMMxXaP+wCMzcAsyHCyQLomRElayQs+y1tAVUAKnLtdW+3ke8avSRILNGZpPMjlsozlMBUI6u36Ebaz8M+OjiPUHwvc9g9KeyWkqLD13ITdpkG9OBPmcQNPrW3uti7hlYjkq3Z5iSH8vPEslCfSV1Ha7g1EucSt/Exe8krv/qrzMQeMxCUyu3d1WGutt5lW+QyXDZLPf9M26cldAODkfY99zSUU4FvL6+kdoK1xKt4dDbc3G3EUmSQhw7EDLqFSFZmvZtf2bQvm8HHeyA2FvFGPd6TlN0R0iZJj0Lq2NSZiWsLGNsjKOYvjlIbbIN/gUK8Nn86IrnuAAAAABJRU5ErkJggg==";function At(t){return[null,void 0].indexOf(t)!==-1}function Tx(t,e,n){const{object:i,valueProp:a,mode:r}=s.toRefs(t),o=s.getCurrentInstance().proxy,l=n.iv,M=g=>{l.value=c(g);const y=u(g);e.emit("change",y,o),e.emit("input",y),e.emit("update:modelValue",y)},u=g=>i.value||At(g)?g:Array.isArray(g)?g.map(y=>y[a.value]):g[a.value],c=g=>At(g)?r.value==="single"?{}:[]:g;return{update:M}}function Lx(t,e){const{value:n,modelValue:i,mode:a,valueProp:r}=s.toRefs(t),o=s.ref(a.value!=="single"?[]:{}),l=i&&i.value!==void 0?i:n,M=s.computed(()=>a.value==="single"?o.value[r.value]:o.value.map(c=>c[r.value])),u=s.computed(()=>a.value!=="single"?o.value.map(c=>c[r.value]).join(","):o.value[r.value]);return{iv:o,internalValue:o,ev:l,externalValue:l,textValue:u,plainValue:M}}function xx(t,e,n){const{regex:i}=s.toRefs(t),a=s.getCurrentInstance().proxy,r=n.isOpen,o=n.open,l=s.ref(null),M=s.ref(null),u=()=>{l.value=""},c=d=>{l.value=d.target.value},g=d=>{if(i&&i.value){let j=i.value;typeof j=="string"&&(j=new RegExp(j)),d.key.match(j)||d.preventDefault()}},y=d=>{if(i&&i.value){let f=(d.clipboardData||window.clipboardData).getData("Text"),I=i.value;typeof I=="string"&&(I=new RegExp(I)),f.split("").every(N=>!!N.match(I))||d.preventDefault()}e.emit("paste",d,a)};return s.watch(l,d=>{!r.value&&d&&o(),e.emit("search-change",d,a)}),{search:l,input:M,clearSearch:u,handleSearchInput:c,handleKeypress:g,handlePaste:y}}function Ox(t,e,n){const{groupSelect:i,mode:a,groups:r,disabledProp:o}=s.toRefs(t),l=s.ref(null),M=c=>{c===void 0||c!==null&&c[o.value]||r.value&&c&&c.group&&(a.value==="single"||!i.value)||(l.value=c)};return{pointer:l,setPointer:M,clearPointer:()=>{M(null)}}}function mr(t,e=!0){return e?String(t).toLowerCase().trim():String(t).normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase().trim()}function Sx(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ex(t,e){const n=e.slice().sort();return t.length===e.length&&t.slice().sort().every(function(i,a){return i===n[a]})}function bx(t,e,n){const{options:i,mode:a,trackBy:r,limit:o,hideSelected:l,createTag:M,createOption:u,label:c,appendNewTag:g,appendNewOption:y,multipleLabel:d,object:j,loading:f,delay:I,resolveOnLoad:N,minChars:D,filterResults:A,clearOnSearch:p,clearOnSelect:m,valueProp:z,canDeselect:k,max:v,strict:Y,closeOnSelect:R,groups:w,reverse:h,infinite:E,groupOptions:C,groupHideEmpty:T,groupSelect:Q,onCreate:V,disabledProp:Z,searchStart:H}=s.toRefs(t),$=s.getCurrentInstance().proxy,O=n.iv,P=n.ev,U=n.search,je=n.clearSearch,B=n.update,X=n.pointer,Ae=n.clearPointer,ge=n.focus,re=n.deactivate,ue=n.close,Fe=s.ref([]),Ye=s.ref([]),Qe=s.ref(!1),Ve=s.ref(null),b=s.ref(E.value&&o.value===-1?10:o.value),se=s.computed(()=>M.value||u.value||!1),he=s.computed(()=>g.value!==void 0?g.value:y.value!==void 0?y.value:!0),qe=s.computed(()=>{if(w.value){let x=Ye.value||[],W=[];return x.forEach(ae=>{Nt(ae[C.value]).forEach(ke=>{W.push(Object.assign({},ke,ae[Z.value]?{[Z.value]:!0}:{}))})}),W}else{let x=Nt(Ye.value||[]);return Fe.value.length&&(x=x.concat(Fe.value)),x}}),zt=s.computed(()=>w.value?ie((Ye.value||[]).map((x,W)=>{const ae=Nt(x[C.value]);return{...x,index:W,group:!0,[C.value]:Ct(ae,!1).map(ke=>Object.assign({},ke,x[Z.value]?{[Z.value]:!0}:{})),__VISIBLE__:Ct(ae).map(ke=>Object.assign({},ke,x[Z.value]?{[Z.value]:!0}:{}))}})):[]),Tn=s.computed(()=>{let x=qe.value;return h.value&&(x=x.reverse()),_e.value.length&&(x=_e.value.concat(x)),Ct(x)}),pt=s.computed(()=>{let x=Tn.value;return b.value>0&&(x=x.slice(0,b.value)),x}),L=s.computed(()=>{switch(a.value){case"single":return!At(O.value[z.value]);case"multiple":case"tags":return!At(O.value)&&O.value.length>0}}),_=s.computed(()=>d!==void 0&&d.value!==void 0?d.value(O.value,$):O.value&&O.value.length>1?`${O.value.length} options selected`:"1 option selected"),G=s.computed(()=>!qe.value.length&&!Qe.value&&!_e.value.length),ne=s.computed(()=>qe.value.length>0&&pt.value.length==0&&(U.value&&w.value||!w.value)),_e=s.computed(()=>se.value===!1||!U.value?[]:q(U.value)!==-1?[]:[{[z.value]:U.value,[c.value]:U.value,[ve.value]:U.value,__CREATE__:!0}]),ve=s.computed(()=>r.value||c.value),ot=s.computed(()=>{switch(a.value){case"single":return null;case"multiple":case"tags":return[]}}),Ln=s.computed(()=>f.value||Qe.value),Je=x=>{switch(typeof x!="object"&&(x=S(x)),a.value){case"single":B(x);break;case"multiple":case"tags":B(O.value.concat(x));break}e.emit("select",Ar(x),x,$)},$t=x=>{switch(typeof x!="object"&&(x=S(x)),a.value){case"single":pr();break;case"tags":case"multiple":B(Array.isArray(x)?O.value.filter(W=>x.map(ae=>ae[z.value]).indexOf(W[z.value])===-1):O.value.filter(W=>W[z.value]!=x[z.value]));break}e.emit("deselect",Ar(x),x,$)},Ar=x=>j.value?x:x[z.value],zr=x=>{$t(x)},yl=(x,W)=>{if(W.button!==0){W.preventDefault();return}zr(x)},pr=()=>{e.emit("clear",$),B(ot.value)},Tt=x=>{if(x.group!==void 0)return a.value==="single"?!1:Il(x[C.value])&&x[C.value].length;switch(a.value){case"single":return!At(O.value)&&O.value[z.value]==x[z.value];case"tags":case"multiple":return!At(O.value)&&O.value.map(W=>W[z.value]).indexOf(x[z.value])!==-1}},bt=x=>x[Z.value]===!0,ai=()=>v===void 0||v.value===-1||!L.value&&v.value>0?!1:O.value.length>=v.value,dl=x=>{if(!bt(x)){if(V&&V.value&&!Tt(x)&&x.__CREATE__&&(x={...x},delete x.__CREATE__,x=V.value(x,$),x instanceof Promise)){Qe.value=!0,x.then(W=>{Qe.value=!1,Tr(W)});return}Tr(x)}},Tr=x=>{switch(x.__CREATE__&&(x={...x},delete x.__CREATE__),a.value){case"single":if(x&&Tt(x)){k.value&&$t(x);return}x&&Mn(x),m.value&&je(),R.value&&(Ae(),ue()),x&&Je(x);break;case"multiple":if(x&&Tt(x)){$t(x);return}if(ai())return;x&&(Mn(x),Je(x)),m.value&&je(),l.value&&Ae(),R.value&&ue();break;case"tags":if(x&&Tt(x)){$t(x);return}if(ai())return;x&&Mn(x),m.value&&je(),x&&Je(x),l.value&&Ae(),R.value&&ue();break}R.value||ge()},jl=x=>{if(!(bt(x)||a.value==="single"||!Q.value)){switch(a.value){case"multiple":case"tags":xn(x[C.value])?$t(x[C.value]):Je(x[C.value].filter(W=>O.value.map(ae=>ae[z.value]).indexOf(W[z.value])===-1).filter(W=>!W[Z.value]).filter((W,ae)=>O.value.length+1+ae<=v.value||v.value===-1));break}R.value&&re()}},Mn=x=>{S(x[z.value])===void 0&&se.value&&(e.emit("tag",x[z.value],$),e.emit("option",x[z.value],$),he.value&&te(x),je())},Lr=()=>{a.value!=="single"&&Je(pt.value)},xn=x=>x.find(W=>!Tt(W)&&!W[Z.value])===void 0,Il=x=>x.find(W=>!Tt(W))===void 0,S=x=>qe.value[qe.value.map(W=>String(W[z.value])).indexOf(String(x))],q=(x,W=!0)=>qe.value.map(ae=>parseInt(ae[ve.value])==ae[ve.value]?parseInt(ae[ve.value]):ae[ve.value]).indexOf(parseInt(x)==x?parseInt(x):x),F=x=>["tags","multiple"].indexOf(a.value)!==-1&&l.value&&Tt(x),te=x=>{Fe.value.push(x)},ie=x=>T.value?x.filter(W=>U.value?W.__VISIBLE__.length:W[C.value].length):x.filter(W=>U.value?W.__VISIBLE__.length:!0),Ct=(x,W=!0)=>{let ae=x;return U.value&&A.value&&(ae=ae.filter(ke=>H.value?mr(ke[ve.value],Y.value).startsWith(mr(U.value,Y.value)):mr(ke[ve.value],Y.value).indexOf(mr(U.value,Y.value))!==-1)),l.value&&W&&(ae=ae.filter(ke=>!F(ke))),ae},Nt=x=>{let W=x;return Sx(W)&&(W=Object.keys(W).map(ae=>{let ke=W[ae];return{[z.value]:ae,[ve.value]:ke,[c.value]:ke}})),W=W.map(ae=>typeof ae=="object"?ae:{[z.value]:ae,[ve.value]:ae,[c.value]:ae}),W},un=()=>{At(P.value)||(O.value=Or(P.value))},cn=x=>(Qe.value=!0,new Promise((W,ae)=>{i.value(U.value,$).then(ke=>{Ye.value=ke||[],typeof x=="function"&&x(ke),Qe.value=!1}).catch(ke=>{console.error(ke),Ye.value=[],Qe.value=!1}).finally(()=>{W()})})),On=()=>{if(!!L.value)if(a.value==="single"){let x=S(O.value[z.value]);if(x!==void 0){let W=x[c.value];O.value[c.value]=W,j.value&&(P.value[c.value]=W)}}else O.value.forEach((x,W)=>{let ae=S(O.value[W][z.value]);if(ae!==void 0){let ke=ae[c.value];O.value[W][c.value]=ke,j.value&&(P.value[W][c.value]=ke)}})},xr=x=>{cn(x)},Or=x=>At(x)?a.value==="single"?{}:[]:j.value?x:a.value==="single"?S(x)||{}:x.filter(W=>!!S(W)).map(W=>S(W)),Yg=()=>{Ve.value=s.watch(U,x=>{x.length<D.value||!x&&D.value!==0||(Qe.value=!0,p.value&&(Ye.value=[]),setTimeout(()=>{x==U.value&&i.value(U.value,$).then(W=>{(x==U.value||!U.value)&&(Ye.value=W,X.value=pt.value.filter(ae=>ae[Z.value]!==!0)[0]||null,Qe.value=!1)}).catch(W=>{console.error(W)})},I.value))},{flush:"sync"})};if(a.value!=="single"&&!At(P.value)&&!Array.isArray(P.value))throw new Error(`v-model must be an array when using "${a.value}" mode`);return i&&typeof i.value=="function"?N.value?cn(un):j.value==!0&&un():(Ye.value=i.value,un()),I.value>-1&&Yg(),s.watch(I,(x,W)=>{Ve.value&&Ve.value(),x>=0&&Yg()}),s.watch(P,x=>{if(At(x)){O.value=Or(x);return}switch(a.value){case"single":(j.value?x[z.value]!=O.value[z.value]:x!=O.value[z.value])&&(O.value=Or(x));break;case"multiple":case"tags":Ex(j.value?x.map(W=>W[z.value]):x,O.value.map(W=>W[z.value]))||(O.value=Or(x));break}},{deep:!0}),s.watch(i,(x,W)=>{typeof t.options=="function"?N.value&&(!W||x&&x.toString()!==W.toString())&&cn():(Ye.value=t.options,Object.keys(O.value).length||un(),On())}),s.watch(c,On),{pfo:Tn,fo:pt,filteredOptions:pt,hasSelected:L,multipleLabelText:_,eo:qe,extendedOptions:qe,fg:zt,filteredGroups:zt,noOptions:G,noResults:ne,resolving:Qe,busy:Ln,offset:b,select:Je,deselect:$t,remove:zr,selectAll:Lr,clear:pr,isSelected:Tt,isDisabled:bt,isMax:ai,getOption:S,handleOptionClick:dl,handleGroupClick:jl,handleTagRemove:yl,refreshOptions:xr,resolveOptions:cn,refreshLabels:On}}function Cx(t,e,n){const{valueProp:i,showOptions:a,searchable:r,groupLabel:o,groups:l,mode:M,groupSelect:u,disabledProp:c}=s.toRefs(t),g=n.fo,y=n.fg,d=n.handleOptionClick,j=n.handleGroupClick,f=n.search,I=n.pointer,N=n.setPointer,D=n.clearPointer,A=n.multiselect,p=n.isOpen,m=s.computed(()=>g.value.filter(B=>!B[c.value])),z=s.computed(()=>y.value.filter(B=>!B[c.value])),k=s.computed(()=>M.value!=="single"&&u.value),v=s.computed(()=>I.value&&I.value.group),Y=s.computed(()=>U(I.value)),R=s.computed(()=>{const B=v.value?I.value:U(I.value),X=z.value.map(ge=>ge[o.value]).indexOf(B[o.value]);let Ae=z.value[X-1];return Ae===void 0&&(Ae=h.value),Ae}),w=s.computed(()=>{let B=z.value.map(X=>X.label).indexOf(v.value?I.value[o.value]:U(I.value)[o.value])+1;return z.value.length<=B&&(B=0),z.value[B]}),h=s.computed(()=>[...z.value].slice(-1)[0]),E=s.computed(()=>I.value.__VISIBLE__.filter(B=>!B[c.value])[0]),C=s.computed(()=>{const B=Y.value.__VISIBLE__.filter(X=>!X[c.value]);return B[B.map(X=>X[i.value]).indexOf(I.value[i.value])-1]}),T=s.computed(()=>{const B=U(I.value).__VISIBLE__.filter(X=>!X[c.value]);return B[B.map(X=>X[i.value]).indexOf(I.value[i.value])+1]}),Q=s.computed(()=>[...R.value.__VISIBLE__.filter(B=>!B[c.value])].slice(-1)[0]),V=s.computed(()=>[...h.value.__VISIBLE__.filter(B=>!B[c.value])].slice(-1)[0]),Z=B=>!!I.value&&(!B.group&&I.value[i.value]==B[i.value]||B.group!==void 0&&I.value[o.value]==B[o.value])?!0:void 0,H=()=>{N(m.value[0]||null)},$=()=>{!I.value||I.value[c.value]===!0||(v.value?j(I.value):d(I.value))},O=()=>{if(I.value===null)N((l.value&&k.value?z.value[0]:m.value[0])||null);else if(l.value&&k.value){let B=v.value?E.value:T.value;B===void 0&&(B=w.value),N(B||null)}else{let B=m.value.map(X=>X[i.value]).indexOf(I.value[i.value])+1;m.value.length<=B&&(B=0),N(m.value[B]||null)}s.nextTick(()=>{je()})},P=()=>{if(I.value===null){let B=m.value[m.value.length-1];l.value&&k.value&&(B=V.value,B===void 0&&(B=h.value)),N(B||null)}else if(l.value&&k.value){let B=v.value?Q.value:C.value;B===void 0&&(B=v.value?R.value:Y.value),N(B||null)}else{let B=m.value.map(X=>X[i.value]).indexOf(I.value[i.value])-1;B<0&&(B=m.value.length-1),N(m.value[B]||null)}s.nextTick(()=>{je()})},U=B=>z.value.find(X=>X.__VISIBLE__.map(Ae=>Ae[i.value]).indexOf(B[i.value])!==-1),je=()=>{let B=A.value.querySelector("[data-pointed]");if(!B)return;let X=B.parentElement.parentElement;l.value&&(X=v.value?B.parentElement.parentElement.parentElement:B.parentElement.parentElement.parentElement.parentElement),B.offsetTop+B.offsetHeight>X.clientHeight+X.scrollTop&&(X.scrollTop=B.offsetTop+B.offsetHeight-X.clientHeight),B.offsetTop<X.scrollTop&&(X.scrollTop=B.offsetTop)};return s.watch(f,B=>{r.value&&(B.length&&a.value?H():D())}),s.watch(p,B=>{if(B){let X=A.value.querySelectorAll("[data-selected]")[0];if(!X)return;let Ae=X.parentElement.parentElement;s.nextTick(()=>{Ae.scrollTop>0||(Ae.scrollTop=X.offsetTop)})}}),{pointer:I,canPointGroups:k,isPointed:Z,setPointerFirst:H,selectPointer:$,forwardPointer:O,backwardPointer:P}}function wx(t,e,n){const{disabled:i}=s.toRefs(t),a=s.getCurrentInstance().proxy,r=s.ref(!1);return{isOpen:r,open:()=>{r.value||i.value||(r.value=!0,e.emit("open",a))},close:()=>{!r.value||(r.value=!1,e.emit("close",a))}}}function kx(t,e,n){const{searchable:i,disabled:a}=s.toRefs(t),r=n.input,o=n.open,l=n.close,M=n.clearSearch,u=n.isOpen,c=s.ref(null),g=s.ref(null),y=s.ref(null),d=s.ref(!1),j=s.ref(!1),f=s.computed(()=>i.value||a.value?-1:0),I=()=>{i.value&&r.value.blur(),g.value.blur()},N=()=>{i.value&&!a.value&&r.value.focus()},D=(v=!0)=>{a.value||(d.value=!0,v&&o())},A=()=>{d.value=!1,setTimeout(()=>{d.value||(l(),M())},1)};return{multiselect:c,wrapper:g,tags:y,tabindex:f,isActive:d,mouseClicked:j,blur:I,focus:N,activate:D,deactivate:A,handleFocusIn:v=>{v.target.closest("[data-tags]")||v.target.closest("[data-clear]")||D(j.value)},handleFocusOut:()=>{A()},handleCaretClick:()=>{A(),I()},handleMousedown:v=>{j.value=!0,u.value&&(v.target.isEqualNode(g.value)||v.target.isEqualNode(y.value))?setTimeout(()=>{A()},0):document.activeElement.isEqualNode(g.value)&&!u.value&&(console.log(v.target.closest("[data-tags]")),D()),setTimeout(()=>{j.value=!1},0)}}}function vx(t,e,n){const{mode:i,addTagOn:a,openDirection:r,searchable:o,showOptions:l,valueProp:M,groups:u,addOptionOn:c,createTag:g,createOption:y,reverse:d}=s.toRefs(t),j=s.getCurrentInstance().proxy,f=n.iv,I=n.update,N=n.search,D=n.setPointer,A=n.selectPointer,p=n.backwardPointer,m=n.forwardPointer,z=n.multiselect,k=n.wrapper,v=n.tags,Y=n.isOpen,R=n.open,w=n.blur,h=n.fo,E=s.computed(()=>g.value||y.value||!1),C=s.computed(()=>a.value!==void 0?a.value:c.value!==void 0?c.value:["enter"]),T=()=>{i.value==="tags"&&!l.value&&E.value&&o.value&&!u.value&&D(h.value[h.value.map(Z=>Z[M.value]).indexOf(N.value)])};return{handleKeydown:Z=>{e.emit("keydown",Z,j);let H,$;switch(["ArrowLeft","ArrowRight","Enter"].indexOf(Z.key)!==-1&&i.value==="tags"&&(H=[...z.value.querySelectorAll("[data-tags] > *")].filter(O=>O!==v.value),$=H.findIndex(O=>O===document.activeElement)),Z.key){case"Backspace":if(i.value==="single"||o.value&&[null,""].indexOf(N.value)===-1||f.value.length===0)return;I([...f.value].slice(0,-1));break;case"Enter":if(Z.preventDefault(),Z.keyCode===229)return;if($!==-1&&$!==void 0){I([...f.value].filter((O,P)=>P!==$)),$===H.length-1&&(H.length-1?H[H.length-2].focus():o.value?v.value.querySelector("input").focus():k.value.focus());return}if(C.value.indexOf("enter")===-1&&E.value)return;T(),A();break;case" ":if(!E.value&&!o.value){Z.preventDefault(),T(),A();return}if(!E.value)return!1;if(C.value.indexOf("space")===-1&&E.value)return;Z.preventDefault(),T(),A();break;case"Tab":case";":case",":if(C.value.indexOf(Z.key.toLowerCase())===-1||!E.value)return;T(),A(),Z.preventDefault();break;case"Escape":w();break;case"ArrowUp":if(Z.preventDefault(),!l.value)return;Y.value||R(),p();break;case"ArrowDown":if(Z.preventDefault(),!l.value)return;Y.value||R(),m();break;case"ArrowLeft":if(o.value&&v.value&&v.value.querySelector("input").selectionStart||Z.shiftKey||i.value!=="tags"||!f.value||!f.value.length)return;Z.preventDefault(),$===-1?H[H.length-1].focus():$>0&&H[$-1].focus();break;case"ArrowRight":if($===-1||Z.shiftKey||i.value!=="tags"||!f.value||!f.value.length)return;Z.preventDefault(),H.length>$+1?H[$+1].focus():o.value?v.value.querySelector("input").focus():o.value||k.value.focus();break}},handleKeyup:Z=>{e.emit("keyup",Z,j)},preparePointer:T}}function Qx(t,e,n){const{classes:i,disabled:a,openDirection:r,showOptions:o}=s.toRefs(t),l=n.isOpen,M=n.isPointed,u=n.isSelected,c=n.isDisabled,g=n.isActive,y=n.canPointGroups,d=n.resolving,j=n.fo,f=s.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...i.value})),I=s.computed(()=>!!(l.value&&o.value&&(!d.value||d.value&&j.value.length)));return{classList:s.computed(()=>{const D=f.value;return{container:[D.container].concat(a.value?D.containerDisabled:[]).concat(I.value&&r.value==="top"?D.containerOpenTop:[]).concat(I.value&&r.value!=="top"?D.containerOpen:[]).concat(g.value?D.containerActive:[]),wrapper:D.wrapper,spacer:D.spacer,singleLabel:D.singleLabel,singleLabelText:D.singleLabelText,multipleLabel:D.multipleLabel,search:D.search,tags:D.tags,tag:[D.tag].concat(a.value?D.tagDisabled:[]),tagRemove:D.tagRemove,tagRemoveIcon:D.tagRemoveIcon,tagsSearchWrapper:D.tagsSearchWrapper,tagsSearch:D.tagsSearch,tagsSearchCopy:D.tagsSearchCopy,placeholder:D.placeholder,caret:[D.caret].concat(l.value?D.caretOpen:[]),clear:D.clear,clearIcon:D.clearIcon,spinner:D.spinner,inifinite:D.inifinite,inifiniteSpinner:D.inifiniteSpinner,dropdown:[D.dropdown].concat(r.value==="top"?D.dropdownTop:[]).concat(!l.value||!o.value||!I.value?D.dropdownHidden:[]),options:[D.options].concat(r.value==="top"?D.optionsTop:[]),group:D.group,groupLabel:A=>{let p=[D.groupLabel];return M(A)?p.push(u(A)?D.groupLabelSelectedPointed:D.groupLabelPointed):u(A)&&y.value?p.push(c(A)?D.groupLabelSelectedDisabled:D.groupLabelSelected):c(A)&&p.push(D.groupLabelDisabled),y.value&&p.push(D.groupLabelPointable),p},groupOptions:D.groupOptions,option:(A,p)=>{let m=[D.option];return M(A)?m.push(u(A)?D.optionSelectedPointed:D.optionPointed):u(A)?m.push(c(A)?D.optionSelectedDisabled:D.optionSelected):(c(A)||p&&c(p))&&m.push(D.optionDisabled),m},noOptions:D.noOptions,noResults:D.noResults,assist:D.assist,fakeInput:D.fakeInput}}),showDropdown:I}}function _x(t,e,n){const{limit:i,infinite:a}=s.toRefs(t),r=n.isOpen,o=n.offset,l=n.search,M=n.pfo,u=n.eo,c=s.ref(null),g=s.ref(null),y=s.computed(()=>o.value<M.value.length),d=f=>{const{isIntersecting:I,target:N}=f[0];if(I){const D=N.offsetParent,A=D.scrollTop;o.value+=i.value==-1?10:i.value,s.nextTick(()=>{D.scrollTop=A})}},j=()=>{r.value&&o.value<M.value.length?c.value.observe(g.value):!r.value&&c.value&&c.value.disconnect()};return s.watch(r,()=>{!a.value||j()}),s.watch(l,()=>{!a.value||(o.value=i.value,j())},{flush:"post"}),s.watch(u,()=>{!a.value||j()},{immediate:!1,flush:"post"}),s.onMounted(()=>{window&&window.IntersectionObserver&&(c.value=new IntersectionObserver(d))}),{hasMore:y,infiniteLoader:g}}function Yx(t,e,n){const{placeholder:i,id:a,valueProp:r,label:o,mode:l,groupLabel:M,aria:u,searchable:c}=s.toRefs(t),g=n.pointer,y=n.iv,d=n.hasSelected,j=n.multipleLabelText,f=s.ref(null),I=s.computed(()=>{let h=[];return a&&a.value&&h.push(a.value),h.push("assist"),h.join("-")}),N=s.computed(()=>{let h=[];return a&&a.value&&h.push(a.value),h.push("multiselect-options"),h.join("-")}),D=s.computed(()=>{let h=[];if(a&&a.value&&h.push(a.value),g.value)return h.push(g.value.group?"multiselect-group":"multiselect-option"),h.push(g.value.group?g.value.index:g.value[r.value]),h.join("-")}),A=s.computed(()=>i.value),p=s.computed(()=>l.value!=="single"),m=s.computed(()=>{let h="";return l.value==="single"&&d.value&&(h+=y.value[o.value]),l.value==="multiple"&&d.value&&(h+=j.value),l.value==="tags"&&d.value&&(h+=y.value.map(E=>E[o.value]).join(", ")),h}),z=s.computed(()=>{let h={...u.value};return c.value&&(h["aria-labelledby"]=h["aria-labelledby"]?`${I.value} ${h["aria-labelledby"]}`:I.value,m.value&&h["aria-label"]&&(h["aria-label"]=`${m.value}, ${h["aria-label"]}`)),h}),k=h=>{let E=[];return a&&a.value&&E.push(a.value),E.push("multiselect-option"),E.push(h[r.value]),E.join("-")},v=h=>{let E=[];return a&&a.value&&E.push(a.value),E.push("multiselect-group"),E.push(h.index),E.join("-")},Y=h=>{let E=[];return E.push(h[o.value]),E.join(" ")},R=h=>{let E=[];return E.push(h[M.value]),E.join(" ")},w=h=>`${h} \u274E`;return s.onMounted(()=>{if(a&&a.value&&document&&document.querySelector){let h=document.querySelector(`[for="${a.value}"]`);f.value=h?h.innerText:null}}),{arias:z,ariaLabel:m,ariaAssist:I,ariaControls:N,ariaPlaceholder:A,ariaMultiselectable:p,ariaActiveDescendant:D,ariaOptionId:k,ariaOptionLabel:Y,ariaGroupId:v,ariaGroupLabel:R,ariaTagLabel:w}}function Ux(t,e,n,i={}){return n.forEach(a=>{a&&(i={...i,...a(t,e,i)})}),i}var Nl={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(t,e){return Ux(t,e,[Lx,Ox,wx,xx,Tx,kx,bx,_x,Cx,vx,Qx,Yx])}};const Px=["id","dir"],Rx=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Zx=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Bx=["onKeyup","aria-label"],Vx=["onClick"],Gx=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Wx=["innerHTML"],$x=["id"],Hx=["id","aria-label","aria-selected"],Fx=["data-pointed","onMouseenter","onClick"],Jx=["innerHTML"],Xx=["aria-label"],Kx=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],qx=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],eO=["innerHTML"],tO=["innerHTML"],nO=["value"],iO=["name","value"],aO=["name","value"],rO=["id"];function oO(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("div",{ref:"multiselect",class:s.normalizeClass(t.classList.container),id:n.searchable?void 0:n.id,dir:n.rtl?"rtl":void 0,onFocusin:e[10]||(e[10]=(...o)=>t.handleFocusIn&&t.handleFocusIn(...o)),onFocusout:e[11]||(e[11]=(...o)=>t.handleFocusOut&&t.handleFocusOut(...o)),onKeyup:e[12]||(e[12]=(...o)=>t.handleKeyup&&t.handleKeyup(...o)),onKeydown:e[13]||(e[13]=(...o)=>t.handleKeydown&&t.handleKeydown(...o))},[s.createElementVNode("div",s.mergeProps({class:t.classList.wrapper,onMousedown:e[9]||(e[9]=(...o)=>t.handleMousedown&&t.handleMousedown(...o)),ref:"wrapper",tabindex:t.tabindex,"aria-controls":n.searchable?void 0:t.ariaControls,"aria-placeholder":n.searchable?void 0:t.ariaPlaceholder,"aria-expanded":n.searchable?void 0:t.isOpen,"aria-activedescendant":n.searchable?void 0:t.ariaActiveDescendant,"aria-multiselectable":n.searchable?void 0:t.ariaMultiselectable,role:n.searchable?void 0:"combobox"},n.searchable?{}:t.arias),[s.createCommentVNode(" Search "),n.mode!=="tags"&&n.searchable&&!n.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:n.inputType,modelValue:t.search,value:t.search,class:t.classList.search,autocomplete:n.autocomplete,id:n.searchable?n.id:void 0,onInput:e[0]||(e[0]=(...o)=>t.handleSearchInput&&t.handleSearchInput(...o)),onKeypress:e[1]||(e[1]=(...o)=>t.handleKeypress&&t.handleKeypress(...o)),onPaste:e[2]||(e[2]=s.withModifiers((...o)=>t.handlePaste&&t.handlePaste(...o),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...n.attrs,...t.arias}),null,16,Zx)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Tags (with search) "),n.mode=="tags"?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.classList.tags),"data-tags":""},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.iv,(o,l,M)=>s.renderSlot(t.$slots,"tag",{option:o,handleTagRemove:t.handleTagRemove,disabled:n.disabled},()=>[(s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(t.classList.tag),tabindex:"-1",onKeyup:s.withKeys(u=>t.handleTagRemove(o,u),["enter"]),key:M,"aria-label":t.ariaTagLabel(o[n.label])},[s.createTextVNode(s.toDisplayString(o[n.label])+" ",1),n.disabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(t.classList.tagRemove),onClick:u=>t.handleTagRemove(o,u)},[s.createElementVNode("span",{class:s.normalizeClass(t.classList.tagRemoveIcon)},null,2)],10,Vx))],42,Bx))])),256)),s.createElementVNode("div",{class:s.normalizeClass(t.classList.tagsSearchWrapper),ref:"tags"},[s.createCommentVNode(" Used for measuring search width "),s.createElementVNode("span",{class:s.normalizeClass(t.classList.tagsSearchCopy)},s.toDisplayString(t.search),3),s.createCommentVNode(" Actual search input "),n.searchable&&!n.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:n.inputType,modelValue:t.search,value:t.search,class:t.classList.tagsSearch,id:n.searchable?n.id:void 0,autocomplete:n.autocomplete,onInput:e[3]||(e[3]=(...o)=>t.handleSearchInput&&t.handleSearchInput(...o)),onKeypress:e[4]||(e[4]=(...o)=>t.handleKeypress&&t.handleKeypress(...o)),onPaste:e[5]||(e[5]=s.withModifiers((...o)=>t.handlePaste&&t.handlePaste(...o),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...n.attrs,...t.arias}),null,16,Gx)):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Single label "),n.mode=="single"&&t.hasSelected&&!t.search&&t.iv?s.renderSlot(t.$slots,"singlelabel",{key:2,value:t.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.singleLabel)},[s.createElementVNode("span",{class:s.normalizeClass(t.classList.singleLabelText)},s.toDisplayString(t.iv[n.label]),3)],2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Multiple label "),n.mode=="multiple"&&t.hasSelected&&!t.search?s.renderSlot(t.$slots,"multiplelabel",{key:3,values:t.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.multipleLabel),innerHTML:t.multipleLabelText},null,10,Wx)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Placeholder "),n.placeholder&&!t.hasSelected&&!t.search?s.renderSlot(t.$slots,"placeholder",{key:4},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.placeholder),"aria-hidden":"true"},s.toDisplayString(n.placeholder),3)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Spinner "),n.loading||t.resolving?s.renderSlot(t.$slots,"spinner",{key:5},()=>[s.createElementVNode("span",{class:s.normalizeClass(t.classList.spinner),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Clear "),t.hasSelected&&!n.disabled&&n.canClear&&!t.busy?s.renderSlot(t.$slots,"clear",{key:6,clear:t.clear},()=>[s.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"\u274E",class:s.normalizeClass(t.classList.clear),onClick:e[6]||(e[6]=(...o)=>t.clear&&t.clear(...o)),onKeyup:e[7]||(e[7]=s.withKeys((...o)=>t.clear&&t.clear(...o),["enter"]))},[s.createElementVNode("span",{class:s.normalizeClass(t.classList.clearIcon)},null,2)],34)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Caret "),n.caret&&n.showOptions?s.renderSlot(t.$slots,"caret",{key:7},()=>[s.createElementVNode("span",{class:s.normalizeClass(t.classList.caret),onClick:e[8]||(e[8]=(...o)=>t.handleCaretClick&&t.handleCaretClick(...o)),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0)],16,Rx),s.createCommentVNode(" Options "),s.createElementVNode("div",{class:s.normalizeClass(t.classList.dropdown),tabindex:"-1"},[s.renderSlot(t.$slots,"beforelist",{options:t.fo}),s.createElementVNode("ul",{class:s.normalizeClass(t.classList.options),id:t.ariaControls,role:"listbox"},[n.groups?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(t.fg,(o,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(t.classList.group),key:M,id:t.ariaGroupId(o),"aria-label":t.ariaGroupLabel(o),"aria-selected":t.isSelected(o),role:"option"},[s.createElementVNode("div",{class:s.normalizeClass(t.classList.groupLabel(o)),"data-pointed":t.isPointed(o),onMouseenter:u=>t.setPointer(o,l),onClick:u=>t.handleGroupClick(o)},[s.renderSlot(t.$slots,"grouplabel",{group:o,isSelected:t.isSelected,isPointed:t.isPointed},()=>[s.createElementVNode("span",{innerHTML:o[n.groupLabel]},null,8,Jx)])],42,Fx),s.createElementVNode("ul",{class:s.normalizeClass(t.classList.groupOptions),"aria-label":t.ariaGroupLabel(o),role:"group"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.__VISIBLE__,(u,c,g)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(t.classList.option(u,o)),"data-pointed":t.isPointed(u),"data-selected":t.isSelected(u)||void 0,key:g,onMouseenter:y=>t.setPointer(u),onClick:y=>t.handleOptionClick(u),id:t.ariaOptionId(u),"aria-selected":t.isSelected(u),"aria-label":t.ariaOptionLabel(u),role:"option"},[s.renderSlot(t.$slots,"option",{option:u,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},()=>[s.createElementVNode("span",null,s.toDisplayString(u[n.label]),1)])],42,Kx))),128))],10,Xx)],10,Hx))),128)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(t.fo,(o,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(t.classList.option(o)),"data-pointed":t.isPointed(o),"data-selected":t.isSelected(o)||void 0,key:M,onMouseenter:u=>t.setPointer(o),onClick:u=>t.handleOptionClick(o),id:t.ariaOptionId(o),"aria-selected":t.isSelected(o),"aria-label":t.ariaOptionLabel(o),role:"option"},[s.renderSlot(t.$slots,"option",{option:o,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},()=>[s.createElementVNode("span",null,s.toDisplayString(o[n.label]),1)])],42,qx))),128))],10,$x),t.noOptions?s.renderSlot(t.$slots,"nooptions",{key:0},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.noOptions),innerHTML:n.noOptionsText},null,10,eO)]):s.createCommentVNode("v-if",!0),t.noResults?s.renderSlot(t.$slots,"noresults",{key:1},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.noResults),innerHTML:n.noResultsText},null,10,tO)]):s.createCommentVNode("v-if",!0),n.infinite&&t.hasMore?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.classList.inifinite),ref:"infiniteLoader"},[s.renderSlot(t.$slots,"infinite",{},()=>[s.createElementVNode("span",{class:s.normalizeClass(t.classList.inifiniteSpinner)},null,2)])],2)):s.createCommentVNode("v-if",!0),s.renderSlot(t.$slots,"afterlist",{options:t.fo})],2),s.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(s.openBlock(),s.createElementBlock("input",{key:0,class:s.normalizeClass(t.classList.fakeInput),tabindex:"-1",value:t.textValue,required:""},null,10,nO)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Native input support "),n.nativeSupport?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[n.mode=="single"?(s.openBlock(),s.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:t.plainValue!==void 0?t.plainValue:""},null,8,iO)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(t.plainValue,(o,l)=>(s.openBlock(),s.createElementBlock("input",{type:"hidden",name:`${n.name}[]`,value:o,key:l},null,8,aO))),128))],64)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Screen reader assistive text "),n.searchable&&t.hasSelected?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.classList.assist),id:t.ariaAssist,"aria-hidden":"true"},s.toDisplayString(t.ariaLabel),11,rO)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Create height for empty input "),s.createElementVNode("div",{class:s.normalizeClass(t.classList.spacer)},null,2)],42,Px)}Nl.render=oO,Nl.__file="src/Multiselect.vue";var QO="",_O="";const sO=s.createElementVNode("img",{alt:"",class:"list__item_thumb",src:px},null,-1),lO={class:"list__item_text"},MO=s.createElementVNode("div",{id:"list"},null,-1),uO={__name:"InputList",props:{list:{type:Array,required:!0}},setup(t){const e=s.ref(null);return(n,i)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(s.unref(Nl),{modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=a=>e.value=a),mode:"tags",options:t.list,placeholder:"Start typing a name",searchable:!0},{tag:s.withCtx(({option:a,handleTagRemove:r,disabled:o})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#list"},[s.createElementVNode("div",{class:s.normalizeClass(["list__item",{"is-disabled":o}])},[sO,s.createElementVNode("p",lO,s.toDisplayString(a.value),1),s.createVNode(Ie,{class:"list__item_icon","icon-name":"delete",size:24,onClick:l=>r(a,l)},null,8,["onClick"]),s.renderSlot(n.$slots,"default")],2)]))]),_:3},8,["modelValue","options"]),MO],64))}};fe.DhAdvancedFilter=Dl,fe.DhDatePicker=rA,fe.DhDropdownMenu=Dx,fe.DhError=sA,fe.DhExpansionPanel=dx,fe.DhFileUpload=TA,fe.DhIcon=Ie,fe.DhInputDropdown=zx,fe.DhInputList=uO,fe.DhModal=bA,fe.DhNotification=BA,fe.DhNumberRange=wL,fe.DhPasswordField=YL,fe.DhRadioBox=_g,fe.DhRadioBoxGroup=BL,fe.DhSearchInput=WL,fe.DhStepper=JL,fe.DhSwitch=nx,fe.DhTooltip=lx,fe.DhVerificationCode=ux,Object.defineProperties(fe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
19
|
+
`):t}function ST(t,e){const{element:n,datasetIndex:i,index:a}=e,r=t.getDatasetMeta(i).controller,{label:o,value:l}=r.getLabelAndValue(a);return{chart:t,label:o,parsed:r.getParsed(a),raw:t.data.datasets[i].data[a],formattedValue:l,dataset:r.getDataset(),dataIndex:a,datasetIndex:i,element:n}}function mg(t,e){const n=t.chart.ctx,{body:i,footer:a,title:r}=t,{boxWidth:o,boxHeight:l}=e,M=et(e.bodyFont),u=et(e.titleFont),c=et(e.footerFont),g=r.length,y=a.length,d=i.length,j=rt(e.padding);let f=j.height,I=0,N=i.reduce((p,m)=>p+m.before.length+m.lines.length+m.after.length,0);if(N+=t.beforeBody.length+t.afterBody.length,g&&(f+=g*u.lineHeight+(g-1)*e.titleSpacing+e.titleMarginBottom),N){const p=e.displayColors?Math.max(l,M.lineHeight):M.lineHeight;f+=d*p+(N-d)*M.lineHeight+(N-1)*e.bodySpacing}y&&(f+=e.footerMarginTop+y*c.lineHeight+(y-1)*e.footerSpacing);let D=0;const A=function(p){I=Math.max(I,n.measureText(p).width+D)};return n.save(),n.font=u.string,de(t.title,A),n.font=M.string,de(t.beforeBody.concat(t.afterBody),A),D=e.displayColors?o+2+e.boxPadding:0,de(i,p=>{de(p.before,A),de(p.lines,A),de(p.after,A)}),D=0,n.font=c.string,de(t.footer,A),n.restore(),I+=j.width,{width:I,height:f}}function ET(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}function bT(t,e,n,i){const{x:a,width:r}=i,o=n.caretSize+n.caretPadding;if(t==="left"&&a+r+o>e.width||t==="right"&&a-r-o<0)return!0}function CT(t,e,n,i){const{x:a,width:r}=n,{width:o,chartArea:{left:l,right:M}}=t;let u="center";return i==="center"?u=a<=(l+M)/2?"left":"right":a<=r/2?u="left":a>=o-r/2&&(u="right"),bT(u,t,e,n)&&(u="center"),u}function Ag(t,e,n){const i=n.yAlign||e.yAlign||ET(t,n);return{xAlign:n.xAlign||e.xAlign||CT(t,e,n,i),yAlign:i}}function wT(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function kT(t,e,n){let{y:i,height:a}=t;return e==="top"?i+=n:e==="bottom"?i-=a+n:i-=a/2,i}function zg(t,e,n,i){const{caretSize:a,caretPadding:r,cornerRadius:o}=t,{xAlign:l,yAlign:M}=n,u=a+r,{topLeft:c,topRight:g,bottomLeft:y,bottomRight:d}=hn(o);let j=wT(e,l);const f=kT(e,M,u);return M==="center"?l==="left"?j+=u:l==="right"&&(j-=u):l==="left"?j-=Math.max(c,y)+a:l==="right"&&(j+=Math.max(g,d)+a),{x:Be(j,0,i.width-e.width),y:Be(f,0,i.height-e.height)}}function gr(t,e,n){const i=rt(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function pg(t){return mt([],Et(t))}function vT(t,e,n){return Vt(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Tg(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class ul extends St{constructor(e){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=e.chart||e._chart,this._chart=this.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,i=this.options.setContext(this.getContext()),a=i.enabled&&n.options.animation&&i.animations,r=new bc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=vT(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,a=i.beforeTitle.apply(this,[e]),r=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let l=[];return l=mt(l,Et(a)),l=mt(l,Et(r)),l=mt(l,Et(o)),l}getBeforeBody(e,n){return pg(n.callbacks.beforeBody.apply(this,[e]))}getBody(e,n){const{callbacks:i}=n,a=[];return de(e,r=>{const o={before:[],lines:[],after:[]},l=Tg(i,r);mt(o.before,Et(l.beforeLabel.call(this,r))),mt(o.lines,l.label.call(this,r)),mt(o.after,Et(l.afterLabel.call(this,r))),a.push(o)}),a}getAfterBody(e,n){return pg(n.callbacks.afterBody.apply(this,[e]))}getFooter(e,n){const{callbacks:i}=n,a=i.beforeFooter.apply(this,[e]),r=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let l=[];return l=mt(l,Et(a)),l=mt(l,Et(r)),l=mt(l,Et(o)),l}_createItems(e){const n=this._active,i=this.chart.data,a=[],r=[],o=[];let l=[],M,u;for(M=0,u=n.length;M<u;++M)l.push(ST(this.chart,n[M]));return e.filter&&(l=l.filter((c,g,y)=>e.filter(c,g,y,i))),e.itemSort&&(l=l.sort((c,g)=>e.itemSort(c,g,i))),de(l,c=>{const g=Tg(e.callbacks,c);a.push(g.labelColor.call(this,c)),r.push(g.labelPointStyle.call(this,c)),o.push(g.labelTextColor.call(this,c))}),this.labelColors=a,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=l,l}update(e,n){const i=this.options.setContext(this.getContext()),a=this._active;let r,o=[];if(!a.length)this.opacity!==0&&(r={opacity:0});else{const l=ii[i.position].call(this,a,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const M=this._size=mg(this,i),u=Object.assign({},l,M),c=Ag(this.chart,i,u),g=zg(i,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,r={opacity:1,x:g.x,y:g.y,width:M.width,height:M.height,caretX:l.x,caretY:l.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,a){const r=this.getCaretPosition(e,i,a);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(e,n,i){const{xAlign:a,yAlign:r}=this,{caretSize:o,cornerRadius:l}=i,{topLeft:M,topRight:u,bottomLeft:c,bottomRight:g}=hn(l),{x:y,y:d}=e,{width:j,height:f}=n;let I,N,D,A,p,m;return r==="center"?(p=d+f/2,a==="left"?(I=y,N=I-o,A=p+o,m=p-o):(I=y+j,N=I+o,A=p-o,m=p+o),D=I):(a==="left"?N=y+Math.max(M,c)+o:a==="right"?N=y+j-Math.max(u,g)-o:N=this.caretX,r==="top"?(A=d,p=A-o,I=N-o,D=N+o):(A=d+f,p=A+o,I=N+o,D=N-o),m=A),{x1:I,x2:N,x3:D,y1:A,y2:p,y3:m}}drawTitle(e,n,i){const a=this.title,r=a.length;let o,l,M;if(r){const u=Bs(i.rtl,this.x,this.width);for(e.x=gr(this,i.titleAlign,i),n.textAlign=u.textAlign(i.titleAlign),n.textBaseline="middle",o=et(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,M=0;M<r;++M)n.fillText(a[M],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+l,M+1===r&&(e.y+=i.titleMarginBottom-l)}}_drawColorBox(e,n,i,a,r){const o=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:M,boxWidth:u,boxPadding:c}=r,g=et(r.bodyFont),y=gr(this,"left",r),d=a.x(y),j=M<g.lineHeight?(g.lineHeight-M)/2:0,f=n.y+j;if(r.usePointStyle){const I={radius:Math.min(u,M)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},N=a.leftForLtr(d,u)+u/2,D=f+M/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,Qs(e,I,N,D),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Qs(e,I,N,D)}else{e.lineWidth=le(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const I=a.leftForLtr(d,u-c),N=a.leftForLtr(a.xPlus(d,1),u-c-2),D=hn(o.borderRadius);Object.values(D).some(A=>A!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,Fa(e,{x:I,y:f,w:u,h:M,radius:D}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Fa(e,{x:N,y:f+1,w:u-2,h:M-2,radius:D}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(I,f,u,M),e.strokeRect(I,f,u,M),e.fillStyle=o.backgroundColor,e.fillRect(N,f+1,u-2,M-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:a}=this,{bodySpacing:r,bodyAlign:o,displayColors:l,boxHeight:M,boxWidth:u,boxPadding:c}=i,g=et(i.bodyFont);let y=g.lineHeight,d=0;const j=Bs(i.rtl,this.x,this.width),f=function(v){n.fillText(v,j.x(e.x+d),e.y+y/2),e.y+=y+r},I=j.textAlign(o);let N,D,A,p,m,z,k;for(n.textAlign=o,n.textBaseline="middle",n.font=g.string,e.x=gr(this,I,i),n.fillStyle=i.bodyColor,de(this.beforeBody,f),d=l&&I!=="right"?o==="center"?u/2+c:u+2+c:0,p=0,z=a.length;p<z;++p){for(N=a[p],D=this.labelTextColors[p],n.fillStyle=D,de(N.before,f),A=N.lines,l&&A.length&&(this._drawColorBox(n,e,p,j,i),y=Math.max(g.lineHeight,M)),m=0,k=A.length;m<k;++m)f(A[m]),y=g.lineHeight;de(N.after,f)}d=0,y=g.lineHeight,de(this.afterBody,f),e.y-=r}drawFooter(e,n,i){const a=this.footer,r=a.length;let o,l;if(r){const M=Bs(i.rtl,this.x,this.width);for(e.x=gr(this,i.footerAlign,i),e.y+=i.footerMarginTop,n.textAlign=M.textAlign(i.footerAlign),n.textBaseline="middle",o=et(i.footerFont),n.fillStyle=i.footerColor,n.font=o.string,l=0;l<r;++l)n.fillText(a[l],M.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,n,i,a){const{xAlign:r,yAlign:o}=this,{x:l,y:M}=e,{width:u,height:c}=i,{topLeft:g,topRight:y,bottomLeft:d,bottomRight:j}=hn(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(l+g,M),o==="top"&&this.drawCaret(e,n,i,a),n.lineTo(l+u-y,M),n.quadraticCurveTo(l+u,M,l+u,M+y),o==="center"&&r==="right"&&this.drawCaret(e,n,i,a),n.lineTo(l+u,M+c-j),n.quadraticCurveTo(l+u,M+c,l+u-j,M+c),o==="bottom"&&this.drawCaret(e,n,i,a),n.lineTo(l+d,M+c),n.quadraticCurveTo(l,M+c,l,M+c-d),o==="center"&&r==="left"&&this.drawCaret(e,n,i,a),n.lineTo(l,M+g),n.quadraticCurveTo(l,M,l+g,M),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,a=i&&i.x,r=i&&i.y;if(a||r){const o=ii[e.position].call(this,this._active,this._eventPosition);if(!o)return;const l=this._size=mg(this,e),M=Object.assign({},o,this._size),u=Ag(n,e,M),c=zg(e,M,u,n);(a._to!==c.x||r._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=rt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,a,n),I0(e,n.textDirection),r.y+=o.top,this.drawTitle(r,e,n),this.drawBody(r,e,n),this.drawFooter(r,e,n),D0(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,a=e.map(({datasetIndex:l,index:M})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[M],index:M}}),r=!Ya(i,a),o=this._positionChanged(a,n);(r||o)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,r=this._active||[],o=this._getActiveElements(e,r,n,i),l=this._positionChanged(o,e),M=n||!Ya(o,r)||l;return M&&(this._active=o,(a.enabled||a.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),M}_getActiveElements(e,n,i,a){const r=this.options;if(e.type==="mouseout")return[];if(!a)return n;const o=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:i,caretY:a,options:r}=this,o=ii[r.position].call(this,e,n);return o!==!1&&(i!==o.x||a!==o.y)}}ul.positioners=ii;var QT={id:"tooltip",_element:ul,positioners:ii,afterInit(t,e,n){n&&(t.tooltip=new ul({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",n)===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:{beforeTitle:Lt,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Ne(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const _T=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function YT(t,e,n,i){const a=t.indexOf(e);if(a===-1)return _T(t,e,n,i);const r=t.lastIndexOf(e);return a!==r?n:a}const UT=(t,e)=>t===null?null:Be(Math.round(t),0,e);class Nr extends sn{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:a,label:r}of n)i[a]===r&&i.splice(a,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Ne(e))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===e?n:YT(i,e,Me(n,e),this._addedLabels),UT(n,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),n||(a=this.getLabels().length-1)),this.min=i,this.max=a}buildTicks(){const e=this.min,n=this.max,i=this.options.offset,a=[];let r=this.getLabels();r=e===0&&n===r.length-1?r:r.slice(e,n+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=n;o++)a.push({value:o});return a}getLabelForValue(e){const n=this.getLabels();return e>=0&&e<n.length?n[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Nr.id="category",Nr.defaults={ticks:{callback:Nr.prototype.getLabelForValue}};function PT(t,e){const n=[],{bounds:a,step:r,min:o,max:l,precision:M,count:u,maxTicks:c,maxDigits:g,includeBounds:y}=t,d=r||1,j=c-1,{min:f,max:I}=e,N=!Ne(o),D=!Ne(l),A=!Ne(u),p=(I-f)/(g+1);let m=Pu((I-f)/j/d)*d,z,k,v,Y;if(m<1e-14&&!N&&!D)return[{value:f},{value:I}];Y=Math.ceil(I/m)-Math.floor(f/m),Y>j&&(m=Pu(Y*m/j/d)*d),Ne(M)||(z=Math.pow(10,M),m=Math.ceil(m*z)/z),a==="ticks"?(k=Math.floor(f/m)*m,v=Math.ceil(I/m)*m):(k=f,v=I),N&&D&&r&&ez((l-o)/r,m/1e3)?(Y=Math.round(Math.min((l-o)/m,c)),m=(l-o)/Y,k=o,v=l):A?(k=N?o:k,v=D?l:v,Y=u-1,m=(v-k)/Y):(Y=(v-k)/m,Un(Y,Math.round(Y),m/1e3)?Y=Math.round(Y):Y=Math.ceil(Y));const R=Math.max(Zu(m),Zu(k));z=Math.pow(10,Ne(M)?R:M),k=Math.round(k*z)/z,v=Math.round(v*z)/z;let w=0;for(N&&(y&&k!==o?(n.push({value:o}),k<o&&w++,Un(Math.round((k+w*m)*z)/z,o,Lg(o,p,t))&&w++):k<o&&w++);w<Y;++w)n.push({value:Math.round((k+w*m)*z)/z});return D&&y&&v!==l?n.length&&Un(n[n.length-1].value,l,Lg(l,p,t))?n[n.length-1].value=l:n.push({value:l}):(!D||v===l)&&n.push({value:v}),n}function Lg(t,e,{horizontal:n,minRotation:i}){const a=ut(i),r=(n?Math.sin(a):Math.cos(a))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}class yr extends sn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Ne(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:a,max:r}=this;const o=M=>a=n?a:M,l=M=>r=i?r:M;if(e){const M=ft(a),u=ft(r);M<0&&u<0?l(0):M>0&&u>0&&o(0)}if(a===r){let M=1;(r>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(M=Math.abs(r*.05)),l(r+M),e||o(a-M)}this.min=a,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,a;return i?(a=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const a={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=PT(a,r);return e.bounds==="ticks"&&Ru(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const a=(i-n)/Math.max(e.length-1,1)/2;n-=a,i+=a}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Wn(e,this.chart.options.locale,this.options.ticks.format)}}class cl extends yr{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Re(e)?e:0,this.max=Re(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=ut(this.options.ticks.minRotation),a=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/a))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}cl.id="linear",cl.defaults={ticks:{callback:tr.formatters.numeric}};function xg(t){return t/Math.pow(10,Math.floor(it(t)))===1}function RT(t,e){const n=Math.floor(it(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),a=[];let r=tt(t.min,Math.pow(10,Math.floor(it(e.min)))),o=Math.floor(it(r)),l=Math.floor(r/Math.pow(10,o)),M=o<0?Math.pow(10,Math.abs(o)):1;do a.push({value:r,major:xg(r)}),++l,l===10&&(l=1,++o,M=o>=0?1:M),r=Math.round(l*Math.pow(10,o)*M)/M;while(o<n||o===n&&l<i);const u=tt(t.max,r);return a.push({value:u,major:xg(r)}),a}class Og extends sn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=yr.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return Re(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Re(e)?Math.max(0,e):null,this.max=Re(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,a=this.max;const r=M=>i=e?i:M,o=M=>a=n?a:M,l=(M,u)=>Math.pow(10,Math.floor(it(M))+u);i===a&&(i<=0?(r(1),o(10)):(r(l(i,-1)),o(l(a,1)))),i<=0&&r(l(a,-1)),a<=0&&o(l(i,1)),this._zero&&this.min!==this._suggestedMin&&i===l(this.min,0)&&r(l(i,-1)),this.min=i,this.max=a}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=RT(n,this);return e.bounds==="ticks"&&Ru(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Wn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=it(e),this._valueRange=it(this.max)-it(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(it(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}Og.id="logarithmic",Og.defaults={ticks:{callback:tr.formatters.logarithmic,major:{enabled:!0}}};function gl(t){const e=t.ticks;if(e.display&&t.display){const n=rt(e.backdropPadding);return Me(e.font&&e.font.size,oe.font.size)+n.height}return 0}function ZT(t,e,n){return n=Te(n)?n:[n],{w:Cz(t,e.string,n),h:n.length*e.lineHeight}}function Sg(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function BT(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],a=[],r=t._pointLabels.length,o=t.options.pointLabels,l=o.centerPointLabels?Ee/r:0;for(let M=0;M<r;M++){const u=o.setContext(t.getPointLabelContext(M));a[M]=u.padding;const c=t.getPointPosition(M,t.drawingArea+a[M],l),g=et(u.font),y=ZT(t.ctx,g,t._pointLabels[M]);i[M]=y;const d=ct(t.getIndexAngle(M)+l),j=Math.round(Ts(d)),f=Sg(j,c.x,y.w,0,180),I=Sg(j,c.y,y.h,90,270);VT(n,e,d,f,I)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=GT(t,i,a)}function VT(t,e,n,i,a){const r=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let l=0,M=0;i.start<e.l?(l=(e.l-i.start)/r,t.l=Math.min(t.l,e.l-l)):i.end>e.r&&(l=(i.end-e.r)/r,t.r=Math.max(t.r,e.r+l)),a.start<e.t?(M=(e.t-a.start)/o,t.t=Math.min(t.t,e.t-M)):a.end>e.b&&(M=(a.end-e.b)/o,t.b=Math.max(t.b,e.b+M))}function GT(t,e,n){const i=[],a=t._pointLabels.length,r=t.options,o=gl(r)/2,l=t.drawingArea,M=r.pointLabels.centerPointLabels?Ee/a:0;for(let u=0;u<a;u++){const c=t.getPointPosition(u,l+o+n[u],M),g=Math.round(Ts(ct(c.angle+be))),y=e[u],d=HT(c.y,y.h,g),j=WT(g),f=$T(c.x,y.w,j);i.push({x:c.x,y:d,textAlign:j,left:f,top:d,right:f+y.w,bottom:d+y.h})}return i}function WT(t){return t===0||t===180?"center":t<180?"left":"right"}function $T(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function HT(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function FT(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let a=e-1;a>=0;a--){const r=i.setContext(t.getPointLabelContext(a)),o=et(r.font),{x:l,y:M,textAlign:u,left:c,top:g,right:y,bottom:d}=t._pointLabelItems[a],{backdropColor:j}=r;if(!Ne(j)){const f=hn(r.borderRadius),I=rt(r.backdropPadding);n.fillStyle=j;const N=c-I.left,D=g-I.top,A=y-c+I.width,p=d-g+I.height;Object.values(f).some(m=>m!==0)?(n.beginPath(),Fa(n,{x:N,y:D,w:A,h:p,radius:f}),n.fill()):n.fillRect(N,D,A,p)}Ha(n,t._pointLabels[a],l,M+o.lineHeight/2,o,{color:r.color,textAlign:u,textBaseline:"middle"})}}function Eg(t,e,n,i){const{ctx:a}=t;if(n)a.arc(t.xCenter,t.yCenter,e,0,De);else{let r=t.getPointPosition(0,e);a.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=t.getPointPosition(o,e),a.lineTo(r.x,r.y)}}function JT(t,e,n,i){const a=t.ctx,r=e.circular,{color:o,lineWidth:l}=e;!r&&!i||!o||!l||n<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),Eg(t,n,r,i),a.closePath(),a.stroke(),a.restore())}function XT(t,e,n){return Vt(t,{label:n,index:e,type:"pointLabel"})}class dr extends yr{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=rt(gl(this.options)/2),n=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=Re(e)&&!isNaN(e)?e:0,this.max=Re(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/gl(this.options))}generateTickLabels(e){yr.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,i)=>{const a=Se(this.options.pointLabels.callback,[n,i],this);return a||a===0?a:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?BT(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,a){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,a))}getIndexAngle(e){const n=De/(this._pointLabels.length||1),i=this.options.startAngle||0;return ct(e*n+ut(i))}getDistanceFromCenterForValue(e){if(Ne(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(Ne(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const i=n[e];return XT(this.getContext(),e,i)}}getPointPosition(e,n,i=0){const a=this.getIndexAngle(e)-be+i;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:i,right:a,bottom:r}=this._pointLabelItems[e];return{left:n,top:i,right:a,bottom:r}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),Eg(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:i,grid:a}=n,r=this._pointLabels.length;let o,l,M;if(n.pointLabels.display&&FT(this,r),a.display&&this.ticks.forEach((u,c)=>{if(c!==0){l=this.getDistanceFromCenterForValue(u.value);const g=a.setContext(this.getContext(c-1));JT(this,g,l,r)}}),i.display){for(e.save(),o=r-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:c,lineWidth:g}=u;!g||!c||(e.lineWidth=g,e.strokeStyle=c,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),M=this.getPointPosition(o,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(M.x,M.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const a=this.getIndexAngle(0);let r,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,M)=>{if(M===0&&!n.reverse)return;const u=i.setContext(this.getContext(M)),c=et(u.font);if(r=this.getDistanceFromCenterForValue(this.ticks[M].value),u.showLabelBackdrop){e.font=c.string,o=e.measureText(l.label).width,e.fillStyle=u.backdropColor;const g=rt(u.backdropPadding);e.fillRect(-o/2-g.left,-r-c.size/2-g.top,o+g.width,c.size+g.height)}Ha(e,l.label,0,-r,c,{color:u.color})}),e.restore()}drawTitle(){}}dr.id="radialLinear",dr.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:tr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}},dr.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},dr.descriptors={angleLines:{_fallback:"grid"}};const jr={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}},Ke=Object.keys(jr);function KT(t,e){return t-e}function bg(t,e){if(Ne(e))return null;const n=t._adapter,{parser:i,round:a,isoWeekday:r}=t._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Re(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(a&&(o=a==="week"&&(Dn(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,a)),+o)}function Cg(t,e,n,i){const a=Ke.length;for(let r=Ke.indexOf(t);r<a-1;++r){const o=jr[Ke[r]],l=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(l*o.size))<=i)return Ke[r]}return Ke[a-1]}function qT(t,e,n,i,a){for(let r=Ke.length-1;r>=Ke.indexOf(n);r--){const o=Ke[r];if(jr[o].common&&t._adapter.diff(a,i,o)>=e-1)return o}return Ke[n?Ke.indexOf(n):0]}function eL(t){for(let e=Ke.indexOf(t)+1,n=Ke.length;e<n;++e)if(jr[Ke[e]].common)return Ke[e]}function wg(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:i,hi:a}=xs(n,e),r=n[i]>=e?n[i]:n[a];t[r]=!0}}function tL(t,e,n,i){const a=t._adapter,r=+a.startOf(e[0].value,i),o=e[e.length-1].value;let l,M;for(l=r;l<=o;l=+a.add(l,1,i))M=n[l],M>=0&&(e[M].major=!0);return e}function kg(t,e,n){const i=[],a={},r=e.length;let o,l;for(o=0;o<r;++o)l=e[o],a[l]=o,i.push({value:l,major:!1});return r===0||!n?i:tL(t,i,a,n)}class Ir extends sn{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n){const i=e.time||(e.time={}),a=this._adapter=new fp._date(e.adapters.date);a.init(n),_n(i.displayFormats,a.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:bg(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,i=e.time.unit||"day";let{min:a,max:r,minDefined:o,maxDefined:l}=this.getUserBounds();function M(u){!o&&!isNaN(u.min)&&(a=Math.min(a,u.min)),!l&&!isNaN(u.max)&&(r=Math.max(r,u.max))}(!o||!l)&&(M(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&M(this.getMinMax(!1))),a=Re(a)&&!isNaN(a)?a:+n.startOf(Date.now(),i),r=Re(r)&&!isNaN(r)?r:+n.endOf(Date.now(),i)+1,this.min=Math.min(a,r-1),this.max=Math.max(a+1,r)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],i=e[e.length-1]),{min:n,max:i}}buildTicks(){const e=this.options,n=e.time,i=e.ticks,a=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const r=this.min,o=this.max,l=az(a,r,o);return this._unit=n.unit||(i.autoSkip?Cg(n.minUnit,this.min,this.max,this._getLabelCapacity(r)):qT(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:eL(this._unit),this.initOffsets(a),e.reverse&&l.reverse(),kg(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e){let n=0,i=0,a,r;this.options.offset&&e.length&&(a=this.getDecimalForValue(e[0]),e.length===1?n=1-a:n=(this.getDecimalForValue(e[1])-a)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?i=r:i=(r-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Be(n,0,o),i=Be(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,a=this.options,r=a.time,o=r.unit||Cg(r.minUnit,n,i,this._getLabelCapacity(n)),l=Me(r.stepSize,1),M=o==="week"?r.isoWeekday:!1,u=Dn(M)||M===!0,c={};let g=n,y,d;if(u&&(g=+e.startOf(g,"isoWeek",M)),g=+e.startOf(g,u?"day":o),e.diff(i,n,o)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+o);const j=a.ticks.source==="data"&&this.getDataTimestamps();for(y=g,d=0;y<i;y=+e.add(y,l,o),d++)wg(c,y,j);return(y===i||a.bounds==="ticks"||d===1)&&wg(c,y,j),Object.keys(c).sort((f,I)=>f-I).map(f=>+f)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,n,i,a){const r=this.options,o=r.time.displayFormats,l=this._unit,M=this._majorUnit,u=l&&o[l],c=M&&o[M],g=i[n],y=M&&c&&g&&g.major,d=this._adapter.format(e,a||(y?c:u)),j=r.ticks.callback;return j?Se(j,[d,n,i],this):d}generateTickLabels(e){let n,i,a;for(n=0,i=e.length;n<i;++n)a=e[n],a.label=this._tickFormatFunction(a.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,i=this.ctx.measureText(e).width,a=ut(this.isHorizontal()?n.maxRotation:n.minRotation),r=Math.cos(a),o=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:i*r+l*o,h:i*o+l*r}}_getLabelCapacity(e){const n=this.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=this._tickFormatFunction(e,0,kg(this,[e],this._majorUnit),a),o=this._getLabelSize(r),l=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,i=a.length;n<i;++n)e=e.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,i;if(e.length)return e;const a=this.getLabels();for(n=0,i=a.length;n<i;++n)e.push(bg(this,a[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Wu(e.sort(KT))}}Ir.id="time",Ir.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Dr(t,e,n){let i=0,a=t.length-1,r,o,l,M;n?(e>=t[i].pos&&e<=t[a].pos&&({lo:i,hi:a}=en(t,"pos",e)),{pos:r,time:l}=t[i],{pos:o,time:M}=t[a]):(e>=t[i].time&&e<=t[a].time&&({lo:i,hi:a}=en(t,"time",e)),{time:r,pos:l}=t[i],{time:o,pos:M}=t[a]);const u=o-r;return u?l+(M-l)*(e-r)/u:l}class vg extends Ir{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Dr(n,this.min),this._tableRange=Dr(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,a=[],r=[];let o,l,M,u,c;for(o=0,l=e.length;o<l;++o)u=e[o],u>=n&&u<=i&&a.push(u);if(a.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,l=a.length;o<l;++o)c=a[o+1],M=a[o-1],u=a[o],Math.round((c+M)/2)!==u&&r.push({time:u,pos:o/(l-1)});return r}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Dr(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return Dr(this._table,i*this._tableRange+this._minPos,!0)}}vg.id="timeseries",vg.defaults=Ir.defaults;var pn;(function(t){t.ChartRendered="chart:rendered",t.ChartUpdated="chart:updated",t.ChartDestroyed="chart:destroyed",t.LabelsUpdated="labels:updated"})(pn||(pn={}));function fr(t,e,n,i){t(e,n),i!==void 0&&i.emit(pn.ChartRendered)}function nL(t,e){t.update(),e!==void 0&&e.emit(pn.ChartUpdated)}function hr(t,e){t.destroy(),e!==void 0&&e.emit(pn.ChartDestroyed)}function iL(t,e){const n={labels:typeof t.labels=="undefined"?[]:[...t.labels],datasets:[]};return Qg(n,{...t},e),n}function Qg(t,e,n){const i=[];t.datasets=e.datasets.map(a=>{const r=t.datasets.find(o=>o[n]===a[n]);return!r||!a.data||i.includes(r)?{...a}:(i.push(r),Object.assign(r,a),r)})}function aL(t,e,n){t.data.labels=e,n!==void 0&&n.emit(pn.LabelsUpdated)}function rL(t,e){t.options={...e}}function oL(t,e){const n=t.datasets.map(a=>a.label),i=e.datasets.map(a=>a.label);return e.datasets.length===t.datasets.length&&n.every((a,r)=>a===i[r])}const sL="Please remove the <template></template> tags from your chart component. See https://vue-chartjs.org/guide/#vue-single-file-components",lL="Update ERROR: chart instance not found",ML=((t,e,n)=>s.defineComponent({props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>{}},datasetIdKey:{type:String,default:"label"},chartId:{type:String,default:t},width:{type:Number,default:400},height:{type:Number,default:400},cssClasses:{type:String,default:""},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(i,a){ni.register(n);const r=s.shallowRef(null),o=s.ref(null);function l(g,y){if(r.value!==null&&hr(s.toRaw(r.value),a),o.value===null)throw new Error(sL);{const d=iL(g,i.datasetIdKey),j=o.value.getContext("2d");j!==null&&(r.value=new ni(j,{type:e,data:s.isProxy(g)?new Proxy(d,{}):d,options:y,plugins:i.plugins}))}}function M(g,y){const d=s.isProxy(g)?s.toRaw(g):{...g},j=s.isProxy(y)?s.toRaw(y):{...y};if(Object.keys(j).length>0){const f=s.toRaw(r.value);oL(d,j)&&f!==null?(Qg(f==null?void 0:f.data,d,i.datasetIdKey),d.labels!==void 0&&aL(f,d.labels,a),c()):(f!==null&&hr(f,a),fr(l,i.chartData,i.chartOptions,a))}else r.value!==null&&hr(s.toRaw(r.value),a),fr(l,i.chartData,i.chartOptions,a)}function u(g){const y=s.toRaw(r.value);y!==null?(rL(y,g),c()):fr(l,i.chartData,i.chartOptions,a)}function c(){const g=s.toRaw(r.value);g!==null?nL(g,a):console.error(lL)}return s.watch(()=>i.chartData,(g,y)=>M(g,y),{deep:!0}),s.watch(()=>i.chartOptions,g=>u(g),{deep:!0}),s.onMounted(()=>{"datasets"in i.chartData&&i.chartData.datasets.length>0&&fr(l,i.chartData,i.chartOptions,a)}),s.onBeforeUnmount(()=>{r.value!==null&&hr(s.toRaw(r.value),a)}),a.expose({chart:r,updateChart:c}),()=>s.h("div",{style:i.styles,class:i.cssClasses},[s.h("canvas",{id:i.chartId,width:i.width,height:i.height,ref:o})])}}))("bar-chart","bar",er);var hO="";const uL={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let t=this.labels||[],e=this.min===void 0?0:this.min,n=t.length?t.length-1:100,i=this.max===void 0?n:this.max,a=this.minValue===void 0?25:this.minValue;t.length&&this.minValue===void 0&&(a=1);let r=this.maxValue||75;if(t.length&&this.maxValue===void 0&&(r=t.length-2),i<=e)throw new Error("Invalid props min or max");if(a>r)throw new Error("Invalid props minValue or maxValue");let o=this.rangeMargin===void 0?this.step:this.rangeMargin,l=o%this.step;return l&&(o=o+this.step-l),{valueMin:a<e?e:a,valueMax:r>i?i:r,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:o}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(t){let e=parseFloat(t.target.value);e<=this.valueMax-this.rangeMarginValue&&e>=this.minimum?this.valueMin=e:t.target.value=this.valueMin},onInputMaxChange(t){let e=parseFloat(t.target.value);e>=this.valueMin+this.rangeMarginValue&&e<=this.maximum?this.valueMax=e:t.target.value=this.valueMax},onLeftThumbMousedown(t){if(t.preventDefault(),this.startX=t.clientX,t.type==="touchstart")if(t.touches.length===1)this.startX=t.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=t.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(t){this.mouseMoveCounter++;let e=t.clientX;t.type==="touchmove"&&(e=t.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,a=this.barValue+(this.maximum-this.minimum)*i;a-=a%this.step,a<this.minimum?a=this.minimum:a>this.valueMax-this.rangeMarginValue&&(a=this.valueMax-this.rangeMarginValue),this.valueMin=a},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(t){if(t.preventDefault(),this.startX=t.clientX,t.type==="touchstart")if(t.touches.length===1)this.startX=t.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=t.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(t){this.mouseMoveCounter++;let e=t.clientX;t.type==="touchmove"&&(e=t.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,a=this.barValue+(this.maximum-this.minimum)*i;a-=a%this.step,a<this.valueMin+this.rangeMarginValue?a=this.valueMin+this.rangeMarginValue:a>this.maximum&&(a=this.maximum),this.valueMax=a},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(t){if(this.preventWheel===!0||!t.shiftKey&&!t.ctrlKey)return;let e=this.step;t.deltaY<0&&(e=-e),t.shiftKey&&t.ctrlKey?this.valueMin+e>=this.minimum&&this.valueMax+e<=this.maximum&&(this.valueMin=this.valueMin+e,this.valueMax=this.valueMax+e):t.ctrlKey?(e=this.valueMax+e,e<this.valueMin+this.rangeMarginValue?e=this.valueMin+this.rangeMarginValue:e>this.maximum&&(e=this.maximum),this.valueMax=e):t.shiftKey&&(e=this.valueMin+e,e<this.minimum?e=this.minimum:e>this.valueMax-this.rangeMarginValue&&(e=this.valueMax-this.rangeMarginValue),this.valueMin=e)},triggerInput(){let t=0;this.step.toString().includes(".")&&(t=2);let e={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(t)),maxValue:parseFloat(this.valueMax.toFixed(t))};this.$emit("input",e)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let t=this.labels||[],e=t.length?t.length-1:100;return this.max===void 0?e:this.max},stepCount(){let t=this.labels||[];return t.length?t.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let t=0;return this.step.toString().includes(".")&&(t=2),(this.valueMin||0).toFixed(t)},barMaxVal(){let t=0;return this.step.toString().includes(".")&&(t=2),(this.valueMax||100).toFixed(t)},scaleLabels(){let t=this.labels||[];return t.length===0&&(t=[],t.push(this.minimum),t.push(this.maximum)),t}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(t){this.valueMin=t<this.minimum?this.minimum:t},maxValue(t){this.valueMax=t>this.maximum?this.maximum:t}},mounted(){}},cL={class:"bar"},gL=["min","max","step","value"],NL={class:"caption"},yL={class:"min-caption"},dL={class:"bar-inner"},jL=["min","max","step","value"],IL={class:"caption"},DL={class:"max-caption"},fL={key:0,class:"ruler"},hL={key:1,class:"sub-ruler"},mL={key:2,class:"labels"};function AL(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([n.baseClassName,a.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:e[10]||(e[10]=s.withModifiers((...o)=>r.onMouseWheel&&r.onMouseWheel(...o),["prevent","stop"]))},[s.createElementVNode("div",cL,[s.createElementVNode("div",{class:"bar-left",style:s.normalizeStyle({width:r.barMin+"%"}),onClick:e[0]||(e[0]=(...o)=>r.onBarLeftClick&&r.onBarLeftClick(...o))},null,4),s.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:r.minimum,max:r.maximum,step:n.step,value:a.valueMin,onInput:e[1]||(e[1]=s.withModifiers((...o)=>r.onInputMinChange&&r.onInputMinChange(...o),["stop","prevent"]))},null,40,gL),s.createElementVNode("div",{class:"thumb thumb-left",onMousedown:e[2]||(e[2]=(...o)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...o)),onTouchstart:e[3]||(e[3]=(...o)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...o))},[s.createElementVNode("div",NL,[s.createElementVNode("span",yL,s.toDisplayString(n.minCaption||r.barMinVal),1)])],32),s.createElementVNode("div",dL,[s.createElementVNode("div",{class:"bar-inner-left",onClick:e[4]||(e[4]=(...o)=>r.onInnerBarLeftClick&&r.onInnerBarLeftClick(...o))}),s.createElementVNode("div",{class:"bar-inner-right",onClick:e[5]||(e[5]=(...o)=>r.onInnerBarRightClick&&r.onInnerBarRightClick(...o))})]),s.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:r.minimum,max:r.maximum,step:n.step,value:a.valueMax,onInput:e[6]||(e[6]=s.withModifiers((...o)=>r.onInputMaxChange&&r.onInputMaxChange(...o),["stop","prevent"]))},null,40,jL),s.createElementVNode("div",{class:"thumb thumb-right",onMousedown:e[7]||(e[7]=(...o)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...o)),onTouchstart:e[8]||(e[8]=(...o)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...o))},[s.createElementVNode("div",IL,[s.createElementVNode("span",DL,s.toDisplayString(n.maxCaption||r.barMaxVal),1)])],32),s.createElementVNode("div",{class:"bar-right",style:s.normalizeStyle({width:r.barMax+"%"}),onClick:e[9]||(e[9]=(...o)=>r.onBarRightClick&&r.onBarRightClick(...o))},null,4)]),n.ruler?(s.openBlock(),s.createElementBlock("div",fL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.stepCount,o=>(s.openBlock(),s.createElementBlock("div",{key:o,class:"ruler-rule"}))),128))])):s.createCommentVNode("",!0),r.subStepCount?(s.openBlock(),s.createElementBlock("div",hL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.subStepCount,o=>(s.openBlock(),s.createElementBlock("div",{key:o,class:"ruler-sub-rule"}))),128))])):s.createCommentVNode("",!0),n.label?(s.openBlock(),s.createElementBlock("div",mL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.scaleLabels,o=>(s.openBlock(),s.createElementBlock("div",{class:"label",key:o},s.toDisplayString(o),1))),128))])):s.createCommentVNode("",!0)],34)}var zL=Ge(uL,[["render",AL]]),mO="";ni.register(QT,cr,Nr,cl);const pL=s.defineComponent({components:{Bar:ML,MultiRangeSlider:zL,DhAdvancedFilter:Dl},props:{numberRange:{type:Array,default:()=>[{key:1,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},steps:{type:Number,default:1},includeForm:{type:Boolean,default:!1}},data(){return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:["#5ea9e5"],borderRadius:1,hoverBackgroundColor:"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},chartLines:{},min:"1",max:this.maxNumber(this.numberRange),rangeMax:this.numberRange.length,chart_dta:[],BarMinValue:1,BarMaxValue:this.numberRange.length,activeFilter:!1,validated:!1,isMatch:!1,isExclude:!1,isDisable:!1}},mounted(){this.isMatch=!0,this.setChartData(this.numberRange),this.highlightChart()},methods:{matchFilter(){if(!this.isDisable){this.isMatch=!0,this.isExclude=!1;var t=this.chartData.datasets[0].data;this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=t.length;e++)t[e]>=this.min&&t[e]<=this.max?this.chartData.datasets[0].backgroundColor.push("#5ea9e5"):this.chartData.datasets[0].backgroundColor.push("#e0e0e0")}},excludeFilter(){if(!this.isDisable){this.isMatch=!1,this.isExclude=!0;var t=this.chartData.datasets[0].data;this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<t.length;e++)t[e]>=this.min&&t[e]<=this.max?this.chartData.datasets[0].backgroundColor.push("#e0e0e0"):this.chartData.datasets[0].backgroundColor.push("#5ea9e5")}},missingFilter(){this.isDisable=!this.isDisable,this.validated=!this.validated;var t=this.chartData.datasets[0].data;if(this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[],this.validated)for(let e=1;e<=t.length;e++)this.chartData.datasets[0].backgroundColor.push("#e0e0e0");else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(t){let e=t.target.value;this.min=e||"1",this.BarMinValue=e?this.getFirstIndex(parseInt(e)):1,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(t){let e=t.target.value;this.BarMaxValue=e&&e>this.maxNumber(this.numberRange)?this.numberRange.length:this.getLastIndex(parseInt(e)),this.max=e&&e>this.maxNumber(this.numberRange)?this.maxNumber(this.numberRange):e,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(t){t=this.sortData(t),this.removeChartData();let e=this.chartData.labels;for(let n=0;n<t.length;n++)e.push(t[n].key),this.chart_dta.push(t[n].count);this.chartData.datasets[0].data=this.chart_dta},highlightChart(){var t=this.chartData.datasets[0].data;this.chartLines=this.chartData.datasets[0],this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=t.length;e++)t[e]>=this.min&&t[e]<=this.max?this.chartData.datasets[0].backgroundColor.push("#5ea9e5"):this.chartData.datasets[0].backgroundColor.push("#e0e0e0")},updateBarChart(t){const{minValue:e,maxValue:n}=t;this.BarMinValue=e,this.BarMaxValue=n;var i=this.chartData.datasets[0].data;this.min=i[this.BarMinValue]?i[this.BarMinValue]:"1",this.max=i[this.BarMaxValue]?i[this.BarMaxValue]:this.max,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},toggleFilter(){this.activeFilter=!this.activeFilter},removeChartData(){this.chartData.labels=[],this.chartData.datasets[0].data=[],this.chart_dta=[]},sortData(t){return t.slice().sort(function(e,n){return e.count-n.count})},maxNumber(t){if(t.length!=0)return t.reduce((e,n)=>e=e>n.count?e:n.count,0)},getLastIndex(t){let e=this.chartData.datasets[0].data,n=0;for(let i=t;i>=0;i--)if(e.lastIndexOf(i)!==-1){n=e.lastIndexOf(i);break}else continue;return n},getFirstIndex(t){let e=this.chartData.datasets[0].data,n=0;for(let i=t;i<=this.max;i++)if(e.lastIndexOf(i)!==-1){n=e.lastIndexOf(i);break}else continue;return n}}}),TL={class:"dh-range-container"},LL={class:"bar-chart"},xL={key:0,class:"input-group-section"},OL={class:"input-group sb-input"},SL=["disabled","max","value"],EL={class:"input-group sb-input"},bL=["disabled","max","min","value"];function CL(t,e,n,i,a,r){const o=s.resolveComponent("Bar"),l=s.resolveComponent("MultiRangeSlider"),M=s.resolveComponent("dh-advanced-filter");return s.openBlock(),s.createElementBlock("div",TL,[s.createElementVNode("div",LL,[s.createVNode(o,{"chart-data":t.chartData,"chart-id":t.chartId,"chart-options":t.chartOptions,"dataset-id-key":t.datasetIdKey,height:t.height,width:t.width},null,8,["chart-data","chart-id","chart-options","dataset-id-key","height","width"]),s.createVNode(l,{"base-class-name":`multi-range-slider range-slider ${t.isDisable}`,label:!1,max:t.rangeMax,"max-caption":`${t.max}`,"max-value":t.BarMaxValue,min:1,"min-caption":`${t.min}`,"min-value":t.BarMinValue,"range-margin":0,ruler:!1,step:t.steps,onInput:t.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","step","onInput"])]),t.includeForm?(s.openBlock(),s.createElementBlock("div",xL,[s.createElementVNode("div",OL,[s.createElementVNode("label",{class:s.normalizeClass(`text-2 input-to ${t.validated?"disable":""}`)}," From ",2),s.createElementVNode("input",{class:"form-input text",disabled:!!t.validated,max:`${t.max}`,min:"1",placeholder:"From",type:"number",value:`${t.min}`,onInput:e[0]||(e[0]=u=>t.changeMin(u))},null,40,SL)]),s.createElementVNode("div",EL,[s.createElementVNode("label",{class:s.normalizeClass(`text-2 input-to ${t.validated?"disable":""}`)}," To ",2),s.createElementVNode("input",{class:"form-input text",disabled:!!t.validated,max:`${t.maxNumber(t.numberRange)}`,min:`${t.min}`,placeholder:"To",type:"number",value:`${t.max}`,onInput:e[1]||(e[1]=u=>t.changeMax(u))},null,40,bL)])])):s.createCommentVNode("",!0),s.renderSlot(t.$slots,"default"),s.createVNode(M,{onExclude:t.excludeFilter,onFilter_missing:t.missingFilter,onMatch:t.matchFilter},null,8,["onExclude","onFilter_missing","onMatch"])])}var wL=Ge(pL,[["render",CL]]),AO="";const kL={class:"password__panel"},vL=["placeholder","type"],QL={class:"icon is-right"},_L={key:0,class:"password__tooltip"};var YL=Ge(s.defineComponent({__name:"PasswordField",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""},tipChars:{type:String,default:"12 Characters"},tipNumbers:{type:String,default:"Numbers"},tipSymbols:{type:String,default:"Symbols"},passwordTooltipDisabled:{type:Boolean,default:!1}},emits:["submit","update:modelValue"],setup(t,{emit:e}){const n=t,i=s.ref(""),a=s.ref(!1),r=s.ref(!1),o=s.ref(!1),l=s.ref(!1),M=s.ref(!1),u=s.ref(!1);function c(){e("submit",i.value),e("update:modelValue",i.value)}function g(){a.value=!0,u.value=!0}function y(){a.value=!1,u.value=!1}function d(){M.value=!M.value}return s.onMounted(()=>()=>i.value=n.modelValue||""),s.watch(n,()=>(i.value=n.modelValue||"",r.value=i.value.length>11,o.value=/\d/.test(i.value),l.value=/[!@#$%^&*)(+=._-]/.test(i.value))),(j,f)=>(s.openBlock(),s.createElementBlock("div",kL,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=I=>i.value=I),class:"form__input password__panel_input","data-e2e":"password-input",placeholder:n.placeholder,type:M.value?"text":"password",onFocus:g,onFocusout:y,onKeyup:c},null,40,vL),[[s.vModelDynamic,i.value]]),s.createElementVNode("button",{class:"password__panel_button",type:"button",onClick:d},[s.createElementVNode("span",QL,[s.createVNode(Ie,{active:u.value,"icon-name":M.value?"invisible":"visible",size:20},null,8,["active","icon-name"])])]),a.value&&!n.passwordTooltipDisabled?(s.openBlock(),s.createElementBlock("div",_L,[s.createElementVNode("p",{class:s.normalizeClass(["password__tooltip_text",r.value?"password__tooltip_text--valid":""])},[s.createVNode(Ie,{class:s.normalizeClass(r.value?"password__tooltip_icon--active":"password__tooltip_icon"),"icon-name":r.value?"accept":"close",size:16},null,8,["class","icon-name"]),s.createElementVNode("span",null,s.toDisplayString(n.tipChars),1)],2),s.createElementVNode("p",{class:s.normalizeClass(["password__tooltip_text",o.value?"password__tooltip_text--valid":""])},[s.createVNode(Ie,{class:s.normalizeClass(o.value?"password__tooltip_icon--active":"password__tooltip_icon"),"icon-name":o.value?"accept":"close",size:16},null,8,["class","icon-name"]),s.createElementVNode("span",null,s.toDisplayString(n.tipNumbers),1)],2),s.createElementVNode("p",{class:s.normalizeClass(["password__tooltip_text",l.value?"password__tooltip_text--valid":""])},[s.createVNode(Ie,{class:s.normalizeClass(l.value?"password__tooltip_icon--active":"password__tooltip_icon"),"icon-name":l.value?"accept":"close",size:16},null,8,["class","icon-name"]),s.createElementVNode("span",null,s.toDisplayString(n.tipSymbols),1)],2)])):s.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-3ae35090"]]),pO="";const UL={class:"radio"},PL=["for"],RL=["id","type","value"],ZL={class:"radio__label_txt"};var _g=Ge({__name:"RadioBox",props:{type:{type:String,default:"radio"},value:{type:String,required:!0},label:{type:String,required:!0}},emits:["clickBox"],setup(t,{emit:e}){return(n,i)=>(s.openBlock(),s.createElementBlock("div",UL,[s.createElementVNode("label",{class:"radio__label",for:t.value},[s.createElementVNode("input",{id:t.value,class:"radio__input",name:"radiobox",type:t.type,value:t.value,onClick:i[0]||(i[0]=a=>e("clickBox"))},null,8,RL),s.createElementVNode("span",ZL,s.toDisplayString(t.label),1)],8,PL)]))}},[["__scopeId","data-v-29696bd5"]]),LO="";const BL={__name:"RadioBoxGroup",props:{orientation:{type:String,default:"horizontal"},type:{type:String,default:"radio"},list:{type:Array,required:!0}},setup(t){const e=s.ref(null);function n(){const i=document.querySelectorAll("input");for(let a=0;a<i.length;a++)i[a].checked?i[a].parentNode.parentNode.classList.add("radio--checked"):i[a].parentNode.parentNode.classList.remove("radio--checked")}return(i,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["radio__grp",t.orientation==="vertical"?"radio__vertical":"radio__horizontal"])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.list,r=>(s.openBlock(),s.createBlock(_g,{key:r.key,ref_for:!0,ref_key:"boxes",ref:e,label:r.label,type:t.type,value:r.value,onClickBox:n},null,8,["label","type","value"]))),128))],2))}};var xO="";const VL={class:"search-panel"},GL=["placeholder"];var WL=Ge(s.defineComponent({__name:"SearchInput",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["submit","clean","update:modelValue"],setup(t,{emit:e}){const n=t,i=s.ref("");function a(){e("submit",i.value),e("update:modelValue",i.value)}function r(){i.value="",e("clean"),e("update:modelValue",i.value)}return s.onMounted(()=>()=>i.value=n.modelValue||""),s.watch(n,()=>i.value=n.modelValue||""),(o,l)=>(s.openBlock(),s.createElementBlock("div",VL,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=M=>i.value=M),class:"form-input search-panel-input","data-e2e":"search-input",placeholder:n.placeholder,onKeyup:a},null,40,GL),[[s.vModelText,i.value]]),i.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:0,class:"search-panel-button","data-e2e":"search-submit",onClick:a},[s.createVNode(Ie,{active:!0,"icon-name":"search",size:24})])),i.value?(s.openBlock(),s.createElementBlock("button",{key:1,class:"search-panel-button close","data-e2e":"search-close",onClick:r},[s.createVNode(Ie,{class:"icon","icon-name":"close",size:24})])):s.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-562faa14"]]),SO="";const $L=t=>(s.pushScopeId("data-v-0213b522"),t=t(),s.popScopeId(),t),HL={class:"stepper"},FL=$L(()=>s.createElementVNode("hr",{class:"solid"},null,-1));var JL=Ge(s.defineComponent({__name:"Stepper",props:{maxSteps:{type:Number,default:0},currentStep:{type:Number,default:0}},setup(t){const e=t;function n(){return Array.from(Array(e.maxSteps||0).keys())}return(i,a)=>(s.openBlock(),s.createElementBlock("div",HL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n(),(r,o)=>(s.openBlock(),s.createElementBlock("div",{key:o,class:"step"},[s.createElementVNode("span",{class:s.normalizeClass(["step-number",{active:r===t.currentStep}])},s.toDisplayString(r+1),3),FL]))),128))]))}}),[["__scopeId","data-v-0213b522"]]);const XL=s.defineComponent({props:{data:{type:Boolean,required:!0,default:!1},label:{type:String,default:"Label"}},data(){return{active:this.data}},emits:["change"],computed:{checkedValue:{get(){return this.data},set(t){this.active=t,this.$emit("change",t)}}}}),KL={class:"dp__options"},qL={class:"dp__options_switch"},ex=s.createElementVNode("span",{class:"dp__options_slider"},null,-1);function tx(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("label",KL,[s.createElementVNode("span",null,s.toDisplayString(t.label),1),s.createElementVNode("div",qL,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>t.checkedValue=o),name:"switch",type:"checkbox"},null,512),[[s.vModelCheckbox,t.checkedValue]]),ex])])}var nx=Ge(XL,[["render",tx]]);const ix=s.defineComponent({props:{target:{type:String,required:!0},trigger:{type:String,required:!0},placement:{type:Object,default:()=>({placement:"bottom"}),required:!1},tooltipText:{type:String,required:!0}},data(){return{show:!1}},methods:{showTooltip(){this.show=!this.show},tooltip(){let t=this.$refs.main,e=this.$refs[this.target];["right","left"].includes(this.placement)&&(e.style.top=-(((e==null?void 0:e.offsetHeight)-(t==null?void 0:t.offsetHeight))/2)+"px")}}}),ax=["placement","target","tooltipText","trigger"],rx=["id"],ox={class:"text"};function sx(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("div",{id:"main-contain",ref:"main",class:"dh-tooltip-container tooltip",placement:t.placement,target:t.target,tooltipText:t.tooltipText,trigger:t.trigger,onClick:e[0]||(e[0]=o=>t.trigger=="click"?t.showTooltip():null),onMouseover:e[1]||(e[1]=o=>t.tooltip())},[s.renderSlot(t.$slots,"default"),s.createElementVNode("div",{id:t.target,ref:t.target,class:s.normalizeClass(`tooltiptext ${t.show}`)},[s.createElementVNode("span",ox,s.toDisplayString(t.tooltipText),1)],10,rx)],40,ax)}var lx=Ge(ix,[["render",sx]]),bO="";const Mx={class:"code"};var ux=Ge(s.defineComponent({__name:"VerificationCode",props:{code:{type:String,required:!0}},emits:["submit"],setup(t,{emit:e}){const n=t,i=s.ref(null),a=s.ref(null),r=s.ref(null),o=s.ref(null),l=s.ref(null),M=s.ref(null);async function u(f){var I,N,D,A,p;switch(f){case 1:break;case 2:(I=i.value)==null||I.focus();break;case 3:(N=a.value)==null||N.focus();break;case 4:(D=r.value)==null||D.focus();break;case 5:(A=o.value)==null||A.focus();break;case 6:(p=l.value)==null||p.focus();break}}async function c(f){var I,N,D,A,p;switch(f){case 1:(I=a.value)==null||I.focus();break;case 2:(N=r.value)==null||N.focus();break;case 3:(D=o.value)==null||D.focus();break;case 4:(A=l.value)==null||A.focus();break;case 5:(p=M.value)==null||p.focus();break}}async function g(f,I){const N=f.key;let D=!0;[{_index:1,nextInput:a},{_index:2,nextInput:r},{_index:3,nextInput:o},{_index:4,nextInput:l},{_index:5,nextInput:M}].forEach(({_index:A,nextInput:p})=>{I===A&&(p.value&&N.match(/^[0-9]+$/)&&p.value.focus({}),D=!1),f.preventDefault()}),N.match(/^[0-9]+$/)&&(f.target.value=N),D&&j()}async function y(f){var N;const I=((N=f.clipboardData)==null?void 0:N.getData("text/plain"))||"";d(I),j()}function d(f){const I=f.replace(/\D/g,"");if(I.length!==6)return;const[N,D,A,p,m,z]=I.split("");i.value&&(i.value.value=N),a.value&&(a.value.value=D),r.value&&(r.value.value=A),o.value&&(o.value.value=p),l.value&&(l.value.value=m),M.value&&(M.value.value=z)}async function j(){var I,N,D,A,p,m;const f=`${(I=i.value)==null?void 0:I.value}${(N=a.value)==null?void 0:N.value}${(D=r.value)==null?void 0:D.value}${(A=o.value)==null?void 0:A.value}${(p=l.value)==null?void 0:p.value}${(m=M.value)==null?void 0:m.value}`;e("submit",f)}return s.onMounted(()=>{n.code&&(d(n.code),j())}),(f,I)=>(s.openBlock(),s.createElementBlock("div",Mx,[s.createElementVNode("input",{ref_key:"txtInput1",ref:i,autofocus:"",class:"form-input input-1","data-e2e":"input-1",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[0]||(I[0]=N=>g(N,1)),onKeyup:[I[1]||(I[1]=s.withKeys(N=>u(1),["delete"])),I[2]||(I[2]=s.withKeys(N=>u(1),["left"])),I[3]||(I[3]=s.withKeys(N=>c(1),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput2",ref:a,class:"form-input","data-e2e":"input-2",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[4]||(I[4]=N=>g(N,2)),onKeyup:[I[5]||(I[5]=s.withKeys(N=>u(2),["delete"])),I[6]||(I[6]=s.withKeys(N=>u(2),["left"])),I[7]||(I[7]=s.withKeys(N=>c(2),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput3",ref:r,class:"form-input","data-e2e":"input-3",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[8]||(I[8]=N=>g(N,3)),onKeyup:[I[9]||(I[9]=s.withKeys(N=>u(3),["delete"])),I[10]||(I[10]=s.withKeys(N=>u(3),["left"])),I[11]||(I[11]=s.withKeys(N=>c(3),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput4",ref:o,class:"form-input","data-e2e":"input-4",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[12]||(I[12]=N=>g(N,4)),onKeyup:[I[13]||(I[13]=s.withKeys(N=>u(4),["delete"])),I[14]||(I[14]=s.withKeys(N=>u(4),["left"])),I[15]||(I[15]=s.withKeys(N=>c(4),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput5",ref:l,class:"form-input","data-e2e":"input-5",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[16]||(I[16]=N=>g(N,5)),onKeyup:[I[17]||(I[17]=s.withKeys(N=>u(5),["delete"])),I[18]||(I[18]=s.withKeys(N=>u(5),["left"])),I[19]||(I[19]=s.withKeys(N=>c(5),["right"]))],onPaste:y},null,544),s.createElementVNode("input",{ref_key:"txtInput6",ref:M,class:"form-input","data-e2e":"input-6",inputmode:"numeric",maxlength:"1",placeholder:"_",type:"text",onKeypress:I[20]||(I[20]=N=>g(N,6)),onKeyup:[I[21]||(I[21]=s.withKeys(N=>u(6),["delete"])),I[22]||(I[22]=s.withKeys(N=>u(6),["left"])),I[23]||(I[23]=s.withKeys(N=>c(6),["right"]))],onPaste:y},null,544)]))}}),[["__scopeId","data-v-7d5513ee"]]);const cx=s.defineComponent({components:{DhIcon:Ie},props:{title:{type:String,default:"Advanced"}},data(){return{isAdvancedSettingsOpen:!1}}}),gx={class:"text-1"},Nx=s.createTextVNode(" Content ");function yx(t,e,n,i,a,r){const o=s.resolveComponent("dh-icon");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",{class:s.normalizeClass(["advanced-panel-header clickable",{opened:t.isAdvancedSettingsOpen,closed:!t.isAdvancedSettingsOpen}]),"data-e2e":"expansion-panel-button",onClick:e[0]||(e[0]=l=>t.isAdvancedSettingsOpen=!t.isAdvancedSettingsOpen)},[s.createElementVNode("h4",gx,s.toDisplayString(t.title),1),s.createVNode(o,{class:"icon","icon-name":t.isAdvancedSettingsOpen?"arrow-up":"arrow-down",size:24},null,8,["icon-name"])],2),t.isAdvancedSettingsOpen?s.renderSlot(t.$slots,"content",{key:0},()=>[Nx]):s.createCommentVNode("",!0)],64)}var dx=Ge(cx,[["render",yx]]),wO="";const jx=["src"],Ix={key:3,class:"menu-item-text-wrapper"};var Dx=Ge(s.defineComponent({__name:"DropdownMenu",props:{items:{type:Object,required:!0},textEllipsis:{type:Boolean,required:!1,default:!1},iconSize:{type:Number,required:!1,default:24},closeOnClickOutside:{type:Boolean,required:!1,default:!0},zIndex:{type:Number,required:!1,default:100},closeOnItemSelected:{type:Boolean,required:!1,default:!0}},emits:["itemSelected","close"],setup(t,{emit:e}){const n=t;s.onMounted(()=>{document.addEventListener("click",r=>{i(r)})});function i(r){const o=r.target,l=document.querySelector("[data-id='dropdown-menu']");l&&!l.contains(r.target)&&!o.classList.contains("dropdown-toggle")&&n.closeOnClickOutside&&e("close")}function a(r){e("itemSelected",r),n.closeOnItemSelected&&e("close")}return(r,o)=>{const l=s.resolveComponent("router-link");return s.openBlock(),s.createElementBlock("div",{class:"dropdown-menu","data-id":"dropdown-menu",style:s.normalizeStyle({"z-index":n.zIndex})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,M=>(s.openBlock(),s.createBlock(l,{key:M.iconName,class:"menu-item","data-e2e":M.dataE2eTag,to:{path:M.url},onClick:u=>a(M)},{default:s.withCtx(()=>[M.iconUrl?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"icon image",class:"icon icon-url",src:M.iconUrl},null,8,jx)):s.createCommentVNode("",!0),M.iconUrl?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(Ie,s.mergeProps({key:1,class:"icon"},{...M,size:n.iconSize}),null,16)),M.subText?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(["text-2",{"text-ellipsis":n.textEllipsis}])},s.toDisplayString(M.text),3)),M.subText?(s.openBlock(),s.createElementBlock("div",Ix,[s.createElementVNode("span",{class:s.normalizeClass(["text-4",{"text-ellipsis":n.textEllipsis}])},s.toDisplayString(M.text),3),s.createElementVNode("span",{class:s.normalizeClass(["text-1",{"text-ellipsis":n.textEllipsis}])},s.toDisplayString(M.subText),3)])):s.createCommentVNode("",!0),M.isSelected?(s.openBlock(),s.createBlock(Ie,{key:4,class:"icon-blue icon-accept","icon-name":"accept",size:16})):s.createCommentVNode("",!0)]),_:2},1032,["data-e2e","to","onClick"]))),128))],4)}}}),[["__scopeId","data-v-3f98d032"]]),vO="";const fx={class:"input__dropdown"},hx={class:"input__dropdown_second"},mx=["tabindex"],Ax=["onClick"],zx={__name:"InputDropdown",props:{list:{type:Array,required:!0},icon:{type:String,required:!0},default:{type:String,required:!1,default:null},tabindex:{type:Number,required:!1,default:0}},emits:["update"],setup(t,{emit:e}){const n=t,i=s.ref(n.default?n.default:n.list.length>0?n.list[0]:null),a=s.ref(!1),r=s.ref(null);s.onMounted(()=>{e("update","",i.value)});function o(){e("update",r.value.value,i.value)}return(l,M)=>(s.openBlock(),s.createElementBlock("div",fx,[s.createElementVNode("input",{ref_key:"name",ref:r,class:"input__dropdown_text",type:"text",onInput:o},null,544),s.createElementVNode("div",hx,[s.createVNode(Ie,{"icon-name":t.icon,size:18},null,8,["icon-name"]),s.createElementVNode("div",{class:"custom__select",tabindex:t.tabindex,onBlur:M[1]||(M[1]=u=>a.value=!1)},[s.createElementVNode("div",{class:s.normalizeClass(["custom__select_selected",{"custom__select--open":a.value}]),onClick:M[0]||(M[0]=u=>a.value=!a.value)},s.toDisplayString(i.value),3),s.createElementVNode("div",{class:s.normalizeClass(["custom__select_items",{"custom__select--hide":!a.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.list,(u,c)=>(s.openBlock(),s.createElementBlock("div",{key:c,onClick:g=>{i.value=u,a.value=!1,o()}},s.toDisplayString(u),9,Ax))),128))],2)],40,mx)])]))}};var px="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAR2SURBVHgBlVVdaFtlGH6+LydJ89OYtHVbf+YyhoPK5uK2G3/oIlTYhRctKApebAiCXowtDLzxIi3sUqnBiiBerF6osGl7J0idqWyD4WSZF3PzZ4tt7Y/NmnRN0yYn5/t8z9e0Ne35Wnwg5Jzzvt/7vO/7vT8MO6BnYDEuPP4TXMi4kIgyxqOrElEAZEZKZLhVHhpJBDPb2WE6wcsDZtwwXEkJGd9G7T9WRJqZ+f6RxONprUp9BDIs3CLJJM7tSLAJkg5xIT6EVSTCSEFLdPKT5ai36hqWzBVj8v+R1IFVM8y0ekcSvuwWop6BfFgaoR8kY0RSf04qRUriSh6l/AzcDY3wRtpgmWUSUhSewFYuITMFwV9MJ5iKzFgTCHfITtcWEhvW/H38NfYpViZ+UZ7Jmn920B3dZxDuPLnljOQsFmYiSY8J+53Xook734nE4v1r+P2rBMoTt1VUqzRC/ThFU85P2m7CCYKxc3bVrhNZRjDpdPHmoxnMXBmErFbgDIncza+RuzGE1QTXQ1k0fElF9OpAJcaZK+5kZuHuKCqlAraDbWzmxmWUJm5pXEH89Y8W49w0cNrBGYWlqTvbFvjTna1oigQoLQKP/ryq0eIooSFOxcCP6AxJaWkkDAEfw/uJ52GaJt658D1yhSmdGdJmJ+iOZEyrQaFeOPss9u3xKXUVHlXN8UO78U2qFx0tbuxv9eOzZDepCr0ZGlsGdUFYR3L04C50H4ugt2s/HkwXsVgqoyXUgLbdQeITtgFFEPK58VR7iFKk81dEuU7m5yWkXmtEo98Ao0jeS12FWeVo3+WnZhT48edJvNl3RTkU8nN8fKoJAWNJE5HdsJJl6SG6WVZhbsyZfuxVlSLwwbtd2NMcUM/2wReOP4Enoy2rVuhbQTRhpep25pGiwBmvZJ2EVcuD8/fewGwloIy1NftUdUlqUkn7glPKWpsblO7flTDO330FFjyORKSd4bBcY9CCYboUXFe3S9UmYmuvNeTJGRrEziTM1q/eJieLaWhAnuDbiQO12cZgLa0Ay1UI+7eyUfqjMwehWymMHHNXqxc57Y003W5aR3YrfwCXsp3KkCvgAfd7wX3073PRLAOGxztxbWqfrudtpC/R9uWrrGa/1KjS6MSXfxzFFxNdsJhXxUmOQbj8+Py35zB07xilh2kyAoom328/K6KRM740mUxtHoz2fRTmBKYfMMxXaP+wCMzcAsyHCyQLomRElayQs+y1tAVUAKnLtdW+3ke8avSRILNGZpPMjlsozlMBUI6u36Ebaz8M+OjiPUHwvc9g9KeyWkqLD13ITdpkG9OBPmcQNPrW3uti7hlYjkq3Z5iSH8vPEslCfSV1Ha7g1EucSt/Exe8krv/qrzMQeMxCUyu3d1WGutt5lW+QyXDZLPf9M26cldAODkfY99zSUU4FvL6+kdoK1xKt4dDbc3G3EUmSQhw7EDLqFSFZmvZtf2bQvm8HHeyA2FvFGPd6TlN0R0iZJj0Lq2NSZiWsLGNsjKOYvjlIbbIN/gUK8Nn86IrnuAAAAABJRU5ErkJggg==";function At(t){return[null,void 0].indexOf(t)!==-1}function Tx(t,e,n){const{object:i,valueProp:a,mode:r}=s.toRefs(t),o=s.getCurrentInstance().proxy,l=n.iv,M=g=>{l.value=c(g);const y=u(g);e.emit("change",y,o),e.emit("input",y),e.emit("update:modelValue",y)},u=g=>i.value||At(g)?g:Array.isArray(g)?g.map(y=>y[a.value]):g[a.value],c=g=>At(g)?r.value==="single"?{}:[]:g;return{update:M}}function Lx(t,e){const{value:n,modelValue:i,mode:a,valueProp:r}=s.toRefs(t),o=s.ref(a.value!=="single"?[]:{}),l=i&&i.value!==void 0?i:n,M=s.computed(()=>a.value==="single"?o.value[r.value]:o.value.map(c=>c[r.value])),u=s.computed(()=>a.value!=="single"?o.value.map(c=>c[r.value]).join(","):o.value[r.value]);return{iv:o,internalValue:o,ev:l,externalValue:l,textValue:u,plainValue:M}}function xx(t,e,n){const{regex:i}=s.toRefs(t),a=s.getCurrentInstance().proxy,r=n.isOpen,o=n.open,l=s.ref(null),M=s.ref(null),u=()=>{l.value=""},c=d=>{l.value=d.target.value},g=d=>{if(i&&i.value){let j=i.value;typeof j=="string"&&(j=new RegExp(j)),d.key.match(j)||d.preventDefault()}},y=d=>{if(i&&i.value){let f=(d.clipboardData||window.clipboardData).getData("Text"),I=i.value;typeof I=="string"&&(I=new RegExp(I)),f.split("").every(N=>!!N.match(I))||d.preventDefault()}e.emit("paste",d,a)};return s.watch(l,d=>{!r.value&&d&&o(),e.emit("search-change",d,a)}),{search:l,input:M,clearSearch:u,handleSearchInput:c,handleKeypress:g,handlePaste:y}}function Ox(t,e,n){const{groupSelect:i,mode:a,groups:r,disabledProp:o}=s.toRefs(t),l=s.ref(null),M=c=>{c===void 0||c!==null&&c[o.value]||r.value&&c&&c.group&&(a.value==="single"||!i.value)||(l.value=c)};return{pointer:l,setPointer:M,clearPointer:()=>{M(null)}}}function mr(t,e=!0){return e?String(t).toLowerCase().trim():String(t).normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase().trim()}function Sx(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ex(t,e){const n=e.slice().sort();return t.length===e.length&&t.slice().sort().every(function(i,a){return i===n[a]})}function bx(t,e,n){const{options:i,mode:a,trackBy:r,limit:o,hideSelected:l,createTag:M,createOption:u,label:c,appendNewTag:g,appendNewOption:y,multipleLabel:d,object:j,loading:f,delay:I,resolveOnLoad:N,minChars:D,filterResults:A,clearOnSearch:p,clearOnSelect:m,valueProp:z,canDeselect:k,max:v,strict:Y,closeOnSelect:R,groups:w,reverse:h,infinite:E,groupOptions:C,groupHideEmpty:T,groupSelect:Q,onCreate:V,disabledProp:Z,searchStart:H}=s.toRefs(t),$=s.getCurrentInstance().proxy,O=n.iv,P=n.ev,U=n.search,je=n.clearSearch,B=n.update,X=n.pointer,Ae=n.clearPointer,ge=n.focus,re=n.deactivate,ue=n.close,Fe=s.ref([]),Ye=s.ref([]),Qe=s.ref(!1),Ve=s.ref(null),b=s.ref(E.value&&o.value===-1?10:o.value),se=s.computed(()=>M.value||u.value||!1),he=s.computed(()=>g.value!==void 0?g.value:y.value!==void 0?y.value:!0),qe=s.computed(()=>{if(w.value){let x=Ye.value||[],W=[];return x.forEach(ae=>{Nt(ae[C.value]).forEach(ke=>{W.push(Object.assign({},ke,ae[Z.value]?{[Z.value]:!0}:{}))})}),W}else{let x=Nt(Ye.value||[]);return Fe.value.length&&(x=x.concat(Fe.value)),x}}),zt=s.computed(()=>w.value?ie((Ye.value||[]).map((x,W)=>{const ae=Nt(x[C.value]);return{...x,index:W,group:!0,[C.value]:Ct(ae,!1).map(ke=>Object.assign({},ke,x[Z.value]?{[Z.value]:!0}:{})),__VISIBLE__:Ct(ae).map(ke=>Object.assign({},ke,x[Z.value]?{[Z.value]:!0}:{}))}})):[]),Tn=s.computed(()=>{let x=qe.value;return h.value&&(x=x.reverse()),_e.value.length&&(x=_e.value.concat(x)),Ct(x)}),pt=s.computed(()=>{let x=Tn.value;return b.value>0&&(x=x.slice(0,b.value)),x}),L=s.computed(()=>{switch(a.value){case"single":return!At(O.value[z.value]);case"multiple":case"tags":return!At(O.value)&&O.value.length>0}}),_=s.computed(()=>d!==void 0&&d.value!==void 0?d.value(O.value,$):O.value&&O.value.length>1?`${O.value.length} options selected`:"1 option selected"),G=s.computed(()=>!qe.value.length&&!Qe.value&&!_e.value.length),ne=s.computed(()=>qe.value.length>0&&pt.value.length==0&&(U.value&&w.value||!w.value)),_e=s.computed(()=>se.value===!1||!U.value?[]:q(U.value)!==-1?[]:[{[z.value]:U.value,[c.value]:U.value,[ve.value]:U.value,__CREATE__:!0}]),ve=s.computed(()=>r.value||c.value),ot=s.computed(()=>{switch(a.value){case"single":return null;case"multiple":case"tags":return[]}}),Ln=s.computed(()=>f.value||Qe.value),Je=x=>{switch(typeof x!="object"&&(x=S(x)),a.value){case"single":B(x);break;case"multiple":case"tags":B(O.value.concat(x));break}e.emit("select",Ar(x),x,$)},$t=x=>{switch(typeof x!="object"&&(x=S(x)),a.value){case"single":pr();break;case"tags":case"multiple":B(Array.isArray(x)?O.value.filter(W=>x.map(ae=>ae[z.value]).indexOf(W[z.value])===-1):O.value.filter(W=>W[z.value]!=x[z.value]));break}e.emit("deselect",Ar(x),x,$)},Ar=x=>j.value?x:x[z.value],zr=x=>{$t(x)},yl=(x,W)=>{if(W.button!==0){W.preventDefault();return}zr(x)},pr=()=>{e.emit("clear",$),B(ot.value)},Tt=x=>{if(x.group!==void 0)return a.value==="single"?!1:Il(x[C.value])&&x[C.value].length;switch(a.value){case"single":return!At(O.value)&&O.value[z.value]==x[z.value];case"tags":case"multiple":return!At(O.value)&&O.value.map(W=>W[z.value]).indexOf(x[z.value])!==-1}},bt=x=>x[Z.value]===!0,ai=()=>v===void 0||v.value===-1||!L.value&&v.value>0?!1:O.value.length>=v.value,dl=x=>{if(!bt(x)){if(V&&V.value&&!Tt(x)&&x.__CREATE__&&(x={...x},delete x.__CREATE__,x=V.value(x,$),x instanceof Promise)){Qe.value=!0,x.then(W=>{Qe.value=!1,Tr(W)});return}Tr(x)}},Tr=x=>{switch(x.__CREATE__&&(x={...x},delete x.__CREATE__),a.value){case"single":if(x&&Tt(x)){k.value&&$t(x);return}x&&Mn(x),m.value&&je(),R.value&&(Ae(),ue()),x&&Je(x);break;case"multiple":if(x&&Tt(x)){$t(x);return}if(ai())return;x&&(Mn(x),Je(x)),m.value&&je(),l.value&&Ae(),R.value&&ue();break;case"tags":if(x&&Tt(x)){$t(x);return}if(ai())return;x&&Mn(x),m.value&&je(),x&&Je(x),l.value&&Ae(),R.value&&ue();break}R.value||ge()},jl=x=>{if(!(bt(x)||a.value==="single"||!Q.value)){switch(a.value){case"multiple":case"tags":xn(x[C.value])?$t(x[C.value]):Je(x[C.value].filter(W=>O.value.map(ae=>ae[z.value]).indexOf(W[z.value])===-1).filter(W=>!W[Z.value]).filter((W,ae)=>O.value.length+1+ae<=v.value||v.value===-1));break}R.value&&re()}},Mn=x=>{S(x[z.value])===void 0&&se.value&&(e.emit("tag",x[z.value],$),e.emit("option",x[z.value],$),he.value&&te(x),je())},Lr=()=>{a.value!=="single"&&Je(pt.value)},xn=x=>x.find(W=>!Tt(W)&&!W[Z.value])===void 0,Il=x=>x.find(W=>!Tt(W))===void 0,S=x=>qe.value[qe.value.map(W=>String(W[z.value])).indexOf(String(x))],q=(x,W=!0)=>qe.value.map(ae=>parseInt(ae[ve.value])==ae[ve.value]?parseInt(ae[ve.value]):ae[ve.value]).indexOf(parseInt(x)==x?parseInt(x):x),F=x=>["tags","multiple"].indexOf(a.value)!==-1&&l.value&&Tt(x),te=x=>{Fe.value.push(x)},ie=x=>T.value?x.filter(W=>U.value?W.__VISIBLE__.length:W[C.value].length):x.filter(W=>U.value?W.__VISIBLE__.length:!0),Ct=(x,W=!0)=>{let ae=x;return U.value&&A.value&&(ae=ae.filter(ke=>H.value?mr(ke[ve.value],Y.value).startsWith(mr(U.value,Y.value)):mr(ke[ve.value],Y.value).indexOf(mr(U.value,Y.value))!==-1)),l.value&&W&&(ae=ae.filter(ke=>!F(ke))),ae},Nt=x=>{let W=x;return Sx(W)&&(W=Object.keys(W).map(ae=>{let ke=W[ae];return{[z.value]:ae,[ve.value]:ke,[c.value]:ke}})),W=W.map(ae=>typeof ae=="object"?ae:{[z.value]:ae,[ve.value]:ae,[c.value]:ae}),W},un=()=>{At(P.value)||(O.value=Or(P.value))},cn=x=>(Qe.value=!0,new Promise((W,ae)=>{i.value(U.value,$).then(ke=>{Ye.value=ke||[],typeof x=="function"&&x(ke),Qe.value=!1}).catch(ke=>{console.error(ke),Ye.value=[],Qe.value=!1}).finally(()=>{W()})})),On=()=>{if(!!L.value)if(a.value==="single"){let x=S(O.value[z.value]);if(x!==void 0){let W=x[c.value];O.value[c.value]=W,j.value&&(P.value[c.value]=W)}}else O.value.forEach((x,W)=>{let ae=S(O.value[W][z.value]);if(ae!==void 0){let ke=ae[c.value];O.value[W][c.value]=ke,j.value&&(P.value[W][c.value]=ke)}})},xr=x=>{cn(x)},Or=x=>At(x)?a.value==="single"?{}:[]:j.value?x:a.value==="single"?S(x)||{}:x.filter(W=>!!S(W)).map(W=>S(W)),Yg=()=>{Ve.value=s.watch(U,x=>{x.length<D.value||!x&&D.value!==0||(Qe.value=!0,p.value&&(Ye.value=[]),setTimeout(()=>{x==U.value&&i.value(U.value,$).then(W=>{(x==U.value||!U.value)&&(Ye.value=W,X.value=pt.value.filter(ae=>ae[Z.value]!==!0)[0]||null,Qe.value=!1)}).catch(W=>{console.error(W)})},I.value))},{flush:"sync"})};if(a.value!=="single"&&!At(P.value)&&!Array.isArray(P.value))throw new Error(`v-model must be an array when using "${a.value}" mode`);return i&&typeof i.value=="function"?N.value?cn(un):j.value==!0&&un():(Ye.value=i.value,un()),I.value>-1&&Yg(),s.watch(I,(x,W)=>{Ve.value&&Ve.value(),x>=0&&Yg()}),s.watch(P,x=>{if(At(x)){O.value=Or(x);return}switch(a.value){case"single":(j.value?x[z.value]!=O.value[z.value]:x!=O.value[z.value])&&(O.value=Or(x));break;case"multiple":case"tags":Ex(j.value?x.map(W=>W[z.value]):x,O.value.map(W=>W[z.value]))||(O.value=Or(x));break}},{deep:!0}),s.watch(i,(x,W)=>{typeof t.options=="function"?N.value&&(!W||x&&x.toString()!==W.toString())&&cn():(Ye.value=t.options,Object.keys(O.value).length||un(),On())}),s.watch(c,On),{pfo:Tn,fo:pt,filteredOptions:pt,hasSelected:L,multipleLabelText:_,eo:qe,extendedOptions:qe,fg:zt,filteredGroups:zt,noOptions:G,noResults:ne,resolving:Qe,busy:Ln,offset:b,select:Je,deselect:$t,remove:zr,selectAll:Lr,clear:pr,isSelected:Tt,isDisabled:bt,isMax:ai,getOption:S,handleOptionClick:dl,handleGroupClick:jl,handleTagRemove:yl,refreshOptions:xr,resolveOptions:cn,refreshLabels:On}}function Cx(t,e,n){const{valueProp:i,showOptions:a,searchable:r,groupLabel:o,groups:l,mode:M,groupSelect:u,disabledProp:c}=s.toRefs(t),g=n.fo,y=n.fg,d=n.handleOptionClick,j=n.handleGroupClick,f=n.search,I=n.pointer,N=n.setPointer,D=n.clearPointer,A=n.multiselect,p=n.isOpen,m=s.computed(()=>g.value.filter(B=>!B[c.value])),z=s.computed(()=>y.value.filter(B=>!B[c.value])),k=s.computed(()=>M.value!=="single"&&u.value),v=s.computed(()=>I.value&&I.value.group),Y=s.computed(()=>U(I.value)),R=s.computed(()=>{const B=v.value?I.value:U(I.value),X=z.value.map(ge=>ge[o.value]).indexOf(B[o.value]);let Ae=z.value[X-1];return Ae===void 0&&(Ae=h.value),Ae}),w=s.computed(()=>{let B=z.value.map(X=>X.label).indexOf(v.value?I.value[o.value]:U(I.value)[o.value])+1;return z.value.length<=B&&(B=0),z.value[B]}),h=s.computed(()=>[...z.value].slice(-1)[0]),E=s.computed(()=>I.value.__VISIBLE__.filter(B=>!B[c.value])[0]),C=s.computed(()=>{const B=Y.value.__VISIBLE__.filter(X=>!X[c.value]);return B[B.map(X=>X[i.value]).indexOf(I.value[i.value])-1]}),T=s.computed(()=>{const B=U(I.value).__VISIBLE__.filter(X=>!X[c.value]);return B[B.map(X=>X[i.value]).indexOf(I.value[i.value])+1]}),Q=s.computed(()=>[...R.value.__VISIBLE__.filter(B=>!B[c.value])].slice(-1)[0]),V=s.computed(()=>[...h.value.__VISIBLE__.filter(B=>!B[c.value])].slice(-1)[0]),Z=B=>!!I.value&&(!B.group&&I.value[i.value]==B[i.value]||B.group!==void 0&&I.value[o.value]==B[o.value])?!0:void 0,H=()=>{N(m.value[0]||null)},$=()=>{!I.value||I.value[c.value]===!0||(v.value?j(I.value):d(I.value))},O=()=>{if(I.value===null)N((l.value&&k.value?z.value[0]:m.value[0])||null);else if(l.value&&k.value){let B=v.value?E.value:T.value;B===void 0&&(B=w.value),N(B||null)}else{let B=m.value.map(X=>X[i.value]).indexOf(I.value[i.value])+1;m.value.length<=B&&(B=0),N(m.value[B]||null)}s.nextTick(()=>{je()})},P=()=>{if(I.value===null){let B=m.value[m.value.length-1];l.value&&k.value&&(B=V.value,B===void 0&&(B=h.value)),N(B||null)}else if(l.value&&k.value){let B=v.value?Q.value:C.value;B===void 0&&(B=v.value?R.value:Y.value),N(B||null)}else{let B=m.value.map(X=>X[i.value]).indexOf(I.value[i.value])-1;B<0&&(B=m.value.length-1),N(m.value[B]||null)}s.nextTick(()=>{je()})},U=B=>z.value.find(X=>X.__VISIBLE__.map(Ae=>Ae[i.value]).indexOf(B[i.value])!==-1),je=()=>{let B=A.value.querySelector("[data-pointed]");if(!B)return;let X=B.parentElement.parentElement;l.value&&(X=v.value?B.parentElement.parentElement.parentElement:B.parentElement.parentElement.parentElement.parentElement),B.offsetTop+B.offsetHeight>X.clientHeight+X.scrollTop&&(X.scrollTop=B.offsetTop+B.offsetHeight-X.clientHeight),B.offsetTop<X.scrollTop&&(X.scrollTop=B.offsetTop)};return s.watch(f,B=>{r.value&&(B.length&&a.value?H():D())}),s.watch(p,B=>{if(B){let X=A.value.querySelectorAll("[data-selected]")[0];if(!X)return;let Ae=X.parentElement.parentElement;s.nextTick(()=>{Ae.scrollTop>0||(Ae.scrollTop=X.offsetTop)})}}),{pointer:I,canPointGroups:k,isPointed:Z,setPointerFirst:H,selectPointer:$,forwardPointer:O,backwardPointer:P}}function wx(t,e,n){const{disabled:i}=s.toRefs(t),a=s.getCurrentInstance().proxy,r=s.ref(!1);return{isOpen:r,open:()=>{r.value||i.value||(r.value=!0,e.emit("open",a))},close:()=>{!r.value||(r.value=!1,e.emit("close",a))}}}function kx(t,e,n){const{searchable:i,disabled:a}=s.toRefs(t),r=n.input,o=n.open,l=n.close,M=n.clearSearch,u=n.isOpen,c=s.ref(null),g=s.ref(null),y=s.ref(null),d=s.ref(!1),j=s.ref(!1),f=s.computed(()=>i.value||a.value?-1:0),I=()=>{i.value&&r.value.blur(),g.value.blur()},N=()=>{i.value&&!a.value&&r.value.focus()},D=(v=!0)=>{a.value||(d.value=!0,v&&o())},A=()=>{d.value=!1,setTimeout(()=>{d.value||(l(),M())},1)};return{multiselect:c,wrapper:g,tags:y,tabindex:f,isActive:d,mouseClicked:j,blur:I,focus:N,activate:D,deactivate:A,handleFocusIn:v=>{v.target.closest("[data-tags]")||v.target.closest("[data-clear]")||D(j.value)},handleFocusOut:()=>{A()},handleCaretClick:()=>{A(),I()},handleMousedown:v=>{j.value=!0,u.value&&(v.target.isEqualNode(g.value)||v.target.isEqualNode(y.value))?setTimeout(()=>{A()},0):document.activeElement.isEqualNode(g.value)&&!u.value&&(console.log(v.target.closest("[data-tags]")),D()),setTimeout(()=>{j.value=!1},0)}}}function vx(t,e,n){const{mode:i,addTagOn:a,openDirection:r,searchable:o,showOptions:l,valueProp:M,groups:u,addOptionOn:c,createTag:g,createOption:y,reverse:d}=s.toRefs(t),j=s.getCurrentInstance().proxy,f=n.iv,I=n.update,N=n.search,D=n.setPointer,A=n.selectPointer,p=n.backwardPointer,m=n.forwardPointer,z=n.multiselect,k=n.wrapper,v=n.tags,Y=n.isOpen,R=n.open,w=n.blur,h=n.fo,E=s.computed(()=>g.value||y.value||!1),C=s.computed(()=>a.value!==void 0?a.value:c.value!==void 0?c.value:["enter"]),T=()=>{i.value==="tags"&&!l.value&&E.value&&o.value&&!u.value&&D(h.value[h.value.map(Z=>Z[M.value]).indexOf(N.value)])};return{handleKeydown:Z=>{e.emit("keydown",Z,j);let H,$;switch(["ArrowLeft","ArrowRight","Enter"].indexOf(Z.key)!==-1&&i.value==="tags"&&(H=[...z.value.querySelectorAll("[data-tags] > *")].filter(O=>O!==v.value),$=H.findIndex(O=>O===document.activeElement)),Z.key){case"Backspace":if(i.value==="single"||o.value&&[null,""].indexOf(N.value)===-1||f.value.length===0)return;I([...f.value].slice(0,-1));break;case"Enter":if(Z.preventDefault(),Z.keyCode===229)return;if($!==-1&&$!==void 0){I([...f.value].filter((O,P)=>P!==$)),$===H.length-1&&(H.length-1?H[H.length-2].focus():o.value?v.value.querySelector("input").focus():k.value.focus());return}if(C.value.indexOf("enter")===-1&&E.value)return;T(),A();break;case" ":if(!E.value&&!o.value){Z.preventDefault(),T(),A();return}if(!E.value)return!1;if(C.value.indexOf("space")===-1&&E.value)return;Z.preventDefault(),T(),A();break;case"Tab":case";":case",":if(C.value.indexOf(Z.key.toLowerCase())===-1||!E.value)return;T(),A(),Z.preventDefault();break;case"Escape":w();break;case"ArrowUp":if(Z.preventDefault(),!l.value)return;Y.value||R(),p();break;case"ArrowDown":if(Z.preventDefault(),!l.value)return;Y.value||R(),m();break;case"ArrowLeft":if(o.value&&v.value&&v.value.querySelector("input").selectionStart||Z.shiftKey||i.value!=="tags"||!f.value||!f.value.length)return;Z.preventDefault(),$===-1?H[H.length-1].focus():$>0&&H[$-1].focus();break;case"ArrowRight":if($===-1||Z.shiftKey||i.value!=="tags"||!f.value||!f.value.length)return;Z.preventDefault(),H.length>$+1?H[$+1].focus():o.value?v.value.querySelector("input").focus():o.value||k.value.focus();break}},handleKeyup:Z=>{e.emit("keyup",Z,j)},preparePointer:T}}function Qx(t,e,n){const{classes:i,disabled:a,openDirection:r,showOptions:o}=s.toRefs(t),l=n.isOpen,M=n.isPointed,u=n.isSelected,c=n.isDisabled,g=n.isActive,y=n.canPointGroups,d=n.resolving,j=n.fo,f=s.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...i.value})),I=s.computed(()=>!!(l.value&&o.value&&(!d.value||d.value&&j.value.length)));return{classList:s.computed(()=>{const D=f.value;return{container:[D.container].concat(a.value?D.containerDisabled:[]).concat(I.value&&r.value==="top"?D.containerOpenTop:[]).concat(I.value&&r.value!=="top"?D.containerOpen:[]).concat(g.value?D.containerActive:[]),wrapper:D.wrapper,spacer:D.spacer,singleLabel:D.singleLabel,singleLabelText:D.singleLabelText,multipleLabel:D.multipleLabel,search:D.search,tags:D.tags,tag:[D.tag].concat(a.value?D.tagDisabled:[]),tagRemove:D.tagRemove,tagRemoveIcon:D.tagRemoveIcon,tagsSearchWrapper:D.tagsSearchWrapper,tagsSearch:D.tagsSearch,tagsSearchCopy:D.tagsSearchCopy,placeholder:D.placeholder,caret:[D.caret].concat(l.value?D.caretOpen:[]),clear:D.clear,clearIcon:D.clearIcon,spinner:D.spinner,inifinite:D.inifinite,inifiniteSpinner:D.inifiniteSpinner,dropdown:[D.dropdown].concat(r.value==="top"?D.dropdownTop:[]).concat(!l.value||!o.value||!I.value?D.dropdownHidden:[]),options:[D.options].concat(r.value==="top"?D.optionsTop:[]),group:D.group,groupLabel:A=>{let p=[D.groupLabel];return M(A)?p.push(u(A)?D.groupLabelSelectedPointed:D.groupLabelPointed):u(A)&&y.value?p.push(c(A)?D.groupLabelSelectedDisabled:D.groupLabelSelected):c(A)&&p.push(D.groupLabelDisabled),y.value&&p.push(D.groupLabelPointable),p},groupOptions:D.groupOptions,option:(A,p)=>{let m=[D.option];return M(A)?m.push(u(A)?D.optionSelectedPointed:D.optionPointed):u(A)?m.push(c(A)?D.optionSelectedDisabled:D.optionSelected):(c(A)||p&&c(p))&&m.push(D.optionDisabled),m},noOptions:D.noOptions,noResults:D.noResults,assist:D.assist,fakeInput:D.fakeInput}}),showDropdown:I}}function _x(t,e,n){const{limit:i,infinite:a}=s.toRefs(t),r=n.isOpen,o=n.offset,l=n.search,M=n.pfo,u=n.eo,c=s.ref(null),g=s.ref(null),y=s.computed(()=>o.value<M.value.length),d=f=>{const{isIntersecting:I,target:N}=f[0];if(I){const D=N.offsetParent,A=D.scrollTop;o.value+=i.value==-1?10:i.value,s.nextTick(()=>{D.scrollTop=A})}},j=()=>{r.value&&o.value<M.value.length?c.value.observe(g.value):!r.value&&c.value&&c.value.disconnect()};return s.watch(r,()=>{!a.value||j()}),s.watch(l,()=>{!a.value||(o.value=i.value,j())},{flush:"post"}),s.watch(u,()=>{!a.value||j()},{immediate:!1,flush:"post"}),s.onMounted(()=>{window&&window.IntersectionObserver&&(c.value=new IntersectionObserver(d))}),{hasMore:y,infiniteLoader:g}}function Yx(t,e,n){const{placeholder:i,id:a,valueProp:r,label:o,mode:l,groupLabel:M,aria:u,searchable:c}=s.toRefs(t),g=n.pointer,y=n.iv,d=n.hasSelected,j=n.multipleLabelText,f=s.ref(null),I=s.computed(()=>{let h=[];return a&&a.value&&h.push(a.value),h.push("assist"),h.join("-")}),N=s.computed(()=>{let h=[];return a&&a.value&&h.push(a.value),h.push("multiselect-options"),h.join("-")}),D=s.computed(()=>{let h=[];if(a&&a.value&&h.push(a.value),g.value)return h.push(g.value.group?"multiselect-group":"multiselect-option"),h.push(g.value.group?g.value.index:g.value[r.value]),h.join("-")}),A=s.computed(()=>i.value),p=s.computed(()=>l.value!=="single"),m=s.computed(()=>{let h="";return l.value==="single"&&d.value&&(h+=y.value[o.value]),l.value==="multiple"&&d.value&&(h+=j.value),l.value==="tags"&&d.value&&(h+=y.value.map(E=>E[o.value]).join(", ")),h}),z=s.computed(()=>{let h={...u.value};return c.value&&(h["aria-labelledby"]=h["aria-labelledby"]?`${I.value} ${h["aria-labelledby"]}`:I.value,m.value&&h["aria-label"]&&(h["aria-label"]=`${m.value}, ${h["aria-label"]}`)),h}),k=h=>{let E=[];return a&&a.value&&E.push(a.value),E.push("multiselect-option"),E.push(h[r.value]),E.join("-")},v=h=>{let E=[];return a&&a.value&&E.push(a.value),E.push("multiselect-group"),E.push(h.index),E.join("-")},Y=h=>{let E=[];return E.push(h[o.value]),E.join(" ")},R=h=>{let E=[];return E.push(h[M.value]),E.join(" ")},w=h=>`${h} \u274E`;return s.onMounted(()=>{if(a&&a.value&&document&&document.querySelector){let h=document.querySelector(`[for="${a.value}"]`);f.value=h?h.innerText:null}}),{arias:z,ariaLabel:m,ariaAssist:I,ariaControls:N,ariaPlaceholder:A,ariaMultiselectable:p,ariaActiveDescendant:D,ariaOptionId:k,ariaOptionLabel:Y,ariaGroupId:v,ariaGroupLabel:R,ariaTagLabel:w}}function Ux(t,e,n,i={}){return n.forEach(a=>{a&&(i={...i,...a(t,e,i)})}),i}var Nl={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(t,e){return Ux(t,e,[Lx,Ox,wx,xx,Tx,kx,bx,_x,Cx,vx,Qx,Yx])}};const Px=["id","dir"],Rx=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Zx=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Bx=["onKeyup","aria-label"],Vx=["onClick"],Gx=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Wx=["innerHTML"],$x=["id"],Hx=["id","aria-label","aria-selected"],Fx=["data-pointed","onMouseenter","onClick"],Jx=["innerHTML"],Xx=["aria-label"],Kx=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],qx=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],eO=["innerHTML"],tO=["innerHTML"],nO=["value"],iO=["name","value"],aO=["name","value"],rO=["id"];function oO(t,e,n,i,a,r){return s.openBlock(),s.createElementBlock("div",{ref:"multiselect",class:s.normalizeClass(t.classList.container),id:n.searchable?void 0:n.id,dir:n.rtl?"rtl":void 0,onFocusin:e[10]||(e[10]=(...o)=>t.handleFocusIn&&t.handleFocusIn(...o)),onFocusout:e[11]||(e[11]=(...o)=>t.handleFocusOut&&t.handleFocusOut(...o)),onKeyup:e[12]||(e[12]=(...o)=>t.handleKeyup&&t.handleKeyup(...o)),onKeydown:e[13]||(e[13]=(...o)=>t.handleKeydown&&t.handleKeydown(...o))},[s.createElementVNode("div",s.mergeProps({class:t.classList.wrapper,onMousedown:e[9]||(e[9]=(...o)=>t.handleMousedown&&t.handleMousedown(...o)),ref:"wrapper",tabindex:t.tabindex,"aria-controls":n.searchable?void 0:t.ariaControls,"aria-placeholder":n.searchable?void 0:t.ariaPlaceholder,"aria-expanded":n.searchable?void 0:t.isOpen,"aria-activedescendant":n.searchable?void 0:t.ariaActiveDescendant,"aria-multiselectable":n.searchable?void 0:t.ariaMultiselectable,role:n.searchable?void 0:"combobox"},n.searchable?{}:t.arias),[s.createCommentVNode(" Search "),n.mode!=="tags"&&n.searchable&&!n.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:n.inputType,modelValue:t.search,value:t.search,class:t.classList.search,autocomplete:n.autocomplete,id:n.searchable?n.id:void 0,onInput:e[0]||(e[0]=(...o)=>t.handleSearchInput&&t.handleSearchInput(...o)),onKeypress:e[1]||(e[1]=(...o)=>t.handleKeypress&&t.handleKeypress(...o)),onPaste:e[2]||(e[2]=s.withModifiers((...o)=>t.handlePaste&&t.handlePaste(...o),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...n.attrs,...t.arias}),null,16,Zx)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Tags (with search) "),n.mode=="tags"?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.classList.tags),"data-tags":""},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.iv,(o,l,M)=>s.renderSlot(t.$slots,"tag",{option:o,handleTagRemove:t.handleTagRemove,disabled:n.disabled},()=>[(s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(t.classList.tag),tabindex:"-1",onKeyup:s.withKeys(u=>t.handleTagRemove(o,u),["enter"]),key:M,"aria-label":t.ariaTagLabel(o[n.label])},[s.createTextVNode(s.toDisplayString(o[n.label])+" ",1),n.disabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(t.classList.tagRemove),onClick:u=>t.handleTagRemove(o,u)},[s.createElementVNode("span",{class:s.normalizeClass(t.classList.tagRemoveIcon)},null,2)],10,Vx))],42,Bx))])),256)),s.createElementVNode("div",{class:s.normalizeClass(t.classList.tagsSearchWrapper),ref:"tags"},[s.createCommentVNode(" Used for measuring search width "),s.createElementVNode("span",{class:s.normalizeClass(t.classList.tagsSearchCopy)},s.toDisplayString(t.search),3),s.createCommentVNode(" Actual search input "),n.searchable&&!n.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:n.inputType,modelValue:t.search,value:t.search,class:t.classList.tagsSearch,id:n.searchable?n.id:void 0,autocomplete:n.autocomplete,onInput:e[3]||(e[3]=(...o)=>t.handleSearchInput&&t.handleSearchInput(...o)),onKeypress:e[4]||(e[4]=(...o)=>t.handleKeypress&&t.handleKeypress(...o)),onPaste:e[5]||(e[5]=s.withModifiers((...o)=>t.handlePaste&&t.handlePaste(...o),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...n.attrs,...t.arias}),null,16,Gx)):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Single label "),n.mode=="single"&&t.hasSelected&&!t.search&&t.iv?s.renderSlot(t.$slots,"singlelabel",{key:2,value:t.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.singleLabel)},[s.createElementVNode("span",{class:s.normalizeClass(t.classList.singleLabelText)},s.toDisplayString(t.iv[n.label]),3)],2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Multiple label "),n.mode=="multiple"&&t.hasSelected&&!t.search?s.renderSlot(t.$slots,"multiplelabel",{key:3,values:t.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.multipleLabel),innerHTML:t.multipleLabelText},null,10,Wx)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Placeholder "),n.placeholder&&!t.hasSelected&&!t.search?s.renderSlot(t.$slots,"placeholder",{key:4},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.placeholder),"aria-hidden":"true"},s.toDisplayString(n.placeholder),3)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Spinner "),n.loading||t.resolving?s.renderSlot(t.$slots,"spinner",{key:5},()=>[s.createElementVNode("span",{class:s.normalizeClass(t.classList.spinner),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Clear "),t.hasSelected&&!n.disabled&&n.canClear&&!t.busy?s.renderSlot(t.$slots,"clear",{key:6,clear:t.clear},()=>[s.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"\u274E",class:s.normalizeClass(t.classList.clear),onClick:e[6]||(e[6]=(...o)=>t.clear&&t.clear(...o)),onKeyup:e[7]||(e[7]=s.withKeys((...o)=>t.clear&&t.clear(...o),["enter"]))},[s.createElementVNode("span",{class:s.normalizeClass(t.classList.clearIcon)},null,2)],34)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Caret "),n.caret&&n.showOptions?s.renderSlot(t.$slots,"caret",{key:7},()=>[s.createElementVNode("span",{class:s.normalizeClass(t.classList.caret),onClick:e[8]||(e[8]=(...o)=>t.handleCaretClick&&t.handleCaretClick(...o)),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0)],16,Rx),s.createCommentVNode(" Options "),s.createElementVNode("div",{class:s.normalizeClass(t.classList.dropdown),tabindex:"-1"},[s.renderSlot(t.$slots,"beforelist",{options:t.fo}),s.createElementVNode("ul",{class:s.normalizeClass(t.classList.options),id:t.ariaControls,role:"listbox"},[n.groups?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(t.fg,(o,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(t.classList.group),key:M,id:t.ariaGroupId(o),"aria-label":t.ariaGroupLabel(o),"aria-selected":t.isSelected(o),role:"option"},[s.createElementVNode("div",{class:s.normalizeClass(t.classList.groupLabel(o)),"data-pointed":t.isPointed(o),onMouseenter:u=>t.setPointer(o,l),onClick:u=>t.handleGroupClick(o)},[s.renderSlot(t.$slots,"grouplabel",{group:o,isSelected:t.isSelected,isPointed:t.isPointed},()=>[s.createElementVNode("span",{innerHTML:o[n.groupLabel]},null,8,Jx)])],42,Fx),s.createElementVNode("ul",{class:s.normalizeClass(t.classList.groupOptions),"aria-label":t.ariaGroupLabel(o),role:"group"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.__VISIBLE__,(u,c,g)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(t.classList.option(u,o)),"data-pointed":t.isPointed(u),"data-selected":t.isSelected(u)||void 0,key:g,onMouseenter:y=>t.setPointer(u),onClick:y=>t.handleOptionClick(u),id:t.ariaOptionId(u),"aria-selected":t.isSelected(u),"aria-label":t.ariaOptionLabel(u),role:"option"},[s.renderSlot(t.$slots,"option",{option:u,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},()=>[s.createElementVNode("span",null,s.toDisplayString(u[n.label]),1)])],42,Kx))),128))],10,Xx)],10,Hx))),128)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(t.fo,(o,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(t.classList.option(o)),"data-pointed":t.isPointed(o),"data-selected":t.isSelected(o)||void 0,key:M,onMouseenter:u=>t.setPointer(o),onClick:u=>t.handleOptionClick(o),id:t.ariaOptionId(o),"aria-selected":t.isSelected(o),"aria-label":t.ariaOptionLabel(o),role:"option"},[s.renderSlot(t.$slots,"option",{option:o,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},()=>[s.createElementVNode("span",null,s.toDisplayString(o[n.label]),1)])],42,qx))),128))],10,$x),t.noOptions?s.renderSlot(t.$slots,"nooptions",{key:0},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.noOptions),innerHTML:n.noOptionsText},null,10,eO)]):s.createCommentVNode("v-if",!0),t.noResults?s.renderSlot(t.$slots,"noresults",{key:1},()=>[s.createElementVNode("div",{class:s.normalizeClass(t.classList.noResults),innerHTML:n.noResultsText},null,10,tO)]):s.createCommentVNode("v-if",!0),n.infinite&&t.hasMore?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.classList.inifinite),ref:"infiniteLoader"},[s.renderSlot(t.$slots,"infinite",{},()=>[s.createElementVNode("span",{class:s.normalizeClass(t.classList.inifiniteSpinner)},null,2)])],2)):s.createCommentVNode("v-if",!0),s.renderSlot(t.$slots,"afterlist",{options:t.fo})],2),s.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(s.openBlock(),s.createElementBlock("input",{key:0,class:s.normalizeClass(t.classList.fakeInput),tabindex:"-1",value:t.textValue,required:""},null,10,nO)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Native input support "),n.nativeSupport?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[n.mode=="single"?(s.openBlock(),s.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:t.plainValue!==void 0?t.plainValue:""},null,8,iO)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(t.plainValue,(o,l)=>(s.openBlock(),s.createElementBlock("input",{type:"hidden",name:`${n.name}[]`,value:o,key:l},null,8,aO))),128))],64)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Screen reader assistive text "),n.searchable&&t.hasSelected?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.classList.assist),id:t.ariaAssist,"aria-hidden":"true"},s.toDisplayString(t.ariaLabel),11,rO)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Create height for empty input "),s.createElementVNode("div",{class:s.normalizeClass(t.classList.spacer)},null,2)],42,Px)}Nl.render=oO,Nl.__file="src/Multiselect.vue";var QO="",_O="";const sO=s.createElementVNode("img",{alt:"",class:"list__item_thumb",src:px},null,-1),lO={class:"list__item_text"},MO=s.createElementVNode("div",{id:"list"},null,-1),uO={__name:"InputList",props:{list:{type:Array,required:!0}},setup(t){const e=s.ref(null);return(n,i)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(s.unref(Nl),{modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=a=>e.value=a),mode:"tags",options:t.list,placeholder:"Start typing a name",searchable:!0},{tag:s.withCtx(({option:a,handleTagRemove:r,disabled:o})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#list"},[s.createElementVNode("div",{class:s.normalizeClass(["list__item",{"is-disabled":o}])},[sO,s.createElementVNode("p",lO,s.toDisplayString(a.value),1),s.createVNode(Ie,{class:"list__item_icon","icon-name":"delete",size:24,onClick:l=>r(a,l)},null,8,["onClick"]),s.renderSlot(n.$slots,"default")],2)]))]),_:3},8,["modelValue","options"]),MO],64))}};fe.DhAdvancedFilter=Dl,fe.DhDatePicker=rA,fe.DhDropdownMenu=Dx,fe.DhError=sA,fe.DhExpansionPanel=dx,fe.DhFileUpload=TA,fe.DhIcon=Ie,fe.DhInputDropdown=zx,fe.DhInputList=uO,fe.DhModal=bA,fe.DhNotification=BA,fe.DhNumberRange=wL,fe.DhPasswordField=YL,fe.DhRadioBox=_g,fe.DhRadioBoxGroup=BL,fe.DhSearchInput=WL,fe.DhStepper=JL,fe.DhSwitch=nx,fe.DhTooltip=lx,fe.DhVerificationCode=ux,Object.defineProperties(fe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|