brilliance-admin 0.44.12__py3-none-any.whl → 0.44.13__py3-none-any.whl

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.
@@ -521,5 +521,5 @@ Please report this to https://github.com/markedjs/marked.`,t.silent)return"<p>An
521
521
  * Released under the MIT License
522
522
  */class k0n{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=XMe.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var hm=new k0n;const Aue="transparent",S0n={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=yue(e||Aue),i=r.valid&&yue(t||Aue);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class C0n{constructor(t,n,r,i){const s=n[r];i=gP([t.to,i,s,t.from]);const o=gP([t.from,s,i]);this._active=!0,this._fn=t.fn||S0n[t.type||typeof o],this._easing=RS[t.easing]||RS.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=gP([t.to,n,i,t.from]),this._from=gP([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class g3e{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!pi(t))return;const n=Object.keys(jo.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!pi(s))return;const o={};for(const a of n)o[a]=s[a];(so(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=T0n(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&$0n(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=s[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=d=new C0n(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return hm.add(this._chart,r),!0}}function $0n(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function T0n(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Eue(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function A0n(e,t,n){if(n===!1)return!1;const r=Eue(e,n),i=Eue(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function E0n(e){let t,n,r,i;return pi(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function v3e(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Pue(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(r.all)continue;break}c=e.values[l],Ro(c)&&(s||t===0||up(t)===up(c))&&(t+=c)}return t}}function P0n(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function Oue(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function O0n(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function M0n(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function R0n(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Mue(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function Rue(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=O0n(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[l]:m,[c]:v}=p,y=p._stacks||(p._stacks={});f=y[c]=R0n(i,u,m),f[a]=v,f._top=Mue(f,o,!0,r.type),f._bottom=Mue(f,o,!1,r.type);const _=f._visualValues||(f._visualValues={});_[a]=v}}function e8(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function j0n(e,t){return B0(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function I0n(e,t,n){return B0(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _k(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const t8=e=>e==="reset"||e==="none",jue=(e,t)=>t?e:Object.assign({},e),D0n=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:v3e(n,!0),values:null};class Xf{constructor(t,n){this.chart=t,this._ctx=t.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.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Oue(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_k(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,s=n.xAxisID=Lr(r.xAxisID,e8(t,"x")),o=n.yAxisID=Lr(r.yAxisID,e8(t,"y")),a=n.rAxisID=Lr(r.rAxisID,e8(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&mue(this._data,this),t._stacked&&_k(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(pi(n)){const i=this._cachedMeta;this._data=P0n(n,i)}else if(r!==n){if(r){mue(r,this);const i=this._cachedMeta;_k(i),i._parsed=[]}n&&Object.isExtensible(n)&&_vn(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Oue(n.vScale,n),n.stack!==r.stack&&(i=!0,_k(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&Rue(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{so(i[t])?f=this.parseArrayData(r,i,t,n):pi(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}o&&Rue(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,d=new Array(i);let f,h,p;for(f=0,h=i;f<h;++f)p=f+r,d[f]={[a]:u||s.parse(c[p],p),[l]:o.parse(n[p],p)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:s.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,h;for(u=0,d=i;u<d;++u)f=u+r,h=n[f],c[u]={x:s.parse(h0(h,a),f),y:o.parse(h0(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:v3e(i,!0),values:n._stacks[t.axis]._visualValues};return Pue(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Pue(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=D0n(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=M0n(a);let f,h;function p(){h=i[f];const m=h[a.axis];return!Ro(h[t.axis])||u>m||d<m}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],Ro(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=E0n(Lr(this.options.clip,A0n(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=I0n(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=j0n(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&g$(r);if(a)return jue(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(jo.elements[t]),p=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(jue(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new g3e(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||t8(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){t8(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!t8(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&_k(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}E(Xf,"defaults",{}),E(Xf,"datasetElementType",null),E(Xf,"dataElementType",null);function L0n(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,s=n.length;i<s;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=JMe(r.sort((i,s)=>i-s))}return e._cache.$bar}function N0n(e){const t=e.iScale,n=L0n(t,e.type);let r=t._length,i,s,o,a;const l=()=>{o===32767||o===-32768||(g$(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(i=0,s=n.length;i<s;++i)o=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,s=t.ticks.length;i<s;++i)o=t.getPixelForTick(i),l();return r}function F0n(e,t,n,r){const i=n.barThickness;let s,o;return Yi(i)?(s=t.min*n.categoryPercentage,o=n.barPercentage):(s=i*r,o=1),{chunk:s/r,ratio:o,start:t.pixels[e]-s/2}}function B0n(e,t,n,r){const i=t.pixels,s=i[e];let o=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;o===null&&(o=s-(a===null?t.end-t.start:a-s)),a===null&&(a=s+s-o);const c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:c}}function V0n(e,t,n,r){const i=n.parse(e[0],r),s=n.parse(e[1],r),o=Math.min(i,s),a=Math.max(i,s);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:s,min:o,max:a}}function y3e(e,t,n,r){return so(e)?V0n(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Iue(e,t,n,r){const i=e.iScale,s=e.vScale,o=i.getLabels(),a=i===s,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[i.axis]=a||i.parse(o[c],c),l.push(y3e(f,d,s,c));return l}function n8(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function z0n(e,t,n){return e!==0?up(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function W0n(e){let t,n,r,i,s;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",s="start"):(i="start",s="end"),{start:n,end:r,reverse:t,top:i,bottom:s}}function H0n(e,t,n,r){let i=t.borderSkipped;const s={};if(!i){e.borderSkipped=s;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=W0n(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(s[Due(u,o,a,l)]=!0,i=c)),s[Due(i,o,a,l)]=!0,e.borderSkipped=s}function Due(e,t,n,r){return r?(e=U0n(e,t,n),e=Lue(e,n,t)):e=Lue(e,t,n),e}function U0n(e,t,n){return e===t?n:e===n?t:e}function Lue(e,t,n){return e==="start"?t:e==="end"?n:e}function q0n(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class SO extends Xf{parsePrimitiveData(t,n,r,i){return Iue(t,n,r,i)}parseArrayData(t,n,r,i){return Iue(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:s,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=s.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let f,h,p,m;for(f=r,h=r+i;f<h;++f)m=n[f],p={},p[s.axis]=s.parse(h0(m,c),f),d.push(y3e(h0(m,u),p,o,f));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const s=r._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,s=this.getParsed(t),o=s._custom,a=n8(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const s=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=s||Yi(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),v=this._calculateBarIndexPixels(h,u),y=(p._stacks||{})[a.axis],_={horizontal:c,base:m.base,enableBorderRadius:!y||n8(p._custom)||o===y._top||o===y._bottom,x:c?m.head:v.center,y:c?v.center:m.head,height:c?v.size:Math.abs(m.size),width:c?Math.abs(m.size):v.size};f&&(_.options=d||this.resolveDataElementOptions(h,t[h].active?"active":i));const b=_.options||t[h].options;H0n(_,b,y,o),q0n(_,b,u.ratio),this.updateElement(t[h],h,_,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),s=r.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Yi(u)||isNaN(u))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((s===!1||o.indexOf(l.stack)===-1||s===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let s,o;for(s=0,o=n.data.length;s<o;++s)i.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const a=t.barThickness;return{min:a||N0n(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:s,minBarLength:o}}=this,a=s||0,l=this.getParsed(t),c=l._custom,u=n8(c);let d=l[n.axis],f=0,h=r?this.applyStack(n,l,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&up(d)!==up(c.barEnd)&&(f=0),f+=d);const v=!Yi(s)&&!u?s:f;let y=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=y,m=p-y,Math.abs(m)<o){m=z0n(m,n,a)*o,d===a&&(y-=m/2);const _=n.getPixelForDecimal(0),b=n.getPixelForDecimal(1),x=Math.min(_,b),k=Math.max(_,b);y=Math.max(Math.min(y,k),x),p=y+m,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(p)-n.getValueForPixel(y))}if(y===n.getPixelForValue(a)){const _=up(m)*n.getLineWidthForValue(a)/2;y+=_,m-=_}return{size:m,base:y,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,s=i.skipNull,o=Lr(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=s?this._getStackCount(t):n.stackCount,u=i.barThickness==="flex"?B0n(t,n,i,c):F0n(t,n,i,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}E(SO,"id","bar"),E(SO,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),E(SO,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class CO extends Xf{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const s=super.parsePrimitiveData(t,n,r,i);for(let o=0;o<s.length;o++)s[o]._custom=this.resolveDataElementOptions(o+r).radius;return s}parseArrayData(t,n,r,i){const s=super.parseArrayData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Lr(a[2],this.resolveDataElementOptions(o+r).radius)}return s}parseObjectData(t,n,r,i){const s=super.parseObjectData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Lr(a&&a.r&&+a.r,this.resolveDataElementOptions(o+r).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y),c=o._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=o.axis,d=a.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!s&&this.getParsed(f),m={},v=m[u]=s?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),y=m[d]=s?a.getBasePixel():a.getPixelForValue(p[d]);m.skip=isNaN(v)||isNaN(y),c&&(m.options=l||this.resolveDataElementOptions(f,h.active?"active":i),s&&(m.options.radius=0)),this.updateElement(h,f,m,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const s=i.radius;return n!=="active"&&(i.radius=0),i.radius+=Lr(r&&r._custom,s),i}}E(CO,"id","bubble"),E(CO,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),E(CO,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Y0n(e,t,n){let r=1,i=1,s=0,o=0;if(t<Na){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),h=(b,x,k)=>e5(b,a,l,!0)?1:Math.max(x,x*n,k,k*n),p=(b,x,k)=>e5(b,a,l,!0)?-1:Math.min(x,x*n,k,k*n),m=h(0,c,d),v=h(pc,u,f),y=p(yo,c,d),_=p(yo+pc,u,f);r=(m-y)/2,i=(v-_)/2,s=-(m+y)/2,o=-(v+_)/2}return{ratioX:r,ratioY:i,offsetX:s,offsetY:o}}class Fw extends Xf{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let s=l=>+r[l];if(pi(r[t])){const{key:l="value"}=this._parsing;s=c=>+h0(r[c],l)}let o,a;for(o=t,a=t+n;o<a;++o)i._parsed[o]=s(o)}}_getRotation(){return Vf(this.options.rotation-90)}_getCircumference(){return Vf(this.options.circumference)}_getRotationExtents(){let t=Na,n=-Na;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,s=i._getRotation(),o=i._getCircumference();t=Math.min(t,s),n=Math.max(n,s+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,s=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(ovn(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=Y0n(d,u,l),v=(r.width-o)/f,y=(r.height-o)/h,_=Math.max(Math.min(v,y)/2,0),b=qMe(this.options.radius,_),x=Math.max(b*l,0),k=(b-x)/this._getVisibleDatasetWeightTotal();this.offsetX=p*b,this.offsetY=m*b,i.total=this.calculateTotal(),this.outerRadius=b-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*c,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,s=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*s/Na)}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=s&&c.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:v}=this._getSharedOptions(n,i);let y=this._getRotation(),_;for(_=0;_<n;++_)y+=this._circumference(_,s);for(_=n;_<n+r;++_){const b=this._circumference(_,s),x=t[_],k={x:u+this.offsetX,y:d+this.offsetY,startAngle:y,endAngle:y+b,circumference:b,outerRadius:p,innerRadius:h};v&&(k.options=m||this.resolveDataElementOptions(_,x.active?"active":i)),y+=b,this.updateElement(x,_,k,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const s=t._parsed[i];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Na*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=BT(n._parsed[t],r.options.locale);return{label:i[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,s,o,a,l;if(!t){for(i=0,s=r.data.datasets.length;i<s;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,a=o.controller;break}}if(!t)return 0;for(i=0,s=t.length;i<s;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const s=this.resolveDataElementOptions(r);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Lr(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}E(Fw,"id","doughnut"),E(Fw,"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"}),E(Fw,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),E(Fw,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((s,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class $O extends Xf{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=QMe(n,i,o);this._drawStart=a,this._drawCount=l,e3e(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:p,segment:m}=this.options,v=p2(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none",_=n+r,b=t.length;let x=n>0&&this.getParsed(n-1);for(let k=0;k<b;++k){const C=t[k],S=y?C:{};if(k<n||k>=_){S.skip=!0;continue}const A=this.getParsed(k),T=Yi(A[h]),O=S[f]=o.getPixelForValue(A[f],k),F=S[h]=s||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[h],k);S.skip=isNaN(O)||isNaN(F)||T,S.stop=k>0&&Math.abs(A[f]-x[f])>v,m&&(S.parsed=A,S.raw=c.data[k]),d&&(S.options=u||this.resolveDataElementOptions(k,C.active?"active":i)),y||this.updateElement(C,k,S,i),x=A}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}E($O,"id","line"),E($O,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),E($O,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class TO extends Xf{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=BT(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:s}}parseObjectData(t,n,r,i){return c3e.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(i/2,0),o=Math.max(r.cutoutPercentage?s/100*r.cutoutPercentage:1,0),a=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*yo;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,i,m);for(p=n;p<n+r;p++){const v=t[p];let y=h,_=h+this._computeAngle(p,i,m),b=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=_,s&&(l.animateScale&&(b=0),l.animateRotate&&(y=_=f));const x={x:u,y:d,innerRadius:0,outerRadius:b,startAngle:y,endAngle:_,options:this.resolveDataElementOptions(p,v.active?"active":i)};this.updateElement(v,p,x,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Vf(this.resolveDataElementOptions(t,n).angle||r):0}}E(TO,"id","polarArea"),E(TO,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),E(TO,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((s,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class RF extends Fw{}E(RF,"id","pie"),E(RF,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class AO extends Xf{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return c3e.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:u.x,f=o?s.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,h,i)}}}E(AO,"id","radar"),E(AO,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),E(AO,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class EO extends Xf{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:o}=QMe(n,r,i);if(this._drawStart=s,this._drawCount=o,e3e(n)&&(s=0,o=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,s,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),d=this.getSharedOptions(u),f=this.includeOptions(i,d),h=o.axis,p=a.axis,{spanGaps:m,segment:v}=this.options,y=p2(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||s||i==="none";let b=n>0&&this.getParsed(n-1);for(let x=n;x<n+r;++x){const k=t[x],C=this.getParsed(x),S=_?k:{},A=Yi(C[p]),T=S[h]=o.getPixelForValue(C[h],x),O=S[p]=s||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,C,l):C[p],x);S.skip=isNaN(T)||isNaN(O)||A,S.stop=x>0&&Math.abs(C[h]-b[h])>y,v&&(S.parsed=C,S.raw=c.data[x]),f&&(S.options=d||this.resolveDataElementOptions(x,k.active?"active":i)),_||this.updateElement(k,x,S,i),b=C}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}}E(EO,"id","scatter"),E(EO,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),E(EO,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function w1(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Iq{constructor(t){E(this,"options");this.options=t||{}}static override(t){Object.assign(Iq.prototype,t)}init(){}formats(){return w1()}parse(){return w1()}format(){return w1()}add(){return w1()}diff(){return w1()}startOf(){return w1()}endOf(){return w1()}}var G0n={_date:Iq};function K0n(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const l=a._reversePixels?bvn:q1;if(r){if(i._sharedOptions){const c=s[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(s,t,n-u),f=l(s,t,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(s,t,n)}return{lo:0,hi:s.length-1}}function VT(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:d,hi:f}=K0n(s[a],t,o,i);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,c,h)}}}function J0n(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function r8(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||VT(e,n,t,function(a,l,c){!i&&!Rm(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function X0n(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=gvn(o,{x:t.x,y:t.y});e5(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return VT(e,n,t,s),i}function Z0n(e,t,n,r,i,s){let o=[];const a=J0n(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const p=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(p))&&!h)return;const v=a(t,p);v<l?(o=[{element:u,datasetIndex:d,index:f}],l=v):v===l&&o.push({element:u,datasetIndex:d,index:f})}return VT(e,n,t,c),o}function i8(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?X0n(e,t,n,i):Z0n(e,t,n,r,i,s)}function Nue(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return VT(e,n,t,(l,c,u)=>{l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var Q0n={evaluateInteractionItems:VT,modes:{index(e,t,n,r){const i=$1(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?r8(e,i,s,r,o):i8(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=$1(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?r8(e,i,s,r,o):i8(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=$1(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return r8(e,i,s,r,o)},nearest(e,t,n,r){const i=$1(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return i8(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=$1(t,e);return Nue(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=$1(t,e);return Nue(e,i,"y",n.intersect,r)}}};const b3e=["left","top","right","bottom"];function xk(e,t){return e.filter(n=>n.pos===t)}function Fue(e,t){return e.filter(n=>b3e.indexOf(n.pos)===-1&&n.box.axis===t)}function kk(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function e1n(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function t1n(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!b3e.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function n1n(e,t){const n=t1n(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function r1n(e){const t=e1n(e),n=kk(t.filter(c=>c.box.fullSize),!0),r=kk(xk(t,"left"),!0),i=kk(xk(t,"right")),s=kk(xk(t,"top"),!0),o=kk(xk(t,"bottom")),a=Fue(t,"x"),l=Fue(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:xk(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Bue(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function w3e(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function i1n(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!pi(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&w3e(o,s.getPadding());const a=Math.max(0,t.outerWidth-Bue(o,e,"left","right")),l=Math.max(0,t.outerHeight-Bue(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function s1n(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function o1n(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function Bk(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,o1n(a.horizontal,t));const{same:d,other:f}=i1n(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&Bk(i,t,n,r)||u}function bP(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Vue(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;g$(c.start)&&(o=c.start),l.fullSize?bP(l,i.left,o,n.outerWidth-i.right-i.left,f):bP(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;g$(c.start)&&(s=c.start),l.fullSize?bP(l,s,i.top,f,n.outerHeight-i.bottom-i.top):bP(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var Od={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Ul(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=r1n(e.boxes),l=a.vertical,c=a.horizontal;rs(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);w3e(f,Ul(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),p=n1n(l.concat(c),d);Bk(a.fullSize,h,d,p),Bk(l,h,d,p),Bk(c,h,d,p)&&Bk(l,h,d,p),s1n(h),Vue(a.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,Vue(a.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},rs(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class _3e{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class a1n extends _3e{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const PO="$chartjs",l1n={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},zue=e=>e===null||e==="";function c1n(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[PO]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",zue(i)){const s=Sue(e,"width");s!==void 0&&(e.width=s)}if(zue(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Sue(e,"height");s!==void 0&&(e.height=s)}return e}const x3e=f0n?{passive:!0}:!1;function u1n(e,t,n){e&&e.addEventListener(t,n,x3e)}function d1n(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,x3e)}function f1n(e,t){const n=l1n[e.type]||e.type,{x:r,y:i}=$1(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function r5(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function h1n(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||r5(a.addedNodes,r),o=o&&!r5(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function p1n(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||r5(a.removedNodes,r),o=o&&!r5(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const y$=new Map;let Wue=0;function k3e(){const e=window.devicePixelRatio;e!==Wue&&(Wue=e,y$.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function m1n(e,t){y$.size||window.addEventListener("resize",k3e),y$.set(e,t)}function g1n(e){y$.delete(e),y$.size||window.removeEventListener("resize",k3e)}function v1n(e,t,n){const r=e.canvas,i=r&&jq(r);if(!i)return;const s=ZMe((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),m1n(e,s),o}function s8(e,t,n){n&&n.disconnect(),t==="resize"&&g1n(e)}function y1n(e,t,n){const r=e.canvas,i=ZMe(s=>{e.ctx!==null&&n(f1n(s,e))},e);return u1n(r,t,i),i}class b1n extends _3e{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(c1n(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[PO])return!1;const r=n[PO].initial;["height","width"].forEach(s=>{const o=r[s];Yi(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[PO],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:h1n,detach:p1n,resize:v1n}[n]||y1n;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:s8,detach:s8,resize:s8}[n]||d1n)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return d0n(t,n,r,i)}isAttached(t){const n=t&&jq(t);return!!(n&&n.isConnected)}}function w1n(e){return!Rq()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?a1n:b1n}var TP;let V0=(TP=class{constructor(){E(this,"x");E(this,"y");E(this,"active",!1);E(this,"options");E(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return p2(this.x)&&p2(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},E(TP,"defaults",{}),E(TP,"defaultRoutes"),TP);function _1n(e,t){const n=e.options.ticks,r=x1n(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?S1n(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return C1n(t,c,s,o/i),c;const u=k1n(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(wP(t,c,u,Yi(h)?0:a-h,a),d=0,f=o-1;d<f;d++)wP(t,c,u,s[d],s[d+1]);return wP(t,c,u,l,Yi(h)?t.length:l+h),c}return wP(t,c,u),c}function x1n(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function k1n(e,t,n){const r=$1n(e),i=t.length/n;if(!r)return Math.max(i,1);const s=pvn(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function S1n(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function C1n(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function wP(e,t,n,r,i){const s=Lr(r,0),o=Math.min(Lr(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function $1n(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const T1n=e=>e==="left"?"right":e==="right"?"left":e,Hue=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Uue=(e,t)=>Math.min(t||e,e);function que(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function A1n(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function E1n(e,t){rs(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function Sk(e){return e.drawTicks?e.tickLength:0}function Yue(e,t){if(!e.display)return 0;const n=_a(e.font,t),r=Ul(e.padding);return(so(e.text)?e.text.length:1)*n.lineHeight+r.height}function P1n(e,t){return B0(e,{scale:t,type:"scale"})}function O1n(e,t,n){return B0(e,{tick:n,index:t,type:"tick"})}function M1n(e,t,n){let r=Aq(e);return(n&&t!=="right"||!n&&t==="right")&&(r=T1n(r)),r}function R1n(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,p;const m=o-i,v=a-s;if(e.isHorizontal()){if(h=Cl(r,s,a),pi(n)){const y=Object.keys(n)[0],_=n[y];p=u[y].getPixelForValue(_)+m-t}else n==="center"?p=(c.bottom+c.top)/2+m-t:p=Hue(e,n,t);f=a-s}else{if(pi(n)){const y=Object.keys(n)[0],_=n[y];h=u[y].getPixelForValue(_)-v+t}else n==="center"?h=(c.left+c.right)/2-v+t:h=Hue(e,n,t);p=Cl(r,o,i),d=n==="left"?-pc:pc}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class yb extends V0{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=xu(t,Number.POSITIVE_INFINITY),n=xu(n,Number.NEGATIVE_INFINITY),r=xu(r,Number.POSITIVE_INFINITY),i=xu(i,Number.NEGATIVE_INFINITY),{min:xu(t,r),max:xu(n,i),minDefined:Ro(t),maxDefined:Ro(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:xu(n,xu(r,n)),max:xu(r,xu(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ps(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Wvn(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?que(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=_1n(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ps(this.options.afterUpdate,[this])}beforeSetDimensions(){Ps(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(){Ps(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ps(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ps(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=Ps(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){Ps(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ps(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Uue(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=Lu(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-Sk(t.grid)-n.padding-Yue(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=$q(Math.min(Math.asin(Lu((u.highest.height+6)/a,-1,1)),Math.asin(Lu(l/c,-1,1))-Math.asin(Lu(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ps(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ps(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Yue(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Sk(s)+l):(t.height=this.maxHeight,t.width=Sk(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=Vf(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=r.mirror?0:v*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+y+h)}else{const y=r.mirror?0:m*d.width+v*f.height;t.width=Math.min(this.maxWidth,t.width+y+h)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;s==="start"?(u=0,d=t.height):s==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+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(){Ps(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Yi(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=que(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/Uue(n,r));let c=0,u=0,d,f,h,p,m,v,y,_,b,x,k;for(d=0;d<n;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),i.font=v=m.string,y=s[v]=s[v]||{data:{},gc:[]},_=m.lineHeight,b=x=0,!Yi(p)&&!so(p))b=t5(i,y.data,y.gc,b,p),x=_;else if(so(p))for(f=0,h=p.length;f<h;++f)k=p[f],!Yi(k)&&!so(k)&&(b=t5(i,y.data,y.gc,b,k),x+=_);o.push(b),a.push(x),c=Math.max(b,c),u=Math.max(x,u)}E1n(s,n);const C=o.indexOf(c),S=a.indexOf(u),A=T=>({width:o[T]||0,height:a[T]||0});return{first:A(0),last:A(n-1),widest:A(C),highest:A(S),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return yvn(this._alignToPixels?b1(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=O1n(this.getContext(),t,r))}return this.$context||(this.$context=P1n(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Vf(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Sk(s),h=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(B){return b1(r,B,m)};let _,b,x,k,C,S,A,T,O,F,P,L;if(o==="top")_=y(this.bottom),S=this.bottom-f,T=_-v,F=y(t.top)+v,L=t.bottom;else if(o==="bottom")_=y(this.top),F=t.top,L=y(t.bottom)-v,S=_+v,T=this.top+f;else if(o==="left")_=y(this.right),C=this.right-f,A=_-v,O=y(t.left)+v,P=t.right;else if(o==="right")_=y(this.left),O=t.left,P=y(t.right)-v,C=_+v,A=this.left+f;else if(n==="x"){if(o==="center")_=y((t.top+t.bottom)/2+.5);else if(pi(o)){const B=Object.keys(o)[0],Y=o[B];_=y(this.chart.scales[B].getPixelForValue(Y))}F=t.top,L=t.bottom,S=_+v,T=S+f}else if(n==="y"){if(o==="center")_=y((t.left+t.right)/2);else if(pi(o)){const B=Object.keys(o)[0],Y=o[B];_=y(this.chart.scales[B].getPixelForValue(Y))}C=_-v,A=C-f,O=t.left,P=t.right}const q=Lr(i.ticks.maxTicksLimit,d),V=Math.max(1,Math.ceil(d/q));for(b=0;b<d;b+=V){const B=this.getContext(b),Y=s.setContext(B),D=a.setContext(B),K=Y.lineWidth,z=Y.color,N=D.dash||[],Z=D.dashOffset,j=Y.tickWidth,M=Y.tickColor,W=Y.tickBorderDash||[],G=Y.tickBorderDashOffset;x=A1n(this,b,l),x!==void 0&&(k=b1(r,x,K),c?C=A=O=P=k:S=T=F=L=k,h.push({tx1:C,ty1:S,tx2:A,ty2:T,x1:O,y1:F,x2:P,y2:L,width:K,color:z,borderDash:N,borderDashOffset:Z,tickWidth:j,tickColor:M,tickBorderDash:W,tickBorderDashOffset:G}))}return this._ticksLength=d,this._borderValue=_,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=s,f=Sk(r.grid),h=f+u,p=d?-u:h,m=-Vf(this.labelRotation),v=[];let y,_,b,x,k,C,S,A,T,O,F,P,L="middle";if(i==="top")C=this.bottom-p,S=this._getXAxisLabelAlignment();else if(i==="bottom")C=this.top+p,S=this._getXAxisLabelAlignment();else if(i==="left"){const V=this._getYAxisLabelAlignment(f);S=V.textAlign,k=V.x}else if(i==="right"){const V=this._getYAxisLabelAlignment(f);S=V.textAlign,k=V.x}else if(n==="x"){if(i==="center")C=(t.top+t.bottom)/2+h;else if(pi(i)){const V=Object.keys(i)[0],B=i[V];C=this.chart.scales[V].getPixelForValue(B)+h}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")k=(t.left+t.right)/2-h;else if(pi(i)){const V=Object.keys(i)[0],B=i[V];k=this.chart.scales[V].getPixelForValue(B)}S=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const q=this._getLabelSizes();for(y=0,_=a.length;y<_;++y){b=a[y],x=b.label;const V=s.setContext(this.getContext(y));A=this.getPixelForTick(y)+s.labelOffset,T=this._resolveTickFontOptions(y),O=T.lineHeight,F=so(x)?x.length:1;const B=F/2,Y=V.color,D=V.textStrokeColor,K=V.textStrokeWidth;let z=S;o?(k=A,S==="inner"&&(y===_-1?z=this.options.reverse?"left":"right":y===0?z=this.options.reverse?"right":"left":z="center"),i==="top"?c==="near"||m!==0?P=-F*O+O/2:c==="center"?P=-q.highest.height/2-B*O+O:P=-q.highest.height+O/2:c==="near"||m!==0?P=O/2:c==="center"?P=q.highest.height/2-B*O:P=q.highest.height-F*O,d&&(P*=-1),m!==0&&!V.showLabelBackdrop&&(k+=O/2*Math.sin(m))):(C=A,P=(1-F)*O/2);let N;if(V.showLabelBackdrop){const Z=Ul(V.backdropPadding),j=q.heights[y],M=q.widths[y];let W=P-Z.top,G=0-Z.left;switch(L){case"middle":W-=j/2;break;case"bottom":W-=j;break}switch(S){case"center":G-=M/2;break;case"right":G-=M;break;case"inner":y===_-1?G-=M:y>0&&(G-=M/2);break}N={left:G,top:W,width:M+Z.width,height:j+Z.height,color:V.backdropColor}}v.push({label:x,font:T,textOffset:P,options:{rotation:m,color:Y,strokeColor:D,strokeWidth:K,textAlign:z,textBaseline:L,translation:[k,C],backdrop:N}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Vf(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=b1(t,this.left,o)-o/2,u=b1(t,this.right,a)+a/2,d=f=l):(d=b1(t,this.top,o)-o/2,f=b1(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&n4(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Hy(r,c,0,u,l,a)}i&&r4(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=_a(r.font),o=Ul(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||pi(n)?(l+=o.bottom,so(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=R1n(this,l,n,a);Hy(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:M1n(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Lr(t.grid&&t.grid.z,-1),i=Lr(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==yb.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return _a(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class _P{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;D1n(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,j1n(t,o,r),this.override&&jo.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in jo[i]&&(delete jo[i][r],this.override&&delete Wy[r])}}function j1n(e,t,n){const r=m$(Object.create(null),[n?jo.get(n):{},jo.get(t),e.defaults]);jo.set(t,r),e.defaultRoutes&&I1n(t,e.defaultRoutes),e.descriptors&&jo.describe(t,e.descriptors)}function I1n(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");jo.route(s,i,l,a)})}function D1n(e){return"id"in e&&"defaults"in e}class L1n{constructor(){this.controllers=new _P(Xf,"datasets",!0),this.elements=new _P(V0,"elements"),this.plugins=new _P(Object,"plugins"),this.scales=new _P(yb,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):rs(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Cq(t);Ps(r["before"+i],[],r),n[t](r),Ps(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Rh=new L1n;class N1n{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(Ps(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Yi(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Lr(r.options&&r.options.plugins,{}),s=F1n(r);return i===!1&&!n?[]:V1n(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function F1n(e){const t={},n=[],r=Object.keys(Rh.plugins.items);for(let s=0;s<r.length;s++)n.push(Rh.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function B1n(e,t){return!t&&e===!1?null:e===!0?{}:e}function V1n(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=B1n(r[l],i);c!==null&&s.push({plugin:a,options:z1n(e.config,{plugin:a,local:n[l]},c,o)})}return s}function z1n(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function jF(e,t){const n=jo.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function W1n(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function H1n(e,t){return e===t?"_index_":"_value_"}function Gue(e){if(e==="x"||e==="y"||e==="r")return e}function U1n(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function IF(e,...t){if(Gue(e))return e;for(const n of t){const r=n.axis||U1n(n.position)||e.length>1&&Gue(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Kue(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function q1n(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Kue(e,"x",n[0])||Kue(e,"y",n[0])}return{}}function Y1n(e,t){const n=Wy[e.type]||{scales:{}},r=t.scales||{},i=jF(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!pi(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=IF(o,a,q1n(o,e),jo.scales[a.type]),c=H1n(l,i),u=n.scales||{};s[o]=OS(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||jF(a,t),u=(Wy[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=W1n(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),OS(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];OS(a,[jo.scales[a.type],jo.scale])}),s}function S3e(e){const t=e.options||(e.options={});t.plugins=Lr(t.plugins,{}),t.scales=Y1n(e,t)}function C3e(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function G1n(e){return e=e||{},e.data=C3e(e.data),S3e(e),e}const Jue=new Map,$3e=new Set;function xP(e,t){let n=Jue.get(e);return n||(n=t(),Jue.set(e,n),$3e.add(n)),n}const Ck=(e,t,n)=>{const r=h0(t,n);r!==void 0&&e.add(r)};class K1n{constructor(t){this._config=G1n(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=C3e(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),S3e(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return xP(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return xP(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return xP(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return xP(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ck(l,t,d))),u.forEach(d=>Ck(l,i,d)),u.forEach(d=>Ck(l,Wy[s]||{},d)),u.forEach(d=>Ck(l,jo,d)),u.forEach(d=>Ck(l,OF,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),$3e.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Wy[n]||{},jo.datasets[n]||{},{type:n},jo,OF]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Xue(this._resolverCache,t,i);let l=o;if(X1n(o,n)){s.$shared=!1,r=p0(r)?r():r;const c=this.createResolver(t,r,a);l=m2(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Xue(this._resolverCache,t,r);return pi(n)?m2(s,n,void 0,i):s}}function Xue(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Pq(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const J1n=e=>pi(e)&&Object.getOwnPropertyNames(e).some(t=>p0(e[t]));function X1n(e,t){const{isScriptable:n,isIndexable:r}=s3e(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(p0(a)||J1n(a))||o&&so(a))return!0}return!1}var Z1n="4.4.3";const Q1n=["top","bottom","left","right","chartArea"];function Zue(e,t){return e==="top"||e==="bottom"||Q1n.indexOf(e)===-1&&t==="x"}function Que(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function ede(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ps(n&&n.onComplete,[e],t)}function eyn(e){const t=e.chart,n=t.options.animation;Ps(n&&n.onProgress,[e],t)}function T3e(e){return Rq()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const OO={},tde=e=>{const t=T3e(e);return Object.values(OO).filter(n=>n.canvas===t).pop()};function tyn(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function nyn(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function kP(e,t,n){return e.options.clip?e[n]:t[n]}function ryn(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:kP(n,t,"left"),right:kP(n,t,"right"),top:kP(r,t,"top"),bottom:kP(r,t,"bottom")}:t}var ev;let s4=(ev=class{static register(...t){Rh.add(...t),nde()}static unregister(...t){Rh.remove(...t),nde()}constructor(t,n){const r=this.config=new K1n(n),i=T3e(t),s=tde(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||w1n(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=svn(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 N1n,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=xvn(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],OO[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}hm.listen(this,"complete",ede),hm.listen(this,"progress",eyn),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Yi(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Rh}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():kue(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wue(this.canvas,this.ctx),this}stop(){return hm.stop(this),this}resize(t,n){hm.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,kue(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ps(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};rs(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=IF(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),rs(s,o=>{const a=o.options,l=a.id,c=IF(l,a),u=Lr(a.type,o.dtype);(a.position===void 0||Zue(a.position,c)!==Zue(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Rh.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),rs(i,(o,a)=>{o||delete r[a]}),rs(r,o=>{Od.configure(this,o,o.options),Od.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Que("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||jF(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Rh.getController(a),{datasetElementType:c,dataElementType:u}=jo.datasets[a];Object.assign(l,{dataElementType:Rh.getElement(u),datasetElementType:c&&Rh.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){rs(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||rs(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Que("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){rs(this.scales,t=>{Od.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!due(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;tyn(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!due(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Od.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],rs(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,p0(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(hm.has(this)?this.attached&&!hm.running(this)&&hm.start(this):(this.draw(),ede({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,s=ryn(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&n4(n,{left:r.left===!1?0:s.left-r.left,right:r.right===!1?this.width:s.right+r.right,top:r.top===!1?0:s.top-r.top,bottom:r.bottom===!1?this.height:s.bottom+r.bottom}),t.controller.draw(),i&&r4(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Rm(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=Q0n.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=B0(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);g$(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),hm.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wue(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete OO[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};rs(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){rs(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},rs(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!X3(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=dvn(t),c=nyn(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ps(s.onHover,[t,a,this],this),l&&Ps(s.onClick,[t,a,this],this));const u=!X3(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}},E(ev,"defaults",jo),E(ev,"instances",OO),E(ev,"overrides",Wy),E(ev,"registry",Rh),E(ev,"version",Z1n),E(ev,"getChart",tde),ev);function nde(){return rs(s4.instances,e=>e._plugins.invalidate())}function A3e(e,t,n=t){e.lineCap=Lr(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Lr(n.borderDash,t.borderDash)),e.lineDashOffset=Lr(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Lr(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Lr(n.borderWidth,t.borderWidth),e.strokeStyle=Lr(n.borderColor,t.borderColor)}function iyn(e,t,n){e.lineTo(n.x,n.y)}function syn(e){return e.stepped?jvn:e.tension||e.cubicInterpolationMode==="monotone"?Ivn:iyn}function E3e(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function oyn(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=E3e(i,n,r),u=syn(s);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=c;++h)p=i[(a+(f?c-h:h))%o],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,s.stepped),m=p);return l&&(p=i[(a+(f?c:0))%o],u(e,m,p,f,s.stepped)),!!l}function ayn(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=E3e(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,p,m,v,y;const _=x=>(o+(c?a-x:x))%s,b=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(h=i[_(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[_(f)],h.skip)continue;const x=h.x,k=h.y,C=x|0;C===p?(k<m?m=k:k>v&&(v=k),u=(d*u+x)/++d):(b(),e.lineTo(x,k),p=C,d=0,m=v=k),y=k}b()}function DF(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?ayn:oyn}function lyn(e){return e.stepped?h0n:e.tension||e.cubicInterpolationMode==="monotone"?p0n:T1}function cyn(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),A3e(e,t.options),e.stroke(i)}function uyn(e,t,n,r){const{segments:i,options:s}=t,o=DF(t);for(const a of i)A3e(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const dyn=typeof Path2D=="function";function fyn(e,t,n,r){dyn&&!t.options.segment?cyn(e,t,n,r):uyn(e,t,n,r)}class Ev extends V0{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;s0n(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=w0n(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=m3e(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=lyn(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],h=s[d],p=s[f];if(h===p){a.push(h);continue}const m=Math.abs((i-h[n])/(p[n]-h[n])),v=l(h,p,m,r.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,r){return DF(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=DF(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),fyn(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}E(Ev,"id","line"),E(Ev,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),E(Ev,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),E(Ev,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function rde(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class MO extends V0{constructor(n){super();E(this,"parsed");E(this,"skip");E(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return rde(this,n,"x",r)}inYRange(n,r){return rde(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!Rm(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,MF(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}E(MO,"id","point"),E(MO,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),E(MO,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function P3e(e,t){const{x:n,y:r,base:i,width:s,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=o/2,a=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=s/2,a=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function Pv(e,t,n,r){return e?0:Lu(t,n,r)}function hyn(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,s=i3e(r);return{t:Pv(i.top,s.top,0,n),r:Pv(i.right,s.right,0,t),b:Pv(i.bottom,s.bottom,0,n),l:Pv(i.left,s.left,0,t)}}function pyn(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,s=cy(i),o=Math.min(t,n),a=e.borderSkipped,l=r||pi(i);return{topLeft:Pv(!l||a.top||a.left,s.topLeft,0,o),topRight:Pv(!l||a.top||a.right,s.topRight,0,o),bottomLeft:Pv(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:Pv(!l||a.bottom||a.right,s.bottomRight,0,o)}}function myn(e){const t=P3e(e),n=t.right-t.left,r=t.bottom-t.top,i=hyn(e,n/2,r/2),s=pyn(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:s},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function o8(e,t,n,r){const i=t===null,s=n===null,a=e&&!(i&&s)&&P3e(e,r);return a&&(i||Av(t,a.left,a.right))&&(s||Av(n,a.top,a.bottom))}function gyn(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function vyn(e,t){e.rect(t.x,t.y,t.w,t.h)}function a8(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+s,h:e.h+o,radius:e.radius}}class RO extends V0{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:s,outer:o}=myn(this),a=gyn(o.radius)?v$:vyn;t.save(),(o.w!==s.w||o.h!==s.h)&&(t.beginPath(),a(t,a8(o,n,s)),t.clip(),a(t,a8(s,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,a8(s,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return o8(this,t,n,r)}inXRange(t,n){return o8(this,t,null,n)}inYRange(t,n){return o8(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+i)/2:n,y:s?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}E(RO,"id","bar"),E(RO,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),E(RO,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function yyn(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=Dq(l,c,i);const u=LF(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=m3e(t,u);for(const f of d){const h=LF(n,s[f.start],s[f.end],f.loop),p=p3e(a,i,h);for(const m of p)o.push({source:m,target:f,start:{[n]:ide(u,h,"start",Math.max)},end:{[n]:ide(u,h,"end",Math.min)}})}}return o}function LF(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=$u(i),s=$u(s)),{property:e,start:i,end:s}}function byn(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Dq(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function Dq(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function ide(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function O3e(e,t){let n=[],r=!1;return so(e)?(r=!0,n=e):n=byn(e,t),n.length?new Ev({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function sde(e){return e&&e.fill!==!1}function wyn(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!Ro(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function _yn(e,t,n){const r=Cyn(e);if(pi(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Ro(i)&&Math.floor(i)===i?xyn(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function xyn(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function kyn(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:pi(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Syn(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:pi(e)?r=e.value:r=t.getBaseValue(),r}function Cyn(e){const t=e.options,n=t.fill;let r=Lr(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function $yn(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=Tyn(t,n);a.push(O3e({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)Ayn(i,o[u],a)}return new Ev({points:i,options:{}})}function Tyn(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function Ayn(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=Eyn(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Eyn(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],d=o[u.start][n],f=o[u.end][n];if(Av(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class M3e{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:Na},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function Pyn(e){const{chart:t,fill:n,line:r}=e;if(Ro(n))return Oyn(t,n);if(n==="stack")return $yn(e);if(n==="shape")return!0;const i=Myn(e);return i instanceof M3e?i:O3e(i,r)}function Oyn(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Myn(e){return(e.scale||{}).getPointPositionForValue?jyn(e):Ryn(e)}function Ryn(e){const{scale:t={},fill:n}=e,r=kyn(n,t);if(Ro(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function jyn(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=Syn(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new M3e({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function l8(e,t,n){const r=Pyn(t),{line:i,scale:s,axis:o}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(n4(e,n),Iyn(e,{line:i,target:r,above:u,below:d,area:n,scale:s,axis:o}),r4(e))}function Iyn(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&s!==i&&(ode(e,r,o.top),ade(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),ode(e,r,o.bottom)),ade(e,{line:n,target:r,color:s,scale:a,property:l}),e.restore()}function ode(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Dq(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function ade(e,t){const{line:n,target:r,property:i,color:s,scale:o}=t,a=yyn(n,r,i);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:f=s}={}}=l,h=r!==!0;e.save(),e.fillStyle=f,Dyn(e,o,h&&LF(i,u,d)),e.beginPath();const p=!!n.pathSegment(e,l);let m;if(h){p?e.closePath():lde(e,r,d,i);const v=!!r.pathSegment(e,c,{move:p,reverse:!0});m=p&&v,m||lde(e,r,u,i)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function Dyn(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:s,start:o,end:a}=n||{};s==="x"&&(e.beginPath(),e.rect(o,r,a-o,i-r),e.clip())}function lde(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Lyn={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Ev&&(l={visible:e.isDatasetVisible(o),index:o,fill:_yn(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=wyn(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&l8(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;sde(s)&&l8(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!sde(r)||n.drawTime!=="beforeDatasetDraw"||l8(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const cde=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Nyn=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class ude extends V0{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ps(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=_a(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=cde(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const v=r+n/2+s.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:v,height:i},c[c.length-1]+=v+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,h=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:_,itemHeight:b}=Fyn(r,n,s,v,i);y>0&&h+b+2*a>u&&(d+=f+a,c.push({width:f,height:h}),p+=f+a,m++,f=h=0),l[y]={left:p,top:h,col:m,width:_,height:b},f=Math.max(f,_),h+=b+a}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=k_(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Cl(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Cl(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=Cl(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Cl(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;n4(t,this),this._draw(),r4(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=jo.color,l=k_(t.rtl,this.left,this.width),c=_a(o.font),{padding:u}=o,d=c.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=cde(o,d),y=function(C,S,A){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;i.save();const T=Lr(A.lineWidth,1);if(i.fillStyle=Lr(A.fillStyle,a),i.lineCap=Lr(A.lineCap,"butt"),i.lineDashOffset=Lr(A.lineDashOffset,0),i.lineJoin=Lr(A.lineJoin,"miter"),i.lineWidth=T,i.strokeStyle=Lr(A.strokeStyle,a),i.setLineDash(Lr(A.lineDash,[])),o.usePointStyle){const O={radius:m*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:T},F=l.xPlus(C,p/2),P=S+f;n3e(i,O,F,P,o.pointStyleWidth&&p)}else{const O=S+Math.max((d-m)/2,0),F=l.leftForLtr(C,p),P=cy(A.borderRadius);i.beginPath(),Object.values(P).some(L=>L!==0)?v$(i,{x:F,y:O,w:p,h:m,radius:P}):i.rect(F,O,p,m),i.fill(),T!==0&&i.stroke()}i.restore()},_=function(C,S,A){Hy(i,A.text,C,S+v/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},b=this.isHorizontal(),x=this._computeTitleHeight();b?h={x:Cl(s,this.left+u,this.right-r[0]),y:this.top+u+x,line:0}:h={x:this.left+u,y:Cl(s,this.top+x+u,this.bottom-n[0].height),line:0},d3e(this.ctx,t.textDirection);const k=v+u;this.legendItems.forEach((C,S)=>{i.strokeStyle=C.fontColor,i.fillStyle=C.fontColor;const A=i.measureText(C.text).width,T=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),O=p+f+A;let F=h.x,P=h.y;l.setWidth(this.width),b?S>0&&F+O+u>this.right&&(P=h.y+=k,h.line++,F=h.x=Cl(s,this.left+u,this.right-r[h.line])):S>0&&P+k>this.bottom&&(F=h.x=F+n[h.line].width+u,h.line++,P=h.y=Cl(s,this.top+x+u,this.bottom-n[h.line].height));const L=l.x(F);if(y(L,P,C),F=kvn(T,F+p+f,b?F+O:this.right,t.rtl),_(l.x(F),P,C),b)h.x+=O+u;else if(typeof C.text!="string"){const q=c.lineHeight;h.y+=R3e(C,q)+u}else h.y+=k}),f3e(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=_a(n.font),i=Ul(n.padding);if(!n.display)return;const s=k_(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Cl(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Cl(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=Cl(a,d,d+f);o.textAlign=s.textAlign(Aq(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Hy(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=_a(t.font),r=Ul(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(Av(t,this.left,this.right)&&Av(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],Av(t,i.left,i.left+i.width)&&Av(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!zyn(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=Nyn(i,r);i&&!s&&Ps(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&Ps(n.onHover,[t,r,this],this)}else r&&Ps(n.onClick,[t,r,this],this)}}function Fyn(e,t,n,r,i){const s=Byn(r,e,t,n),o=Vyn(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function Byn(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function Vyn(e,t,n){let r=e;return typeof t.text!="string"&&(r=R3e(t,n)),r}function R3e(e,t){const n=e.text?e.text.length:0;return t*n}function zyn(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Wyn={id:"legend",_element:ude,start(e,t,n){const r=e.legend=new ude({ctx:e.ctx,options:n,chart:e});Od.configure(e,r,n),Od.addBox(e,r)},stop(e){Od.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Od.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ul(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class j3e extends V0{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=so(r.text)?r.text.length:1;this._padding=Ul(r.padding);const s=i*_a(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Cl(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=Cl(a,i,n),l=yo*-.5):(u=s-t,d=Cl(a,n,i),l=yo*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=_a(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Hy(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Aq(n.align),textBaseline:"middle",translation:[o,a]})}}function Hyn(e,t){const n=new j3e({ctx:e.ctx,options:t,chart:e});Od.configure(e,n,t),Od.addBox(e,n),e.titleBlock=n}var Uyn={id:"title",_element:j3e,start(e,t,n){Hyn(e,n)},stop(e){const t=e.titleBlock;Od.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Od.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Vk={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=PF(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Mh(e,t){return t&&(so(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function pm(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
523
523
  `)>-1?e.split(`
524
- `):e}function qyn(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function dde(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=_a(t.bodyFont),c=_a(t.titleFont),u=_a(t.footerFont),d=s.length,f=i.length,h=r.length,p=Ul(t.padding);let m=p.height,v=0,y=r.reduce((x,k)=>x+k.before.length+k.lines.length+k.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const x=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*x+(y-h)*l.lineHeight+(y-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0;const b=function(x){v=Math.max(v,n.measureText(x).width+_)};return n.save(),n.font=c.string,rs(e.title,b),n.font=l.string,rs(e.beforeBody.concat(e.afterBody),b),_=t.displayColors?o+2+t.boxPadding:0,rs(r,x=>{rs(x.before,b),rs(x.lines,b),rs(x.after,b)}),_=0,n.font=u.string,rs(e.footer,b),n.restore(),v+=p.width,{width:v,height:m}}function Yyn(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Gyn(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function Kyn(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),Gyn(c,e,t,n)&&(c="center"),c}function fde(e,t,n){const r=n.yAlign||t.yAlign||Yyn(e,n);return{xAlign:n.xAlign||t.xAlign||Kyn(e,t,n,r),yAlign:r}}function Jyn(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Xyn(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function hde(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=cy(o);let p=Jyn(t,a);const m=Xyn(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+i:a==="right"&&(p+=Math.max(d,h)+i),{x:Lu(p,0,r.width-t.width),y:Lu(m,0,r.height-t.height)}}function SP(e,t,n){const r=Ul(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function pde(e){return Mh([],pm(e))}function Zyn(e,t,n){return B0(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function mde(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const I3e={beforeTitle:cm,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:cm,beforeBody:cm,beforeLabel:cm,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Yi(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:cm,afterBody:cm,beforeFooter:cm,footer:cm,afterFooter:cm};function jc(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?I3e[t].call(n,r):i}class NF extends V0{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new g3e(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Zyn(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=jc(r,"beforeTitle",this,t),s=jc(r,"title",this,t),o=jc(r,"afterTitle",this,t);let a=[];return a=Mh(a,pm(i)),a=Mh(a,pm(s)),a=Mh(a,pm(o)),a}getBeforeBody(t,n){return pde(jc(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return rs(t,s=>{const o={before:[],lines:[],after:[]},a=mde(r,s);Mh(o.before,pm(jc(a,"beforeLabel",this,s))),Mh(o.lines,jc(a,"label",this,s)),Mh(o.after,pm(jc(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return pde(jc(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=jc(r,"beforeFooter",this,t),s=jc(r,"footer",this,t),o=jc(r,"afterFooter",this,t);let a=[];return a=Mh(a,pm(i)),a=Mh(a,pm(s)),a=Mh(a,pm(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(qyn(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),rs(a,u=>{const d=mde(t.callbacks,u);i.push(jc(d,"labelColor",this,u)),s.push(jc(d,"labelPointStyle",this,u)),o.push(jc(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Vk[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=dde(this,r),c=Object.assign({},a,l),u=fde(this.chart,r,c),d=hde(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=cy(a),{x:f,y:h}=t,{width:p,height:m}=n;let v,y,_,b,x,k;return s==="center"?(x=h+m/2,i==="left"?(v=f,y=v-o,b=x+o,k=x-o):(v=f+p,y=v+o,b=x-o,k=x+o),_=v):(i==="left"?y=f+Math.max(l,u)+o:i==="right"?y=f+p-Math.max(c,d)-o:y=this.caretX,s==="top"?(b=h,x=b-o,v=y-o,_=y+o):(b=h+m,x=b+o,v=y+o,_=y-o),k=b),{x1:v,x2:y,x3:_,y1:b,y2:x,y3:k}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=k_(r.rtl,this.x,this.width);for(t.x=SP(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=_a(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=_a(s.bodyFont),d=SP(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=i.leftForLtr(f,c)+c/2,y=p+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,MF(t,m,v,y),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,MF(t,m,v,y)}else{t.lineWidth=pi(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,c),v=i.leftForLtr(i.xPlus(f,1),c-2),y=cy(o.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,v$(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),v$(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=_a(r.bodyFont);let f=d.lineHeight,h=0;const p=k_(r.rtl,this.x,this.width),m=function(A){n.fillText(A,p.x(t.x+h),t.y+f/2),t.y+=f+s},v=p.textAlign(o);let y,_,b,x,k,C,S;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=SP(this,v,r),n.fillStyle=r.bodyColor,rs(this.beforeBody,m),h=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,x=0,C=i.length;x<C;++x){for(y=i[x],_=this.labelTextColors[x],n.fillStyle=_,rs(y.before,m),b=y.lines,a&&b.length&&(this._drawColorBox(n,t,x,p,r),f=Math.max(d.lineHeight,l)),k=0,S=b.length;k<S;++k)m(b[k]),f=d.lineHeight;rs(y.after,m)}h=0,f=d.lineHeight,rs(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=k_(r.rtl,this.x,this.width);for(t.x=SP(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=_a(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=cy(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=Vk[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=dde(this,t),l=Object.assign({},o,this._size),c=fde(n,t,l),u=hde(t,l,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Ul(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),d3e(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),f3e(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),s=!X3(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!X3(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=Vk[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}E(NF,"positioners",Vk);var Qyn={id:"tooltip",_element:NF,positioners:Vk,afterInit(e,t,n){n&&(e.tooltip=new NF({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:I3e},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ebn=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function tbn(e,t,n,r){const i=e.indexOf(t);if(i===-1)return ebn(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const nbn=(e,t)=>e===null?null:Lu(Math.round(e),0,t);function gde(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class FF extends yb{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Yi(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:tbn(r,t,Lr(n,t),this._addedLabels),nbn(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return gde.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}E(FF,"id","category"),E(FF,"defaults",{ticks:{callback:gde}});function rbn(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,p=u-1,{min:m,max:v}=t,y=!Yi(o),_=!Yi(a),b=!Yi(c),x=(v-m)/(d+1);let k=hue((v-m)/p/h)*h,C,S,A,T;if(k<1e-14&&!y&&!_)return[{value:m},{value:v}];T=Math.ceil(v/k)-Math.floor(m/k),T>p&&(k=hue(T*k/p/h)*h),Yi(l)||(C=Math.pow(10,l),k=Math.ceil(k*C)/C),i==="ticks"?(S=Math.floor(m/k)*k,A=Math.ceil(v/k)*k):(S=m,A=v),y&&_&&s&&mvn((a-o)/s,k/1e3)?(T=Math.round(Math.min((a-o)/k,u)),k=(a-o)/T,S=o,A=a):b?(S=y?o:S,A=_?a:A,T=c-1,k=(A-S)/T):(T=(A-S)/k,MS(T,Math.round(T),k/1e3)?T=Math.round(T):T=Math.ceil(T));const O=Math.max(pue(k),pue(S));C=Math.pow(10,Yi(l)?O:l),S=Math.round(S*C)/C,A=Math.round(A*C)/C;let F=0;for(y&&(f&&S!==o?(n.push({value:o}),S<o&&F++,MS(Math.round((S+F*k)*C)/C,o,vde(o,x,e))&&F++):S<o&&F++);F<T;++F){const P=Math.round((S+F*k)*C)/C;if(_&&P>a)break;n.push({value:P})}return _&&f&&A!==a?n.length&&MS(n[n.length-1].value,a,vde(a,x,e))?n[n.length-1].value=a:n.push({value:a}):(!_||A===a)&&n.push({value:A}),n}function vde(e,t,{horizontal:n,minRotation:r}){const i=Vf(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class i5 extends yb{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Yi(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=up(i),c=up(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=rbn(i,s);return t.bounds==="ticks"&&GMe(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return BT(t,this.chart.options.locale,this.options.ticks.format)}}class BF extends i5{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ro(t)?t:0,this.max=Ro(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Vf(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}E(BF,"id","linear"),E(BF,"defaults",{ticks:{callback:t4.formatters.numeric}});const b$=e=>Math.floor(Tv(e)),_1=(e,t)=>Math.pow(10,b$(e)+t);function yde(e){return e/Math.pow(10,b$(e))===1}function bde(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function ibn(e,t){const n=t-e;let r=b$(n);for(;bde(e,t,r)>10;)r++;for(;bde(e,t,r)<10;)r--;return Math.min(r,b$(e))}function sbn(e,{min:t,max:n}){t=xu(e.min,t);const r=[],i=b$(t);let s=ibn(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=i>s?Math.pow(10,i):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,s)),f=xu(e.min,Math.round((l+u+d*Math.pow(10,s))*o)/o);for(;f<n;)r.push({value:f,major:yde(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(s++,d=2,o=s>=0?1:o),f=Math.round((l+u+d*Math.pow(10,s))*o)/o;const h=xu(e.max,f);return r.push({value:h,major:yde(h),significand:d}),r}class wde extends yb{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=i5.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Ro(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ro(t)?Math.max(0,t):null,this.max=Ro(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ro(this._userMin)&&(this.min=t===_1(this.min,0)?_1(this.min,-1):_1(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=t?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(_1(r,-1)),o(_1(i,1)))),r<=0&&s(_1(i,-1)),i<=0&&o(_1(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=sbn(n,this);return t.bounds==="ticks"&&GMe(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":BT(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Tv(t),this._valueRange=Tv(this.max)-Tv(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Tv(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}E(wde,"id","logarithmic"),E(wde,"defaults",{ticks:{callback:t4.formatters.logarithmic,major:{enabled:!0}}});function VF(e){const t=e.ticks;if(t.display&&e.display){const n=Ul(t.backdropPadding);return Lr(t.font&&t.font.size,jo.font.size)+n.height}return 0}function obn(e,t,n){return n=so(n)?n:[n],{w:Rvn(e,t.string,n),h:n.length*t.lineHeight}}function _de(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function abn(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?yo/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=_a(c.font),f=obn(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=$u(e.getIndexAngle(l)+a),p=Math.round($q(h)),m=_de(p,u.x,f.w,0,180),v=_de(p,u.y,f.h,90,270);lbn(n,t,h,m,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=dbn(e,r,i)}function lbn(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function cbn(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round($q($u(l.angle+pc))),u=pbn(l.y,a.h,c),d=fbn(c),f=hbn(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function ubn(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(Rm({x:n,y:r},t)||Rm({x:n,y:s},t)||Rm({x:i,y:r},t)||Rm({x:i,y:s},t))}function dbn(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:VF(s)/2,additionalAngle:o?yo/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=cbn(e,u,l);r.push(d),a==="auto"&&(d.visible=ubn(d,c),d.visible&&(c=d))}return r}function fbn(e){return e===0||e===180?"center":e<180?"left":"right"}function hbn(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function pbn(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function mbn(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Yi(a)){const l=cy(t.borderRadius),c=Ul(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),v$(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function gbn(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));mbn(n,o,s);const a=_a(o.font),{x:l,y:c,textAlign:u}=s;Hy(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function D3e(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Na);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function vbn(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash),s.lineDashOffset=i.dashOffset,s.beginPath(),D3e(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function ybn(e,t,n){return B0(e,{label:n,index:t,type:"pointLabel"})}class CP extends i5{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ul(VF(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Ro(t)&&!isNaN(t)?t:0,this.max=Ro(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/VF(this.options))}generateTickLabels(t){i5.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ps(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?abn(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Na/(this._pointLabels.length||1),r=this.options.startAngle||0;return $u(t*n+Vf(r))}getDistanceFromCenterForValue(t){if(Yi(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Yi(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return ybn(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-pc+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),D3e(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&gbn(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),p=s.setContext(f);vbn(this,h,l,o,p)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=_a(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ul(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Hy(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}E(CP,"id","radialLinear"),E(CP,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t4.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),E(CP,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),E(CP,"descriptors",{angleLines:{_fallback:"grid"}});const o4={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}},zc=Object.keys(o4);function xde(e,t){return e-t}function kde(e,t){if(Yi(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),Ro(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(p2(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Sde(e,t,n,r){const i=zc.length;for(let s=zc.indexOf(e);s<i-1;++s){const o=o4[zc[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return zc[s]}return zc[i-1]}function bbn(e,t,n,r,i){for(let s=zc.length-1;s>=zc.indexOf(n);s--){const o=zc[s];if(o4[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return zc[n?zc.indexOf(n):0]}function wbn(e){for(let t=zc.indexOf(e)+1,n=zc.length;t<n;++t)if(o4[zc[t]].common)return zc[t]}function Cde(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Tq(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function _bn(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function $de(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:_bn(e,r,i,n)}class s5 extends yb{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new G0n._date(t.adapters.date);i.init(n),OS(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:kde(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Ro(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Ro(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=wvn(i,s,o);return this._unit=n.unit||(r.autoSkip?Sde(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):bbn(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:wbn(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),$de(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=Lu(n,0,o),r=Lu(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||Sde(s.minUnit,n,r,this._getLabelCapacity(n)),a=Lr(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=p2(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const p=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)Cde(u,f,p);return(f===r||i.bounds==="ticks"||h===1)&&Cde(u,f,p),Object.keys(u).sort(xde).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return Ps(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Vf(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,$de(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(kde(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return JMe(t.sort(xde))}}E(s5,"id","time"),E(s5,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function $P(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=q1(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=q1(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class Tde extends s5{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=$P(n,this.min),this._tableRange=$P(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return($P(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return $P(this._table,r*this._tableRange+this._minPos,!0)}}E(Tde,"id","timeseries"),E(Tde,"defaults",s5.defaults);const L3e={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},xbn={ariaLabel:{type:String},ariaDescribedby:{type:String}},kbn={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...L3e,...xbn},Sbn=kB[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function rw(e){return x$(e)?Pn(e):e}function Cbn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return x$(t)?new Proxy(e,{}):e}function $bn(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function N3e(e,t){e.labels=t}function F3e(e,t,n){const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function Tbn(e,t){const n={labels:[],datasets:[]};return N3e(n,e.labels),F3e(n,e.datasets,t),n}const Abn=jn({props:kbn,setup(e,t){let{expose:n,slots:r}=t;const i=Ve(null),s=tn(null);n({chart:s});const o=()=>{if(!i.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:h}=e,p=Tbn(u,h),m=Cbn(p,u);s.value=new s4(i.value,{type:c,data:m,options:{...d},plugins:f})},a=()=>{const c=Pn(s.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),s.value=null},e.destroyDelay):(c.destroy(),s.value=null))},l=c=>{c.update(e.updateMode)};return _i(o),ou(a),Nt([()=>e.options,()=>e.data],(c,u)=>{let[d,f]=c,[h,p]=u;const m=Pn(s.value);if(!m)return;let v=!1;if(d){const y=rw(d),_=rw(h);y&&y!==_&&($bn(m,y),v=!0)}if(f){const y=rw(f.labels),_=rw(p.labels),b=rw(f.datasets),x=rw(p.datasets);y!==_&&(N3e(m.config.data,y),v=!0),b&&b!==x&&(F3e(m.config.data,b,e.datasetIdKey),v=!0)}v&&or(()=>{l(m)})},{deep:!0}),()=>Oo("canvas",{role:"img",ariaLabel:e.ariaLabel,ariaDescribedby:e.ariaDescribedby,ref:i},[Oo("p",{},[r.default?r.default():""])])}});function z0(e,t){return s4.register(t),jn({props:L3e,setup(n,r){let{expose:i}=r;const s=tn(null),o=a=>{s.value=a==null?void 0:a.chart};return i({chart:s}),()=>Oo(Abn,Sbn({ref:o},{type:e,...n}))}})}const Ebn=z0("bar",SO),Pbn=z0("doughnut",Fw),Obn=z0("line",$O),Mbn=z0("pie",RF),Rbn=z0("polarArea",TO),jbn=z0("radar",AO),Ibn=z0("bubble",CO),Dbn=z0("scatter",EO);s4.register(Uyn,Qyn,Wyn,Ev,BF,FF,MO,Lyn,RO);const Lbn={line:Obn,bar:Ebn,bubble:Ibn,doughnut:Pbn,pie:Mbn,polararea:Rbn,radar:jbn,scatter:Dbn},Nbn={props:{chartData:{type:Object,required:!0}},components:{},data(){},created(){},methods:{getComponent(e){const t=Lbn[e.type];if(t)return t;const n=`Inline type "${e.type}" not found`;Ur(n,{theme:"auto",type:"error",position:"top-center",dangerouslyHTMLString:!0})}}};function Fbn(e,t,n,r,i,s){return fe(),at(Uu(s.getComponent(n.chartData)),{options:n.chartData.options,data:n.chartData.data,width:n.chartData.width,height:n.chartData.height,fill:n.chartData.fill,pointBorderColor:n.chartData.pointBorderColor,borderColor:n.chartData.borderColor,backgroundColor:n.chartData.backgroundColor,pointBorderWidth:n.chartData.pointBorderWidth,tension:n.chartData.tension,borderWidth:n.chartData.borderWidth},null,8,["options","data","width","height","fill","pointBorderColor","borderColor","backgroundColor","pointBorderWidth","tension","borderWidth"])}const B3e=gi(Nbn,[["render",Fbn]]),Bbn={name:"DashboardContainer",props:{componentData:{type:Object,required:!0}},components:{Chart:B3e,SmallGraph:VMe,PeriodGraph:zMe},data(){return{}},created(){},methods:{}};function Vbn(e,t,n,r,i,s){const o=li("DashboardContainer",!0),a=B3e,l=zMe,c=VMe;return fe(),at(Pf,{cols:n.componentData.cols||12,md:n.componentData.md,sm:n.componentData.sm,lg:n.componentData.lg,class:"d-flex flex-column"},{default:Re(()=>[n.componentData.components?(fe(),at(Dm,{key:0,class:"flex-grow-1"},{default:Re(()=>[(fe(!0),Me(Ke,null,Cn(n.componentData.components,u=>(fe(),Me(Ke,{key:u},[u.component_type==="container"?(fe(),at(o,{key:0,"component-data":u},null,8,["component-data"])):u.component_type==="chart"?(fe(),at(Pf,{key:1,cols:"12"},{default:Re(()=>[R(a,{"chart-data":u},null,8,["chart-data"])]),_:2},1024)):u.component_type==="period_graph"?(fe(),at(Pf,{key:2,cols:"12",class:"d-flex"},{default:Re(()=>[R(l,{"component-data":u,class:"flex-grow-1"},null,8,["component-data"])]),_:2},1024)):u.component_type==="small_graph"?(fe(),at(Pf,{key:3,cols:"12",class:"d-flex"},{default:Re(()=>[R(c,{"component-data":u,class:"flex-grow-1"},null,8,["component-data"])]),_:2},1024)):(fe(),at(Pf,{key:4,cols:"12"},{default:Re(()=>[Je("p",null,'Dashboard component "'+Ct(u.component_type)+'" is not supported',1)]),_:2},1024))],64))),128))]),_:1})):Xe("",!0)]),_:1},8,["cols","md","sm","lg"])}const V3e=gi(Bbn,[["render",Vbn]]),Bw="f-";function zbn(e,t=[]){const n=e.query??e,r={},i=new Set;for(const s of Object.keys(n)){if(!s.startsWith(Bw))continue;const o=s.slice(Bw.length);if(!o.includes("__"))continue;const a=o.split("__")[0];(!t.length||t.includes(a))&&i.add(a)}for(const[s,o]of Object.entries(n)){if(!s.startsWith(Bw))continue;const l=s.slice(Bw.length).split("__"),c=l[0];if(!(t.length&&!t.includes(c))){if(i.has(c)){r[c]||(r[c]={}),l.length===2&&(r[c][l[1]]=o);continue}l.length===1&&(r[c]=o)}}return r}function Wbn(e,t){for(const[n,r]of Object.entries(t))if(r!==null&&typeof r=="object"&&!Array.isArray(r))for(const[i,s]of Object.entries(r))s!=null&&(e[`${Bw}${n}__${i}`]=s);else r!=null&&(e[`${Bw}${n}`]=r);return e}function Hbn(e){const t={};for(const[n,r]of Object.entries(e)){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){const i={};for(const[s,o]of Object.entries(r))o!=null&&o!==""&&(i[s]=o);Object.keys(i).length>0&&(t[n]=i);continue}r!=null&&r!==""&&(t[n]=r)}return t}const Ubn={props:{...lu},emits:["changed"],data(e){return{value:null,choices:[{value:!0,display_name:this.$t("yes")},{value:!1,display_name:this.$t("no")}]}},created(){sd(this),this.value=this.field.initial},methods:{updateFormData(e){this.value=e[this.fieldSlug]},onChange(e){this.value=e,this.$emit("changed",this.value)}}};function qbn(e,t,n,r,i,s){return fe(),at(Ky,{density:e.density,variant:e.variant,clearable:!0,label:e.field.label,"model-value":i.value,messages:e.field.help_text||[],disabled:e.readOnly,loading:e.loading,items:i.choices,"item-title":"display_name","item-value":"value","return-object":!1,"onUpdate:modelValue":s.onChange},null,8,["density","variant","label","model-value","messages","disabled","loading","items","onUpdate:modelValue"])}const Ybn=gi(Ubn,[["render",qbn]]),Gbn={props:{group:{type:String,required:!0},category:{type:String,required:!0},categorySchema:{type:Jy,required:!0},loading:{type:Boolean,required:!1},searchEnabled:{type:Boolean,required:!1},searchHelp:{type:String,required:!1},fieldsInfo:{type:Object,required:!0},filtersInit:{type:Object,required:!1},searchInit:{type:String,required:!1}},emits:["filtered"],data(){return{filters:{},search:null}},created(){this.initFilters&&(this.filters=this.initFilters),this.initSearch&&(this.search=this.initSearch)},methods:{getFieldComponent(e){if(["choice"].indexOf(e.type)!==-1||e.choices)return LP;if(["datetime"].indexOf(e.type)!==-1)return CPe;if(["related"].indexOf(e.type)!==-1)return qAe;if(["string"].indexOf(e.type)!==-1)return jge;if(["integer"].indexOf(e.type)!==-1)return Ige;if(["boolean"].indexOf(e.type)!==-1)return Ybn},_updateValue(e,t){this.filters[t]=e},applyFilter(){this.loading||this.$emit("filtered",Hbn(this.filters),this.search)},searchHelpHtml(){return this.searchHelp.replace(/\n/g,"<br>")}}},Kbn={class:"filters-container"},Jbn={key:0,class:"filter-element"},Xbn=["innerHTML"],Zbn={class:"filter-button"};function Qbn(e,t,n,r,i,s){return fe(),Me("div",Kbn,[n.searchEnabled?(fe(),Me("div",Jbn,[R(bc,{modelValue:i.search,"onUpdate:modelValue":t[0]||(t[0]=o=>i.search=o),density:"compact",variant:"solo","prepend-inner-icon":"mdi-magnify",label:e.$t("search"),onKeydown:Ym(qu(s.applyFilter,["prevent"]),["enter"])},{"append-inner":Re(()=>[R(PS,{location:"bottom"},{activator:Re(({props:o})=>[n.searchHelp?(fe(),at(Tr,ut({key:0},o,{icon:"mdi-help-circle-outline"}),null,16)):Xe("",!0),R(Tr,{icon:"mdi-magnify"})]),default:Re(()=>[Je("div",{innerHTML:s.searchHelpHtml()},null,8,Xbn)]),_:1})]),_:1},8,["modelValue","label","onKeydown"])])):Xe("",!0),(fe(!0),Me(Ke,null,Cn(n.fieldsInfo,(o,a)=>(fe(),Me("div",{key:a,class:"filter-element",onKeydown:t[1]||(t[1]=Ym(qu((...l)=>s.applyFilter&&s.applyFilter(...l),["prevent"]),["enter"]))},[s.getFieldComponent(o)?(fe(),at(Uu(s.getFieldComponent(o)),{key:0,density:"compact",variant:"solo","category-schema":n.categorySchema,field:o,"field-slug":a,loading:!1,"is-filter":!0,onChanged:l=>s._updateValue(l,a)},null,40,["category-schema","field","field-slug","onChanged"])):(fe(),Me(Ke,{key:1},[$n(Ct(o),1)],64))],32))),128)),Je("div",Zbn,[R(nr,{onClick:s.applyFilter,color:"secondary","prepend-icon":"mdi-magnify",disabled:n.loading},{default:Re(()=>[$n(Ct(e.$t("apply")),1)]),_:1},8,["onClick","disabled"])])])}const z3e=gi(Gbn,[["render",Qbn]]),ewn=Ap(Nr.backend_prefix,"dashboard/{group}/{category}/");function twn(e){return new Promise((t,n)=>{const r=ewn.replace("{group}",e.group).replace("{category}",e.category);id({url:r,data:{filters:e.filters},method:"post",timeout:Nr.api_timeout_ms,headers:{"Accept-Language":Vd(),"Cache-Control":"no-cache"}}).then(i=>{t(i)}).catch(i=>n(i))})}const nwn={props:{adminSchema:{type:Object,required:!0},categorySchema:{type:Jy,required:!0}},components:{DashboardContainer:V3e},data(){return{search:null,filters:{},loading:!1,responseData:null}},created(){this.updateDashboard()},methods:{updateDashboard(){this.loading=!0,twn({group:this.categorySchema.group,category:this.categorySchema.category,filters:this.filters,search:this.search}).then(e=>{this.loading=!1,this.responseData=e.data}).catch(e=>{this.loading=!1;const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},hasFilters(){const e=this.categorySchema.getDashboardInfo().table_filters;return this.categorySchema.getDashboardInfo().search_enabled||e&&Object.keys(e).length>0},handleFilter(e,t){this.filters=e,this.search=t,this.updateDashboard()},getDashboardInfo(){return this.categorySchema.getDashboardInfo()}}},rwn={class:"list-page"},iwn={class:"list-above-block"},swn={key:0,class:"header-row-filters"},own={key:0};function awn(e,t,n,r,i,s){const o=z3e,a=V3e;return fe(),Me("div",rwn,[Je("div",iwn,[s.hasFilters()?(fe(),Me("div",swn,[R(o,{"category-schema":n.categorySchema,"filters-init":i.filters,"search-init":i.search,onFiltered:s.handleFilter,loading:i.loading,"search-enabled":s.getDashboardInfo().search_enabled,"fields-info":s.getDashboardInfo().table_filters.fields,"search-help":s.getDashboardInfo().search_help},null,8,["category-schema","filters-init","search-init","onFiltered","loading","search-enabled","fields-info","search-help"])])):Xe("",!0)]),i.responseData?(fe(),Me("div",own,[R(A$,null,{default:Re(()=>[R(a,{"component-data":i.responseData},null,8,["component-data"])]),_:1})])):Xe("",!0)])}const W3e=gi(nwn,[["render",awn]]),lwn={props:{title:{type:String,required:!0},adminSchema:{type:Object,required:!0},categorySchema:{type:Jy,required:!0}},components:{FieldsContainer:xx},emits:["created"],data(){return{open:!1,formData:{},loading:!1}},methods:{getTitle(){return this.title},createModel(){this.loading=!0,this.$refs.fieldscontainer.updateErrors({}),Hmn({group:this.categorySchema.group,category:this.categorySchema.category,data:this.formData}).then(e=>{if(this.loading=!1,e){let t=this.$t("modelCreated",{pk:e.data.pk});Ur(t,{theme:"auto",type:"success",position:"top-center"})}this.open=!1,this.formData={},this.$emit("created")}).catch(e=>{this.loading=!1;const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})}}},cwn={key:0};function uwn(e,t,n,r,i,s){const o=xx;return fe(),at(Xw,{"content-class":"dialog-top-position",persistent:"","retain-focus":!1,modelValue:i.open,"onUpdate:modelValue":t[3]||(t[3]=a=>i.open=a),class:"create-dialog"},{activator:Re(({props:a})=>[R(nr,ut(a,{color:"primary",onClick:t[0]||(t[0]=l=>i.open=!0),icon:"mdi-plus",class:"button-icon"}),null,16)]),default:Re(({isActive:a})=>[i.open?(fe(),at(ul,{key:0},{default:Re(()=>[R(aC,{class:"d-flex justify-space-between align-center"},{default:Re(()=>[s.getTitle()?(fe(),Me("span",cwn,Ct(s.getTitle())+": "+Ct(e.$t("creation")),1)):Xe("",!0),R(nr,{icon:"mdi-close",variant:"text",density:"compact",onClick:l=>a.value=!1},null,8,["onClick"])]),_:2},1024),R(o,{ref:"fieldscontainer","form-type":"create","category-schema":n.categorySchema,"table-schema":n.categorySchema.getTableInfo().table_schema,loading:i.loading,onChanged:t[1]||(t[1]=l=>i.formData=l)},null,8,["category-schema","table-schema","loading"]),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("close"),onClick:t[2]||(t[2]=l=>i.open=!1)},null,8,["text"]),R(nr,{text:e.$t("create"),variant:"elevated",color:"primary",onClick:s.createModel},null,8,["text","onClick"])]),_:1})]),_:2},1024)):Xe("",!0)]),_:1},8,["modelValue"])}const H3e=gi(lwn,[["render",uwn]]);function dwn(e,t){if(typeof e!="string")throw new TypeError("truncate expects string");return e.length<=t?e:e.slice(0,t)+"..."}const fwn=mt({bordered:Boolean,color:String,content:[Number,String],dot:Boolean,floating:Boolean,icon:Yr,inline:Boolean,label:{type:String,default:"$vuetify.badge"},max:[Number,String],modelValue:{type:Boolean,default:!0},offsetX:[Number,String],offsetY:[Number,String],textColor:String,...Fn(),...O$({location:"top end"}),...pl(),...Mi(),...js(),...Gy({transition:"scale-rotate-transition"})},"VBadge"),hwn=Vt()({name:"VBadge",inheritAttrs:!1,props:fwn(),setup(e,t){const{backgroundColorClasses:n,backgroundColorStyles:r}=cl(Et(e,"color")),{roundedClasses:i}=ql(e),{t:s}=ed(),{textColorClasses:o,textColorStyles:a}=tu(Et(e,"textColor")),{themeClasses:l}=kpe(),{locationStyles:c}=M$(e,!0,u=>(e.floating?e.dot?2:4:e.dot?8:12)+(["top","bottom"].includes(u)?+(e.offsetY??0):["left","right"].includes(u)?+(e.offsetX??0):0));return Xt(()=>{const u=Number(e.content),d=!e.max||isNaN(u)?e.content:u<=+e.max?u:`${e.max}+`,[f,h]=L8(t.attrs,["aria-atomic","aria-label","aria-live","role","title"]);return R(e.tag,ut({class:["v-badge",{"v-badge--bordered":e.bordered,"v-badge--dot":e.dot,"v-badge--floating":e.floating,"v-badge--inline":e.inline},e.class]},h,{style:e.style}),{default:()=>{var p,m;return[R("div",{class:"v-badge__wrapper"},[(m=(p=t.slots).default)==null?void 0:m.call(p),R(Gh,{transition:e.transition},{default:()=>{var v,y;return[qs(R("span",ut({class:["v-badge__badge",l.value,n.value,i.value,o.value],style:[r.value,a.value,e.inline?{}:c.value],"aria-atomic":"true","aria-label":s(e.label,u),"aria-live":"polite",role:"status"},f),[e.dot?void 0:t.slots.badge?(y=(v=t.slots).badge)==null?void 0:y.call(v):e.icon?R(Tr,{icon:e.icon},null):d]),[[mc,e.modelValue]])]}})])]}})}),{}}});function pwn(){const e=Ve([]);$5(()=>e.value=[]);function t(n,r){e.value[r]=n}return{refs:e,updateRef:t}}const mwn=mt({activeColor:String,start:{type:[Number,String],default:1},modelValue:{type:Number,default:e=>e.start},disabled:Boolean,length:{type:[Number,String],default:1,validator:e=>e%1===0},totalVisible:[Number,String],firstIcon:{type:Yr,default:"$first"},prevIcon:{type:Yr,default:"$prev"},nextIcon:{type:Yr,default:"$next"},lastIcon:{type:Yr,default:"$last"},ariaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.root"},pageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.page"},currentPageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.currentPage"},firstAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.first"},previousAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.previous"},nextAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.next"},lastAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.last"},ellipsis:{type:String,default:"..."},showFirstLastPage:Boolean,...gg(),...Fn(),...xc(),...fh(),...pl(),...x2(),...Mi({tag:"nav"}),...js(),...$p({variant:"text"})},"VPagination"),zF=Vt()({name:"VPagination",props:mwn(),emits:{"update:modelValue":e=>!0,first:e=>!0,prev:e=>!0,next:e=>!0,last:e=>!0},setup(e,t){let{slots:n,emit:r}=t;const i=Ar(e,"modelValue"),{t:s,n:o}=ed(),{isRtl:a}=td(),{themeClasses:l}=ko(e),{width:c}=_0(),u=tn(-1);eu(void 0,{scoped:!0});const{resizeRef:d}=py(A=>{if(!A.length)return;const{target:T,contentRect:O}=A[0],F=T.querySelector(".v-pagination__list > *");if(!F)return;const P=O.width,L=F.offsetWidth+parseFloat(getComputedStyle(F).marginRight)*2;u.value=m(P,L)}),f=te(()=>parseInt(e.length,10)),h=te(()=>parseInt(e.start,10)),p=te(()=>e.totalVisible!=null?parseInt(e.totalVisible,10):u.value>=0?u.value:m(c.value,58));function m(A,T){const O=e.showFirstLastPage?5:3;return Math.max(0,Math.floor(+((A-T*O)/T).toFixed(2)))}const v=te(()=>{if(f.value<=0||isNaN(f.value)||f.value>Number.MAX_SAFE_INTEGER)return[];if(p.value<=0)return[];if(p.value===1)return[i.value];if(f.value<=p.value)return kw(f.value,h.value);const A=p.value%2===0,T=A?p.value/2:Math.floor(p.value/2),O=A?T:T+1,F=f.value-T;if(O-i.value>=0)return[...kw(Math.max(1,p.value-1),h.value),e.ellipsis,f.value];if(i.value-F>=(A?1:0)){const P=p.value-1,L=f.value-P+h.value;return[h.value,e.ellipsis,...kw(P,L)]}else{const P=Math.max(1,p.value-3),L=P===1?i.value:i.value-Math.ceil(P/2)+h.value;return[h.value,e.ellipsis,...kw(P,L),e.ellipsis,f.value]}});function y(A,T,O){A.preventDefault(),i.value=T,O&&r(O,T)}const{refs:_,updateRef:b}=pwn();eu({VPaginationBtn:{color:Et(e,"color"),border:Et(e,"border"),density:Et(e,"density"),size:Et(e,"size"),variant:Et(e,"variant"),rounded:Et(e,"rounded"),elevation:Et(e,"elevation")}});const x=te(()=>v.value.map((A,T)=>{const O=F=>b(F,T);if(typeof A=="string")return{isActive:!1,key:`ellipsis-${T}`,page:A,props:{ref:O,ellipsis:!0,icon:!0,disabled:!0}};{const F=A===i.value;return{isActive:F,key:A,page:o(A),props:{ref:O,ellipsis:!1,icon:!0,disabled:!!e.disabled||+e.length<2,color:F?e.activeColor:e.color,"aria-current":F,"aria-label":s(F?e.currentPageAriaLabel:e.pageAriaLabel,A),onClick:P=>y(P,A)}}}})),k=te(()=>{const A=!!e.disabled||i.value<=h.value,T=!!e.disabled||i.value>=h.value+f.value-1;return{first:e.showFirstLastPage?{icon:a.value?e.lastIcon:e.firstIcon,onClick:O=>y(O,h.value,"first"),disabled:A,"aria-label":s(e.firstAriaLabel),"aria-disabled":A}:void 0,prev:{icon:a.value?e.nextIcon:e.prevIcon,onClick:O=>y(O,i.value-1,"prev"),disabled:A,"aria-label":s(e.previousAriaLabel),"aria-disabled":A},next:{icon:a.value?e.prevIcon:e.nextIcon,onClick:O=>y(O,i.value+1,"next"),disabled:T,"aria-label":s(e.nextAriaLabel),"aria-disabled":T},last:e.showFirstLastPage?{icon:a.value?e.firstIcon:e.lastIcon,onClick:O=>y(O,h.value+f.value-1,"last"),disabled:T,"aria-label":s(e.lastAriaLabel),"aria-disabled":T}:void 0}});function C(){var T;const A=i.value-h.value;(T=_.value[A])==null||T.$el.focus()}function S(A){A.key===dJ.left&&!e.disabled&&i.value>+e.start?(i.value=i.value-1,or(C)):A.key===dJ.right&&!e.disabled&&i.value<h.value+f.value-1&&(i.value=i.value+1,or(C))}return Xt(()=>R(e.tag,{ref:d,class:["v-pagination",l.value,e.class],style:e.style,role:"navigation","aria-label":s(e.ariaLabel),onKeydown:S,"data-test":"v-pagination-root"},{default:()=>[R("ul",{class:"v-pagination__list"},[e.showFirstLastPage&&R("li",{key:"first",class:"v-pagination__first","data-test":"v-pagination-first"},[n.first?n.first(k.value.first):R(nr,ut({_as:"VPaginationBtn"},k.value.first),null)]),R("li",{key:"prev",class:"v-pagination__prev","data-test":"v-pagination-prev"},[n.prev?n.prev(k.value.prev):R(nr,ut({_as:"VPaginationBtn"},k.value.prev),null)]),x.value.map((A,T)=>R("li",{key:A.key,class:["v-pagination__item",{"v-pagination__item--is-active":A.isActive}],"data-test":"v-pagination-item"},[n.item?n.item(A):R(nr,ut({_as:"VPaginationBtn"},A.props),{default:()=>[A.page]})])),R("li",{key:"next",class:"v-pagination__next","data-test":"v-pagination-next"},[n.next?n.next(k.value.next):R(nr,ut({_as:"VPaginationBtn"},k.value.next),null)]),e.showFirstLastPage&&R("li",{key:"last",class:"v-pagination__last","data-test":"v-pagination-last"},[n.last?n.last(k.value.last):R(nr,ut({_as:"VPaginationBtn"},k.value.last),null)])])]})),{}}}),gwn=mt({page:{type:[Number,String],default:1},itemsPerPage:{type:[Number,String],default:10}},"DataTable-paginate"),U3e=Symbol.for("vuetify:data-table-pagination");function vwn(e){const t=Ar(e,"page",void 0,r=>+(r??1)),n=Ar(e,"itemsPerPage",void 0,r=>+(r??10));return{page:t,itemsPerPage:n}}function ywn(e){const{page:t,itemsPerPage:n,itemsLength:r}=e,i=te(()=>n.value===-1?0:n.value*(t.value-1)),s=te(()=>n.value===-1?r.value:Math.min(r.value,i.value+n.value)),o=te(()=>n.value===-1||r.value===0?1:Math.ceil(r.value/n.value));lo(()=>{t.value>o.value&&(t.value=o.value)});function a(f){n.value=f,t.value=1}function l(){t.value=gc(t.value+1,1,o.value)}function c(){t.value=gc(t.value-1,1,o.value)}function u(f){t.value=gc(f,1,o.value)}const d={page:t,itemsPerPage:n,startIndex:i,stopIndex:s,pageCount:o,itemsLength:r,nextPage:l,prevPage:c,setPage:u,setItemsPerPage:a};return fs(U3e,d),d}function bwn(){const e=ur(U3e);if(!e)throw new Error("Missing pagination!");return e}function wwn(e){const t=xo("usePaginatedItems"),{items:n,startIndex:r,stopIndex:i,itemsPerPage:s}=e,o=te(()=>s.value<=0?n.value:n.value.slice(r.value,i.value));return Nt(o,a=>{t.emit("update:currentItems",a)}),{paginatedItems:o}}const q3e=mt({prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},pageText:{type:String,default:"$vuetify.dataFooter.pageText"},firstPageLabel:{type:String,default:"$vuetify.dataFooter.firstPage"},prevPageLabel:{type:String,default:"$vuetify.dataFooter.prevPage"},nextPageLabel:{type:String,default:"$vuetify.dataFooter.nextPage"},lastPageLabel:{type:String,default:"$vuetify.dataFooter.lastPage"},itemsPerPageOptions:{type:Array,default:()=>[{value:10,title:"10"},{value:25,title:"25"},{value:50,title:"50"},{value:100,title:"100"},{value:-1,title:"$vuetify.dataFooter.itemsPerPageAll"}]},showCurrentPage:Boolean},"VDataTableFooter"),Ade=Vt()({name:"VDataTableFooter",props:q3e(),setup(e,t){let{slots:n}=t;const{t:r}=ed(),{page:i,pageCount:s,startIndex:o,stopIndex:a,itemsLength:l,itemsPerPage:c,setItemsPerPage:u}=bwn(),d=te(()=>e.itemsPerPageOptions.map(f=>typeof f=="number"?{value:f,title:f===-1?r("$vuetify.dataFooter.itemsPerPageAll"):String(f)}:{...f,title:isNaN(Number(f.title))?r(f.title):f.title}));return Xt(()=>{var h;const f=zF.filterProps(e);return R("div",{class:"v-data-table-footer"},[(h=n.prepend)==null?void 0:h.call(n),R("div",{class:"v-data-table-footer__items-per-page"},[R("span",null,[r(e.itemsPerPageText)]),R(Ky,{items:d.value,modelValue:c.value,"onUpdate:modelValue":p=>u(Number(p)),density:"compact",variant:"outlined","hide-details":!0},null)]),R("div",{class:"v-data-table-footer__info"},[R("div",null,[r(e.pageText,l.value?o.value+1:0,a.value,l.value)])]),R("div",{class:"v-data-table-footer__pagination"},[R(zF,ut({modelValue:i.value,"onUpdate:modelValue":p=>i.value=p,density:"comfortable","first-aria-label":e.firstPageLabel,"last-aria-label":e.lastPageLabel,length:s.value,"next-aria-label":e.nextPageLabel,"previous-aria-label":e.prevPageLabel,rounded:!0,"show-first-last-page":!0,"total-visible":e.showCurrentPage?1:0,variant:"plain"},f),null)])])}),{}}}),o5=VBe({align:{type:String,default:"start"},fixed:Boolean,fixedOffset:[Number,String],height:[Number,String],lastFixed:Boolean,noPadding:Boolean,tag:String,width:[Number,String],maxWidth:[Number,String],nowrap:Boolean},(e,t)=>{let{slots:n}=t;const r=e.tag??"td";return R(r,{class:["v-data-table__td",{"v-data-table-column--fixed":e.fixed,"v-data-table-column--last-fixed":e.lastFixed,"v-data-table-column--no-padding":e.noPadding,"v-data-table-column--nowrap":e.nowrap},`v-data-table-column--align-${e.align}`],style:{height:An(e.height),width:An(e.width),maxWidth:An(e.maxWidth),left:An(e.fixedOffset||null)}},{default:()=>{var i;return[(i=n.default)==null?void 0:i.call(n)]}})}),_wn=mt({headers:Array},"DataTable-header"),Y3e=Symbol.for("vuetify:data-table-headers"),G3e={title:"",sortable:!1},xwn={...G3e,width:48};function kwn(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(n=>({element:n,priority:0}));return{enqueue:(n,r)=>{let i=!1;for(let s=0;s<t.length;s++)if(t[s].priority>r){t.splice(s,0,{element:n,priority:r}),i=!0;break}i||t.push({element:n,priority:r})},size:()=>t.length,count:()=>{let n=0;if(!t.length)return 0;const r=Math.floor(t[0].priority);for(let i=0;i<t.length;i++)Math.floor(t[i].priority)===r&&(n+=1);return n},dequeue:()=>t.shift()}}function WF(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(!e.children)t.push(e);else for(const n of e.children)WF(n,t);return t}function K3e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;for(const n of e)n.key&&t.add(n.key),n.children&&K3e(n.children,t);return t}function Swn(e){if(e.key){if(e.key==="data-table-group")return G3e;if(["data-table-expand","data-table-select"].includes(e.key))return xwn}}function Lq(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.children?Math.max(t,...e.children.map(n=>Lq(n,t+1))):t}function Cwn(e){let t=!1;function n(s){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(s)if(o&&(s.fixed=!0),s.fixed)if(s.children)for(let a=s.children.length-1;a>=0;a--)n(s.children[a],!0);else t?isNaN(+s.width)&&(`${s.key}`,void 0):s.lastFixed=!0,t=!0;else if(s.children)for(let a=s.children.length-1;a>=0;a--)n(s.children[a]);else t=!1}for(let s=e.length-1;s>=0;s--)n(e[s]);function r(s){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!s)return o;if(s.children){s.fixedOffset=o;for(const a of s.children)o=r(a,o)}else s.fixed&&(s.fixedOffset=o,o+=parseFloat(s.width||"0")||0);return o}let i=0;for(const s of e)i=r(s,i)}function $wn(e,t){const n=[];let r=0;const i=kwn(e);for(;i.size()>0;){let o=i.count();const a=[];let l=1;for(;o>0;){const{element:c,priority:u}=i.dequeue(),d=t-r-Lq(c);if(a.push({...c,rowspan:d??1,colspan:c.children?WF(c).length:1}),c.children)for(const f of c.children){const h=u%1+l/Math.pow(10,r+2);i.enqueue(f,r+d+h)}l+=1,o-=1}r+=1,n.push(a)}return{columns:e.map(o=>WF(o)).flat(),headers:n}}function J3e(e){const t=[];for(const n of e){const r={...Swn(n),...n},i=r.key??(typeof r.value=="string"?r.value:null),s=r.value??i??null,o={...r,key:i,value:s,sortable:r.sortable??(r.key!=null||!!r.sort),children:r.children?J3e(r.children):void 0};t.push(o)}return t}function Twn(e,t){const n=Ve([]),r=Ve([]),i=Ve({}),s=Ve({}),o=Ve({});lo(()=>{var m,v,y;const c=(e.headers||Object.keys(e.items[0]??{}).map(_=>({key:_,title:uh(_)}))).slice(),u=K3e(c);(m=t==null?void 0:t.groupBy)!=null&&m.value.length&&!u.has("data-table-group")&&c.unshift({key:"data-table-group",title:"Group"}),(v=t==null?void 0:t.showSelect)!=null&&v.value&&!u.has("data-table-select")&&c.unshift({key:"data-table-select"}),(y=t==null?void 0:t.showExpand)!=null&&y.value&&!u.has("data-table-expand")&&c.push({key:"data-table-expand"});const d=J3e(c);Cwn(d);const f=Math.max(...d.map(_=>Lq(_)))+1,h=$wn(d,f);n.value=h.headers,r.value=h.columns;const p=h.headers.flat(1);for(const _ of p)_.key&&(_.sortable&&(_.sort&&(i.value[_.key]=_.sort),_.sortRaw&&(s.value[_.key]=_.sortRaw)),_.filter&&(o.value[_.key]=_.filter))});const a={headers:n,columns:r,sortFunctions:i,sortRawFunctions:s,filterFunctions:o};return fs(Y3e,a),a}function a4(){const e=ur(Y3e);if(!e)throw new Error("Missing headers!");return e}const Awn={showSelectAll:!1,allSelected:()=>[],select:e=>{var r;let{items:t,value:n}=e;return new Set(n?[(r=t[0])==null?void 0:r.value]:[])},selectAll:e=>{let{selected:t}=e;return t}},X3e={showSelectAll:!0,allSelected:e=>{let{currentPage:t}=e;return t},select:e=>{let{items:t,value:n,selected:r}=e;for(const i of t)n?r.add(i.value):r.delete(i.value);return r},selectAll:e=>{let{value:t,currentPage:n,selected:r}=e;return X3e.select({items:n,value:t,selected:r})}},Z3e={showSelectAll:!0,allSelected:e=>{let{allItems:t}=e;return t},select:e=>{let{items:t,value:n,selected:r}=e;for(const i of t)n?r.add(i.value):r.delete(i.value);return r},selectAll:e=>{let{value:t,allItems:n,selected:r}=e;return Z3e.select({items:n,value:t,selected:r})}},Ewn=mt({showSelect:Boolean,selectStrategy:{type:[String,Object],default:"page"},modelValue:{type:Array,default:()=>[]},valueComparator:{type:Function,default:w0}},"DataTable-select"),Q3e=Symbol.for("vuetify:data-table-selection");function Pwn(e,t){let{allItems:n,currentPage:r}=t;const i=Ar(e,"modelValue",e.modelValue,y=>new Set(ka(y).map(_=>{var b;return((b=n.value.find(x=>e.valueComparator(_,x.value)))==null?void 0:b.value)??_})),y=>[...y.values()]),s=te(()=>n.value.filter(y=>y.selectable)),o=te(()=>r.value.filter(y=>y.selectable)),a=te(()=>{if(typeof e.selectStrategy=="object")return e.selectStrategy;switch(e.selectStrategy){case"single":return Awn;case"all":return Z3e;case"page":default:return X3e}});function l(y){return ka(y).every(_=>i.value.has(_.value))}function c(y){return ka(y).some(_=>i.value.has(_.value))}function u(y,_){const b=a.value.select({items:y,value:_,selected:new Set(i.value)});i.value=b}function d(y){u([y],!l([y]))}function f(y){const _=a.value.selectAll({value:y,allItems:s.value,currentPage:o.value,selected:new Set(i.value)});i.value=_}const h=te(()=>i.value.size>0),p=te(()=>{const y=a.value.allSelected({allItems:s.value,currentPage:o.value});return!!y.length&&l(y)}),m=te(()=>a.value.showSelectAll),v={toggleSelect:d,select:u,selectAll:f,isSelected:l,isSomeSelected:c,someSelected:h,allSelected:p,showSelectAll:m};return fs(Q3e,v),v}function l4(){const e=ur(Q3e);if(!e)throw new Error("Missing selection!");return e}const Own=mt({sortBy:{type:Array,default:()=>[]},customKeySort:Object,multiSort:Boolean,mustSort:Boolean},"DataTable-sort"),e5e=Symbol.for("vuetify:data-table-sort");function Mwn(e){const t=Ar(e,"sortBy"),n=Et(e,"mustSort"),r=Et(e,"multiSort");return{sortBy:t,mustSort:n,multiSort:r}}function Rwn(e){const{sortBy:t,mustSort:n,multiSort:r,page:i}=e,s=l=>{if(l.key==null)return;let c=t.value.map(d=>({...d}))??[];const u=c.find(d=>d.key===l.key);u?u.order==="desc"?n.value?u.order="asc":c=c.filter(d=>d.key!==l.key):u.order="desc":r.value?c=[...c,{key:l.key,order:"asc"}]:c=[{key:l.key,order:"asc"}],t.value=c,i&&(i.value=1)};function o(l){return!!t.value.find(c=>c.key===l.key)}const a={sortBy:t,toggleSort:s,isSorted:o};return fs(e5e,a),a}function t5e(){const e=ur(e5e);if(!e)throw new Error("Missing sort!");return e}function jwn(e,t,n,r){const i=ed();return{sortedItems:te(()=>{var o,a;return!n.value.length||e.disableSort?t.value:Iwn(t.value,n.value,i.current.value,{transform:r==null?void 0:r.transform,sortFunctions:{...e.customKeySort,...(o=r==null?void 0:r.sortFunctions)==null?void 0:o.value},sortRawFunctions:(a=r==null?void 0:r.sortRawFunctions)==null?void 0:a.value})})}}function Iwn(e,t,n,r){const i=new Intl.Collator(n,{sensitivity:"accent",usage:"sort"});return e.map(o=>[o,r!=null&&r.transform?r.transform(o):o]).sort((o,a)=>{var l,c;for(let u=0;u<t.length;u++){let d=!1;const f=t[u].key,h=t[u].order??"asc";if(h===!1)continue;let p=o[1][f],m=a[1][f],v=o[0].raw,y=a[0].raw;if(h==="desc"&&([p,m]=[m,p],[v,y]=[y,v]),(l=r==null?void 0:r.sortRawFunctions)!=null&&l[f]){const _=r.sortRawFunctions[f](v,y);if(_==null)continue;if(d=!0,_)return _}if((c=r==null?void 0:r.sortFunctions)!=null&&c[f]){const _=r.sortFunctions[f](p,m);if(_==null)continue;if(d=!0,_)return _}if(!d){if(p instanceof Date&&m instanceof Date)return p.getTime()-m.getTime();if([p,m]=[p,m].map(_=>_!=null?_.toString().toLocaleLowerCase():_),p!==m)return zA(p)&&zA(m)?0:zA(p)?-1:zA(m)?1:!isNaN(p)&&!isNaN(m)?Number(p)-Number(m):i.compare(p,m)}}return 0}).map(o=>{let[a]=o;return a})}const n5e=mt({color:String,sticky:Boolean,disableSort:Boolean,multiSort:Boolean,sortAscIcon:{type:Yr,default:"$sortAsc"},sortDescIcon:{type:Yr,default:"$sortDesc"},headerProps:{type:Object},...T$(),...B5()},"VDataTableHeaders"),Ede=Vt()({name:"VDataTableHeaders",props:n5e(),setup(e,t){let{slots:n}=t;const{t:r}=ed(),{toggleSort:i,sortBy:s,isSorted:o}=t5e(),{someSelected:a,allSelected:l,selectAll:c,showSelectAll:u}=l4(),{columns:d,headers:f}=a4(),{loaderClasses:h}=R$(e);function p(A,T){if(!(!e.sticky&&!A.fixed))return{position:"sticky",left:A.fixed?An(A.fixedOffset):void 0,top:e.sticky?`calc(var(--v-table-header-height) * ${T})`:void 0}}function m(A){const T=s.value.find(O=>O.key===A.key);return T?T.order==="asc"?e.sortAscIcon:e.sortDescIcon:e.sortAscIcon}const{backgroundColorClasses:v,backgroundColorStyles:y}=cl(e,"color"),{displayClasses:_,mobile:b}=_0(e),x=te(()=>({headers:f.value,columns:d.value,toggleSort:i,isSorted:o,sortBy:s.value,someSelected:a.value,allSelected:l.value,selectAll:c,getSortIcon:m})),k=te(()=>["v-data-table__th",{"v-data-table__th--sticky":e.sticky},_.value,h.value]),C=A=>{let{column:T,x:O,y:F}=A;const P=T.key==="data-table-select"||T.key==="data-table-expand",L=ut(e.headerProps??{},T.headerProps??{});return R(o5,ut({tag:"th",align:T.align,class:[{"v-data-table__th--sortable":T.sortable&&!e.disableSort,"v-data-table__th--sorted":o(T),"v-data-table__th--fixed":T.fixed},...k.value],style:{width:An(T.width),minWidth:An(T.minWidth),maxWidth:An(T.maxWidth),...p(T,F)},colspan:T.colspan,rowspan:T.rowspan,onClick:T.sortable?()=>i(T):void 0,fixed:T.fixed,nowrap:T.nowrap,lastFixed:T.lastFixed,noPadding:P},L),{default:()=>{var B;const q=`header.${T.key}`,V={column:T,selectAll:c,isSorted:o,toggleSort:i,sortBy:s.value,someSelected:a.value,allSelected:l.value,getSortIcon:m};return n[q]?n[q](V):T.key==="data-table-select"?((B=n["header.data-table-select"])==null?void 0:B.call(n,V))??(u.value&&R(my,{modelValue:l.value,indeterminate:a.value&&!l.value,"onUpdate:modelValue":c},null)):R("div",{class:"v-data-table-header__content"},[R("span",null,[T.title]),T.sortable&&!e.disableSort&&R(Tr,{key:"icon",class:"v-data-table-header__sort-icon",icon:m(T)},null),e.multiSort&&o(T)&&R("div",{key:"badge",class:["v-data-table-header__sort-badge",...v.value],style:y.value},[s.value.findIndex(Y=>Y.key===T.key)+1])])}})},S=()=>{const A=ut(e.headerProps??{}??{}),T=te(()=>d.value.filter(F=>(F==null?void 0:F.sortable)&&!e.disableSort)),O=te(()=>{if(d.value.find(P=>P.key==="data-table-select")!=null)return l.value?"$checkboxOn":a.value?"$checkboxIndeterminate":"$checkboxOff"});return R(o5,ut({tag:"th",class:[...k.value],colspan:f.value.length+1},A),{default:()=>[R("div",{class:"v-data-table-header__content"},[R(Ky,{chips:!0,class:"v-data-table__td-sort-select",clearable:!0,density:"default",items:T.value,label:r("$vuetify.dataTable.sortBy"),multiple:e.multiSort,variant:"underlined","onClick:clear":()=>s.value=[],appendIcon:O.value,"onClick:append":()=>c(!l.value)},{...n,chip:F=>{var P;return R(Km,{onClick:(P=F.item.raw)!=null&&P.sortable?()=>i(F.item.raw):void 0,onMousedown:L=>{L.preventDefault(),L.stopPropagation()}},{default:()=>[F.item.title,R(Tr,{class:["v-data-table__td-sort-icon",o(F.item.raw)&&"v-data-table__td-sort-icon-active"],icon:m(F.item.raw),size:"small"},null)]})}})])]})};Xt(()=>b.value?R("tr",null,[R(S,null,null)]):R(Ke,null,[n.headers?n.headers(x.value):f.value.map((A,T)=>R("tr",null,[A.map((O,F)=>R(C,{column:O,x:F,y:T},null))])),e.loading&&R("tr",{class:"v-data-table-progress"},[R("th",{colspan:d.value.length},[R(V5,{name:"v-data-table-progress",absolute:!0,active:!0,color:typeof e.loading=="boolean"?void 0:e.loading,indeterminate:!0},{default:n.loader})])])]))}}),Dwn=mt({groupBy:{type:Array,default:()=>[]}},"DataTable-group"),r5e=Symbol.for("vuetify:data-table-group");function Lwn(e){return{groupBy:Ar(e,"groupBy")}}function Nwn(e){const{groupBy:t,sortBy:n}=e,r=Ve(new Set),i=te(()=>t.value.map(c=>({...c,order:c.order??!1})).concat(n.value));function s(c){return r.value.has(c.id)}function o(c){const u=new Set(r.value);s(c)?u.delete(c.id):u.add(c.id),r.value=u}function a(c){function u(d){const f=[];for(const h of d.items)"type"in h&&h.type==="group"?f.push(...u(h)):f.push(h);return f}return u({type:"group",items:c,id:"dummy",key:"dummy",value:"dummy",depth:0})}const l={sortByWithGroups:i,toggleGroup:o,opened:r,groupBy:t,extractRows:a,isGroupOpen:s};return fs(r5e,l),l}function i5e(){const e=ur(r5e);if(!e)throw new Error("Missing group!");return e}function Fwn(e,t){if(!e.length)return[];const n=new Map;for(const r of e){const i=YS(r.raw,t);n.has(i)||n.set(i,[]),n.get(i).push(r)}return n}function s5e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"root";if(!t.length)return[];const i=Fwn(e,t[0]),s=[],o=t.slice(1);return i.forEach((a,l)=>{const c=t[0],u=`${r}_${c}_${l}`;s.push({depth:n,id:u,key:c,value:l,items:o.length?s5e(a,o,n+1,u):a,type:"group"})}),s}function o5e(e,t){const n=[];for(const r of e)"type"in r&&r.type==="group"?(r.value!=null&&n.push(r),(t.has(r.id)||r.value==null)&&n.push(...o5e(r.items,t))):n.push(r);return n}function Bwn(e,t,n){return{flatItems:te(()=>{if(!t.value.length)return e.value;const i=s5e(e.value,t.value.map(s=>s.key));return o5e(i,n.value)})}}const Vwn=mt({item:{type:Object,required:!0}},"VDataTableGroupHeaderRow"),zwn=Vt()({name:"VDataTableGroupHeaderRow",props:Vwn(),setup(e,t){let{slots:n}=t;const{isGroupOpen:r,toggleGroup:i,extractRows:s}=i5e(),{isSelected:o,isSomeSelected:a,select:l}=l4(),{columns:c}=a4(),u=te(()=>s([e.item]));return()=>R("tr",{class:"v-data-table-group-header-row",style:{"--v-data-table-group-header-row-depth":e.item.depth}},[c.value.map(d=>{var f,h;if(d.key==="data-table-group"){const p=r(e.item)?"$expand":"$next",m=()=>i(e.item);return((f=n["data-table-group"])==null?void 0:f.call(n,{item:e.item,count:u.value.length,props:{icon:p,onClick:m}}))??R(o5,{class:"v-data-table-group-header-row__column"},{default:()=>[R(nr,{size:"small",variant:"text",icon:p,onClick:m},null),R("span",null,[e.item.value]),R("span",null,[$n("("),u.value.length,$n(")")])]})}if(d.key==="data-table-select"){const p=o(u.value),m=a(u.value)&&!p,v=y=>l(u.value,y);return((h=n["data-table-select"])==null?void 0:h.call(n,{props:{modelValue:p,indeterminate:m,"onUpdate:modelValue":v}}))??R("td",null,[R(my,{modelValue:p,indeterminate:m,"onUpdate:modelValue":v},null)])}return R("td",null,null)})])}}),Wwn=mt({expandOnClick:Boolean,showExpand:Boolean,expanded:{type:Array,default:()=>[]}},"DataTable-expand"),a5e=Symbol.for("vuetify:datatable:expanded");function Hwn(e){const t=Et(e,"expandOnClick"),n=Ar(e,"expanded",e.expanded,a=>new Set(a),a=>[...a.values()]);function r(a,l){const c=new Set(n.value);l?c.add(a.value):c.delete(a.value),n.value=c}function i(a){return n.value.has(a.value)}function s(a){r(a,!i(a))}const o={expand:r,expanded:n,expandOnClick:t,isExpanded:i,toggleExpand:s};return fs(a5e,o),o}function l5e(){const e=ur(a5e);if(!e)throw new Error("foo");return e}const Uwn=mt({index:Number,item:Object,cellProps:[Object,Function],onClick:Gc(),onContextmenu:Gc(),onDblclick:Gc(),...T$()},"VDataTableRow"),qwn=Vt()({name:"VDataTableRow",props:Uwn(),setup(e,t){let{slots:n}=t;const{displayClasses:r,mobile:i}=_0(e,"v-data-table__tr"),{isSelected:s,toggleSelect:o,someSelected:a,allSelected:l,selectAll:c}=l4(),{isExpanded:u,toggleExpand:d}=l5e(),{toggleSort:f,sortBy:h,isSorted:p}=t5e(),{columns:m}=a4();Xt(()=>R("tr",{class:["v-data-table__tr",{"v-data-table__tr--clickable":!!(e.onClick||e.onContextmenu||e.onDblclick)},r.value],onClick:e.onClick,onContextmenu:e.onContextmenu,onDblclick:e.onDblclick},[e.item&&m.value.map((v,y)=>{const _=e.item,b=`item.${v.key}`,x=`header.${v.key}`,k={index:e.index,item:_.raw,internalItem:_,value:YS(_.columns,v.key),column:v,isSelected:s,toggleSelect:o,isExpanded:u,toggleExpand:d},C={column:v,selectAll:c,isSorted:p,toggleSort:f,sortBy:h.value,someSelected:a.value,allSelected:l.value,getSortIcon:()=>""},S=typeof e.cellProps=="function"?e.cellProps({index:k.index,item:k.item,internalItem:k.internalItem,value:k.value,column:v}):e.cellProps,A=typeof v.cellProps=="function"?v.cellProps({index:k.index,item:k.item,internalItem:k.internalItem,value:k.value}):v.cellProps;return R(o5,ut({align:v.align,class:{"v-data-table__td--expanded-row":v.key==="data-table-expand","v-data-table__td--select-row":v.key==="data-table-select"},fixed:v.fixed,fixedOffset:v.fixedOffset,lastFixed:v.lastFixed,maxWidth:i.value?void 0:v.maxWidth,noPadding:v.key==="data-table-select"||v.key==="data-table-expand",nowrap:v.nowrap,width:i.value?void 0:v.width},S,A),{default:()=>{var O,F,P,L,q;if(n[b]&&!i.value)return(O=n[b])==null?void 0:O.call(n,k);if(v.key==="data-table-select")return((F=n["item.data-table-select"])==null?void 0:F.call(n,k))??R(my,{disabled:!_.selectable,modelValue:s([_]),onClick:qu(()=>o(_),["stop"])},null);if(v.key==="data-table-expand")return((P=n["item.data-table-expand"])==null?void 0:P.call(n,k))??R(nr,{icon:u(_)?"$collapse":"$expand",size:"small",variant:"text",onClick:qu(()=>d(_),["stop"])},null);const T=Ct(k.value);return i.value?R(Ke,null,[R("div",{class:"v-data-table__td-title"},[((L=n[x])==null?void 0:L.call(n,C))??v.title]),R("div",{class:"v-data-table__td-value"},[((q=n[b])==null?void 0:q.call(n,k))??T])]):T}})})]))}}),c5e=mt({loading:[Boolean,String],loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideNoData:Boolean,items:{type:Array,default:()=>[]},noDataText:{type:String,default:"$vuetify.noDataText"},rowProps:[Object,Function],cellProps:[Object,Function],...T$()},"VDataTableRows"),Pde=Vt()({name:"VDataTableRows",inheritAttrs:!1,props:c5e(),setup(e,t){let{attrs:n,slots:r}=t;const{columns:i}=a4(),{expandOnClick:s,toggleExpand:o,isExpanded:a}=l5e(),{isSelected:l,toggleSelect:c}=l4(),{toggleGroup:u,isGroupOpen:d}=i5e(),{t:f}=ed(),{mobile:h}=_0(e);return Xt(()=>{var p,m;return e.loading&&(!e.items.length||r.loading)?R("tr",{class:"v-data-table-rows-loading",key:"loading"},[R("td",{colspan:i.value.length},[((p=r.loading)==null?void 0:p.call(r))??f(e.loadingText)])]):!e.loading&&!e.items.length&&!e.hideNoData?R("tr",{class:"v-data-table-rows-no-data",key:"no-data"},[R("td",{colspan:i.value.length},[((m=r["no-data"])==null?void 0:m.call(r))??f(e.noDataText)])]):R(Ke,null,[e.items.map((v,y)=>{var x;if(v.type==="group"){const k={index:y,item:v,columns:i.value,isExpanded:a,toggleExpand:o,isSelected:l,toggleSelect:c,toggleGroup:u,isGroupOpen:d};return r["group-header"]?r["group-header"](k):R(zwn,ut({key:`group-header_${v.id}`,item:v},OJ(n,":group-header",()=>k)),r)}const _={index:y,item:v.raw,internalItem:v,columns:i.value,isExpanded:a,toggleExpand:o,isSelected:l,toggleSelect:c},b={..._,props:ut({key:`item_${v.key??v.index}`,onClick:s.value?()=>{o(v)}:void 0,index:y,item:v,cellProps:e.cellProps,mobile:h.value},OJ(n,":row",()=>_),typeof e.rowProps=="function"?e.rowProps({item:_.item,index:_.index,internalItem:_.internalItem}):e.rowProps)};return R(Ke,{key:b.props.key},[r.item?r.item(b):R(qwn,b.props,r),a(v)&&((x=r["expanded-row"])==null?void 0:x.call(r,_))])})])}),{}}}),u5e=mt({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,...Fn(),...xc(),...Mi(),...js()},"VTable"),Ode=Vt()({name:"VTable",props:u5e(),setup(e,t){let{slots:n,emit:r}=t;const{themeClasses:i}=ko(e),{densityClasses:s}=nd(e);return Xt(()=>R(e.tag,{class:["v-table",{"v-table--fixed-height":!!e.height,"v-table--fixed-header":e.fixedHeader,"v-table--fixed-footer":e.fixedFooter,"v-table--has-top":!!n.top,"v-table--has-bottom":!!n.bottom,"v-table--hover":e.hover},i.value,s.value,e.class],style:e.style},{default:()=>{var o,a,l;return[(o=n.top)==null?void 0:o.call(n),n.default?R("div",{class:"v-table__wrapper",style:{height:An(e.height)}},[R("table",null,[n.default()])]):(a=n.wrapper)==null?void 0:a.call(n),(l=n.bottom)==null?void 0:l.call(n)]}})),{}}}),Ywn=mt({items:{type:Array,default:()=>[]},itemValue:{type:[String,Array,Function],default:"id"},itemSelectable:{type:[String,Array,Function],default:null},rowProps:[Object,Function],cellProps:[Object,Function],returnObject:Boolean},"DataTable-items");function Gwn(e,t,n,r){const i=e.returnObject?t:Bc(t,e.itemValue),s=Bc(t,e.itemSelectable,!0),o=r.reduce((a,l)=>(l.key!=null&&(a[l.key]=Bc(t,l.value)),a),{});return{type:"item",key:e.returnObject?Bc(t,e.itemValue):i,index:n,value:i,selectable:s,columns:o,raw:t}}function Kwn(e,t,n){return t.map((r,i)=>Gwn(e,r,i,n))}function Jwn(e,t){return{items:te(()=>Kwn(e,e.items,t.value))}}function Xwn(e){let{page:t,itemsPerPage:n,sortBy:r,groupBy:i,search:s}=e;const o=xo("VDataTable"),a=te(()=>({page:t.value,itemsPerPage:n.value,sortBy:r.value,groupBy:i.value,search:s.value}));let l=null;Nt(a,()=>{w0(l,a.value)||(l&&l.search!==a.value.search&&(t.value=1),o.emit("update:options",a.value),l=a.value)},{deep:!0,immediate:!0})}const Zwn=mt({...c5e(),hideDefaultBody:Boolean,hideDefaultFooter:Boolean,hideDefaultHeader:Boolean,width:[String,Number],search:String,...Wwn(),...Dwn(),..._wn(),...Ywn(),...Ewn(),...Own(),...n5e(),...u5e()},"DataTable"),Qwn=mt({...gwn(),...Zwn(),...HAe(),...q3e()},"VDataTable"),e_n=Vt()({name:"VDataTable",props:Qwn(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:groupBy":e=>!0,"update:expanded":e=>!0,"update:currentItems":e=>!0},setup(e,t){let{attrs:n,slots:r}=t;const{groupBy:i}=Lwn(e),{sortBy:s,multiSort:o,mustSort:a}=Mwn(e),{page:l,itemsPerPage:c}=vwn(e),{columns:u,headers:d,sortFunctions:f,sortRawFunctions:h,filterFunctions:p}=Twn(e,{groupBy:i,showSelect:Et(e,"showSelect"),showExpand:Et(e,"showExpand")}),{items:m}=Jwn(e,u),v=Et(e,"search"),{filteredItems:y}=UAe(e,m,v,{transform:G=>G.columns,customKeyFilter:p}),{toggleSort:_}=Rwn({sortBy:s,multiSort:o,mustSort:a,page:l}),{sortByWithGroups:b,opened:x,extractRows:k,isGroupOpen:C,toggleGroup:S}=Nwn({groupBy:i,sortBy:s}),{sortedItems:A}=jwn(e,y,b,{transform:G=>G.columns,sortFunctions:f,sortRawFunctions:h}),{flatItems:T}=Bwn(A,i,x),O=te(()=>T.value.length),{startIndex:F,stopIndex:P,pageCount:L,setItemsPerPage:q}=ywn({page:l,itemsPerPage:c,itemsLength:O}),{paginatedItems:V}=wwn({items:T,startIndex:F,stopIndex:P,itemsPerPage:c}),B=te(()=>k(V.value)),{isSelected:Y,select:D,selectAll:K,toggleSelect:z,someSelected:N,allSelected:Z}=Pwn(e,{allItems:m,currentPage:B}),{isExpanded:j,toggleExpand:M}=Hwn(e);Xwn({page:l,itemsPerPage:c,sortBy:s,groupBy:i,search:v}),eu({VDataTableRows:{hideNoData:Et(e,"hideNoData"),noDataText:Et(e,"noDataText"),loading:Et(e,"loading"),loadingText:Et(e,"loadingText")}});const W=te(()=>({page:l.value,itemsPerPage:c.value,sortBy:s.value,pageCount:L.value,toggleSort:_,setItemsPerPage:q,someSelected:N.value,allSelected:Z.value,isSelected:Y,select:D,selectAll:K,toggleSelect:z,isExpanded:j,toggleExpand:M,isGroupOpen:C,toggleGroup:S,items:B.value.map(G=>G.raw),internalItems:B.value,groupedItems:V.value,columns:u.value,headers:d.value}));return Xt(()=>{const G=Ade.filterProps(e),I=Ede.filterProps(e),ue=Pde.filterProps(e),be=Ode.filterProps(e);return R(Ode,ut({class:["v-data-table",{"v-data-table--show-select":e.showSelect,"v-data-table--loading":e.loading},e.class],style:e.style},be),{top:()=>{var se;return(se=r.top)==null?void 0:se.call(r,W.value)},default:()=>{var se,de,he,ee,ne,pe;return r.default?r.default(W.value):R(Ke,null,[(se=r.colgroup)==null?void 0:se.call(r,W.value),!e.hideDefaultHeader&&R("thead",{key:"thead"},[R(Ede,I,r)]),(de=r.thead)==null?void 0:de.call(r,W.value),!e.hideDefaultBody&&R("tbody",null,[(he=r["body.prepend"])==null?void 0:he.call(r,W.value),r.body?r.body(W.value):R(Pde,ut(n,ue,{items:V.value}),r),(ee=r["body.append"])==null?void 0:ee.call(r,W.value)]),(ne=r.tbody)==null?void 0:ne.call(r,W.value),(pe=r.tfoot)==null?void 0:pe.call(r,W.value)])},bottom:()=>r.bottom?r.bottom(W.value):!e.hideDefaultFooter&&R(Ke,null,[R(pv,null,null),R(Ade,G,{prepend:r["footer.prepend"]})])})}),{}}}),t_n={props:{adminSchema:{type:Object,required:!0},categorySchema:{type:Jy,required:!0}},components:{FieldsContainer:xx,FormCreate:H3e},data(){return{filtersOpen:!1,loading:!1,pageData:{},pageInfo:{},headers:{},selected:[],search:null,filters:{},perPageOptions:[25,50,100,150],actionToAll:!1,actionFormData:null,actionDialogConfirmation:!1,actionFormDialogOpen:!1,actionSelected:null,actionLoading:!1,persistentMessageDialog:!1,persistentMessage:null,isNarrow:!1}},mounted(){const e=window.matchMedia("(max-width: 1280px)");this.isNarrow=e.matches,e.addEventListener("change",t=>{this.isNarrow=t.matches})},created(){this.headers=this.getHeaders(),this.pageInfo={page:1,limit:j_().page_size||25},this.deserializeQuery(),this.getListData()},methods:{getHeaders(){let e=[];const t=this.categorySchema.getTableInfo();for(const n of t.table_schema.list_display){const r=t.table_schema.fields[n];if(!r){console.error("Table field from listDisplay not found:",n);continue}const i=r.header||{};i.field=r,i.key=n,i.type=r.type,i.title=r.label,i.align=i.align||"left",i.sortable=t.ordering_fields.indexOf(n)>=0,e.push(i)}return e},clickRow(e,t){e.ctrlKey&&(this.selected.includes(t.item.id)?this.selected.splice(this.selected.indexOf(t.item.id),1):this.selected.push(t.item.id))},getSelectedCount(){return this.actionToAll?this.getTotalCount():this.selected?this.selected.length:0},hasFilters(){const e=this.categorySchema.getTableInfo().table_filters;return this.categorySchema.getTableInfo().search_enabled||e&&Object.keys(e).length>0},getTotalCount(){return this.pageData.total_count||0},canCreate(){return this.categorySchema.getTableInfo().can_create},canRetrieve(){return this.categorySchema.getTableInfo().can_retrieve},handleClick(e,t){if(e==0&&this.canRetrieve()){const n=t[this.categorySchema.getTableInfo().pk_name];if(!this.categorySchema.getTableInfo().pk_name||!n){console.error(`PK value "${this.categorySchema.getTableInfo().pk_name}" not found in row:`,t);return}const r=kge(this.categorySchema.group,this.categorySchema.category,n);this.$router.push({path:r})}},deserializeQuery(){if(!this.categorySchema.group)return;const e=this.$route.query.page;e&&(this.pageInfo.page=parseInt(e));const t=this.$route.query.limit;if(t){let s=parseInt(t);this.pageInfo.limit=Math.min(150,Math.max(25,s))}const n=this.$route.query.ordering;n&&(this.ordering=n);const r=this.$route.query.search;r&&(this.search=r);const i=this.categorySchema.getTableInfo().table_filters||{};this.filters=zbn(this.$route,Object.keys(i))},serializeQuery(){if(!this.categorySchema.group)return;let e={};this.pageInfo.page&&(e.page=this.pageInfo.page),this.pageInfo.limit&&(e.limit=this.pageInfo.limit),this.ordering&&(e.ordering=this.ordering),this.search&&(e.search=this.search),e=Wbn(e,this.filters),this.$router.push({name:this.$route.name,query:e})},async getListData(){this.loading=!0,Wmn({pageInfo:this.pageInfo,filters:this.filters,search:this.search,ordering:this.ordering,group:this.categorySchema.group,category:this.categorySchema.category}).then(e=>{this.pageData=e,this.loading=!1}).catch(e=>{this.loading=!1,console.error("Get list error:",e);const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},handleFilter(e,t){this.pageInfo.page=1,this.filters=e,this.search=t,this.serializeQuery(),this.getListData()},hasActons(){return this.categorySchema.getTableInfo().actions?Object.keys(this.categorySchema.getTableInfo().actions).length>0:!1},isShowSelect(){return this.hasActons()},changePagination(){let e=j_();e.page_size=this.pageInfo.limit,NB(e),this.selected=[],this.serializeQuery(),this.getListData()},getPagesLength(){return Math.ceil((this.pageData.total_count||0)/this.pageInfo.limit)},pressAction(e,t){if(!e.allow_empty_selection&&!this.actionToAll&&this.selected.length===0){Ur(this.$t("actionNotAllowEmptySelection"),{limit:3,theme:"auto",type:"warning",position:"top-center"});return}this.actionFormData=null,this.actionMeta=null,this.actionSelected=t,e.form_schema?this.actionFormDialogOpen=!0:e.confirmation_text?this.actionDialogConfirmation=!0:this.applyAction()},getActionInfo(){return this.categorySchema.getTableInfo().actions[this.actionSelected]},applyAction(){this.actionLoading=!0,Gmn({group:this.categorySchema.group,category:this.categorySchema.category,action:this.actionSelected,pks:this.selected,formData:this.actionFormData||{},sendToAll:this.actionToAll,filters:this.filters,search:this.search}).then(e=>{if(e.headers["content-type"]!=="application/json"){const t=e.headers.pragma||`${Yt().format("DD.MM.YYYY_HH:MM")}.csv`;qmn(e.data,t,e.headers["content-type"])}else e.data.message?Ur(e.data.message.text,{type:e.data.message.type,position:e.data.message.position,dangerouslyHTMLString:!0}):e.data.persistent_message?(this.persistentMessageDialog=!0,this.persistentMessage=e.data.persistent_message):Ur(this.$t("successAdminAction"));this.actionDialogConfirmation=!1,this.actionFormDialogOpen=!1,this.actionLoading=!1,this.selected=[],this.getListData()}).catch(e=>{this.actionLoading=!1,console.error(`Admin action ${this.actionSelected} error:`,e);const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},updateSortBy(e){if(!e[0])this.ordering=null;else{const t=e[0].order==="desc"?"-":"",n=e[0].key;this.ordering=`${t}${n}`}this.serializeQuery(),this.getListData()},formatDateTime(e){if(e)return Yt(e).format("YYYY-MM-DD HH:mm")},getTableInfo(){return this.categorySchema.getTableInfo()},getChoiceValue(e,t){const n=e[t.key];return typeof n=="object"?n.value:n},getChoiceColor(e,t){const n=e[t.key];if(typeof n=="object"&&n.tag_color)return n.tag_color;if(t.field.choices){const r=this.getChoiceValue(e,t),i=t.field.choices.find(s=>s.value===r);if(i)return i.tag_color}return null},getChoiceTitle(e,t){const n=e[t.key];return typeof n=="object"?n.title:n},formatRelated(e){return e?Array.isArray(e)?e:[e]:[]},createdEvent(){this.serializeQuery(),this.getListData()},stripHtml(e){var n;const t=document.createElement("div");return t.innerHTML=e,((n=t.textContent)==null?void 0:n.trim())??""},truncate:dwn,getFiltersCount(){var e=0;return this.search&&(e+=1),this.filters&&(e+=Object.values(this.filters).filter(t=>t!=null).length),e},hasTagColors(e){return Array.isArray(e.choices)?e.choices.some(t=>t&&typeof t=="object"&&"tag_color"in t):!1}}},n_n={class:"list-page"},r_n={class:"list-above-block"},i_n={class:"header-row-filters"},s_n={key:0,class:"filters-inline"},o_n={key:1,class:"filters-drawer"},a_n={class:"navbar-filters"},l_n={class:"filters-drawer-header"},c_n={class:"header-row-actions"},u_n={key:0,class:"table-button"},d_n=["onClick"],f_n={key:4,class:"cell-string"},h_n={key:0,class:"cell-string"},p_n={key:1,class:"cell-string"},m_n={class:"cell-string"},g_n={class:"table-bottom"},v_n={key:0,class:"table-bottom-cell"},y_n={class:"selected-count"},b_n={class:"table-bottom-cell actions-cell"},w_n={class:"table-bottom-cell"},__n={class:"confirmation-text"},x_n={class:"selected-count"},k_n=["innerHTML"];function S_n(e,t,n,r,i,s){const o=z3e,a=H3e,l=xx;return fe(),Me("div",n_n,[Je("div",r_n,[Je("div",i_n,[i.isNarrow?(fe(),Me("div",o_n,[R(XB,{modelValue:i.filtersOpen,"onUpdate:modelValue":t[1]||(t[1]=c=>i.filtersOpen=c),location:"right",temporary:"",class:"filters-drawer-panel",width:"320"},{default:Re(()=>[Je("div",a_n,[Je("div",l_n,[R(nr,{icon:"mdi-close",onClick:t[0]||(t[0]=c=>i.filtersOpen=!1)})]),R(o,{"category-schema":n.categorySchema,"filters-init":i.filters,"search-init":i.search,onFiltered:s.handleFilter,loading:e.listLoading,"search-enabled":s.getTableInfo().search_enabled,"fields-info":s.getTableInfo().table_filters.fields,"search-help":s.getTableInfo().search_help},null,8,["category-schema","filters-init","search-init","onFiltered","loading","search-enabled","fields-info","search-help"])])]),_:1},8,["modelValue"]),s.getFiltersCount()>0?(fe(),at(hwn,{key:0,content:s.getFiltersCount(),onClick:t[2]||(t[2]=c=>i.filtersOpen=!0)},{default:Re(()=>[R(nr,{icon:"mdi-filter-variant"})]),_:1},8,["content"])):(fe(),at(nr,{key:1,icon:"mdi-filter-variant",onClick:t[3]||(t[3]=c=>i.filtersOpen=!0)}))])):(fe(),Me("div",s_n,[s.hasFilters()?(fe(),at(o,{key:0,"category-schema":n.categorySchema,"filters-init":i.filters,"search-init":i.search,onFiltered:s.handleFilter,loading:e.listLoading,"search-enabled":s.getTableInfo().search_enabled,"fields-info":s.getTableInfo().table_filters.fields,"search-help":s.getTableInfo().search_help},null,8,["category-schema","filters-init","search-init","onFiltered","loading","search-enabled","fields-info","search-help"])):Xe("",!0)]))]),Je("div",c_n,[s.canCreate()?(fe(),Me("div",u_n,[R(a,{title:n.categorySchema.title,"admin-schema":n.adminSchema,"category-schema":n.categorySchema,onCreated:s.createdEvent},null,8,["title","admin-schema","category-schema","onCreated"])])):Xe("",!0)])]),R(e_n,{class:"model-table",color:"primary",modelValue:i.selected,"onUpdate:modelValue":t[5]||(t[5]=c=>i.selected=c),items:i.pageData.data||[],headers:i.headers,loading:i.loading,"show-select":s.isShowSelect(),"items-per-page":i.pageInfo.limit,page:i.pageInfo.page,"onUpdate:sortBy":s.updateSortBy,"onClick:row":s.clickRow},Fa({bottom:Re(()=>[]),"header.data-table-select":Re(({on:c,props:u})=>[R(PS,{text:`${e.$t("applyToAllRecords")} ${s.getTotalCount()}`},{activator:Re(({props:d})=>[Je("div",ut(d,{class:"select-to-all"}),[R(CWe,{modelValue:i.actionToAll,"onUpdate:modelValue":t[4]||(t[4]=f=>i.actionToAll=f),color:"var(--color-darken-2)",density:"compact"},null,8,["modelValue"])],16)]),_:2},1032,["text"])]),_:2},[Cn(i.headers,(c,u)=>({name:`item.${c.key}`,fn:Re(({item:d})=>[Je("div",{onClick:f=>s.handleClick(u,d),class:Pt({"table-cell":!0,"table-link":u===0&&s.canRetrieve()})},[c.type==="string"?(fe(),Me(Ke,{key:0},[$n(Ct(s.stripHtml(d[c.key])),1)],64)):c.type==="related"?(fe(!0),Me(Ke,{key:1},Cn(s.formatRelated(d[c.key]),f=>(fe(),at(PS,{key:f.key},{activator:Re(({props:h})=>[R(Km,ut({size:c.field.size||"default",ref_for:!0},h),{default:Re(()=>[$n(Ct(s.truncate(f.title,30)),1)]),_:2},1040,["size"])]),default:Re(()=>[$n(" #"+Ct(f.key)+" "+Ct(f.title)+" ",1)]),_:2},1024))),128)):c.type==="boolean"?(fe(),Me(Ke,{key:2},[d[c.key]?(fe(),at(Tr,{key:0,color:"green-darken-2",icon:"mdi-check",size:"small"})):(fe(),at(Tr,{key:1,color:"red-darken-2",icon:"mdi-close",size:"small"}))],64)):c.type==="choice"?(fe(),Me(Ke,{key:3},[d[c.key]!==null&&d[c.key]!==void 0?(fe(),Me(Ke,{key:0},[s.hasTagColors(c.field)?(fe(),at(Km,{key:0,class:"table-choice-chip",size:c.field.size||"default",variant:c.field.variant,color:s.getChoiceColor(d,c)},{default:Re(()=>[$n(Ct(s.getChoiceTitle(d,c)),1)]),_:2},1032,["size","variant","color"])):(fe(),Me(Ke,{key:1},[$n(Ct(s.getChoiceTitle(d,c)),1)],64))],64)):Xe("",!0)],64)):c.type==="datetime"?(fe(),Me("span",f_n,Ct(s.formatDateTime(d[c.key])),1)):c.type==="image"?(fe(),Me(Ke,{key:5},[d[c.key]&&d[c.key].url?(fe(),at(vg,{key:0,class:"image-preview","max-height":c.field.preview_max_height||100,"max-width":c.field.preview_max_width||100,cover:"",src:d[c.key].url},null,8,["max-height","max-width","src"])):Xe("",!0)],64)):c.type==="file"?(fe(),Me(Ke,{key:6},[d[c.key]?(fe(),Me("span",h_n,Ct(d[c.key].name),1)):(fe(),Me("span",p_n,Ct(d[c.key]),1))],64)):(fe(),Me(Ke,{key:7},[Je("div",{class:Pt(c.type),style:{display:"none"}},null,2),Je("span",m_n,Ct(d[c.key]),1)],64))],10,d_n)])}))]),1032,["modelValue","items","headers","loading","show-select","items-per-page","page","onUpdate:sortBy","onClick:row"]),Je("div",g_n,[s.hasActons()?(fe(),Me("div",v_n,[R(Fu,{class:"info"},{default:Re(()=>[i.isNarrow?Xe("",!0):(fe(),Me(Ke,{key:0},[$n(Ct(e.$t("selected")),1)],64)),Je("p",y_n,Ct(s.getSelectedCount())+"/"+Ct(s.getTotalCount()),1)]),_:1})])):Xe("",!0),Je("div",b_n,[i.isNarrow?(fe(),at(a9,{key:1},{activator:Re(({props:c})=>[R(nr,ut({class:"action-button-opener"},c,{color:"primary",icon:"mdi-dots-vertical",disabled:i.actionLoading}),null,16,["disabled"])]),default:Re(()=>[R(Jv,null,{default:Re(()=>[(fe(!0),Me(Ke,null,Cn(n.categorySchema.getTableInfo().actions,(c,u)=>(fe(),at(Ia,{key:u,onClick:d=>s.pressAction(c,u)},{default:Re(()=>[R(Lme,null,{default:Re(()=>[$n(Ct(c.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})):(fe(!0),Me(Ke,{key:0},Cn(n.categorySchema.getTableInfo().actions,(c,u)=>(fe(),at(nr,{key:u,size:"small",class:"action-button",variant:c.variant||"flat","prepend-icon":c.icon,"base-color":c.base_color||"secondary",onClick:d=>s.pressAction(c,u),disabled:i.actionLoading},{default:Re(()=>[$n(Ct(c.title),1)]),_:2},1032,["variant","prepend-icon","base-color","onClick","disabled"]))),128))]),Je("div",w_n,[R(PS,{location:"start",text:e.$t("itemsPerPage")},{activator:Re(({props:c})=>[Je("div",Po(ya(c)),[R(Ky,{class:"list-pagination-per-page",modelValue:i.pageInfo.limit,"onUpdate:modelValue":[t[6]||(t[6]=u=>i.pageInfo.limit=u),t[7]||(t[7]=u=>{this.pageInfo.page=1,s.changePagination(u)})],items:i.perPageOptions},null,8,["modelValue","items"])],16)]),_:1},8,["text"]),i.isNarrow?Xe("",!0):(fe(),at(Fu,{key:0,class:"info"},{default:Re(()=>[$n(Ct(s.getTotalCount()),1)]),_:1})),R(zF,{class:"list-pagination",modelValue:i.pageInfo.page,"onUpdate:modelValue":[t[8]||(t[8]=c=>i.pageInfo.page=c),t[9]||(t[9]=c=>s.changePagination(c))],length:s.getPagesLength(),"total-visible":i.isNarrow?1:5,size:"40"},null,8,["modelValue","length","total-visible"])])]),R(Xw,{modelValue:i.actionDialogConfirmation,"onUpdate:modelValue":t[12]||(t[12]=c=>i.actionDialogConfirmation=c),"max-width":"500"},{default:Re(()=>[R(ul,{disabled:i.actionLoading,loading:i.actionLoading},{default:Re(()=>[R(aC,{class:"d-flex justify-space-between align-center"},{default:Re(()=>[Je("span",null,Ct(e.$t("confirmation"))+": "+Ct(s.getActionInfo().title),1),R(nr,{icon:"mdi-close",variant:"text",density:"compact",onClick:t[10]||(t[10]=c=>i.actionDialogConfirmation=!1)})]),_:1}),R(vy,null,{default:Re(()=>[Je("div",__n,Ct(s.getActionInfo().confirmation_text),1),R(Fu,{class:"info selected-warning-count"},{default:Re(()=>[$n(Ct(e.$t("selected"))+" ",1),Je("p",x_n,Ct(s.getSelectedCount())+"/"+Ct(s.getTotalCount()),1)]),_:1})]),_:1}),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("cancel"),variant:"elevated",onClick:t[11]||(t[11]=c=>i.actionDialogConfirmation=!1),disabled:i.actionLoading},null,8,["text","disabled"]),R(nr,{text:e.$t("confirm"),variant:"tonal",color:"primary",onClick:s.applyAction,disabled:i.actionLoading},null,8,["text","onClick","disabled"])]),_:1})]),_:1},8,["disabled","loading"])]),_:1},8,["modelValue"]),R(Xw,{persistent:"",modelValue:i.actionFormDialogOpen,"onUpdate:modelValue":t[16]||(t[16]=c=>i.actionFormDialogOpen=c),class:"action-form-dialog"},{default:Re(()=>[R(ul,{disabled:i.actionLoading,loading:i.actionLoading},{default:Re(()=>[R(aC,{class:"d-flex justify-space-between align-center"},{default:Re(()=>[Je("span",null,Ct(s.getActionInfo().title),1),R(nr,{icon:"mdi-close",variant:"text",density:"compact",onClick:t[13]||(t[13]=c=>i.actionFormDialogOpen=!1)})]),_:1}),Je("div",{class:"action-description",innerHTML:s.getActionInfo().description},null,8,k_n),R(l,{ref:"fieldscontainer",formType:"create","table-schema":s.getActionInfo().form_schema,loading:i.actionLoading,onChanged:t[14]||(t[14]=c=>i.actionFormData=c)},null,8,["table-schema","loading"]),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("cancel"),variant:"elevated",onClick:t[15]||(t[15]=c=>i.actionFormDialogOpen=!1),disabled:i.actionLoading},null,8,["text","disabled"]),R(nr,{text:e.$t("send"),variant:"tonal",color:"primary",onClick:s.applyAction,disabled:i.actionLoading},null,8,["text","onClick","disabled"])]),_:1})]),_:1},8,["disabled","loading"])]),_:1},8,["modelValue"]),R(Xw,{modelValue:i.persistentMessageDialog,"onUpdate:modelValue":t[18]||(t[18]=c=>i.persistentMessageDialog=c),class:"persistent-message-dialog"},{default:Re(()=>[R(ul,null,{default:Re(()=>[R(vy,{innerHTML:i.persistentMessage},null,8,["innerHTML"]),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("close"),variant:"elevated",onClick:t[17]||(t[17]=c=>i.persistentMessageDialog=!1)},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const d5e=gi(t_n,[["render",S_n]]),C_n={props:{adminSchema:{type:Object,required:!0},settings:{type:Object,required:!0},group:{type:String,required:!0},category:{type:String,required:!0}},components:{TableCategory:d5e,DashboardCategory:W3e},data(){return{currentTab:null,apiMethods:null,categorySchema:null}},created(){if(this.categorySchema=this.adminSchema.get_category(this.group,this.category),!this.categorySchema){console.error(`Page with category "${this.category}" not found`),this.$router.push({path:"/404"});return}},watch:{$route:{immediate:!0,handler(e,t){var r;const n=this.adminSchema.get_category(this.group,this.category);n&&(document.title=`${n.title} | ${(r=this.settings)==null?void 0:r.title}`)}}},methods:{getType(){if(this.categorySchema)return this.categorySchema.type}}};function $_n(e,t,n,r,i,s){const o=d5e,a=W3e;return s.getType()==="table"?(fe(),at(o,{key:0,"admin-schema":n.adminSchema,"category-schema":i.categorySchema},null,8,["admin-schema","category-schema"])):s.getType()==="dashboard"?(fe(),at(a,{key:1,"admin-schema":n.adminSchema,"category-schema":i.categorySchema},null,8,["admin-schema","category-schema"])):(fe(),Me(Ke,{key:2},[$n(' Category type "'+Ct(s.getType())+'" is not supported ',1)],64))}const f5e=gi(C_n,[["render",$_n]]);function T_n(e){return{required:t=>n=>!!n||t||e("validation.required"),min_length:t=>n=>n&&String(n).length>=t||e("validation.min_length",{min_length:t}),max_length:t=>n=>!n||String(n).length<=t||e("validation.max_length",{min_length:t})}}const A_n=Ap(Nr.backend_prefix,"auth/login/");function E_n(e){var t={username:e.username,password:e.password,phone:""};return id({url:A_n,method:"post",data:t,headers:{"Accept-Language":Vd(),"Cache-Control":"no-cache"},timeout:Nr.api_timeout_ms})}function P_n(e,t){return console.assert(Nr.backend_prefix,"backend url is not set!"),new Promise((n,r)=>{E_n({username:e.trim(),password:t}).then(i=>{hqe(i.data.token,i.data.token),localStorage.setItem("name",i.data.username),localStorage.setItem("user_id",i.data.pk),n()}).catch(i=>{r(i)})})}const O_n=mt({...Fn(),...Cpe({fullHeight:!0}),...js()},"VApp"),h5e=Vt()({name:"VApp",props:O_n(),setup(e,t){let{slots:n}=t;const r=ko(e),{layoutClasses:i,getLayoutItem:s,items:o,layoutRef:a}=Ape(e),{rtlClasses:l}=td();return Xt(()=>R("div",{ref:a,class:["v-application",r.themeClasses.value,i.value,l.value,e.class],style:[e.style]},[R("div",{class:"v-application__wrap"},[R(fB,null,{default:()=>{var c;return[R(Ke,null,[(c=n.default)==null?void 0:c.call(n)])]}})])])),{getLayoutItem:s,items:o,theme:r}}}),M_n=mt({...Fn(),...wWe()},"VForm"),R_n=Vt()({name:"VForm",props:M_n(),emits:{"update:modelValue":e=>!0,submit:e=>!0},setup(e,t){let{slots:n,emit:r}=t;const i=_We(e),s=Ve();function o(l){l.preventDefault(),i.reset()}function a(l){const c=l,u=i.validate();c.then=u.then.bind(u),c.catch=u.catch.bind(u),c.finally=u.finally.bind(u),r("submit",c),c.defaultPrevented||u.then(d=>{var h;let{valid:f}=d;f&&((h=s.value)==null||h.submit())}),c.preventDefault()}return Xt(()=>{var l;return R("form",{ref:s,class:["v-form",e.class],style:e.style,novalidate:!0,onReset:o,onSubmit:a},[(l=n.default)==null?void 0:l.call(n,i)])}),Tp(i,s)}}),j_n={data(){return{rules:{},username:"",password:"",show:!1,loading:!1,settingsLoading:!0}},watch:{$route:{immediate:!0,handler(e,t){document.title=`${this.$t("login")} | Admin Panel`}}},async created(){this.rules=T_n(this.$t),this.settingsLoading=!0,Tge().then(e=>{this.settingsLoading=!1,this.settings=e}).catch(e=>{this.settingsLoading=!1,console.error("Get admin settings error:",e);const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},methods:{getLogo(){return Nr.logo_image},getTitle(){return this.settings.title},getLoginGreetingsMessage(){return this.settings.login_greetings_message},getDescription(){return this.settings.description},async login(){(await this.$refs.loginForm.validate()).valid&&(this.loading=!0,P_n(this.username,this.password).then(()=>{this.$router.push(this.settings.main_page||"/"),this.loading=!1}).catch(t=>{this.loading=!1;const n=this.$handleError(t);n.persistentMessage&&(this.persistentMessage=n.persistentMessage)}))}}},I_n={class:"top-right-icon"},D_n={key:1,class:"login-title"},L_n=["innerHTML"],N_n=["innerHTML"];function F_n(e,t,n,r,i,s){const o=u9,a=Qpe,l=b9;return fe(),at(h5e,null,{default:Re(()=>[R(w9,{class:"login-page"},{default:Re(()=>[R(o,{ref:"settings"},null,512),R(A$,{fluid:"",class:"fill-height gradient-bg"},{default:Re(()=>[R(Dm,null,{default:Re(()=>[R(Pf,{class:"d-flex justify-center"},{default:Re(()=>[i.settingsLoading?(fe(),at(a,{key:0})):Xe("",!0),e.settings?(fe(),at(ul,{key:1,class:"login-window"},{title:Re(()=>[R(Dm,{justify:"center","no-gutters":""},{default:Re(()=>[s.getLogo()?(fe(),at(vg,{key:0,class:"project-logo",alt:s.getTitle(),src:s.getLogo(),"max-width":"250",eager:!0},null,8,["alt","src"])):(fe(),Me("span",D_n,Ct(s.getTitle()),1))]),_:1})]),default:Re(()=>[Je("div",I_n,[e.settings&&e.settings.languages?(fe(),at(l,{key:0,langs:e.settings.languages},null,8,["langs"])):Xe("",!0),R(nr,{icon:"",onClick:t[0]||(t[0]=c=>e.$refs.settings.toggle())},{default:Re(()=>[R(Tr,null,{default:Re(()=>[$n("mdi-cog-outline")]),_:1})]),_:1})]),R(vy,{class:"bg-surface-light pt-4"},{default:Re(()=>[s.getDescription()?(fe(),at(RMe,{key:0,class:"login-description",color:"primary",variant:"tonal",border:"start"},{default:Re(()=>[Je("p",{innerHTML:s.getDescription()},null,8,L_n)]),_:1})):Xe("",!0),R(R_n,{class:"login-form",ref:"loginForm","validate-on":"submit"},{default:Re(()=>[R(bc,{density:"default",hideDetails:!1,loading:i.loading,disabled:i.loading,modelValue:i.username,"onUpdate:modelValue":t[1]||(t[1]=c=>i.username=c),rules:[i.rules.required,i.rules.min_length(5)],label:e.$t("username"),required:"",onKeydown:Ym(qu(s.login,["prevent"]),["enter"])},null,8,["loading","disabled","modelValue","rules","label","onKeydown"]),R(bc,{density:"default",hideDetails:!1,disabled:i.loading,modelValue:i.password,"onUpdate:modelValue":t[2]||(t[2]=c=>i.password=c),rules:[i.rules.required,i.rules.min_length(5)],label:e.$t("password"),type:i.show?"text":"password","append-icon":i.show?"mdi-eye":"mdi-eye-off",required:"","onClick:append":t[3]||(t[3]=c=>i.show=!i.show),onKeydown:Ym(qu(s.login,["prevent"]),["enter"])},null,8,["disabled","modelValue","rules","label","type","append-icon","onKeydown"])]),_:1},512),s.getLoginGreetingsMessage()?(fe(),at(ul,{key:1,color:"primary",variant:"outlined",class:"mx-auto login-description"},{default:Re(()=>[R(Cge,null,{default:Re(()=>[Je("div",{innerHTML:s.getLoginGreetingsMessage()},null,8,N_n)]),_:1})]),_:1})):Xe("",!0),R(Dm,{justify:"end","no-gutters":""},{default:Re(()=>[R(nr,{onClick:s.login,disabled:i.loading},{default:Re(()=>[$n(Ct(e.$t("login")),1)]),_:1},8,["onClick","disabled"])]),_:1})]),_:1})]),_:1})):Xe("",!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const B_n=gi(j_n,[["render",F_n]]),V_n={props:{apiInfo:{type:Object,required:!0}},methods:{getLogo(){return Nr.logo_image}}},z_n={class:"page-404"},W_n={class:"text-h4 text-center"},H_n={class:"text-center text-subtitle-2"},U_n={class:"navigation-link text-center"};function q_n(e,t,n,r,i,s){const o=li("router-link");return fe(),at(h5e,null,{default:Re(()=>[R(w9,null,{default:Re(()=>[R(A$,{fluid:"",class:"fill-height gradient-bg"},{default:Re(()=>[R(Dm,null,{default:Re(()=>[R(Pf,{class:"d-flex justify-center"},{default:Re(()=>[Je("div",z_n,[s.getLogo()?(fe(),at(o,{key:0,to:"/navigation"},{default:Re(()=>[R(vg,{class:"project-logo",src:s.getLogo(),"max-width":"400",eager:!0},null,8,["src"])]),_:1})):Xe("",!0),Je("p",W_n,Ct(e.$t("notFoundPageHeadline")),1),Je("p",H_n,Ct(e.$t("notFoundPageTitle")),1),R(o,{to:"/navigation"},{default:Re(()=>[Je("p",U_n,Ct(e.$t("notFoundPageGoBack")),1)]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Y_n=gi(V_n,[["render",q_n]]),G_n=[{path:"",redirect:"/navigation"},{path:"/login",component:B_n},{path:"/404",component:Y_n},{path:"",component:tYe,children:[{path:"navigation",props:!0,component:lgn},{path:":group/:category/",props:!0,name:"category",component:f5e},{path:":group/:category/:pk/",props:!0,name:"detail",component:BMe}]},{path:"/:pathMatch(.*)*",redirect:"/404",hidden:!0}],K_n=bze({history:YVe(Nr.base_admin_url||"admin/"),routes:G_n});function J_n(e){e.use(gVe).use(K_n).use(LB)}function X_n(e){return function(n){if(console.error(`API error url=${n.config.url}`),console.error(n),!(n!=null&&n.response))return Ur(e("errorMessage",{status:"-",errorText:String(n)}),{type:"error",position:"top-center",dangerouslyHTMLString:!0}),{};const{status:r,data:i}=n.response;if(r===422&&Array.isArray(i==null?void 0:i.detail)){const s=i.detail.map(o=>{var l;const a=(l=o.loc)==null?void 0:l.slice(1).join(".");return a?`${a}: ${o.msg}`:o.msg});Ur(e("validationErrors",{errors:s.join(`
524
+ `):e}function qyn(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function dde(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=_a(t.bodyFont),c=_a(t.titleFont),u=_a(t.footerFont),d=s.length,f=i.length,h=r.length,p=Ul(t.padding);let m=p.height,v=0,y=r.reduce((x,k)=>x+k.before.length+k.lines.length+k.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const x=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*x+(y-h)*l.lineHeight+(y-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0;const b=function(x){v=Math.max(v,n.measureText(x).width+_)};return n.save(),n.font=c.string,rs(e.title,b),n.font=l.string,rs(e.beforeBody.concat(e.afterBody),b),_=t.displayColors?o+2+t.boxPadding:0,rs(r,x=>{rs(x.before,b),rs(x.lines,b),rs(x.after,b)}),_=0,n.font=u.string,rs(e.footer,b),n.restore(),v+=p.width,{width:v,height:m}}function Yyn(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Gyn(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function Kyn(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),Gyn(c,e,t,n)&&(c="center"),c}function fde(e,t,n){const r=n.yAlign||t.yAlign||Yyn(e,n);return{xAlign:n.xAlign||t.xAlign||Kyn(e,t,n,r),yAlign:r}}function Jyn(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Xyn(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function hde(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=cy(o);let p=Jyn(t,a);const m=Xyn(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+i:a==="right"&&(p+=Math.max(d,h)+i),{x:Lu(p,0,r.width-t.width),y:Lu(m,0,r.height-t.height)}}function SP(e,t,n){const r=Ul(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function pde(e){return Mh([],pm(e))}function Zyn(e,t,n){return B0(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function mde(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const I3e={beforeTitle:cm,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:cm,beforeBody:cm,beforeLabel:cm,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Yi(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:cm,afterBody:cm,beforeFooter:cm,footer:cm,afterFooter:cm};function jc(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?I3e[t].call(n,r):i}class NF extends V0{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new g3e(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Zyn(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=jc(r,"beforeTitle",this,t),s=jc(r,"title",this,t),o=jc(r,"afterTitle",this,t);let a=[];return a=Mh(a,pm(i)),a=Mh(a,pm(s)),a=Mh(a,pm(o)),a}getBeforeBody(t,n){return pde(jc(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return rs(t,s=>{const o={before:[],lines:[],after:[]},a=mde(r,s);Mh(o.before,pm(jc(a,"beforeLabel",this,s))),Mh(o.lines,jc(a,"label",this,s)),Mh(o.after,pm(jc(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return pde(jc(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=jc(r,"beforeFooter",this,t),s=jc(r,"footer",this,t),o=jc(r,"afterFooter",this,t);let a=[];return a=Mh(a,pm(i)),a=Mh(a,pm(s)),a=Mh(a,pm(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(qyn(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),rs(a,u=>{const d=mde(t.callbacks,u);i.push(jc(d,"labelColor",this,u)),s.push(jc(d,"labelPointStyle",this,u)),o.push(jc(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Vk[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=dde(this,r),c=Object.assign({},a,l),u=fde(this.chart,r,c),d=hde(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=cy(a),{x:f,y:h}=t,{width:p,height:m}=n;let v,y,_,b,x,k;return s==="center"?(x=h+m/2,i==="left"?(v=f,y=v-o,b=x+o,k=x-o):(v=f+p,y=v+o,b=x-o,k=x+o),_=v):(i==="left"?y=f+Math.max(l,u)+o:i==="right"?y=f+p-Math.max(c,d)-o:y=this.caretX,s==="top"?(b=h,x=b-o,v=y-o,_=y+o):(b=h+m,x=b+o,v=y+o,_=y-o),k=b),{x1:v,x2:y,x3:_,y1:b,y2:x,y3:k}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=k_(r.rtl,this.x,this.width);for(t.x=SP(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=_a(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=_a(s.bodyFont),d=SP(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=i.leftForLtr(f,c)+c/2,y=p+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,MF(t,m,v,y),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,MF(t,m,v,y)}else{t.lineWidth=pi(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,c),v=i.leftForLtr(i.xPlus(f,1),c-2),y=cy(o.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,v$(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),v$(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=_a(r.bodyFont);let f=d.lineHeight,h=0;const p=k_(r.rtl,this.x,this.width),m=function(A){n.fillText(A,p.x(t.x+h),t.y+f/2),t.y+=f+s},v=p.textAlign(o);let y,_,b,x,k,C,S;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=SP(this,v,r),n.fillStyle=r.bodyColor,rs(this.beforeBody,m),h=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,x=0,C=i.length;x<C;++x){for(y=i[x],_=this.labelTextColors[x],n.fillStyle=_,rs(y.before,m),b=y.lines,a&&b.length&&(this._drawColorBox(n,t,x,p,r),f=Math.max(d.lineHeight,l)),k=0,S=b.length;k<S;++k)m(b[k]),f=d.lineHeight;rs(y.after,m)}h=0,f=d.lineHeight,rs(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=k_(r.rtl,this.x,this.width);for(t.x=SP(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=_a(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=cy(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=Vk[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=dde(this,t),l=Object.assign({},o,this._size),c=fde(n,t,l),u=hde(t,l,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Ul(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),d3e(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),f3e(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),s=!X3(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!X3(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=Vk[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}E(NF,"positioners",Vk);var Qyn={id:"tooltip",_element:NF,positioners:Vk,afterInit(e,t,n){n&&(e.tooltip=new NF({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:I3e},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ebn=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function tbn(e,t,n,r){const i=e.indexOf(t);if(i===-1)return ebn(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const nbn=(e,t)=>e===null?null:Lu(Math.round(e),0,t);function gde(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class FF extends yb{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Yi(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:tbn(r,t,Lr(n,t),this._addedLabels),nbn(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return gde.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}E(FF,"id","category"),E(FF,"defaults",{ticks:{callback:gde}});function rbn(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,p=u-1,{min:m,max:v}=t,y=!Yi(o),_=!Yi(a),b=!Yi(c),x=(v-m)/(d+1);let k=hue((v-m)/p/h)*h,C,S,A,T;if(k<1e-14&&!y&&!_)return[{value:m},{value:v}];T=Math.ceil(v/k)-Math.floor(m/k),T>p&&(k=hue(T*k/p/h)*h),Yi(l)||(C=Math.pow(10,l),k=Math.ceil(k*C)/C),i==="ticks"?(S=Math.floor(m/k)*k,A=Math.ceil(v/k)*k):(S=m,A=v),y&&_&&s&&mvn((a-o)/s,k/1e3)?(T=Math.round(Math.min((a-o)/k,u)),k=(a-o)/T,S=o,A=a):b?(S=y?o:S,A=_?a:A,T=c-1,k=(A-S)/T):(T=(A-S)/k,MS(T,Math.round(T),k/1e3)?T=Math.round(T):T=Math.ceil(T));const O=Math.max(pue(k),pue(S));C=Math.pow(10,Yi(l)?O:l),S=Math.round(S*C)/C,A=Math.round(A*C)/C;let F=0;for(y&&(f&&S!==o?(n.push({value:o}),S<o&&F++,MS(Math.round((S+F*k)*C)/C,o,vde(o,x,e))&&F++):S<o&&F++);F<T;++F){const P=Math.round((S+F*k)*C)/C;if(_&&P>a)break;n.push({value:P})}return _&&f&&A!==a?n.length&&MS(n[n.length-1].value,a,vde(a,x,e))?n[n.length-1].value=a:n.push({value:a}):(!_||A===a)&&n.push({value:A}),n}function vde(e,t,{horizontal:n,minRotation:r}){const i=Vf(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class i5 extends yb{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Yi(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=up(i),c=up(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=rbn(i,s);return t.bounds==="ticks"&&GMe(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return BT(t,this.chart.options.locale,this.options.ticks.format)}}class BF extends i5{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ro(t)?t:0,this.max=Ro(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Vf(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}E(BF,"id","linear"),E(BF,"defaults",{ticks:{callback:t4.formatters.numeric}});const b$=e=>Math.floor(Tv(e)),_1=(e,t)=>Math.pow(10,b$(e)+t);function yde(e){return e/Math.pow(10,b$(e))===1}function bde(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function ibn(e,t){const n=t-e;let r=b$(n);for(;bde(e,t,r)>10;)r++;for(;bde(e,t,r)<10;)r--;return Math.min(r,b$(e))}function sbn(e,{min:t,max:n}){t=xu(e.min,t);const r=[],i=b$(t);let s=ibn(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=i>s?Math.pow(10,i):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,s)),f=xu(e.min,Math.round((l+u+d*Math.pow(10,s))*o)/o);for(;f<n;)r.push({value:f,major:yde(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(s++,d=2,o=s>=0?1:o),f=Math.round((l+u+d*Math.pow(10,s))*o)/o;const h=xu(e.max,f);return r.push({value:h,major:yde(h),significand:d}),r}class wde extends yb{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=i5.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Ro(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ro(t)?Math.max(0,t):null,this.max=Ro(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ro(this._userMin)&&(this.min=t===_1(this.min,0)?_1(this.min,-1):_1(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=t?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(_1(r,-1)),o(_1(i,1)))),r<=0&&s(_1(i,-1)),i<=0&&o(_1(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=sbn(n,this);return t.bounds==="ticks"&&GMe(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":BT(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Tv(t),this._valueRange=Tv(this.max)-Tv(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Tv(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}E(wde,"id","logarithmic"),E(wde,"defaults",{ticks:{callback:t4.formatters.logarithmic,major:{enabled:!0}}});function VF(e){const t=e.ticks;if(t.display&&e.display){const n=Ul(t.backdropPadding);return Lr(t.font&&t.font.size,jo.font.size)+n.height}return 0}function obn(e,t,n){return n=so(n)?n:[n],{w:Rvn(e,t.string,n),h:n.length*t.lineHeight}}function _de(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function abn(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?yo/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=_a(c.font),f=obn(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=$u(e.getIndexAngle(l)+a),p=Math.round($q(h)),m=_de(p,u.x,f.w,0,180),v=_de(p,u.y,f.h,90,270);lbn(n,t,h,m,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=dbn(e,r,i)}function lbn(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function cbn(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round($q($u(l.angle+pc))),u=pbn(l.y,a.h,c),d=fbn(c),f=hbn(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function ubn(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(Rm({x:n,y:r},t)||Rm({x:n,y:s},t)||Rm({x:i,y:r},t)||Rm({x:i,y:s},t))}function dbn(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:VF(s)/2,additionalAngle:o?yo/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=cbn(e,u,l);r.push(d),a==="auto"&&(d.visible=ubn(d,c),d.visible&&(c=d))}return r}function fbn(e){return e===0||e===180?"center":e<180?"left":"right"}function hbn(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function pbn(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function mbn(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Yi(a)){const l=cy(t.borderRadius),c=Ul(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),v$(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function gbn(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));mbn(n,o,s);const a=_a(o.font),{x:l,y:c,textAlign:u}=s;Hy(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function D3e(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Na);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function vbn(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash),s.lineDashOffset=i.dashOffset,s.beginPath(),D3e(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function ybn(e,t,n){return B0(e,{label:n,index:t,type:"pointLabel"})}class CP extends i5{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ul(VF(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Ro(t)&&!isNaN(t)?t:0,this.max=Ro(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/VF(this.options))}generateTickLabels(t){i5.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ps(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?abn(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Na/(this._pointLabels.length||1),r=this.options.startAngle||0;return $u(t*n+Vf(r))}getDistanceFromCenterForValue(t){if(Yi(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Yi(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return ybn(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-pc+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),D3e(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&gbn(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),p=s.setContext(f);vbn(this,h,l,o,p)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=_a(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ul(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Hy(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}E(CP,"id","radialLinear"),E(CP,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t4.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),E(CP,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),E(CP,"descriptors",{angleLines:{_fallback:"grid"}});const o4={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}},zc=Object.keys(o4);function xde(e,t){return e-t}function kde(e,t){if(Yi(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),Ro(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(p2(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Sde(e,t,n,r){const i=zc.length;for(let s=zc.indexOf(e);s<i-1;++s){const o=o4[zc[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return zc[s]}return zc[i-1]}function bbn(e,t,n,r,i){for(let s=zc.length-1;s>=zc.indexOf(n);s--){const o=zc[s];if(o4[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return zc[n?zc.indexOf(n):0]}function wbn(e){for(let t=zc.indexOf(e)+1,n=zc.length;t<n;++t)if(o4[zc[t]].common)return zc[t]}function Cde(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Tq(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function _bn(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function $de(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:_bn(e,r,i,n)}class s5 extends yb{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new G0n._date(t.adapters.date);i.init(n),OS(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:kde(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Ro(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Ro(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=wvn(i,s,o);return this._unit=n.unit||(r.autoSkip?Sde(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):bbn(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:wbn(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),$de(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=Lu(n,0,o),r=Lu(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||Sde(s.minUnit,n,r,this._getLabelCapacity(n)),a=Lr(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=p2(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const p=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)Cde(u,f,p);return(f===r||i.bounds==="ticks"||h===1)&&Cde(u,f,p),Object.keys(u).sort(xde).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return Ps(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Vf(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,$de(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(kde(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return JMe(t.sort(xde))}}E(s5,"id","time"),E(s5,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function $P(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=q1(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=q1(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class Tde extends s5{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=$P(n,this.min),this._tableRange=$P(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return($P(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return $P(this._table,r*this._tableRange+this._minPos,!0)}}E(Tde,"id","timeseries"),E(Tde,"defaults",s5.defaults);const L3e={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},xbn={ariaLabel:{type:String},ariaDescribedby:{type:String}},kbn={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...L3e,...xbn},Sbn=kB[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function rw(e){return x$(e)?Pn(e):e}function Cbn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return x$(t)?new Proxy(e,{}):e}function $bn(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function N3e(e,t){e.labels=t}function F3e(e,t,n){const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function Tbn(e,t){const n={labels:[],datasets:[]};return N3e(n,e.labels),F3e(n,e.datasets,t),n}const Abn=jn({props:kbn,setup(e,t){let{expose:n,slots:r}=t;const i=Ve(null),s=tn(null);n({chart:s});const o=()=>{if(!i.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:h}=e,p=Tbn(u,h),m=Cbn(p,u);s.value=new s4(i.value,{type:c,data:m,options:{...d},plugins:f})},a=()=>{const c=Pn(s.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),s.value=null},e.destroyDelay):(c.destroy(),s.value=null))},l=c=>{c.update(e.updateMode)};return _i(o),ou(a),Nt([()=>e.options,()=>e.data],(c,u)=>{let[d,f]=c,[h,p]=u;const m=Pn(s.value);if(!m)return;let v=!1;if(d){const y=rw(d),_=rw(h);y&&y!==_&&($bn(m,y),v=!0)}if(f){const y=rw(f.labels),_=rw(p.labels),b=rw(f.datasets),x=rw(p.datasets);y!==_&&(N3e(m.config.data,y),v=!0),b&&b!==x&&(F3e(m.config.data,b,e.datasetIdKey),v=!0)}v&&or(()=>{l(m)})},{deep:!0}),()=>Oo("canvas",{role:"img",ariaLabel:e.ariaLabel,ariaDescribedby:e.ariaDescribedby,ref:i},[Oo("p",{},[r.default?r.default():""])])}});function z0(e,t){return s4.register(t),jn({props:L3e,setup(n,r){let{expose:i}=r;const s=tn(null),o=a=>{s.value=a==null?void 0:a.chart};return i({chart:s}),()=>Oo(Abn,Sbn({ref:o},{type:e,...n}))}})}const Ebn=z0("bar",SO),Pbn=z0("doughnut",Fw),Obn=z0("line",$O),Mbn=z0("pie",RF),Rbn=z0("polarArea",TO),jbn=z0("radar",AO),Ibn=z0("bubble",CO),Dbn=z0("scatter",EO);s4.register(Uyn,Qyn,Wyn,Ev,BF,FF,MO,Lyn,RO);const Lbn={line:Obn,bar:Ebn,bubble:Ibn,doughnut:Pbn,pie:Mbn,polararea:Rbn,radar:jbn,scatter:Dbn},Nbn={props:{chartData:{type:Object,required:!0}},components:{},data(){},created(){},methods:{getComponent(e){const t=Lbn[e.type];if(t)return t;const n=`Inline type "${e.type}" not found`;Ur(n,{theme:"auto",type:"error",position:"top-center",dangerouslyHTMLString:!0})}}};function Fbn(e,t,n,r,i,s){return fe(),at(Uu(s.getComponent(n.chartData)),{options:n.chartData.options,data:n.chartData.data,width:n.chartData.width,height:n.chartData.height,fill:n.chartData.fill,pointBorderColor:n.chartData.pointBorderColor,borderColor:n.chartData.borderColor,backgroundColor:n.chartData.backgroundColor,pointBorderWidth:n.chartData.pointBorderWidth,tension:n.chartData.tension,borderWidth:n.chartData.borderWidth},null,8,["options","data","width","height","fill","pointBorderColor","borderColor","backgroundColor","pointBorderWidth","tension","borderWidth"])}const B3e=gi(Nbn,[["render",Fbn]]),Bbn={name:"DashboardContainer",props:{componentData:{type:Object,required:!0}},components:{Chart:B3e,SmallGraph:VMe,PeriodGraph:zMe},data(){return{}},created(){},methods:{}};function Vbn(e,t,n,r,i,s){const o=li("DashboardContainer",!0),a=B3e,l=zMe,c=VMe;return fe(),at(Pf,{cols:n.componentData.cols||12,md:n.componentData.md,sm:n.componentData.sm,lg:n.componentData.lg,class:"d-flex flex-column"},{default:Re(()=>[n.componentData.components?(fe(),at(Dm,{key:0,class:"flex-grow-1"},{default:Re(()=>[(fe(!0),Me(Ke,null,Cn(n.componentData.components,u=>(fe(),Me(Ke,{key:u},[u.component_type==="container"?(fe(),at(o,{key:0,"component-data":u},null,8,["component-data"])):u.component_type==="chart"?(fe(),at(Pf,{key:1,cols:"12"},{default:Re(()=>[R(a,{"chart-data":u},null,8,["chart-data"])]),_:2},1024)):u.component_type==="period_graph"?(fe(),at(Pf,{key:2,cols:"12",class:"d-flex"},{default:Re(()=>[R(l,{"component-data":u,class:"flex-grow-1"},null,8,["component-data"])]),_:2},1024)):u.component_type==="small_graph"?(fe(),at(Pf,{key:3,cols:"12",class:"d-flex"},{default:Re(()=>[R(c,{"component-data":u,class:"flex-grow-1"},null,8,["component-data"])]),_:2},1024)):(fe(),at(Pf,{key:4,cols:"12"},{default:Re(()=>[Je("p",null,'Dashboard component "'+Ct(u.component_type)+'" is not supported',1)]),_:2},1024))],64))),128))]),_:1})):Xe("",!0)]),_:1},8,["cols","md","sm","lg"])}const V3e=gi(Bbn,[["render",Vbn]]),Bw="f-";function zbn(e,t=[]){const n=e.query??e,r={},i=new Set;for(const s of Object.keys(n)){if(!s.startsWith(Bw))continue;const o=s.slice(Bw.length);if(!o.includes("__"))continue;const a=o.split("__")[0];(!t.length||t.includes(a))&&i.add(a)}for(const[s,o]of Object.entries(n)){if(!s.startsWith(Bw))continue;const l=s.slice(Bw.length).split("__"),c=l[0];if(!(t.length&&!t.includes(c))){if(i.has(c)){r[c]||(r[c]={}),l.length===2&&(r[c][l[1]]=o);continue}l.length===1&&(r[c]=o)}}return r}function Wbn(e,t){for(const[n,r]of Object.entries(t))if(r!==null&&typeof r=="object"&&!Array.isArray(r))for(const[i,s]of Object.entries(r))s!=null&&(e[`${Bw}${n}__${i}`]=s);else r!=null&&(e[`${Bw}${n}`]=r);return e}function Hbn(e){const t={};for(const[n,r]of Object.entries(e)){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){const i={};for(const[s,o]of Object.entries(r))o!=null&&o!==""&&(i[s]=o);Object.keys(i).length>0&&(t[n]=i);continue}r!=null&&r!==""&&(t[n]=r)}return t}const Ubn={props:{...lu},emits:["changed"],data(e){return{value:null,choices:[{value:!0,display_name:this.$t("yes")},{value:!1,display_name:this.$t("no")}]}},created(){sd(this),this.value=this.field.initial},methods:{updateFormData(e){this.value=e[this.fieldSlug]},onChange(e){this.value=e,this.$emit("changed",this.value)}}};function qbn(e,t,n,r,i,s){return fe(),at(Ky,{density:e.density,variant:e.variant,clearable:!0,label:e.field.label,"model-value":i.value,messages:e.field.help_text||[],disabled:e.readOnly,loading:e.loading,items:i.choices,"item-title":"display_name","item-value":"value","return-object":!1,"onUpdate:modelValue":s.onChange},null,8,["density","variant","label","model-value","messages","disabled","loading","items","onUpdate:modelValue"])}const Ybn=gi(Ubn,[["render",qbn]]),Gbn={props:{group:{type:String,required:!0},category:{type:String,required:!0},categorySchema:{type:Jy,required:!0},loading:{type:Boolean,required:!1},searchEnabled:{type:Boolean,required:!1},searchHelp:{type:String,required:!1},fieldsInfo:{type:Object,required:!0},filtersInit:{type:Object,required:!1},searchInit:{type:String,required:!1}},emits:["filtered"],data(){return{filters:{},search:null}},created(){this.initFilters&&(this.filters=this.initFilters),this.initSearch&&(this.search=this.initSearch)},methods:{getFieldComponent(e){if(["choice"].indexOf(e.type)!==-1||e.choices)return LP;if(["datetime"].indexOf(e.type)!==-1)return CPe;if(["related"].indexOf(e.type)!==-1)return qAe;if(["string"].indexOf(e.type)!==-1)return jge;if(["integer"].indexOf(e.type)!==-1)return Ige;if(["boolean"].indexOf(e.type)!==-1)return Ybn},_updateValue(e,t){this.filters[t]=e},applyFilter(){this.loading||this.$emit("filtered",Hbn(this.filters),this.search)},searchHelpHtml(){return this.searchHelp.replace(/\n/g,"<br>")}}},Kbn={class:"filters-container"},Jbn={key:0,class:"filter-element"},Xbn=["innerHTML"],Zbn={class:"filter-button"};function Qbn(e,t,n,r,i,s){return fe(),Me("div",Kbn,[n.searchEnabled?(fe(),Me("div",Jbn,[R(bc,{modelValue:i.search,"onUpdate:modelValue":t[0]||(t[0]=o=>i.search=o),density:"compact",variant:"solo","prepend-inner-icon":"mdi-magnify",label:e.$t("search"),onKeydown:Ym(qu(s.applyFilter,["prevent"]),["enter"])},{"append-inner":Re(()=>[R(PS,{location:"bottom"},{activator:Re(({props:o})=>[n.searchHelp?(fe(),at(Tr,ut({key:0},o,{icon:"mdi-help-circle-outline"}),null,16)):Xe("",!0),R(Tr,{icon:"mdi-magnify"})]),default:Re(()=>[Je("div",{innerHTML:s.searchHelpHtml()},null,8,Xbn)]),_:1})]),_:1},8,["modelValue","label","onKeydown"])])):Xe("",!0),(fe(!0),Me(Ke,null,Cn(n.fieldsInfo,(o,a)=>(fe(),Me("div",{key:a,class:"filter-element",onKeydown:t[1]||(t[1]=Ym(qu((...l)=>s.applyFilter&&s.applyFilter(...l),["prevent"]),["enter"]))},[s.getFieldComponent(o)?(fe(),at(Uu(s.getFieldComponent(o)),{key:0,density:"compact",variant:"solo","category-schema":n.categorySchema,field:o,"field-slug":a,loading:!1,"is-filter":!0,onChanged:l=>s._updateValue(l,a)},null,40,["category-schema","field","field-slug","onChanged"])):(fe(),Me(Ke,{key:1},[$n(Ct(o),1)],64))],32))),128)),Je("div",Zbn,[R(nr,{onClick:s.applyFilter,color:"secondary","prepend-icon":"mdi-magnify",disabled:n.loading},{default:Re(()=>[$n(Ct(e.$t("apply")),1)]),_:1},8,["onClick","disabled"])])])}const z3e=gi(Gbn,[["render",Qbn]]),ewn=Ap(Nr.backend_prefix,"dashboard/{group}/{category}/");function twn(e){return new Promise((t,n)=>{const r=ewn.replace("{group}",e.group).replace("{category}",e.category);id({url:r,data:{filters:e.filters},method:"post",timeout:Nr.api_timeout_ms,headers:{"Accept-Language":Vd(),"Cache-Control":"no-cache"}}).then(i=>{t(i)}).catch(i=>n(i))})}const nwn={props:{adminSchema:{type:Object,required:!0},categorySchema:{type:Jy,required:!0}},components:{DashboardContainer:V3e},data(){return{search:null,filters:{},loading:!1,responseData:null}},created(){this.updateDashboard()},methods:{updateDashboard(){this.loading=!0,twn({group:this.categorySchema.group,category:this.categorySchema.category,filters:this.filters,search:this.search}).then(e=>{this.loading=!1,this.responseData=e.data}).catch(e=>{this.loading=!1;const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},hasFilters(){const e=this.categorySchema.getDashboardInfo().table_filters;return this.categorySchema.getDashboardInfo().search_enabled||e&&Object.keys(e).length>0},handleFilter(e,t){this.filters=e,this.search=t,this.updateDashboard()},getDashboardInfo(){return this.categorySchema.getDashboardInfo()}}},rwn={class:"list-page"},iwn={key:0,class:"list-above-block"},swn={class:"header-row-filters"},own={key:1};function awn(e,t,n,r,i,s){const o=z3e,a=V3e;return fe(),Me("div",rwn,[s.hasFilters()?(fe(),Me("div",iwn,[Je("div",swn,[R(o,{"category-schema":n.categorySchema,"filters-init":i.filters,"search-init":i.search,onFiltered:s.handleFilter,loading:i.loading,"search-enabled":s.getDashboardInfo().search_enabled,"fields-info":s.getDashboardInfo().table_filters.fields,"search-help":s.getDashboardInfo().search_help},null,8,["category-schema","filters-init","search-init","onFiltered","loading","search-enabled","fields-info","search-help"])])])):Xe("",!0),i.responseData?(fe(),Me("div",own,[R(A$,null,{default:Re(()=>[R(a,{"component-data":i.responseData},null,8,["component-data"])]),_:1})])):Xe("",!0)])}const W3e=gi(nwn,[["render",awn]]),lwn={props:{title:{type:String,required:!0},adminSchema:{type:Object,required:!0},categorySchema:{type:Jy,required:!0}},components:{FieldsContainer:xx},emits:["created"],data(){return{open:!1,formData:{},loading:!1}},methods:{getTitle(){return this.title},createModel(){this.loading=!0,this.$refs.fieldscontainer.updateErrors({}),Hmn({group:this.categorySchema.group,category:this.categorySchema.category,data:this.formData}).then(e=>{if(this.loading=!1,e){let t=this.$t("modelCreated",{pk:e.data.pk});Ur(t,{theme:"auto",type:"success",position:"top-center"})}this.open=!1,this.formData={},this.$emit("created")}).catch(e=>{this.loading=!1;const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})}}},cwn={key:0};function uwn(e,t,n,r,i,s){const o=xx;return fe(),at(Xw,{"content-class":"dialog-top-position",persistent:"","retain-focus":!1,modelValue:i.open,"onUpdate:modelValue":t[3]||(t[3]=a=>i.open=a),class:"create-dialog"},{activator:Re(({props:a})=>[R(nr,ut(a,{color:"primary",onClick:t[0]||(t[0]=l=>i.open=!0),icon:"mdi-plus",class:"button-icon"}),null,16)]),default:Re(({isActive:a})=>[i.open?(fe(),at(ul,{key:0},{default:Re(()=>[R(aC,{class:"d-flex justify-space-between align-center"},{default:Re(()=>[s.getTitle()?(fe(),Me("span",cwn,Ct(s.getTitle())+": "+Ct(e.$t("creation")),1)):Xe("",!0),R(nr,{icon:"mdi-close",variant:"text",density:"compact",onClick:l=>a.value=!1},null,8,["onClick"])]),_:2},1024),R(o,{ref:"fieldscontainer","form-type":"create","category-schema":n.categorySchema,"table-schema":n.categorySchema.getTableInfo().table_schema,loading:i.loading,onChanged:t[1]||(t[1]=l=>i.formData=l)},null,8,["category-schema","table-schema","loading"]),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("close"),onClick:t[2]||(t[2]=l=>i.open=!1)},null,8,["text"]),R(nr,{text:e.$t("create"),variant:"elevated",color:"primary",onClick:s.createModel},null,8,["text","onClick"])]),_:1})]),_:2},1024)):Xe("",!0)]),_:1},8,["modelValue"])}const H3e=gi(lwn,[["render",uwn]]);function dwn(e,t){if(typeof e!="string")throw new TypeError("truncate expects string");return e.length<=t?e:e.slice(0,t)+"..."}const fwn=mt({bordered:Boolean,color:String,content:[Number,String],dot:Boolean,floating:Boolean,icon:Yr,inline:Boolean,label:{type:String,default:"$vuetify.badge"},max:[Number,String],modelValue:{type:Boolean,default:!0},offsetX:[Number,String],offsetY:[Number,String],textColor:String,...Fn(),...O$({location:"top end"}),...pl(),...Mi(),...js(),...Gy({transition:"scale-rotate-transition"})},"VBadge"),hwn=Vt()({name:"VBadge",inheritAttrs:!1,props:fwn(),setup(e,t){const{backgroundColorClasses:n,backgroundColorStyles:r}=cl(Et(e,"color")),{roundedClasses:i}=ql(e),{t:s}=ed(),{textColorClasses:o,textColorStyles:a}=tu(Et(e,"textColor")),{themeClasses:l}=kpe(),{locationStyles:c}=M$(e,!0,u=>(e.floating?e.dot?2:4:e.dot?8:12)+(["top","bottom"].includes(u)?+(e.offsetY??0):["left","right"].includes(u)?+(e.offsetX??0):0));return Xt(()=>{const u=Number(e.content),d=!e.max||isNaN(u)?e.content:u<=+e.max?u:`${e.max}+`,[f,h]=L8(t.attrs,["aria-atomic","aria-label","aria-live","role","title"]);return R(e.tag,ut({class:["v-badge",{"v-badge--bordered":e.bordered,"v-badge--dot":e.dot,"v-badge--floating":e.floating,"v-badge--inline":e.inline},e.class]},h,{style:e.style}),{default:()=>{var p,m;return[R("div",{class:"v-badge__wrapper"},[(m=(p=t.slots).default)==null?void 0:m.call(p),R(Gh,{transition:e.transition},{default:()=>{var v,y;return[qs(R("span",ut({class:["v-badge__badge",l.value,n.value,i.value,o.value],style:[r.value,a.value,e.inline?{}:c.value],"aria-atomic":"true","aria-label":s(e.label,u),"aria-live":"polite",role:"status"},f),[e.dot?void 0:t.slots.badge?(y=(v=t.slots).badge)==null?void 0:y.call(v):e.icon?R(Tr,{icon:e.icon},null):d]),[[mc,e.modelValue]])]}})])]}})}),{}}});function pwn(){const e=Ve([]);$5(()=>e.value=[]);function t(n,r){e.value[r]=n}return{refs:e,updateRef:t}}const mwn=mt({activeColor:String,start:{type:[Number,String],default:1},modelValue:{type:Number,default:e=>e.start},disabled:Boolean,length:{type:[Number,String],default:1,validator:e=>e%1===0},totalVisible:[Number,String],firstIcon:{type:Yr,default:"$first"},prevIcon:{type:Yr,default:"$prev"},nextIcon:{type:Yr,default:"$next"},lastIcon:{type:Yr,default:"$last"},ariaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.root"},pageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.page"},currentPageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.currentPage"},firstAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.first"},previousAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.previous"},nextAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.next"},lastAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.last"},ellipsis:{type:String,default:"..."},showFirstLastPage:Boolean,...gg(),...Fn(),...xc(),...fh(),...pl(),...x2(),...Mi({tag:"nav"}),...js(),...$p({variant:"text"})},"VPagination"),zF=Vt()({name:"VPagination",props:mwn(),emits:{"update:modelValue":e=>!0,first:e=>!0,prev:e=>!0,next:e=>!0,last:e=>!0},setup(e,t){let{slots:n,emit:r}=t;const i=Ar(e,"modelValue"),{t:s,n:o}=ed(),{isRtl:a}=td(),{themeClasses:l}=ko(e),{width:c}=_0(),u=tn(-1);eu(void 0,{scoped:!0});const{resizeRef:d}=py(A=>{if(!A.length)return;const{target:T,contentRect:O}=A[0],F=T.querySelector(".v-pagination__list > *");if(!F)return;const P=O.width,L=F.offsetWidth+parseFloat(getComputedStyle(F).marginRight)*2;u.value=m(P,L)}),f=te(()=>parseInt(e.length,10)),h=te(()=>parseInt(e.start,10)),p=te(()=>e.totalVisible!=null?parseInt(e.totalVisible,10):u.value>=0?u.value:m(c.value,58));function m(A,T){const O=e.showFirstLastPage?5:3;return Math.max(0,Math.floor(+((A-T*O)/T).toFixed(2)))}const v=te(()=>{if(f.value<=0||isNaN(f.value)||f.value>Number.MAX_SAFE_INTEGER)return[];if(p.value<=0)return[];if(p.value===1)return[i.value];if(f.value<=p.value)return kw(f.value,h.value);const A=p.value%2===0,T=A?p.value/2:Math.floor(p.value/2),O=A?T:T+1,F=f.value-T;if(O-i.value>=0)return[...kw(Math.max(1,p.value-1),h.value),e.ellipsis,f.value];if(i.value-F>=(A?1:0)){const P=p.value-1,L=f.value-P+h.value;return[h.value,e.ellipsis,...kw(P,L)]}else{const P=Math.max(1,p.value-3),L=P===1?i.value:i.value-Math.ceil(P/2)+h.value;return[h.value,e.ellipsis,...kw(P,L),e.ellipsis,f.value]}});function y(A,T,O){A.preventDefault(),i.value=T,O&&r(O,T)}const{refs:_,updateRef:b}=pwn();eu({VPaginationBtn:{color:Et(e,"color"),border:Et(e,"border"),density:Et(e,"density"),size:Et(e,"size"),variant:Et(e,"variant"),rounded:Et(e,"rounded"),elevation:Et(e,"elevation")}});const x=te(()=>v.value.map((A,T)=>{const O=F=>b(F,T);if(typeof A=="string")return{isActive:!1,key:`ellipsis-${T}`,page:A,props:{ref:O,ellipsis:!0,icon:!0,disabled:!0}};{const F=A===i.value;return{isActive:F,key:A,page:o(A),props:{ref:O,ellipsis:!1,icon:!0,disabled:!!e.disabled||+e.length<2,color:F?e.activeColor:e.color,"aria-current":F,"aria-label":s(F?e.currentPageAriaLabel:e.pageAriaLabel,A),onClick:P=>y(P,A)}}}})),k=te(()=>{const A=!!e.disabled||i.value<=h.value,T=!!e.disabled||i.value>=h.value+f.value-1;return{first:e.showFirstLastPage?{icon:a.value?e.lastIcon:e.firstIcon,onClick:O=>y(O,h.value,"first"),disabled:A,"aria-label":s(e.firstAriaLabel),"aria-disabled":A}:void 0,prev:{icon:a.value?e.nextIcon:e.prevIcon,onClick:O=>y(O,i.value-1,"prev"),disabled:A,"aria-label":s(e.previousAriaLabel),"aria-disabled":A},next:{icon:a.value?e.prevIcon:e.nextIcon,onClick:O=>y(O,i.value+1,"next"),disabled:T,"aria-label":s(e.nextAriaLabel),"aria-disabled":T},last:e.showFirstLastPage?{icon:a.value?e.firstIcon:e.lastIcon,onClick:O=>y(O,h.value+f.value-1,"last"),disabled:T,"aria-label":s(e.lastAriaLabel),"aria-disabled":T}:void 0}});function C(){var T;const A=i.value-h.value;(T=_.value[A])==null||T.$el.focus()}function S(A){A.key===dJ.left&&!e.disabled&&i.value>+e.start?(i.value=i.value-1,or(C)):A.key===dJ.right&&!e.disabled&&i.value<h.value+f.value-1&&(i.value=i.value+1,or(C))}return Xt(()=>R(e.tag,{ref:d,class:["v-pagination",l.value,e.class],style:e.style,role:"navigation","aria-label":s(e.ariaLabel),onKeydown:S,"data-test":"v-pagination-root"},{default:()=>[R("ul",{class:"v-pagination__list"},[e.showFirstLastPage&&R("li",{key:"first",class:"v-pagination__first","data-test":"v-pagination-first"},[n.first?n.first(k.value.first):R(nr,ut({_as:"VPaginationBtn"},k.value.first),null)]),R("li",{key:"prev",class:"v-pagination__prev","data-test":"v-pagination-prev"},[n.prev?n.prev(k.value.prev):R(nr,ut({_as:"VPaginationBtn"},k.value.prev),null)]),x.value.map((A,T)=>R("li",{key:A.key,class:["v-pagination__item",{"v-pagination__item--is-active":A.isActive}],"data-test":"v-pagination-item"},[n.item?n.item(A):R(nr,ut({_as:"VPaginationBtn"},A.props),{default:()=>[A.page]})])),R("li",{key:"next",class:"v-pagination__next","data-test":"v-pagination-next"},[n.next?n.next(k.value.next):R(nr,ut({_as:"VPaginationBtn"},k.value.next),null)]),e.showFirstLastPage&&R("li",{key:"last",class:"v-pagination__last","data-test":"v-pagination-last"},[n.last?n.last(k.value.last):R(nr,ut({_as:"VPaginationBtn"},k.value.last),null)])])]})),{}}}),gwn=mt({page:{type:[Number,String],default:1},itemsPerPage:{type:[Number,String],default:10}},"DataTable-paginate"),U3e=Symbol.for("vuetify:data-table-pagination");function vwn(e){const t=Ar(e,"page",void 0,r=>+(r??1)),n=Ar(e,"itemsPerPage",void 0,r=>+(r??10));return{page:t,itemsPerPage:n}}function ywn(e){const{page:t,itemsPerPage:n,itemsLength:r}=e,i=te(()=>n.value===-1?0:n.value*(t.value-1)),s=te(()=>n.value===-1?r.value:Math.min(r.value,i.value+n.value)),o=te(()=>n.value===-1||r.value===0?1:Math.ceil(r.value/n.value));lo(()=>{t.value>o.value&&(t.value=o.value)});function a(f){n.value=f,t.value=1}function l(){t.value=gc(t.value+1,1,o.value)}function c(){t.value=gc(t.value-1,1,o.value)}function u(f){t.value=gc(f,1,o.value)}const d={page:t,itemsPerPage:n,startIndex:i,stopIndex:s,pageCount:o,itemsLength:r,nextPage:l,prevPage:c,setPage:u,setItemsPerPage:a};return fs(U3e,d),d}function bwn(){const e=ur(U3e);if(!e)throw new Error("Missing pagination!");return e}function wwn(e){const t=xo("usePaginatedItems"),{items:n,startIndex:r,stopIndex:i,itemsPerPage:s}=e,o=te(()=>s.value<=0?n.value:n.value.slice(r.value,i.value));return Nt(o,a=>{t.emit("update:currentItems",a)}),{paginatedItems:o}}const q3e=mt({prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},pageText:{type:String,default:"$vuetify.dataFooter.pageText"},firstPageLabel:{type:String,default:"$vuetify.dataFooter.firstPage"},prevPageLabel:{type:String,default:"$vuetify.dataFooter.prevPage"},nextPageLabel:{type:String,default:"$vuetify.dataFooter.nextPage"},lastPageLabel:{type:String,default:"$vuetify.dataFooter.lastPage"},itemsPerPageOptions:{type:Array,default:()=>[{value:10,title:"10"},{value:25,title:"25"},{value:50,title:"50"},{value:100,title:"100"},{value:-1,title:"$vuetify.dataFooter.itemsPerPageAll"}]},showCurrentPage:Boolean},"VDataTableFooter"),Ade=Vt()({name:"VDataTableFooter",props:q3e(),setup(e,t){let{slots:n}=t;const{t:r}=ed(),{page:i,pageCount:s,startIndex:o,stopIndex:a,itemsLength:l,itemsPerPage:c,setItemsPerPage:u}=bwn(),d=te(()=>e.itemsPerPageOptions.map(f=>typeof f=="number"?{value:f,title:f===-1?r("$vuetify.dataFooter.itemsPerPageAll"):String(f)}:{...f,title:isNaN(Number(f.title))?r(f.title):f.title}));return Xt(()=>{var h;const f=zF.filterProps(e);return R("div",{class:"v-data-table-footer"},[(h=n.prepend)==null?void 0:h.call(n),R("div",{class:"v-data-table-footer__items-per-page"},[R("span",null,[r(e.itemsPerPageText)]),R(Ky,{items:d.value,modelValue:c.value,"onUpdate:modelValue":p=>u(Number(p)),density:"compact",variant:"outlined","hide-details":!0},null)]),R("div",{class:"v-data-table-footer__info"},[R("div",null,[r(e.pageText,l.value?o.value+1:0,a.value,l.value)])]),R("div",{class:"v-data-table-footer__pagination"},[R(zF,ut({modelValue:i.value,"onUpdate:modelValue":p=>i.value=p,density:"comfortable","first-aria-label":e.firstPageLabel,"last-aria-label":e.lastPageLabel,length:s.value,"next-aria-label":e.nextPageLabel,"previous-aria-label":e.prevPageLabel,rounded:!0,"show-first-last-page":!0,"total-visible":e.showCurrentPage?1:0,variant:"plain"},f),null)])])}),{}}}),o5=VBe({align:{type:String,default:"start"},fixed:Boolean,fixedOffset:[Number,String],height:[Number,String],lastFixed:Boolean,noPadding:Boolean,tag:String,width:[Number,String],maxWidth:[Number,String],nowrap:Boolean},(e,t)=>{let{slots:n}=t;const r=e.tag??"td";return R(r,{class:["v-data-table__td",{"v-data-table-column--fixed":e.fixed,"v-data-table-column--last-fixed":e.lastFixed,"v-data-table-column--no-padding":e.noPadding,"v-data-table-column--nowrap":e.nowrap},`v-data-table-column--align-${e.align}`],style:{height:An(e.height),width:An(e.width),maxWidth:An(e.maxWidth),left:An(e.fixedOffset||null)}},{default:()=>{var i;return[(i=n.default)==null?void 0:i.call(n)]}})}),_wn=mt({headers:Array},"DataTable-header"),Y3e=Symbol.for("vuetify:data-table-headers"),G3e={title:"",sortable:!1},xwn={...G3e,width:48};function kwn(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(n=>({element:n,priority:0}));return{enqueue:(n,r)=>{let i=!1;for(let s=0;s<t.length;s++)if(t[s].priority>r){t.splice(s,0,{element:n,priority:r}),i=!0;break}i||t.push({element:n,priority:r})},size:()=>t.length,count:()=>{let n=0;if(!t.length)return 0;const r=Math.floor(t[0].priority);for(let i=0;i<t.length;i++)Math.floor(t[i].priority)===r&&(n+=1);return n},dequeue:()=>t.shift()}}function WF(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(!e.children)t.push(e);else for(const n of e.children)WF(n,t);return t}function K3e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;for(const n of e)n.key&&t.add(n.key),n.children&&K3e(n.children,t);return t}function Swn(e){if(e.key){if(e.key==="data-table-group")return G3e;if(["data-table-expand","data-table-select"].includes(e.key))return xwn}}function Lq(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.children?Math.max(t,...e.children.map(n=>Lq(n,t+1))):t}function Cwn(e){let t=!1;function n(s){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(s)if(o&&(s.fixed=!0),s.fixed)if(s.children)for(let a=s.children.length-1;a>=0;a--)n(s.children[a],!0);else t?isNaN(+s.width)&&(`${s.key}`,void 0):s.lastFixed=!0,t=!0;else if(s.children)for(let a=s.children.length-1;a>=0;a--)n(s.children[a]);else t=!1}for(let s=e.length-1;s>=0;s--)n(e[s]);function r(s){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!s)return o;if(s.children){s.fixedOffset=o;for(const a of s.children)o=r(a,o)}else s.fixed&&(s.fixedOffset=o,o+=parseFloat(s.width||"0")||0);return o}let i=0;for(const s of e)i=r(s,i)}function $wn(e,t){const n=[];let r=0;const i=kwn(e);for(;i.size()>0;){let o=i.count();const a=[];let l=1;for(;o>0;){const{element:c,priority:u}=i.dequeue(),d=t-r-Lq(c);if(a.push({...c,rowspan:d??1,colspan:c.children?WF(c).length:1}),c.children)for(const f of c.children){const h=u%1+l/Math.pow(10,r+2);i.enqueue(f,r+d+h)}l+=1,o-=1}r+=1,n.push(a)}return{columns:e.map(o=>WF(o)).flat(),headers:n}}function J3e(e){const t=[];for(const n of e){const r={...Swn(n),...n},i=r.key??(typeof r.value=="string"?r.value:null),s=r.value??i??null,o={...r,key:i,value:s,sortable:r.sortable??(r.key!=null||!!r.sort),children:r.children?J3e(r.children):void 0};t.push(o)}return t}function Twn(e,t){const n=Ve([]),r=Ve([]),i=Ve({}),s=Ve({}),o=Ve({});lo(()=>{var m,v,y;const c=(e.headers||Object.keys(e.items[0]??{}).map(_=>({key:_,title:uh(_)}))).slice(),u=K3e(c);(m=t==null?void 0:t.groupBy)!=null&&m.value.length&&!u.has("data-table-group")&&c.unshift({key:"data-table-group",title:"Group"}),(v=t==null?void 0:t.showSelect)!=null&&v.value&&!u.has("data-table-select")&&c.unshift({key:"data-table-select"}),(y=t==null?void 0:t.showExpand)!=null&&y.value&&!u.has("data-table-expand")&&c.push({key:"data-table-expand"});const d=J3e(c);Cwn(d);const f=Math.max(...d.map(_=>Lq(_)))+1,h=$wn(d,f);n.value=h.headers,r.value=h.columns;const p=h.headers.flat(1);for(const _ of p)_.key&&(_.sortable&&(_.sort&&(i.value[_.key]=_.sort),_.sortRaw&&(s.value[_.key]=_.sortRaw)),_.filter&&(o.value[_.key]=_.filter))});const a={headers:n,columns:r,sortFunctions:i,sortRawFunctions:s,filterFunctions:o};return fs(Y3e,a),a}function a4(){const e=ur(Y3e);if(!e)throw new Error("Missing headers!");return e}const Awn={showSelectAll:!1,allSelected:()=>[],select:e=>{var r;let{items:t,value:n}=e;return new Set(n?[(r=t[0])==null?void 0:r.value]:[])},selectAll:e=>{let{selected:t}=e;return t}},X3e={showSelectAll:!0,allSelected:e=>{let{currentPage:t}=e;return t},select:e=>{let{items:t,value:n,selected:r}=e;for(const i of t)n?r.add(i.value):r.delete(i.value);return r},selectAll:e=>{let{value:t,currentPage:n,selected:r}=e;return X3e.select({items:n,value:t,selected:r})}},Z3e={showSelectAll:!0,allSelected:e=>{let{allItems:t}=e;return t},select:e=>{let{items:t,value:n,selected:r}=e;for(const i of t)n?r.add(i.value):r.delete(i.value);return r},selectAll:e=>{let{value:t,allItems:n,selected:r}=e;return Z3e.select({items:n,value:t,selected:r})}},Ewn=mt({showSelect:Boolean,selectStrategy:{type:[String,Object],default:"page"},modelValue:{type:Array,default:()=>[]},valueComparator:{type:Function,default:w0}},"DataTable-select"),Q3e=Symbol.for("vuetify:data-table-selection");function Pwn(e,t){let{allItems:n,currentPage:r}=t;const i=Ar(e,"modelValue",e.modelValue,y=>new Set(ka(y).map(_=>{var b;return((b=n.value.find(x=>e.valueComparator(_,x.value)))==null?void 0:b.value)??_})),y=>[...y.values()]),s=te(()=>n.value.filter(y=>y.selectable)),o=te(()=>r.value.filter(y=>y.selectable)),a=te(()=>{if(typeof e.selectStrategy=="object")return e.selectStrategy;switch(e.selectStrategy){case"single":return Awn;case"all":return Z3e;case"page":default:return X3e}});function l(y){return ka(y).every(_=>i.value.has(_.value))}function c(y){return ka(y).some(_=>i.value.has(_.value))}function u(y,_){const b=a.value.select({items:y,value:_,selected:new Set(i.value)});i.value=b}function d(y){u([y],!l([y]))}function f(y){const _=a.value.selectAll({value:y,allItems:s.value,currentPage:o.value,selected:new Set(i.value)});i.value=_}const h=te(()=>i.value.size>0),p=te(()=>{const y=a.value.allSelected({allItems:s.value,currentPage:o.value});return!!y.length&&l(y)}),m=te(()=>a.value.showSelectAll),v={toggleSelect:d,select:u,selectAll:f,isSelected:l,isSomeSelected:c,someSelected:h,allSelected:p,showSelectAll:m};return fs(Q3e,v),v}function l4(){const e=ur(Q3e);if(!e)throw new Error("Missing selection!");return e}const Own=mt({sortBy:{type:Array,default:()=>[]},customKeySort:Object,multiSort:Boolean,mustSort:Boolean},"DataTable-sort"),e5e=Symbol.for("vuetify:data-table-sort");function Mwn(e){const t=Ar(e,"sortBy"),n=Et(e,"mustSort"),r=Et(e,"multiSort");return{sortBy:t,mustSort:n,multiSort:r}}function Rwn(e){const{sortBy:t,mustSort:n,multiSort:r,page:i}=e,s=l=>{if(l.key==null)return;let c=t.value.map(d=>({...d}))??[];const u=c.find(d=>d.key===l.key);u?u.order==="desc"?n.value?u.order="asc":c=c.filter(d=>d.key!==l.key):u.order="desc":r.value?c=[...c,{key:l.key,order:"asc"}]:c=[{key:l.key,order:"asc"}],t.value=c,i&&(i.value=1)};function o(l){return!!t.value.find(c=>c.key===l.key)}const a={sortBy:t,toggleSort:s,isSorted:o};return fs(e5e,a),a}function t5e(){const e=ur(e5e);if(!e)throw new Error("Missing sort!");return e}function jwn(e,t,n,r){const i=ed();return{sortedItems:te(()=>{var o,a;return!n.value.length||e.disableSort?t.value:Iwn(t.value,n.value,i.current.value,{transform:r==null?void 0:r.transform,sortFunctions:{...e.customKeySort,...(o=r==null?void 0:r.sortFunctions)==null?void 0:o.value},sortRawFunctions:(a=r==null?void 0:r.sortRawFunctions)==null?void 0:a.value})})}}function Iwn(e,t,n,r){const i=new Intl.Collator(n,{sensitivity:"accent",usage:"sort"});return e.map(o=>[o,r!=null&&r.transform?r.transform(o):o]).sort((o,a)=>{var l,c;for(let u=0;u<t.length;u++){let d=!1;const f=t[u].key,h=t[u].order??"asc";if(h===!1)continue;let p=o[1][f],m=a[1][f],v=o[0].raw,y=a[0].raw;if(h==="desc"&&([p,m]=[m,p],[v,y]=[y,v]),(l=r==null?void 0:r.sortRawFunctions)!=null&&l[f]){const _=r.sortRawFunctions[f](v,y);if(_==null)continue;if(d=!0,_)return _}if((c=r==null?void 0:r.sortFunctions)!=null&&c[f]){const _=r.sortFunctions[f](p,m);if(_==null)continue;if(d=!0,_)return _}if(!d){if(p instanceof Date&&m instanceof Date)return p.getTime()-m.getTime();if([p,m]=[p,m].map(_=>_!=null?_.toString().toLocaleLowerCase():_),p!==m)return zA(p)&&zA(m)?0:zA(p)?-1:zA(m)?1:!isNaN(p)&&!isNaN(m)?Number(p)-Number(m):i.compare(p,m)}}return 0}).map(o=>{let[a]=o;return a})}const n5e=mt({color:String,sticky:Boolean,disableSort:Boolean,multiSort:Boolean,sortAscIcon:{type:Yr,default:"$sortAsc"},sortDescIcon:{type:Yr,default:"$sortDesc"},headerProps:{type:Object},...T$(),...B5()},"VDataTableHeaders"),Ede=Vt()({name:"VDataTableHeaders",props:n5e(),setup(e,t){let{slots:n}=t;const{t:r}=ed(),{toggleSort:i,sortBy:s,isSorted:o}=t5e(),{someSelected:a,allSelected:l,selectAll:c,showSelectAll:u}=l4(),{columns:d,headers:f}=a4(),{loaderClasses:h}=R$(e);function p(A,T){if(!(!e.sticky&&!A.fixed))return{position:"sticky",left:A.fixed?An(A.fixedOffset):void 0,top:e.sticky?`calc(var(--v-table-header-height) * ${T})`:void 0}}function m(A){const T=s.value.find(O=>O.key===A.key);return T?T.order==="asc"?e.sortAscIcon:e.sortDescIcon:e.sortAscIcon}const{backgroundColorClasses:v,backgroundColorStyles:y}=cl(e,"color"),{displayClasses:_,mobile:b}=_0(e),x=te(()=>({headers:f.value,columns:d.value,toggleSort:i,isSorted:o,sortBy:s.value,someSelected:a.value,allSelected:l.value,selectAll:c,getSortIcon:m})),k=te(()=>["v-data-table__th",{"v-data-table__th--sticky":e.sticky},_.value,h.value]),C=A=>{let{column:T,x:O,y:F}=A;const P=T.key==="data-table-select"||T.key==="data-table-expand",L=ut(e.headerProps??{},T.headerProps??{});return R(o5,ut({tag:"th",align:T.align,class:[{"v-data-table__th--sortable":T.sortable&&!e.disableSort,"v-data-table__th--sorted":o(T),"v-data-table__th--fixed":T.fixed},...k.value],style:{width:An(T.width),minWidth:An(T.minWidth),maxWidth:An(T.maxWidth),...p(T,F)},colspan:T.colspan,rowspan:T.rowspan,onClick:T.sortable?()=>i(T):void 0,fixed:T.fixed,nowrap:T.nowrap,lastFixed:T.lastFixed,noPadding:P},L),{default:()=>{var B;const q=`header.${T.key}`,V={column:T,selectAll:c,isSorted:o,toggleSort:i,sortBy:s.value,someSelected:a.value,allSelected:l.value,getSortIcon:m};return n[q]?n[q](V):T.key==="data-table-select"?((B=n["header.data-table-select"])==null?void 0:B.call(n,V))??(u.value&&R(my,{modelValue:l.value,indeterminate:a.value&&!l.value,"onUpdate:modelValue":c},null)):R("div",{class:"v-data-table-header__content"},[R("span",null,[T.title]),T.sortable&&!e.disableSort&&R(Tr,{key:"icon",class:"v-data-table-header__sort-icon",icon:m(T)},null),e.multiSort&&o(T)&&R("div",{key:"badge",class:["v-data-table-header__sort-badge",...v.value],style:y.value},[s.value.findIndex(Y=>Y.key===T.key)+1])])}})},S=()=>{const A=ut(e.headerProps??{}??{}),T=te(()=>d.value.filter(F=>(F==null?void 0:F.sortable)&&!e.disableSort)),O=te(()=>{if(d.value.find(P=>P.key==="data-table-select")!=null)return l.value?"$checkboxOn":a.value?"$checkboxIndeterminate":"$checkboxOff"});return R(o5,ut({tag:"th",class:[...k.value],colspan:f.value.length+1},A),{default:()=>[R("div",{class:"v-data-table-header__content"},[R(Ky,{chips:!0,class:"v-data-table__td-sort-select",clearable:!0,density:"default",items:T.value,label:r("$vuetify.dataTable.sortBy"),multiple:e.multiSort,variant:"underlined","onClick:clear":()=>s.value=[],appendIcon:O.value,"onClick:append":()=>c(!l.value)},{...n,chip:F=>{var P;return R(Km,{onClick:(P=F.item.raw)!=null&&P.sortable?()=>i(F.item.raw):void 0,onMousedown:L=>{L.preventDefault(),L.stopPropagation()}},{default:()=>[F.item.title,R(Tr,{class:["v-data-table__td-sort-icon",o(F.item.raw)&&"v-data-table__td-sort-icon-active"],icon:m(F.item.raw),size:"small"},null)]})}})])]})};Xt(()=>b.value?R("tr",null,[R(S,null,null)]):R(Ke,null,[n.headers?n.headers(x.value):f.value.map((A,T)=>R("tr",null,[A.map((O,F)=>R(C,{column:O,x:F,y:T},null))])),e.loading&&R("tr",{class:"v-data-table-progress"},[R("th",{colspan:d.value.length},[R(V5,{name:"v-data-table-progress",absolute:!0,active:!0,color:typeof e.loading=="boolean"?void 0:e.loading,indeterminate:!0},{default:n.loader})])])]))}}),Dwn=mt({groupBy:{type:Array,default:()=>[]}},"DataTable-group"),r5e=Symbol.for("vuetify:data-table-group");function Lwn(e){return{groupBy:Ar(e,"groupBy")}}function Nwn(e){const{groupBy:t,sortBy:n}=e,r=Ve(new Set),i=te(()=>t.value.map(c=>({...c,order:c.order??!1})).concat(n.value));function s(c){return r.value.has(c.id)}function o(c){const u=new Set(r.value);s(c)?u.delete(c.id):u.add(c.id),r.value=u}function a(c){function u(d){const f=[];for(const h of d.items)"type"in h&&h.type==="group"?f.push(...u(h)):f.push(h);return f}return u({type:"group",items:c,id:"dummy",key:"dummy",value:"dummy",depth:0})}const l={sortByWithGroups:i,toggleGroup:o,opened:r,groupBy:t,extractRows:a,isGroupOpen:s};return fs(r5e,l),l}function i5e(){const e=ur(r5e);if(!e)throw new Error("Missing group!");return e}function Fwn(e,t){if(!e.length)return[];const n=new Map;for(const r of e){const i=YS(r.raw,t);n.has(i)||n.set(i,[]),n.get(i).push(r)}return n}function s5e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"root";if(!t.length)return[];const i=Fwn(e,t[0]),s=[],o=t.slice(1);return i.forEach((a,l)=>{const c=t[0],u=`${r}_${c}_${l}`;s.push({depth:n,id:u,key:c,value:l,items:o.length?s5e(a,o,n+1,u):a,type:"group"})}),s}function o5e(e,t){const n=[];for(const r of e)"type"in r&&r.type==="group"?(r.value!=null&&n.push(r),(t.has(r.id)||r.value==null)&&n.push(...o5e(r.items,t))):n.push(r);return n}function Bwn(e,t,n){return{flatItems:te(()=>{if(!t.value.length)return e.value;const i=s5e(e.value,t.value.map(s=>s.key));return o5e(i,n.value)})}}const Vwn=mt({item:{type:Object,required:!0}},"VDataTableGroupHeaderRow"),zwn=Vt()({name:"VDataTableGroupHeaderRow",props:Vwn(),setup(e,t){let{slots:n}=t;const{isGroupOpen:r,toggleGroup:i,extractRows:s}=i5e(),{isSelected:o,isSomeSelected:a,select:l}=l4(),{columns:c}=a4(),u=te(()=>s([e.item]));return()=>R("tr",{class:"v-data-table-group-header-row",style:{"--v-data-table-group-header-row-depth":e.item.depth}},[c.value.map(d=>{var f,h;if(d.key==="data-table-group"){const p=r(e.item)?"$expand":"$next",m=()=>i(e.item);return((f=n["data-table-group"])==null?void 0:f.call(n,{item:e.item,count:u.value.length,props:{icon:p,onClick:m}}))??R(o5,{class:"v-data-table-group-header-row__column"},{default:()=>[R(nr,{size:"small",variant:"text",icon:p,onClick:m},null),R("span",null,[e.item.value]),R("span",null,[$n("("),u.value.length,$n(")")])]})}if(d.key==="data-table-select"){const p=o(u.value),m=a(u.value)&&!p,v=y=>l(u.value,y);return((h=n["data-table-select"])==null?void 0:h.call(n,{props:{modelValue:p,indeterminate:m,"onUpdate:modelValue":v}}))??R("td",null,[R(my,{modelValue:p,indeterminate:m,"onUpdate:modelValue":v},null)])}return R("td",null,null)})])}}),Wwn=mt({expandOnClick:Boolean,showExpand:Boolean,expanded:{type:Array,default:()=>[]}},"DataTable-expand"),a5e=Symbol.for("vuetify:datatable:expanded");function Hwn(e){const t=Et(e,"expandOnClick"),n=Ar(e,"expanded",e.expanded,a=>new Set(a),a=>[...a.values()]);function r(a,l){const c=new Set(n.value);l?c.add(a.value):c.delete(a.value),n.value=c}function i(a){return n.value.has(a.value)}function s(a){r(a,!i(a))}const o={expand:r,expanded:n,expandOnClick:t,isExpanded:i,toggleExpand:s};return fs(a5e,o),o}function l5e(){const e=ur(a5e);if(!e)throw new Error("foo");return e}const Uwn=mt({index:Number,item:Object,cellProps:[Object,Function],onClick:Gc(),onContextmenu:Gc(),onDblclick:Gc(),...T$()},"VDataTableRow"),qwn=Vt()({name:"VDataTableRow",props:Uwn(),setup(e,t){let{slots:n}=t;const{displayClasses:r,mobile:i}=_0(e,"v-data-table__tr"),{isSelected:s,toggleSelect:o,someSelected:a,allSelected:l,selectAll:c}=l4(),{isExpanded:u,toggleExpand:d}=l5e(),{toggleSort:f,sortBy:h,isSorted:p}=t5e(),{columns:m}=a4();Xt(()=>R("tr",{class:["v-data-table__tr",{"v-data-table__tr--clickable":!!(e.onClick||e.onContextmenu||e.onDblclick)},r.value],onClick:e.onClick,onContextmenu:e.onContextmenu,onDblclick:e.onDblclick},[e.item&&m.value.map((v,y)=>{const _=e.item,b=`item.${v.key}`,x=`header.${v.key}`,k={index:e.index,item:_.raw,internalItem:_,value:YS(_.columns,v.key),column:v,isSelected:s,toggleSelect:o,isExpanded:u,toggleExpand:d},C={column:v,selectAll:c,isSorted:p,toggleSort:f,sortBy:h.value,someSelected:a.value,allSelected:l.value,getSortIcon:()=>""},S=typeof e.cellProps=="function"?e.cellProps({index:k.index,item:k.item,internalItem:k.internalItem,value:k.value,column:v}):e.cellProps,A=typeof v.cellProps=="function"?v.cellProps({index:k.index,item:k.item,internalItem:k.internalItem,value:k.value}):v.cellProps;return R(o5,ut({align:v.align,class:{"v-data-table__td--expanded-row":v.key==="data-table-expand","v-data-table__td--select-row":v.key==="data-table-select"},fixed:v.fixed,fixedOffset:v.fixedOffset,lastFixed:v.lastFixed,maxWidth:i.value?void 0:v.maxWidth,noPadding:v.key==="data-table-select"||v.key==="data-table-expand",nowrap:v.nowrap,width:i.value?void 0:v.width},S,A),{default:()=>{var O,F,P,L,q;if(n[b]&&!i.value)return(O=n[b])==null?void 0:O.call(n,k);if(v.key==="data-table-select")return((F=n["item.data-table-select"])==null?void 0:F.call(n,k))??R(my,{disabled:!_.selectable,modelValue:s([_]),onClick:qu(()=>o(_),["stop"])},null);if(v.key==="data-table-expand")return((P=n["item.data-table-expand"])==null?void 0:P.call(n,k))??R(nr,{icon:u(_)?"$collapse":"$expand",size:"small",variant:"text",onClick:qu(()=>d(_),["stop"])},null);const T=Ct(k.value);return i.value?R(Ke,null,[R("div",{class:"v-data-table__td-title"},[((L=n[x])==null?void 0:L.call(n,C))??v.title]),R("div",{class:"v-data-table__td-value"},[((q=n[b])==null?void 0:q.call(n,k))??T])]):T}})})]))}}),c5e=mt({loading:[Boolean,String],loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideNoData:Boolean,items:{type:Array,default:()=>[]},noDataText:{type:String,default:"$vuetify.noDataText"},rowProps:[Object,Function],cellProps:[Object,Function],...T$()},"VDataTableRows"),Pde=Vt()({name:"VDataTableRows",inheritAttrs:!1,props:c5e(),setup(e,t){let{attrs:n,slots:r}=t;const{columns:i}=a4(),{expandOnClick:s,toggleExpand:o,isExpanded:a}=l5e(),{isSelected:l,toggleSelect:c}=l4(),{toggleGroup:u,isGroupOpen:d}=i5e(),{t:f}=ed(),{mobile:h}=_0(e);return Xt(()=>{var p,m;return e.loading&&(!e.items.length||r.loading)?R("tr",{class:"v-data-table-rows-loading",key:"loading"},[R("td",{colspan:i.value.length},[((p=r.loading)==null?void 0:p.call(r))??f(e.loadingText)])]):!e.loading&&!e.items.length&&!e.hideNoData?R("tr",{class:"v-data-table-rows-no-data",key:"no-data"},[R("td",{colspan:i.value.length},[((m=r["no-data"])==null?void 0:m.call(r))??f(e.noDataText)])]):R(Ke,null,[e.items.map((v,y)=>{var x;if(v.type==="group"){const k={index:y,item:v,columns:i.value,isExpanded:a,toggleExpand:o,isSelected:l,toggleSelect:c,toggleGroup:u,isGroupOpen:d};return r["group-header"]?r["group-header"](k):R(zwn,ut({key:`group-header_${v.id}`,item:v},OJ(n,":group-header",()=>k)),r)}const _={index:y,item:v.raw,internalItem:v,columns:i.value,isExpanded:a,toggleExpand:o,isSelected:l,toggleSelect:c},b={..._,props:ut({key:`item_${v.key??v.index}`,onClick:s.value?()=>{o(v)}:void 0,index:y,item:v,cellProps:e.cellProps,mobile:h.value},OJ(n,":row",()=>_),typeof e.rowProps=="function"?e.rowProps({item:_.item,index:_.index,internalItem:_.internalItem}):e.rowProps)};return R(Ke,{key:b.props.key},[r.item?r.item(b):R(qwn,b.props,r),a(v)&&((x=r["expanded-row"])==null?void 0:x.call(r,_))])})])}),{}}}),u5e=mt({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,...Fn(),...xc(),...Mi(),...js()},"VTable"),Ode=Vt()({name:"VTable",props:u5e(),setup(e,t){let{slots:n,emit:r}=t;const{themeClasses:i}=ko(e),{densityClasses:s}=nd(e);return Xt(()=>R(e.tag,{class:["v-table",{"v-table--fixed-height":!!e.height,"v-table--fixed-header":e.fixedHeader,"v-table--fixed-footer":e.fixedFooter,"v-table--has-top":!!n.top,"v-table--has-bottom":!!n.bottom,"v-table--hover":e.hover},i.value,s.value,e.class],style:e.style},{default:()=>{var o,a,l;return[(o=n.top)==null?void 0:o.call(n),n.default?R("div",{class:"v-table__wrapper",style:{height:An(e.height)}},[R("table",null,[n.default()])]):(a=n.wrapper)==null?void 0:a.call(n),(l=n.bottom)==null?void 0:l.call(n)]}})),{}}}),Ywn=mt({items:{type:Array,default:()=>[]},itemValue:{type:[String,Array,Function],default:"id"},itemSelectable:{type:[String,Array,Function],default:null},rowProps:[Object,Function],cellProps:[Object,Function],returnObject:Boolean},"DataTable-items");function Gwn(e,t,n,r){const i=e.returnObject?t:Bc(t,e.itemValue),s=Bc(t,e.itemSelectable,!0),o=r.reduce((a,l)=>(l.key!=null&&(a[l.key]=Bc(t,l.value)),a),{});return{type:"item",key:e.returnObject?Bc(t,e.itemValue):i,index:n,value:i,selectable:s,columns:o,raw:t}}function Kwn(e,t,n){return t.map((r,i)=>Gwn(e,r,i,n))}function Jwn(e,t){return{items:te(()=>Kwn(e,e.items,t.value))}}function Xwn(e){let{page:t,itemsPerPage:n,sortBy:r,groupBy:i,search:s}=e;const o=xo("VDataTable"),a=te(()=>({page:t.value,itemsPerPage:n.value,sortBy:r.value,groupBy:i.value,search:s.value}));let l=null;Nt(a,()=>{w0(l,a.value)||(l&&l.search!==a.value.search&&(t.value=1),o.emit("update:options",a.value),l=a.value)},{deep:!0,immediate:!0})}const Zwn=mt({...c5e(),hideDefaultBody:Boolean,hideDefaultFooter:Boolean,hideDefaultHeader:Boolean,width:[String,Number],search:String,...Wwn(),...Dwn(),..._wn(),...Ywn(),...Ewn(),...Own(),...n5e(),...u5e()},"DataTable"),Qwn=mt({...gwn(),...Zwn(),...HAe(),...q3e()},"VDataTable"),e_n=Vt()({name:"VDataTable",props:Qwn(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:groupBy":e=>!0,"update:expanded":e=>!0,"update:currentItems":e=>!0},setup(e,t){let{attrs:n,slots:r}=t;const{groupBy:i}=Lwn(e),{sortBy:s,multiSort:o,mustSort:a}=Mwn(e),{page:l,itemsPerPage:c}=vwn(e),{columns:u,headers:d,sortFunctions:f,sortRawFunctions:h,filterFunctions:p}=Twn(e,{groupBy:i,showSelect:Et(e,"showSelect"),showExpand:Et(e,"showExpand")}),{items:m}=Jwn(e,u),v=Et(e,"search"),{filteredItems:y}=UAe(e,m,v,{transform:G=>G.columns,customKeyFilter:p}),{toggleSort:_}=Rwn({sortBy:s,multiSort:o,mustSort:a,page:l}),{sortByWithGroups:b,opened:x,extractRows:k,isGroupOpen:C,toggleGroup:S}=Nwn({groupBy:i,sortBy:s}),{sortedItems:A}=jwn(e,y,b,{transform:G=>G.columns,sortFunctions:f,sortRawFunctions:h}),{flatItems:T}=Bwn(A,i,x),O=te(()=>T.value.length),{startIndex:F,stopIndex:P,pageCount:L,setItemsPerPage:q}=ywn({page:l,itemsPerPage:c,itemsLength:O}),{paginatedItems:V}=wwn({items:T,startIndex:F,stopIndex:P,itemsPerPage:c}),B=te(()=>k(V.value)),{isSelected:Y,select:D,selectAll:K,toggleSelect:z,someSelected:N,allSelected:Z}=Pwn(e,{allItems:m,currentPage:B}),{isExpanded:j,toggleExpand:M}=Hwn(e);Xwn({page:l,itemsPerPage:c,sortBy:s,groupBy:i,search:v}),eu({VDataTableRows:{hideNoData:Et(e,"hideNoData"),noDataText:Et(e,"noDataText"),loading:Et(e,"loading"),loadingText:Et(e,"loadingText")}});const W=te(()=>({page:l.value,itemsPerPage:c.value,sortBy:s.value,pageCount:L.value,toggleSort:_,setItemsPerPage:q,someSelected:N.value,allSelected:Z.value,isSelected:Y,select:D,selectAll:K,toggleSelect:z,isExpanded:j,toggleExpand:M,isGroupOpen:C,toggleGroup:S,items:B.value.map(G=>G.raw),internalItems:B.value,groupedItems:V.value,columns:u.value,headers:d.value}));return Xt(()=>{const G=Ade.filterProps(e),I=Ede.filterProps(e),ue=Pde.filterProps(e),be=Ode.filterProps(e);return R(Ode,ut({class:["v-data-table",{"v-data-table--show-select":e.showSelect,"v-data-table--loading":e.loading},e.class],style:e.style},be),{top:()=>{var se;return(se=r.top)==null?void 0:se.call(r,W.value)},default:()=>{var se,de,he,ee,ne,pe;return r.default?r.default(W.value):R(Ke,null,[(se=r.colgroup)==null?void 0:se.call(r,W.value),!e.hideDefaultHeader&&R("thead",{key:"thead"},[R(Ede,I,r)]),(de=r.thead)==null?void 0:de.call(r,W.value),!e.hideDefaultBody&&R("tbody",null,[(he=r["body.prepend"])==null?void 0:he.call(r,W.value),r.body?r.body(W.value):R(Pde,ut(n,ue,{items:V.value}),r),(ee=r["body.append"])==null?void 0:ee.call(r,W.value)]),(ne=r.tbody)==null?void 0:ne.call(r,W.value),(pe=r.tfoot)==null?void 0:pe.call(r,W.value)])},bottom:()=>r.bottom?r.bottom(W.value):!e.hideDefaultFooter&&R(Ke,null,[R(pv,null,null),R(Ade,G,{prepend:r["footer.prepend"]})])})}),{}}}),t_n={props:{adminSchema:{type:Object,required:!0},categorySchema:{type:Jy,required:!0}},components:{FieldsContainer:xx,FormCreate:H3e},data(){return{filtersOpen:!1,loading:!1,pageData:{},pageInfo:{},headers:{},selected:[],search:null,filters:{},perPageOptions:[25,50,100,150],actionToAll:!1,actionFormData:null,actionDialogConfirmation:!1,actionFormDialogOpen:!1,actionSelected:null,actionLoading:!1,persistentMessageDialog:!1,persistentMessage:null,isNarrow:!1}},mounted(){const e=window.matchMedia("(max-width: 1280px)");this.isNarrow=e.matches,e.addEventListener("change",t=>{this.isNarrow=t.matches})},created(){this.headers=this.getHeaders(),this.pageInfo={page:1,limit:j_().page_size||25},this.deserializeQuery(),this.getListData()},methods:{getHeaders(){let e=[];const t=this.categorySchema.getTableInfo();for(const n of t.table_schema.list_display){const r=t.table_schema.fields[n];if(!r){console.error("Table field from listDisplay not found:",n);continue}const i=r.header||{};i.field=r,i.key=n,i.type=r.type,i.title=r.label,i.align=i.align||"left",i.sortable=t.ordering_fields.indexOf(n)>=0,e.push(i)}return e},clickRow(e,t){e.ctrlKey&&(this.selected.includes(t.item.id)?this.selected.splice(this.selected.indexOf(t.item.id),1):this.selected.push(t.item.id))},getSelectedCount(){return this.actionToAll?this.getTotalCount():this.selected?this.selected.length:0},hasFilters(){const e=this.categorySchema.getTableInfo().table_filters;return this.categorySchema.getTableInfo().search_enabled||e&&Object.keys(e).length>0},getTotalCount(){return this.pageData.total_count||0},canCreate(){return this.categorySchema.getTableInfo().can_create},canRetrieve(){return this.categorySchema.getTableInfo().can_retrieve},handleClick(e,t){if(e==0&&this.canRetrieve()){const n=t[this.categorySchema.getTableInfo().pk_name];if(!this.categorySchema.getTableInfo().pk_name||!n){console.error(`PK value "${this.categorySchema.getTableInfo().pk_name}" not found in row:`,t);return}const r=kge(this.categorySchema.group,this.categorySchema.category,n);this.$router.push({path:r})}},deserializeQuery(){if(!this.categorySchema.group)return;const e=this.$route.query.page;e&&(this.pageInfo.page=parseInt(e));const t=this.$route.query.limit;if(t){let s=parseInt(t);this.pageInfo.limit=Math.min(150,Math.max(25,s))}const n=this.$route.query.ordering;n&&(this.ordering=n);const r=this.$route.query.search;r&&(this.search=r);const i=this.categorySchema.getTableInfo().table_filters||{};this.filters=zbn(this.$route,Object.keys(i))},serializeQuery(){if(!this.categorySchema.group)return;let e={};this.pageInfo.page&&(e.page=this.pageInfo.page),this.pageInfo.limit&&(e.limit=this.pageInfo.limit),this.ordering&&(e.ordering=this.ordering),this.search&&(e.search=this.search),e=Wbn(e,this.filters),this.$router.push({name:this.$route.name,query:e})},async getListData(){this.loading=!0,Wmn({pageInfo:this.pageInfo,filters:this.filters,search:this.search,ordering:this.ordering,group:this.categorySchema.group,category:this.categorySchema.category}).then(e=>{this.pageData=e,this.loading=!1}).catch(e=>{this.loading=!1,console.error("Get list error:",e);const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},handleFilter(e,t){this.pageInfo.page=1,this.filters=e,this.search=t,this.serializeQuery(),this.getListData()},hasActons(){return this.categorySchema.getTableInfo().actions?Object.keys(this.categorySchema.getTableInfo().actions).length>0:!1},isShowSelect(){return this.hasActons()},changePagination(){let e=j_();e.page_size=this.pageInfo.limit,NB(e),this.selected=[],this.serializeQuery(),this.getListData()},getPagesLength(){return Math.ceil((this.pageData.total_count||0)/this.pageInfo.limit)},pressAction(e,t){if(!e.allow_empty_selection&&!this.actionToAll&&this.selected.length===0){Ur(this.$t("actionNotAllowEmptySelection"),{limit:3,theme:"auto",type:"warning",position:"top-center"});return}this.actionFormData=null,this.actionMeta=null,this.actionSelected=t,e.form_schema?this.actionFormDialogOpen=!0:e.confirmation_text?this.actionDialogConfirmation=!0:this.applyAction()},getActionInfo(){return this.categorySchema.getTableInfo().actions[this.actionSelected]},applyAction(){this.actionLoading=!0,Gmn({group:this.categorySchema.group,category:this.categorySchema.category,action:this.actionSelected,pks:this.selected,formData:this.actionFormData||{},sendToAll:this.actionToAll,filters:this.filters,search:this.search}).then(e=>{if(e.headers["content-type"]!=="application/json"){const t=e.headers.pragma||`${Yt().format("DD.MM.YYYY_HH:MM")}.csv`;qmn(e.data,t,e.headers["content-type"])}else e.data.message?Ur(e.data.message.text,{type:e.data.message.type,position:e.data.message.position,dangerouslyHTMLString:!0}):e.data.persistent_message?(this.persistentMessageDialog=!0,this.persistentMessage=e.data.persistent_message):Ur(this.$t("successAdminAction"));this.actionDialogConfirmation=!1,this.actionFormDialogOpen=!1,this.actionLoading=!1,this.selected=[],this.getListData()}).catch(e=>{this.actionLoading=!1,console.error(`Admin action ${this.actionSelected} error:`,e);const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},updateSortBy(e){if(!e[0])this.ordering=null;else{const t=e[0].order==="desc"?"-":"",n=e[0].key;this.ordering=`${t}${n}`}this.serializeQuery(),this.getListData()},formatDateTime(e){if(e)return Yt(e).format("YYYY-MM-DD HH:mm")},getTableInfo(){return this.categorySchema.getTableInfo()},getChoiceValue(e,t){const n=e[t.key];return typeof n=="object"?n.value:n},getChoiceColor(e,t){const n=e[t.key];if(typeof n=="object"&&n.tag_color)return n.tag_color;if(t.field.choices){const r=this.getChoiceValue(e,t),i=t.field.choices.find(s=>s.value===r);if(i)return i.tag_color}return null},getChoiceTitle(e,t){const n=e[t.key];return typeof n=="object"?n.title:n},formatRelated(e){return e?Array.isArray(e)?e:[e]:[]},createdEvent(){this.serializeQuery(),this.getListData()},stripHtml(e){var n;const t=document.createElement("div");return t.innerHTML=e,((n=t.textContent)==null?void 0:n.trim())??""},truncate:dwn,getFiltersCount(){var e=0;return this.search&&(e+=1),this.filters&&(e+=Object.values(this.filters).filter(t=>t!=null).length),e},hasTagColors(e){return Array.isArray(e.choices)?e.choices.some(t=>t&&typeof t=="object"&&"tag_color"in t):!1}}},n_n={class:"list-page"},r_n={class:"list-above-block"},i_n={class:"header-row-filters"},s_n={key:0,class:"filters-inline"},o_n={key:1,class:"filters-drawer"},a_n={class:"navbar-filters"},l_n={class:"filters-drawer-header"},c_n={class:"header-row-actions"},u_n={key:0,class:"table-button"},d_n=["onClick"],f_n={key:4,class:"cell-string"},h_n={key:0,class:"cell-string"},p_n={key:1,class:"cell-string"},m_n={class:"cell-string"},g_n={class:"table-bottom"},v_n={key:0,class:"table-bottom-cell"},y_n={class:"selected-count"},b_n={class:"table-bottom-cell actions-cell"},w_n={class:"table-bottom-cell"},__n={class:"confirmation-text"},x_n={class:"selected-count"},k_n=["innerHTML"];function S_n(e,t,n,r,i,s){const o=z3e,a=H3e,l=xx;return fe(),Me("div",n_n,[Je("div",r_n,[Je("div",i_n,[i.isNarrow?(fe(),Me("div",o_n,[R(XB,{modelValue:i.filtersOpen,"onUpdate:modelValue":t[1]||(t[1]=c=>i.filtersOpen=c),location:"right",temporary:"",class:"filters-drawer-panel",width:"320"},{default:Re(()=>[Je("div",a_n,[Je("div",l_n,[R(nr,{icon:"mdi-close",onClick:t[0]||(t[0]=c=>i.filtersOpen=!1)})]),R(o,{"category-schema":n.categorySchema,"filters-init":i.filters,"search-init":i.search,onFiltered:s.handleFilter,loading:e.listLoading,"search-enabled":s.getTableInfo().search_enabled,"fields-info":s.getTableInfo().table_filters.fields,"search-help":s.getTableInfo().search_help},null,8,["category-schema","filters-init","search-init","onFiltered","loading","search-enabled","fields-info","search-help"])])]),_:1},8,["modelValue"]),s.getFiltersCount()>0?(fe(),at(hwn,{key:0,content:s.getFiltersCount(),onClick:t[2]||(t[2]=c=>i.filtersOpen=!0)},{default:Re(()=>[R(nr,{icon:"mdi-filter-variant"})]),_:1},8,["content"])):(fe(),at(nr,{key:1,icon:"mdi-filter-variant",onClick:t[3]||(t[3]=c=>i.filtersOpen=!0)}))])):(fe(),Me("div",s_n,[s.hasFilters()?(fe(),at(o,{key:0,"category-schema":n.categorySchema,"filters-init":i.filters,"search-init":i.search,onFiltered:s.handleFilter,loading:e.listLoading,"search-enabled":s.getTableInfo().search_enabled,"fields-info":s.getTableInfo().table_filters.fields,"search-help":s.getTableInfo().search_help},null,8,["category-schema","filters-init","search-init","onFiltered","loading","search-enabled","fields-info","search-help"])):Xe("",!0)]))]),Je("div",c_n,[s.canCreate()?(fe(),Me("div",u_n,[R(a,{title:n.categorySchema.title,"admin-schema":n.adminSchema,"category-schema":n.categorySchema,onCreated:s.createdEvent},null,8,["title","admin-schema","category-schema","onCreated"])])):Xe("",!0)])]),R(e_n,{class:"model-table",color:"primary",modelValue:i.selected,"onUpdate:modelValue":t[5]||(t[5]=c=>i.selected=c),items:i.pageData.data||[],headers:i.headers,loading:i.loading,"show-select":s.isShowSelect(),"items-per-page":i.pageInfo.limit,page:i.pageInfo.page,"onUpdate:sortBy":s.updateSortBy,"onClick:row":s.clickRow},Fa({bottom:Re(()=>[]),"header.data-table-select":Re(({on:c,props:u})=>[R(PS,{text:`${e.$t("applyToAllRecords")} ${s.getTotalCount()}`},{activator:Re(({props:d})=>[Je("div",ut(d,{class:"select-to-all"}),[R(CWe,{modelValue:i.actionToAll,"onUpdate:modelValue":t[4]||(t[4]=f=>i.actionToAll=f),color:"var(--color-darken-2)",density:"compact"},null,8,["modelValue"])],16)]),_:2},1032,["text"])]),_:2},[Cn(i.headers,(c,u)=>({name:`item.${c.key}`,fn:Re(({item:d})=>[Je("div",{onClick:f=>s.handleClick(u,d),class:Pt({"table-cell":!0,"table-link":u===0&&s.canRetrieve()})},[c.type==="string"?(fe(),Me(Ke,{key:0},[$n(Ct(s.stripHtml(d[c.key])),1)],64)):c.type==="related"?(fe(!0),Me(Ke,{key:1},Cn(s.formatRelated(d[c.key]),f=>(fe(),at(PS,{key:f.key},{activator:Re(({props:h})=>[R(Km,ut({size:c.field.size||"default",ref_for:!0},h),{default:Re(()=>[$n(Ct(s.truncate(f.title,30)),1)]),_:2},1040,["size"])]),default:Re(()=>[$n(" #"+Ct(f.key)+" "+Ct(f.title)+" ",1)]),_:2},1024))),128)):c.type==="boolean"?(fe(),Me(Ke,{key:2},[d[c.key]?(fe(),at(Tr,{key:0,color:"green-darken-2",icon:"mdi-check",size:"small"})):(fe(),at(Tr,{key:1,color:"red-darken-2",icon:"mdi-close",size:"small"}))],64)):c.type==="choice"?(fe(),Me(Ke,{key:3},[d[c.key]!==null&&d[c.key]!==void 0?(fe(),Me(Ke,{key:0},[s.hasTagColors(c.field)?(fe(),at(Km,{key:0,class:"table-choice-chip",size:c.field.size||"default",variant:c.field.variant,color:s.getChoiceColor(d,c)},{default:Re(()=>[$n(Ct(s.getChoiceTitle(d,c)),1)]),_:2},1032,["size","variant","color"])):(fe(),Me(Ke,{key:1},[$n(Ct(s.getChoiceTitle(d,c)),1)],64))],64)):Xe("",!0)],64)):c.type==="datetime"?(fe(),Me("span",f_n,Ct(s.formatDateTime(d[c.key])),1)):c.type==="image"?(fe(),Me(Ke,{key:5},[d[c.key]&&d[c.key].url?(fe(),at(vg,{key:0,class:"image-preview","max-height":c.field.preview_max_height||100,"max-width":c.field.preview_max_width||100,cover:"",src:d[c.key].url},null,8,["max-height","max-width","src"])):Xe("",!0)],64)):c.type==="file"?(fe(),Me(Ke,{key:6},[d[c.key]?(fe(),Me("span",h_n,Ct(d[c.key].name),1)):(fe(),Me("span",p_n,Ct(d[c.key]),1))],64)):(fe(),Me(Ke,{key:7},[Je("div",{class:Pt(c.type),style:{display:"none"}},null,2),Je("span",m_n,Ct(d[c.key]),1)],64))],10,d_n)])}))]),1032,["modelValue","items","headers","loading","show-select","items-per-page","page","onUpdate:sortBy","onClick:row"]),Je("div",g_n,[s.hasActons()?(fe(),Me("div",v_n,[R(Fu,{class:"info"},{default:Re(()=>[i.isNarrow?Xe("",!0):(fe(),Me(Ke,{key:0},[$n(Ct(e.$t("selected")),1)],64)),Je("p",y_n,Ct(s.getSelectedCount())+"/"+Ct(s.getTotalCount()),1)]),_:1})])):Xe("",!0),Je("div",b_n,[i.isNarrow?(fe(),at(a9,{key:1},{activator:Re(({props:c})=>[R(nr,ut({class:"action-button-opener"},c,{color:"primary",icon:"mdi-dots-vertical",disabled:i.actionLoading}),null,16,["disabled"])]),default:Re(()=>[R(Jv,null,{default:Re(()=>[(fe(!0),Me(Ke,null,Cn(n.categorySchema.getTableInfo().actions,(c,u)=>(fe(),at(Ia,{key:u,onClick:d=>s.pressAction(c,u)},{default:Re(()=>[R(Lme,null,{default:Re(()=>[$n(Ct(c.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})):(fe(!0),Me(Ke,{key:0},Cn(n.categorySchema.getTableInfo().actions,(c,u)=>(fe(),at(nr,{key:u,size:"small",class:"action-button",variant:c.variant||"flat","prepend-icon":c.icon,"base-color":c.base_color||"secondary",onClick:d=>s.pressAction(c,u),disabled:i.actionLoading},{default:Re(()=>[$n(Ct(c.title),1)]),_:2},1032,["variant","prepend-icon","base-color","onClick","disabled"]))),128))]),Je("div",w_n,[R(PS,{location:"start",text:e.$t("itemsPerPage")},{activator:Re(({props:c})=>[Je("div",Po(ya(c)),[R(Ky,{class:"list-pagination-per-page",modelValue:i.pageInfo.limit,"onUpdate:modelValue":[t[6]||(t[6]=u=>i.pageInfo.limit=u),t[7]||(t[7]=u=>{this.pageInfo.page=1,s.changePagination(u)})],items:i.perPageOptions},null,8,["modelValue","items"])],16)]),_:1},8,["text"]),i.isNarrow?Xe("",!0):(fe(),at(Fu,{key:0,class:"info"},{default:Re(()=>[$n(Ct(s.getTotalCount()),1)]),_:1})),R(zF,{class:"list-pagination",modelValue:i.pageInfo.page,"onUpdate:modelValue":[t[8]||(t[8]=c=>i.pageInfo.page=c),t[9]||(t[9]=c=>s.changePagination(c))],length:s.getPagesLength(),"total-visible":i.isNarrow?1:5,size:"40"},null,8,["modelValue","length","total-visible"])])]),R(Xw,{modelValue:i.actionDialogConfirmation,"onUpdate:modelValue":t[12]||(t[12]=c=>i.actionDialogConfirmation=c),"max-width":"500"},{default:Re(()=>[R(ul,{disabled:i.actionLoading,loading:i.actionLoading},{default:Re(()=>[R(aC,{class:"d-flex justify-space-between align-center"},{default:Re(()=>[Je("span",null,Ct(e.$t("confirmation"))+": "+Ct(s.getActionInfo().title),1),R(nr,{icon:"mdi-close",variant:"text",density:"compact",onClick:t[10]||(t[10]=c=>i.actionDialogConfirmation=!1)})]),_:1}),R(vy,null,{default:Re(()=>[Je("div",__n,Ct(s.getActionInfo().confirmation_text),1),R(Fu,{class:"info selected-warning-count"},{default:Re(()=>[$n(Ct(e.$t("selected"))+" ",1),Je("p",x_n,Ct(s.getSelectedCount())+"/"+Ct(s.getTotalCount()),1)]),_:1})]),_:1}),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("cancel"),variant:"elevated",onClick:t[11]||(t[11]=c=>i.actionDialogConfirmation=!1),disabled:i.actionLoading},null,8,["text","disabled"]),R(nr,{text:e.$t("confirm"),variant:"tonal",color:"primary",onClick:s.applyAction,disabled:i.actionLoading},null,8,["text","onClick","disabled"])]),_:1})]),_:1},8,["disabled","loading"])]),_:1},8,["modelValue"]),R(Xw,{persistent:"",modelValue:i.actionFormDialogOpen,"onUpdate:modelValue":t[16]||(t[16]=c=>i.actionFormDialogOpen=c),class:"action-form-dialog"},{default:Re(()=>[R(ul,{disabled:i.actionLoading,loading:i.actionLoading},{default:Re(()=>[R(aC,{class:"d-flex justify-space-between align-center"},{default:Re(()=>[Je("span",null,Ct(s.getActionInfo().title),1),R(nr,{icon:"mdi-close",variant:"text",density:"compact",onClick:t[13]||(t[13]=c=>i.actionFormDialogOpen=!1)})]),_:1}),Je("div",{class:"action-description",innerHTML:s.getActionInfo().description},null,8,k_n),R(l,{ref:"fieldscontainer",formType:"create","table-schema":s.getActionInfo().form_schema,loading:i.actionLoading,onChanged:t[14]||(t[14]=c=>i.actionFormData=c)},null,8,["table-schema","loading"]),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("cancel"),variant:"elevated",onClick:t[15]||(t[15]=c=>i.actionFormDialogOpen=!1),disabled:i.actionLoading},null,8,["text","disabled"]),R(nr,{text:e.$t("send"),variant:"tonal",color:"primary",onClick:s.applyAction,disabled:i.actionLoading},null,8,["text","onClick","disabled"])]),_:1})]),_:1},8,["disabled","loading"])]),_:1},8,["modelValue"]),R(Xw,{modelValue:i.persistentMessageDialog,"onUpdate:modelValue":t[18]||(t[18]=c=>i.persistentMessageDialog=c),class:"persistent-message-dialog"},{default:Re(()=>[R(ul,null,{default:Re(()=>[R(vy,{innerHTML:i.persistentMessage},null,8,["innerHTML"]),R(Xk,null,{default:Re(()=>[R(Jk),R(nr,{text:e.$t("close"),variant:"elevated",onClick:t[17]||(t[17]=c=>i.persistentMessageDialog=!1)},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const d5e=gi(t_n,[["render",S_n]]),C_n={props:{adminSchema:{type:Object,required:!0},settings:{type:Object,required:!0},group:{type:String,required:!0},category:{type:String,required:!0}},components:{TableCategory:d5e,DashboardCategory:W3e},data(){return{currentTab:null,apiMethods:null,categorySchema:null}},created(){if(this.categorySchema=this.adminSchema.get_category(this.group,this.category),!this.categorySchema){console.error(`Page with category "${this.category}" not found`),this.$router.push({path:"/404"});return}},watch:{$route:{immediate:!0,handler(e,t){var r;const n=this.adminSchema.get_category(this.group,this.category);n&&(document.title=`${n.title} | ${(r=this.settings)==null?void 0:r.title}`)}}},methods:{getType(){if(this.categorySchema)return this.categorySchema.type}}};function $_n(e,t,n,r,i,s){const o=d5e,a=W3e;return s.getType()==="table"?(fe(),at(o,{key:0,"admin-schema":n.adminSchema,"category-schema":i.categorySchema},null,8,["admin-schema","category-schema"])):s.getType()==="dashboard"?(fe(),at(a,{key:1,"admin-schema":n.adminSchema,"category-schema":i.categorySchema},null,8,["admin-schema","category-schema"])):(fe(),Me(Ke,{key:2},[$n(' Category type "'+Ct(s.getType())+'" is not supported ',1)],64))}const f5e=gi(C_n,[["render",$_n]]);function T_n(e){return{required:t=>n=>!!n||t||e("validation.required"),min_length:t=>n=>n&&String(n).length>=t||e("validation.min_length",{min_length:t}),max_length:t=>n=>!n||String(n).length<=t||e("validation.max_length",{min_length:t})}}const A_n=Ap(Nr.backend_prefix,"auth/login/");function E_n(e){var t={username:e.username,password:e.password,phone:""};return id({url:A_n,method:"post",data:t,headers:{"Accept-Language":Vd(),"Cache-Control":"no-cache"},timeout:Nr.api_timeout_ms})}function P_n(e,t){return console.assert(Nr.backend_prefix,"backend url is not set!"),new Promise((n,r)=>{E_n({username:e.trim(),password:t}).then(i=>{hqe(i.data.token,i.data.token),localStorage.setItem("name",i.data.username),localStorage.setItem("user_id",i.data.pk),n()}).catch(i=>{r(i)})})}const O_n=mt({...Fn(),...Cpe({fullHeight:!0}),...js()},"VApp"),h5e=Vt()({name:"VApp",props:O_n(),setup(e,t){let{slots:n}=t;const r=ko(e),{layoutClasses:i,getLayoutItem:s,items:o,layoutRef:a}=Ape(e),{rtlClasses:l}=td();return Xt(()=>R("div",{ref:a,class:["v-application",r.themeClasses.value,i.value,l.value,e.class],style:[e.style]},[R("div",{class:"v-application__wrap"},[R(fB,null,{default:()=>{var c;return[R(Ke,null,[(c=n.default)==null?void 0:c.call(n)])]}})])])),{getLayoutItem:s,items:o,theme:r}}}),M_n=mt({...Fn(),...wWe()},"VForm"),R_n=Vt()({name:"VForm",props:M_n(),emits:{"update:modelValue":e=>!0,submit:e=>!0},setup(e,t){let{slots:n,emit:r}=t;const i=_We(e),s=Ve();function o(l){l.preventDefault(),i.reset()}function a(l){const c=l,u=i.validate();c.then=u.then.bind(u),c.catch=u.catch.bind(u),c.finally=u.finally.bind(u),r("submit",c),c.defaultPrevented||u.then(d=>{var h;let{valid:f}=d;f&&((h=s.value)==null||h.submit())}),c.preventDefault()}return Xt(()=>{var l;return R("form",{ref:s,class:["v-form",e.class],style:e.style,novalidate:!0,onReset:o,onSubmit:a},[(l=n.default)==null?void 0:l.call(n,i)])}),Tp(i,s)}}),j_n={data(){return{rules:{},username:"",password:"",show:!1,loading:!1,settingsLoading:!0}},watch:{$route:{immediate:!0,handler(e,t){document.title=`${this.$t("login")} | Admin Panel`}}},async created(){this.rules=T_n(this.$t),this.settingsLoading=!0,Tge().then(e=>{this.settingsLoading=!1,this.settings=e}).catch(e=>{this.settingsLoading=!1,console.error("Get admin settings error:",e);const t=this.$handleError(e);t.fieldErrors&&this.$refs.fieldscontainer.updateErrors(t.fieldErrors),t.persistentMessage&&(this.persistentMessageDialog=!0,this.persistentMessage=t.persistentMessage)})},methods:{getLogo(){return Nr.logo_image},getTitle(){return this.settings.title},getLoginGreetingsMessage(){return this.settings.login_greetings_message},getDescription(){return this.settings.description},async login(){(await this.$refs.loginForm.validate()).valid&&(this.loading=!0,P_n(this.username,this.password).then(()=>{this.$router.push(this.settings.main_page||"/"),this.loading=!1}).catch(t=>{this.loading=!1;const n=this.$handleError(t);n.persistentMessage&&(this.persistentMessage=n.persistentMessage)}))}}},I_n={class:"top-right-icon"},D_n={key:1,class:"login-title"},L_n=["innerHTML"],N_n=["innerHTML"];function F_n(e,t,n,r,i,s){const o=u9,a=Qpe,l=b9;return fe(),at(h5e,null,{default:Re(()=>[R(w9,{class:"login-page"},{default:Re(()=>[R(o,{ref:"settings"},null,512),R(A$,{fluid:"",class:"fill-height gradient-bg"},{default:Re(()=>[R(Dm,null,{default:Re(()=>[R(Pf,{class:"d-flex justify-center"},{default:Re(()=>[i.settingsLoading?(fe(),at(a,{key:0})):Xe("",!0),e.settings?(fe(),at(ul,{key:1,class:"login-window"},{title:Re(()=>[R(Dm,{justify:"center","no-gutters":""},{default:Re(()=>[s.getLogo()?(fe(),at(vg,{key:0,class:"project-logo",alt:s.getTitle(),src:s.getLogo(),"max-width":"250",eager:!0},null,8,["alt","src"])):(fe(),Me("span",D_n,Ct(s.getTitle()),1))]),_:1})]),default:Re(()=>[Je("div",I_n,[e.settings&&e.settings.languages?(fe(),at(l,{key:0,langs:e.settings.languages},null,8,["langs"])):Xe("",!0),R(nr,{icon:"",onClick:t[0]||(t[0]=c=>e.$refs.settings.toggle())},{default:Re(()=>[R(Tr,null,{default:Re(()=>[$n("mdi-cog-outline")]),_:1})]),_:1})]),R(vy,{class:"bg-surface-light pt-4"},{default:Re(()=>[s.getDescription()?(fe(),at(RMe,{key:0,class:"login-description",color:"primary",variant:"tonal",border:"start"},{default:Re(()=>[Je("p",{innerHTML:s.getDescription()},null,8,L_n)]),_:1})):Xe("",!0),R(R_n,{class:"login-form",ref:"loginForm","validate-on":"submit"},{default:Re(()=>[R(bc,{density:"default",hideDetails:!1,loading:i.loading,disabled:i.loading,modelValue:i.username,"onUpdate:modelValue":t[1]||(t[1]=c=>i.username=c),rules:[i.rules.required,i.rules.min_length(5)],label:e.$t("username"),required:"",onKeydown:Ym(qu(s.login,["prevent"]),["enter"])},null,8,["loading","disabled","modelValue","rules","label","onKeydown"]),R(bc,{density:"default",hideDetails:!1,disabled:i.loading,modelValue:i.password,"onUpdate:modelValue":t[2]||(t[2]=c=>i.password=c),rules:[i.rules.required,i.rules.min_length(5)],label:e.$t("password"),type:i.show?"text":"password","append-icon":i.show?"mdi-eye":"mdi-eye-off",required:"","onClick:append":t[3]||(t[3]=c=>i.show=!i.show),onKeydown:Ym(qu(s.login,["prevent"]),["enter"])},null,8,["disabled","modelValue","rules","label","type","append-icon","onKeydown"])]),_:1},512),s.getLoginGreetingsMessage()?(fe(),at(ul,{key:1,color:"primary",variant:"outlined",class:"mx-auto login-description"},{default:Re(()=>[R(Cge,null,{default:Re(()=>[Je("div",{innerHTML:s.getLoginGreetingsMessage()},null,8,N_n)]),_:1})]),_:1})):Xe("",!0),R(Dm,{justify:"end","no-gutters":""},{default:Re(()=>[R(nr,{onClick:s.login,disabled:i.loading},{default:Re(()=>[$n(Ct(e.$t("login")),1)]),_:1},8,["onClick","disabled"])]),_:1})]),_:1})]),_:1})):Xe("",!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const B_n=gi(j_n,[["render",F_n]]),V_n={props:{apiInfo:{type:Object,required:!0}},methods:{getLogo(){return Nr.logo_image}}},z_n={class:"page-404"},W_n={class:"text-h4 text-center"},H_n={class:"text-center text-subtitle-2"},U_n={class:"navigation-link text-center"};function q_n(e,t,n,r,i,s){const o=li("router-link");return fe(),at(h5e,null,{default:Re(()=>[R(w9,null,{default:Re(()=>[R(A$,{fluid:"",class:"fill-height gradient-bg"},{default:Re(()=>[R(Dm,null,{default:Re(()=>[R(Pf,{class:"d-flex justify-center"},{default:Re(()=>[Je("div",z_n,[s.getLogo()?(fe(),at(o,{key:0,to:"/navigation"},{default:Re(()=>[R(vg,{class:"project-logo",src:s.getLogo(),"max-width":"400",eager:!0},null,8,["src"])]),_:1})):Xe("",!0),Je("p",W_n,Ct(e.$t("notFoundPageHeadline")),1),Je("p",H_n,Ct(e.$t("notFoundPageTitle")),1),R(o,{to:"/navigation"},{default:Re(()=>[Je("p",U_n,Ct(e.$t("notFoundPageGoBack")),1)]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Y_n=gi(V_n,[["render",q_n]]),G_n=[{path:"",redirect:"/navigation"},{path:"/login",component:B_n},{path:"/404",component:Y_n},{path:"",component:tYe,children:[{path:"navigation",props:!0,component:lgn},{path:":group/:category/",props:!0,name:"category",component:f5e},{path:":group/:category/:pk/",props:!0,name:"detail",component:BMe}]},{path:"/:pathMatch(.*)*",redirect:"/404",hidden:!0}],K_n=bze({history:YVe(Nr.base_admin_url||"admin/"),routes:G_n});function J_n(e){e.use(gVe).use(K_n).use(LB)}function X_n(e){return function(n){if(console.error(`API error url=${n.config.url}`),console.error(n),!(n!=null&&n.response))return Ur(e("errorMessage",{status:"-",errorText:String(n)}),{type:"error",position:"top-center",dangerouslyHTMLString:!0}),{};const{status:r,data:i}=n.response;if(r===422&&Array.isArray(i==null?void 0:i.detail)){const s=i.detail.map(o=>{var l;const a=(l=o.loc)==null?void 0:l.slice(1).join(".");return a?`${a}: ${o.msg}`:o.msg});Ur(e("validationErrors",{errors:s.join(`
525
525
  `)}),{theme:"auto",type:"error",position:"top-center"})}else r>=400&&r<500&&(i!=null&&i.code?Ur(e(i.code),{theme:"auto",type:"error",position:"top-center"}):i!=null&&i.message?Ur(i.message,{theme:"auto",type:"error",position:"top-center"}):Ur(String(i),{theme:"auto",type:"error",position:"top-center"}));return r>=500&&(console.error("Error:",(i==null?void 0:i.message)??String(i)),Ur(e("errorMessage",{status:r,errorText:(i==null?void 0:i.message)??String(i)}),{type:"error",position:"top-center",dangerouslyHTMLString:!0})),{persistentMessage:n.response.data.persistent_message,fieldErrors:n.response.data.field_errors}}}const Z_n={};function Q_n(e,t){const n=li("router-view");return fe(),at(n)}const e2n=gi(Z_n,[["render",Q_n]]);function t2n(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}const pg=$B(e2n);pg.component("JsonForms",tye);pg.component("Category",f5e);pg.component("Detail",BMe);J_n(pg);var Mde;const n2n=(Mde=pg.config.globalProperties.$t)==null?void 0:Mde.bind(pg.config.globalProperties);pg.config.globalProperties.$handleError=X_n(n2n??(e=>String(e)));const r2n=t2n();pg.config.globalProperties.emitter=r2n;pg.mount("#app")});export default i2n();
@@ -13,7 +13,7 @@
13
13
  <link rel="icon" href="{{ favicon_image }}" />
14
14
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
15
  <title>{{ title }}</title>
16
- <script type="module" crossorigin src="/admin/static/index-8ahvKI6W.js"></script>
16
+ <script type="module" crossorigin src="/admin/static/index-COgQt_g1.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="/admin/static/index-B8JOx1Ps.css">
18
18
  </head>
19
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brilliance-admin
3
- Version: 0.44.12
3
+ Version: 0.44.13
4
4
  Summary: Simple and lightweight data managment framework powered by FastAPI and Vue3 Vuetify all-in-one. Some call it heavenly in its brilliance.
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.10
@@ -43,8 +43,8 @@ brilliance_admin/schema/table/table_models.py,sha256=xidraifRYbXGkiVLn6dJ96dkOhW
43
43
  brilliance_admin/schema/table/fields/__init__.py,sha256=RW-sIFTAaSQo4mMR6iWtnefogWPjmg6KAsDwe9mKW1k,291
44
44
  brilliance_admin/schema/table/fields/base.py,sha256=rSVTsY1ph9ix33NiPslDjPjnwWvHwNtvt90FAByE4mQ,10243
45
45
  brilliance_admin/schema/table/fields/function_field.py,sha256=4fm9kS8zpBG5oqp9sA81NQDHiqvU0BQmpf-wjkTuuwM,1780
46
- brilliance_admin/static/index-8ahvKI6W.js,sha256=UVxVir-ZeOS8j83b7hAD-ZCanD7TO3vrNMgnclPFlP8,3209593
47
46
  brilliance_admin/static/index-B8JOx1Ps.css,sha256=tvExD9r6ozGNJwjveAsdguzJ7Eab2iT-Z9coevdEtK0,984316
47
+ brilliance_admin/static/index-COgQt_g1.js,sha256=lF1ZuLlQwuKeqm69AbjyTdXdTiIAadjHyK2bTl0NeoM,3209593
48
48
  brilliance_admin/static/materialdesignicons-webfont-CYDMK1kx.woff2,sha256=5S1g9kJnzaoIQitQurXUW9NeZisDua91F5zq4ArF_Is,385360
49
49
  brilliance_admin/static/materialdesignicons-webfont-CgCzGbLl.woff,sha256=SNPuxqtw3HoZCPm6LyCOClhxi57hbj9qvbXbT0Yfolg,561776
50
50
  brilliance_admin/static/materialdesignicons-webfont-D3kAzl71.ttf,sha256=vXJaejiTnltZkE4benJlkZ7OwlYWbs5p1RXCEAUWWQc,1243500
@@ -65,9 +65,9 @@ brilliance_admin/static/tinymce/plugins/accordion/css/accordion.css,sha256=u5UQk
65
65
  brilliance_admin/static/tinymce/plugins/codesample/css/prism.css,sha256=exAdMtHbvwW7-DEs567MX65Fq1aJQTfREP5pw8gW-AY,1736
66
66
  brilliance_admin/static/tinymce/plugins/customLink/plugin.js,sha256=illBNpnHDkBsLG6wo_jDPF6z7CGnO1MQWUoDwZKy6vQ,5589
67
67
  brilliance_admin/static/tinymce/plugins/customLink/css/link.css,sha256=gh5nvY8Z92hJfCEBPnIm4jIPCcKKbJnab-30oIfX7Hc,56
68
- brilliance_admin/templates/index.html,sha256=B7ExuuNN6qMvD5VHnezrHs_eYlwoLptGSHj96C9Q_EA,1294
69
- brilliance_admin-0.44.12.dist-info/licenses/LICENSE,sha256=rgWE5Cxk53W0PhTOVmcQedABEWN1QMG-PRz3fz531sE,1074
70
- brilliance_admin-0.44.12.dist-info/METADATA,sha256=Pt5porK8GT1bv2N3cknxbp31hzXXnarI7r3Dwvy3VVE,7393
71
- brilliance_admin-0.44.12.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
72
- brilliance_admin-0.44.12.dist-info/top_level.txt,sha256=almFFSWrVYieI3i54hYL0fMUaeuIYiazS2Kx4wtK-ns,17
73
- brilliance_admin-0.44.12.dist-info/RECORD,,
68
+ brilliance_admin/templates/index.html,sha256=RHNLExQzUemOT5pPyDw40clpYb2fd4w53Mf3uiiLFQQ,1294
69
+ brilliance_admin-0.44.13.dist-info/licenses/LICENSE,sha256=rgWE5Cxk53W0PhTOVmcQedABEWN1QMG-PRz3fz531sE,1074
70
+ brilliance_admin-0.44.13.dist-info/METADATA,sha256=RB7fpnfpqEVN1cmO6K6liqYDumSQ6PGa6cemU1JlLqc,7393
71
+ brilliance_admin-0.44.13.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
72
+ brilliance_admin-0.44.13.dist-info/top_level.txt,sha256=almFFSWrVYieI3i54hYL0fMUaeuIYiazS2Kx4wtK-ns,17
73
+ brilliance_admin-0.44.13.dist-info/RECORD,,