django-ledger 0.8.0__py3-none-any.whl → 0.8.2__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.
Potentially problematic release.
This version of django-ledger might be problematic. Click here for more details.
- django_ledger/__init__.py +1 -1
- django_ledger/forms/account.py +45 -46
- django_ledger/forms/data_import.py +182 -64
- django_ledger/io/io_core.py +507 -374
- django_ledger/migrations/0026_stagedtransactionmodel_customer_model_and_more.py +56 -0
- django_ledger/models/__init__.py +2 -1
- django_ledger/models/bill.py +337 -300
- django_ledger/models/customer.py +47 -34
- django_ledger/models/data_import.py +770 -289
- django_ledger/models/entity.py +882 -637
- django_ledger/models/mixins.py +421 -282
- django_ledger/models/receipt.py +1083 -0
- django_ledger/models/transactions.py +105 -41
- django_ledger/models/unit.py +42 -30
- django_ledger/models/utils.py +12 -2
- django_ledger/models/vendor.py +85 -66
- django_ledger/settings.py +1 -0
- django_ledger/static/django_ledger/bundle/djetler.bundle.js +1 -1
- django_ledger/static/django_ledger/bundle/djetler.bundle.js.LICENSE.txt +1 -13
- django_ledger/templates/django_ledger/bills/bill_update.html +1 -1
- django_ledger/templates/django_ledger/components/period_navigator.html +5 -3
- django_ledger/templates/django_ledger/customer/customer_detail.html +87 -0
- django_ledger/templates/django_ledger/customer/customer_list.html +0 -1
- django_ledger/templates/django_ledger/customer/tags/customer_table.html +3 -1
- django_ledger/templates/django_ledger/data_import/tags/data_import_job_txs_imported.html +24 -3
- django_ledger/templates/django_ledger/data_import/tags/data_import_job_txs_table.html +26 -10
- django_ledger/templates/django_ledger/entity/entity_dashboard.html +2 -2
- django_ledger/templates/django_ledger/invoice/invoice_update.html +1 -1
- django_ledger/templates/django_ledger/layouts/base.html +3 -1
- django_ledger/templates/django_ledger/layouts/content_layout_1.html +1 -1
- django_ledger/templates/django_ledger/receipt/customer_receipt_report.html +115 -0
- django_ledger/templates/django_ledger/receipt/receipt_delete.html +30 -0
- django_ledger/templates/django_ledger/receipt/receipt_detail.html +89 -0
- django_ledger/templates/django_ledger/receipt/receipt_list.html +134 -0
- django_ledger/templates/django_ledger/receipt/vendor_receipt_report.html +115 -0
- django_ledger/templates/django_ledger/vendor/tags/vendor_table.html +3 -2
- django_ledger/templates/django_ledger/vendor/vendor_detail.html +86 -0
- django_ledger/templatetags/django_ledger.py +338 -191
- django_ledger/urls/__init__.py +1 -0
- django_ledger/urls/customer.py +3 -0
- django_ledger/urls/data_import.py +3 -0
- django_ledger/urls/receipt.py +102 -0
- django_ledger/urls/vendor.py +1 -0
- django_ledger/views/__init__.py +1 -0
- django_ledger/views/customer.py +56 -14
- django_ledger/views/data_import.py +119 -66
- django_ledger/views/mixins.py +112 -86
- django_ledger/views/receipt.py +294 -0
- django_ledger/views/vendor.py +53 -14
- {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/METADATA +1 -1
- {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/RECORD +55 -45
- django_ledger/static/django_ledger/bundle/styles.bundle.js +0 -1
- {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/WHEEL +0 -0
- {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/licenses/AUTHORS.md +0 -0
- {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/licenses/LICENSE +0 -0
- {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see djetler.bundle.js.LICENSE.txt */
|
|
2
|
-
var djLedger;(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{closeModal:()=>Mh,renderNetPayablesChart:()=>_h,renderNetReceivablesChart:()=>vh,renderPnLChart:()=>yh,showModal:()=>wh,submitForm:()=>Sh,toggleDropdown:()=>Oh,toggleModal:()=>kh});var i={};function n(t,e){return function(){return t.apply(e,arguments)}}t.r(i),t.d(i,{hasBrowserEnv:()=>ut,hasStandardBrowserEnv:()=>pt,hasStandardBrowserWebWorkerEnv:()=>gt,navigator:()=>ft,origin:()=>mt});const{toString:s}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:r,toStringTag:a}=Symbol,l=(c=Object.create(null),t=>{const e=s.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const h=t=>(t=t.toLowerCase(),e=>l(e)===t),d=t=>e=>typeof e===t,{isArray:u}=Array,f=d("undefined");function p(t){return null!==t&&!f(t)&&null!==t.constructor&&!f(t.constructor)&&b(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const g=h("ArrayBuffer"),m=d("string"),b=d("function"),x=d("number"),y=t=>null!==t&&"object"==typeof t,_=t=>{if("object"!==l(t))return!1;const e=o(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||a in t||r in t)},v=h("Date"),w=h("File"),M=h("Blob"),k=h("FileList"),S=h("URLSearchParams"),[O,E,P,C]=["ReadableStream","Request","Response","Headers"].map(h);function A(t,e,{allOwnKeys:i=!1}={}){if(null==t)return;let n,s;if("object"!=typeof t&&(t=[t]),u(t))for(n=0,s=t.length;n<s;n++)e.call(null,t[n],n,t);else{if(p(t))return;const s=i?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let r;for(n=0;n<o;n++)r=s[n],e.call(null,t[r],r,t)}}function D(t,e){if(p(t))return null;e=e.toLowerCase();const i=Object.keys(t);let n,s=i.length;for(;s-- >0;)if(n=i[s],e===n.toLowerCase())return n;return null}const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,R=t=>!f(t)&&t!==T,L=(I="undefined"!=typeof Uint8Array&&o(Uint8Array),t=>I&&t instanceof I);var I;const F=h("HTMLFormElement"),j=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),z=h("RegExp"),N=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),n={};A(i,((i,s)=>{let o;!1!==(o=e(i,s,t))&&(n[s]=o||i)})),Object.defineProperties(t,n)},B=h("AsyncFunction"),V=(W="function"==typeof setImmediate,H=b(T.postMessage),W?setImmediate:H?(U=`axios@${Math.random()}`,$=[],T.addEventListener("message",(({source:t,data:e})=>{t===T&&e===U&&$.length&&$.shift()()}),!1),t=>{$.push(t),T.postMessage(U,"*")}):t=>setTimeout(t));var W,H,U,$;const q="undefined"!=typeof queueMicrotask?queueMicrotask.bind(T):"undefined"!=typeof process&&process.nextTick||V,Y={isArray:u,isArrayBuffer:g,isBuffer:p,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||b(t.append)&&("formdata"===(e=l(t))||"object"===e&&b(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&g(t.buffer),e},isString:m,isNumber:x,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:_,isEmptyObject:t=>{if(!y(t)||p(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:O,isRequest:E,isResponse:P,isHeaders:C,isUndefined:f,isDate:v,isFile:w,isBlob:M,isRegExp:z,isFunction:b,isStream:t=>y(t)&&b(t.pipe),isURLSearchParams:S,isTypedArray:L,isFileList:k,forEach:A,merge:function t(){const{caseless:e}=R(this)&&this||{},i={},n=(n,s)=>{const o=e&&D(i,s)||s;_(i[o])&&_(n)?i[o]=t(i[o],n):_(n)?i[o]=t({},n):u(n)?i[o]=n.slice():i[o]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&A(arguments[t],n);return i},extend:(t,e,i,{allOwnKeys:s}={})=>(A(e,((e,s)=>{i&&b(e)?t[s]=n(e,i):t[s]=e}),{allOwnKeys:s}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,i,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,e,i,n)=>{let s,r,a;const l={};if(e=e||{},null==t)return e;do{for(s=Object.getOwnPropertyNames(t),r=s.length;r-- >0;)a=s[r],n&&!n(a,t,e)||l[a]||(e[a]=t[a],l[a]=!0);t=!1!==i&&o(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:l,kindOfTest:h,endsWith:(t,e,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;const n=t.indexOf(e,i);return-1!==n&&n===i},toArray:t=>{if(!t)return null;if(u(t))return t;let e=t.length;if(!x(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},forEachEntry:(t,e)=>{const i=(t&&t[r]).call(t);let n;for(;(n=i.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll:(t,e)=>{let i;const n=[];for(;null!==(i=t.exec(e));)n.push(i);return n},isHTMLForm:F,hasOwnProperty:j,hasOwnProp:j,reduceDescriptors:N,freezeMethods:t=>{N(t,((e,i)=>{if(b(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=t[i];b(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(t,e)=>{const i={},n=t=>{t.forEach((t=>{i[t]=!0}))};return u(t)?n(t):n(String(t).split(e)),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,i){return e.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:D,global:T,isContextDefined:R,isSpecCompliantForm:function(t){return!!(t&&b(t.append)&&"FormData"===t[a]&&t[r])},toJSONObject:t=>{const e=new Array(10),i=(t,n)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(p(t))return t;if(!("toJSON"in t)){e[n]=t;const s=u(t)?[]:{};return A(t,((t,e)=>{const o=i(t,n+1);!f(o)&&(s[e]=o)})),e[n]=void 0,s}}return t};return i(t,0)},isAsyncFn:B,isThenable:t=>t&&(y(t)||b(t))&&b(t.then)&&b(t.catch),setImmediate:V,asap:q,isIterable:t=>null!=t&&b(t[r])};function X(t,e,i,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}Y.inherits(X,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.status}}});const K=X.prototype,J={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{J[t]={value:t}})),Object.defineProperties(X,J),Object.defineProperty(K,"isAxiosError",{value:!0}),X.from=(t,e,i,n,s,o)=>{const r=Object.create(K);return Y.toFlatObject(t,r,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),X.call(r,t.message,e,i,n,s),r.cause=t,r.name=t.name,o&&Object.assign(r,o),r};const G=X;function Q(t){return Y.isPlainObject(t)||Y.isArray(t)}function Z(t){return Y.endsWith(t,"[]")?t.slice(0,-2):t}function tt(t,e,i){return t?t.concat(e).map((function(t,e){return t=Z(t),!i&&e?"["+t+"]":t})).join(i?".":""):e}const et=Y.toFlatObject(Y,{},null,(function(t){return/^is[A-Z]/.test(t)})),it=function(t,e,i){if(!Y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(i=Y.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Y.isUndefined(e[t])}))).metaTokens,s=i.visitor||c,o=i.dots,r=i.indexes,a=(i.Blob||"undefined"!=typeof Blob&&Blob)&&Y.isSpecCompliantForm(e);if(!Y.isFunction(s))throw new TypeError("visitor must be a function");function l(t){if(null===t)return"";if(Y.isDate(t))return t.toISOString();if(Y.isBoolean(t))return t.toString();if(!a&&Y.isBlob(t))throw new G("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(t)||Y.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,i,s){let a=t;if(t&&!s&&"object"==typeof t)if(Y.endsWith(i,"{}"))i=n?i:i.slice(0,-2),t=JSON.stringify(t);else if(Y.isArray(t)&&function(t){return Y.isArray(t)&&!t.some(Q)}(t)||(Y.isFileList(t)||Y.endsWith(i,"[]"))&&(a=Y.toArray(t)))return i=Z(i),a.forEach((function(t,n){!Y.isUndefined(t)&&null!==t&&e.append(!0===r?tt([i],n,o):null===r?i:i+"[]",l(t))})),!1;return!!Q(t)||(e.append(tt(s,i,o),l(t)),!1)}const h=[],d=Object.assign(et,{defaultVisitor:c,convertValue:l,isVisitable:Q});if(!Y.isObject(t))throw new TypeError("data must be an object");return function t(i,n){if(!Y.isUndefined(i)){if(-1!==h.indexOf(i))throw Error("Circular reference detected in "+n.join("."));h.push(i),Y.forEach(i,(function(i,o){!0===(!(Y.isUndefined(i)||null===i)&&s.call(e,i,Y.isString(o)?o.trim():o,n,d))&&t(i,n?n.concat(o):[o])})),h.pop()}}(t),e};function nt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function st(t,e){this._pairs=[],t&&it(t,this,e)}const ot=st.prototype;ot.append=function(t,e){this._pairs.push([t,e])},ot.toString=function(t){const e=t?function(e){return t.call(this,e,nt)}:nt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const rt=st;function at(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lt(t,e,i){if(!e)return t;const n=i&&i.encode||at;Y.isFunction(i)&&(i={serialize:i});const s=i&&i.serialize;let o;if(o=s?s(e,i):Y.isURLSearchParams(e)?e.toString():new rt(e,i).toString(n),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}const ct=class{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Y.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ht={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:rt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ut="undefined"!=typeof window&&"undefined"!=typeof document,ft="object"==typeof navigator&&navigator||void 0,pt=ut&&(!ft||["ReactNative","NativeScript","NS"].indexOf(ft.product)<0),gt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mt=ut&&window.location.href||"http://localhost",bt={...i,...dt},xt=function(t){function e(t,i,n,s){let o=t[s++];if("__proto__"===o)return!0;const r=Number.isFinite(+o),a=s>=t.length;return o=!o&&Y.isArray(n)?n.length:o,a?(Y.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i,!r):(n[o]&&Y.isObject(n[o])||(n[o]=[]),e(t,i,n[o],s)&&Y.isArray(n[o])&&(n[o]=function(t){const e={},i=Object.keys(t);let n;const s=i.length;let o;for(n=0;n<s;n++)o=i[n],e[o]=t[o];return e}(n[o])),!r)}if(Y.isFormData(t)&&Y.isFunction(t.entries)){const i={};return Y.forEachEntry(t,((t,n)=>{e(function(t){return Y.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,i,0)})),i}return null},yt={transitional:ht,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,s=Y.isObject(t);if(s&&Y.isHTMLForm(t)&&(t=new FormData(t)),Y.isFormData(t))return n?JSON.stringify(xt(t)):t;if(Y.isArrayBuffer(t)||Y.isBuffer(t)||Y.isStream(t)||Y.isFile(t)||Y.isBlob(t)||Y.isReadableStream(t))return t;if(Y.isArrayBufferView(t))return t.buffer;if(Y.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return it(t,new bt.classes.URLSearchParams,{visitor:function(t,e,i,n){return bt.isNode&&Y.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((o=Y.isFileList(t))||i.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return it(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return s||n?(e.setContentType("application/json",!1),function(t){if(Y.isString(t))try{return(0,JSON.parse)(t),Y.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||yt.transitional,i=e&&e.forcedJSONParsing,n="json"===this.responseType;if(Y.isResponse(t)||Y.isReadableStream(t))return t;if(t&&Y.isString(t)&&(i&&!this.responseType||n)){const i=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw G.from(t,G.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],(t=>{yt.headers[t]={}}));const _t=yt,vt=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wt=Symbol("internals");function Mt(t){return t&&String(t).trim().toLowerCase()}function kt(t){return!1===t||null==t?t:Y.isArray(t)?t.map(kt):String(t)}function St(t,e,i,n,s){return Y.isFunction(n)?n.call(this,e,i):(s&&(e=i),Y.isString(e)?Y.isString(n)?-1!==e.indexOf(n):Y.isRegExp(n)?n.test(e):void 0:void 0)}class Ot{constructor(t){t&&this.set(t)}set(t,e,i){const n=this;function s(t,e,i){const s=Mt(e);if(!s)throw new Error("header name must be a non-empty string");const o=Y.findKey(n,s);(!o||void 0===n[o]||!0===i||void 0===i&&!1!==n[o])&&(n[o||e]=kt(t))}const o=(t,e)=>Y.forEach(t,((t,i)=>s(t,i,e)));if(Y.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(Y.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o((t=>{const e={};let i,n,s;return t&&t.split("\n").forEach((function(t){s=t.indexOf(":"),i=t.substring(0,s).trim().toLowerCase(),n=t.substring(s+1).trim(),!i||e[i]&&vt[i]||("set-cookie"===i?e[i]?e[i].push(n):e[i]=[n]:e[i]=e[i]?e[i]+", "+n:n)})),e})(t),e);else if(Y.isObject(t)&&Y.isIterable(t)){let i,n,s={};for(const e of t){if(!Y.isArray(e))throw TypeError("Object iterator must return a key-value pair");s[n=e[0]]=(i=s[n])?Y.isArray(i)?[...i,e[1]]:[i,e[1]]:e[1]}o(s,e)}else null!=t&&s(e,t,i);return this}get(t,e){if(t=Mt(t)){const i=Y.findKey(this,t);if(i){const t=this[i];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(t);)e[n[1]]=n[2];return e}(t);if(Y.isFunction(e))return e.call(this,t,i);if(Y.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Mt(t)){const i=Y.findKey(this,t);return!(!i||void 0===this[i]||e&&!St(0,this[i],i,e))}return!1}delete(t,e){const i=this;let n=!1;function s(t){if(t=Mt(t)){const s=Y.findKey(i,t);!s||e&&!St(0,i[s],s,e)||(delete i[s],n=!0)}}return Y.isArray(t)?t.forEach(s):s(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const s=e[i];t&&!St(0,this[s],s,t,!0)||(delete this[s],n=!0)}return n}normalize(t){const e=this,i={};return Y.forEach(this,((n,s)=>{const o=Y.findKey(i,s);if(o)return e[o]=kt(n),void delete e[s];const r=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,i)=>e.toUpperCase()+i))}(s):String(s).trim();r!==s&&delete e[s],e[r]=kt(n),i[r]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Y.forEach(this,((i,n)=>{null!=i&&!1!==i&&(e[n]=t&&Y.isArray(i)?i.join(", "):i)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach((t=>i.set(t))),i}static accessor(t){const e=(this[wt]=this[wt]={accessors:{}}).accessors,i=this.prototype;function n(t){const n=Mt(t);e[n]||(function(t,e){const i=Y.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+i,{value:function(t,i,s){return this[n].call(this,e,t,i,s)},configurable:!0})}))}(i,t),e[n]=!0)}return Y.isArray(t)?t.forEach(n):n(t),this}}Ot.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(Ot.prototype,(({value:t},e)=>{let i=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[i]=t}}})),Y.freezeMethods(Ot);const Et=Ot;function Pt(t,e){const i=this||_t,n=e||i,s=Et.from(n.headers);let o=n.data;return Y.forEach(t,(function(t){o=t.call(i,o,s.normalize(),e?e.status:void 0)})),s.normalize(),o}function Ct(t){return!(!t||!t.__CANCEL__)}function At(t,e,i){G.call(this,null==t?"canceled":t,G.ERR_CANCELED,e,i),this.name="CanceledError"}Y.inherits(At,G,{__CANCEL__:!0});const Dt=At;function Tt(t,e,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?e(new G("Request failed with status code "+i.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}const Rt=(t,e,i=3)=>{let n=0;const s=function(t,e){t=t||10;const i=new Array(t),n=new Array(t);let s,o=0,r=0;return e=void 0!==e?e:1e3,function(a){const l=Date.now(),c=n[r];s||(s=l),i[o]=a,n[o]=l;let h=r,d=0;for(;h!==o;)d+=i[h++],h%=t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),l-s<e)return;const u=c&&l-c;return u?Math.round(1e3*d/u):void 0}}(50,250);return function(t,e){let i,n,s=0,o=1e3/e;const r=(e,o=Date.now())=>{s=o,i=null,n&&(clearTimeout(n),n=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-s;a>=o?r(t,e):(i=t,n||(n=setTimeout((()=>{n=null,r(i)}),o-a)))},()=>i&&r(i)]}((i=>{const o=i.loaded,r=i.lengthComputable?i.total:void 0,a=o-n,l=s(a);n=o,t({loaded:o,total:r,progress:r?o/r:void 0,bytes:a,rate:l||void 0,estimated:l&&r&&o<=r?(r-o)/l:void 0,event:i,lengthComputable:null!=r,[e?"download":"upload"]:!0})}),i)},Lt=(t,e)=>{const i=null!=t;return[n=>e[0]({lengthComputable:i,total:t,loaded:n}),e[1]]},It=t=>(...e)=>Y.asap((()=>t(...e))),Ft=bt.hasStandardBrowserEnv?((t,e)=>i=>(i=new URL(i,bt.origin),t.protocol===i.protocol&&t.host===i.host&&(e||t.port===i.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,jt=bt.hasStandardBrowserEnv?{write(t,e,i,n,s,o){const r=[t+"="+encodeURIComponent(e)];Y.isNumber(i)&&r.push("expires="+new Date(i).toGMTString()),Y.isString(n)&&r.push("path="+n),Y.isString(s)&&r.push("domain="+s),!0===o&&r.push("secure"),document.cookie=r.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function zt(t,e,i){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==i)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Nt=t=>t instanceof Et?{...t}:t;function Bt(t,e){e=e||{};const i={};function n(t,e,i,n){return Y.isPlainObject(t)&&Y.isPlainObject(e)?Y.merge.call({caseless:n},t,e):Y.isPlainObject(e)?Y.merge({},e):Y.isArray(e)?e.slice():e}function s(t,e,i,s){return Y.isUndefined(e)?Y.isUndefined(t)?void 0:n(void 0,t,0,s):n(t,e,0,s)}function o(t,e){if(!Y.isUndefined(e))return n(void 0,e)}function r(t,e){return Y.isUndefined(e)?Y.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(i,s,o){return o in e?n(i,s):o in t?n(void 0,i):void 0}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(t,e,i)=>s(Nt(t),Nt(e),0,!0)};return Y.forEach(Object.keys({...t,...e}),(function(n){const o=l[n]||s,r=o(t[n],e[n],n);Y.isUndefined(r)&&o!==a||(i[n]=r)})),i}const Vt=t=>{const e=Bt({},t);let i,{data:n,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:r,headers:a,auth:l}=e;if(e.headers=a=Et.from(a),e.url=lt(zt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Y.isFormData(n))if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(i=a.getContentType())){const[t,...e]=i?i.split(";").map((t=>t.trim())).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(bt.hasStandardBrowserEnv&&(s&&Y.isFunction(s)&&(s=s(e)),s||!1!==s&&Ft(e.url))){const t=o&&r&&jt.read(r);t&&a.set(o,t)}return e},Wt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,i){const n=Vt(t);let s=n.data;const o=Et.from(n.headers).normalize();let r,a,l,c,h,{responseType:d,onUploadProgress:u,onDownloadProgress:f}=n;function p(){c&&c(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(r),n.signal&&n.signal.removeEventListener("abort",r)}let g=new XMLHttpRequest;function m(){if(!g)return;const n=Et.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Tt((function(t){e(t),p()}),(function(t){i(t),p()}),{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:n,config:t,request:g}),g=null}g.open(n.method.toUpperCase(),n.url,!0),g.timeout=n.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(i(new G("Request aborted",G.ECONNABORTED,t,g)),g=null)},g.onerror=function(){i(new G("Network Error",G.ERR_NETWORK,t,g)),g=null},g.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||ht;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),i(new G(e,s.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,t,g)),g=null},void 0===s&&o.setContentType(null),"setRequestHeader"in g&&Y.forEach(o.toJSON(),(function(t,e){g.setRequestHeader(e,t)})),Y.isUndefined(n.withCredentials)||(g.withCredentials=!!n.withCredentials),d&&"json"!==d&&(g.responseType=n.responseType),f&&([l,h]=Rt(f,!0),g.addEventListener("progress",l)),u&&g.upload&&([a,c]=Rt(u),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(r=e=>{g&&(i(!e||e.type?new Dt(null,t,g):e),g.abort(),g=null)},n.cancelToken&&n.cancelToken.subscribe(r),n.signal&&(n.signal.aborted?r():n.signal.addEventListener("abort",r)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);b&&-1===bt.protocols.indexOf(b)?i(new G("Unsupported protocol "+b+":",G.ERR_BAD_REQUEST,t)):g.send(s||null)}))},Ht=(t,e)=>{const{length:i}=t=t?t.filter(Boolean):[];if(e||i){let i,n=new AbortController;const s=function(t){if(!i){i=!0,r();const e=t instanceof Error?t:this.reason;n.abort(e instanceof G?e:new Dt(e instanceof Error?e.message:e))}};let o=e&&setTimeout((()=>{o=null,s(new G(`timeout ${e} of ms exceeded`,G.ETIMEDOUT))}),e);const r=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(s):t.removeEventListener("abort",s)})),t=null)};t.forEach((t=>t.addEventListener("abort",s)));const{signal:a}=n;return a.unsubscribe=()=>Y.asap(r),a}},Ut=function*(t,e){let i=t.byteLength;if(!e||i<e)return void(yield t);let n,s=0;for(;s<i;)n=s+e,yield t.slice(s,n),s=n},$t=(t,e,i,n)=>{const s=async function*(t,e){for await(const i of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}}(t))yield*Ut(i,e)}(t,e);let o,r=0,a=t=>{o||(o=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await s.next();if(e)return a(),void t.close();let o=n.byteLength;if(i){let t=r+=o;i(t)}t.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:t=>(a(t),s.return())},{highWaterMark:2})},qt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Yt=qt&&"function"==typeof ReadableStream,Xt=qt&&("function"==typeof TextEncoder?(Kt=new TextEncoder,t=>Kt.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var Kt;const Jt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Gt=Yt&&Jt((()=>{let t=!1;const e=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Qt=Yt&&Jt((()=>Y.isReadableStream(new Response("").body))),Zt={stream:Qt&&(t=>t.body)};var te;qt&&(te=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!Zt[t]&&(Zt[t]=Y.isFunction(te[t])?e=>e[t]():(e,i)=>{throw new G(`Response type '${t}' is not supported`,G.ERR_NOT_SUPPORT,i)})})));const ee=qt&&(async t=>{let{url:e,method:i,data:n,signal:s,cancelToken:o,timeout:r,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:h,withCredentials:d="same-origin",fetchOptions:u}=Vt(t);c=c?(c+"").toLowerCase():"text";let f,p=Ht([s,o&&o.toAbortSignal()],r);const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let m;try{if(l&&Gt&&"get"!==i&&"head"!==i&&0!==(m=await(async(t,e)=>{const i=Y.toFiniteNumber(t.getContentLength());return null==i?(async t=>{if(null==t)return 0;if(Y.isBlob(t))return t.size;if(Y.isSpecCompliantForm(t)){const e=new Request(bt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Y.isArrayBufferView(t)||Y.isArrayBuffer(t)?t.byteLength:(Y.isURLSearchParams(t)&&(t+=""),Y.isString(t)?(await Xt(t)).byteLength:void 0)})(e):i})(h,n))){let t,i=new Request(e,{method:"POST",body:n,duplex:"half"});if(Y.isFormData(n)&&(t=i.headers.get("content-type"))&&h.setContentType(t),i.body){const[t,e]=Lt(m,Rt(It(l)));n=$t(i.body,65536,t,e)}}Y.isString(d)||(d=d?"include":"omit");const s="credentials"in Request.prototype;f=new Request(e,{...u,signal:p,method:i.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:s?d:void 0});let o=await fetch(f,u);const r=Qt&&("stream"===c||"response"===c);if(Qt&&(a||r&&g)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=o[e]}));const e=Y.toFiniteNumber(o.headers.get("content-length")),[i,n]=a&&Lt(e,Rt(It(a),!0))||[];o=new Response($t(o.body,65536,i,(()=>{n&&n(),g&&g()})),t)}c=c||"text";let b=await Zt[Y.findKey(Zt,c)||"text"](o,t);return!r&&g&&g(),await new Promise(((e,i)=>{Tt(e,i,{data:b,headers:Et.from(o.headers),status:o.status,statusText:o.statusText,config:t,request:f})}))}catch(e){if(g&&g(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,t,f),{cause:e.cause||e});throw G.from(e,e&&e.code,t,f)}}),ie={http:null,xhr:Wt,fetch:ee};Y.forEach(ie,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ne=t=>`- ${t}`,se=t=>Y.isFunction(t)||null===t||!1===t,oe=t=>{t=Y.isArray(t)?t:[t];const{length:e}=t;let i,n;const s={};for(let o=0;o<e;o++){let e;if(i=t[o],n=i,!se(i)&&(n=ie[(e=String(i)).toLowerCase()],void 0===n))throw new G(`Unknown adapter '${e}'`);if(n)break;s[e||"#"+o]=n}if(!n){const t=Object.entries(s).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let i=e?t.length>1?"since :\n"+t.map(ne).join("\n"):" "+ne(t[0]):"as no adapter specified";throw new G("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n};function re(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Dt(null,t)}function ae(t){return re(t),t.headers=Et.from(t.headers),t.data=Pt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),oe(t.adapter||_t.adapter)(t).then((function(e){return re(t),e.data=Pt.call(t,t.transformResponse,e),e.headers=Et.from(e.headers),e}),(function(e){return Ct(e)||(re(t),e&&e.response&&(e.response.data=Pt.call(t,t.transformResponse,e.response),e.response.headers=Et.from(e.response.headers))),Promise.reject(e)}))}const le="1.11.0",ce={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ce[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));const he={};ce.transitional=function(t,e,i){function n(t,e){return"[Axios v"+le+"] Transitional option '"+t+"'"+e+(i?". "+i:"")}return(i,s,o)=>{if(!1===t)throw new G(n(s," has been removed"+(e?" in "+e:"")),G.ERR_DEPRECATED);return e&&!he[s]&&(he[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,s,o)}},ce.spelling=function(t){return(e,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};const de={assertOptions:function(t,e,i){if("object"!=typeof t)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let s=n.length;for(;s-- >0;){const o=n[s],r=e[o];if(r){const e=t[o],i=void 0===e||r(e,o,t);if(!0!==i)throw new G("option "+o+" must be "+i,G.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new G("Unknown option "+o,G.ERR_BAD_OPTION)}},validators:ce},ue=de.validators;class fe{constructor(t){this.defaults=t||{},this.interceptors={request:new ct,response:new ct}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const i=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+i):t.stack=i}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Bt(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:s}=e;void 0!==i&&de.assertOptions(i,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),null!=n&&(Y.isFunction(n)?e.paramsSerializer={serialize:n}:de.assertOptions(n,{encode:ue.function,serialize:ue.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),de.assertOptions(e,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=s&&Y.merge(s.common,s[e.method]);s&&Y.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete s[t]})),e.headers=Et.concat(o,s);const r=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));let h,d=0;if(!a){const t=[ae.bind(this),void 0];for(t.unshift(...r),t.push(...l),h=t.length,c=Promise.resolve(e);d<h;)c=c.then(t[d++],t[d++]);return c}h=r.length;let u=e;for(d=0;d<h;){const t=r[d++],e=r[d++];try{u=t(u)}catch(t){e.call(this,t);break}}try{c=ae.call(this,u)}catch(t){return Promise.reject(t)}for(d=0,h=l.length;d<h;)c=c.then(l[d++],l[d++]);return c}getUri(t){return lt(zt((t=Bt(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}Y.forEach(["delete","get","head","options"],(function(t){fe.prototype[t]=function(e,i){return this.request(Bt(i||{},{method:t,url:e,data:(i||{}).data}))}})),Y.forEach(["post","put","patch"],(function(t){function e(e){return function(i,n,s){return this.request(Bt(s||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}fe.prototype[t]=e(),fe.prototype[t+"Form"]=e(!0)}));const pe=fe;class ge{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const i=this;this.promise.then((t=>{if(!i._listeners)return;let e=i._listeners.length;for(;e-- >0;)i._listeners[e](t);i._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{i.subscribe(t),e=t})).then(t);return n.cancel=function(){i.unsubscribe(e)},n},t((function(t,n,s){i.reason||(i.reason=new Dt(t,n,s),e(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ge((function(e){t=e})),cancel:t}}}const me=ge,be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(be).forEach((([t,e])=>{be[e]=t}));const xe=be,ye=function t(e){const i=new pe(e),s=n(pe.prototype.request,i);return Y.extend(s,pe.prototype,i,{allOwnKeys:!0}),Y.extend(s,i,null,{allOwnKeys:!0}),s.create=function(i){return t(Bt(e,i))},s}(_t);ye.Axios=pe,ye.CanceledError=Dt,ye.CancelToken=me,ye.isCancel=Ct,ye.VERSION=le,ye.toFormData=it,ye.AxiosError=G,ye.Cancel=ye.CanceledError,ye.all=function(t){return Promise.all(t)},ye.spread=function(t){return function(e){return t.apply(null,e)}},ye.isAxiosError=function(t){return Y.isObject(t)&&!0===t.isAxiosError},ye.mergeConfig=Bt,ye.AxiosHeaders=Et,ye.formToJSON=t=>xt(Y.isHTMLForm(t)?new FormData(t):t),ye.getAdapter=oe,ye.HttpStatusCode=xe,ye.default=ye;const _e=ye;function ve(t){return t+.5|0}const we=(t,e,i)=>Math.max(Math.min(t,i),e);function Me(t){return we(ve(2.55*t),0,255)}function ke(t){return we(ve(255*t),0,255)}function Se(t){return we(ve(t/2.55)/100,0,1)}function Oe(t){return we(ve(100*t),0,100)}const Ee={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Pe=[..."0123456789ABCDEF"],Ce=t=>Pe[15&t],Ae=t=>Pe[(240&t)>>4]+Pe[15&t],De=t=>(240&t)>>4==(15&t);const Te=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Re(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function Le(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function Ie(t,e,i){const n=Re(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Fe(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e<i?6:0):e===s?(i-t)/n+2:(t-e)/n+4}(e,i,n,c,s),a=60*a+.5),[0|a,l||0,r]}function je(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(ke)}function ze(t,e,i){return je(Re,t,e,i)}function Ne(t){return(t%360+360)%360}const Be={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ve={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let We;const He=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ue=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,$e=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function qe(t,e,i){if(t){let n=Fe(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=ze(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function Ye(t,e){return t?Object.assign(e||{},t):t}function Xe(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=ke(t[3]))):(e=Ye(t,{r:0,g:0,b:0,a:1})).a=ke(e.a),e}function Ke(t){return"r"===t.charAt(0)?function(t){const e=He.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Me(t):we(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Me(i):we(i,0,255)),n=255&(e[4]?Me(n):we(n,0,255)),s=255&(e[6]?Me(s):we(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):function(t){const e=Te.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?Me(+e[5]):ke(+e[5]));const s=Ne(+e[2]),o=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return je(Ie,t,e,i)}(s,o,r):"hsv"===e[1]?function(t,e,i){return je(Le,t,e,i)}(s,o,r):ze(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class Je{constructor(t){if(t instanceof Je)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=Xe(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Ee[n[1]],g:255&17*Ee[n[2]],b:255&17*Ee[n[3]],a:5===o?17*Ee[n[4]]:255}:7!==o&&9!==o||(s={r:Ee[n[1]]<<4|Ee[n[2]],g:Ee[n[3]]<<4|Ee[n[4]],b:Ee[n[5]]<<4|Ee[n[6]],a:9===o?Ee[n[7]]<<4|Ee[n[8]]:255})),i=s||function(t){We||(We=function(){const t={},e=Object.keys(Ve),i=Object.keys(Be);let n,s,o,r,a;for(n=0;n<e.length;n++){for(r=a=e[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,Be[o]);o=parseInt(Ve[r],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),We.transparent=[0,0,0,0]);const e=We[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ke(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ye(this._rgb);return t&&(t.a=Se(t.a)),t}set rgb(t){this._rgb=Xe(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Se(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>De(t.r)&&De(t.g)&&De(t.b)&&De(t.a))(t)?Ce:Ae,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Fe(t),i=e[0],n=Oe(e[1]),s=Oe(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Se(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a==-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=$e(Se(t.r)),s=$e(Se(t.g)),o=$e(Se(t.b));return{r:ke(Ue(n+i*($e(Se(e.r))-n))),g:ke(Ue(s+i*($e(Se(e.g))-s))),b:ke(Ue(o+i*($e(Se(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Je(this.rgb)}alpha(t){return this._rgb.a=ke(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=ve(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return qe(this._rgb,2,t),this}darken(t){return qe(this._rgb,2,-t),this}saturate(t){return qe(this._rgb,1,t),this}desaturate(t){return qe(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Fe(t);i[0]=Ne(i[0]+e),i=ze(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Ge(){}const Qe=(()=>{let t=0;return()=>t++})();function Ze(t){return null==t}function ti(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function ei(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function ii(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function ni(t,e){return ii(t)?t:e}function si(t,e){return void 0===t?e:t}const oi=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ri(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function ai(t,e,i,n){let s,o,r;if(ti(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;s<o;s++)e.call(i,t[s],s);else if(ei(t))for(r=Object.keys(t),o=r.length,s=0;s<o;s++)e.call(i,t[r[s]],r[s])}function li(t,e){let i,n,s,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(s=t[i],o=e[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ci(t){if(ti(t))return t.map(ci);if(ei(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let s=0;for(;s<n;++s)e[i[s]]=ci(t[i[s]]);return e}return t}function hi(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function di(t,e,i,n){if(!hi(t))return;const s=e[t],o=i[t];ei(s)&&ei(o)?ui(s,o,n):e[t]=ci(o)}function ui(t,e,i){const n=ti(e)?e:[e],s=n.length;if(!ei(t))return t;const o=(i=i||{}).merger||di;let r;for(let e=0;e<s;++e){if(r=n[e],!ei(r))continue;const s=Object.keys(r);for(let e=0,n=s.length;e<n;++e)o(s[e],t,r,i)}return t}function fi(t,e){return ui(t,e,{merger:pi})}function pi(t,e,i){if(!hi(t))return;const n=e[t],s=i[t];ei(n)&&ei(s)?fi(n,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ci(s))}const gi={"":t=>t,x:t=>t.x,y:t=>t.y};function mi(t,e){const i=gi[e]||(gi[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function bi(t){return t.charAt(0).toUpperCase()+t.slice(1)}const xi=t=>void 0!==t,yi=t=>"function"==typeof t,_i=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},vi=Math.PI,wi=2*vi,Mi=wi+vi,ki=Number.POSITIVE_INFINITY,Si=vi/180,Oi=vi/2,Ei=vi/4,Pi=2*vi/3,Ci=Math.log10,Ai=Math.sign;function Di(t,e,i){return Math.abs(t-e)<i}function Ti(t){const e=Math.round(t);t=Di(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Ci(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Ri(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Li(t,e,i){let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Ii(t){return t*(vi/180)}function Fi(t){return t*(180/vi)}function ji(t){if(!ii(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function zi(t,e){const i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n);let o=Math.atan2(n,i);return o<-.5*vi&&(o+=wi),{angle:o,distance:s}}function Ni(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bi(t,e){return(t-e+Mi)%wi-vi}function Vi(t){return(t%wi+wi)%wi}function Wi(t,e,i,n){const s=Vi(t),o=Vi(e),r=Vi(i),a=Vi(o-s),l=Vi(r-s),c=Vi(s-o),h=Vi(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function Hi(t,e,i){return Math.max(e,Math.min(i,t))}function Ui(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function $i(t,e,i){i=i||(i=>t[i]<e);let n,s=t.length-1,o=0;for(;s-o>1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const qi=(t,e,i,n)=>$i(t,i,n?n=>{const s=t[n][e];return s<i||s===i&&t[n+1][e]===i}:n=>t[n][e]<i),Yi=(t,e,i)=>$i(t,i,(n=>t[n][e]>=i)),Xi=["push","pop","shift","splice","unshift"];function Ki(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(Xi.forEach((e=>{delete t[e]})),delete t._chartjs)}function Ji(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Gi="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Qi(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Gi.call(window,(()=>{n=!1,t.apply(e,i)})))}}const Zi=t=>"start"===t?"left":"end"===t?"right":"center",tn=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function en(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(qi(l,h,d).lo,i?n:qi(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex((t=>!Ze(t[a.axis])));s-=Math.max(0,t)}s=Hi(s,0,n-1)}if(p){let t=Math.max(qi(l,r.axis,u,!0).hi+1,i?0:qi(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex((t=>!Ze(t[a.axis])));t+=Math.max(0,e)}o=Hi(t,s,n)-s}else o=n-s}return{start:s,count:o}}function nn(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const sn=t=>0===t||1===t,on=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*wi/i),rn=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*wi/i)+1,an={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Oi),easeOutSine:t=>Math.sin(t*Oi),easeInOutSine:t=>-.5*(Math.cos(vi*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>sn(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>sn(t)?t:on(t,.075,.3),easeOutElastic:t=>sn(t)?t:rn(t,.075,.3),easeInOutElastic(t){const e=.1125;return sn(t)?t:t<.5?.5*on(2*t,e,.45):.5+.5*rn(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-an.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*an.easeInBounce(2*t):.5*an.easeOutBounce(2*t-1)+.5};function ln(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function cn(t){return ln(t)?t:new Je(t)}function hn(t){return ln(t)?t:new Je(t).saturate(.5).darken(.1).hexString()}const dn=["x","y","borderWidth","radius","tension"],un=["color","borderColor","backgroundColor"],fn=new Map;function pn(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=fn.get(i);return n||(n=new Intl.NumberFormat(t,e),fn.set(i,n)),n}(e,i).format(t)}const gn={values:t=>ti(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Ci(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),pn(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(Ci(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?gn.numeric.call(this,t,e,i):""}};var mn={formatters:gn};const bn=Object.create(null),xn=Object.create(null);function yn(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;e<n;++e){const n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function _n(t,e,i){return"string"==typeof e?ui(yn(t,e),i):ui(yn(t,""),e)}class vn{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>hn(e.backgroundColor),this.hoverBorderColor=(t,e)=>hn(e.borderColor),this.hoverColor=(t,e)=>hn(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return _n(this,t,e)}get(t){return yn(this,t)}describe(t,e){return _n(xn,t,e)}override(t,e){return _n(bn,t,e)}route(t,e,i,n){const s=yn(this,t),o=yn(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return ei(t)?Object.assign({},e,t):si(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach((t=>t(this)))}}var wn=new vn({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:un},numbers:{type:"number",properties:dn}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:mn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Mn(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function kn(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;l<a;l++)if(d=i[l],null==d||ti(d)){if(ti(d))for(c=0,h=d.length;c<h;c++)u=d[c],null==u||ti(u)||(r=Mn(t,s,o,r,u))}else r=Mn(t,s,o,r,d);t.restore();const f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function Sn(t,e,i){const n=t.currentDevicePixelRatio,s=0!==i?Math.max(i/2,.5):0;return Math.round((e-s)*n)/n+s}function On(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function En(t,e,i,n){Pn(t,e,i,n,null)}function Pn(t,e,i,n,s){let o,r,a,l,c,h,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*Si;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:s?t.ellipse(i,n,s/2,g,0,0,wi):t.arc(i,n,g,0,wi),t.closePath();break;case"triangle":h=s?s/2:g,t.moveTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=Pi,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=Pi,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":c=.516*g,l=g-c,r=Math.cos(m+Ei)*l,d=Math.cos(m+Ei)*(s?s/2-c:l),a=Math.sin(m+Ei)*l,u=Math.sin(m+Ei)*(s?s/2-c:l),t.arc(i-d,n-a,c,m-vi,m-Oi),t.arc(i+u,n-r,c,m-Oi,m),t.arc(i+d,n+a,c,m,m+Oi),t.arc(i-u,n+r,c,m+Oi,m+vi),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=s?s/2:l,t.rect(i-h,n-l,2*h,2*l);break}m+=Ei;case"rectRot":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+u,n-r),t.lineTo(i+d,n+a),t.lineTo(i-u,n+r),t.closePath();break;case"crossRot":m+=Ei;case"cross":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r);break;case"star":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r),m+=Ei,d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r);break;case"line":r=s?s/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(i-r,n-a),t.lineTo(i+r,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(s?s/2:g),n+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Cn(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function An(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Dn(t){t.restore()}function Tn(t,e,i,n,s){if(!e)return t.lineTo(i.x,i.y);if("middle"===s){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===s!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Rn(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Ln(t,e,i,n,s){if(s.strikethrough||s.underline){const o=t.measureText(n),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,c=i+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(r,h),t.lineTo(a,h),t.stroke()}}function In(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Fn(t,e,i,n,s,o={}){const r=ti(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Ze(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&In(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),Ze(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,i,n,o.maxWidth)),t.fillText(c,i,n,o.maxWidth),Ln(t,i,n,c,o),n+=Number(s.lineHeight);t.restore()}function jn(t,e){const{x:i,y:n,w:s,h:o,radius:r}=e;t.arc(i+r.topLeft,n+r.topLeft,r.topLeft,1.5*vi,vi,!0),t.lineTo(i,n+o-r.bottomLeft),t.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,vi,Oi,!0),t.lineTo(i+s-r.bottomRight,n+o),t.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,Oi,0,!0),t.lineTo(i+s,n+r.topRight),t.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-Oi,!0),t.lineTo(i+r.topLeft,n)}const zn=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Nn=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Bn(t,e){const i=(""+t).match(zn);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function Vn(t,e){const i={},n=ei(e),s=n?Object.keys(e):e,o=ei(t)?n?i=>si(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+o(t)||0;return i}function Wn(t){return Vn(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Hn(t){return Vn(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Un(t){const e=Wn(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $n(t,e){t=t||{},e=e||wn.font;let i=si(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=si(t.style,e.style);n&&!(""+n).match(Nn)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:si(t.family,e.family),lineHeight:Bn(si(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:si(t.weight,e.weight),string:""};return s.string=function(t){return!t||Ze(t.size)||Ze(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function qn(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;s<o;++s)if(r=t[s],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),a=!1),void 0!==i&&ti(r)&&(r=r[i%r.length],a=!1),void 0!==r))return n&&!a&&(n.cacheable=!1),r}function Yn(t,e){return Object.assign(Object.create(t),e)}function Xn(t,e=[""],i,n,s=()=>t[0]){const o=i||t;void 0===n&&(n=os("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>Xn([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Zn(i,n,(()=>function(t,e,i,n){let s;for(const o of e)if(s=os(Gn(o,t),i),void 0!==s)return Qn(t,s)?ns(i,n,t,s):s}(n,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>rs(t).includes(e),ownKeys:t=>rs(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Kn(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Jn(t,n),setContext:e=>Kn(t,e,i,n),override:s=>Kn(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Zn(t,e,(()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];return yi(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);return a.delete(t),Qn(t,l)&&(l=ns(s._scopes,s,t,l)),l}(e,a,t,i)),ti(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(ei(e[0])){const i=e,n=s._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=ns(n,s,t,l);e.push(Kn(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable)),Qn(e,a)&&(a=Kn(a,s,o&&o[e],r)),a}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Jn(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:yi(i)?i:()=>i,isIndexable:yi(n)?n:()=>n}}const Gn=(t,e)=>t?t+bi(e):e,Qn=(t,e)=>ei(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Zn(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function ts(t,e,i){return yi(t)?t(e,i):t}const es=(t,e)=>!0===t?e:"string"==typeof t?mi(e,t):void 0;function is(t,e,i,n,s){for(const o of e){const e=es(i,o);if(e){t.add(e);const o=ts(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function ns(t,e,i,n){const s=e._rootScopes,o=ts(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=ss(a,r,i,o||i,n);return null!==l&&(void 0===o||o===i||(l=ss(a,r,o,l,n),null!==l))&&Xn(Array.from(a),[""],s,o,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return ti(s)&&ei(i)?i:s||{}}(e,i,n)))}function ss(t,e,i,n,s){for(;i;)i=is(t,e,i,n,s);return i}function os(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function rs(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function as(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=e[c],r[a]={r:s.parse(mi(h,o),c)};return r}const ls=Number.EPSILON||1e-14,cs=(t,e)=>e<t.length&&!t[e].skip&&t[e],hs=t=>"x"===t?"y":"x";function ds(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=Ni(o,s),l=Ni(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function us(t,e,i){return Math.max(Math.min(t,i),e)}function fs(t,e,i,n,s){let o,r,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=hs(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=cs(t,0);for(r=0;r<n;++r)if(a=l,l=c,c=cs(t,r+1),l){if(c){const t=c[e]-l[e];s[r]=0!==t?(c[i]-l[i])/t:0}o[r]=a?c?Ai(s[r-1])!==Ai(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}!function(t,e,i){const n=t.length;let s,o,r,a,l,c=cs(t,0);for(let h=0;h<n-1;++h)l=c,c=cs(t,h+1),l&&c&&(Di(e[h],0,ls)?i[h]=i[h+1]=0:(s=i[h]/e[h],o=i[h+1]/e[h],a=Math.pow(s,2)+Math.pow(o,2),a<=9||(r=3/Math.sqrt(a),i[h]=s*r*e[h],i[h+1]=o*r*e[h])))}(t,s,o),function(t,e,i="x"){const n=hs(i),s=t.length;let o,r,a,l=cs(t,0);for(let c=0;c<s;++c){if(r=a,a=l,l=cs(t,c+1),!a)continue;const s=a[i],h=a[n];r&&(o=(s-r[i])/3,a[`cp1${i}`]=s-o,a[`cp1${n}`]=h-o*e[c]),l&&(o=(l[i]-s)/3,a[`cp2${i}`]=s+o,a[`cp2${n}`]=h+o*e[c])}}(t,o,e)}(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],l=ds(i,a,t[Math.min(o+1,r-(n?0:1))%r],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,s,o,r,a=Cn(t[0],e);for(i=0,n=t.length;i<n;++i)r=o,o=a,a=i<n-1&&Cn(t[i+1],e),o&&(s=t[i],r&&(s.cp1x=us(s.cp1x,e.left,e.right),s.cp1y=us(s.cp1y,e.top,e.bottom)),a&&(s.cp2x=us(s.cp2x,e.left,e.right),s.cp2y=us(s.cp2y,e.top,e.bottom)))}(t,i)}function ps(){return"undefined"!=typeof window&&"undefined"!=typeof document}function gs(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ms(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const bs=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),xs=["top","right","bottom","left"];function ys(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=xs[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function _s(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=bs(i),o="border-box"===s.boxSizing,r=ys(s,"padding"),a=ys(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const vs=t=>Math.round(10*t)/10;function ws(t,e,i){const n=e||1,s=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ms=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ps()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ks(t,e){const i=function(t,e){return bs(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ss(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Os(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Es(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=Ss(t,s,i),a=Ss(s,o,i),l=Ss(o,e,i),c=Ss(r,a,i),h=Ss(a,l,i);return Ss(c,h,i)}function Ps(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Cs(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function As(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ds(t){return"angle"===t?{between:Wi,compare:Bi,normalize:Vi}:{between:Ui,compare:(t,e)=>t-e,normalize:t=>t}}function Ts({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function Rs(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=Ds(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=Ds(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;c<h&&r(a(e[d%l][n]),s,o);++c)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),p=[];let g,m,b,x=!1,y=null;for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(x=l(g,s,o),null===y&&(x||l(s,b,g)&&0!==a(s,b))&&(y=0===a(g,s)?t:i),null!==y&&(!x||0===a(o,g)||l(o,b,g))&&(p.push(Ts({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(Ts({start:y,end:d,loop:u,count:r,style:f})),p}function Ls(t,e){const i=[],n=t.segments;for(let s=0;s<n.length;s++){const o=Rs(n[s],t.points,e);o.length&&i.push(...o)}return i}function Is(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Fs(t,e){if(!e)return!1;const i=[],n=function(t,e){return ln(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}function js(t,e,i){return t.options.clip?t[i]:e[i]}function zs(t,e){const i=e._clip;if(i.disabled)return!1;const n=function(t,e){const{xScale:i,yScale:n}=t;return i&&n?{left:js(i,e,"left"),right:js(i,e,"right"),top:js(n,e,"top"),bottom:js(n,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:n.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:n.right+(!0===i.right?0:i.right),top:!1===i.top?0:n.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:n.bottom+(!0===i.bottom?0:i.bottom)}}class Ns{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const s=e.listeners[n],o=e.duration;s.forEach((n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=Gi.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Bs=new Ns;const Vs="transparent",Ws={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=cn(t||Vs),s=n.valid&&cn(e||Vs);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Hs{constructor(t,e,i,n){const s=e[i];n=qn([t.to,n,s,t.from]);const o=qn([t.from,s,n]);this._active=!0,this._fn=t.fn||Ws[t.type||typeof o],this._easing=an[t.easing]||an.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=qn([t.to,e,n,t.from]),this._from=qn([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e<i),!this._active)return this._target[n]=r,void this._notify(!0);e<0?this._target[n]=s:(a=e/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class Us{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ei(t))return;const e=Object.keys(wn.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const s=t[n];if(!ei(s))return;const o={};for(const t of e)o[t]=s[t];(ti(s.properties)&&s.properties||[n]).forEach((t=>{t!==n&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){const s=t[n[e]];s&&s.active()&&i.push(s.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new Hs(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(Bs.add(this._chart,i),!0):void 0}}function $s(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function qs(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function Ys(t,e,i,n={}){const s=t.keys,o="single"===n.mode;let r,a,l,c;if(null===e)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===i){if(h=!0,n.all)continue;break}c=t.values[l],ii(c)&&(o||0===e||Ai(e)===Ai(c))&&(e+=c)}return h||n.all?e:0}function Xs(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Ks(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Js(t,e,i,n){for(const s of e.getMatchingVisibleMetas(n).reverse()){const e=t[s.index];if(i&&e>0||!i&&e<0)return s.index}return null}function Gs(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[c]:d}=i;u=(i._stacks||(i._stacks={}))[c]=Ks(s,h,o),u[a]=d,u._top=Js(u,r,!0,n.type),u._bottom=Js(u,r,!1,n.type),(u._visualValues||(u._visualValues={}))[a]=d}}function Qs(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Zs(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const to=t=>"reset"===t||"none"===t,eo=(t,e)=>e?t:Object.assign({},t);class io{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Xs(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&&Zs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=si(i.xAxisID,Qs(t,"x")),o=e.yAxisID=si(i.yAxisID,Qs(t,"y")),r=e.rAxisID=si(i.rAxisID,Qs(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ki(this._data,this),t._stacked&&Zs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ei(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:t[h]};return a}(e,t)}else if(i!==e){if(i){Ki(i,this);const t=this._cachedMeta;Zs(t),t._parsed=[]}e&&Object.isExtensible(e)&&((n=e)._chartjs?n._chartjs.listeners.push(this):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Xi.forEach((t=>{const e="_onData"+bi(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),s}})})))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Xs(e.vScale,e),e.stack!==i.stack&&(n=!0,Zs(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Gs(this,e._parsed),e._stacked=Xs(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=ti(n[t])?this.parseArrayData(i,n,t,e):ei(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]<d[r];for(a=0;a<e;++a)i._parsed[a+t]=l=c[a],h&&(s()&&(h=!1),d=l);i._sorted=h}o&&Gs(this,c)}parsePrimitiveData(t,e,i,n){const{iScale:s,vScale:o}=t,r=s.axis,a=o.axis,l=s.getLabels(),c=s===o,h=new Array(n);let d,u,f;for(d=0,u=n;d<u;++d)f=d+i,h[d]={[r]:c||s.parse(l[f],f),[a]:o.parse(e[f],f)};return h}parseArrayData(t,e,i,n){const{xScale:s,yScale:o}=t,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=e[c],r[a]={x:s.parse(h[0],c),y:o.parse(h[1],c)};return r}parseObjectData(t,e,i,n){const{xScale:s,yScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let c,h,d,u;for(c=0,h=n;c<h;++c)d=c+i,u=e[d],l[c]={x:s.parse(mi(u,r),d),y:o.parse(mi(u,a),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,s=this._cachedMeta,o=e[t.axis];return Ys({keys:qs(n,!0),values:e._stacks[t.axis]._visualValues},o,s.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const s=i[e.axis];let o=null===s?NaN:s;const r=n&&i._stacks[e.axis];n&&r&&(n.values=r,o=Ys(n,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,s=i._sorted&&t===i.iScale,o=n.length,r=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:qs(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!ii(u[t.axis])||c>e||h<e}for(d=0;d<o&&(f()||(this.updateRangeFromParsed(l,t,u,a),!s));++d);if(s)for(d=o-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n<s;++n)o=e[n][t.axis],ii(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:n?""+n.getLabelForValue(s[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,s;return ei(t)?(e=t.top,i=t.right,n=t.bottom,s=t.left):e=i=n=s=t,{top:e,right:i,bottom:n,left:s,disabled:!1===t}}(si(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=$s(t,i),s=$s(e,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],s=e.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||n.length-r,l=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(t,s,r,a),c=r;c<r+a;++c){const e=n[c];e.hidden||(e.active&&l?o.push(e):e.draw(t,s))}for(c=0;c<o.length;++c)o[c].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];s=e.$context||(e.$context=function(t,e,i){return Yn(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),s.parsed=this.getParsed(t),s.raw=n.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=function(t,e){return Yn(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),s.dataset=n,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,s=this._cachedDataOpts,o=t+"-"+e,r=s[o],a=this.enableOptionSharing&&xi(i);if(r)return eo(r,a);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),h=n?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),c),u=Object.keys(wn.elements[t]),f=l.resolveNamedOptions(d,u,(()=>this.getContext(i,n,e)),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(eo(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new Us(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||to(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){to(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!to(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s<n&&this._removeElements(s,n-s)}_insertElements(t,e,i=!0){const n=this._cachedMeta,s=n.data,o=t+e;let r;const a=t=>{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;r<o;++r)s[r]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&Zs(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function no(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,s=i.length;e<s;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Ji(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(xi(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;n<s;++n)o=e.getPixelForValue(i[n]),l();for(r=void 0,n=0,s=e.ticks.length;n<s;++n)o=e.getPixelForTick(n),l();return a}function so(t,e,i,n){return ti(t)?function(t,e,i,n){const s=i.parse(t[0],n),o=i.parse(t[1],n),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function oo(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;c<h;++c)u=e[c],d={},d[s.axis]=a||s.parse(r[c],c),l.push(so(u,d,o,c));return l}function ro(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function ao(t,e,i,n){let s=e.borderSkipped;const o={};if(!s)return void(t.borderSkipped=o);if(!0===s)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:r,end:a,reverse:l,top:c,bottom:h}=function(t){let e,i,n,s,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:e,top:s,bottom:o}}(t);"middle"===s&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?s=c:(i._bottom||0)===n?s=h:(o[lo(h,r,a,l)]=!0,s=c)),o[lo(s,r,a,l)]=!0,t.borderSkipped=o}function lo(t,e,i,n){var s,o,r;return n?(r=i,t=co(t=(s=t)===(o=e)?r:s===r?o:s,i,e)):t=co(t,e,i),t}function co(t,e,i){return"start"===t?e:"end"===t?i:t}function ho(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class uo extends io{static id="doughnut";static 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"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,s)=>{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(ei(i[t])){const{key:t="value"}=this._parsing;r=e=>+mi(i[e],t)}for(s=t,o=t+e;s<o;++s)n._parsed[s]=r(s)}}_getRotation(){return Ii(this.options.rotation-90)}_getCircumference(){return Ii(this.options.circumference)}_getRotationExtents(){let t=wi,e=-wi;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,s=n._getRotation(),o=n._getCircumference();t=Math.min(t,s),e=Math.max(e,s+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,s=n.data,o=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min((c=r,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(t,e,i){let n=1,s=1,o=0,r=0;if(e<wi){const a=t,l=a+e,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(t,e,n)=>Wi(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>Wi(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(Oi,h,u),b=p(vi,c,d),x=p(vi+Oi,h,u);n=(g-b)/2,s=(m-x)/2,o=-(g+b)/2,r=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,x=(i.height-o)/p,y=Math.max(Math.min(b,x)/2,0),_=oi(this.options.radius,y),v=(_-Math.max(_*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=m*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/wi)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,s);for(g=e;g<e+i;++g){const e=this._circumference(g,s),i=t[g],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};p&&(o.options=f||this.resolveDataElementOptions(g,i.active?"active":n)),m+=e,this.updateElement(i,g,o,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const s=t._parsed[i];null===s||isNaN(s)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(s))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?wi*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=pn(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n<s;++n)if(i.isDatasetVisible(n)){o=i.getDatasetMeta(n),t=o.data,r=o.controller;break}if(!t)return 0;for(n=0,s=t.length;n<s;++n)a=r.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(si(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class fo extends io{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,s)=>{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=pn(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return as.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*vi;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,n,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,p=u+this._computeAngle(d,n,f),g=o.getDataVisibility(d)?a.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=p,s&&(r.animateScale&&(g=0),r.animateRotate&&(i=p=h));const m={x:l,y:c,innerRadius:0,outerRadius:g,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(d,e.active?"active":n)};this.updateElement(e,d,m,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ii(this.resolveDataElementOptions(t,e).angle||i):0}}var po=Object.freeze({__proto__:null,BarController:class extends io{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return oo(t,e,i,n)}parseArrayData(t,e,i,n){return oo(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;d<u;++d)p=e[d],f={},f[s.axis]=s.parse(mi(p,l),d),h.push(so(mi(p,c),f,o,d));return h}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const s=i._custom;s&&e===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 e=this._cachedMeta,{iScale:i,vScale:n}=e,s=this.getParsed(t),o=s._custom,r=ro(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(s[n.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const s="reset"===n,{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),l=r.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n);for(let u=e;u<e+i;u++){const e=this.getParsed(u),i=s||Ze(e[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(u),f=this._calculateBarIndexPixels(u,c),p=(e._stacks||{})[r.axis],g={horizontal:l,base:i.base,enableBorderRadius:!p||ro(e._custom)||o===p._top||o===p._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};d&&(g.options=h||this.resolveDataElementOptions(u,t[u].active?"active":n));const m=g.options||t[u].options;ao(g,m,p,o),ho(g,m,c.ratio),this.updateElement(t[u],u,g,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find((t=>t[i.axis]===a)),n=e&&e[t.vScale.axis];if(Ze(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s<o;++s)n.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const r=t.barThickness;return{min:r||no(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:s,minBarLength:o}}=this,r=s||0,a=this.getParsed(t),l=a._custom,c=ro(l);let h,d,u=a[e.axis],f=0,p=i?this.applyStack(e,a,i):u;p!==u&&(f=p-u,p=u),c&&(u=l.barStart,p=l.barEnd-l.barStart,0!==u&&Ai(u)!==Ai(l.barEnd)&&(f=0),f+=u);const g=Ze(s)||c?f:s;let m=e.getPixelForValue(g);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(f+p):m,d=h-m,Math.abs(d)<o){d=function(t,e,i){return 0!==t?Ai(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=Ai(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=si(n.maxBarThickness,1/0);let r,a;if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null;const l=i.categoryPercentage;null===r&&(r=o-(null===a?e.end-e.start:a-o)),null===a&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:i.barPercentage,start:c}}(t,e,n,i):function(t,e,i,n){const s=i.barThickness;let o,r;return Ze(s)?(o=e.min*i.categoryPercentage,r=i.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:e.pixels[t]-o/2}}(t,e,n,i),c=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0);r=l.start+l.chunk*c+l.chunk/2,a=Math.min(o,l.chunk*l.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(o,e.min*e.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let s=0;for(;s<n;++s)null===this.getParsed(s)[e.axis]||i[s].hidden||i[s].draw(this._ctx)}},BubbleController:class extends io{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const s=super.parsePrimitiveData(t,e,i,n);for(let t=0;t<s.length;t++)s[t]._custom=this.resolveDataElementOptions(t+i).radius;return s}parseArrayData(t,e,i,n){const s=super.parseArrayData(t,e,i,n);for(let t=0;t<s.length;t++){const n=e[i+t];s[t]._custom=si(n[2],this.resolveDataElementOptions(t+i).radius)}return s}parseObjectData(t,e,i,n){const s=super.parseObjectData(t,e,i,n);for(let t=0;t<s.length;t++){const n=e[i+t];s[t]._custom=si(n&&n.r&&+n.r,this.resolveDataElementOptions(t+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!s&&this.getParsed(d),u={},f=u[c]=s?o.getPixelForDecimal(.5):o.getPixelForValue(i[c]),p=u[h]=s?r.getBasePixel():r.getPixelForValue(i[h]);u.skip=isNaN(f)||isNaN(p),l&&(u.options=a||this.resolveDataElementOptions(d,e.active?"active":n),s&&(u.options.radius=0)),this.updateElement(e,d,u,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const s=n.radius;return"active"!==e&&(n.radius=0),n.radius+=si(i&&i._custom,s),n}},DoughnutController:uo,LineController:class extends io{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,o=this.chart._animationsDisabled;let{start:r,count:a}=en(e,n,o);this._drawStart=r,this._drawCount=a,nn(e)&&(r=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(n,r,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,n),d=o.axis,u=r.axis,{spanGaps:f,segment:p}=this.options,g=Ri(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||s||"none"===n,b=e+i,x=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i<x;++i){const f=t[i],x=m?f:{};if(i<e||i>=b){x.skip=!0;continue}const _=this.getParsed(i),v=Ze(_[u]),w=x[d]=o.getPixelForValue(_[d],i),M=x[u]=s||v?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,_,a):_[u],i);x.skip=isNaN(w)||isNaN(M)||v,x.stop=i>0&&Math.abs(_[d]-y[d])>g,p&&(x.parsed=_,x.raw=l.data[i]),h&&(x.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,x,n),y=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];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}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends uo{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:fo,RadarController:class extends io{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return as.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r<e+i;r++){const e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":n),a=s.getPointPositionForValue(r,this.getParsed(r).r),l=o?s.xCenter:a.x,c=o?s.yCenter:a.y,h={x:l,y:c,angle:a.angle,skip:isNaN(l)||isNaN(c),options:i};this.updateElement(e,r,h,n)}}},ScatterController:class extends io{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y);return{label:i[t]||"",value:"("+r+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:s,count:o}=en(e,i,n);if(this._drawStart=s,this._drawCount=o,nn(e)&&(s=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:s,_dataset:o}=e;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=i;const r=this.resolveDatasetElementOptions(t);r.segment=this.options.segment,this.updateElement(s,void 0,{animated:!n,options:r},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=o.axis,f=r.axis,{spanGaps:p,segment:g}=this.options,m=Ri(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||s||"none"===n;let x=e>0&&this.getParsed(e-1);for(let c=e;c<e+i;++c){const e=t[c],i=this.getParsed(c),p=b?e:{},y=Ze(i[f]),_=p[u]=o.getPixelForValue(i[u],c),v=p[f]=s||y?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,i,a):i[f],c);p.skip=isNaN(_)||isNaN(v)||y,p.stop=c>0&&Math.abs(i[u]-x[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),x=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function go(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mo{static override(t){Object.assign(mo.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return go()}parse(){return go()}format(){return go()}add(){return go()}diff(){return go()}startOf(){return go()}endOf(){return go()}}var bo=mo;function xo(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?Yi:qi;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex((t=>!Ze(t[e.axis])));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex((t=>!Ze(t[e.axis])));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function yo(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:a}=o[t],{lo:l,hi:c}=xo(o[t],e,r,s);for(let t=l;t<=c;++t){const e=a[t];e.skip||n(e,i,t)}}}function _o(t,e,i,n,s){const o=[];return s||t.isPointInArea(e)?(yo(t,i,e,(function(i,r,a){(s||Cn(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&o.push({element:i,datasetIndex:r,index:a})}),!0),o):o}function vo(t,e,i,n,s,o){return o||t.isPointInArea(e)?"r"!==i||n?function(t,e,i,n,s,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const s=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return yo(t,i,e,(function(i,c,h){const d=i.inRange(e.x,e.y,s);if(n&&!d)return;const u=i.getCenterPoint(s);if(!o&&!t.isPointInArea(u)&&!d)return;const f=a(e,u);f<l?(r=[{element:i,datasetIndex:c,index:h}],l=f):f===l&&r.push({element:i,datasetIndex:c,index:h})})),r}(t,e,i,n,s,o):function(t,e,i,n){let s=[];return yo(t,i,e,(function(t,i,o){const{startAngle:r,endAngle:a}=t.getProps(["startAngle","endAngle"],n),{angle:l}=zi(t,{x:e.x,y:e.y});Wi(l,r,a)&&s.push({element:t,datasetIndex:i,index:o})})),s}(t,e,i,s):[]}function wo(t,e,i,n,s){const o=[],r="x"===i?"inXRange":"inYRange";let a=!1;return yo(t,i,e,((t,n,l)=>{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))})),n&&!a?[]:o}var Mo={evaluateInteractionItems:yo,modes:{index(t,e,i,n){const s=_s(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?_o(t,s,o,n,r):vo(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,n){const s=_s(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?_o(t,s,o,n,r):vo(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,n)=>_o(t,_s(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=_s(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return vo(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>wo(t,_s(e,t),"x",i.intersect,n),y:(t,e,i,n)=>wo(t,_s(e,t),"y",i.intersect,n)}};const ko=["left","top","right","bottom"];function So(t,e){return t.filter((t=>t.pos===e))}function Oo(t,e){return t.filter((t=>-1===ko.indexOf(t.pos)&&t.box.axis===e))}function Eo(t,e){return t.sort(((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight}))}function Po(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Co(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ao(t,e,i,n){const{pos:s,box:o}=i,r=t.maxPadding;if(!ei(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[s]+=i.size}o.getPadding&&Co(r,o.getPadding());const a=Math.max(0,e.outerWidth-Po(r,t,"left","right")),l=Math.max(0,e.outerHeight-Po(r,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function Do(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}(t?["left","right"]:["top","bottom"])}function To(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;o<r;++o){a=t[o],l=a.box,l.update(a.width||e.w,a.height||e.h,Do(a.horizontal,e));const{same:r,other:d}=Ao(e,i,a,n);c|=r&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&To(s,e,i,n)||h}function Ro(t,e,i,n,s){t.top=i,t.left=e,t.right=e+n,t.bottom=i+s,t.width=n,t.height=s}function Lo(t,e,i,n){const s=i.padding;let{x:o,y:r}=e;for(const a of t){const t=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/l.weight||1;if(a.horizontal){const n=e.w*c,o=l.size||t.height;xi(l.start)&&(r=l.start),t.fullSize?Ro(t,s.left,r,i.outerWidth-s.right-s.left,o):Ro(t,e.left+l.placed,r,n,o),l.start=r,l.placed+=n,r=t.bottom}else{const n=e.h*c,r=l.size||t.width;xi(l.start)&&(o=l.start),t.fullSize?Ro(t,o,s.top,r,i.outerHeight-s.bottom-s.top):Ro(t,o,e.top+l.placed,r,n),l.start=o,l.placed+=n,o=t.right}}e.x=o,e.y=r}var Io={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const s=Un(t.options.layout.padding),o=Math.max(e-s.width,0),r=Math.max(i-s.height,0),a=function(t){const e=function(t){const e=[];let i,n,s,o,r,a;for(i=0,n=(t||[]).length;i<n;++i)s=t[i],({position:o,options:{stack:r,stackWeight:a=1}}=s),e.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return e}(t),i=Eo(e.filter((t=>t.box.fullSize)),!0),n=Eo(So(e,"left"),!0),s=Eo(So(e,"right")),o=Eo(So(e,"top"),!0),r=Eo(So(e,"bottom")),a=Oo(e,"x"),l=Oo(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:So(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;ai(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const h=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);Co(u,Un(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!ko.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o<r;++o){a=t[o];const{fullSize:r}=a.box,l=i[a.stack],c=l&&a.stackWeight/l.weight;a.horizontal?(a.width=c?c*n:r&&e.availableWidth,a.height=s):(a.width=n,a.height=c?c*s:r&&e.availableHeight)}return i}(l.concat(c),d);To(a.fullSize,f,d,p),To(l,f,d,p),To(c,f,d,p)&&To(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Lo(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Lo(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},ai(a.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Fo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class jo extends Fo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const zo="$chartjs",No={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bo=t=>null===t||""===t,Vo=!!Ms&&{passive:!0};function Wo(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,Vo)}function Ho(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Uo(t,e,i){const n=t.canvas,s=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Ho(i.addedNodes,n),e=e&&!Ho(i.removedNodes,n);e&&i()}));return s.observe(document,{childList:!0,subtree:!0}),s}function $o(t,e,i){const n=t.canvas,s=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Ho(i.removedNodes,n),e=e&&!Ho(i.addedNodes,n);e&&i()}));return s.observe(document,{childList:!0,subtree:!0}),s}const qo=new Map;let Yo=0;function Xo(){const t=window.devicePixelRatio;t!==Yo&&(Yo=t,qo.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Ko(t,e,i){const n=t.canvas,s=n&&gs(n);if(!s)return;const o=Qi(((t,e)=>{const n=s.clientWidth;i(t,e),n<s.clientWidth&&i()}),window),r=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)}));return r.observe(s),function(t,e){qo.size||window.addEventListener("resize",Xo),qo.set(t,e)}(t,o),r}function Jo(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){qo.delete(t),qo.size||window.removeEventListener("resize",Xo)}(t)}function Go(t,e,i){const n=t.canvas,s=Qi((e=>{null!==t.ctx&&i(function(t,e){const i=No[t.type]||t.type,{x:n,y:s}=_s(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,Vo)}(n,e,s),s}class Qo extends Fo{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[zo]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Bo(s)){const e=ks(t,"width");void 0!==e&&(t.width=e)}if(Bo(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ks(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[zo])return!1;const i=e[zo].initial;["height","width"].forEach((t=>{const n=i[t];Ze(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[zo],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Uo,detach:$o,resize:Ko}[e]||Go;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Jo,detach:Jo,resize:Jo}[e]||Wo)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const s=bs(t),o=ys(s,"margin"),r=ms(s.maxWidth,t,"clientWidth")||ki,a=ms(s.maxHeight,t,"clientHeight")||ki,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&gs(t);if(o){const t=o.getBoundingClientRect(),r=bs(o),a=ys(r,"border","width"),l=ys(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=ms(r.maxWidth,o,"clientWidth"),s=ms(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||ki,maxHeight:s||ki}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=ys(s,"border","width"),e=ys(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=vs(Math.min(c,r,l.maxWidth)),h=vs(Math.min(h,a,l.maxHeight)),c&&!h&&(h=vs(c/2)),(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=vs(Math.floor(h*n))),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=t&&gs(t);return!(!e||!e.isConnected)}}class Zo{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ri(this.x)&&Ri(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function tr(t,e,i,n,s){const o=si(n,0),r=Math.min(si(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=o;c<0;)h++,c=Math.round(o+h*i);for(l=Math.max(o,0);l<r;l++)l===c&&(e.push(t[l]),h++,c=Math.round(o+h*i))}const er=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,ir=(t,e)=>Math.min(e||t,t);function nr(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;o<s;o+=n)i.push(t[Math.floor(o)]);return i}function sr(t,e,i){const n=t.ticks.length,s=Math.min(e,n-1),o=t._startPixel,r=t._endPixel,a=1e-6;let l,c=t.getPixelForTick(s);if(!(i&&(l=1===n?Math.max(c-o,r-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(s-1))/2,c+=s<e?l:-l,c<o-a||c>r+a)))return c}function or(t){return t.drawTicks?t.tickLength:0}function rr(t,e){if(!t.display)return 0;const i=$n(t.font,e),n=Un(t.padding);return(ti(t.text)?t.text.length:1)*i.lineHeight+n.height}function ar(t,e,i){let n=Zi(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class lr extends Zo{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=ni(t,Number.POSITIVE_INFINITY),e=ni(e,Number.NEGATIVE_INFINITY),i=ni(i,Number.POSITIVE_INFINITY),n=ni(n,Number.NEGATIVE_INFINITY),{min:ni(t,i),max:ni(e,n),minDefined:ii(t),maxDefined:ii(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;a<l;++a)e=r[a].controller.getMinMax(this,t),s||(i=Math.min(i,e.min)),o||(n=Math.max(n,e.max));return i=o&&i>n?n:i,n=s&&i>n?i:n,{min:ni(i,ni(n,i)),max:ni(n,ni(i,n))}}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(){ri(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=oi(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?nr(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;s<t.length;s++)s===r&&(e.push(t[s]),o++,r=i[o*n])}(e,c,o,r/s),c;const h=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),s=e.length/i;if(!n)return Math.max(s,1);const o=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(n);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>s)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(tr(e,c,h,Ze(n)?0:a-n,a),t=0,i=r-1;t<i;t++)tr(e,c,h,o[t],o[t+1]);return tr(e,c,h,l,Ze(n)?e.length:l+n),c}return tr(e,c,h),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ri(this.options.afterUpdate,[this])}beforeSetDimensions(){ri(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(){ri(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ri(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ri(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,s;for(i=0,n=t.length;i<n;i++)s=t[i],s.label=ri(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){ri(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ri(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=ir(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,s=e.maxRotation;let o,r,a,l=n;if(!this._isVisible()||!e.display||n>=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=Hi(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-or(t.grid)-e.padding-rr(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=Fi(Math.min(Math.asin(Hi((c.highest.height+6)/o,-1,1)),Math.asin(Hi(r/a,-1,1))-Math.asin(Hi(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){ri(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ri(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=rr(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=or(s)+o):(t.height=this.maxHeight,t.width=or(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=Ii(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+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(){ri(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)Ze(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=nr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:s}=this,o=[],r=[],a=Math.floor(e/ir(e,i));let l,c,h,d,u,f,p,g,m,b,x,y=0,_=0;for(l=0;l<e;l+=a){if(d=t[l].label,u=this._resolveTickFontOptions(l),n.font=f=u.string,p=s[f]=s[f]||{data:{},gc:[]},g=u.lineHeight,m=b=0,Ze(d)||ti(d)){if(ti(d))for(c=0,h=d.length;c<h;++c)x=d[c],Ze(x)||ti(x)||(m=Mn(n,p.data,p.gc,m,x),b+=g)}else m=Mn(n,p.data,p.gc,m,d),b=g;o.push(m),r.push(b),y=Math.max(m,y),_=Math.max(b,_)}!function(t,e){ai(t,(t=>{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s<n;++s)delete t.data[i[s]];i.splice(0,n)}}))}(s,e);const v=o.indexOf(y),w=r.indexOf(_),M=t=>({width:o[t]||0,height:r[t]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Hi(this._alignToPixels?Sn(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return Yn(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Yn(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Ii(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,r=s?s.widest.width+o:0,a=s?s.highest.height+o:0;return this.isHorizontal()?a*i>r*n?r/i:a/n:a*n<r*i?a/i:r/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=or(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Sn(i,t,f)};let m,b,x,y,_,v,w,M,k,S,O,E;if("top"===o)m=g(this.bottom),v=this.bottom-h,M=m-p,S=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),S=t.top,E=g(t.bottom)-p,v=m+p,M=this.top+h;else if("left"===o)m=g(this.right),_=this.right-h,w=m-p,k=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),k=t.left,O=g(t.right)-p,_=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(ei(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,E=t.bottom,v=m+p,M=v+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(ei(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}_=m-p,w=_-h,k=t.left,O=t.right}const P=si(n.ticks.maxTicksLimit,c),C=Math.max(1,Math.ceil(c/P));for(b=0;b<c;b+=C){const t=this.getContext(b),e=s.setContext(t),n=r.setContext(t),o=e.lineWidth,c=e.color,h=n.dash||[],u=n.dashOffset,f=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;x=sr(this,b,a),void 0!==x&&(y=Sn(i,x,o),l?_=w=k=O=y:v=M=S=E=y,d.push({tx1:_,ty1:v,tx2:w,ty2:M,x1:k,y1:S,x2:O,y2:E,width:o,color:c,borderDash:h,borderDashOffset:u,tickWidth:f,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:s}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:l,padding:c,mirror:h}=s,d=or(i.grid),u=d+c,f=h?-c:u,p=-Ii(this.labelRotation),g=[];let m,b,x,y,_,v,w,M,k,S,O,E,P="middle";if("top"===n)v=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===n)v=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("x"===e){if("center"===n)v=(t.top+t.bottom)/2+u;else if(ei(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)_=(t.left+t.right)/2-u;else if(ei(n)){const t=Object.keys(n)[0],e=n[t];_=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===a?P="top":"end"===a&&(P="bottom"));const C=this._getLabelSizes();for(m=0,b=r.length;m<b;++m){x=r[m],y=x.label;const t=s.setContext(this.getContext(m));M=this.getPixelForTick(m)+s.labelOffset,k=this._resolveTickFontOptions(m),S=k.lineHeight,O=ti(y)?y.length:1;const e=O/2,i=t.color,a=t.textStrokeColor,c=t.textStrokeWidth;let d,u=w;if(o?(_=M,"inner"===w&&(u=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),E="top"===n?"near"===l||0!==p?-O*S+S/2:"center"===l?-C.highest.height/2-e*S+S:-C.highest.height+S/2:"near"===l||0!==p?S/2:"center"===l?C.highest.height/2-e*S:C.highest.height-O*S,h&&(E*=-1),0===p||t.showLabelBackdrop||(_+=S/2*Math.sin(p))):(v=M,E=(1-O)*S/2),t.showLabelBackdrop){const e=Un(t.backdropPadding),i=C.heights[m],n=C.widths[m];let s=E-e.top,o=0-e.left;switch(P){case"middle":s-=i/2;break;case"bottom":s-=i}switch(w){case"center":o-=n/2;break;case"right":o-=n;break;case"inner":m===b-1?o-=n:m>0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:k,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:P,translation:[_,v],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ii(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s<o;++s){const t=n[s];e.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,s=i.setContext(this.getContext()),o=i.display?s.width:0;if(!o)return;const r=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,d;this.isHorizontal()?(l=Sn(t,this.left,o)-o/2,c=Sn(t,this.right,r)+r/2,h=d=a):(h=Sn(t,this.top,o)-o/2,d=Sn(t,this.bottom,r)+r/2,l=c=a),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(l,h),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&An(e,i);const n=this.getLabelItems(t);for(const t of n){const i=t.options,n=t.font;Fn(e,t.label,0,t.textOffset,n,i)}i&&Dn(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const s=$n(i.font),o=Un(i.padding),r=i.align;let a=s.lineHeight/2;"bottom"===e||"center"===e||ei(e)?(a+=o.bottom,ti(i.text)&&(a+=s.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:l,titleY:c,maxWidth:h,rotation:d}=function(t,e,i,n){const{top:s,left:o,bottom:r,right:a,chart:l}=t,{chartArea:c,scales:h}=l;let d,u,f,p=0;const g=r-s,m=a-o;if(t.isHorizontal()){if(u=tn(n,o,a),ei(i)){const t=Object.keys(i)[0],n=i[t];f=h[t].getPixelForValue(n)+g-e}else f="center"===i?(c.bottom+c.top)/2+g-e:er(t,i,e);d=a-o}else{if(ei(i)){const t=Object.keys(i)[0],n=i[t];u=h[t].getPixelForValue(n)-m+e}else u="center"===i?(c.left+c.right)/2-m+e:er(t,i,e);f=tn(n,r,s),p="left"===i?-Oi:Oi}return{titleX:u,titleY:f,maxWidth:d,rotation:p}}(this,a,e,r);Fn(t,i.text,0,0,s,{color:i.color,maxWidth:h,rotation:d,textAlign:ar(r,e,n),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=si(t.grid&&t.grid.z,-1),n=si(t.border&&t.border.z,0);return this._isVisible()&&this.draw===lr.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s<o;++s){const o=e[s];o[i]!==this.id||t&&o.type!==t||n.push(o)}return n}_resolveTickFontOptions(t){return $n(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class cr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in n||(n[s]=t,function(t,e,i){const n=ui(Object.create(null),[i?wn.get(i):{},wn.get(e),t.defaults]);wn.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");wn.route(o,s,l,a)}))}(e,t.defaultRoutes),t.descriptors&&wn.describe(e,t.descriptors)}(t,o,i),this.override&&wn.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in wn[n]&&(delete wn[n][i],this.override&&delete bn[i])}}class hr{constructor(){this.controllers=new cr(io,"datasets",!0),this.elements=new cr(Zo,"elements"),this.plugins=new cr(Object,"plugins"),this.scales=new cr(lr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):ai(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=bi(t);ri(i["before"+n],[],i),e[t](i),ri(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var dr=new hr;class ur{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(s,t,e,i);return"afterDestroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,n){n=n||{};for(const s of t){const t=s.plugin;if(!1===ri(t[i],[e,n,s.options],t)&&n.cancelable)return!1}return!0}invalidate(){Ze(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=si(i.options&&i.options.plugins,{}),s=function(t){const e={},i=[],n=Object.keys(dr.plugins.items);for(let t=0;t<n.length;t++)i.push(dr.getPlugin(n[t]));const s=t.plugins||[];for(let t=0;t<s.length;t++){const n=s[t];-1===i.indexOf(n)&&(i.push(n),e[n.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,s){const o=[],r=t.getContext();for(const a of e){const e=a.id,l=fr(n[e],s);null!==l&&o.push({plugin:a,options:pr(t.config,{plugin:a,local:i[e]},l,r)})}return o}(t,s,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function fr(t,e){return e||!1!==t?!0===t?{}:t:null}function pr(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function gr(t,e){const i=wn.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function mr(t){if("x"===t||"y"===t||"r"===t)return t}function br(t,...e){if(mr(t))return t;for(const n of e){const e=n.axis||("top"===(i=n.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&mr(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function xr(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function yr(t){const e=t.options||(t.options={});e.plugins=si(e.plugins,{}),e.scales=function(t,e){const i=bn[t.type]||{scales:{}},n=e.scales||{},s=gr(t.type,e),o=Object.create(null);return Object.keys(n).forEach((e=>{const r=n[e];if(!ei(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=br(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return xr(t,"x",i[0])||xr(t,"y",i[0])}return{}}(e,t),wn.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=fi(Object.create(null),[{axis:a},r,c[a],c[l]])})),t.data.datasets.forEach((i=>{const s=i.type||t.type,r=i.indexAxis||gr(s,e),a=(bn[s]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),fi(o[s],[{axis:e},n[s],a[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];fi(e,[wn.scales[e.type],wn.scale])})),o}(t,e)}function _r(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const vr=new Map,wr=new Set;function Mr(t,e){let i=vr.get(t);return i||(i=e(),vr.set(t,i),wr.add(i)),i}const kr=(t,e,i)=>{const n=mi(e,i);void 0!==n&&t.add(n)};class Sr{constructor(t){this._config=function(t){return(t=t||{}).data=_r(t.data),yr(t),t}(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=_r(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(),yr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Mr(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Mr(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Mr(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Mr(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>kr(a,t,e)))),e.forEach((t=>kr(a,n,t))),e.forEach((t=>kr(a,bn[s]||{},t))),e.forEach((t=>kr(a,wn,t))),e.forEach((t=>kr(a,xn,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),wr.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,bn[e]||{},wn.datasets[e]||{},{type:e},wn,xn]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Or(this._resolverCache,t,n);let a=o;(function(t,e){const{isScriptable:i,isIndexable:n}=Jn(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(yi(r)||Er(r))||o&&ti(r))return!0}return!1})(o,e)&&(s.$shared=!1,a=Kn(o,i=yi(i)?i():i,this.createResolver(t,i,r)));for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=Or(this._resolverCache,t,i);return ei(e)?Kn(s,e,void 0,n):s}}function Or(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);return o||(o={resolver:Xn(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(s,o)),o}const Er=t=>ei(t)&&Object.getOwnPropertyNames(t).some((e=>yi(t[e]))),Pr=["top","bottom","left","right","chartArea"];function Cr(t,e){return"top"===t||"bottom"===t||-1===Pr.indexOf(t)&&"x"===e}function Ar(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Dr(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),ri(i&&i.onComplete,[t],e)}function Tr(t){const e=t.chart,i=e.options.animation;ri(i&&i.onProgress,[t],e)}function Rr(t){return ps()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Lr={},Ir=t=>{const e=Rr(t);return Object.values(Lr).filter((t=>t.canvas===e)).pop()};function Fr(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class jr{static defaults=wn;static instances=Lr;static overrides=bn;static registry=dr;static version="4.4.9";static getChart=Ir;static register(...t){dr.add(...t),zr()}static unregister(...t){dr.remove(...t),zr()}constructor(t,e){const i=this.config=new Sr(e),n=Rr(t),s=Ir(n);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=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!ps()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?jo:Qo}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=Qe(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,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 ur,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Lr[this.id]=this,r&&a?(Bs.listen(this,"complete",Dr),Bs.listen(this,"progress",Tr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return Ze(t)?e&&s?s:n?i/n: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 dr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ws(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return On(this.canvas,this.ctx),this}stop(){return Bs.stop(this),this}resize(t,e){Bs.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ws(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ri(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){ai(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let s=[];e&&(s=s.concat(Object.keys(e).map((t=>{const i=e[t],n=br(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}})))),ai(s,(e=>{const s=e.options,o=s.id,r=br(o,s),a=si(s.type,e.dtype);void 0!==s.position&&Cr(s.position,r)===Cr(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;o in i&&i[o].type===a?l=i[o]:(l=new(dr.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(s,t)})),ai(n,((t,e)=>{t||delete i[e]})),ai(i,(t=>{Io.configure(this,t,t.options),Io.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ar("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let s=this.getDatasetMeta(i);const o=n.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=n.indexAxis||gr(o,this.options),s.order=n.order||0,s.index=i,s.label=""+n.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const e=dr.getController(o),{datasetElementType:n,dataElementType:r}=wn.datasets[o];Object.assign(e,{dataElementType:dr.getElement(r),datasetElementType:n&&dr.getElement(n)}),s.controller=new e(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){ai(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===s.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),n||ai(s,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ar("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){ai(this.scales,(t=>{Io.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);_i(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e)Fr(t,n,"_removeElements"===i?-s:s)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0);for(let t=1;t<e;t++)if(!_i(n,i(t)))return;return Array.from(n).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Io.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],ai(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,yi(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Bs.has(this)?this.attached&&!Bs.running(this)&&Bs.start(this):(this.draw(),Dr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,s;for(n=0,s=e.length;n<s;++n){const s=e[n];t&&!s.visible||i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=zs(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&An(e,n),t.controller.draw(),n&&Dn(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Cn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=Mo.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Yn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);xi(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Bs.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),On(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Lr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};ai(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){ai(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},ai(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!li(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,ri(s.onHover,[t,r,this],this),a&&ri(s.onClick,[t,r,this],this));const c=!li(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function zr(){return ai(jr.instances,(t=>t._plugins.invalidate()))}function Nr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Br(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*d-i/vi)/d)/2,m=l+g+f,b=s-g-f,{outerStart:x,outerEnd:y,innerStart:_,innerEnd:v}=function(t,e,i,n){const s=Vn(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return Hi(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Hi(s.innerStart,0,r),innerEnd:Hi(s.innerEnd,0,r)}}(e,u,d,b-m),w=d-x,M=d-y,k=m+x/w,S=b-y/M,O=u+_,E=u+v,P=m+_/O,C=b-v/E;if(t.beginPath(),o){const e=(k+S)/2;if(t.arc(r,a,d,k,e),t.arc(r,a,d,e,S),y>0){const e=Nr(M,S,r,a);t.arc(e.x,e.y,y,S,b+Oi)}const i=Nr(E,b,r,a);if(t.lineTo(i.x,i.y),v>0){const e=Nr(E,C,r,a);t.arc(e.x,e.y,v,b+Oi,C+Math.PI)}const n=(b-v/u+(m+_/u))/2;if(t.arc(r,a,u,b-v/u,n,!0),t.arc(r,a,u,n,m+_/u,!0),_>0){const e=Nr(O,P,r,a);t.arc(e.x,e.y,_,P+Math.PI,m-Oi)}const s=Nr(w,m,r,a);if(t.lineTo(s.x,s.y),x>0){const e=Nr(w,k,r,a);t.arc(e.x,e.y,x,m-Oi,k)}}else{t.moveTo(r,a);const e=Math.cos(k)*d+r,i=Math.sin(k)*d+a;t.lineTo(e,i);const n=Math.cos(S)*d+r,s=Math.sin(S)*d+a;t.lineTo(n,s)}t.closePath()}function Vr(t,e,i=e){t.lineCap=si(i.borderCapStyle,e.borderCapStyle),t.setLineDash(si(i.borderDash,e.borderDash)),t.lineDashOffset=si(i.borderDashOffset,e.borderDashOffset),t.lineJoin=si(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=si(i.borderWidth,e.borderWidth),t.strokeStyle=si(i.borderColor,e.borderColor)}function Wr(t,e,i){t.lineTo(i.x,i.y)}function Hr(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:e.loop,ilen:c<l&&!h?n+c-l:c-l}}function Ur(t,e,i,n){const{points:s,options:o}=e,{count:r,start:a,loop:l,ilen:c}=Hr(s,i,n),h=function(t){return t.stepped?Tn:t.tension||"monotone"===t.cubicInterpolationMode?Rn:Wr}(o);let d,u,f,{move:p=!0,reverse:g}=n||{};for(d=0;d<=c;++d)u=s[(a+(g?c-d:d))%r],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):h(t,f,u,g,o.stepped),f=u);return l&&(u=s[(a+(g?c:0))%r],h(t,f,u,g,o.stepped)),!!l}function $r(t,e,i,n){const s=e.points,{count:o,start:r,ilen:a}=Hr(s,i,n),{move:l=!0,reverse:c}=n||{};let h,d,u,f,p,g,m=0,b=0;const x=t=>(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(i<f?f=i:i>p&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function qr(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Ur:$r}const Yr="function"==typeof Path2D;class Xr extends Zo{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;fs(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;s<e&&!t[s].skip;)s++;for(;s<e&&t[s].skip;)s++;for(s%=e,i&&(o+=s);o>s&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),o=Is(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,l=i.length,c=[];let h=o,d=e[0].start,u=d;function f(t,e,n,s){const o=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=Is(n.setContext(Yn(s,{type:"segment",p0:o,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Fs(e,h)&&f(d,u-1,t.loop,h),o=a,h=e}d<u-1&&f(d,u-1,t.loop,h)}return c}(t,e,i,n):e}(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a<r?a+s:a,!!t._fullLoop&&0===r&&a===s-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],s=this.points,o=Ls(this,{property:e,start:n,end:n});if(!o.length)return;const r=[],a=function(t){return t.stepped?Os:t.tension||"monotone"===t.cubicInterpolationMode?Es:Ss}(i);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:h}=o[l],d=s[c],u=s[h];if(d===u){r.push(d);continue}const f=a(d,u,Math.abs((n-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],r.push(f)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return qr(this)(t,this,e,i)}path(t,e,i){const n=this.segments,s=qr(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of n)o&=s(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,n){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),function(t,e,i,n){Yr&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Vr(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=qr(e);for(const a of s)Vr(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Kr(t,e,i,n){const s=t.options,{[i]:o}=t.getProps([i],n);return Math.abs(e-o)<s.radius+s.hitRadius}function Jr(t,e){const{x:i,y:n,base:s,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let a,l,c,h,d;return t.horizontal?(d=r/2,a=Math.min(i,s),l=Math.max(i,s),c=n-d,h=n+d):(d=o/2,a=i-d,l=i+d,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function Gr(t,e,i,n){return t?0:Hi(e,i,n)}function Qr(t,e,i,n){const s=null===e,o=null===i,r=t&&!(s&&o)&&Jr(t,n);return r&&(s||Ui(e,r.left,r.right))&&(o||Ui(i,r.top,r.bottom))}function Zr(t,e){t.rect(e.x,e.y,e.w,e.h)}function ta(t,e,i={}){const n=t.x!==i.x?-e:0,s=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-n,r=(t.y+t.h!==i.y+i.h?e:0)-s;return{x:t.x+n,y:t.y+s,w:t.w+o,h:t.h+r,radius:t.radius}}var ea=Object.freeze({__proto__:null,ArcElement:class extends Zo{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=zi(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=si(h,a-r),f=Wi(s,r,a)&&r!==a,p=u>=wi||f,g=Ui(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>wi?Math.floor(i/wi):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(vi,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Br(t,e,i,n,l,s);for(let e=0;e<o;++e)t.fill();isNaN(a)||(l=r+(a%wi||wi))}Br(t,e,i,n,l,s),t.fill()}(t,this,a,s,o),function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u}=l,f="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,f?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let p=e.endAngle;if(o){Br(t,e,i,n,p,s);for(let e=0;e<o;++e)t.stroke();isNaN(a)||(p=r+(a%wi||wi))}f&&function(t,e,i){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(o,r,a,n-c,i+c),l>s?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+Oi,n-Oi),t.closePath(),t.clip()}(t,e,p),o||(Br(t,e,i,n,p,s),t.stroke())}(t,this,a,s,o),t.restore()}},BarElement:class extends Zo{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:s,outer:o}=function(t){const e=Jr(t),i=e.right-e.left,n=e.bottom-e.top,s=function(t,e,i){const n=t.options.borderWidth,s=t.borderSkipped,o=Wn(n);return{t:Gr(s.top,o.top,0,i),r:Gr(s.right,o.right,0,e),b:Gr(s.bottom,o.bottom,0,i),l:Gr(s.left,o.left,0,e)}}(t,i/2,n/2),o=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=Hn(s),r=Math.min(e,i),a=t.borderSkipped,l=n||ei(s);return{topLeft:Gr(!l||a.top||a.left,o.topLeft,0,r),topRight:Gr(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Gr(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Gr(!l||a.bottom||a.right,o.bottomRight,0,r)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}(this),r=(a=o.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?jn:Zr;var a;t.save(),o.w===s.w&&o.h===s.h||(t.beginPath(),r(t,ta(o,e,s)),t.clip(),r(t,ta(s,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,ta(s,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return Qr(this,t,e,i)}inXRange(t,e){return Qr(this,t,null,e)}inYRange(t,e){return Qr(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+n)/2:e,y:s?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:Xr,PointElement:class extends Zo{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Kr(this,t,"x",e)}inYRange(t,e){return Kr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Cn(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,En(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});const ia=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],na=ia.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function sa(t){return ia[t%ia.length]}function oa(t){return na[t%na.length]}function ra(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var aa={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=ra(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&ra(o)||"rgba(0,0,0,0.1)"!==wn.borderColor||"rgba(0,0,0,0.1)"!==wn.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=function(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof uo?e=function(t,e){return t.backgroundColor=t.data.map((()=>sa(e++))),e}(i,e):s instanceof fo?e=function(t,e){return t.backgroundColor=t.data.map((()=>oa(e++))),e}(i,e):s&&(e=function(t,e){return t.borderColor=sa(e),t.backgroundColor=oa(e),++e}(i,e))}}(t);n.forEach(l)}};function la(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function ca(t){t.data.datasets.forEach((t=>{la(t)}))}var ha={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void ca(t);const n=t.width;t.data.datasets.forEach(((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===qn([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let h,{start:d,count:u}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=Hi(qi(e,o.axis,r).lo,0,i-1)),n=c?Hi(qi(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(u<=(i.threshold||4*n))la(e);else{switch(Ze(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":h=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;h<o-2;h++){let n,s=0,o=0;const c=Math.floor((h+1)*a)+1+e,m=Math.min(Math.floor((h+2)*a)+1,i)+e,b=m-c;for(n=c;n<m;n++)s+=t[n].x,o+=t[n].y;s/=b,o/=b;const x=Math.floor(h*a)+1+e,y=Math.min(Math.floor((h+1)*a)+1,i)+e,{x:_,y:v}=t[g];for(u=f=-1,n=x;n<y;n++)f=.5*Math.abs((_-s)*(t[n].y-v)-(_-t[n].x)*(o-v)),f>u&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,d,u,n,i);break;case"min-max":h=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,x=t[e].x,y=t[b].x-x;for(s=e;s<e+i;++s){o=t[s],r=(o.x-x)/y*n,a=o.y;const e=0|r;if(e===l)a<u?(u=a,c=s):a>f&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!Ze(c)&&!Ze(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=h}}))},destroy(t){ca(t)}};function da(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=Vi(s),o=Vi(o)),{property:t,start:s,end:o}}function ua(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function fa(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function pa(t,e){let i=[],n=!1;return ti(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=ua(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))})),o}(t,e),i.length?new Xr({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function ga(t){return t&&!1!==t.fill}function ma(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!ii(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function ba(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=si(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if(ei(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return ii(s)&&Math.floor(s)===s?function(t,e,i,n){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=n)&&i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function xa(t,e,i){const n=[];for(let s=0;s<i.length;s++){const o=i[s],{first:r,last:a,point:l}=ya(o,e,"x");if(!(!l||r&&a))if(r)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function ya(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const s=n[i],o=t.segments,r=t.points;let a=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],n=r[e.start][i],c=r[e.end][i];if(Ui(s,n,c)){a=s===n,l=s===c;break}}return{first:a,last:l,point:n}}class _a{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:o}=this;return e=e||{start:0,end:wi},t.arc(n,s,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function va(t,e,i){const n=function(t){const{chart:e,fill:i,line:n}=t;if(ii(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,s=[],o=n.segments,r=n.points,a=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t<n.length;t++){const s=n[t];if(s.index===e)break;s.hidden||i.unshift(s.dataset)}return i}(e,i);a.push(pa({x:null,y:e.bottom},n));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)xa(s,r[t],a)}return new Xr({points:s,options:{}})}(t);if("shape"===i)return!0;const s=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,s=e.getLabels().length,o=n.reverse?e.max:e.min,r=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:ei(t)?t.value:e.getBaseValue(),n}(i,e,o),a=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,o);return new _a({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<s;++t)a.push(e.getPointPositionForValue(t,r));return a}(t):function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:ei(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(ii(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return s instanceof _a?s:pa(s,n)}(e),{chart:s,index:o,line:r,scale:a,axis:l}=e,c=r.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=s.getDatasetMeta(o),g=zs(s,p);n&&r.points.length&&(An(t,i),function(t,e){const{line:i,target:n,above:s,below:o,area:r,scale:a,clip:l}=e,c=i._loop?"angle":e.axis;t.save(),"x"===c&&o!==s&&(wa(t,n,r.top),Ma(t,{line:i,target:n,color:s,scale:a,property:c,clip:l}),t.restore(),t.save(),wa(t,n,r.bottom)),Ma(t,{line:i,target:n,color:o,scale:a,property:c,clip:l}),t.restore()}(t,{line:r,target:n,above:u,below:f,area:i,scale:a,axis:l,clip:g}),Dn(t))}function wa(t,e,i){const{segments:n,points:s}=e;let o=!0,r=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[ua(n,l,s)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ma(t,e){const{line:i,target:n,property:s,color:o,scale:r,clip:a}=e,l=function(t,e,i){const n=t.segments,s=t.points,o=e.points,r=[];for(const t of n){let{start:n,end:a}=t;a=ua(n,a,s);const l=da(i,s[n],s[a],t.loop);if(!e.segments){r.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=Ls(e,l);for(const e of c){const n=da(i,o[e.start],o[e.end],e.loop),a=Rs(t,s,n);for(const t of a)r.push({source:t,target:e,start:{[i]:fa(l,n,"start",Math.max)},end:{[i]:fa(l,n,"end",Math.min)}})}}return r}(i,n,s);for(const{source:e,target:c,start:h,end:d}of l){const{style:{backgroundColor:l=o}={}}=e,u=!0!==n;t.save(),t.fillStyle=l,ka(t,r,a,u&&da(s,h,d)),t.beginPath();const f=!!i.pathSegment(t,e);let p;if(u){f?t.closePath():Sa(t,n,d,s);const e=!!n.pathSegment(t,c,{move:f,reverse:!0});p=f&&e,p||Sa(t,n,h,s)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function ka(t,e,i,n){const s=e.chart.chartArea,{property:o,start:r,end:a}=n||{};if("x"===o||"y"===o){let e,n,l,c;"x"===o?(e=r,n=s.top,l=a,c=s.bottom):(e=s.left,n=r,l=s.right,c=a),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),n=Math.max(n,i.top),c=Math.min(c,i.bottom)),t.rect(e,n,l-e,c-n),t.clip()}}function Sa(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}var Oa={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<n;++r)o=t.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Xr&&(l={visible:t.isDatasetVisible(r),index:r,fill:ba(a,r,n),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],l&&!1!==l.fill&&(l.fill=ma(s,r,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,s=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&va(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;ga(i)&&va(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;ga(n)&&"beforeDatasetDraw"===i.drawTime&&va(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ea=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class Pa extends Zo{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=ri(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=$n(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=Ea(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach(((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r})),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;return s&&"string"!=typeof s&&(s=s.reduce(((t,e)=>t.length>e.length?t:e))),e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;return"string"!=typeof e.text&&(n=Ca(e,i)),n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r})),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=Ps(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=tn(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=tn(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=tn(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=tn(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;An(t,this),this._draw(),Dn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=wn.color,a=Ps(t.rtl,this.left,this.width),l=$n(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=Ea(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:tn(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:tn(s,this.top+b+c,this.bottom-e[0].height),line:0},Cs(this.ctx,t.textDirection);const x=g+c;this.legendItems.forEach(((y,_)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const v=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),M=f+d+v;let k=u.x,S=u.y;if(a.setWidth(this.width),m?_>0&&k+M+c>this.right&&(S=u.y+=x,u.line++,k=u.x=tn(s,this.left+c,this.right-i[u.line])):_>0&&S+x>this.bottom&&(k=u.x=k+e[u.line].width+c,u.line++,S=u.y=tn(s,this.top+b+c,this.bottom-e[u.line].height)),function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=si(i.lineWidth,1);if(n.fillStyle=si(i.fillStyle,r),n.lineCap=si(i.lineCap,"butt"),n.lineDashOffset=si(i.lineDashOffset,0),n.lineJoin=si(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=si(i.strokeStyle,r),n.setLineDash(si(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);Pn(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=Hn(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?jn(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(k),S,y),k=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,k+f+d,m?k+M:this.right,t.rtl),function(t,e,i){Fn(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(k),S,y),m)u.x+=M+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=Ca(y,t)+c}else u.y+=x})),As(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=$n(e.font),n=Un(e.padding);if(!e.display)return;const s=Ps(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=tn(t.align,h,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+tn(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=tn(r,h,h+d);o.textAlign=s.textAlign(Zi(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Fn(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=$n(t.font),i=Un(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(Ui(t,this.left,this.right)&&Ui(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(n=s[i],Ui(t,n.left,n.left+n.width)&&Ui(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,r=(s=i,null!==(n=o)&&null!==s&&n.datasetIndex===s.datasetIndex&&n.index===s.index);o&&!r&&ri(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!r&&ri(e.onHover,[t,i,this],this)}else i&&ri(e.onClick,[t,i,this],this);var n,s}}function Ca(t,e){return e*(t.text?t.text.length:0)}var Aa={id:"legend",_element:Pa,start(t,e,i){const n=t.legend=new Pa({ctx:t.ctx,options:i,chart:t});Io.configure(t,n,i),Io.addBox(t,n)},stop(t){Io.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;Io.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),e.hidden=!0):(s.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),c=Un(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Da extends Zo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=ti(i.text)?i.text.length:1;this._padding=Un(i.padding);const s=n*$n(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=tn(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=tn(r,n,e),h=-.5*vi):(l=s-t,c=tn(r,e,n),h=.5*vi),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=$n(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);Fn(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:Zi(e.align),textBaseline:"middle",translation:[s,o]})}}var Ta={id:"title",_element:Da,start(t,e,i){!function(t,e){const i=new Da({ctx:t.ctx,options:e,chart:t});Io.configure(t,i,e),Io.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Io.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;Io.configure(t,n,i),n.options=i},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 Ra=new WeakMap;var La={id:"subtitle",start(t,e,i){const n=new Da({ctx:t.ctx,options:i,chart:t});Io.configure(t,n,i),Io.addBox(t,n),Ra.set(t,n)},stop(t){Io.removeBox(t,Ra.get(t)),Ra.delete(t)},beforeUpdate(t,e,i){const n=Ra.get(t);Io.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ia={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n.add(t.x),s+=t.y,++o}}return 0!==o&&0!==n.size&&{x:[...n].reduce(((t,e)=>t+e))/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=Ni(e,n.getCenterPoint());t<a&&(a=t,s=n)}}if(s){const t=s.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function Fa(t,e){return e&&(ti(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ja(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function za(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Na(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=$n(e.bodyFont),c=$n(e.titleFont),h=$n(e.footerFont),d=o.length,u=s.length,f=n.length,p=Un(e.padding);let g=p.height,m=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=c.string,ai(t.title,y),i.font=l.string,ai(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?r+2+e.boxPadding:0,ai(n,(t=>{ai(t.before,y),ai(t.lines,y),ai(t.after,y)})),x=0,i.font=h.string,ai(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Ba(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Va(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Ba(t,e,i,n),yAlign:n}}function Wa(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Hn(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:Hi(p,0,n.width-e.width),y:Hi(g,0,n.height-e.height)}}function Ha(t,e,i){const n=Un(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ua(t){return Fa([],ja(t))}function $a(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const qa={beforeTitle:Ge,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:Ge,beforeBody:Ge,beforeLabel:Ge,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return Ze(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ge,afterBody:Ge,beforeFooter:Ge,footer:Ge,afterFooter:Ge};function Ya(t,e,i,n){const s=t[e].call(i,n);return void 0===s?qa[e].call(i,n):s}class Xa extends Zo{static positioners=Ia;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new Us(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Yn(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){const{callbacks:i}=e,n=Ya(i,"beforeTitle",this,t),s=Ya(i,"title",this,t),o=Ya(i,"afterTitle",this,t);let r=[];return r=Fa(r,ja(n)),r=Fa(r,ja(s)),r=Fa(r,ja(o)),r}getBeforeBody(t,e){return Ua(Ya(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return ai(t,(t=>{const e={before:[],lines:[],after:[]},s=$a(i,t);Fa(e.before,ja(Ya(s,"beforeLabel",this,t))),Fa(e.lines,Ya(s,"label",this,t)),Fa(e.after,ja(Ya(s,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return Ua(Ya(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Ya(i,"beforeFooter",this,t),s=Ya(i,"footer",this,t),o=Ya(i,"afterFooter",this,t);let r=[];return r=Fa(r,ja(n)),r=Fa(r,ja(s)),r=Fa(r,ja(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;r<a;++r)l.push(za(this.chart,e[r]));return t.filter&&(l=l.filter(((e,n,s)=>t.filter(e,n,s,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),ai(l,(e=>{const i=$a(t.callbacks,e);n.push(Ya(i,"labelColor",this,e)),s.push(Ya(i,"labelPointStyle",this,e)),o.push(Ya(i,"labelTextColor",this,e))})),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Ia[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Na(this,i),r=Object.assign({},t,e),a=Va(this.chart,i,r),l=Wa(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=Hn(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,x,y,_;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,x=y+o,_=y-o):(g=d+f,m=g+o,x=y-o,_=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(x=u,y=x-o,g=m-o,b=m+o):(x=u+p,y=x+o,g=m+o,b=m-o),_=x),{x1:g,x2:m,x3:b,y1:x,y2:y,y3:_}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=Ps(i.rtl,this.x,this.width);for(t.x=Ha(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=$n(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a<s;++a)e.fillText(n[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r,a+1===s&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,s){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=s,c=$n(s.bodyFont),h=Ha(this,"left",s),d=n.x(h),u=a<c.lineHeight?(c.lineHeight-a)/2:0,f=e.y+u;if(s.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=n.leftForLtr(d,l)+l/2,c=f+a/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,En(t,e,i,c),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,En(t,e,i,c)}else{t.lineWidth=ei(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 e=n.leftForLtr(d,l),i=n.leftForLtr(n.xPlus(d,1),l-2),r=Hn(o.borderRadius);Object.values(r).some((t=>0!==t))?(t.beginPath(),t.fillStyle=s.multiKeyBackground,jn(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),jn(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=$n(i.bodyFont);let d=h.lineHeight,u=0;const f=Ps(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,x,y,_,v,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Ha(this,g,i),e.fillStyle=i.bodyColor,ai(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,v=n.length;y<v;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,ai(m.before,p),x=m.lines,r&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),_=0,w=x.length;_<w;++_)p(x[_]),d=h.lineHeight;ai(m.after,p)}u=0,d=h.lineHeight,ai(this.afterBody,p),t.y-=s}drawFooter(t,e,i){const n=this.footer,s=n.length;let o,r;if(s){const a=Ps(i.rtl,this.x,this.width);for(t.x=Ha(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",o=$n(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,r=0;r<s;++r)e.fillText(n[r],a.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:s,yAlign:o}=this,{x:r,y:a}=t,{width:l,height:c}=i,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Hn(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+h,a),"top"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+l-d,a),e.quadraticCurveTo(r+l,a,r+l,a+d),"center"===o&&"right"===s&&this.drawCaret(t,e,i,n),e.lineTo(r+l,a+c-f),e.quadraticCurveTo(r+l,a+c,r+l-f,a+c),"bottom"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+u,a+c),e.quadraticCurveTo(r,a+c,r,a+c-u),"center"===o&&"left"===s&&this.drawCaret(t,e,i,n),e.lineTo(r,a+h),e.quadraticCurveTo(r,a,r+h,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Ia[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Na(this,t),r=Object.assign({},i,this._size),a=Va(e,t,r),l=Wa(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Un(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),Cs(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),As(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),s=!li(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!li(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Ia[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Ka={id:"tooltip",_element:Xa,positioners:Ia,afterInit(t,e,i){i&&(t.tooltip=new Xa({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:qa},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ja=Object.freeze({__proto__:null,Colors:aa,Decimation:ha,Filler:Oa,Legend:Aa,SubTitle:La,Title:Ta,Tooltip:Ka});function Ga(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function Qa(t,e,{horizontal:i,minRotation:n}){const s=Ii(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Za extends lr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Ze(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=Ai(n),e=Ai(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:s,min:o,max:r,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:p,max:g}=e,m=!Ze(o),b=!Ze(r),x=!Ze(l),y=(g-p)/(h+1);let _,v,w,M,k=Ti((g-p)/f/u)*u;if(k<1e-14&&!m&&!b)return[{value:p},{value:g}];M=Math.ceil(g/k)-Math.floor(p/k),M>f&&(k=Ti(M*k/f/u)*u),Ze(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===n?(v=Math.floor(p/k)*k,w=Math.ceil(g/k)*k):(v=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,k/1e3)?(M=Math.round(Math.min((r-o)/k,c)),k=(r-o)/M,v=o,w=r):x?(v=m?o:v,w=b?r:w,M=l-1,k=(w-v)/M):(M=(w-v)/k,M=Di(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(ji(k),ji(v));_=Math.pow(10,Ze(a)?S:a),v=Math.round(v*_)/_,w=Math.round(w*_)/_;let O=0;for(m&&(d&&v!==o?(i.push({value:o}),v<o&&O++,Di(Math.round((v+O*k)*_)/_,o,Qa(o,y,t))&&O++):v<o&&O++);O<M;++O){const t=Math.round((v+O*k)*_)/_;if(b&&t>r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&Di(i[i.length-1].value,r,Qa(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Li(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return pn(t,this.chart.options.locale,this.options.ticks.format)}}class tl extends Za{static id="linear";static defaults={ticks:{callback:mn.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ii(t)?t:0,this.max=ii(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ii(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const el=t=>Math.floor(Ci(t)),il=(t,e)=>Math.pow(10,el(t)+e);function nl(t){return 1==t/Math.pow(10,el(t))}function sl(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}class ol extends lr{static id="logarithmic";static defaults={ticks:{callback:mn.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Za.prototype.parse.apply(this,[t,e]);if(0!==i)return ii(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ii(t)?Math.max(0,t):null,this.max=ii(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ii(this._userMin)&&(this.min=t===il(this.min,0)?il(this.min,-1):il(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(il(i,-1)),o(il(n,1)))),i<=0&&s(il(n,-1)),n<=0&&o(il(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,{min:e,max:i}){e=ni(t.min,e);const n=[],s=el(e);let o=function(t,e){let i=el(e-t);for(;sl(t,e,i)>10;)i++;for(;sl(t,e,i)<10;)i--;return Math.min(i,el(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=ni(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u<i;)n.push({value:u,major:nl(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=ni(t.max,u);return n.push({value:f,major:nl(f),significand:d}),n}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Li(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":pn(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ci(t),this._valueRange=Ci(this.max)-Ci(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ci(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function rl(t){const e=t.ticks;if(e.display&&t.display){const t=Un(e.backdropPadding);return si(e.font&&e.font.size,wn.font.size)+t.height}return 0}function al(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:t<n||t>s?{start:e-i,end:e}:{start:e,end:e+i}}function ll(t,e,i,n,s){const o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let a=0,l=0;n.start<e.l?(a=(e.l-n.start)/o,t.l=Math.min(t.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.start<e.t?(l=(e.t-s.start)/r,t.t=Math.min(t.t,e.t-l)):s.end>e.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function cl(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(Fi(Vi(l.angle+Oi))),h=function(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}(l.y,a.h,c),d=function(t){return 0===t||180===t?"center":t<180?"left":"right"}(c),u=(f=l.x,p=a.w,"right"===(g=d)?f-=p:"center"===g&&(f-=p/2),f);var f,p,g;return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function hl(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(Cn({x:i,y:n},e)||Cn({x:i,y:o},e)||Cn({x:s,y:n},e)||Cn({x:s,y:o},e))}function dl(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!Ze(a)){const i=Hn(e.borderRadius),l=Un(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),jn(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ul(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,wi);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;o<n;o++)i=t.getPointPosition(o,e),s.lineTo(i.x,i.y)}}class fl extends Za{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:mn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=Un(rl(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ii(t)&&!isNaN(t)?t:0,this.max=ii(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/rl(this.options))}generateTickLabels(t){Za.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=ri(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?vi/o:0;for(let d=0;d<o;d++){const o=r.setContext(t.getPointLabelContext(d));s[d]=o.padding;const u=t.getPointPosition(d,t.drawingArea+s[d],a),f=$n(o.font),p=(l=t.ctx,c=f,h=ti(h=t._pointLabels[d])?h:[h],{w:kn(l,c.string,h),h:h.length*c.lineHeight});n[d]=p;const g=Vi(t.getIndexAngle(d)+a),m=Math.round(Fi(g));ll(i,e,g,al(m,u.x,p.w,0,180),al(m,u.y,p.h,90,270))}var l,c,h;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const n=[],s=t._pointLabels.length,o=t.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:rl(o)/2,additionalAngle:r?vi/s:0};let c;for(let o=0;o<s;o++){l.padding=i[o],l.size=e[o];const s=cl(t,o,l);n.push(s),"auto"===a&&(s.visible=hl(s,c),s.visible&&(c=s))}return n}(t,n,s)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return Vi(t*(wi/(this._pointLabels.length||1))+Ii(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(Ze(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Ze(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return Yn(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const n=this.getIndexAngle(t)-Oi+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),ul(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:s}=e,o=this._pointLabels.length;let r,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let s=e-1;s>=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));dl(i,o,e);const r=$n(o.font),{x:a,y:l,textAlign:c}=e;Fn(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ul(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}})),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=$n(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=Un(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}Fn(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})})),t.restore()}drawTitle(){}}const pl={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}},gl=Object.keys(pl);function ml(t,e){return t-e}function bl(t,e){if(Ze(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),ii(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!Ri(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function xl(t,e,i,n){const s=gl.length;for(let o=gl.indexOf(t);o<s-1;++o){const t=pl[gl[o]],s=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(s*t.size))<=n)return gl[o]}return gl[s-1]}function yl(t,e,i){if(i){if(i.length){const{lo:n,hi:s}=$i(i,e);t[i[n]>=e?i[n]:i[s]]=!0}}else t[e]=!0}function _l(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r<o;++r)a=e[r],s[a]=r,n.push({value:a,major:!1});return 0!==o&&i?function(t,e,i,n){const s=t._adapter,o=+s.startOf(e[0].value,n),r=e[e.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}(t,n,s,i):n}class vl extends lr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new bo(t.adapters.date);n.init(e),fi(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:bl(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=ii(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=ii(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;n<s&&t[n]<e;)n++;for(;s>n&&t[s-1]>i;)s--;return n>0||s<t.length?t.slice(n,s):t}(n,s,this.max);return this._unit=e.unit||(i.autoSkip?xl(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):function(t,e,i,n,s){for(let o=gl.length-1;o>=gl.indexOf(i);o--){const i=gl[o];if(pl[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return gl[i?gl.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=gl.indexOf(t)+1,i=gl.length;e<i;++e)if(pl[gl[e]].common)return gl[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&o.reverse(),_l(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=Hi(n,0,o),s=Hi(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||xl(s.minUnit,e,i,this._getLabelCapacity(e)),r=si(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=Ri(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h<i;h=+t.add(h,r,o),d++)yl(c,h,f);return h!==i&&"ticks"!==n.bounds&&1!==d||yl(c,h,f),Object.keys(c).sort(ml).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return ri(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=Ii(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(n),o=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:i*s+r*o,h:i*o+r*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,_l(this,[t],this._majorUnit),n),o=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(bl(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ji(t.sort(ml))}}function wl(t,e,i){let n,s,o,r,a=0,l=t.length-1;i?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=qi(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=qi(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var Ml=Object.freeze({__proto__:null,CategoryScale:class extends lr{static id="category";static defaults={ticks:{callback:Ga}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Ze(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Hi(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const s=t.indexOf(e);return-1===s?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):s!==t.lastIndexOf(e)?i:s}(i,t,si(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Ga.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:tl,LogarithmicScale:ol,RadialLinearScale:fl,TimeScale:vl,TimeSeriesScale:class extends vl{static id="timeseries";static defaults=vl.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=wl(e,this.min),this._tableRange=wl(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o<r;++o)l=t[o],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;o<r;++o)c=n[o+1],a=n[o-1],l=n[o],Math.round((c+a)/2)!==l&&s.push({time:l,pos:o/(r-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(wl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return wl(this._table,i*this._tableRange+this._minPos,!0)}}});const kl=[po,ea,Ja,Ml];jr.register(...kl);class Sl{selector;chart;chartData;http;entitySlug;consoleLogData=!1;lazyGetData=!1;fromDate;toDate;htmlElement=null;constructor(t,e,i,n,s=void 0){this.selector=t,this.fromDate=i,this.toDate=n,this.getHTMLElement(),s?this.chartData=s:this.startHttpClient(),this.entitySlug=e}getHTMLElement(){this.htmlElement=document.getElementById(this.selector)}getEndPoint(){return this.htmlElement.dataset.endpoint}getChartData(){if(!this.chartData&&this.htmlElement){let t={params:{fromDate:this.fromDate?this.fromDate:null,toDate:this.toDate?this.toDate:null}};this.http?.get(this.getEndPoint(),t).then((t=>{this.chartData=t.data,this.consoleLogData&&console.log(t),this.renderChart()}))}else this.renderChart()}startHttpClient(){this.http=_e.create({}),this.lazyGetData||this.getChartData()}renderChart(){}}class Ol extends Sl{renderChart(){if(this.chartData){let t=this.chartData.results.entity_name,e=this.chartData.results.pnl_data,i=Object.keys(e),n=i.map((t=>e[t].GROUP_INCOME)),s=i.map((t=>e[t].GROUP_EXPENSES)),o={labels:i,datasets:[{label:"Income",backgroundColor:"rgb(70,160,45)",borderColor:"rgb(115,255,99)",data:n},{label:"Expenses",backgroundColor:"rgb(231,46,75)",borderColor:"rgb(255, 99, 132)",data:s}]};const r=document.getElementById(this.selector);let a={plugins:{title:{display:!0,text:`${t} - Income & Expenses`,font:{size:20}},tooltip:{callbacks:{}}},aspectRatio:1,scales:{y:{beginAtZero:!0}}};this.chart=new jr(r,{type:"bar",data:o,options:a})}}}class El extends Sl{renderChart(){if(this.chartData){let t=this.chartData.results.net_payable_data,e=Object.keys(t),i=e.map((e=>t[e])),n={labels:e.map((t=>t.replace("_"," ").toUpperCase())),datasets:[{borderColor:"rgb(195,195,195)",borderWidth:.75,backgroundColor:["rgba(102, 24, 0, 1)","rgba(255, 95, 46, 1)","rgba(252, 190, 50, 1)","rgba(0,210,1,1)","rgba(225, 238, 246, 1)"],data:i}]};const s=document.getElementById(this.selector);let o={plugins:{title:{display:!0,position:"top",text:"Net Payables 0-90+ Days",font:{size:20}},tooltip:{callbacks:{}}},aspectRatio:1,scales:{y:{beginAtZero:!0}}};this.chart=new jr(s,{type:"doughnut",data:n,options:o})}}}class Pl extends Sl{renderChart(){if(this.chartData){let t=this.chartData.results.net_receivable_data,e=Object.keys(t),i=e.map((e=>t[e])),n={labels:e.map((t=>t.replace("_"," ").toUpperCase())),datasets:[{borderColor:"rgb(195,195,195)",borderWidth:.75,backgroundColor:["rgba(102, 24, 0, 1)","rgba(255, 95, 46, 1)","rgba(252, 190, 50, 1)","rgba(0,210,1,1)","rgba(225, 238, 246, 1)"],data:i}]};const s=document.getElementById(this.selector);let o={plugins:{title:{display:!0,position:"top",text:"Net Receivables 0-90+ Days",font:{size:20}},tooltip:{callbacks:{}}},aspectRatio:1,scales:{y:{beginAtZero:!0}}};this.chart=new jr(s,{type:"doughnut",data:n,options:o})}}}const Cl=Object.freeze({left:0,top:0,width:16,height:16}),Al=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Dl=Object.freeze({...Cl,...Al}),Tl=Object.freeze({...Dl,body:"",hidden:!1}),Rl=Object.freeze({width:null,height:null}),Ll=Object.freeze({...Rl,...Al}),Il=/[\s,]+/,Fl={...Ll,preserveAspectRatio:""};function jl(t){const e={...Fl},i=(e,i)=>t.getAttribute(e)||i;var n;return e.width=i("width",null),e.height=i("height",null),e.rotate=function(t,e=0){const i=t.replace(/^-?[0-9.]*/,"");function n(t){for(;t<0;)t+=4;return t%4}if(""===i){const e=parseInt(t);return isNaN(e)?0:n(e)}if(i!==t){let e=0;switch(i){case"%":e=25;break;case"deg":e=90}if(e){let s=parseFloat(t.slice(0,t.length-i.length));return isNaN(s)?0:(s/=e,s%1==0?n(s):0)}}return e}(i("rotate","")),n=e,i("flip","").split(Il).forEach((t=>{switch(t.trim()){case"horizontal":n.hFlip=!0;break;case"vertical":n.vFlip=!0}})),e.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),e}const zl=/^[a-z0-9]+(-[a-z0-9]+)*$/,Nl=(t,e,i,n="")=>{const s=t.split(":");if("@"===t.slice(0,1)){if(s.length<2||s.length>3)return null;n=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const t=s.pop(),i=s.pop(),o={provider:s.length>0?s[0]:n,prefix:i,name:t};return e&&!Bl(o)?null:o}const o=s[0],r=o.split("-");if(r.length>1){const t={provider:n,prefix:r.shift(),name:r.join("-")};return e&&!Bl(t)?null:t}if(i&&""===n){const t={provider:n,prefix:"",name:o};return e&&!Bl(t,i)?null:t}return null},Bl=(t,e)=>!!t&&!(!(e&&""===t.prefix||t.prefix)||!t.name);function Vl(t,e){const i=function(t,e){const i={};!t.hFlip!=!e.hFlip&&(i.hFlip=!0),!t.vFlip!=!e.vFlip&&(i.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(i.rotate=n),i}(t,e);for(const n in Tl)n in Al?n in t&&!(n in i)&&(i[n]=Al[n]):n in e?i[n]=e[n]:n in t&&(i[n]=t[n]);return i}function Wl(t,e,i){const n=t.icons,s=t.aliases||Object.create(null);let o={};function r(t){o=Vl(n[t]||s[t],o)}return r(e),i.forEach(r),Vl(t,o)}function Hl(t,e){const i=[];if("object"!=typeof t||"object"!=typeof t.icons)return i;t.not_found instanceof Array&&t.not_found.forEach((t=>{e(t,null),i.push(t)}));const n=function(t){const e=t.icons,i=t.aliases||Object.create(null),n=Object.create(null);return Object.keys(e).concat(Object.keys(i)).forEach((function t(s){if(e[s])return n[s]=[];if(!(s in n)){n[s]=null;const e=i[s]&&i[s].parent,o=e&&t(e);o&&(n[s]=[e].concat(o))}return n[s]})),n}(t);for(const s in n){const o=n[s];o&&(e(s,Wl(t,s,o)),i.push(s))}return i}const Ul={provider:"",aliases:{},not_found:{},...Cl};function $l(t,e){for(const i in e)if(i in t&&typeof t[i]!=typeof e[i])return!1;return!0}function ql(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons)return null;if(!$l(t,Ul))return null;const i=e.icons;for(const t in i){const e=i[t];if(!t||"string"!=typeof e.body||!$l(e,Tl))return null}const n=e.aliases||Object.create(null);for(const t in n){const e=n[t],s=e.parent;if(!t||"string"!=typeof s||!i[s]&&!n[s]||!$l(e,Tl))return null}return e}const Yl=Object.create(null);function Xl(t,e){const i=Yl[t]||(Yl[t]=Object.create(null));return i[e]||(i[e]=function(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}(t,e))}function Kl(t,e){return ql(e)?Hl(e,((e,i)=>{i?t.icons[e]=i:t.missing.add(e)})):[]}function Jl(t,e){let i=[];return("string"==typeof t?[t]:Object.keys(Yl)).forEach((t=>{("string"==typeof t&&"string"==typeof e?[e]:Object.keys(Yl[t]||{})).forEach((e=>{const n=Xl(t,e);i=i.concat(Object.keys(n.icons).map((i=>(""!==t?"@"+t+":":"")+e+":"+i)))}))})),i}let Gl=!1;function Ql(t){return"boolean"==typeof t&&(Gl=t),Gl}function Zl(t){const e="string"==typeof t?Nl(t,!0,Gl):t;if(e){const t=Xl(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function tc(t,e){const i=Nl(t,!0,Gl);if(!i)return!1;const n=Xl(i.provider,i.prefix);return e?function(t,e,i){try{if("string"==typeof i.body)return t.icons[e]={...i},!0}catch(t){}return!1}(n,i.name,e):(n.missing.add(i.name),!0)}function ec(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e=t.provider||""),Gl&&!e&&!t.prefix){let e=!1;return ql(t)&&(t.prefix="",Hl(t,((t,i)=>{tc(t,i)&&(e=!0)}))),e}const i=t.prefix;return!!Bl({provider:e,prefix:i,name:"a"})&&!!Kl(Xl(e,i),t)}function ic(t){return!!Zl(t)}function nc(t){const e=Zl(t);return e?{...Dl,...e}:e}function sc(t,e){t.forEach((t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter((t=>t.id!==e)))}))}let oc=0;const rc=Object.create(null);function ac(t,e){rc[t]=e}function lc(t){return rc[t]||rc[""]}var cc={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function hc(t){const e={...cc,...t};let i=[];function n(){i=i.filter((t=>"pending"===t().status))}const s={query:function(t,s,o){const r=function(t,e,i,n){const s=t.resources.length,o=t.random?Math.floor(Math.random()*s):t.index;let r;if(t.random){let e=t.resources.slice(0);for(r=[];e.length>1;){const t=Math.floor(Math.random()*e.length);r.push(e[t]),e=e.slice(0,t).concat(e.slice(t+1))}r=r.concat(e)}else r=t.resources.slice(o).concat(t.resources.slice(0,o));const a=Date.now();let l,c="pending",h=0,d=null,u=[],f=[];function p(){d&&(clearTimeout(d),d=null)}function g(){"pending"===c&&(c="aborted"),p(),u.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),u=[]}function m(t,e){e&&(f=[]),"function"==typeof t&&f.push(t)}function b(){c="failed",f.forEach((t=>{t(void 0,l)}))}function x(){u.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),u=[]}return"function"==typeof n&&f.push(n),setTimeout((function n(){if("pending"!==c)return;p();const s=r.shift();if(void 0===s)return u.length?void(d=setTimeout((()=>{p(),"pending"===c&&(x(),b())}),t.timeout)):void b();const o={status:"pending",resource:s,callback:(e,i)=>{!function(e,i,s){const o="success"!==i;switch(u=u.filter((t=>t!==e)),c){case"pending":break;case"failed":if(o||!t.dataAfterTimeout)return;break;default:return}if("abort"===i)return l=s,void b();if(o)return l=s,void(u.length||(r.length?n():b()));if(p(),x(),!t.random){const i=t.resources.indexOf(e.resource);-1!==i&&i!==t.index&&(t.index=i)}c="completed",f.forEach((t=>{t(s)}))}(o,e,i)}};u.push(o),h++,d=setTimeout(n,t.rotate),i(s,e,o.callback)})),function(){return{startTime:a,payload:e,status:c,queriesSent:h,queriesPending:u.length,subscribe:m,abort:g}}}(e,t,s,((t,e)=>{n(),o&&o(t,e)}));return i.push(r),r},find:function(t){return i.find((e=>t(e)))||null},setIndex:t=>{e.index=t},getIndex:()=>e.index,cleanup:n};return s}function dc(t){let e;if("string"==typeof t.resources)e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:!0===t.random,index:t.index||0,dataAfterTimeout:!1!==t.dataAfterTimeout}}const uc=Object.create(null),fc=["https://api.simplesvg.com","https://api.unisvg.com"],pc=[];for(;fc.length>0;)1===fc.length||Math.random()>.5?pc.push(fc.shift()):pc.push(fc.pop());function gc(t,e){const i=dc(e);return null!==i&&(uc[t]=i,!0)}function mc(t){return uc[t]}function bc(){return Object.keys(uc)}function xc(){}uc[""]=dc({resources:["https://api.iconify.design"].concat(pc)});const yc=Object.create(null);function _c(t,e,i){let n,s;if("string"==typeof t){const e=lc(t);if(!e)return i(void 0,424),xc;s=e.send;const o=function(t){if(!yc[t]){const e=mc(t);if(!e)return;const i={config:e,redundancy:hc(e)};yc[t]=i}return yc[t]}(t);o&&(n=o.redundancy)}else{const e=dc(t);if(e){n=hc(e);const i=lc(t.resources?t.resources[0]:"");i&&(s=i.send)}}return n&&s?n.query(e,s,i)().abort:(i(void 0,424),xc)}function vc(){}function wc(t,e,i){function n(){const i=t.pendingIcons;e.forEach((e=>{i&&i.delete(e),t.icons[e]||t.missing.add(e)}))}if(i&&"object"==typeof i)try{if(!Kl(t,i).length)return void n()}catch(t){console.error(t)}n(),function(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout((()=>{t.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout((()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let i=!1;const n=t.provider,s=t.prefix;e.forEach((e=>{const o=e.icons,r=o.pending.length;o.pending=o.pending.filter((e=>{if(e.prefix!==s)return!0;const r=e.name;if(t.icons[r])o.loaded.push({provider:n,prefix:s,name:r});else{if(!t.missing.has(r))return i=!0,!0;o.missing.push({provider:n,prefix:s,name:r})}return!1})),o.pending.length!==r&&(i||sc([t],e.id),e.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),e.abort))}))})))}(t)})))}(t)}function Mc(t,e){t instanceof Promise?t.then((t=>{e(t)})).catch((()=>{e(null)})):e(t)}const kc=(t,e)=>{const i=function(t,e=!0,i=!1){const n=[];return t.forEach((t=>{const s="string"==typeof t?Nl(t,e,i):t;s&&n.push(s)})),n}(t,!0,Ql()),n=function(t){const e={loaded:[],missing:[],pending:[]},i=Object.create(null);t.sort(((t,e)=>t.provider!==e.provider?t.provider.localeCompare(e.provider):t.prefix!==e.prefix?t.prefix.localeCompare(e.prefix):t.name.localeCompare(e.name)));let n={provider:"",prefix:"",name:""};return t.forEach((t=>{if(n.name===t.name&&n.prefix===t.prefix&&n.provider===t.provider)return;n=t;const s=t.provider,o=t.prefix,r=t.name,a=i[s]||(i[s]=Object.create(null)),l=a[o]||(a[o]=Xl(s,o));let c;c=r in l.icons?e.loaded:""===o||l.missing.has(r)?e.missing:e.pending;const h={provider:s,prefix:o,name:r};c.push(h)})),e}(i);if(!n.pending.length){let t=!0;return e&&setTimeout((()=>{t&&e(n.loaded,n.missing,n.pending,vc)})),()=>{t=!1}}const s=Object.create(null),o=[];let r,a;return n.pending.forEach((t=>{const{provider:e,prefix:i}=t;if(i===a&&e===r)return;r=e,a=i,o.push(Xl(e,i));const n=s[e]||(s[e]=Object.create(null));n[i]||(n[i]=[])})),n.pending.forEach((t=>{const{provider:e,prefix:i,name:n}=t,o=Xl(e,i),r=o.pendingIcons||(o.pendingIcons=new Set);r.has(n)||(r.add(n),s[e][i].push(n))})),o.forEach((t=>{const e=s[t.provider][t.prefix];e.length&&function(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout((()=>{t.iconsQueueFlag=!1;const{provider:e,prefix:i}=t,n=t.iconsToLoad;if(delete t.iconsToLoad,!n||!n.length)return;const s=t.loadIcon;if(t.loadIcons&&(n.length>1||!s))return void Mc(t.loadIcons(n,i,e),(e=>{wc(t,n,e)}));if(s)return void n.forEach((n=>{Mc(s(n,i,e),(e=>{wc(t,[n],e?{prefix:i,icons:{[n]:e}}:null)}))}));const{valid:o,invalid:r}=function(t){const e=[],i=[];return t.forEach((t=>{(t.match(zl)?e:i).push(t)})),{valid:e,invalid:i}}(n);if(r.length&&wc(t,r,null),!o.length)return;const a=i.match(zl)?lc(e):null;a?a.prepare(e,i,o).forEach((i=>{_c(e,i,(e=>{wc(t,i.icons,e)}))})):wc(t,o,null)})))}(t,e)})),e?function(t,e,i){const n=oc++,s=sc.bind(null,i,n);if(!e.pending.length)return s;const o={id:n,icons:e,callback:t,abort:s};return i.forEach((t=>{(t.loaderCallbacks||(t.loaderCallbacks=[])).push(o)})),s}(e,n,o):vc},Sc=t=>new Promise(((e,i)=>{const n="string"==typeof t?Nl(t,!0):t;n?kc([n||t],(s=>{if(s.length&&n){const t=Zl(n);if(t)return void e({...Dl,...t})}i(t)})):i(t)}));function Oc(t){try{const e="string"==typeof t?JSON.parse(t):t;if("string"==typeof e.body)return{...e}}catch(t){}}let Ec=!1;try{Ec=0===navigator.vendor.indexOf("Apple")}catch(t){}const Pc=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Cc=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ac(t,e,i){if(1===e)return t;if(i=i||100,"number"==typeof t)return Math.ceil(t*e*i)/i;if("string"!=typeof t)return t;const n=t.split(Pc);if(null===n||!n.length)return t;const s=[];let o=n.shift(),r=Cc.test(o);for(;;){if(r){const t=parseFloat(o);isNaN(t)?s.push(o):s.push(Math.ceil(t*e*i)/i)}else s.push(o);if(o=n.shift(),void 0===o)return s.join("");r=!r}}function Dc(t,e){const i={...Dl,...t},n={...Ll,...e},s={left:i.left,top:i.top,width:i.width,height:i.height};let o=i.body;[i,n].forEach((t=>{const e=[],i=t.hFlip,n=t.vFlip;let r,a=t.rotate;switch(i?n?a+=2:(e.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),e.push("scale(-1 1)"),s.top=s.left=0):n&&(e.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),e.push("scale(1 -1)"),s.top=s.left=0),a<0&&(a-=4*Math.floor(a/4)),a%=4,a){case 1:r=s.height/2+s.top,e.unshift("rotate(90 "+r.toString()+" "+r.toString()+")");break;case 2:e.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:r=s.width/2+s.left,e.unshift("rotate(-90 "+r.toString()+" "+r.toString()+")")}a%2==1&&(s.left!==s.top&&(r=s.left,s.left=s.top,s.top=r),s.width!==s.height&&(r=s.width,s.width=s.height,s.height=r)),e.length&&(o=function(t,e){const i=function(t,e="defs"){let i="";const n=t.indexOf("<"+e);for(;n>=0;){const s=t.indexOf(">",n),o=t.indexOf("</"+e);if(-1===s||-1===o)break;const r=t.indexOf(">",o);if(-1===r)break;i+=t.slice(s+1,o).trim(),t=t.slice(0,n).trim()+t.slice(r+1)}return{defs:i,content:t}}(t);return n=i.defs,s=e+i.content+"</g>",n?"<defs>"+n+"</defs>"+s:s;var n,s}(o,'<g transform="'+e.join(" ")+'">'))}));const r=n.width,a=n.height,l=s.width,c=s.height;let h,d;null===r?(d=null===a?"1em":"auto"===a?c:a,h=Ac(d,l/c)):(h="auto"===r?l:r,d=null===a?Ac(h,c/l):"auto"===a?c:a);const u={},f=(t,e)=>{(t=>"unset"===t||"undefined"===t||"none"===t)(e)||(u[t]=e.toString())};f("width",h),f("height",d);const p=[s.left,s.top,l,c];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:o}}function Tc(t,e){let i=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const t in e)i+=" "+t+'="'+e[t]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+i+">"+t+"</svg>"}function Rc(t){return'url("'+function(t){return"data:image/svg+xml,"+function(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(t)}(t)+'")'}let Lc=(()=>{let t;try{if(t=fetch,"function"==typeof t)return t}catch(t){}})();function Ic(t){Lc=t}function Fc(){return Lc}const jc={prepare:(t,e,i)=>{const n=[],s=function(t,e){const i=mc(t);if(!i)return 0;let n;if(i.maxURL){let t=0;i.resources.forEach((e=>{const i=e;t=Math.max(t,i.length)}));const s=e+".json?icons=";n=i.maxURL-t-i.path.length-s.length}else n=0;return n}(t,e),o="icons";let r={type:o,provider:t,prefix:e,icons:[]},a=0;return i.forEach(((i,l)=>{a+=i.length+1,a>=s&&l>0&&(n.push(r),r={type:o,provider:t,prefix:e,icons:[]},a=i.length),r.icons.push(i)})),n.push(r),n},send:(t,e,i)=>{if(!Lc)return void i("abort",424);let n=function(t){if("string"==typeof t){const e=mc(t);if(e)return e.path}return"/"}(e.provider);switch(e.type){case"icons":{const t=e.prefix,i=e.icons.join(",");n+=t+".json?"+new URLSearchParams({icons:i}).toString();break}case"custom":{const t=e.uri;n+="/"===t.slice(0,1)?t.slice(1):t;break}default:return void i("abort",400)}let s=503;Lc(t+n).then((t=>{const e=t.status;if(200===e)return s=501,t.json();setTimeout((()=>{i(function(t){return 404===t}(e)?"abort":"next",e)}))})).then((t=>{"object"==typeof t&&null!==t?setTimeout((()=>{i("success",t)})):setTimeout((()=>{404===t?i("abort",t):i("next",s)}))})).catch((()=>{i("next",s)}))}};function zc(t,e,i){Xl(i||"",e).loadIcons=t}function Nc(t,e,i){Xl(i||"",e).loadIcon=t}const Bc="data-style";let Vc="";function Wc(t){Vc=t}function Hc(t,e){let i=Array.from(t.childNodes).find((t=>t.hasAttribute&&t.hasAttribute(Bc)));i||(i=document.createElement("style"),i.setAttribute(Bc,Bc),t.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block;margin:auto}"+Vc}function Uc(){let t;ac("",jc),Ql(!0);try{t=window}catch(t){}if(t){if(void 0!==t.IconifyPreload){const e=t.IconifyPreload,i="Invalid IconifyPreload syntax.";"object"==typeof e&&null!==e&&(e instanceof Array?e:[e]).forEach((t=>{try{("object"!=typeof t||null===t||t instanceof Array||"object"!=typeof t.icons||"string"!=typeof t.prefix||!ec(t))&&console.error(i)}catch(t){console.error(i)}}))}if(void 0!==t.IconifyProviders){const e=t.IconifyProviders;if("object"==typeof e&&null!==e)for(const t in e){const i="IconifyProviders["+t+"] is invalid.";try{const n=e[t];if("object"!=typeof n||!n||void 0===n.resources)continue;gc(t,n)||console.error(i)}catch(t){console.error(i)}}}}return{enableCache:t=>{},disableCache:t=>{},iconLoaded:ic,iconExists:ic,getIcon:nc,listIcons:Jl,addIcon:tc,addCollection:ec,calculateSize:Ac,buildIcon:Dc,iconToHTML:Tc,svgToURL:Rc,loadIcons:kc,loadIcon:Sc,addAPIProvider:gc,setCustomIconLoader:Nc,setCustomIconsLoader:zc,appendCustomStyle:Wc,_api:{getAPIConfig:mc,setAPIModule:ac,sendAPIQuery:_c,setFetch:Ic,getFetch:Fc,listAPIProviders:bc}}}const $c={"background-color":"currentColor"},qc={"background-color":"transparent"},Yc={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Xc={"-webkit-mask":$c,mask:$c,background:qc};for(const t in Xc){const e=Xc[t];for(const i in Yc)e[t+"-"+i]=Yc[i]}function Kc(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}let Jc;function Gc(t){return Array.from(t.childNodes).find((t=>{const e=t.tagName&&t.tagName.toUpperCase();return"SPAN"===e||"SVG"===e}))}function Qc(t,e){const i=e.icon.data,n=e.customisations,s=Dc(i,n);n.preserveAspectRatio&&(s.attributes.preserveAspectRatio=n.preserveAspectRatio);const o=e.renderedMode;let r;r="svg"===o?function(t){const e=document.createElement("span"),i=t.attributes;let n="";i.width||(n="width: inherit;"),i.height||(n+="height: inherit;"),n&&(i.style=n);const s=Tc(t.body,i);return e.innerHTML=function(t){return void 0===Jc&&function(){try{Jc=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch(t){Jc=null}}(),Jc?Jc.createHTML(t):t}(s),e.firstChild}(s):function(t,e,i){const n=document.createElement("span");let s=t.body;-1!==s.indexOf("<a")&&(s+="\x3c!-- "+Date.now()+" --\x3e");const o=t.attributes,r=Rc(Tc(s,{...o,width:e.width+"",height:e.height+""})),a=n.style,l={"--svg":r,width:Kc(o.width),height:Kc(o.height),...i?$c:qc};for(const t in l)a.setProperty(t,l[t]);return n}(s,{...Dl,...i},"mask"===o);const a=Gc(t);a?"SPAN"===r.tagName&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):t.replaceChild(r,a):t.appendChild(r)}function Zc(t,e,i){return{rendered:!1,inline:e,icon:t,lastRender:i&&(i.rendered?i:i.lastRender)}}const th=function(t="iconify-icon"){let e,i;try{e=window.customElements,i=window.HTMLElement}catch(t){return}if(!e||!i)return;const n=e.get(t);if(n)return n;const s=["icon","mode","inline","noobserver","width","height","rotate","flip"],o=class extends i{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();const t=this._shadowRoot=this.attachShadow({mode:"open"}),e=this.hasAttribute("inline");Hc(t,e),this._state=Zc({value:""},e),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return s.slice(0)}attributeChangedCallback(t){switch(t){case"inline":{const t=this.hasAttribute("inline"),e=this._state;t!==e.inline&&(e.inline=t,Hc(this._shadowRoot,t));break}case"noobserver":this.hasAttribute("noobserver")?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){const t=this.getAttribute("icon");if(t&&"{"===t.slice(0,1))try{return JSON.parse(t)}catch(t){}return t}set icon(t){"object"==typeof t&&(t=JSON.stringify(t)),this.setAttribute("icon",t)}get inline(){return this.hasAttribute("inline")}set inline(t){t?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(t){t?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const t=this._state;if(t.rendered){const e=this._shadowRoot;if("svg"===t.renderedMode)try{return void e.lastChild.setCurrentTime(0)}catch(t){}Qc(e,t)}}get status(){const t=this._state;return t.rendered?"rendered":null===t.icon.data?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout((()=>{this._check()})))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const t=this._state,e=this.getAttribute("icon");if(e!==t.icon.value)return void this._iconChanged(e);if(!t.rendered||!this._visible)return;const i=this.getAttribute("mode"),n=jl(this);t.attrMode===i&&!function(t,e){for(const i in Fl)if(t[i]!==e[i])return!0;return!1}(t.customisations,n)&&Gc(this._shadowRoot)||this._renderIcon(t.icon,n,i)}_iconChanged(t){const e=function(t,e){if("object"==typeof t)return{data:Oc(t),value:t};if("string"!=typeof t)return{value:t};if(t.includes("{")){const e=Oc(t);if(e)return{data:e,value:t}}const i=Nl(t,!0,!0);if(!i)return{value:t};const n=Zl(i);if(void 0!==n||!i.prefix)return{value:t,name:i,data:n};const s=kc([i],(()=>e(t,i,Zl(i))));return{value:t,name:i,loading:s}}(t,((t,e,i)=>{const n=this._state;if(n.rendered||this.getAttribute("icon")!==t)return;const s={value:t,name:e,data:i};s.data?this._gotIconData(s):n.icon=s}));e.data?this._gotIconData(e):this._state=Zc(e,this._state.inline,this._state)}_forceRender(){if(this._visible)this._queueCheck();else{const t=Gc(this._shadowRoot);t&&this._shadowRoot.removeChild(t)}}_gotIconData(t){this._checkQueued=!1,this._renderIcon(t,jl(this),this.getAttribute("mode"))}_renderIcon(t,e,i){const n=function(t,e){switch(e){case"svg":case"bg":case"mask":return e}return"style"===e||!Ec&&-1!==t.indexOf("<a")?-1===t.indexOf("currentColor")?"bg":"mask":"svg"}(t.data.body,i),s=this._state.inline;Qc(this._shadowRoot,this._state={rendered:!0,icon:t,inline:s,customisations:e,attrMode:i,renderedMode:n})}startObserver(){if(!this._observer&&!this.hasAttribute("noobserver"))try{this._observer=new IntersectionObserver((t=>{const e=t.some((t=>t.isIntersecting));e!==this._visible&&(this._visible=e,this._forceRender())})),this._observer.observe(this)}catch(t){if(this._observer){try{this._observer.disconnect()}catch(t){}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};s.forEach((t=>{t in o.prototype||Object.defineProperty(o.prototype,t,{get:function(){return this.getAttribute(t)},set:function(e){null!==e?this.setAttribute(t,e):this.removeAttribute(t)}})}));const r=Uc();for(const t in r)o[t]=o.prototype[t]=r[t];return e.define(t,o),o}()||Uc(),{enableCache:eh,disableCache:ih,iconLoaded:nh,iconExists:sh,getIcon:oh,listIcons:rh,addIcon:ah,addCollection:lh,calculateSize:ch,buildIcon:hh,iconToHTML:dh,svgToURL:uh,loadIcons:fh,loadIcon:ph,setCustomIconLoader:gh,setCustomIconsLoader:mh,addAPIProvider:bh,_api:xh}=th;function yh(t,e,i,n){return new Ol(t,e,i,n)}function _h(t,e,i,n){return new El(t,e,i,n)}function vh(t,e,i,n){return new Pl(t,e,i,n)}function wh(t){let e=document.getElementById(t);e&&e.classList.add("is-active","is-clipped")}function Mh(t){let e=document.getElementById(t);e&&e.classList.remove("is-active","is-clipped")}function kh(t){let e=document.getElementById(t);e&&(e.classList.toggle("is-active"),e.classList.toggle("is-clipped"))}function Sh(t,e){let i=document.forms.namedItem(t);i&&(i.submit(),e&&Mh(e))}function Oh(t){let e=document.getElementById(t);e&&(e.classList.contains("is-active")?e.classList.remove("is-active"):e.classList.add("is-active"))}new class{dateFilters=null;endDateFilters=null;constructor(){document.addEventListener("DOMContentLoaded",(()=>{(document.querySelectorAll(".notification .delete")||[]).forEach((t=>{let e;e=t.parentNode,t.addEventListener("click",(()=>{e.parentNode.removeChild(e)}))}))})),document.addEventListener("DOMContentLoaded",(()=>{const t=Array.prototype.slice.call(document.querySelectorAll(".navbar-burger"),0);t.length>0&&t.forEach((t=>{t.addEventListener("click",(()=>{const e=t.dataset.target,i=document.getElementById(e);t.classList.toggle("is-active"),i.classList.toggle("is-active")}))}))})),document.addEventListener("DOMContentLoaded",(()=>{(document.querySelectorAll(".djetler-set-entity-form-input")||[]).forEach((t=>{t.addEventListener("change",this.setEntityFilter)}))}))}getFlatPickrOptions(t=!1){return t?{wrap:!t,inline:t,onChange:(t,e,i)=>{let n=i._input.classList[1].split("-")[5];document.getElementById("djetler-end-date-icon-filter-form-"+n).submit()}}:{wrap:!t,inline:t,onChange:(t,e,i)=>{let n=i._input.classList[1].split("-")[5];document.getElementById("djetler-end-date-icon-filter-form-"+n).submit()}}}setEntityFilter(t){let e=t.target;if(e){let t=e.classList[2].split("-")[4],i=document.getElementById("djetler-set-entity-form-"+t);i&&i.submit()}}},djLedger=e})();
|
|
2
|
+
var djLedger;(()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{closeModal:()=>Tl,renderNetPayablesChart:()=>Dl,renderNetReceivablesChart:()=>Cl,renderPnLChart:()=>El,showModal:()=>Al,submitForm:()=>Ll,toggleDropdown:()=>Il,toggleModal:()=>Rl});var i={};function s(t,e){return function(){return t.apply(e,arguments)}}t.r(i),t.d(i,{hasBrowserEnv:()=>ut,hasStandardBrowserEnv:()=>pt,hasStandardBrowserWebWorkerEnv:()=>gt,navigator:()=>ft,origin:()=>mt});const{toString:n}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:r,toStringTag:a}=Symbol,l=(h=Object.create(null),t=>{const e=n.call(t);return h[e]||(h[e]=e.slice(8,-1).toLowerCase())});var h;const c=t=>(t=t.toLowerCase(),e=>l(e)===t),d=t=>e=>typeof e===t,{isArray:u}=Array,f=d("undefined");function p(t){return null!==t&&!f(t)&&null!==t.constructor&&!f(t.constructor)&&b(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const g=c("ArrayBuffer"),m=d("string"),b=d("function"),x=d("number"),y=t=>null!==t&&"object"==typeof t,_=t=>{if("object"!==l(t))return!1;const e=o(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||a in t||r in t)},v=c("Date"),w=c("File"),M=c("Blob"),k=c("FileList"),S=c("URLSearchParams"),[O,P,E,D]=["ReadableStream","Request","Response","Headers"].map(c);function C(t,e,{allOwnKeys:i=!1}={}){if(null==t)return;let s,n;if("object"!=typeof t&&(t=[t]),u(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{if(p(t))return;const n=i?Object.getOwnPropertyNames(t):Object.keys(t),o=n.length;let r;for(s=0;s<o;s++)r=n[s],e.call(null,t[r],r,t)}}function A(t,e){if(p(t))return null;e=e.toLowerCase();const i=Object.keys(t);let s,n=i.length;for(;n-- >0;)if(s=i[n],e===s.toLowerCase())return s;return null}const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,R=t=>!f(t)&&t!==T,L=(I="undefined"!=typeof Uint8Array&&o(Uint8Array),t=>I&&t instanceof I);var I;const F=c("HTMLFormElement"),z=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),N=c("RegExp"),B=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),s={};C(i,((i,n)=>{let o;!1!==(o=e(i,n,t))&&(s[n]=o||i)})),Object.defineProperties(t,s)},j=c("AsyncFunction"),V=(W="function"==typeof setImmediate,H=b(T.postMessage),W?setImmediate:H?(U=`axios@${Math.random()}`,$=[],T.addEventListener("message",(({source:t,data:e})=>{t===T&&e===U&&$.length&&$.shift()()}),!1),t=>{$.push(t),T.postMessage(U,"*")}):t=>setTimeout(t));var W,H,U,$;const q="undefined"!=typeof queueMicrotask?queueMicrotask.bind(T):"undefined"!=typeof process&&process.nextTick||V,Y={isArray:u,isArrayBuffer:g,isBuffer:p,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||b(t.append)&&("formdata"===(e=l(t))||"object"===e&&b(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&g(t.buffer),e},isString:m,isNumber:x,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:_,isEmptyObject:t=>{if(!y(t)||p(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:O,isRequest:P,isResponse:E,isHeaders:D,isUndefined:f,isDate:v,isFile:w,isBlob:M,isRegExp:N,isFunction:b,isStream:t=>y(t)&&b(t.pipe),isURLSearchParams:S,isTypedArray:L,isFileList:k,forEach:C,merge:function t(){const{caseless:e,skipUndefined:i}=R(this)&&this||{},s={},n=(n,o)=>{const r=e&&A(s,o)||o;_(s[r])&&_(n)?s[r]=t(s[r],n):_(n)?s[r]=t({},n):u(n)?s[r]=n.slice():i&&f(n)||(s[r]=n)};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&C(arguments[t],n);return s},extend:(t,e,i,{allOwnKeys:n}={})=>(C(e,((e,n)=>{i&&b(e)?t[n]=s(e,i):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,i,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,e,i,s)=>{let n,r,a;const l={};if(e=e||{},null==t)return e;do{for(n=Object.getOwnPropertyNames(t),r=n.length;r-- >0;)a=n[r],s&&!s(a,t,e)||l[a]||(e[a]=t[a],l[a]=!0);t=!1!==i&&o(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:l,kindOfTest:c,endsWith:(t,e,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;const s=t.indexOf(e,i);return-1!==s&&s===i},toArray:t=>{if(!t)return null;if(u(t))return t;let e=t.length;if(!x(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},forEachEntry:(t,e)=>{const i=(t&&t[r]).call(t);let s;for(;(s=i.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},matchAll:(t,e)=>{let i;const s=[];for(;null!==(i=t.exec(e));)s.push(i);return s},isHTMLForm:F,hasOwnProperty:z,hasOwnProp:z,reduceDescriptors:B,freezeMethods:t=>{B(t,((e,i)=>{if(b(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const s=t[i];b(s)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(t,e)=>{const i={},s=t=>{t.forEach((t=>{i[t]=!0}))};return u(t)?s(t):s(String(t).split(e)),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,i){return e.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:A,global:T,isContextDefined:R,isSpecCompliantForm:function(t){return!!(t&&b(t.append)&&"FormData"===t[a]&&t[r])},toJSONObject:t=>{const e=new Array(10),i=(t,s)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(p(t))return t;if(!("toJSON"in t)){e[s]=t;const n=u(t)?[]:{};return C(t,((t,e)=>{const o=i(t,s+1);!f(o)&&(n[e]=o)})),e[s]=void 0,n}}return t};return i(t,0)},isAsyncFn:j,isThenable:t=>t&&(y(t)||b(t))&&b(t.then)&&b(t.catch),setImmediate:V,asap:q,isIterable:t=>null!=t&&b(t[r])};function X(t,e,i,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),s&&(this.request=s),n&&(this.response=n,this.status=n.status?n.status:null)}Y.inherits(X,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.status}}});const K=X.prototype,J={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{J[t]={value:t}})),Object.defineProperties(X,J),Object.defineProperty(K,"isAxiosError",{value:!0}),X.from=(t,e,i,s,n,o)=>{const r=Object.create(K);Y.toFlatObject(t,r,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t));const a=t&&t.message?t.message:"Error",l=null==e&&t?t.code:e;return X.call(r,a,l,i,s,n),t&&null==r.cause&&Object.defineProperty(r,"cause",{value:t,configurable:!0}),r.name=t&&t.name||"Error",o&&Object.assign(r,o),r};const G=X;function Z(t){return Y.isPlainObject(t)||Y.isArray(t)}function Q(t){return Y.endsWith(t,"[]")?t.slice(0,-2):t}function tt(t,e,i){return t?t.concat(e).map((function(t,e){return t=Q(t),!i&&e?"["+t+"]":t})).join(i?".":""):e}const et=Y.toFlatObject(Y,{},null,(function(t){return/^is[A-Z]/.test(t)})),it=function(t,e,i){if(!Y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const s=(i=Y.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Y.isUndefined(e[t])}))).metaTokens,n=i.visitor||h,o=i.dots,r=i.indexes,a=(i.Blob||"undefined"!=typeof Blob&&Blob)&&Y.isSpecCompliantForm(e);if(!Y.isFunction(n))throw new TypeError("visitor must be a function");function l(t){if(null===t)return"";if(Y.isDate(t))return t.toISOString();if(Y.isBoolean(t))return t.toString();if(!a&&Y.isBlob(t))throw new G("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(t)||Y.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function h(t,i,n){let a=t;if(t&&!n&&"object"==typeof t)if(Y.endsWith(i,"{}"))i=s?i:i.slice(0,-2),t=JSON.stringify(t);else if(Y.isArray(t)&&function(t){return Y.isArray(t)&&!t.some(Z)}(t)||(Y.isFileList(t)||Y.endsWith(i,"[]"))&&(a=Y.toArray(t)))return i=Q(i),a.forEach((function(t,s){!Y.isUndefined(t)&&null!==t&&e.append(!0===r?tt([i],s,o):null===r?i:i+"[]",l(t))})),!1;return!!Z(t)||(e.append(tt(n,i,o),l(t)),!1)}const c=[],d=Object.assign(et,{defaultVisitor:h,convertValue:l,isVisitable:Z});if(!Y.isObject(t))throw new TypeError("data must be an object");return function t(i,s){if(!Y.isUndefined(i)){if(-1!==c.indexOf(i))throw Error("Circular reference detected in "+s.join("."));c.push(i),Y.forEach(i,(function(i,o){!0===(!(Y.isUndefined(i)||null===i)&&n.call(e,i,Y.isString(o)?o.trim():o,s,d))&&t(i,s?s.concat(o):[o])})),c.pop()}}(t),e};function st(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function nt(t,e){this._pairs=[],t&&it(t,this,e)}const ot=nt.prototype;ot.append=function(t,e){this._pairs.push([t,e])},ot.toString=function(t){const e=t?function(e){return t.call(this,e,st)}:st;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const rt=nt;function at(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function lt(t,e,i){if(!e)return t;const s=i&&i.encode||at;Y.isFunction(i)&&(i={serialize:i});const n=i&&i.serialize;let o;if(o=n?n(e,i):Y.isURLSearchParams(e)?e.toString():new rt(e,i).toString(s),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}const ht=class{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Y.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:rt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ut="undefined"!=typeof window&&"undefined"!=typeof document,ft="object"==typeof navigator&&navigator||void 0,pt=ut&&(!ft||["ReactNative","NativeScript","NS"].indexOf(ft.product)<0),gt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mt=ut&&window.location.href||"http://localhost",bt={...i,...dt},xt=function(t){function e(t,i,s,n){let o=t[n++];if("__proto__"===o)return!0;const r=Number.isFinite(+o),a=n>=t.length;return o=!o&&Y.isArray(s)?s.length:o,a?(Y.hasOwnProp(s,o)?s[o]=[s[o],i]:s[o]=i,!r):(s[o]&&Y.isObject(s[o])||(s[o]=[]),e(t,i,s[o],n)&&Y.isArray(s[o])&&(s[o]=function(t){const e={},i=Object.keys(t);let s;const n=i.length;let o;for(s=0;s<n;s++)o=i[s],e[o]=t[o];return e}(s[o])),!r)}if(Y.isFormData(t)&&Y.isFunction(t.entries)){const i={};return Y.forEachEntry(t,((t,s)=>{e(function(t){return Y.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),s,i,0)})),i}return null},yt={transitional:ct,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const i=e.getContentType()||"",s=i.indexOf("application/json")>-1,n=Y.isObject(t);if(n&&Y.isHTMLForm(t)&&(t=new FormData(t)),Y.isFormData(t))return s?JSON.stringify(xt(t)):t;if(Y.isArrayBuffer(t)||Y.isBuffer(t)||Y.isStream(t)||Y.isFile(t)||Y.isBlob(t)||Y.isReadableStream(t))return t;if(Y.isArrayBufferView(t))return t.buffer;if(Y.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(n){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return it(t,new bt.classes.URLSearchParams,{visitor:function(t,e,i,s){return bt.isNode&&Y.isBuffer(t)?(this.append(e,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((o=Y.isFileList(t))||i.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return it(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return n||s?(e.setContentType("application/json",!1),function(t){if(Y.isString(t))try{return(0,JSON.parse)(t),Y.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||yt.transitional,i=e&&e.forcedJSONParsing,s="json"===this.responseType;if(Y.isResponse(t)||Y.isReadableStream(t))return t;if(t&&Y.isString(t)&&(i&&!this.responseType||s)){const i=!(e&&e.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(t){if(i){if("SyntaxError"===t.name)throw G.from(t,G.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],(t=>{yt.headers[t]={}}));const _t=yt,vt=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wt=Symbol("internals");function Mt(t){return t&&String(t).trim().toLowerCase()}function kt(t){return!1===t||null==t?t:Y.isArray(t)?t.map(kt):String(t)}function St(t,e,i,s,n){return Y.isFunction(s)?s.call(this,e,i):(n&&(e=i),Y.isString(e)?Y.isString(s)?-1!==e.indexOf(s):Y.isRegExp(s)?s.test(e):void 0:void 0)}class Ot{constructor(t){t&&this.set(t)}set(t,e,i){const s=this;function n(t,e,i){const n=Mt(e);if(!n)throw new Error("header name must be a non-empty string");const o=Y.findKey(s,n);(!o||void 0===s[o]||!0===i||void 0===i&&!1!==s[o])&&(s[o||e]=kt(t))}const o=(t,e)=>Y.forEach(t,((t,i)=>n(t,i,e)));if(Y.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(Y.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o((t=>{const e={};let i,s,n;return t&&t.split("\n").forEach((function(t){n=t.indexOf(":"),i=t.substring(0,n).trim().toLowerCase(),s=t.substring(n+1).trim(),!i||e[i]&&vt[i]||("set-cookie"===i?e[i]?e[i].push(s):e[i]=[s]:e[i]=e[i]?e[i]+", "+s:s)})),e})(t),e);else if(Y.isObject(t)&&Y.isIterable(t)){let i,s,n={};for(const e of t){if(!Y.isArray(e))throw TypeError("Object iterator must return a key-value pair");n[s=e[0]]=(i=n[s])?Y.isArray(i)?[...i,e[1]]:[i,e[1]]:e[1]}o(n,e)}else null!=t&&n(e,t,i);return this}get(t,e){if(t=Mt(t)){const i=Y.findKey(this,t);if(i){const t=this[i];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=i.exec(t);)e[s[1]]=s[2];return e}(t);if(Y.isFunction(e))return e.call(this,t,i);if(Y.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Mt(t)){const i=Y.findKey(this,t);return!(!i||void 0===this[i]||e&&!St(0,this[i],i,e))}return!1}delete(t,e){const i=this;let s=!1;function n(t){if(t=Mt(t)){const n=Y.findKey(i,t);!n||e&&!St(0,i[n],n,e)||(delete i[n],s=!0)}}return Y.isArray(t)?t.forEach(n):n(t),s}clear(t){const e=Object.keys(this);let i=e.length,s=!1;for(;i--;){const n=e[i];t&&!St(0,this[n],n,t,!0)||(delete this[n],s=!0)}return s}normalize(t){const e=this,i={};return Y.forEach(this,((s,n)=>{const o=Y.findKey(i,n);if(o)return e[o]=kt(s),void delete e[n];const r=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,i)=>e.toUpperCase()+i))}(n):String(n).trim();r!==n&&delete e[n],e[r]=kt(s),i[r]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Y.forEach(this,((i,s)=>{null!=i&&!1!==i&&(e[s]=t&&Y.isArray(i)?i.join(", "):i)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach((t=>i.set(t))),i}static accessor(t){const e=(this[wt]=this[wt]={accessors:{}}).accessors,i=this.prototype;function s(t){const s=Mt(t);e[s]||(function(t,e){const i=Y.toCamelCase(" "+e);["get","set","has"].forEach((s=>{Object.defineProperty(t,s+i,{value:function(t,i,n){return this[s].call(this,e,t,i,n)},configurable:!0})}))}(i,t),e[s]=!0)}return Y.isArray(t)?t.forEach(s):s(t),this}}Ot.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(Ot.prototype,(({value:t},e)=>{let i=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[i]=t}}})),Y.freezeMethods(Ot);const Pt=Ot;function Et(t,e){const i=this||_t,s=e||i,n=Pt.from(s.headers);let o=s.data;return Y.forEach(t,(function(t){o=t.call(i,o,n.normalize(),e?e.status:void 0)})),n.normalize(),o}function Dt(t){return!(!t||!t.__CANCEL__)}function Ct(t,e,i){G.call(this,null==t?"canceled":t,G.ERR_CANCELED,e,i),this.name="CanceledError"}Y.inherits(Ct,G,{__CANCEL__:!0});const At=Ct;function Tt(t,e,i){const s=i.config.validateStatus;i.status&&s&&!s(i.status)?e(new G("Request failed with status code "+i.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}const Rt=(t,e,i=3)=>{let s=0;const n=function(t,e){t=t||10;const i=new Array(t),s=new Array(t);let n,o=0,r=0;return e=void 0!==e?e:1e3,function(a){const l=Date.now(),h=s[r];n||(n=l),i[o]=a,s[o]=l;let c=r,d=0;for(;c!==o;)d+=i[c++],c%=t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),l-n<e)return;const u=h&&l-h;return u?Math.round(1e3*d/u):void 0}}(50,250);return function(t,e){let i,s,n=0,o=1e3/e;const r=(e,o=Date.now())=>{n=o,i=null,s&&(clearTimeout(s),s=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-n;a>=o?r(t,e):(i=t,s||(s=setTimeout((()=>{s=null,r(i)}),o-a)))},()=>i&&r(i)]}((i=>{const o=i.loaded,r=i.lengthComputable?i.total:void 0,a=o-s,l=n(a);s=o,t({loaded:o,total:r,progress:r?o/r:void 0,bytes:a,rate:l||void 0,estimated:l&&r&&o<=r?(r-o)/l:void 0,event:i,lengthComputable:null!=r,[e?"download":"upload"]:!0})}),i)},Lt=(t,e)=>{const i=null!=t;return[s=>e[0]({lengthComputable:i,total:t,loaded:s}),e[1]]},It=t=>(...e)=>Y.asap((()=>t(...e))),Ft=bt.hasStandardBrowserEnv?((t,e)=>i=>(i=new URL(i,bt.origin),t.protocol===i.protocol&&t.host===i.host&&(e||t.port===i.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,zt=bt.hasStandardBrowserEnv?{write(t,e,i,s,n,o){const r=[t+"="+encodeURIComponent(e)];Y.isNumber(i)&&r.push("expires="+new Date(i).toGMTString()),Y.isString(s)&&r.push("path="+s),Y.isString(n)&&r.push("domain="+n),!0===o&&r.push("secure"),document.cookie=r.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Nt(t,e,i){let s=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(s||0==i)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Bt=t=>t instanceof Pt?{...t}:t;function jt(t,e){e=e||{};const i={};function s(t,e,i,s){return Y.isPlainObject(t)&&Y.isPlainObject(e)?Y.merge.call({caseless:s},t,e):Y.isPlainObject(e)?Y.merge({},e):Y.isArray(e)?e.slice():e}function n(t,e,i,n){return Y.isUndefined(e)?Y.isUndefined(t)?void 0:s(void 0,t,0,n):s(t,e,0,n)}function o(t,e){if(!Y.isUndefined(e))return s(void 0,e)}function r(t,e){return Y.isUndefined(e)?Y.isUndefined(t)?void 0:s(void 0,t):s(void 0,e)}function a(i,n,o){return o in e?s(i,n):o in t?s(void 0,i):void 0}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(t,e,i)=>n(Bt(t),Bt(e),0,!0)};return Y.forEach(Object.keys({...t,...e}),(function(s){const o=l[s]||n,r=o(t[s],e[s],s);Y.isUndefined(r)&&o!==a||(i[s]=r)})),i}const Vt=t=>{const e=jt({},t);let{data:i,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:o,headers:r,auth:a}=e;if(e.headers=r=Pt.from(r),e.url=lt(Nt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Y.isFormData(i))if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Y.isFunction(i.getHeaders)){const t=i.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach((([t,i])=>{e.includes(t.toLowerCase())&&r.set(t,i)}))}if(bt.hasStandardBrowserEnv&&(s&&Y.isFunction(s)&&(s=s(e)),s||!1!==s&&Ft(e.url))){const t=n&&o&&zt.read(o);t&&r.set(n,t)}return e},Wt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,i){const s=Vt(t);let n=s.data;const o=Pt.from(s.headers).normalize();let r,a,l,h,c,{responseType:d,onUploadProgress:u,onDownloadProgress:f}=s;function p(){h&&h(),c&&c(),s.cancelToken&&s.cancelToken.unsubscribe(r),s.signal&&s.signal.removeEventListener("abort",r)}let g=new XMLHttpRequest;function m(){if(!g)return;const s=Pt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Tt((function(t){e(t),p()}),(function(t){i(t),p()}),{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:s,config:t,request:g}),g=null}g.open(s.method.toUpperCase(),s.url,!0),g.timeout=s.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(i(new G("Request aborted",G.ECONNABORTED,t,g)),g=null)},g.onerror=function(e){const s=e&&e.message?e.message:"Network Error",n=new G(s,G.ERR_NETWORK,t,g);n.event=e||null,i(n),g=null},g.ontimeout=function(){let e=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const n=s.transitional||ct;s.timeoutErrorMessage&&(e=s.timeoutErrorMessage),i(new G(e,n.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,t,g)),g=null},void 0===n&&o.setContentType(null),"setRequestHeader"in g&&Y.forEach(o.toJSON(),(function(t,e){g.setRequestHeader(e,t)})),Y.isUndefined(s.withCredentials)||(g.withCredentials=!!s.withCredentials),d&&"json"!==d&&(g.responseType=s.responseType),f&&([l,c]=Rt(f,!0),g.addEventListener("progress",l)),u&&g.upload&&([a,h]=Rt(u),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(r=e=>{g&&(i(!e||e.type?new At(null,t,g):e),g.abort(),g=null)},s.cancelToken&&s.cancelToken.subscribe(r),s.signal&&(s.signal.aborted?r():s.signal.addEventListener("abort",r)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(s.url);b&&-1===bt.protocols.indexOf(b)?i(new G("Unsupported protocol "+b+":",G.ERR_BAD_REQUEST,t)):g.send(n||null)}))},Ht=(t,e)=>{const{length:i}=t=t?t.filter(Boolean):[];if(e||i){let i,s=new AbortController;const n=function(t){if(!i){i=!0,r();const e=t instanceof Error?t:this.reason;s.abort(e instanceof G?e:new At(e instanceof Error?e.message:e))}};let o=e&&setTimeout((()=>{o=null,n(new G(`timeout ${e} of ms exceeded`,G.ETIMEDOUT))}),e);const r=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(n):t.removeEventListener("abort",n)})),t=null)};t.forEach((t=>t.addEventListener("abort",n)));const{signal:a}=s;return a.unsubscribe=()=>Y.asap(r),a}},Ut=function*(t,e){let i=t.byteLength;if(!e||i<e)return void(yield t);let s,n=0;for(;n<i;)s=n+e,yield t.slice(n,s),n=s},$t=(t,e,i,s)=>{const n=async function*(t,e){for await(const i of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}}(t))yield*Ut(i,e)}(t,e);let o,r=0,a=t=>{o||(o=!0,s&&s(t))};return new ReadableStream({async pull(t){try{const{done:e,value:s}=await n.next();if(e)return a(),void t.close();let o=s.byteLength;if(i){let t=r+=o;i(t)}t.enqueue(new Uint8Array(s))}catch(t){throw a(t),t}},cancel:t=>(a(t),n.return())},{highWaterMark:2})},{isFunction:qt}=Y,Yt=(({Request:t,Response:e})=>({Request:t,Response:e}))(Y.global),{ReadableStream:Xt,TextEncoder:Kt}=Y.global,Jt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Gt=t=>{t=Y.merge.call({skipUndefined:!0},Yt,t);const{fetch:e,Request:i,Response:s}=t,n=e?qt(e):"function"==typeof fetch,o=qt(i),r=qt(s);if(!n)return!1;const a=n&&qt(Xt),l=n&&("function"==typeof Kt?(h=new Kt,t=>h.encode(t)):async t=>new Uint8Array(await new i(t).arrayBuffer()));var h;const c=o&&a&&Jt((()=>{let t=!1;const e=new i(bt.origin,{body:new Xt,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),d=r&&a&&Jt((()=>Y.isReadableStream(new s("").body))),u={stream:d&&(t=>t.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!u[t]&&(u[t]=(e,i)=>{let s=e&&e[t];if(s)return s.call(e);throw new G(`Response type '${t}' is not supported`,G.ERR_NOT_SUPPORT,i)})}));return async t=>{let{url:n,method:r,data:a,signal:h,cancelToken:f,timeout:p,onDownloadProgress:g,onUploadProgress:m,responseType:b,headers:x,withCredentials:y="same-origin",fetchOptions:_}=Vt(t),v=e||fetch;b=b?(b+"").toLowerCase():"text";let w=Ht([h,f&&f.toAbortSignal()],p),M=null;const k=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let S;try{if(m&&c&&"get"!==r&&"head"!==r&&0!==(S=await(async(t,e)=>{const s=Y.toFiniteNumber(t.getContentLength());return null==s?(async t=>{if(null==t)return 0;if(Y.isBlob(t))return t.size;if(Y.isSpecCompliantForm(t)){const e=new i(bt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Y.isArrayBufferView(t)||Y.isArrayBuffer(t)?t.byteLength:(Y.isURLSearchParams(t)&&(t+=""),Y.isString(t)?(await l(t)).byteLength:void 0)})(e):s})(x,a))){let t,e=new i(n,{method:"POST",body:a,duplex:"half"});if(Y.isFormData(a)&&(t=e.headers.get("content-type"))&&x.setContentType(t),e.body){const[t,i]=Lt(S,Rt(It(m)));a=$t(e.body,65536,t,i)}}Y.isString(y)||(y=y?"include":"omit");const e=o&&"credentials"in i.prototype,h={..._,signal:w,method:r.toUpperCase(),headers:x.normalize().toJSON(),body:a,duplex:"half",credentials:e?y:void 0};M=o&&new i(n,h);let f=await(o?v(M,_):v(n,h));const p=d&&("stream"===b||"response"===b);if(d&&(g||p&&k)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=f[e]}));const e=Y.toFiniteNumber(f.headers.get("content-length")),[i,n]=g&&Lt(e,Rt(It(g),!0))||[];f=new s($t(f.body,65536,i,(()=>{n&&n(),k&&k()})),t)}b=b||"text";let O=await u[Y.findKey(u,b)||"text"](f,t);return!p&&k&&k(),await new Promise(((e,i)=>{Tt(e,i,{data:O,headers:Pt.from(f.headers),status:f.status,statusText:f.statusText,config:t,request:M})}))}catch(e){if(k&&k(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,t,M),{cause:e.cause||e});throw G.from(e,e&&e.code,t,M)}}},Zt=new Map,Qt=t=>{let e=t?t.env:{};const{fetch:i,Request:s,Response:n}=e,o=[s,n,i];let r,a,l=o.length,h=Zt;for(;l--;)r=o[l],a=h.get(r),void 0===a&&h.set(r,a=l?new Map:Gt(e)),h=a;return a},te=(Qt(),{http:null,xhr:Wt,fetch:{get:Qt}});Y.forEach(te,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ee=t=>`- ${t}`,ie=t=>Y.isFunction(t)||null===t||!1===t,se=(t,e)=>{t=Y.isArray(t)?t:[t];const{length:i}=t;let s,n;const o={};for(let r=0;r<i;r++){let i;if(s=t[r],n=s,!ie(s)&&(n=te[(i=String(s)).toLowerCase()],void 0===n))throw new G(`Unknown adapter '${i}'`);if(n&&(Y.isFunction(n)||(n=n.get(e))))break;o[i||"#"+r]=n}if(!n){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let e=i?t.length>1?"since :\n"+t.map(ee).join("\n"):" "+ee(t[0]):"as no adapter specified";throw new G("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return n};function ne(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new At(null,t)}function oe(t){return ne(t),t.headers=Pt.from(t.headers),t.data=Et.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),se(t.adapter||_t.adapter,t)(t).then((function(e){return ne(t),e.data=Et.call(t,t.transformResponse,e),e.headers=Pt.from(e.headers),e}),(function(e){return Dt(e)||(ne(t),e&&e.response&&(e.response.data=Et.call(t,t.transformResponse,e.response),e.response.headers=Pt.from(e.response.headers))),Promise.reject(e)}))}const re="1.12.2",ae={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ae[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));const le={};ae.transitional=function(t,e,i){function s(t,e){return"[Axios v"+re+"] Transitional option '"+t+"'"+e+(i?". "+i:"")}return(i,n,o)=>{if(!1===t)throw new G(s(n," has been removed"+(e?" in "+e:"")),G.ERR_DEPRECATED);return e&&!le[n]&&(le[n]=!0,console.warn(s(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,n,o)}},ae.spelling=function(t){return(e,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};const he={assertOptions:function(t,e,i){if("object"!=typeof t)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let n=s.length;for(;n-- >0;){const o=s[n],r=e[o];if(r){const e=t[o],i=void 0===e||r(e,o,t);if(!0!==i)throw new G("option "+o+" must be "+i,G.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new G("Unknown option "+o,G.ERR_BAD_OPTION)}},validators:ae},ce=he.validators;class de{constructor(t){this.defaults=t||{},this.interceptors={request:new ht,response:new ht}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const i=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+i):t.stack=i}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=jt(this.defaults,e);const{transitional:i,paramsSerializer:s,headers:n}=e;void 0!==i&&he.assertOptions(i,{silentJSONParsing:ce.transitional(ce.boolean),forcedJSONParsing:ce.transitional(ce.boolean),clarifyTimeoutError:ce.transitional(ce.boolean)},!1),null!=s&&(Y.isFunction(s)?e.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:ce.function,serialize:ce.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),he.assertOptions(e,{baseUrl:ce.spelling("baseURL"),withXsrfToken:ce.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=n&&Y.merge(n.common,n[e.method]);n&&Y.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete n[t]})),e.headers=Pt.concat(o,n);const r=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));const l=[];let h;this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));let c,d=0;if(!a){const t=[oe.bind(this),void 0];for(t.unshift(...r),t.push(...l),c=t.length,h=Promise.resolve(e);d<c;)h=h.then(t[d++],t[d++]);return h}c=r.length;let u=e;for(;d<c;){const t=r[d++],e=r[d++];try{u=t(u)}catch(t){e.call(this,t);break}}try{h=oe.call(this,u)}catch(t){return Promise.reject(t)}for(d=0,c=l.length;d<c;)h=h.then(l[d++],l[d++]);return h}getUri(t){return lt(Nt((t=jt(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}Y.forEach(["delete","get","head","options"],(function(t){de.prototype[t]=function(e,i){return this.request(jt(i||{},{method:t,url:e,data:(i||{}).data}))}})),Y.forEach(["post","put","patch"],(function(t){function e(e){return function(i,s,n){return this.request(jt(n||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}de.prototype[t]=e(),de.prototype[t+"Form"]=e(!0)}));const ue=de;class fe{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const i=this;this.promise.then((t=>{if(!i._listeners)return;let e=i._listeners.length;for(;e-- >0;)i._listeners[e](t);i._listeners=null})),this.promise.then=t=>{let e;const s=new Promise((t=>{i.subscribe(t),e=t})).then(t);return s.cancel=function(){i.unsubscribe(e)},s},t((function(t,s,n){i.reason||(i.reason=new At(t,s,n),e(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new fe((function(e){t=e})),cancel:t}}}const pe=fe,ge={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ge).forEach((([t,e])=>{ge[e]=t}));const me=ge,be=function t(e){const i=new ue(e),n=s(ue.prototype.request,i);return Y.extend(n,ue.prototype,i,{allOwnKeys:!0}),Y.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return t(jt(e,i))},n}(_t);be.Axios=ue,be.CanceledError=At,be.CancelToken=pe,be.isCancel=Dt,be.VERSION=re,be.toFormData=it,be.AxiosError=G,be.Cancel=be.CanceledError,be.all=function(t){return Promise.all(t)},be.spread=function(t){return function(e){return t.apply(null,e)}},be.isAxiosError=function(t){return Y.isObject(t)&&!0===t.isAxiosError},be.mergeConfig=jt,be.AxiosHeaders=Pt,be.formToJSON=t=>xt(Y.isHTMLForm(t)?new FormData(t):t),be.getAdapter=se,be.HttpStatusCode=me,be.default=be;const xe=be;function ye(t){return t+.5|0}const _e=(t,e,i)=>Math.max(Math.min(t,i),e);function ve(t){return _e(ye(2.55*t),0,255)}function we(t){return _e(ye(255*t),0,255)}function Me(t){return _e(ye(t/2.55)/100,0,1)}function ke(t){return _e(ye(100*t),0,100)}const Se={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Oe=[..."0123456789ABCDEF"],Pe=t=>Oe[15&t],Ee=t=>Oe[(240&t)>>4]+Oe[15&t],De=t=>(240&t)>>4==(15&t);const Ce=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ae(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function Te(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function Re(t,e,i){const s=Ae(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function Le(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),r=(n+o)/2;let a,l,h;return n!==o&&(h=n-o,l=r>.5?h/(2-n-o):h/(n+o),a=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),a=60*a+.5),[0|a,l||0,r]}function Ie(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(we)}function Fe(t,e,i){return Ie(Ae,t,e,i)}function ze(t){return(t%360+360)%360}const Ne={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Be={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let je;const Ve=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,We=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,He=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Ue(t,e,i){if(t){let s=Le(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=Fe(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function $e(t,e){return t?Object.assign(e||{},t):t}function qe(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=we(t[3]))):(e=$e(t,{r:0,g:0,b:0,a:1})).a=we(e.a),e}function Ye(t){return"r"===t.charAt(0)?function(t){const e=Ve.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?ve(t):_e(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?ve(i):_e(i,0,255)),s=255&(e[4]?ve(s):_e(s,0,255)),n=255&(e[6]?ve(n):_e(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):function(t){const e=Ce.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?ve(+e[5]):we(+e[5]));const n=ze(+e[2]),o=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Ie(Re,t,e,i)}(n,o,r):"hsv"===e[1]?function(t,e,i){return Ie(Te,t,e,i)}(n,o,r):Fe(n,o,r),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class Xe{constructor(t){if(t instanceof Xe)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=qe(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*Se[s[1]],g:255&17*Se[s[2]],b:255&17*Se[s[3]],a:5===o?17*Se[s[4]]:255}:7!==o&&9!==o||(n={r:Se[s[1]]<<4|Se[s[2]],g:Se[s[3]]<<4|Se[s[4]],b:Se[s[5]]<<4|Se[s[6]],a:9===o?Se[s[7]]<<4|Se[s[8]]:255})),i=n||function(t){je||(je=function(){const t={},e=Object.keys(Be),i=Object.keys(Ne);let s,n,o,r,a;for(s=0;s<e.length;s++){for(r=a=e[s],n=0;n<i.length;n++)o=i[n],a=a.replace(o,Ne[o]);o=parseInt(Be[r],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),je.transparent=[0,0,0,0]);const e=je[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ye(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=$e(this._rgb);return t&&(t.a=Me(t.a)),t}set rgb(t){this._rgb=qe(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Me(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>De(t.r)&&De(t.g)&&De(t.b)&&De(t.a))(t)?Pe:Ee,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Le(t),i=e[0],s=ke(e[1]),n=ke(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${Me(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,r=2*o-1,a=i.a-s.a,l=((r*a==-1?r:(r+a)/(1+r*a))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=He(Me(t.r)),n=He(Me(t.g)),o=He(Me(t.b));return{r:we(We(s+i*(He(Me(e.r))-s))),g:we(We(n+i*(He(Me(e.g))-n))),b:we(We(o+i*(He(Me(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Xe(this.rgb)}alpha(t){return this._rgb.a=we(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=ye(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ue(this._rgb,2,t),this}darken(t){return Ue(this._rgb,2,-t),this}saturate(t){return Ue(this._rgb,1,t),this}desaturate(t){return Ue(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Le(t);i[0]=ze(i[0]+e),i=Fe(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Ke(){}const Je=(()=>{let t=0;return()=>t++})();function Ge(t){return null==t}function Ze(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Qe(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function ti(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function ei(t,e){return ti(t)?t:e}function ii(t,e){return void 0===t?e:t}const si=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ni(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function oi(t,e,i,s){let n,o,r;if(Ze(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(Qe(t))for(r=Object.keys(t),o=r.length,n=0;n<o;n++)e.call(i,t[r[n]],r[n])}function ri(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ai(t){if(Ze(t))return t.map(ai);if(Qe(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=ai(t[i[n]]);return e}return t}function li(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function hi(t,e,i,s){if(!li(t))return;const n=e[t],o=i[t];Qe(n)&&Qe(o)?ci(n,o,s):e[t]=ai(o)}function ci(t,e,i){const s=Ze(e)?e:[e],n=s.length;if(!Qe(t))return t;const o=(i=i||{}).merger||hi;let r;for(let e=0;e<n;++e){if(r=s[e],!Qe(r))continue;const n=Object.keys(r);for(let e=0,s=n.length;e<s;++e)o(n[e],t,r,i)}return t}function di(t,e){return ci(t,e,{merger:ui})}function ui(t,e,i){if(!li(t))return;const s=e[t],n=i[t];Qe(s)&&Qe(n)?di(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ai(n))}const fi={"":t=>t,x:t=>t.x,y:t=>t.y};function pi(t,e){const i=fi[e]||(fi[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function gi(t){return t.charAt(0).toUpperCase()+t.slice(1)}const mi=t=>void 0!==t,bi=t=>"function"==typeof t,xi=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},yi=Math.PI,_i=2*yi,vi=_i+yi,wi=Number.POSITIVE_INFINITY,Mi=yi/180,ki=yi/2,Si=yi/4,Oi=2*yi/3,Pi=Math.log10,Ei=Math.sign;function Di(t,e,i){return Math.abs(t-e)<i}function Ci(t){const e=Math.round(t);t=Di(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Pi(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function Ai(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Ti(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Ri(t){return t*(yi/180)}function Li(t){return t*(180/yi)}function Ii(t){if(!ti(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Fi(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*yi&&(o+=_i),{angle:o,distance:n}}function zi(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ni(t,e){return(t-e+vi)%_i-yi}function Bi(t){return(t%_i+_i)%_i}function ji(t,e,i,s){const n=Bi(t),o=Bi(e),r=Bi(i),a=Bi(o-n),l=Bi(r-n),h=Bi(n-o),c=Bi(n-r);return n===o||n===r||s&&o===r||a>l&&h<c}function Vi(t,e,i){return Math.max(e,Math.min(i,t))}function Wi(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Hi(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const Ui=(t,e,i,s)=>Hi(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),$i=(t,e,i)=>Hi(t,i,(s=>t[s][e]>=i)),qi=["push","pop","shift","splice","unshift"];function Yi(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(qi.forEach((e=>{delete t[e]})),delete t._chartjs)}function Xi(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Ki="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Ji(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,Ki.call(window,(()=>{s=!1,t.apply(e,i)})))}}const Gi=t=>"start"===t?"left":"end"===t?"right":"center",Zi=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Qi(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,c=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(n=Math.min(Ui(l,c,d).lo,i?s:Ui(e,c,r.getPixelForValue(d)).lo),h){const t=l.slice(0,n+1).reverse().findIndex((t=>!Ge(t[a.axis])));n-=Math.max(0,t)}n=Vi(n,0,s-1)}if(p){let t=Math.max(Ui(l,r.axis,u,!0).hi+1,i?0:Ui(e,c,r.getPixelForValue(u),!0).hi+1);if(h){const e=l.slice(t-1).findIndex((t=>!Ge(t[a.axis])));t+=Math.max(0,e)}o=Vi(t,n,s)-n}else o=s-n}return{start:n,count:o}}function ts(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}const es=t=>0===t||1===t,is=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*_i/i),ss=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*_i/i)+1,ns={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*ki),easeOutSine:t=>Math.sin(t*ki),easeInOutSine:t=>-.5*(Math.cos(yi*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>es(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>es(t)?t:is(t,.075,.3),easeOutElastic:t=>es(t)?t:ss(t,.075,.3),easeInOutElastic(t){const e=.1125;return es(t)?t:t<.5?.5*is(2*t,e,.45):.5+.5*ss(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ns.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ns.easeInBounce(2*t):.5*ns.easeOutBounce(2*t-1)+.5};function os(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function rs(t){return os(t)?t:new Xe(t)}function as(t){return os(t)?t:new Xe(t).saturate(.5).darken(.1).hexString()}const ls=["x","y","borderWidth","radius","tension"],hs=["color","borderColor","backgroundColor"],cs=new Map;function ds(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=cs.get(i);return s||(s=new Intl.NumberFormat(t,e),cs.set(i,s)),s}(e,i).format(t)}const us={values:t=>Ze(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Pi(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ds(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(Pi(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?us.numeric.call(this,t,e,i):""}};var fs={formatters:us};const ps=Object.create(null),gs=Object.create(null);function ms(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function bs(t,e,i){return"string"==typeof e?ci(ms(t,e),i):ci(ms(t,""),e)}class xs{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>as(e.backgroundColor),this.hoverBorderColor=(t,e)=>as(e.borderColor),this.hoverColor=(t,e)=>as(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return bs(this,t,e)}get(t){return ms(this,t)}describe(t,e){return bs(gs,t,e)}override(t,e){return bs(ps,t,e)}route(t,e,i,s){const n=ms(this,t),o=ms(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[s];return Qe(t)?Object.assign({},e,t):ii(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach((t=>t(this)))}}var ys=new xs({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:hs},numbers:{type:"number",properties:ls}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function _s(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function vs(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,h,c,d,u;for(l=0;l<a;l++)if(d=i[l],null==d||Ze(d)){if(Ze(d))for(h=0,c=d.length;h<c;h++)u=d[h],null==u||Ze(u)||(r=_s(t,n,o,r,u))}else r=_s(t,n,o,r,d);t.restore();const f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return r}function ws(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Ms(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function ks(t,e,i,s){Ss(t,e,i,s,null)}function Ss(t,e,i,s,n){let o,r,a,l,h,c,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*Mi;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,g,0,0,_i):t.arc(i,s,g,0,_i),t.closePath();break;case"triangle":c=n?n/2:g,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=Oi,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=Oi,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,r=Math.cos(m+Si)*l,d=Math.cos(m+Si)*(n?n/2-h:l),a=Math.sin(m+Si)*l,u=Math.sin(m+Si)*(n?n/2-h:l),t.arc(i-d,s-a,h,m-yi,m-ki),t.arc(i+u,s-r,h,m-ki,m),t.arc(i+d,s+a,h,m,m+ki),t.arc(i-u,s+r,h,m+ki,m+yi),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=n?n/2:l,t.rect(i-c,s-l,2*c,2*l);break}m+=Si;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+u,s-r),t.lineTo(i+d,s+a),t.lineTo(i-u,s+r),t.closePath();break;case"crossRot":m+=Si;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r),m+=Si,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(i-r,s-a),t.lineTo(i+r,s+a);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Os(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ps(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Es(t){t.restore()}function Ds(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Cs(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function As(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(r,c),t.lineTo(a,c),t.stroke()}}function Ts(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Rs(t,e,i,s,n,o={}){const r=Ze(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let l,h;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Ge(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<r.length;++l)h=r[l],o.backdrop&&Ts(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),Ge(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(h,i,s,o.maxWidth)),t.fillText(h,i,s,o.maxWidth),As(t,i,s,h,o),s+=Number(n.lineHeight);t.restore()}function Ls(t,e){const{x:i,y:s,w:n,h:o,radius:r}=e;t.arc(i+r.topLeft,s+r.topLeft,r.topLeft,1.5*yi,yi,!0),t.lineTo(i,s+o-r.bottomLeft),t.arc(i+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,yi,ki,!0),t.lineTo(i+n-r.bottomRight,s+o),t.arc(i+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,ki,0,!0),t.lineTo(i+n,s+r.topRight),t.arc(i+n-r.topRight,s+r.topRight,r.topRight,0,-ki,!0),t.lineTo(i+r.topLeft,s)}const Is=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Fs=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zs(t,e){const i=(""+t).match(Is);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function Ns(t,e){const i={},s=Qe(e),n=s?Object.keys(e):e,o=Qe(t)?s?i=>ii(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=+o(t)||0;return i}function Bs(t){return Ns(t,{top:"y",right:"x",bottom:"y",left:"x"})}function js(t){return Ns(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Vs(t){const e=Bs(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ws(t,e){t=t||{},e=e||ys.font;let i=ii(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=ii(t.style,e.style);s&&!(""+s).match(Fs)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:ii(t.family,e.family),lineHeight:zs(ii(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:ii(t.weight,e.weight),string:""};return n.string=function(t){return!t||Ge(t.size)||Ge(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function Hs(t,e,i,s){let n,o,r,a=!0;for(n=0,o=t.length;n<o;++n)if(r=t[n],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),a=!1),void 0!==i&&Ze(r)&&(r=r[i%r.length],a=!1),void 0!==r))return s&&!a&&(s.cacheable=!1),r}function Us(t,e){return Object.assign(Object.create(t),e)}function $s(t,e=[""],i,s,n=()=>t[0]){const o=i||t;void 0===s&&(s=sn("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>$s([i,...t],e,o,s)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Js(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=sn(Xs(o,t),i),void 0!==n)return Ks(t,n)?tn(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>nn(t).includes(e),ownKeys:t=>nn(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function qs(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ys(t,s),setContext:e=>qs(t,e,i,s),override:n=>qs(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Js(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=t;let a=s[e];return bi(a)&&r.isScriptable(e)&&(a=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||s);return a.delete(t),Ks(t,l)&&(l=tn(n._scopes,n,t,l)),l}(e,a,t,i)),Ze(a)&&a.length&&(a=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(Qe(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=tn(s,n,t,l);e.push(qs(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable)),Ks(e,a)&&(a=qs(a,n,o&&o[e],r)),a}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Ys(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:bi(i)?i:()=>i,isIndexable:bi(s)?s:()=>s}}const Xs=(t,e)=>t?t+gi(e):e,Ks=(t,e)=>Qe(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Js(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function Gs(t,e,i){return bi(t)?t(e,i):t}const Zs=(t,e)=>!0===t?e:"string"==typeof t?pi(e,t):void 0;function Qs(t,e,i,s,n){for(const o of e){const e=Zs(i,o);if(e){t.add(e);const o=Gs(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function tn(t,e,i,s){const n=e._rootScopes,o=Gs(e._fallback,i,s),r=[...t,...n],a=new Set;a.add(s);let l=en(a,r,i,o||i,s);return null!==l&&(void 0===o||o===i||(l=en(a,r,o,l,s),null!==l))&&$s(Array.from(a),[""],n,o,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return Ze(n)&&Qe(i)?i:n||{}}(e,i,s)))}function en(t,e,i,s,n){for(;i;)i=Qs(t,e,i,s,n);return i}function sn(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function nn(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function on(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,r=new Array(s);let a,l,h,c;for(a=0,l=s;a<l;++a)h=a+i,c=e[h],r[a]={r:n.parse(pi(c,o),h)};return r}const rn=Number.EPSILON||1e-14,an=(t,e)=>e<t.length&&!t[e].skip&&t[e],ln=t=>"x"===t?"y":"x";function hn(t,e,i,s){const n=t.skip?e:t,o=e,r=i.skip?e:i,a=zi(o,n),l=zi(r,o);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function cn(t,e,i){return Math.max(Math.min(t,i),e)}function dn(t,e,i,s,n){let o,r,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=ln(e),s=t.length,n=Array(s).fill(0),o=Array(s);let r,a,l,h=an(t,0);for(r=0;r<s;++r)if(a=l,l=h,h=an(t,r+1),l){if(h){const t=h[e]-l[e];n[r]=0!==t?(h[i]-l[i])/t:0}o[r]=a?h?Ei(n[r-1])!==Ei(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}!function(t,e,i){const s=t.length;let n,o,r,a,l,h=an(t,0);for(let c=0;c<s-1;++c)l=h,h=an(t,c+1),l&&h&&(Di(e[c],0,rn)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],a=Math.pow(n,2)+Math.pow(o,2),a<=9||(r=3/Math.sqrt(a),i[c]=n*r*e[c],i[c+1]=o*r*e[c])))}(t,n,o),function(t,e,i="x"){const s=ln(i),n=t.length;let o,r,a,l=an(t,0);for(let h=0;h<n;++h){if(r=a,a=l,l=an(t,h+1),!a)continue;const n=a[i],c=a[s];r&&(o=(n-r[i])/3,a[`cp1${i}`]=n-o,a[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,a[`cp2${i}`]=n+o,a[`cp2${s}`]=c+o*e[h])}}(t,o,e)}(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],l=hn(i,a,t[Math.min(o+1,r-(s?0:1))%r],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,s,n,o,r,a=Os(t[0],e);for(i=0,s=t.length;i<s;++i)r=o,o=a,a=i<s-1&&Os(t[i+1],e),o&&(n=t[i],r&&(n.cp1x=cn(n.cp1x,e.left,e.right),n.cp1y=cn(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=cn(n.cp2x,e.left,e.right),n.cp2y=cn(n.cp2y,e.top,e.bottom)))}(t,i)}function un(){return"undefined"!=typeof window&&"undefined"!=typeof document}function fn(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function pn(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const gn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),mn=["top","right","bottom","left"];function bn(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=mn[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function xn(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=gn(i),o="border-box"===n.boxSizing,r=bn(n,"padding"),a=bn(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,o,t.target))r=n,a=o;else{const t=e.getBoundingClientRect();r=s.clientX-t.left,a=s.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(c&&a.left),u=r.top+(c&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/p*i.height/s)}}const yn=t=>Math.round(10*t)/10;function _n(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||r.height!==n||r.width!==o)&&(t.currentDevicePixelRatio=s,r.height=n,r.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const vn=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};un()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function wn(t,e){const i=function(t,e){return gn(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Mn(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function kn(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function Sn(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=Mn(t,n,i),a=Mn(n,o,i),l=Mn(o,e,i),h=Mn(r,a,i),c=Mn(a,l,i);return Mn(h,c,i)}function On(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Pn(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function En(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Dn(t){return"angle"===t?{between:ji,compare:Ni,normalize:Bi}:{between:Wi,compare:(t,e)=>t-e,normalize:t=>t}}function Cn({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function An(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,r=e.length,{compare:a,between:l,normalize:h}=Dn(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:r,normalize:a}=Dn(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&r(a(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),p=[];let g,m,b,x=!1,y=null;for(let t=c,i=c;t<=d;++t)m=e[t%r],m.skip||(g=h(m[s]),g!==b&&(x=l(g,n,o),null===y&&(x||l(n,b,g)&&0!==a(n,b))&&(y=0===a(g,n)?t:i),null!==y&&(!x||0===a(o,g)||l(o,b,g))&&(p.push(Cn({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(Cn({start:y,end:d,loop:u,count:r,style:f})),p}function Tn(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=An(s[n],t.points,e);o.length&&i.push(...o)}return i}function Rn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Ln(t,e){if(!e)return!1;const i=[],s=function(t,e){return os(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}function In(t,e,i){return t.options.clip?t[i]:e[i]}function Fn(t,e){const i=e._clip;if(i.disabled)return!1;const s=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:In(i,e,"left"),right:In(i,e,"right"),top:In(s,e,"top"),bottom:In(s,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:s.bottom+(!0===i.bottom?0:i.bottom)}}class zn{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=Ki.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,r=n.length-1,a=!1;for(;r>=0;--r)o=n[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(n[r]=n[n.length-1],n.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Nn=new zn;const Bn="transparent",jn={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=rs(t||Bn),n=s.valid&&rs(e||Bn);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Vn{constructor(t,e,i,s){const n=e[i];s=Hs([t.to,s,n,t.from]);const o=Hs([t.from,n,s]);this._active=!0,this._fn=t.fn||jn[t.type||typeof o],this._easing=ns[t.easing]||ns.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Hs([t.to,e,s,t.from]),this._from=Hs([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,r=this._to;let a;if(this._active=n!==r&&(o||e<i),!this._active)return this._target[s]=r,void this._notify(!0);e<0?this._target[s]=n:(a=e/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(n,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class Wn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Qe(t))return;const e=Object.keys(ys.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const n=t[s];if(!Qe(n))return;const o={};for(const t of e)o[t]=n[t];(Ze(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,r);continue}c.cancel()}d&&d.duration?(n[l]=c=new Vn(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(Nn.add(this._chart,i),!0):void 0}}function Hn(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function Un(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function $n(t,e,i,s={}){const n=t.keys,o="single"===s.mode;let r,a,l,h;if(null===e)return;let c=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===i){if(c=!0,s.all)continue;break}h=t.values[l],ti(h)&&(o||0===e||Ei(e)===Ei(h))&&(e+=h)}return c||s.all?e:0}function qn(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Yn(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function Xn(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function Kn(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,h=r.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=Yn(n,c,o),u[a]=d,u._top=Xn(u,r,!0,s.type),u._bottom=Xn(u,r,!1,s.type),(u._visualValues||(u._visualValues={}))[a]=d}}function Jn(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Gn(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const Zn=t=>"reset"===t||"none"===t,Qn=(t,e)=>e?t:Object.assign({},t);class to{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=qn(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&&Gn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=ii(i.xAxisID,Jn(t,"x")),o=e.yAxisID=ii(i.yAxisID,Jn(t,"y")),r=e.rAxisID=ii(i.rAxisID,Jn(t,"r")),a=e.indexAxis,l=e.iAxisID=s(a,n,o,r),h=e.vAxisID=s(a,o,n,r);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Yi(this._data,this),t._stacked&&Gn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Qe(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,h,c;for(l=0,h=r.length;l<h;++l)c=r[l],a[l]={[n]:c,[o]:t[c]};return a}(e,t)}else if(i!==e){if(i){Yi(i,this);const t=this._cachedMeta;Gn(t),t._parsed=[]}e&&Object.isExtensible(e)&&((s=e)._chartjs?s._chartjs.listeners.push(this):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),qi.forEach((t=>{const e="_onData"+gi(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return s._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),n}})})))),this._syncList=[],this._data=e}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=qn(e.vScale,e),e.stack!==i.stack&&(s=!0,Gn(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(Kn(this,e._parsed),e._stacked=qn(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,r=n.axis;let a,l,h,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=Ze(s[t])?this.parseArrayData(i,s,t,e):Qe(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[r]||d&&l[r]<d[r];for(a=0;a<e;++a)i._parsed[a+t]=l=h[a],c&&(n()&&(c=!1),d=l);i._sorted=c}o&&Kn(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,r=n.axis,a=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[r]:h||n.parse(l[f],f),[a]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,r=new Array(s);let a,l,h,c;for(a=0,l=s;a<l;++a)h=a+i,c=e[h],r[a]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(pi(u,r),d),y:o.parse(pi(u,a),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return $n({keys:Un(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const r=s&&i._stacks[e.axis];s&&r&&(s.values=r,o=$n(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,o=s.length,r=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Un(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=s[d];const e=u[r.axis];return!ti(u[t.axis])||h>e||c<e}for(d=0;d<o&&(f()||(this.updateRangeFromParsed(l,t,u,a),!n));++d);if(n)for(d=o-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s][t.axis],ti(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return Qe(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(ii(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=Hn(t,i),n=Hn(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,r,a),h=r;h<r+a;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return Us(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return Us(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,o=t+"-"+e,r=n[o],a=this.enableOptionSharing&&mi(i);if(r)return Qn(r,a);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(ys.elements[t]),f=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s,e)),c);return f.$shared&&(f.$shared=a,n[o]=Object.freeze(Qn(f,a))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,r=n[o];if(r)return r;let a;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);a=s.createResolver(o,this.getContext(t,i,e))}const l=new Wn(s,a&&a.animations);return a&&a._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Zn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){Zn(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Zn(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let r;const a=t=>{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(n),r=t;r<o;++r)n[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Gn(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function eo(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Xi(s.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let s,n,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(mi(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(s=0,n=i.length;s<n;++s)o=e.getPixelForValue(i[s]),l();for(r=void 0,s=0,n=e.ticks.length;s<n;++s)o=e.getPixelForTick(s),l();return a}function io(t,e,i,s){return Ze(t)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),r=Math.min(n,o),a=Math.max(n,o);let l=r,h=a;Math.abs(r)>Math.abs(a)&&(l=a,h=r),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:r,max:a}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function so(t,e,i,s){const n=t.iScale,o=t.vScale,r=n.getLabels(),a=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=a||n.parse(r[h],h),l.push(io(u,d,o,h));return l}function no(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function oo(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:r,end:a,reverse:l,top:h,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(o[ro(c,r,a,l)]=!0,n=h)),o[ro(n,r,a,l)]=!0,t.borderSkipped=o}function ro(t,e,i,s){var n,o,r;return s?(r=i,t=ao(t=(n=t)===(o=e)?r:n===r?o:n,i,e)):t=ao(t,e,i),t}function ao(t,e,i){return"start"===t?e:"end"===t?i:t}function lo(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class ho extends to{static id="doughnut";static 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"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,r=t=>+i[t];if(Qe(i[t])){const{key:t="value"}=this._parsing;r=e=>+pi(i[e],t)}for(n=t,o=t+e;n<o;++n)s._parsed[n]=r(n)}}_getRotation(){return Ri(this.options.rotation-90)}_getCircumference(){return Ri(this.options.circumference)}_getRotationExtents(){let t=_i,e=-_i;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min((h=r,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:+l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(t,e,i){let s=1,n=1,o=0,r=0;if(e<_i){const a=t,l=a+e,h=Math.cos(a),c=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(t,e,s)=>ji(t,a,l,!0)?1:Math.max(e,e*i,s,s*i),p=(t,e,s)=>ji(t,a,l,!0)?-1:Math.min(e,e*i,s,s*i),g=f(0,h,d),m=f(ki,c,u),b=p(yi,h,d),x=p(yi+ki,c,u);s=(g-b)/2,n=(m-x)/2,o=-(g+b)/2,r=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,x=(i.height-o)/p,y=Math.max(Math.min(b,x)/2,0),_=si(this.options.radius,y),v=(_-Math.max(_*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=m*_,s.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/_i)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,h=(r.top+r.bottom)/2,c=n&&a.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,s);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,n);for(g=e;g<e+i;++g){const e=this._circumference(g,n),i=t[g],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};p&&(o.options=f||this.resolveDataElementOptions(g,i.active?"active":s)),m+=e,this.updateElement(i,g,o,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?_i*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ds(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,r,a;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,r=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)a=r.resolveDataElementOptions(s),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(ii(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class co extends to{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ds(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return on.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,h=a.yCenter,c=a.getIndexAngle(0)-.5*yi;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,s,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,p=u+this._computeAngle(d,s,f),g=o.getDataVisibility(d)?a.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=p,n&&(r.animateScale&&(g=0),r.animateRotate&&(i=p=c));const m={x:l,y:h,innerRadius:0,outerRadius:g,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(d,e.active?"active":s)};this.updateElement(e,d,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ri(this.resolveDataElementOptions(t,e).angle||i):0}}var uo=Object.freeze({__proto__:null,BarController:class extends to{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return so(t,e,i,s)}parseArrayData(t,e,i,s){return so(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===n.axis?r:a,h="x"===o.axis?r:a,c=[];let d,u,f,p;for(d=i,u=i+s;d<u;++d)p=e[d],f={},f[n.axis]=n.parse(pi(p,l),d),c.push(io(pi(p,h),f,o,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,r=no(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const n="reset"===s,{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),l=r.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,s);for(let u=e;u<e+i;u++){const e=this.getParsed(u),i=n||Ge(e[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(u),f=this._calculateBarIndexPixels(u,h),p=(e._stacks||{})[r.axis],g={horizontal:l,base:i.base,enableBorderRadius:!p||no(e._custom)||o===p._top||o===p._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};d&&(g.options=c||this.resolveDataElementOptions(u,t[u].active?"active":s));const m=g.options||t[u].options;oo(g,m,p,o),lo(g,m,h.ratio),this.updateElement(t[u],u,g,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),n=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find((t=>t[i.axis]===a)),s=e&&e[t.vScale.axis];if(Ge(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!l(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter((i=>t[i].axis===e)).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[ii("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const r=t.barThickness;return{min:r||eo(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:n,minBarLength:o}}=this,r=n||0,a=this.getParsed(t),l=a._custom,h=no(l);let c,d,u=a[e.axis],f=0,p=i?this.applyStack(e,a,i):u;p!==u&&(f=p-u,p=u),h&&(u=l.barStart,p=l.barEnd-l.barStart,0!==u&&Ei(u)!==Ei(l.barEnd)&&(f=0),f+=u);const g=Ge(n)||h?f:n;let m=e.getPixelForValue(g);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(f+p):m,d=c-m,Math.abs(d)<o){d=function(t,e,i){return 0!==t?Ei(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),l=Math.min(t,n),f=Math.max(t,n);m=Math.max(Math.min(m,f),l),c=m+d,i&&!h&&(a._stacks[e.axis]._visualValues[s]=e.getValueForPixel(c)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=Ei(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=ii(s.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,h="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let r=t>0?n[t-1]:null,a=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===r&&(r=o-(null===a?e.end-e.start:a-o)),null===a&&(a=o+o-r);const h=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,s,i*l):function(t,e,i,s){const n=i.barThickness;let o,r;return Ge(n)?(o=e.min*i.categoryPercentage,r=i.barPercentage):(o=n*s,r=1),{chunk:o/s,ratio:r,start:e.pixels[t]-o/2}}(t,e,s,i*l),c="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(ii(c,this.getFirstScaleIdForIndexAxis())),u=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0)+d;r=h.start+h.chunk*u+h.chunk/2,a=Math.min(o,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(o,e.min*e.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[e.axis]||i[n].hidden||i[n].draw(this._ctx)}},BubbleController:class extends to{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=ii(s[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=ii(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),r=s.getLabelForValue(o.x),a=n.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,s),h=o.axis,c=r.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!n&&this.getParsed(d),u={},f=u[h]=n?o.getPixelForDecimal(.5):o.getPixelForValue(i[h]),p=u[c]=n?r.getBasePixel():r.getPixelForValue(i[c]);u.skip=isNaN(f)||isNaN(p),l&&(u.options=a||this.resolveDataElementOptions(d,e.active?"active":s),n&&(u.options.radius=0)),this.updateElement(e,d,u,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=ii(i&&i._custom,n),s}},DoughnutController:ho,LineController:class extends to{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:r,count:a}=Qi(e,s,o);this._drawStart=r,this._drawCount=a,ts(e)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(s,r,a,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:r,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,s),d=o.axis,u=r.axis,{spanGaps:f,segment:p}=this.options,g=Ai(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||n||"none"===s,b=e+i,x=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i<x;++i){const f=t[i],x=m?f:{};if(i<e||i>=b){x.skip=!0;continue}const _=this.getParsed(i),v=Ge(_[u]),w=x[d]=o.getPixelForValue(_[d],i),M=x[u]=n||v?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,_,a):_[u],i);x.skip=isNaN(w)||isNaN(M)||v,x.stop=i>0&&Math.abs(_[d]-y[d])>g,p&&(x.parsed=_,x.raw=l.data[i]),c&&(x.options=h||this.resolveDataElementOptions(i,f.active?"active":s)),m||this.updateElement(f,i,x,s),y=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends ho{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:co,RadarController:class extends to{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return on.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let r=e;r<e+i;r++){const e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":s),a=n.getPointPositionForValue(r,this.getParsed(r).r),l=o?n.xCenter:a.x,h=o?n.yCenter:a.y,c={x:l,y:h,angle:a.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,r,c,s)}}},ScatterController:class extends to{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),r=s.getLabelForValue(o.x),a=n.getLabelForValue(o.y);return{label:i[t]||"",value:"("+r+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:n,count:o}=Qi(e,i,s);if(this._drawStart=n,this._drawCount=o,ts(e)&&(n=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:n,_dataset:o}=e;n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const r=this.resolveDatasetElementOptions(t);r.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:r},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,n,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:r,_stacked:a,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),c=this.getSharedOptions(h),d=this.includeOptions(s,c),u=o.axis,f=r.axis,{spanGaps:p,segment:g}=this.options,m=Ai(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===s;let x=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=this.getParsed(h),p=b?e:{},y=Ge(i[f]),_=p[u]=o.getPixelForValue(i[u],h),v=p[f]=n||y?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,i,a):i[f],h);p.skip=isNaN(_)||isNaN(v)||y,p.stop=h>0&&Math.abs(i[u]-x[u])>m,g&&(p.parsed=i,p.raw=l.data[h]),d&&(p.options=c||this.resolveDataElementOptions(h,e.active?"active":s)),b||this.updateElement(e,h,p,s),x=i}this.updateSharedOptions(c,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,o)/2}}});function fo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class po{static override(t){Object.assign(po.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return fo()}parse(){return fo()}format(){return fo()}add(){return fo()}diff(){return fo()}startOf(){return fo()}endOf(){return fo()}}var go=po;function mo(t,e,i,s){const{controller:n,data:o,_sorted:r}=t,a=n._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?$i:Ui;if(!s){const s=r(o,e,i);if(l){const{vScale:e}=n._cachedMeta,{_parsed:i}=t,o=i.slice(0,s.lo+1).reverse().findIndex((t=>!Ge(t[e.axis])));s.lo-=Math.max(0,o);const r=i.slice(s.hi).findIndex((t=>!Ge(t[e.axis])));s.hi+=Math.max(0,r)}return s}if(n._sharedOptions){const t=o[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=r(o,e,i-s),n=r(o,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:o.length-1}}function bo(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:a}=o[t],{lo:l,hi:h}=mo(o[t],e,r,n);for(let t=l;t<=h;++t){const e=a[t];e.skip||s(e,i,t)}}}function xo(t,e,i,s,n){const o=[];return n||t.isPointInArea(e)?(bo(t,i,e,(function(i,r,a){(n||Os(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:r,index:a})}),!0),o):o}function yo(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?function(t,e,i,s,n,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return bo(t,i,e,(function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!o&&!t.isPointInArea(u)&&!d)return;const f=a(e,u);f<l?(r=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&r.push({element:i,datasetIndex:h,index:c})})),r}(t,e,i,s,n,o):function(t,e,i,s){let n=[];return bo(t,i,e,(function(t,i,o){const{startAngle:r,endAngle:a}=t.getProps(["startAngle","endAngle"],s),{angle:l}=Fi(t,{x:e.x,y:e.y});ji(l,r,a)&&n.push({element:t,datasetIndex:i,index:o})})),n}(t,e,i,n):[]}function _o(t,e,i,s,n){const o=[],r="x"===i?"inXRange":"inYRange";let a=!1;return bo(t,i,e,((t,s,l)=>{t[r]&&t[r](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),a=a||t.inRange(e.x,e.y,n))})),s&&!a?[]:o}var vo={evaluateInteractionItems:bo,modes:{index(t,e,i,s){const n=xn(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?xo(t,n,o,s,r):yo(t,n,o,!1,s,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=xn(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?xo(t,n,o,s,r):yo(t,n,o,!1,s,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,s)=>xo(t,xn(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=xn(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return yo(t,n,o,i.intersect,s,r)},x:(t,e,i,s)=>_o(t,xn(e,t),"x",i.intersect,s),y:(t,e,i,s)=>_o(t,xn(e,t),"y",i.intersect,s)}};const wo=["left","top","right","bottom"];function Mo(t,e){return t.filter((t=>t.pos===e))}function ko(t,e){return t.filter((t=>-1===wo.indexOf(t.pos)&&t.box.axis===e))}function So(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Oo(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Po(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Eo(t,e,i,s){const{pos:n,box:o}=i,r=t.maxPadding;if(!Qe(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&Po(r,o.getPadding());const a=Math.max(0,e.outerWidth-Oo(r,t,"left","right")),l=Math.max(0,e.outerHeight-Oo(r,t,"top","bottom")),h=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function Do(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}(t?["left","right"]:["top","bottom"])}function Co(t,e,i,s){const n=[];let o,r,a,l,h,c;for(o=0,r=t.length,h=0;o<r;++o){a=t[o],l=a.box,l.update(a.width||e.w,a.height||e.h,Do(a.horizontal,e));const{same:r,other:d}=Eo(e,i,a,s);h|=r&&n.length,c=c||d,l.fullSize||n.push(a)}return h&&Co(n,e,i,s)||c}function Ao(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function To(t,e,i,s){const n=i.padding;let{x:o,y:r}=e;for(const a of t){const t=a.box,l=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const s=e.w*h,o=l.size||t.height;mi(l.start)&&(r=l.start),t.fullSize?Ao(t,n.left,r,i.outerWidth-n.right-n.left,o):Ao(t,e.left+l.placed,r,s,o),l.start=r,l.placed+=s,r=t.bottom}else{const s=e.h*h,r=l.size||t.width;mi(l.start)&&(o=l.start),t.fullSize?Ao(t,o,n.top,r,i.outerHeight-n.bottom-n.top):Ao(t,o,e.top+l.placed,r,s),l.start=o,l.placed+=s,o=t.right}}e.x=o,e.y=r}var Ro={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=Vs(t.options.layout.padding),o=Math.max(e-n.width,0),r=Math.max(i-n.height,0),a=function(t){const e=function(t){const e=[];let i,s,n,o,r,a;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:r,stackWeight:a=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return e}(t),i=So(e.filter((t=>t.box.fullSize)),!0),s=So(Mo(e,"left"),!0),n=So(Mo(e,"right")),o=So(Mo(e,"top"),!0),r=So(Mo(e,"bottom")),a=ko(e,"x"),l=ko(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Mo(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;oi(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/c,hBoxMaxHeight:r/2}),u=Object.assign({},n);Po(u,Vs(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!wo.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,r,a;for(o=0,r=t.length;o<r;++o){a=t[o];const{fullSize:r}=a.box,l=i[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*s:r&&e.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:r&&e.availableHeight)}return i}(l.concat(h),d);Co(a.fullSize,f,d,p),Co(l,f,d,p),Co(h,f,d,p)&&Co(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),To(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,To(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},oi(a.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Lo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Io extends Lo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fo="$chartjs",zo={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},No=t=>null===t||""===t,Bo=!!vn&&{passive:!0};function jo(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,Bo)}function Vo(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Wo(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Vo(i.addedNodes,s),e=e&&!Vo(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Ho(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Vo(i.removedNodes,s),e=e&&!Vo(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const Uo=new Map;let $o=0;function qo(){const t=window.devicePixelRatio;t!==$o&&($o=t,Uo.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Yo(t,e,i){const s=t.canvas,n=s&&fn(s);if(!n)return;const o=Ji(((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i()}),window),r=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return r.observe(n),function(t,e){Uo.size||window.addEventListener("resize",qo),Uo.set(t,e)}(t,o),r}function Xo(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Uo.delete(t),Uo.size||window.removeEventListener("resize",qo)}(t)}function Ko(t,e,i){const s=t.canvas,n=Ji((e=>{null!==t.ctx&&i(function(t,e){const i=zo[t.type]||t.type,{x:s,y:n}=xn(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,Bo)}(s,e,n),n}class Jo extends Lo{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[Fo]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",No(n)){const e=wn(t,"width");void 0!==e&&(t.width=e)}if(No(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=wn(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Fo])return!1;const i=e[Fo].initial;["height","width"].forEach((t=>{const s=i[t];Ge(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[Fo],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Wo,detach:Ho,resize:Yo}[e]||Ko;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:Xo,detach:Xo,resize:Xo}[e]||jo)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){const n=gn(t),o=bn(n,"margin"),r=pn(n.maxWidth,t,"clientWidth")||wi,a=pn(n.maxHeight,t,"clientHeight")||wi,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&fn(t);if(o){const t=o.getBoundingClientRect(),r=gn(o),a=bn(r,"border","width"),l=bn(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,s=pn(r.maxWidth,o,"clientWidth"),n=pn(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||wi,maxHeight:n||wi}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=bn(n,"border","width"),e=bn(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=yn(Math.min(h,r,l.maxWidth)),c=yn(Math.min(c,a,l.maxHeight)),h&&!c&&(c=yn(h/2)),(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=yn(Math.floor(c*s))),{width:h,height:c}}(t,e,i,s)}isAttached(t){const e=t&&fn(t);return!(!e||!e.isConnected)}}class Go{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ai(this.x)&&Ai(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function Zo(t,e,i,s,n){const o=ii(s,0),r=Math.min(ii(n,t.length),t.length);let a,l,h,c=0;for(i=Math.ceil(i),n&&(a=n-s,i=a/Math.floor(a/i)),h=o;h<0;)c++,h=Math.round(o+c*i);for(l=Math.max(o,0);l<r;l++)l===h&&(e.push(t[l]),c++,h=Math.round(o+c*i))}const Qo=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,tr=(t,e)=>Math.min(e||t,t);function er(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function ir(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,r=t._endPixel,a=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,r-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-a||h>r+a)))return h}function sr(t){return t.drawTicks?t.tickLength:0}function nr(t,e){if(!t.display)return 0;const i=Ws(t.font,e),s=Vs(t.padding);return(Ze(t.text)?t.text.length:1)*i.lineHeight+s.height}function or(t,e,i){let s=Gi(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class rr extends Go{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=ei(t,Number.POSITIVE_INFINITY),e=ei(e,Number.NEGATIVE_INFINITY),i=ei(i,Number.POSITIVE_INFINITY),s=ei(s,Number.NEGATIVE_INFINITY),{min:ei(t,i),max:ei(e,s),minDefined:ti(t),maxDefined:ti(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;a<l;++a)e=r[a].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:ei(i,ei(s,i)),max:ei(s,ei(i,s))}}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(){ni(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:s,max:n}=t,o=si(e,(n-s)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(s,-Math.abs(o)),max:r(n,o)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?er(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){const i=t.options.ticks,s=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),n=Math.min(i.maxTicksLimit||s,s),o=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=o.length,a=o[0],l=o[r-1],h=[];if(r>n)return function(t,e,i,s){let n,o=0,r=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===r&&(e.push(t[n]),o++,r=i[o*s])}(e,h,o,r/n),h;const c=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=function(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(o,e,n);if(r>0){let t,i;const s=r>1?Math.round((l-a)/(r-1)):null;for(Zo(e,h,c,Ge(s)?0:a-s,a),t=0,i=r-1;t<i;t++)Zo(e,h,c,o[t],o[t+1]);return Zo(e,h,c,l,Ge(s)?e.length:l+s),h}return Zo(e,h,c),h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ni(this.options.afterUpdate,[this])}beforeSetDimensions(){ni(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(){ni(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ni(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ni(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=ni(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){ni(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ni(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=tr(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,n=e.maxRotation;let o,r,a,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=Vi(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-sr(t.grid)-e.padding-nr(t.title,this.chart.options.font),a=Math.sqrt(c*c+d*d),l=Li(Math.min(Math.asin(Vi((h.highest.height+6)/o,-1,1)),Math.asin(Vi(r/a,-1,1))-Math.asin(Vi(d/a,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){ni(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ni(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=nr(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=sr(n)+o):(t.height=this.maxHeight,t.width=sr(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),a=2*i.padding,l=Ri(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(r){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;a?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+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(){ni(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)Ge(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=er(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:n}=this,o=[],r=[],a=Math.floor(e/tr(e,i));let l,h,c,d,u,f,p,g,m,b,x,y=0,_=0;for(l=0;l<e;l+=a){if(d=t[l].label,u=this._resolveTickFontOptions(l),s.font=f=u.string,p=n[f]=n[f]||{data:{},gc:[]},g=u.lineHeight,m=b=0,Ge(d)||Ze(d)){if(Ze(d))for(h=0,c=d.length;h<c;++h)x=d[h],Ge(x)||Ze(x)||(m=_s(s,p.data,p.gc,m,x),b+=g)}else m=_s(s,p.data,p.gc,m,d),b=g;o.push(m),r.push(b),y=Math.max(m,y),_=Math.max(b,_)}!function(t,e){oi(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}}))}(n,e);const v=o.indexOf(y),w=r.indexOf(_),M=t=>({width:o[t]||0,height:r[t]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Vi(this._alignToPixels?ws(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return Us(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Us(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Ri(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,r=n?n.widest.width+o:0,a=n?n.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:r}=s,a=n.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),c=sr(n),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return ws(i,t,f)};let m,b,x,y,_,v,w,M,k,S,O,P;if("top"===o)m=g(this.bottom),v=this.bottom-c,M=m-p,S=g(t.top)+p,P=t.bottom;else if("bottom"===o)m=g(this.top),S=t.top,P=g(t.bottom)-p,v=m+p,M=this.top+c;else if("left"===o)m=g(this.right),_=this.right-c,w=m-p,k=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),k=t.left,O=g(t.right)-p,_=m+p,w=this.left+c;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Qe(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,v=m+p,M=v+c}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Qe(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}_=m-p,w=_-c,k=t.left,O=t.right}const E=ii(s.ticks.maxTicksLimit,h),D=Math.max(1,Math.ceil(h/E));for(b=0;b<h;b+=D){const t=this.getContext(b),e=n.setContext(t),s=r.setContext(t),o=e.lineWidth,h=e.color,c=s.dash||[],u=s.dashOffset,f=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;x=ir(this,b,a),void 0!==x&&(y=ws(i,x,o),l?_=w=k=O=y:v=M=S=P=y,d.push({tx1:_,ty1:v,tx2:w,ty2:M,x1:k,y1:S,x2:O,y2:P,width:o,color:h,borderDash:c,borderDashOffset:u,tickWidth:f,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=h,this._borderValue=m,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:l,padding:h,mirror:c}=n,d=sr(i.grid),u=d+h,f=c?-h:u,p=-Ri(this.labelRotation),g=[];let m,b,x,y,_,v,w,M,k,S,O,P,E="middle";if("top"===s)v=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===s)v=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,_=t.x}else if("x"===e){if("center"===s)v=(t.top+t.bottom)/2+u;else if(Qe(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)_=(t.left+t.right)/2-u;else if(Qe(s)){const t=Object.keys(s)[0],e=s[t];_=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===a?E="top":"end"===a&&(E="bottom"));const D=this._getLabelSizes();for(m=0,b=r.length;m<b;++m){x=r[m],y=x.label;const t=n.setContext(this.getContext(m));M=this.getPixelForTick(m)+n.labelOffset,k=this._resolveTickFontOptions(m),S=k.lineHeight,O=Ze(y)?y.length:1;const e=O/2,i=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let d,u=w;if(o?(_=M,"inner"===w&&(u=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),P="top"===s?"near"===l||0!==p?-O*S+S/2:"center"===l?-D.highest.height/2-e*S+S:-D.highest.height+S/2:"near"===l||0!==p?S/2:"center"===l?D.highest.height/2-e*S:D.highest.height-O*S,c&&(P*=-1),0===p||t.showLabelBackdrop||(_+=S/2*Math.sin(p))):(v=M,P=(1-O)*S/2),t.showLabelBackdrop){const e=Vs(t.backdropPadding),i=D.heights[m],s=D.widths[m];let n=P-e.top,o=0-e.left;switch(E){case"middle":n-=i/2;break;case"bottom":n-=i}switch(w){case"center":o-=s/2;break;case"right":o-=s;break;case"inner":m===b-1?o-=s:m>0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:k,textOffset:P,options:{rotation:p,color:i,strokeColor:a,strokeWidth:h,textAlign:u,textBaseline:E,translation:[_,v],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ri(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?s?(l=this.right+n,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const r=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,n=i.setContext(this.getContext()),o=i.display?n.width:0;if(!o)return;const r=s.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,h,c,d;this.isHorizontal()?(l=ws(t,this.left,o)-o/2,h=ws(t,this.right,r)+r/2,c=d=a):(c=ws(t,this.top,o)-o/2,d=ws(t,this.bottom,r)+r/2,l=h=a),e.save(),e.lineWidth=n.width,e.strokeStyle=n.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Ps(e,i);const s=this.getLabelItems(t);for(const t of s){const i=t.options,s=t.font;Rs(e,t.label,0,t.textOffset,s,i)}i&&Es(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const n=Ws(i.font),o=Vs(i.padding),r=i.align;let a=n.lineHeight/2;"bottom"===e||"center"===e||Qe(e)?(a+=o.bottom,Ze(i.text)&&(a+=n.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:l,titleY:h,maxWidth:c,rotation:d}=function(t,e,i,s){const{top:n,left:o,bottom:r,right:a,chart:l}=t,{chartArea:h,scales:c}=l;let d,u,f,p=0;const g=r-n,m=a-o;if(t.isHorizontal()){if(u=Zi(s,o,a),Qe(i)){const t=Object.keys(i)[0],s=i[t];f=c[t].getPixelForValue(s)+g-e}else f="center"===i?(h.bottom+h.top)/2+g-e:Qo(t,i,e);d=a-o}else{if(Qe(i)){const t=Object.keys(i)[0],s=i[t];u=c[t].getPixelForValue(s)-m+e}else u="center"===i?(h.left+h.right)/2-m+e:Qo(t,i,e);f=Zi(s,r,n),p="left"===i?-ki:ki}return{titleX:u,titleY:f,maxWidth:d,rotation:p}}(this,a,e,r);Rs(t,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:d,textAlign:or(r,e,s),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=ii(t.grid&&t.grid.z,-1),s=ii(t.border&&t.border.z,0);return this._isVisible()&&this.draw===rr.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){return Ws(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ar{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=ci(Object.create(null),[i?ys.get(i):{},ys.get(e),t.defaults]);ys.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");ys.route(o,n,l,a)}))}(e,t.defaultRoutes),t.descriptors&&ys.describe(e,t.descriptors)}(t,o,i),this.override&&ys.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in ys[s]&&(delete ys[s][i],this.override&&delete ps[i])}}class lr{constructor(){this.controllers=new ar(to,"datasets",!0),this.elements=new ar(Go,"elements"),this.plugins=new ar(Object,"plugins"),this.scales=new ar(rr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):oi(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=gi(t);ni(i["before"+s],[],i),e[t](i),ni(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var hr=new lr;class cr{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===ni(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){Ge(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=ii(i.options&&i.options.plugins,{}),n=function(t){const e={},i=[],s=Object.keys(hr.plugins.items);for(let t=0;t<s.length;t++)i.push(hr.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){const o=[],r=t.getContext();for(const a of e){const e=a.id,l=dr(s[e],n);null!==l&&o.push({plugin:a,options:ur(t.config,{plugin:a,local:i[e]},l,r)})}return o}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function dr(t,e){return e||!1!==t?!0===t?{}:t:null}function ur(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(s,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function fr(t,e){const i=ys.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function pr(t){if("x"===t||"y"===t||"r"===t)return t}function gr(t,...e){if(pr(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&pr(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function mr(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function br(t){const e=t.options||(t.options={});e.plugins=ii(e.plugins,{}),e.scales=function(t,e){const i=ps[t.type]||{scales:{}},s=e.scales||{},n=fr(t.type,e),o=Object.create(null);return Object.keys(s).forEach((e=>{const r=s[e];if(!Qe(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=gr(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return mr(t,"x",i[0])||mr(t,"y",i[0])}return{}}(e,t),ys.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,n),h=i.scales||{};o[e]=di(Object.create(null),[{axis:a},r,h[a],h[l]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,r=i.indexAxis||fr(n,e),a=(ps[n]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),di(o[n],[{axis:e},s[n],a[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];di(e,[ys.scales[e.type],ys.scale])})),o}(t,e)}function xr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const yr=new Map,_r=new Set;function vr(t,e){let i=yr.get(t);return i||(i=e(),yr.set(t,i),_r.add(i)),i}const wr=(t,e,i)=>{const s=pi(e,i);void 0!==s&&t.add(s)};class Mr{constructor(t){this._config=function(t){return(t=t||{}).data=xr(t.data),br(t),t}(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=xr(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(),br(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return vr(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return vr(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return vr(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return vr(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>wr(a,t,e)))),e.forEach((t=>wr(a,s,t))),e.forEach((t=>wr(a,ps[n]||{},t))),e.forEach((t=>wr(a,ys,t))),e.forEach((t=>wr(a,gs,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),_r.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ps[e]||{},ys.datasets[e]||{},{type:e},ys,gs]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:r}=kr(this._resolverCache,t,s);let a=o;(function(t,e){const{isScriptable:i,isIndexable:s}=Ys(t);for(const n of e){const e=i(n),o=s(n),r=(o||e)&&t[n];if(e&&(bi(r)||Sr(r))||o&&Ze(r))return!0}return!1})(o,e)&&(n.$shared=!1,a=qs(o,i=bi(i)?i():i,this.createResolver(t,i,r)));for(const t of e)n[t]=a[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=kr(this._resolverCache,t,i);return Qe(e)?qs(n,e,void 0,s):n}}function kr(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);return o||(o={resolver:$s(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)),o}const Sr=t=>Qe(t)&&Object.getOwnPropertyNames(t).some((e=>bi(t[e]))),Or=["top","bottom","left","right","chartArea"];function Pr(t,e){return"top"===t||"bottom"===t||-1===Or.indexOf(t)&&"x"===e}function Er(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Dr(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),ni(i&&i.onComplete,[t],e)}function Cr(t){const e=t.chart,i=e.options.animation;ni(i&&i.onProgress,[t],e)}function Ar(t){return un()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Tr={},Rr=t=>{const e=Ar(t);return Object.values(Tr).filter((t=>t.canvas===e)).pop()};function Lr(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class Ir{static defaults=ys;static instances=Tr;static overrides=ps;static registry=hr;static version="4.5.0";static getChart=Rr;static register(...t){hr.add(...t),Fr()}static unregister(...t){hr.remove(...t),Fr()}constructor(t,e){const i=this.config=new Mr(e),s=Ar(t),n=Rr(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!un()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Io:Jo}(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,h=a&&a.width;this.id=Je(),this.ctx=r,this.canvas=a,this.width=h,this.height=l,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 cr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Tr[this.id]=this,r&&a?(Nn.listen(this,"complete",Dr),Nn.listen(this,"progress",Cr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return Ge(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return hr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_n(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ms(this.canvas,this.ctx),this}stop(){return Nn.stop(this),this}resize(t,e){Nn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,_n(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ni(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){oi(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=gr(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),oi(n,(e=>{const n=e.options,o=n.id,r=gr(o,n),a=ii(n.type,e.dtype);void 0!==n.position&&Pr(n.position,r)===Pr(e.dposition)||(n.position=e.dposition),s[o]=!0;let l=null;o in i&&i[o].type===a?l=i[o]:(l=new(hr.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(n,t)})),oi(s,((t,e)=>{t||delete i[e]})),oi(i,(t=>{Ro.configure(this,t,t.options),Ro.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Er("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||fr(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=hr.getController(o),{datasetElementType:s,dataElementType:r}=ys.datasets[o];Object.assign(e,{dataElementType:hr.getElement(r),datasetElementType:s&&hr.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){oi(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||oi(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Er("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){oi(this.scales,(t=>{Ro.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);xi(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)Lr(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!xi(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Ro.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],oi(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,bi(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Nn.has(this)?this.attached&&!Nn.running(this)&&Nn.start(this):(this.draw(),Dr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Fn(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(s&&Ps(e,s),t.controller.draw(),s&&Es(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Os(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=vo.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Us(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);mi(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Nn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ms(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Tr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};oi(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){oi(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},oi(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,r,a;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!ri(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),r=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,r=this._getActiveElements(t,s,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,ni(n.onHover,[t,r,this],this),a&&ni(n.onClick,[t,r,this],this));const h=!ri(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Fr(){return oi(Ir.instances,(t=>t._plugins.invalidate()))}function zr(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Nr(t,e,i,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let f=0;const p=n-l;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;f=(p-(0!==t?p*t/(t+s):p))/2}const g=(p-Math.max(.001,p*d-i/yi)/d)/2,m=l+g+f,b=n-g-f,{outerStart:x,outerEnd:y,innerStart:_,innerEnd:v}=function(t,e,i,s){const n=Ns(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,r=Math.min(o,s*e/2),a=t=>{const e=(i-Math.min(o,t))*s/2;return Vi(t,0,Math.min(o,e))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Vi(n.innerStart,0,r),innerEnd:Vi(n.innerEnd,0,r)}}(e,u,d,b-m),w=d-x,M=d-y,k=m+x/w,S=b-y/M,O=u+_,P=u+v,E=m+_/O,D=b-v/P;if(t.beginPath(),o){const e=(k+S)/2;if(t.arc(r,a,d,k,e),t.arc(r,a,d,e,S),y>0){const e=zr(M,S,r,a);t.arc(e.x,e.y,y,S,b+ki)}const i=zr(P,b,r,a);if(t.lineTo(i.x,i.y),v>0){const e=zr(P,D,r,a);t.arc(e.x,e.y,v,b+ki,D+Math.PI)}const s=(b-v/u+(m+_/u))/2;if(t.arc(r,a,u,b-v/u,s,!0),t.arc(r,a,u,s,m+_/u,!0),_>0){const e=zr(O,E,r,a);t.arc(e.x,e.y,_,E+Math.PI,m-ki)}const n=zr(w,m,r,a);if(t.lineTo(n.x,n.y),x>0){const e=zr(w,k,r,a);t.arc(e.x,e.y,x,m-ki,k)}}else{t.moveTo(r,a);const e=Math.cos(k)*d+r,i=Math.sin(k)*d+a;t.lineTo(e,i);const s=Math.cos(S)*d+r,n=Math.sin(S)*d+a;t.lineTo(s,n)}t.closePath()}function Br(t,e,i=e){t.lineCap=ii(i.borderCapStyle,e.borderCapStyle),t.setLineDash(ii(i.borderDash,e.borderDash)),t.lineDashOffset=ii(i.borderDashOffset,e.borderDashOffset),t.lineJoin=ii(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ii(i.borderWidth,e.borderWidth),t.strokeStyle=ii(i.borderColor,e.borderColor)}function jr(t,e,i){t.lineTo(i.x,i.y)}function Vr(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:r,end:a}=e,l=Math.max(n,r),h=Math.min(o,a),c=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Wr(t,e,i,s){const{points:n,options:o}=e,{count:r,start:a,loop:l,ilen:h}=Vr(n,i,s),c=function(t){return t.stepped?Ds:t.tension||"monotone"===t.cubicInterpolationMode?Cs:jr}(o);let d,u,f,{move:p=!0,reverse:g}=s||{};for(d=0;d<=h;++d)u=n[(a+(g?h-d:d))%r],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):c(t,f,u,g,o.stepped),f=u);return l&&(u=n[(a+(g?h:0))%r],c(t,f,u,g,o.stepped)),!!l}function Hr(t,e,i,s){const n=e.points,{count:o,start:r,ilen:a}=Vr(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,p,g,m=0,b=0;const x=t=>(r+(h?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=a;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>p&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=s,b=0,f=p=i),g=i}y()}function Ur(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Wr:Hr}const $r="function"==typeof Path2D;class qr extends Go{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;dn(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return function(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=Rn(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=a?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=Rn(s.setContext(Us(n,{type:"segment",p0:o,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Ln(e,c)&&f(d,u-1,t.loop,c),o=a,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}(t,!0===s?[{start:r,end:a,loop:o}]:function(t,e,i,s){const n=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(r-1)%n,loop:s}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%n,end:a%n,loop:s}),o}(i,r,a<r?a+n:a,!!t._fullLoop&&0===r&&a===n-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=Tn(this,{property:e,start:s,end:s});if(!o.length)return;const r=[],a=function(t){return t.stepped?kn:t.tension||"monotone"===t.cubicInterpolationMode?Sn:Mn}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],d=n[h],u=n[c];if(d===u){r.push(d);continue}const f=a(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],r.push(f)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Ur(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Ur(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of s)o&=n(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){$r&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Br(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,r=Ur(e);for(const a of n)Br(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Yr(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}function Xr(t,e){const{x:i,y:s,base:n,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let a,l,h,c,d;return t.horizontal?(d=r/2,a=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=o/2,a=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:a,top:h,right:l,bottom:c}}function Kr(t,e,i,s){return t?0:Vi(e,i,s)}function Jr(t,e,i,s){const n=null===e,o=null===i,r=t&&!(n&&o)&&Xr(t,s);return r&&(n||Wi(e,r.left,r.right))&&(o||Wi(i,r.top,r.bottom))}function Gr(t,e){t.rect(e.x,e.y,e.w,e.h)}function Zr(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,r=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+r,radius:t.radius}}var Qr=Object.freeze({__proto__:null,ArcElement:class extends Go{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=Fi(s,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=ii(c,a-r),f=ji(n,r,a)&&r!==a,p=u>=_i||f,g=Wi(o,l+d,h+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,h=(s+n)/2,c=(o+r+l+a)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>_i?Math.floor(i/_i):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const a=s*(1-Math.sin(Math.min(yi,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,n){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Nr(t,e,i,s,l,n);for(let e=0;e<o;++e)t.fill();isNaN(a)||(l=r+(a%_i||_i))}Nr(t,e,i,s,l,n),t.fill()}(t,this,a,n,o),function(t,e,i,s,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!h)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let g=e.endAngle;if(o){Nr(t,e,i,s,g,n);for(let e=0;e<o;++e)t.stroke();isNaN(a)||(g=r+(a%_i||_i))}p&&function(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=e;let h=n/a;t.beginPath(),t.arc(o,r,a,s-h,i+h),l>n?(h=n/l,t.arc(o,r,l,i+h,s-h,!0)):t.arc(o,r,n,i+ki,s-ki),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=yi&&0===f&&"miter"!==c&&function(t,e,i){const{startAngle:s,x:n,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:h,borderJoinStyle:c}=l,d=Math.min(h/r,Bi(s-i));if(t.beginPath(),t.arc(n,o,r-h/2,s+d/2,i-d/2),a>0){const e=Math.min(h/a,Bi(s-i));t.arc(n,o,a+h/2,i-e/2,s+e/2,!0)}else{const e=Math.min(h/2,r*Bi(s-i));if("round"===c)t.arc(n,o,e,i-yi/2,s+yi/2,!0);else if("bevel"===c){const r=2*e*e,a=-r*Math.cos(i+yi/2)+n,l=-r*Math.sin(i+yi/2)+o,h=r*Math.cos(s+yi/2)+n,c=r*Math.sin(s+yi/2)+o;t.lineTo(a,l),t.lineTo(h,c)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Nr(t,e,i,s,g,n),t.stroke())}(t,this,a,n,o),t.restore()}},BarElement:class extends Go{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=function(t){const e=Xr(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=Bs(s);return{t:Kr(n.top,o.top,0,i),r:Kr(n.right,o.right,0,e),b:Kr(n.bottom,o.bottom,0,i),l:Kr(n.left,o.left,0,e)}}(t,i/2,s/2),o=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=js(n),r=Math.min(e,i),a=t.borderSkipped,l=s||Qe(n);return{topLeft:Kr(!l||a.top||a.left,o.topLeft,0,r),topRight:Kr(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Kr(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Kr(!l||a.bottom||a.right,o.bottomRight,0,r)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}(this),r=(a=o.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?Ls:Gr;var a;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),r(t,Zr(o,e,n)),t.clip(),r(t,Zr(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Zr(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Jr(this,t,e,i)}inXRange(t,e){return Jr(this,t,null,e)}inYRange(t,e){return Jr(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:qr,PointElement:class extends Go{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Yr(this,t,"x",e)}inYRange(t,e){return Yr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Os(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ks(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});const ta=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ea=ta.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function ia(t){return ta[t%ta.length]}function sa(t){return ea[t%ea.length]}function na(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var oa={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:o}=n,r=na(s)||(a=n)&&(a.borderColor||a.backgroundColor)||o&&na(o)||"rgba(0,0,0,0.1)"!==ys.borderColor||"rgba(0,0,0,0.1)"!==ys.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=function(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof ho?e=function(t,e){return t.backgroundColor=t.data.map((()=>ia(e++))),e}(i,e):n instanceof co?e=function(t,e){return t.backgroundColor=t.data.map((()=>sa(e++))),e}(i,e):n&&(e=function(t,e){return t.borderColor=ia(e),t.backgroundColor=sa(e),++e}(i,e))}}(t);s.forEach(l)}};function ra(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function aa(t){t.data.datasets.forEach((t=>{ra(t)}))}var la={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void aa(t);const s=t.width;t.data.datasets.forEach(((e,n)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(n),l=o||e.data;if("y"===Hs([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const h=t.scales[a.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let c,{start:d,count:u}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=Vi(Ui(e,o.axis,r).lo,0,i-1)),s=h?Vi(Ui(e,o.axis,a).hi+1,n,i)-n:i-n,{start:n,count:s}}(a,l);if(u<=(i.threshold||4*s))ra(e);else{switch(Ge(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":c=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,p,g=e;for(r[l++]=t[g],c=0;c<o-2;c++){let s,n=0,o=0;const h=Math.floor((c+1)*a)+1+e,m=Math.min(Math.floor((c+2)*a)+1,i)+e,b=m-h;for(s=h;s<m;s++)n+=t[s].x,o+=t[s].y;n/=b,o/=b;const x=Math.floor(c*a)+1+e,y=Math.min(Math.floor((c+1)*a)+1,i)+e,{x:_,y:v}=t[g];for(u=f=-1,s=x;s<y;s++)f=.5*Math.abs((_-n)*(t[s].y-v)-(_-t[s].x)*(o-v)),f>u&&(u=f,d=t[s],p=s);r[l++]=d,g=p}return r[l++]=t[h],r}(l,d,u,s,i);break;case"min-max":c=function(t,e,i,s){let n,o,r,a,l,h,c,d,u,f,p=0,g=0;const m=[],b=e+i-1,x=t[e].x,y=t[b].x-x;for(n=e;n<e+i;++n){o=t[n],r=(o.x-x)/y*s,a=o.y;const e=0|r;if(e===l)a<u?(u=a,h=n):a>f&&(f=a,c=n),p=(g*p+o.x)/++g;else{const i=n-1;if(!Ge(h)&&!Ge(c)){const e=Math.min(h,c),s=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:p}),s!==d&&s!==i&&m.push({...t[s],x:p})}n>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,h=c=d=n}}return m}(l,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=c}}))},destroy(t){aa(t)}};function ha(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=Bi(n),o=Bi(o)),{property:t,start:n,end:o}}function ca(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function da(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function ua(t,e){let i=[],s=!1;return Ze(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=ca(t,e,n);const r=n[t],a=n[e];null!==s?(o.push({x:r.x,y:s}),o.push({x:a.x,y:s})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))})),o}(t,e),i.length?new qr({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function fa(t){return t&&!1!==t.fill}function pa(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!ti(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function ga(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=ii(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if(Qe(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return ti(n)&&Math.floor(n)===n?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function ma(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:r,last:a,point:l}=ba(o,e,"x");if(!(!l||r&&a))if(r)s.unshift(l);else if(t.push(l),!a)break}t.push(...s)}function ba(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,r=t.points;let a=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],s=r[e.start][i],h=r[e.end][i];if(Wi(n,s,h)){a=n===s,l=n===h;break}}return{first:a,last:l,point:s}}class xa{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:_i},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function ya(t,e,i){const s=function(t){const{chart:e,fill:i,line:s}=t;if(ti(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,r=s.points,a=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);a.push(ua({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)ma(n,r[t],a)}return new qr({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,r=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:Qe(t)?t.value:e.getBaseValue(),s}(i,e,o),a=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,o);return new xa({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<n;++t)a.push(e.getPointPositionForValue(t,r));return a}(t):function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:Qe(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(ti(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof xa?n:ua(n,s)}(e),{chart:n,index:o,line:r,scale:a,axis:l}=e,h=r.options,c=h.fill,d=h.backgroundColor,{above:u=d,below:f=d}=c||{},p=n.getDatasetMeta(o),g=Fn(n,p);s&&r.points.length&&(Ps(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:r,scale:a,clip:l}=e,h=i._loop?"angle":e.axis;t.save();let c=o;o!==n&&("x"===h?(_a(t,s,r.top),wa(t,{line:i,target:s,color:n,scale:a,property:h,clip:l}),t.restore(),t.save(),_a(t,s,r.bottom)):"y"===h&&(va(t,s,r.left),wa(t,{line:i,target:s,color:o,scale:a,property:h,clip:l}),t.restore(),t.save(),va(t,s,r.right),c=n)),wa(t,{line:i,target:s,color:c,scale:a,property:h,clip:l}),t.restore()}(t,{line:r,target:s,above:u,below:f,area:i,scale:a,axis:l,clip:g}),Es(t))}function _a(t,e,i){const{segments:s,points:n}=e;let o=!0,r=!1;t.beginPath();for(const a of s){const{start:s,end:l}=a,h=n[s],c=n[ca(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function va(t,e,i){const{segments:s,points:n}=e;let o=!0,r=!1;t.beginPath();for(const a of s){const{start:s,end:l}=a,h=n[s],c=n[ca(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(i,h.y),t.lineTo(h.x,h.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function wa(t,e){const{line:i,target:s,property:n,color:o,scale:r,clip:a}=e,l=function(t,e,i){const s=t.segments,n=t.points,o=e.points,r=[];for(const t of s){let{start:s,end:a}=t;a=ca(s,a,n);const l=ha(i,n[s],n[a],t.loop);if(!e.segments){r.push({source:t,target:l,start:n[s],end:n[a]});continue}const h=Tn(e,l);for(const e of h){const s=ha(i,o[e.start],o[e.end],e.loop),a=An(t,n,s);for(const t of a)r.push({source:t,target:e,start:{[i]:da(l,s,"start",Math.max)},end:{[i]:da(l,s,"end",Math.min)}})}}return r}(i,s,n);for(const{source:e,target:h,start:c,end:d}of l){const{style:{backgroundColor:l=o}={}}=e,u=!0!==s;t.save(),t.fillStyle=l,Ma(t,r,a,u&&ha(n,c,d)),t.beginPath();const f=!!i.pathSegment(t,e);let p;if(u){f?t.closePath():ka(t,s,d,n);const e=!!s.pathSegment(t,h,{move:f,reverse:!0});p=f&&e,p||ka(t,s,c,n)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function Ma(t,e,i,s){const n=e.chart.chartArea,{property:o,start:r,end:a}=s||{};if("x"===o||"y"===o){let e,s,l,h;"x"===o?(e=r,s=n.top,l=a,h=n.bottom):(e=n.left,s=r,l=n.right,h=a),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),s=Math.max(s,i.top),h=Math.min(h,i.bottom)),t.rect(e,s,l-e,h-s),t.clip()}}function ka(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var Sa={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<s;++r)o=t.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof qr&&(l={visible:t.isDatasetVisible(r),index:r,fill:ga(a,r,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<s;++r)l=n[r],l&&!1!==l.fill&&(l.fill=pa(n,r,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&ya(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;fa(i)&&ya(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;fa(s)&&"beforeDatasetDraw"===i.drawTime&&ya(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Oa=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Pa extends Go{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=ni(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Ws(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=Oa(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,r,a)+10):(h=this.maxHeight,l=this._fitCols(o,s,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+r;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const p=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),a[f]={left:0,top:u,row:d,width:p,height:s},l[l.length-1]+=p+r})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce(((t,e)=>t.length>e.length?t:e))),e+i.size/2+s.measureText(n).width}(s,t,e,i),r=function(t,e,i){let s=t;return"string"!=typeof e.text&&(s=Ea(e,i)),s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,n,t,s);o>0&&u+m+2*r>h&&(c+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=On(n,this.left,this.width);if(this.isHorizontal()){let n=0,r=Zi(i,this.left+s,this.right-this.lineWidths[n]);for(const a of e)n!==a.row&&(n=a.row,r=Zi(i,this.left+s,this.right-this.lineWidths[n])),a.top+=this.top+t+s,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+s}else{let n=0,r=Zi(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const a of e)a.col!==n&&(n=a.col,r=Zi(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),a.top=r,a.left+=this.left+s,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Ps(t,this),this._draw(),Es(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:o}=t,r=ys.color,a=On(t.rtl,this.left,this.width),l=Ws(o.font),{padding:h}=o,c=l.size,d=c/2;let u;this.drawTitle(),s.textAlign=a.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=Oa(o,c),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Zi(n,this.left+h,this.right-i[0]),y:this.top+h+b,line:0}:{x:this.left+h,y:Zi(n,this.top+b+h,this.bottom-e[0].height),line:0},Pn(this.ctx,t.textDirection);const x=g+h;this.legendItems.forEach(((y,_)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;const v=s.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),M=f+d+v;let k=u.x,S=u.y;if(a.setWidth(this.width),m?_>0&&k+M+h>this.right&&(S=u.y+=x,u.line++,k=u.x=Zi(n,this.left+h,this.right-i[u.line])):_>0&&S+x>this.bottom&&(k=u.x=k+e[u.line].width+h,u.line++,S=u.y=Zi(n,this.top+b+h,this.bottom-e[u.line].height)),function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;s.save();const n=ii(i.lineWidth,1);if(s.fillStyle=ii(i.fillStyle,r),s.lineCap=ii(i.lineCap,"butt"),s.lineDashOffset=ii(i.lineDashOffset,0),s.lineJoin=ii(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=ii(i.strokeStyle,r),s.setLineDash(ii(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=a.xPlus(t,f/2);Ss(s,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((c-p)/2,0),r=a.leftForLtr(t,f),l=js(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?Ls(s,{x:r,y:o,w:f,h:p,radius:l}):s.rect(r,o,f,p),s.fill(),0!==n&&s.stroke()}s.restore()}(a.x(k),S,y),k=((t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e)(w,k+f+d,m?k+M:this.right,t.rtl),function(t,e,i){Rs(s,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(k),S,y),m)u.x+=M+h;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=Ea(y,t)+h}else u.y+=x})),En(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ws(e.font),s=Vs(e.padding);if(!e.display)return;const n=On(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=s.top+a;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=Zi(t.align,c,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+Zi(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Zi(r,c,c+d);o.textAlign=n.textAlign(Gi(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Rs(o,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=Ws(t.font),i=Vs(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(Wi(t,this.left,this.right)&&Wi(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],Wi(t,s.left,s.left+s.width)&&Wi(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,r=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!r&&ni(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!r&&ni(e.onHover,[t,i,this],this)}else i&&ni(e.onClick,[t,i,this],this);var s,n}}function Ea(t,e){return e*(t.text?t.text.length:0)}var Da={id:"legend",_element:Pa,start(t,e,i){const s=t.legend=new Pa({ctx:t.ctx,options:i,chart:t});Ro.configure(t,s,i),Ro.addBox(t,s)},stop(t){Ro.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;Ro.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=Vs(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Ca extends Go{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=Ze(i.text)?i.text.length:1;this._padding=Vs(i.padding);const n=s*Ws(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,r=o.align;let a,l,h,c=0;return this.isHorizontal()?(l=Zi(r,i,n),h=e+t,a=n-i):("left"===o.position?(l=i+t,h=Zi(r,s,e),c=-.5*yi):(l=n-t,h=Zi(r,e,s),c=.5*yi),a=s-e),{titleX:l,titleY:h,maxWidth:a,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ws(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(s);Rs(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:Gi(e.align),textBaseline:"middle",translation:[n,o]})}}var Aa={id:"title",_element:Ca,start(t,e,i){!function(t,e){const i=new Ca({ctx:t.ctx,options:e,chart:t});Ro.configure(t,i,e),Ro.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Ro.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;Ro.configure(t,s,i),s.options=i},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 Ta=new WeakMap;var Ra={id:"subtitle",start(t,e,i){const s=new Ca({ctx:t.ctx,options:i,chart:t});Ro.configure(t,s,i),Ro.addBox(t,s),Ta.set(t,s)},stop(t){Ro.removeBox(t,Ta.get(t)),Ta.delete(t)},beforeUpdate(t,e,i){const s=Ta.get(t);Ro.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const La={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce(((t,e)=>t+e))/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=zi(e,s.getCenterPoint());t<a&&(a=t,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function Ia(t,e){return e&&(Ze(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Fa(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function za(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:t,label:r,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Na(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=Ws(e.bodyFont),h=Ws(e.titleFont),c=Ws(e.footerFont),d=o.length,u=n.length,f=s.length,p=Vs(e.padding);let g=p.height,m=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=h.string,oi(t.title,y),i.font=l.string,oi(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?r+2+e.boxPadding:0,oi(s,(t=>{oi(t.before,y),oi(t.lines,y),oi(t.after,y)})),x=0,i.font=c.string,oi(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Ba(t,e,i,s){const{x:n,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let h="center";return"center"===s?h=n<=(a+l)/2?"left":"right":n<=o/2?h="left":n>=r-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,r=i.caretSize+i.caretPadding;return"left"===t&&n+o+r>e.width||"right"===t&&n-o-r<0||void 0}(h,t,e,i)&&(h="center"),h}function ja(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Ba(t,e,i,s),yAlign:s}}function Va(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=js(r);let p=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,a);const g=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===a?p+=h:"right"===a&&(p-=h):"left"===a?p-=Math.max(c,u)+n:"right"===a&&(p+=Math.max(d,f)+n),{x:Vi(p,0,s.width-e.width),y:Vi(g,0,s.height-e.height)}}function Wa(t,e,i){const s=Vs(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Ha(t){return Ia([],Fa(t))}function Ua(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const $a={beforeTitle:Ke,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:Ke,beforeBody:Ke,beforeLabel:Ke,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return Ge(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function qa(t,e,i,s){const n=t[e].call(i,s);return void 0===n?$a[e].call(i,s):n}class Ya extends Go{static positioners=La;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new Wn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=Us(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){const{callbacks:i}=e,s=qa(i,"beforeTitle",this,t),n=qa(i,"title",this,t),o=qa(i,"afterTitle",this,t);let r=[];return r=Ia(r,Fa(s)),r=Ia(r,Fa(n)),r=Ia(r,Fa(o)),r}getBeforeBody(t,e){return Ha(qa(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return oi(t,(t=>{const e={before:[],lines:[],after:[]},n=Ua(i,t);Ia(e.before,Fa(qa(n,"beforeLabel",this,t))),Ia(e.lines,qa(n,"label",this,t)),Ia(e.after,Fa(qa(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return Ha(qa(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=qa(i,"beforeFooter",this,t),n=qa(i,"footer",this,t),o=qa(i,"afterFooter",this,t);let r=[];return r=Ia(r,Fa(s)),r=Ia(r,Fa(n)),r=Ia(r,Fa(o)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let r,a,l=[];for(r=0,a=e.length;r<a;++r)l.push(za(this.chart,e[r]));return t.filter&&(l=l.filter(((e,s,n)=>t.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),oi(l,(e=>{const i=Ua(t.callbacks,e);s.push(qa(i,"labelColor",this,e)),n.push(qa(i,"labelPointStyle",this,e)),o.push(qa(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=La[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Na(this,i),r=Object.assign({},t,e),a=ja(this.chart,i,r),l=Va(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:h,bottomRight:c}=js(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,x,y,_;return"center"===n?(y=u+p/2,"left"===s?(g=d,m=g-o,x=y+o,_=y-o):(g=d+f,m=g+o,x=y-o,_=y+o),b=g):(m="left"===s?d+Math.max(a,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(x=u,y=x-o,g=m-o,b=m+o):(x=u+p,y=x+o,g=m+o,b=m-o),_=x),{x1:g,x2:m,x3:b,y1:x,y2:y,y3:_}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,r,a;if(n){const l=On(i.rtl,this.x,this.width);for(t.x=Wa(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=Ws(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r,a+1===n&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,n){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=n,h=Ws(n.bodyFont),c=Wa(this,"left",n),d=s.x(c),u=a<h.lineHeight?(h.lineHeight-a)/2:0,f=e.y+u;if(n.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(d,l)+l/2,h=f+a/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,ks(t,e,i,h),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,ks(t,e,i,h)}else{t.lineWidth=Qe(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 e=s.leftForLtr(d,l),i=s.leftForLtr(s.xPlus(d,1),l-2),r=js(o.borderRadius);Object.values(r).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,Ls(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ls(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:h}=i,c=Ws(i.bodyFont);let d=c.lineHeight,u=0;const f=On(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},g=f.textAlign(o);let m,b,x,y,_,v,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Wa(this,g,i),e.fillStyle=i.bodyColor,oi(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+h:l+2+h:0,y=0,v=s.length;y<v;++y){for(m=s[y],b=this.labelTextColors[y],e.fillStyle=b,oi(m.before,p),x=m.lines,r&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(c.lineHeight,a)),_=0,w=x.length;_<w;++_)p(x[_]),d=c.lineHeight;oi(m.after,p)}u=0,d=c.lineHeight,oi(this.afterBody,p),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,r;if(n){const a=On(i.rtl,this.x,this.width);for(t.x=Wa(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",o=Ws(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],a.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:r,y:a}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=js(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+c,a),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+l-d,a),e.quadraticCurveTo(r+l,a,r+l,a+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(r+l,a+h-f),e.quadraticCurveTo(r+l,a+h,r+l-f,a+h),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+u,a+h),e.quadraticCurveTo(r,a+h,r,a+h-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(r,a+c),e.quadraticCurveTo(r,a,r+c,a),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=La[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Na(this,t),r=Object.assign({},i,this._size),a=ja(e,t,r),l=Va(t,r,a,e);s._to===l.x&&n._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Vs(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Pn(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),En(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!ri(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),r=this._positionChanged(o,t),a=e||!ri(o,n)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=La[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Xa={id:"tooltip",_element:Ya,positioners:La,afterInit(t,e,i){i&&(t.tooltip=new Ya({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$a},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ka=Object.freeze({__proto__:null,Colors:oa,Decimation:la,Filler:Sa,Legend:Da,SubTitle:Ra,Title:Aa,Tooltip:Xa});function Ja(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function Ga(t,e,{horizontal:i,minRotation:s}){const n=Ri(s),o=(i?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Za extends rr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Ge(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,r=t=>n=i?n:t;if(t){const t=Ei(s),e=Ei(n);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);r(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:o,max:r,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=n||1,f=h-1,{min:p,max:g}=e,m=!Ge(o),b=!Ge(r),x=!Ge(l),y=(g-p)/(c+1);let _,v,w,M,k=Ci((g-p)/f/u)*u;if(k<1e-14&&!m&&!b)return[{value:p},{value:g}];M=Math.ceil(g/k)-Math.floor(p/k),M>f&&(k=Ci(M*k/f/u)*u),Ge(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===s?(v=Math.floor(p/k)*k,w=Math.ceil(g/k)*k):(v=p,w=g),m&&b&&n&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/n,k/1e3)?(M=Math.round(Math.min((r-o)/k,h)),k=(r-o)/M,v=o,w=r):x?(v=m?o:v,w=b?r:w,M=l-1,k=(w-v)/M):(M=(w-v)/k,M=Di(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(Ii(k),Ii(v));_=Math.pow(10,Ge(a)?S:a),v=Math.round(v*_)/_,w=Math.round(w*_)/_;let O=0;for(m&&(d&&v!==o?(i.push({value:o}),v<o&&O++,Di(Math.round((v+O*k)*_)/_,o,Ga(o,y,t))&&O++):v<o&&O++);O<M;++O){const t=Math.round((v+O*k)*_)/_;if(b&&t>r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&Di(i[i.length-1].value,r,Ga(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Ti(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ds(t,this.chart.options.locale,this.options.ticks.format)}}class Qa extends Za{static id="linear";static defaults={ticks:{callback:fs.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ti(t)?t:0,this.max=ti(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ri(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const tl=t=>Math.floor(Pi(t)),el=(t,e)=>Math.pow(10,tl(t)+e);function il(t){return 1==t/Math.pow(10,tl(t))}function sl(t,e,i){const s=Math.pow(10,i),n=Math.floor(t/s);return Math.ceil(e/s)-n}class nl extends rr{static id="logarithmic";static defaults={ticks:{callback:fs.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Za.prototype.parse.apply(this,[t,e]);if(0!==i)return ti(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ti(t)?Math.max(0,t):null,this.max=ti(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ti(this._userMin)&&(this.min=t===el(this.min,0)?el(this.min,-1):el(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t;i===s&&(i<=0?(n(1),o(10)):(n(el(i,-1)),o(el(s,1)))),i<=0&&n(el(s,-1)),s<=0&&o(el(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=function(t,{min:e,max:i}){e=ei(t.min,e);const s=[],n=tl(e);let o=function(t,e){let i=tl(e-t);for(;sl(t,e,i)>10;)i++;for(;sl(t,e,i)<10;)i--;return Math.min(i,tl(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,h=Math.round((e-l)*r)/r,c=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((h-c)/Math.pow(10,o)),u=ei(t.min,Math.round((l+c+d*Math.pow(10,o))*r)/r);for(;u<i;)s.push({value:u,major:il(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+c+d*Math.pow(10,o))*r)/r;const f=ei(t.max,u);return s.push({value:f,major:il(f),significand:d}),s}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Ti(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ds(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Pi(t),this._valueRange=Pi(this.max)-Pi(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Pi(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ol(t){const e=t.ticks;if(e.display&&t.display){const t=Vs(e.backdropPadding);return ii(e.font&&e.font.size,ys.font.size)+t.height}return 0}function rl(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function al(t,e,i,s,n){const o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let a=0,l=0;s.start<e.l?(a=(e.l-s.start)/o,t.l=Math.min(t.l,e.l-a)):s.end>e.r&&(a=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),n.start<e.t?(l=(e.t-n.start)/r,t.t=Math.min(t.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function ll(t,e,i){const s=t.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,s+n+r,o),h=Math.round(Li(Bi(l.angle+ki))),c=function(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}(l.y,a.h,h),d=function(t){return 0===t||180===t?"center":t<180?"left":"right"}(h),u=(f=l.x,p=a.w,"right"===(g=d)?f-=p:"center"===g&&(f-=p/2),f);var f,p,g;return{visible:!0,x:l.x,y:c,textAlign:d,left:u,top:c,right:u+a.w,bottom:c+a.h}}function hl(t,e){if(!e)return!0;const{left:i,top:s,right:n,bottom:o}=t;return!(Os({x:i,y:s},e)||Os({x:i,y:o},e)||Os({x:n,y:s},e)||Os({x:n,y:o},e))}function cl(t,e,i){const{left:s,top:n,right:o,bottom:r}=i,{backdropColor:a}=e;if(!Ge(a)){const i=js(e.borderRadius),l=Vs(e.backdropPadding);t.fillStyle=a;const h=s-l.left,c=n-l.top,d=o-s+l.width,u=r-n+l.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),Ls(t,{x:h,y:c,w:d,h:u,radius:i}),t.fill()):t.fillRect(h,c,d,u)}}function dl(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,_i);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o<s;o++)i=t.getPointPosition(o,e),n.lineTo(i.x,i.y)}}class ul extends Za{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=Vs(ol(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ti(t)&&!isNaN(t)?t:0,this.max=ti(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ol(this.options))}generateTickLabels(t){Za.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=ni(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],n=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?yi/o:0;for(let d=0;d<o;d++){const o=r.setContext(t.getPointLabelContext(d));n[d]=o.padding;const u=t.getPointPosition(d,t.drawingArea+n[d],a),f=Ws(o.font),p=(l=t.ctx,h=f,c=Ze(c=t._pointLabels[d])?c:[c],{w:vs(l,h.string,c),h:c.length*h.lineHeight});s[d]=p;const g=Bi(t.getIndexAngle(d)+a),m=Math.round(Li(g));al(i,e,g,rl(m,u.x,p.w,0,180),rl(m,u.y,p.h,90,270))}var l,h,c;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const s=[],n=t._pointLabels.length,o=t.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:ol(o)/2,additionalAngle:r?yi/n:0};let h;for(let o=0;o<n;o++){l.padding=i[o],l.size=e[o];const n=ll(t,o,l);s.push(n),"auto"===a&&(n.visible=hl(n,h),n.visible&&(h=n))}return s}(t,s,n)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return Bi(t*(_i/(this._pointLabels.length||1))+Ri(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(Ge(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Ge(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return Us(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-ki+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),dl(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:n}=e,o=this._pointLabels.length;let r,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=t._pointLabelItems[n];if(!e.visible)continue;const o=s.setContext(t.getPointLabelContext(n));cl(i,o,e);const r=Ws(o.font),{x:a,y:l,textAlign:h}=e;Rs(i,t._pointLabels[n],a,l+r.lineHeight/2,r,{color:o.color,textAlign:h,textBaseline:"middle"})}}(this,o),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=s.setContext(i),l=n.setContext(i);!function(t,e,i,s,n){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!s||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),dl(t,i,r,s),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}})),i.display){for(t.save(),r=o-1;r>=0;r--){const s=i.setContext(this.getPointLabelContext(r)),{color:n,lineWidth:o}=s;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=Ws(a.font);if(n=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=a.backdropColor;const e=Vs(a.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}Rs(t,s.label,0,-n,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})})),t.restore()}drawTitle(){}}const fl={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}},pl=Object.keys(fl);function gl(t,e){return t-e}function ml(t,e){if(Ge(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof s&&(r=s(r)),ti(r)||(r="string"==typeof s?i.parse(r,s):i.parse(r)),null===r?null:(n&&(r="week"!==n||!Ai(o)&&!0!==o?i.startOf(r,n):i.startOf(r,"isoWeek",o)),+r)}function bl(t,e,i,s){const n=pl.length;for(let o=pl.indexOf(t);o<n-1;++o){const t=fl[pl[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return pl[o]}return pl[n-1]}function xl(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=Hi(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function yl(t,e,i){const s=[],n={},o=e.length;let r,a;for(r=0;r<o;++r)a=e[r],n[a]=r,s.push({value:a,major:!1});return 0!==o&&i?function(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),r=e[e.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=i[a],l>=0&&(e[l].major=!0);return e}(t,s,n,i):s}class _l extends rr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new go(t.adapters.date);s.init(e),di(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ml(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),s=ti(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=ti(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=function(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}(s,n,this.max);return this._unit=e.unit||(i.autoSkip?bl(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=pl.length-1;o>=pl.indexOf(i);o--){const i=pl[o];if(fl[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return pl[i?pl.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=pl.indexOf(t)+1,i=pl.length;e<i;++e)if(fl[pl[e]].common)return pl[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),yl(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=Vi(s,0,o),n=Vi(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||bl(n.minUnit,e,i,this._getLabelCapacity(e)),r=ii(s.ticks.stepSize,1),a="week"===o&&n.isoWeekday,l=Ai(a)||!0===a,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,r,o),d++)xl(h,c,f);return c!==i&&"ticks"!==s.bounds&&1!==d||xl(h,c,f),Object.keys(h).sort(gl).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.ticks.callback;if(o)return ni(o,[t,e,i],this);const r=n.time.displayFormats,a=this._unit,l=this._majorUnit,h=a&&r[a],c=l&&r[l],d=i[e],u=l&&c&&d&&d.major;return this._adapter.format(t,s||(u?c:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Ri(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),o=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*n+r*o,h:i*o+r*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,yl(this,[t],this._majorUnit),s),o=this._getLabelSize(n),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(ml(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xi(t.sort(gl))}}function vl(t,e,i){let s,n,o,r,a=0,l=t.length-1;i?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=Ui(t,"pos",e)),({pos:s,time:o}=t[a]),({pos:n,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=Ui(t,"time",e)),({time:s,pos:o}=t[a]),({time:n,pos:r}=t[l]));const h=n-s;return h?o+(r-o)*(e-s)/h:o}var wl=Object.freeze({__proto__:null,CategoryScale:class extends rr{static id="category";static defaults={ticks:{callback:Ja}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Ge(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Vi(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,ii(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return Ja.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:Qa,LogarithmicScale:nl,RadialLinearScale:ul,TimeScale:_l,TimeSeriesScale:class extends _l{static id="timeseries";static defaults=_l.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=vl(e,this.min),this._tableRange=vl(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,r,a,l,h;for(o=0,r=t.length;o<r;++o)l=t[o],l>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o<r;++o)h=s[o+1],a=s[o-1],l=s[o],Math.round((h+a)/2)!==l&&n.push({time:l,pos:o/(r-1)});return n}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(vl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return vl(this._table,i*this._tableRange+this._minPos,!0)}}});const Ml=[uo,Qr,Ka,wl];Ir.register(...Ml);class kl{selector;chart;chartData;http;entitySlug;consoleLogData=!1;lazyGetData=!1;fromDate;toDate;htmlElement=null;constructor(t,e,i,s,n=void 0){this.selector=t,this.fromDate=i,this.toDate=s,this.getHTMLElement(),n?this.chartData=n:this.startHttpClient(),this.entitySlug=e}getHTMLElement(){this.htmlElement=document.getElementById(this.selector)}getEndPoint(){return this.htmlElement.dataset.endpoint}getChartData(){if(!this.chartData&&this.htmlElement){let t={params:{fromDate:this.fromDate?this.fromDate:null,toDate:this.toDate?this.toDate:null}};this.http?.get(this.getEndPoint(),t).then((t=>{this.chartData=t.data,this.consoleLogData&&console.log(t),this.renderChart()}))}else this.renderChart()}startHttpClient(){this.http=xe.create({}),this.lazyGetData||this.getChartData()}renderChart(){}}class Sl extends kl{renderChart(){if(this.chartData){let t=this.chartData.results.entity_name,e=this.chartData.results.pnl_data,i=Object.keys(e),s=i.map((t=>e[t].GROUP_INCOME)),n=i.map((t=>e[t].GROUP_EXPENSES)),o={labels:i,datasets:[{label:"Income",backgroundColor:"rgb(70,160,45)",borderColor:"rgb(115,255,99)",data:s},{label:"Expenses",backgroundColor:"rgb(231,46,75)",borderColor:"rgb(255, 99, 132)",data:n}]};const r=document.getElementById(this.selector);let a={plugins:{title:{display:!0,text:`${t} - Income & Expenses`,font:{size:20}},tooltip:{callbacks:{}}},aspectRatio:1,scales:{y:{beginAtZero:!0}}};this.chart=new Ir(r,{type:"bar",data:o,options:a})}}}class Ol extends kl{renderChart(){if(this.chartData){let t=this.chartData.results.net_payable_data,e=Object.keys(t),i=e.map((e=>t[e])),s={labels:e.map((t=>t.replace("_"," ").toUpperCase())),datasets:[{borderColor:"rgb(195,195,195)",borderWidth:.75,backgroundColor:["rgba(102, 24, 0, 1)","rgba(255, 95, 46, 1)","rgba(252, 190, 50, 1)","rgba(0,210,1,1)","rgba(225, 238, 246, 1)"],data:i}]};const n=document.getElementById(this.selector);let o={plugins:{title:{display:!0,position:"top",text:"Net Payables 0-90+ Days",font:{size:20}},tooltip:{callbacks:{}}},aspectRatio:1,scales:{y:{beginAtZero:!0}}};this.chart=new Ir(n,{type:"doughnut",data:s,options:o})}}}class Pl extends kl{renderChart(){if(this.chartData){let t=this.chartData.results.net_receivable_data,e=Object.keys(t),i=e.map((e=>t[e])),s={labels:e.map((t=>t.replace("_"," ").toUpperCase())),datasets:[{borderColor:"rgb(195,195,195)",borderWidth:.75,backgroundColor:["rgba(102, 24, 0, 1)","rgba(255, 95, 46, 1)","rgba(252, 190, 50, 1)","rgba(0,210,1,1)","rgba(225, 238, 246, 1)"],data:i}]};const n=document.getElementById(this.selector);let o={plugins:{title:{display:!0,position:"top",text:"Net Receivables 0-90+ Days",font:{size:20}},tooltip:{callbacks:{}}},aspectRatio:1,scales:{y:{beginAtZero:!0}}};this.chart=new Ir(n,{type:"doughnut",data:s,options:o})}}}function El(t,e,i,s){return new Sl(t,e,i,s)}function Dl(t,e,i,s){return new Ol(t,e,i,s)}function Cl(t,e,i,s){return new Pl(t,e,i,s)}function Al(t){let e=document.getElementById(t);e&&e.classList.add("is-active","is-clipped")}function Tl(t){let e=document.getElementById(t);e&&e.classList.remove("is-active","is-clipped")}function Rl(t){let e=document.getElementById(t);e&&(e.classList.toggle("is-active"),e.classList.toggle("is-clipped"))}function Ll(t,e){let i=document.forms.namedItem(t);i&&(i.submit(),e&&Tl(e))}function Il(t){let e=document.getElementById(t);e&&(e.classList.contains("is-active")?e.classList.remove("is-active"):e.classList.add("is-active"))}new class{dateFilters=null;endDateFilters=null;constructor(){document.addEventListener("DOMContentLoaded",(()=>{(document.querySelectorAll(".notification .delete")||[]).forEach((t=>{let e;e=t.parentNode,t.addEventListener("click",(()=>{e.parentNode.removeChild(e)}))}))})),document.addEventListener("DOMContentLoaded",(()=>{const t=Array.prototype.slice.call(document.querySelectorAll(".navbar-burger"),0);t.length>0&&t.forEach((t=>{t.addEventListener("click",(()=>{const e=t.dataset.target,i=document.getElementById(e);t.classList.toggle("is-active"),i.classList.toggle("is-active")}))}))})),document.addEventListener("DOMContentLoaded",(()=>{(document.querySelectorAll(".djetler-set-entity-form-input")||[]).forEach((t=>{t.addEventListener("change",this.setEntityFilter)}))}))}getFlatPickrOptions(t=!1){return t?{wrap:!t,inline:t,onChange:(t,e,i)=>{let s=i._input.classList[1].split("-")[5];document.getElementById("djetler-end-date-icon-filter-form-"+s).submit()}}:{wrap:!t,inline:t,onChange:(t,e,i)=>{let s=i._input.classList[1].split("-")[5];document.getElementById("djetler-end-date-icon-filter-form-"+s).submit()}}}setEntityFilter(t){let e=t.target;if(e){let t=e.classList[2].split("-")[4],i=document.getElementById("djetler-set-entity-form-"+t);i&&i.submit()}}},djLedger=e})();
|