Skip to content

Firefly III: a personal finances manager

Rebuild frontend

James Colecdd4dc60655e
diff --git a/package-lock.json b/package-lock.json
index dabfd68944..afe450e26c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -26,9 +26,9 @@
}
},
"node_modules/@babel/runtime": {
- "version": "7.22.10",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz",
- "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==",
+ "version": "7.22.11",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz",
+ "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==",
"dependencies": {
"regenerator-runtime": "^0.14.0"
},
@@ -463,9 +463,9 @@
}
},
"node_modules/bignumber.js": {
- "version": "9.1.1",
- "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz",
- "integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==",
+ "version": "9.1.2",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
+ "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==",
"engines": {
"node": "*"
}
@@ -724,9 +724,9 @@
}
},
"node_modules/immutable": {
- "version": "4.3.2",
- "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.2.tgz",
- "integrity": "sha512-oGXzbEDem9OOpDWZu88jGiYCvIsLHMvGw+8OXlpsvTFvIQplQbjg1B1cvKg8f7Hoch6+NGjpPsH1Fr+Mc2D1aA==",
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz",
+ "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==",
"dev": true
},
"node_modules/is-binary-path": {
diff --git a/public/build/assets/dashboard-767a50a1.js b/public/build/assets/dashboard-3bf5d492.js
similarity index 69%
rename from public/build/assets/dashboard-767a50a1.js
rename to public/build/assets/dashboard-3bf5d492.js
index 7a3f6481e0..29cafa1c44 100644
--- a/public/build/assets/dashboard-767a50a1.js
+++ b/public/build/assets/dashboard-3bf5d492.js
@@ -1,16 +1,16 @@
-var ve=Object.defineProperty;var be=(t,e,a)=>e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var R=(t,e,a)=>(be(t,typeof e!="symbol"?e+"":e,a),a);function bind$4(t,e){return function(){return t.apply(e,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(t=>e=>{const a=toString$7.call(e);return t[a]||(t[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=t=>(t=t.toLowerCase(),e=>kindOf(e)===t),typeOfTest=t=>e=>typeof e===t,{isArray:isArray$e}=Array,isUndefined=typeOfTest("undefined");function isBuffer$3(t){return t!==null&&!isUndefined(t)&&t.constructor!==null&&!isUndefined(t.constructor)&&isFunction$6(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&isArrayBuffer(t.buffer),e}const isString$1=typeOfTest("string"),isFunction$6=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$c=t=>t!==null&&typeof t=="object",isBoolean=t=>t===!0||t===!1,isPlainObject=t=>{if(kindOf(t)!=="object")return!1;const e=getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=t=>isObject$c(t)&&isFunction$6(t.pipe),isFormData=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||isFunction$6(t.append)&&((e=kindOf(t))==="formdata"||e==="object"&&isFunction$6(t.toString)&&t.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim$2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(t,e,{allOwnKeys:a=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),isArray$e(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{const i=a?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let s;for(n=0;n<o;n++)s=i[n],e.call(null,t[s],s,t)}}function findKey$1(t,e){e=e.toLowerCase();const a=Object.keys(t);let n=a.length,r;for(;n-- >0;)if(r=a[n],e===r.toLowerCase())return r;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=t=>!isUndefined(t)&&t!==_global;function merge$1(){const{caseless:t}=isContextDefined(this)&&this||{},e={},a=(n,r)=>{const i=t&&findKey$1(e,r)||r;isPlainObject(e[i])&&isPlainObject(n)?e[i]=merge$1(e[i],n):isPlainObject(n)?e[i]=merge$1({},n):isArray$e(n)?e[i]=n.slice():e[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&forEach(arguments[n],a);return e}const extend$1=(t,e,a,{allOwnKeys:n}={})=>(forEach(e,(r,i)=>{a&&isFunction$6(r)?t[i]=bind$4(r,a):t[i]=r},{allOwnKeys:n}),t),stripBOM=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),inherits=(t,e,a,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),a&&Object.assign(t.prototype,a)},toFlatObject=(t,e,a,n)=>{let r,i,o;const s={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!n||n(o,t,e))&&!s[o]&&(e[o]=t[o],s[o]=!0);t=a!==!1&&getPrototypeOf(t)}while(t&&(!a||a(t,e))&&t!==Object.prototype);return e},endsWith=(t,e,a)=>{t=String(t),(a===void 0||a>t.length)&&(a=t.length),a-=e.length;const n=t.indexOf(e,a);return n!==-1&&n===a},toArray=t=>{if(!t)return null;if(isArray$e(t))return t;let e=t.length;if(!isNumber$1(e))return null;const a=new Array(e);for(;e-- >0;)a[e]=t[e];return a},isTypedArray$3=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},matchAll=(t,e)=>{let a;const n=[];for(;(a=t.exec(e))!==null;)n.push(a);return n},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,n,r){return n.toUpperCase()+r}),hasOwnProperty$c=(({hasOwnProperty:t})=>(e,a)=>t.call(e,a))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(t,e)=>{const a=Object.getOwnPropertyDescriptors(t),n={};forEach(a,(r,i)=>{e(r,i,t)!==!1&&(n[i]=r)}),Object.defineProperties(t,n)},freezeMethods=t=>{reduceDescriptors(t,(e,a)=>{if(isFunction$6(t)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const n=t[a];if(isFunction$6(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},toObjectSet=(t,e)=>{const a={},n=r=>{r.forEach(i=>{a[i]=!0})};return isArray$e(t)?n(t):n(String(t).split(e)),a},noop$4=()=>{},toFiniteNumber=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(t=16,e=ALPHABET.ALPHA_DIGIT)=>{let a="";const{length:n}=e;for(;t--;)a+=e[Math.random()*n|0];return a};function isSpecCompliantForm(t){return!!(t&&isFunction$6(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const toJSONObject=t=>{const e=new Array(10),a=(n,r)=>{if(isObject$c(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const i=isArray$e(n)?[]:{};return forEach(n,(o,s)=>{const l=a(o,r+1);!isUndefined(l)&&(i[s]=l)}),e[r]=void 0,i}}return n};return a(t,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=t=>t&&(isObject$c(t)||isFunction$6(t))&&isFunction$6(t.then)&&isFunction$6(t.catch),utils={isArray:isArray$e,isArrayBuffer,isBuffer:isBuffer$3,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean,isObject:isObject$c,isPlainObject,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$6,isStream,isURLSearchParams,isTypedArray:isTypedArray$3,isFileList,forEach,merge:merge$1,extend:extend$1,trim:trim$2,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$c,hasOwnProp:hasOwnProperty$c,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$4,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(t,e,a,n,r){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),a&&(this.config=a),n&&(this.request=n),r&&(this.response=r)}utils.inherits(AxiosError,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:utils.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors$1={};["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=>{descriptors$1[t]={value:t}});Object.defineProperties(AxiosError,descriptors$1);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(t,e,a,n,r,i)=>{const o=Object.create(prototype$1);return utils.toFlatObject(t,o,function(l){return l!==Error.prototype},s=>s!=="isAxiosError"),AxiosError.call(o,t.message,e,a,n,r),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const httpAdapter=null;function isVisitable(t){return utils.isPlainObject(t)||utils.isArray(t)}function removeBrackets(t){return utils.endsWith(t,"[]")?t.slice(0,-2):t}function renderKey(t,e,a){return t?t.concat(e).map(function(r,i){return r=removeBrackets(r),!a&&i?"["+r+"]":r}).join(a?".":""):e}function isFlatArray(t){return utils.isArray(t)&&!t.some(isVisitable)}const predicates=utils.toFlatObject(utils,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(t,e,a){if(!utils.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,a=utils.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,y){return!utils.isUndefined(y[v])});const n=a.metaTokens,r=a.visitor||c,i=a.dots,o=a.indexes,l=(a.Blob||typeof Blob<"u"&&Blob)&&utils.isSpecCompliantForm(e);if(!utils.isFunction(r))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(utils.isDate(p))return p.toISOString();if(!l&&utils.isBlob(p))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils.isArrayBuffer(p)||utils.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,v,y){let w=p;if(p&&!y&&typeof p=="object"){if(utils.endsWith(v,"{}"))v=n?v:v.slice(0,-2),p=JSON.stringify(p);else if(utils.isArray(p)&&isFlatArray(p)||(utils.isFileList(p)||utils.endsWith(v,"[]"))&&(w=utils.toArray(p)))return v=removeBrackets(v),w.forEach(function(D,k){!(utils.isUndefined(D)||D===null)&&e.append(o===!0?renderKey([v],k,i):o===null?v:v+"[]",u(D))}),!1}return isVisitable(p)?!0:(e.append(renderKey(y,v,i),u(p)),!1)}const d=[],h=Object.assign(predicates,{defaultVisitor:c,convertValue:u,isVisitable});function m(p,v){if(!utils.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+v.join("."));d.push(p),utils.forEach(p,function(w,_){(!(utils.isUndefined(w)||w===null)&&r.call(e,w,utils.isString(_)?_.trim():_,v,h))===!0&&m(w,v?v.concat(_):[_])}),d.pop()}}if(!utils.isObject(t))throw new TypeError("data must be an object");return m(t),e}function encode$1(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function AxiosURLSearchParams(t,e){this._pairs=[],t&&toFormData(t,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,a){this._pairs.push([e,a])};prototype.toString=function(e){const a=e?function(n){return e.call(this,n,encode$1)}:encode$1;return this._pairs.map(function(r){return a(r[0])+"="+a(r[1])},"").join("&")};function encode(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(t,e,a){if(!e)return t;const n=a&&a.encode||encode,r=a&&a.serialize;let i;if(r?i=r(e,a):i=utils.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,a).toString(n),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class InterceptorManager{constructor(){this.handlers=[]}use(e,a,n){return this.handlers.push({fulfilled:e,rejected:a,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils.forEach(this.handlers,function(n){n!==null&&e(n)})}}const InterceptorManager$1=InterceptorManager,transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,isStandardBrowserEnv=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),isStandardBrowserWebWorkerEnv=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),platform={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},isStandardBrowserEnv,isStandardBrowserWebWorkerEnv,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(t,e){return toFormData(t,new platform.classes.URLSearchParams,Object.assign({visitor:function(a,n,r,i){return platform.isNode&&utils.isBuffer(a)?(this.append(n,a.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(t){return utils.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(t){const e={},a=Object.keys(t);let n;const r=a.length;let i;for(n=0;n<r;n++)i=a[n],e[i]=t[i];return e}function formDataToJSON(t){function e(a,n,r,i){let o=a[i++];const s=Number.isFinite(+o),l=i>=a.length;return o=!o&&utils.isArray(r)?r.length:o,l?(utils.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s):((!r[o]||!utils.isObject(r[o]))&&(r[o]=[]),e(a,n,r[o],i)&&utils.isArray(r[o])&&(r[o]=arrayToObject(r[o])),!s)}if(utils.isFormData(t)&&utils.isFunction(t.entries)){const a={};return utils.forEachEntry(t,(n,r)=>{e(parsePropPath(n),r,a,0)}),a}return null}const DEFAULT_CONTENT_TYPE={"Content-Type":void 0};function stringifySafely(t,e,a){if(utils.isString(t))try{return(e||JSON.parse)(t),utils.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(a||JSON.stringify)(t)}const defaults$1={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(e,a){const n=a.getContentType()||"",r=n.indexOf("application/json")>-1,i=utils.isObject(e);if(i&&utils.isHTMLForm(e)&&(e=new FormData(e)),utils.isFormData(e))return r&&r?JSON.stringify(formDataToJSON(e)):e;if(utils.isArrayBuffer(e)||utils.isBuffer(e)||utils.isStream(e)||utils.isFile(e)||utils.isBlob(e))return e;if(utils.isArrayBufferView(e))return e.buffer;if(utils.isURLSearchParams(e))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((s=utils.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return toFormData(s?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||r?(a.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const a=this.transitional||defaults$1.transitional,n=a&&a.forcedJSONParsing,r=this.responseType==="json";if(e&&utils.isString(e)&&(n&&!this.responseType||r)){const o=!(a&&a.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?AxiosError.from(s,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],function(e){defaults$1.headers[e]={}});utils.forEach(["post","put","patch"],function(e){defaults$1.headers[e]=utils.merge(DEFAULT_CONTENT_TYPE)});const defaults$2=defaults$1,ignoreDuplicateOf=utils.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"]),parseHeaders=t=>{const e={};let a,n,r;return t&&t.split(`
+var ve=Object.defineProperty;var be=(t,e,a)=>e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var R=(t,e,a)=>(be(t,typeof e!="symbol"?e+"":e,a),a);function bind$4(t,e){return function(){return t.apply(e,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(t=>e=>{const a=toString$7.call(e);return t[a]||(t[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=t=>(t=t.toLowerCase(),e=>kindOf(e)===t),typeOfTest=t=>e=>typeof e===t,{isArray:isArray$e}=Array,isUndefined=typeOfTest("undefined");function isBuffer$3(t){return t!==null&&!isUndefined(t)&&t.constructor!==null&&!isUndefined(t.constructor)&&isFunction$6(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&isArrayBuffer(t.buffer),e}const isString$1=typeOfTest("string"),isFunction$6=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$c=t=>t!==null&&typeof t=="object",isBoolean=t=>t===!0||t===!1,isPlainObject=t=>{if(kindOf(t)!=="object")return!1;const e=getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=t=>isObject$c(t)&&isFunction$6(t.pipe),isFormData=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||isFunction$6(t.append)&&((e=kindOf(t))==="formdata"||e==="object"&&isFunction$6(t.toString)&&t.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim$2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(t,e,{allOwnKeys:a=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),isArray$e(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{const i=a?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let s;for(n=0;n<o;n++)s=i[n],e.call(null,t[s],s,t)}}function findKey$1(t,e){e=e.toLowerCase();const a=Object.keys(t);let n=a.length,r;for(;n-- >0;)if(r=a[n],e===r.toLowerCase())return r;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=t=>!isUndefined(t)&&t!==_global;function merge$1(){const{caseless:t}=isContextDefined(this)&&this||{},e={},a=(n,r)=>{const i=t&&findKey$1(e,r)||r;isPlainObject(e[i])&&isPlainObject(n)?e[i]=merge$1(e[i],n):isPlainObject(n)?e[i]=merge$1({},n):isArray$e(n)?e[i]=n.slice():e[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&forEach(arguments[n],a);return e}const extend=(t,e,a,{allOwnKeys:n}={})=>(forEach(e,(r,i)=>{a&&isFunction$6(r)?t[i]=bind$4(r,a):t[i]=r},{allOwnKeys:n}),t),stripBOM=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),inherits=(t,e,a,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),a&&Object.assign(t.prototype,a)},toFlatObject=(t,e,a,n)=>{let r,i,o;const s={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!n||n(o,t,e))&&!s[o]&&(e[o]=t[o],s[o]=!0);t=a!==!1&&getPrototypeOf(t)}while(t&&(!a||a(t,e))&&t!==Object.prototype);return e},endsWith=(t,e,a)=>{t=String(t),(a===void 0||a>t.length)&&(a=t.length),a-=e.length;const n=t.indexOf(e,a);return n!==-1&&n===a},toArray=t=>{if(!t)return null;if(isArray$e(t))return t;let e=t.length;if(!isNumber$1(e))return null;const a=new Array(e);for(;e-- >0;)a[e]=t[e];return a},isTypedArray$3=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},matchAll=(t,e)=>{let a;const n=[];for(;(a=t.exec(e))!==null;)n.push(a);return n},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,n,r){return n.toUpperCase()+r}),hasOwnProperty$c=(({hasOwnProperty:t})=>(e,a)=>t.call(e,a))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(t,e)=>{const a=Object.getOwnPropertyDescriptors(t),n={};forEach(a,(r,i)=>{let o;(o=e(r,i,t))!==!1&&(n[i]=o||r)}),Object.defineProperties(t,n)},freezeMethods=t=>{reduceDescriptors(t,(e,a)=>{if(isFunction$6(t)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const n=t[a];if(isFunction$6(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},toObjectSet=(t,e)=>{const a={},n=r=>{r.forEach(i=>{a[i]=!0})};return isArray$e(t)?n(t):n(String(t).split(e)),a},noop$4=()=>{},toFiniteNumber=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(t=16,e=ALPHABET.ALPHA_DIGIT)=>{let a="";const{length:n}=e;for(;t--;)a+=e[Math.random()*n|0];return a};function isSpecCompliantForm(t){return!!(t&&isFunction$6(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const toJSONObject=t=>{const e=new Array(10),a=(n,r)=>{if(isObject$c(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const i=isArray$e(n)?[]:{};return forEach(n,(o,s)=>{const l=a(o,r+1);!isUndefined(l)&&(i[s]=l)}),e[r]=void 0,i}}return n};return a(t,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=t=>t&&(isObject$c(t)||isFunction$6(t))&&isFunction$6(t.then)&&isFunction$6(t.catch),utils={isArray:isArray$e,isArrayBuffer,isBuffer:isBuffer$3,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean,isObject:isObject$c,isPlainObject,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$6,isStream,isURLSearchParams,isTypedArray:isTypedArray$3,isFileList,forEach,merge:merge$1,extend,trim:trim$2,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$c,hasOwnProp:hasOwnProperty$c,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$4,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(t,e,a,n,r){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),a&&(this.config=a),n&&(this.request=n),r&&(this.response=r)}utils.inherits(AxiosError,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:utils.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors$1={};["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=>{descriptors$1[t]={value:t}});Object.defineProperties(AxiosError,descriptors$1);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(t,e,a,n,r,i)=>{const o=Object.create(prototype$1);return utils.toFlatObject(t,o,function(l){return l!==Error.prototype},s=>s!=="isAxiosError"),AxiosError.call(o,t.message,e,a,n,r),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const httpAdapter=null;function isVisitable(t){return utils.isPlainObject(t)||utils.isArray(t)}function removeBrackets(t){return utils.endsWith(t,"[]")?t.slice(0,-2):t}function renderKey(t,e,a){return t?t.concat(e).map(function(r,i){return r=removeBrackets(r),!a&&i?"["+r+"]":r}).join(a?".":""):e}function isFlatArray(t){return utils.isArray(t)&&!t.some(isVisitable)}const predicates=utils.toFlatObject(utils,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(t,e,a){if(!utils.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,a=utils.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,y){return!utils.isUndefined(y[v])});const n=a.metaTokens,r=a.visitor||c,i=a.dots,o=a.indexes,l=(a.Blob||typeof Blob<"u"&&Blob)&&utils.isSpecCompliantForm(e);if(!utils.isFunction(r))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(utils.isDate(p))return p.toISOString();if(!l&&utils.isBlob(p))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils.isArrayBuffer(p)||utils.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,v,y){let w=p;if(p&&!y&&typeof p=="object"){if(utils.endsWith(v,"{}"))v=n?v:v.slice(0,-2),p=JSON.stringify(p);else if(utils.isArray(p)&&isFlatArray(p)||(utils.isFileList(p)||utils.endsWith(v,"[]"))&&(w=utils.toArray(p)))return v=removeBrackets(v),w.forEach(function(D,k){!(utils.isUndefined(D)||D===null)&&e.append(o===!0?renderKey([v],k,i):o===null?v:v+"[]",u(D))}),!1}return isVisitable(p)?!0:(e.append(renderKey(y,v,i),u(p)),!1)}const d=[],h=Object.assign(predicates,{defaultVisitor:c,convertValue:u,isVisitable});function m(p,v){if(!utils.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+v.join("."));d.push(p),utils.forEach(p,function(w,_){(!(utils.isUndefined(w)||w===null)&&r.call(e,w,utils.isString(_)?_.trim():_,v,h))===!0&&m(w,v?v.concat(_):[_])}),d.pop()}}if(!utils.isObject(t))throw new TypeError("data must be an object");return m(t),e}function encode$1(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function AxiosURLSearchParams(t,e){this._pairs=[],t&&toFormData(t,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,a){this._pairs.push([e,a])};prototype.toString=function(e){const a=e?function(n){return e.call(this,n,encode$1)}:encode$1;return this._pairs.map(function(r){return a(r[0])+"="+a(r[1])},"").join("&")};function encode(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(t,e,a){if(!e)return t;const n=a&&a.encode||encode,r=a&&a.serialize;let i;if(r?i=r(e,a):i=utils.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,a).toString(n),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class InterceptorManager{constructor(){this.handlers=[]}use(e,a,n){return this.handlers.push({fulfilled:e,rejected:a,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils.forEach(this.handlers,function(n){n!==null&&e(n)})}}const InterceptorManager$1=InterceptorManager,transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,isStandardBrowserEnv=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),isStandardBrowserWebWorkerEnv=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),platform={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},isStandardBrowserEnv,isStandardBrowserWebWorkerEnv,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(t,e){return toFormData(t,new platform.classes.URLSearchParams,Object.assign({visitor:function(a,n,r,i){return platform.isNode&&utils.isBuffer(a)?(this.append(n,a.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(t){return utils.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(t){const e={},a=Object.keys(t);let n;const r=a.length;let i;for(n=0;n<r;n++)i=a[n],e[i]=t[i];return e}function formDataToJSON(t){function e(a,n,r,i){let o=a[i++];const s=Number.isFinite(+o),l=i>=a.length;return o=!o&&utils.isArray(r)?r.length:o,l?(utils.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s):((!r[o]||!utils.isObject(r[o]))&&(r[o]=[]),e(a,n,r[o],i)&&utils.isArray(r[o])&&(r[o]=arrayToObject(r[o])),!s)}if(utils.isFormData(t)&&utils.isFunction(t.entries)){const a={};return utils.forEachEntry(t,(n,r)=>{e(parsePropPath(n),r,a,0)}),a}return null}function stringifySafely(t,e,a){if(utils.isString(t))try{return(e||JSON.parse)(t),utils.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(a||JSON.stringify)(t)}const defaults$1={transitional:transitionalDefaults,adapter:platform.isNode?"http":"xhr",transformRequest:[function(e,a){const n=a.getContentType()||"",r=n.indexOf("application/json")>-1,i=utils.isObject(e);if(i&&utils.isHTMLForm(e)&&(e=new FormData(e)),utils.isFormData(e))return r&&r?JSON.stringify(formDataToJSON(e)):e;if(utils.isArrayBuffer(e)||utils.isBuffer(e)||utils.isStream(e)||utils.isFile(e)||utils.isBlob(e))return e;if(utils.isArrayBufferView(e))return e.buffer;if(utils.isURLSearchParams(e))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((s=utils.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return toFormData(s?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||r?(a.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const a=this.transitional||defaults$1.transitional,n=a&&a.forcedJSONParsing,r=this.responseType==="json";if(e&&utils.isString(e)&&(n&&!this.responseType||r)){const o=!(a&&a.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?AxiosError.from(s,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils.forEach(["delete","get","head","post","put","patch"],t=>{defaults$1.headers[t]={}});const defaults$2=defaults$1,ignoreDuplicateOf=utils.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"]),parseHeaders=t=>{const e={};let a,n,r;return t&&t.split(`
`).forEach(function(o){r=o.indexOf(":"),a=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim(),!(!a||e[a]&&ignoreDuplicateOf[a])&&(a==="set-cookie"?e[a]?e[a].push(n):e[a]=[n]:e[a]=e[a]?e[a]+", "+n:n)}),e},$internals=Symbol("internals");function normalizeHeader(t){return t&&String(t).trim().toLowerCase()}function normalizeValue(t){return t===!1||t==null?t:utils.isArray(t)?t.map(normalizeValue):String(t)}function parseTokens(t){const e=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=a.exec(t);)e[n[1]]=n[2];return e}const isValidHeaderName=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function matchHeaderValue(t,e,a,n,r){if(utils.isFunction(n))return n.call(this,e,a);if(r&&(e=a),!!utils.isString(e)){if(utils.isString(n))return e.indexOf(n)!==-1;if(utils.isRegExp(n))return n.test(e)}}function formatHeader(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,a,n)=>a.toUpperCase()+n)}function buildAccessors(t,e){const a=utils.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+a,{value:function(r,i,o){return this[n].call(this,e,r,i,o)},configurable:!0})})}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,a,n){const r=this;function i(s,l,u){const c=normalizeHeader(l);if(!c)throw new Error("header name must be a non-empty string");const d=utils.findKey(r,c);(!d||r[d]===void 0||u===!0||u===void 0&&r[d]!==!1)&&(r[d||l]=normalizeValue(s))}const o=(s,l)=>utils.forEach(s,(u,c)=>i(u,c,l));return utils.isPlainObject(e)||e instanceof this.constructor?o(e,a):utils.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)?o(parseHeaders(e),a):e!=null&&i(a,e,n),this}get(e,a){if(e=normalizeHeader(e),e){const n=utils.findKey(this,e);if(n){const r=this[n];if(!a)return r;if(a===!0)return parseTokens(r);if(utils.isFunction(a))return a.call(this,r,n);if(utils.isRegExp(a))return a.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,a){if(e=normalizeHeader(e),e){const n=utils.findKey(this,e);return!!(n&&this[n]!==void 0&&(!a||matchHeaderValue(this,this[n],n,a)))}return!1}delete(e,a){const n=this;let r=!1;function i(o){if(o=normalizeHeader(o),o){const s=utils.findKey(n,o);s&&(!a||matchHeaderValue(n,n[s],s,a))&&(delete n[s],r=!0)}}return utils.isArray(e)?e.forEach(i):i(e),r}clear(e){const a=Object.keys(this);let n=a.length,r=!1;for(;n--;){const i=a[n];(!e||matchHeaderValue(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const a=this,n={};return utils.forEach(this,(r,i)=>{const o=utils.findKey(n,i);if(o){a[o]=normalizeValue(r),delete a[i];return}const s=e?formatHeader(i):String(i).trim();s!==i&&delete a[i],a[s]=normalizeValue(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const a=Object.create(null);return utils.forEach(this,(n,r)=>{n!=null&&n!==!1&&(a[r]=e&&utils.isArray(n)?n.join(", "):n)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,a])=>e+": "+a).join(`
-`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...a){const n=new this(e);return a.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[$internals]=this[$internals]={accessors:{}}).accessors,r=this.prototype;function i(o){const s=normalizeHeader(o);n[s]||(buildAccessors(r,o),n[s]=!0)}return utils.isArray(e)?e.forEach(i):i(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils.freezeMethods(AxiosHeaders.prototype);utils.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(t,e){const a=this||defaults$2,n=e||a,r=AxiosHeaders$1.from(n.headers);let i=n.data;return utils.forEach(t,function(s){i=s.call(a,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function isCancel(t){return!!(t&&t.__CANCEL__)}function CanceledError(t,e,a){AxiosError.call(this,t??"canceled",AxiosError.ERR_CANCELED,e,a),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(t,e,a){const n=a.config.validateStatus;!a.status||!n||n(a.status)?t(a):e(new AxiosError("Request failed with status code "+a.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}const cookies=platform.isStandardBrowserEnv?function(){return{write:function(a,n,r,i,o,s){const l=[];l.push(a+"="+encodeURIComponent(n)),utils.isNumber(r)&&l.push("expires="+new Date(r).toGMTString()),utils.isString(i)&&l.push("path="+i),utils.isString(o)&&l.push("domain="+o),s===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(a){const n=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const isURLSameOrigin=platform.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a");let n;function r(i){let o=i;return e&&(a.setAttribute("href",o),o=a.href),a.setAttribute("href",o),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return n=r(window.location.href),function(o){const s=utils.isString(o)?r(o):o;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}();function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const a=new Array(t),n=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=n[i];o||(o=u),a[r]=l,n[r]=u;let d=i,h=0;for(;d!==r;)h+=a[d++],d=d%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),u-o<e)return;const m=c&&u-c;return m?Math.round(h*1e3/m):void 0}}function progressEventReducer(t,e){let a=0;const n=speedometer(50,250);return r=>{const i=r.loaded,o=r.lengthComputable?r.total:void 0,s=i-a,l=n(s),u=i<=o;a=i;const c={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:l||void 0,estimated:l&&o&&u?(o-i)/l:void 0,event:r};c[e?"download":"upload"]=!0,t(c)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(a,n){let r=t.data;const i=AxiosHeaders$1.from(t.headers).normalize(),o=t.responseType;let s;function l(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}utils.isFormData(r)&&(platform.isStandardBrowserEnv||platform.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",p=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(m+":"+p))}const c=buildFullPath(t.baseURL,t.url);u.open(t.method.toUpperCase(),buildURL(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout;function d(){if(!u)return;const m=AxiosHeaders$1.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:m,config:t,request:u};settle(function(w){a(w),l()},function(w){n(w),l()},v),u=null}if("onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(d)},u.onabort=function(){u&&(n(new AxiosError("Request aborted",AxiosError.ECONNABORTED,t,u)),u=null)},u.onerror=function(){n(new AxiosError("Network Error",AxiosError.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let p=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||transitionalDefaults;t.timeoutErrorMessage&&(p=t.timeoutErrorMessage),n(new AxiosError(p,v.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,t,u)),u=null},platform.isStandardBrowserEnv){const m=(t.withCredentials||isURLSameOrigin(c))&&t.xsrfCookieName&&cookies.read(t.xsrfCookieName);m&&i.set(t.xsrfHeaderName,m)}r===void 0&&i.setContentType(null),"setRequestHeader"in u&&utils.forEach(i.toJSON(),function(p,v){u.setRequestHeader(v,p)}),utils.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&o!=="json"&&(u.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&u.addEventListener("progress",progressEventReducer(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",progressEventReducer(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=m=>{u&&(n(!m||m.type?new CanceledError(null,t,u):m),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const h=parseProtocol(c);if(h&&platform.protocols.indexOf(h)===-1){n(new AxiosError("Unsupported protocol "+h+":",AxiosError.ERR_BAD_REQUEST,t));return}u.send(r||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const adapters$1={getAdapter:t=>{t=utils.isArray(t)?t:[t];const{length:e}=t;let a,n;for(let r=0;r<e&&(a=t[r],!(n=utils.isString(a)?knownAdapters[a.toLowerCase()]:a));r++);if(!n)throw n===!1?new AxiosError(`Adapter ${a} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(utils.hasOwnProp(knownAdapters,a)?`Adapter '${a}' is not available in the build`:`Unknown adapter '${a}'`);if(!utils.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:knownAdapters};function throwIfCancellationRequested(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new CanceledError(null,t)}function dispatchRequest(t){return throwIfCancellationRequested(t),t.headers=AxiosHeaders$1.from(t.headers),t.data=transformData.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),adapters$1.getAdapter(t.adapter||defaults$2.adapter)(t).then(function(n){return throwIfCancellationRequested(t),n.data=transformData.call(t,t.transformResponse,n),n.headers=AxiosHeaders$1.from(n.headers),n},function(n){return isCancel(n)||(throwIfCancellationRequested(t),n&&n.response&&(n.response.data=transformData.call(t,t.transformResponse,n.response),n.response.headers=AxiosHeaders$1.from(n.response.headers))),Promise.reject(n)})}const headersToObject=t=>t instanceof AxiosHeaders$1?t.toJSON():t;function mergeConfig(t,e){e=e||{};const a={};function n(u,c,d){return utils.isPlainObject(u)&&utils.isPlainObject(c)?utils.merge.call({caseless:d},u,c):utils.isPlainObject(c)?utils.merge({},c):utils.isArray(c)?c.slice():c}function r(u,c,d){if(utils.isUndefined(c)){if(!utils.isUndefined(u))return n(void 0,u,d)}else return n(u,c,d)}function i(u,c){if(!utils.isUndefined(c))return n(void 0,c)}function o(u,c){if(utils.isUndefined(c)){if(!utils.isUndefined(u))return n(void 0,u)}else return n(void 0,c)}function s(u,c,d){if(d in e)return n(u,c);if(d in t)return n(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,c)=>r(headersToObject(u),headersToObject(c),!0)};return utils.forEach(Object.keys(Object.assign({},t,e)),function(c){const d=l[c]||r,h=d(t[c],e[c],c);utils.isUndefined(h)&&d!==s||(a[c]=h)}),a}const VERSION$1="1.4.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function(e,a,n){function r(i,o){return"[Axios v"+VERSION$1+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,s)=>{if(e===!1)throw new AxiosError(r(o," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(r(o," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(i,o,s):!0}};function assertOptions(t,e,a){if(typeof t!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const i=n[r],o=e[i];if(o){const s=t[i],l=s===void 0||o(s,i,t);if(l!==!0)throw new AxiosError("option "+i+" must be "+l,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=mergeConfig(this.defaults,a);const{transitional:n,paramsSerializer:r,headers:i}=a;n!==void 0&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),r!=null&&(utils.isFunction(r)?a.paramsSerializer={serialize:r}:validator.assertOptions(r,{encode:validators.function,serialize:validators.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let o;o=i&&utils.merge(i.common,i[a.method]),o&&utils.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),a.headers=AxiosHeaders$1.concat(o,i);const s=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(a)===!1||(l=l&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,d=0,h;if(!l){const p=[dispatchRequest.bind(this),void 0];for(p.unshift.apply(p,s),p.push.apply(p,u),h=p.length,c=Promise.resolve(a);d<h;)c=c.then(p[d++],p[d++]);return c}h=s.length;let m=a;for(d=0;d<h;){const p=s[d++],v=s[d++];try{m=p(m)}catch(y){v.call(this,y);break}}try{c=dispatchRequest.call(this,m)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(e){e=mergeConfig(this.defaults,e);const a=buildFullPath(e.baseURL,e.url);return buildURL(a,e.params,e.paramsSerializer)}}utils.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(a,n){return this.request(mergeConfig(n||{},{method:e,url:a,data:(n||{}).data}))}});utils.forEach(["post","put","patch"],function(e){function a(n){return function(i,o,s){return this.request(mergeConfig(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Axios.prototype[e]=a(),Axios.prototype[e+"Form"]=a(!0)});const Axios$1=Axios;class CancelToken{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(s=>{n.subscribe(s),i=s}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,s){n.reason||(n.reason=new CanceledError(i,o,s),a(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}static source(){let e;return{token:new CancelToken(function(r){e=r}),cancel:e}}}const CancelToken$1=CancelToken;function spread(t){return function(a){return t.apply(null,a)}}function isAxiosError(t){return utils.isObject(t)&&t.isAxiosError===!0}const HttpStatusCode={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(HttpStatusCode).forEach(([t,e])=>{HttpStatusCode[e]=t});const HttpStatusCode$1=HttpStatusCode;function createInstance(t){const e=new Axios$1(t),a=bind$4(Axios$1.prototype.request,e);return utils.extend(a,Axios$1.prototype,e,{allOwnKeys:!0}),utils.extend(a,e,null,{allOwnKeys:!0}),a.create=function(r){return createInstance(mergeConfig(t,r))},a}const axios=createInstance(defaults$2);axios.Axios=Axios$1;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel;axios.VERSION=VERSION$1;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(e){return Promise.all(e)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=t=>formDataToJSON(utils.isHTMLForm(t)?new FormData(t):t);axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const axios$1=axios;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var assign$1=make_assign(),create$2=make_create(),trim$1=make_trim(),Global$5=typeof window<"u"?window:commonjsGlobal,util$7={assign:assign$1,create:create$2,trim:trim$1,bind:bind$3,slice:slice$2,each:each$9,map:map$2,pluck:pluck$1,isList:isList$1,isFunction:isFunction$5,isObject:isObject$b,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,a,n,r){for(var i=1;i<arguments.length;i++)each$9(Object(arguments[i]),function(o,s){e[s]=o});return e}}function make_create(){if(Object.create)return function(a,n,r,i){var o=slice$2(arguments,1);return assign$1.apply(this,[Object.create(a)].concat(o))};{let e=function(){};var t=e;return function(n,r,i,o){var s=slice$2(arguments,1);return e.prototype=n,assign$1.apply(this,[new e].concat(s))}}}function make_trim(){return String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function bind$3(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}}function slice$2(t,e){return Array.prototype.slice.call(t,e||0)}function each$9(t,e){pluck$1(t,function(a,n){return e(a,n),!1})}function map$2(t,e){var a=isList$1(t)?[]:{};return pluck$1(t,function(n,r){return a[r]=e(n,r),!1}),a}function pluck$1(t,e){if(isList$1(t)){for(var a=0;a<t.length;a++)if(e(t[a],a))return t[a]}else for(var n in t)if(t.hasOwnProperty(n)&&e(t[n],n))return t[n]}function isList$1(t){return t!=null&&typeof t!="function"&&typeof t.length=="number"}function isFunction$5(t){return t&&{}.toString.call(t)==="[object Function]"}function isObject$b(t){return t&&{}.toString.call(t)==="[object Object]"}var util$6=util$7,slice$1=util$6.slice,pluck=util$6.pluck,each$8=util$6.each,bind$2=util$6.bind,create$1=util$6.create,isList=util$6.isList,isFunction$4=util$6.isFunction,isObject$a=util$6.isObject,storeEngine={createStore},storeAPI={version:"2.0.12",enabled:!1,get:function(t,e){var a=this.storage.read(this._namespacePrefix+t);return this._deserialize(a,e)},set:function(t,e){return e===void 0?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each(function(a,n){t.call(e,e._deserialize(a),(n||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return createStore.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return createStore(this.storage,this.plugins,t)}};function _warn(){var t=typeof console>"u"?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function createStore(t,e,a){a||(a=""),t&&!isList(t)&&(t=[t]),e&&!isList(e)&&(e=[e]);var n=a?"__storejs_"+a+"_":"",r=a?new RegExp("^"+n):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:n,_namespaceRegexp:r,_testStorage:function(l){try{var u="__storejs__test__";l.write(u,u);var c=l.read(u)===u;return l.remove(u),c}catch{return!1}},_assignPluginFnProp:function(l,u){var c=this[u];this[u]=function(){var h=slice$1(arguments,0),m=this;function p(){if(c)return each$8(arguments,function(y,w){h[w]=y}),c.apply(m,h)}var v=[p].concat(h);return l.apply(m,v)}},_serialize:function(l){return JSON.stringify(l)},_deserialize:function(l,u){if(!l)return u;var c="";try{c=JSON.parse(l)}catch{c=l}return c!==void 0?c:u},_addStorage:function(l){this.enabled||this._testStorage(l)&&(this.storage=l,this.enabled=!0)},_addPlugin:function(l){var u=this;if(isList(l)){each$8(l,function(h){u._addPlugin(h)});return}var c=pluck(this.plugins,function(h){return l===h});if(!c){if(this.plugins.push(l),!isFunction$4(l))throw new Error("Plugins must be function values that return objects");var d=l.call(this);if(!isObject$a(d))throw new Error("Plugins must return an object of function properties");each$8(d,function(h,m){if(!isFunction$4(h))throw new Error("Bad plugin property: "+m+" from plugin "+l.name+". Plugins should only return functions.");u._assignPluginFnProp(h,m)})}},addStorage:function(l){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(l)}},s=create$1(o,storeAPI,{plugins:[]});return s.raw={},each$8(s,function(l,u){isFunction$4(l)&&(s.raw[u]=bind$2(s,l))}),each$8(t,function(l){s._addStorage(l)}),each$8(e,function(l){s._addPlugin(l)}),s}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$7,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(t){return localStorage().getItem(t)}function write$6(t,e){return localStorage().setItem(t,e)}function each$7(t){for(var e=localStorage().length-1;e>=0;e--){var a=localStorage().key(e);t(read$6(a),a)}}function remove$5(t){return localStorage().removeItem(t)}function clearAll$5(){return localStorage().clear()}var util$4=util$7,Global$3=util$4.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$5,write:write$5,each:each$6,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(t){return globalStorage[t]}function write$5(t,e){globalStorage[t]=e}function each$6(t){for(var e=globalStorage.length-1;e>=0;e--){var a=globalStorage.key(e);t(globalStorage[a],a)}}function remove$4(t){return globalStorage.removeItem(t)}function clearAll$4(){each$6(function(t,e){delete globalStorage[t]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$5,remove:remove$3,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$4(t,e){if(!disable){var a=fixKey(t);_withStorageEl(function(n){n.setAttribute(a,e),n.save(storageName)})}}function read$4(t){if(!disable){var e=fixKey(t),a=null;return _withStorageEl(function(n){a=n.getAttribute(e)}),a}}function each$5(t){_withStorageEl(function(e){for(var a=e.XMLDocument.documentElement.attributes,n=a.length-1;n>=0;n--){var r=a[n];t(e.getAttribute(r.name),r.name)}})}function remove$3(t){var e=fixKey(t);_withStorageEl(function(a){a.removeAttribute(e),a.save(storageName)})}function clearAll$3(){_withStorageEl(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(storageName);for(var a=e.length-1;a>=0;a--)t.removeAttribute(e[a].name);t.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(t){return t.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var t="script",e,a,n;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+t+">document.w=window</"+t+'><iframe src="/favicon.ico"></iframe>'),a.close(),e=a.w.frames[0].document,n=e.createElement("div")}catch{n=doc$1.createElement("div"),e=doc$1.body}return function(r){var i=[].slice.call(arguments,0);i.unshift(n),e.appendChild(n),n.addBehavior("#default#userData"),n.load(storageName),r.apply(this,i),e.removeChild(n)}}var util$2=util$7,Global$1=util$2.Global,trim=util$2.trim,cookieStorage={name:"cookieStorage",read:read$3,write:write$3,each:each$4,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(t){if(!t||!_has(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$4(t){for(var e=doc.cookie.split(/; ?/g),a=e.length-1;a>=0;a--)if(trim(e[a])){var n=e[a].split("="),r=unescape(n[0]),i=unescape(n[1]);t(i,r)}}function write$3(t,e){t&&(doc.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(t){!t||!_has(t)||(doc.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$4(function(t,e){remove$2(e)})}function _has(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$1=util$7,Global=util$1.Global,sessionStorage_1={name:"sessionStorage",read:read$2,write:write$2,each:each$3,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(t){return sessionStorage().getItem(t)}function write$2(t,e){return sessionStorage().setItem(t,e)}function each$3(t){for(var e=sessionStorage().length-1;e>=0;e--){var a=sessionStorage().key(e);t(read$2(a),a)}}function remove$1(t){return sessionStorage().removeItem(t)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$2,remove,clearAll},memoryStorage={};function read$1(t){return memoryStorage[t]}function write$1(t,e){memoryStorage[t]=e}function each$2(t){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&t(memoryStorage[e],e)}function remove(t){delete memoryStorage[t]}function clearAll(t){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1],json2$1={},hasRequiredJson2;function requireJson2(){return hasRequiredJson2||(hasRequiredJson2=1,typeof JSON!="object"&&(JSON={}),function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(e){var a=meta[e];return typeof a=="string"?a:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var a,n,r,i,o=gap,s,l=e[t];switch(l&&typeof l=="object"&&typeof l.toJSON=="function"&&(l=l.toJSON(t)),typeof rep=="function"&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,s=[],Object.prototype.toString.apply(l)==="[object Array]"){for(i=l.length,a=0;a<i;a+=1)s[a]=str(a,l)||"null";return r=s.length===0?"[]":gap?`[
+`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...a){const n=new this(e);return a.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[$internals]=this[$internals]={accessors:{}}).accessors,r=this.prototype;function i(o){const s=normalizeHeader(o);n[s]||(buildAccessors(r,o),n[s]=!0)}return utils.isArray(e)?e.forEach(i):i(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils.reduceDescriptors(AxiosHeaders.prototype,({value:t},e)=>{let a=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[a]=n}}});utils.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(t,e){const a=this||defaults$2,n=e||a,r=AxiosHeaders$1.from(n.headers);let i=n.data;return utils.forEach(t,function(s){i=s.call(a,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function isCancel(t){return!!(t&&t.__CANCEL__)}function CanceledError(t,e,a){AxiosError.call(this,t??"canceled",AxiosError.ERR_CANCELED,e,a),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(t,e,a){const n=a.config.validateStatus;!a.status||!n||n(a.status)?t(a):e(new AxiosError("Request failed with status code "+a.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}const cookies=platform.isStandardBrowserEnv?function(){return{write:function(a,n,r,i,o,s){const l=[];l.push(a+"="+encodeURIComponent(n)),utils.isNumber(r)&&l.push("expires="+new Date(r).toGMTString()),utils.isString(i)&&l.push("path="+i),utils.isString(o)&&l.push("domain="+o),s===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(a){const n=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const isURLSameOrigin=platform.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a");let n;function r(i){let o=i;return e&&(a.setAttribute("href",o),o=a.href),a.setAttribute("href",o),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return n=r(window.location.href),function(o){const s=utils.isString(o)?r(o):o;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}();function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const a=new Array(t),n=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=n[i];o||(o=u),a[r]=l,n[r]=u;let d=i,h=0;for(;d!==r;)h+=a[d++],d=d%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),u-o<e)return;const m=c&&u-c;return m?Math.round(h*1e3/m):void 0}}function progressEventReducer(t,e){let a=0;const n=speedometer(50,250);return r=>{const i=r.loaded,o=r.lengthComputable?r.total:void 0,s=i-a,l=n(s),u=i<=o;a=i;const c={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:l||void 0,estimated:l&&o&&u?(o-i)/l:void 0,event:r};c[e?"download":"upload"]=!0,t(c)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(a,n){let r=t.data;const i=AxiosHeaders$1.from(t.headers).normalize(),o=t.responseType;let s;function l(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}utils.isFormData(r)&&(platform.isStandardBrowserEnv||platform.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",p=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(m+":"+p))}const c=buildFullPath(t.baseURL,t.url);u.open(t.method.toUpperCase(),buildURL(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout;function d(){if(!u)return;const m=AxiosHeaders$1.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:m,config:t,request:u};settle(function(w){a(w),l()},function(w){n(w),l()},v),u=null}if("onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(d)},u.onabort=function(){u&&(n(new AxiosError("Request aborted",AxiosError.ECONNABORTED,t,u)),u=null)},u.onerror=function(){n(new AxiosError("Network Error",AxiosError.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let p=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||transitionalDefaults;t.timeoutErrorMessage&&(p=t.timeoutErrorMessage),n(new AxiosError(p,v.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,t,u)),u=null},platform.isStandardBrowserEnv){const m=(t.withCredentials||isURLSameOrigin(c))&&t.xsrfCookieName&&cookies.read(t.xsrfCookieName);m&&i.set(t.xsrfHeaderName,m)}r===void 0&&i.setContentType(null),"setRequestHeader"in u&&utils.forEach(i.toJSON(),function(p,v){u.setRequestHeader(v,p)}),utils.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&o!=="json"&&(u.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&u.addEventListener("progress",progressEventReducer(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",progressEventReducer(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=m=>{u&&(n(!m||m.type?new CanceledError(null,t,u):m),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const h=parseProtocol(c);if(h&&platform.protocols.indexOf(h)===-1){n(new AxiosError("Unsupported protocol "+h+":",AxiosError.ERR_BAD_REQUEST,t));return}u.send(r||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const adapters$1={getAdapter:t=>{t=utils.isArray(t)?t:[t];const{length:e}=t;let a,n;for(let r=0;r<e&&(a=t[r],!(n=utils.isString(a)?knownAdapters[a.toLowerCase()]:a));r++);if(!n)throw n===!1?new AxiosError(`Adapter ${a} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(utils.hasOwnProp(knownAdapters,a)?`Adapter '${a}' is not available in the build`:`Unknown adapter '${a}'`);if(!utils.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:knownAdapters};function throwIfCancellationRequested(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new CanceledError(null,t)}function dispatchRequest(t){return throwIfCancellationRequested(t),t.headers=AxiosHeaders$1.from(t.headers),t.data=transformData.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),adapters$1.getAdapter(t.adapter||defaults$2.adapter)(t).then(function(n){return throwIfCancellationRequested(t),n.data=transformData.call(t,t.transformResponse,n),n.headers=AxiosHeaders$1.from(n.headers),n},function(n){return isCancel(n)||(throwIfCancellationRequested(t),n&&n.response&&(n.response.data=transformData.call(t,t.transformResponse,n.response),n.response.headers=AxiosHeaders$1.from(n.response.headers))),Promise.reject(n)})}const headersToObject=t=>t instanceof AxiosHeaders$1?t.toJSON():t;function mergeConfig(t,e){e=e||{};const a={};function n(u,c,d){return utils.isPlainObject(u)&&utils.isPlainObject(c)?utils.merge.call({caseless:d},u,c):utils.isPlainObject(c)?utils.merge({},c):utils.isArray(c)?c.slice():c}function r(u,c,d){if(utils.isUndefined(c)){if(!utils.isUndefined(u))return n(void 0,u,d)}else return n(u,c,d)}function i(u,c){if(!utils.isUndefined(c))return n(void 0,c)}function o(u,c){if(utils.isUndefined(c)){if(!utils.isUndefined(u))return n(void 0,u)}else return n(void 0,c)}function s(u,c,d){if(d in e)return n(u,c);if(d in t)return n(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,c)=>r(headersToObject(u),headersToObject(c),!0)};return utils.forEach(Object.keys(Object.assign({},t,e)),function(c){const d=l[c]||r,h=d(t[c],e[c],c);utils.isUndefined(h)&&d!==s||(a[c]=h)}),a}const VERSION$1="1.5.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function(e,a,n){function r(i,o){return"[Axios v"+VERSION$1+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,s)=>{if(e===!1)throw new AxiosError(r(o," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(r(o," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(i,o,s):!0}};function assertOptions(t,e,a){if(typeof t!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const i=n[r],o=e[i];if(o){const s=t[i],l=s===void 0||o(s,i,t);if(l!==!0)throw new AxiosError("option "+i+" must be "+l,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=mergeConfig(this.defaults,a);const{transitional:n,paramsSerializer:r,headers:i}=a;n!==void 0&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),r!=null&&(utils.isFunction(r)?a.paramsSerializer={serialize:r}:validator.assertOptions(r,{encode:validators.function,serialize:validators.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let o=i&&utils.merge(i.common,i[a.method]);i&&utils.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),a.headers=AxiosHeaders$1.concat(o,i);const s=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(a)===!1||(l=l&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,d=0,h;if(!l){const p=[dispatchRequest.bind(this),void 0];for(p.unshift.apply(p,s),p.push.apply(p,u),h=p.length,c=Promise.resolve(a);d<h;)c=c.then(p[d++],p[d++]);return c}h=s.length;let m=a;for(d=0;d<h;){const p=s[d++],v=s[d++];try{m=p(m)}catch(y){v.call(this,y);break}}try{c=dispatchRequest.call(this,m)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(e){e=mergeConfig(this.defaults,e);const a=buildFullPath(e.baseURL,e.url);return buildURL(a,e.params,e.paramsSerializer)}}utils.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(a,n){return this.request(mergeConfig(n||{},{method:e,url:a,data:(n||{}).data}))}});utils.forEach(["post","put","patch"],function(e){function a(n){return function(i,o,s){return this.request(mergeConfig(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Axios.prototype[e]=a(),Axios.prototype[e+"Form"]=a(!0)});const Axios$1=Axios;class CancelToken{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(s=>{n.subscribe(s),i=s}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,s){n.reason||(n.reason=new CanceledError(i,o,s),a(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}static source(){let e;return{token:new CancelToken(function(r){e=r}),cancel:e}}}const CancelToken$1=CancelToken;function spread(t){return function(a){return t.apply(null,a)}}function isAxiosError(t){return utils.isObject(t)&&t.isAxiosError===!0}const HttpStatusCode={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(HttpStatusCode).forEach(([t,e])=>{HttpStatusCode[e]=t});const HttpStatusCode$1=HttpStatusCode;function createInstance(t){const e=new Axios$1(t),a=bind$4(Axios$1.prototype.request,e);return utils.extend(a,Axios$1.prototype,e,{allOwnKeys:!0}),utils.extend(a,e,null,{allOwnKeys:!0}),a.create=function(r){return createInstance(mergeConfig(t,r))},a}const axios=createInstance(defaults$2);axios.Axios=Axios$1;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel;axios.VERSION=VERSION$1;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(e){return Promise.all(e)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=t=>formDataToJSON(utils.isHTMLForm(t)?new FormData(t):t);axios.getAdapter=adapters$1.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const axios$1=axios;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var assign$1=make_assign(),create$2=make_create(),trim$1=make_trim(),Global$5=typeof window<"u"?window:commonjsGlobal,util$7={assign:assign$1,create:create$2,trim:trim$1,bind:bind$3,slice:slice$2,each:each$9,map:map$2,pluck:pluck$1,isList:isList$1,isFunction:isFunction$5,isObject:isObject$b,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,a,n,r){for(var i=1;i<arguments.length;i++)each$9(Object(arguments[i]),function(o,s){e[s]=o});return e}}function make_create(){if(Object.create)return function(a,n,r,i){var o=slice$2(arguments,1);return assign$1.apply(this,[Object.create(a)].concat(o))};{let e=function(){};var t=e;return function(n,r,i,o){var s=slice$2(arguments,1);return e.prototype=n,assign$1.apply(this,[new e].concat(s))}}}function make_trim(){return String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function bind$3(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}}function slice$2(t,e){return Array.prototype.slice.call(t,e||0)}function each$9(t,e){pluck$1(t,function(a,n){return e(a,n),!1})}function map$2(t,e){var a=isList$1(t)?[]:{};return pluck$1(t,function(n,r){return a[r]=e(n,r),!1}),a}function pluck$1(t,e){if(isList$1(t)){for(var a=0;a<t.length;a++)if(e(t[a],a))return t[a]}else for(var n in t)if(t.hasOwnProperty(n)&&e(t[n],n))return t[n]}function isList$1(t){return t!=null&&typeof t!="function"&&typeof t.length=="number"}function isFunction$5(t){return t&&{}.toString.call(t)==="[object Function]"}function isObject$b(t){return t&&{}.toString.call(t)==="[object Object]"}var util$6=util$7,slice$1=util$6.slice,pluck=util$6.pluck,each$8=util$6.each,bind$2=util$6.bind,create$1=util$6.create,isList=util$6.isList,isFunction$4=util$6.isFunction,isObject$a=util$6.isObject,storeEngine={createStore},storeAPI={version:"2.0.12",enabled:!1,get:function(t,e){var a=this.storage.read(this._namespacePrefix+t);return this._deserialize(a,e)},set:function(t,e){return e===void 0?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each(function(a,n){t.call(e,e._deserialize(a),(n||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return createStore.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return createStore(this.storage,this.plugins,t)}};function _warn(){var t=typeof console>"u"?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function createStore(t,e,a){a||(a=""),t&&!isList(t)&&(t=[t]),e&&!isList(e)&&(e=[e]);var n=a?"__storejs_"+a+"_":"",r=a?new RegExp("^"+n):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:n,_namespaceRegexp:r,_testStorage:function(l){try{var u="__storejs__test__";l.write(u,u);var c=l.read(u)===u;return l.remove(u),c}catch{return!1}},_assignPluginFnProp:function(l,u){var c=this[u];this[u]=function(){var h=slice$1(arguments,0),m=this;function p(){if(c)return each$8(arguments,function(y,w){h[w]=y}),c.apply(m,h)}var v=[p].concat(h);return l.apply(m,v)}},_serialize:function(l){return JSON.stringify(l)},_deserialize:function(l,u){if(!l)return u;var c="";try{c=JSON.parse(l)}catch{c=l}return c!==void 0?c:u},_addStorage:function(l){this.enabled||this._testStorage(l)&&(this.storage=l,this.enabled=!0)},_addPlugin:function(l){var u=this;if(isList(l)){each$8(l,function(h){u._addPlugin(h)});return}var c=pluck(this.plugins,function(h){return l===h});if(!c){if(this.plugins.push(l),!isFunction$4(l))throw new Error("Plugins must be function values that return objects");var d=l.call(this);if(!isObject$a(d))throw new Error("Plugins must return an object of function properties");each$8(d,function(h,m){if(!isFunction$4(h))throw new Error("Bad plugin property: "+m+" from plugin "+l.name+". Plugins should only return functions.");u._assignPluginFnProp(h,m)})}},addStorage:function(l){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(l)}},s=create$1(o,storeAPI,{plugins:[]});return s.raw={},each$8(s,function(l,u){isFunction$4(l)&&(s.raw[u]=bind$2(s,l))}),each$8(t,function(l){s._addStorage(l)}),each$8(e,function(l){s._addPlugin(l)}),s}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$7,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(t){return localStorage().getItem(t)}function write$6(t,e){return localStorage().setItem(t,e)}function each$7(t){for(var e=localStorage().length-1;e>=0;e--){var a=localStorage().key(e);t(read$6(a),a)}}function remove$5(t){return localStorage().removeItem(t)}function clearAll$5(){return localStorage().clear()}var util$4=util$7,Global$3=util$4.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$5,write:write$5,each:each$6,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(t){return globalStorage[t]}function write$5(t,e){globalStorage[t]=e}function each$6(t){for(var e=globalStorage.length-1;e>=0;e--){var a=globalStorage.key(e);t(globalStorage[a],a)}}function remove$4(t){return globalStorage.removeItem(t)}function clearAll$4(){each$6(function(t,e){delete globalStorage[t]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$5,remove:remove$3,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$4(t,e){if(!disable){var a=fixKey(t);_withStorageEl(function(n){n.setAttribute(a,e),n.save(storageName)})}}function read$4(t){if(!disable){var e=fixKey(t),a=null;return _withStorageEl(function(n){a=n.getAttribute(e)}),a}}function each$5(t){_withStorageEl(function(e){for(var a=e.XMLDocument.documentElement.attributes,n=a.length-1;n>=0;n--){var r=a[n];t(e.getAttribute(r.name),r.name)}})}function remove$3(t){var e=fixKey(t);_withStorageEl(function(a){a.removeAttribute(e),a.save(storageName)})}function clearAll$3(){_withStorageEl(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(storageName);for(var a=e.length-1;a>=0;a--)t.removeAttribute(e[a].name);t.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(t){return t.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var t="script",e,a,n;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+t+">document.w=window</"+t+'><iframe src="/favicon.ico"></iframe>'),a.close(),e=a.w.frames[0].document,n=e.createElement("div")}catch{n=doc$1.createElement("div"),e=doc$1.body}return function(r){var i=[].slice.call(arguments,0);i.unshift(n),e.appendChild(n),n.addBehavior("#default#userData"),n.load(storageName),r.apply(this,i),e.removeChild(n)}}var util$2=util$7,Global$1=util$2.Global,trim=util$2.trim,cookieStorage={name:"cookieStorage",read:read$3,write:write$3,each:each$4,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(t){if(!t||!_has(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$4(t){for(var e=doc.cookie.split(/; ?/g),a=e.length-1;a>=0;a--)if(trim(e[a])){var n=e[a].split("="),r=unescape(n[0]),i=unescape(n[1]);t(i,r)}}function write$3(t,e){t&&(doc.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(t){!t||!_has(t)||(doc.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$4(function(t,e){remove$2(e)})}function _has(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$1=util$7,Global=util$1.Global,sessionStorage_1={name:"sessionStorage",read:read$2,write:write$2,each:each$3,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(t){return sessionStorage().getItem(t)}function write$2(t,e){return sessionStorage().setItem(t,e)}function each$3(t){for(var e=sessionStorage().length-1;e>=0;e--){var a=sessionStorage().key(e);t(read$2(a),a)}}function remove$1(t){return sessionStorage().removeItem(t)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$2,remove,clearAll},memoryStorage={};function read$1(t){return memoryStorage[t]}function write$1(t,e){memoryStorage[t]=e}function each$2(t){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&t(memoryStorage[e],e)}function remove(t){delete memoryStorage[t]}function clearAll(t){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1],json2$1={},hasRequiredJson2;function requireJson2(){return hasRequiredJson2||(hasRequiredJson2=1,typeof JSON!="object"&&(JSON={}),function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(e){var a=meta[e];return typeof a=="string"?a:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var a,n,r,i,o=gap,s,l=e[t];switch(l&&typeof l=="object"&&typeof l.toJSON=="function"&&(l=l.toJSON(t)),typeof rep=="function"&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,s=[],Object.prototype.toString.apply(l)==="[object Array]"){for(i=l.length,a=0;a<i;a+=1)s[a]=str(a,l)||"null";return r=s.length===0?"[]":gap?`[
`+gap+s.join(`,
`+gap)+`
`+o+"]":"["+s.join(",")+"]",gap=o,r}if(rep&&typeof rep=="object")for(i=rep.length,a=0;a<i;a+=1)typeof rep[a]=="string"&&(n=rep[a],r=str(n,l),r&&s.push(quote(n)+(gap?": ":":")+r));else for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(r=str(n,l),r&&s.push(quote(n)+(gap?": ":":")+r));return r=s.length===0?"{}":gap?`{
`+gap+s.join(`,
`+gap)+`
-`+o+"}":"{"+s.join(",")+"}",gap=o,r}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,a){var n;if(gap="",indent="",typeof a=="number")for(n=0;n<a;n+=1)indent+=" ";else typeof a=="string"&&(indent=a);if(rep=e,e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSON.stringify");return str("",{"":t})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(t,e){var a,n,r=t[e];if(r&&typeof r=="object")for(a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n=walk(r,a),n!==void 0?r[a]=n:delete r[a]);return reviver.call(t,e,r)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()),json2$1}var json2=json2Plugin;function json2Plugin(){return requireJson2(),{}}var engine=storeEngine,storages=all,plugins=[json2],store_legacy=engine.createStore(storages,plugins);const store$1=getDefaultExportFromCjs(store_legacy);var util=util$7,bind$1=util.bind,each$1=util.each,create=util.create,slice=util.slice,events=eventsPlugin$1;function eventsPlugin$1(){var t=_newPubSub();return{watch:e,unwatch:a,once:n,set:r,remove:i,clearAll:o};function e(s,l,u){return t.on(l,bind$1(this,u))}function a(s,l){t.off(l)}function n(s,l,u){t.once(l,bind$1(this,u))}function r(s,l,u){var c=this.get(l);s(),t.fire(l,u,c)}function i(s,l){var u=this.get(l);s(),t.fire(l,void 0,u)}function o(s){var l={};this.each(function(u,c){l[c]=u}),s(),each$1(l,function(u,c){t.fire(c,void 0,u)})}}function _newPubSub(){return create(_pubSubBase,{_id:0,_subSignals:{},_subCallbacks:{}})}var _pubSubBase={_id:null,_subCallbacks:null,_subSignals:null,on:function(t,e){return this._subCallbacks[t]||(this._subCallbacks[t]={}),this._id+=1,this._subCallbacks[t][this._id]=e,this._subSignals[this._id]=t,this._id},off:function(t){var e=this._subSignals[t];delete this._subCallbacks[e][t],delete this._subSignals[t]},once:function(t,e){var a=this.on(t,bind$1(this,function(){e.apply(this,arguments),this.off(a)}))},fire:function(t){var e=slice(arguments,1);each$1(this._subCallbacks[t],function(a){a.apply(this,e)})}},eventsPlugin=events,observe=[eventsPlugin,observePlugin];function observePlugin(){return{observe:t,unobserve:e};function t(a,n,r){var i=this.watch(n,r);return r(this.get(n)),i}function e(a,n){this.unwatch(n)}}const observePlugin$1=getDefaultExportFromCjs(observe);var flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(t){queueJob(t)}function queueJob(t){queue.includes(t)||queue.push(t),queueFlush()}function dequeueJob(t){let e=queue.indexOf(t);e!==-1&&e>lastFlushedIndex&&queue.splice(e,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let t=0;t<queue.length;t++)queue[t](),lastFlushedIndex=t;queue.length=0,lastFlushedIndex=-1,flushing=!1}var reactive,effect$3,release,raw,shouldSchedule=!0;function disableEffectScheduling(t){shouldSchedule=!1,t(),shouldSchedule=!0}function setReactivityEngine(t){reactive=t.reactive,release=t.release,effect$3=e=>t.effect(e,{scheduler:a=>{shouldSchedule?scheduler(a):a()}}),raw=t.raw}function overrideEffect(t){effect$3=t}function elementBoundEffect(t){let e=()=>{};return[n=>{let r=effect$3(n);return t._x_effects||(t._x_effects=new Set,t._x_runEffects=()=>{t._x_effects.forEach(i=>i())}),t._x_effects.add(r),e=()=>{r!==void 0&&(t._x_effects.delete(r),release(r))},r},()=>{e()}]}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElAdded(t){onElAddeds.push(t)}function onElRemoved(t,e){typeof e=="function"?(t._x_cleanups||(t._x_cleanups=[]),t._x_cleanups.push(e)):(e=t,onElRemoveds.push(e))}function onAttributesAdded(t){onAttributeAddeds.push(t)}function onAttributeRemoved(t,e,a){t._x_attributeCleanups||(t._x_attributeCleanups={}),t._x_attributeCleanups[e]||(t._x_attributeCleanups[e]=[]),t._x_attributeCleanups[e].push(a)}function cleanupAttributes(t,e){t._x_attributeCleanups&&Object.entries(t._x_attributeCleanups).forEach(([a,n])=>{(e===void 0||e.includes(a))&&(n.forEach(r=>r()),delete t._x_attributeCleanups[a])})}var observer=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){flushObserver(),observer.disconnect(),currentlyObserving=!1}var recordQueue=[],willProcessRecordQueue=!1;function flushObserver(){recordQueue=recordQueue.concat(observer.takeRecords()),recordQueue.length&&!willProcessRecordQueue&&(willProcessRecordQueue=!0,queueMicrotask(()=>{processRecordQueue(),willProcessRecordQueue=!1}))}function processRecordQueue(){onMutate(recordQueue),recordQueue.length=0}function mutateDom(t){if(!currentlyObserving)return t();stopObservingMutations();let e=t();return startObservingMutations(),e}var isCollecting=!1,deferredMutations=[];function deferMutations(){isCollecting=!0}function flushAndStopDeferringMutations(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]}function onMutate(t){if(isCollecting){deferredMutations=deferredMutations.concat(t);return}let e=[],a=[],n=new Map,r=new Map;for(let i=0;i<t.length;i++)if(!t[i].target._x_ignoreMutationObserver&&(t[i].type==="childList"&&(t[i].addedNodes.forEach(o=>o.nodeType===1&&e.push(o)),t[i].removedNodes.forEach(o=>o.nodeType===1&&a.push(o))),t[i].type==="attributes")){let o=t[i].target,s=t[i].attributeName,l=t[i].oldValue,u=()=>{n.has(o)||n.set(o,[]),n.get(o).push({name:s,value:o.getAttribute(s)})},c=()=>{r.has(o)||r.set(o,[]),r.get(o).push(s)};o.hasAttribute(s)&&l===null?u():o.hasAttribute(s)?(c(),u()):c()}r.forEach((i,o)=>{cleanupAttributes(o,i)}),n.forEach((i,o)=>{onAttributeAddeds.forEach(s=>s(o,i))});for(let i of a)if(!e.includes(i)&&(onElRemoveds.forEach(o=>o(i)),i._x_cleanups))for(;i._x_cleanups.length;)i._x_cleanups.pop()();e.forEach(i=>{i._x_ignoreSelf=!0,i._x_ignore=!0});for(let i of e)a.includes(i)||i.isConnected&&(delete i._x_ignoreSelf,delete i._x_ignore,onElAddeds.forEach(o=>o(i)),i._x_ignore=!0,i._x_ignoreSelf=!0);e.forEach(i=>{delete i._x_ignoreSelf,delete i._x_ignore}),e=null,a=null,n=null,r=null}function scope(t){return mergeProxies(closestDataStack(t))}function addScopeToNode(t,e,a){return t._x_dataStack=[e,...closestDataStack(a||t)],()=>{t._x_dataStack=t._x_dataStack.filter(n=>n!==e)}}function closestDataStack(t){return t._x_dataStack?t._x_dataStack:typeof ShadowRoot=="function"&&t instanceof ShadowRoot?closestDataStack(t.host):t.parentNode?closestDataStack(t.parentNode):[]}function mergeProxies(t){let e=new Proxy({},{ownKeys:()=>Array.from(new Set(t.flatMap(a=>Object.keys(a)))),has:(a,n)=>t.some(r=>r.hasOwnProperty(n)),get:(a,n)=>(t.find(r=>{if(r.hasOwnProperty(n)){let i=Object.getOwnPropertyDescriptor(r,n);if(i.get&&i.get._x_alreadyBound||i.set&&i.set._x_alreadyBound)return!0;if((i.get||i.set)&&i.enumerable){let o=i.get,s=i.set,l=i;o=o&&o.bind(e),s=s&&s.bind(e),o&&(o._x_alreadyBound=!0),s&&(s._x_alreadyBound=!0),Object.defineProperty(r,n,{...l,get:o,set:s})}return!0}return!1})||{})[n],set:(a,n,r)=>{let i=t.find(o=>o.hasOwnProperty(n));return i?i[n]=r:t[t.length-1][n]=r,!0}});return e}function initInterceptors(t){let e=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,a=(n,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([i,{value:o,enumerable:s}])=>{if(s===!1||o===void 0)return;let l=r===""?i:`${r}.${i}`;typeof o=="object"&&o!==null&&o._x_interceptor?n[i]=o.initialize(t,l,i):e(o)&&o!==n&&!(o instanceof Element)&&a(o,l)})};return a(t)}function interceptor(t,e=()=>{}){let a={initialValue:void 0,_x_interceptor:!0,initialize(n,r,i){return t(this.initialValue,()=>get$3(n,r),o=>set$3(n,r,o),r,i)}};return e(a),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let r=a.initialize.bind(a);a.initialize=(i,o,s)=>{let l=n.initialize(i,o,s);return a.initialValue=l,r(i,o,s)}}else a.initialValue=n;return a}}function get$3(t,e){return e.split(".").reduce((a,n)=>a[n],t)}function set$3(t,e,a){if(typeof e=="string"&&(e=e.split(".")),e.length===1)t[e[0]]=a;else{if(e.length===0)throw error;return t[e[0]]||(t[e[0]]={}),set$3(t[e[0]],e.slice(1),a)}}var magics={};function magic(t,e){magics[t]=e}function injectMagics(t,e){return Object.entries(magics).forEach(([a,n])=>{let r=null;function i(){if(r)return r;{let[o,s]=getElementBoundUtilities(e);return r={interceptor,...o},onElRemoved(e,s),r}}Object.defineProperty(t,`$${a}`,{get(){return n(e,i())},enumerable:!1})}),t}function tryCatch(t,e,a,...n){try{return a(...n)}catch(r){handleError(r,t,e)}}function handleError(t,e,a=void 0){Object.assign(t,{el:e,expression:a}),console.warn(`Alpine Expression Error: ${t.message}
+`+o+"}":"{"+s.join(",")+"}",gap=o,r}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,a){var n;if(gap="",indent="",typeof a=="number")for(n=0;n<a;n+=1)indent+=" ";else typeof a=="string"&&(indent=a);if(rep=e,e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSON.stringify");return str("",{"":t})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(t,e){var a,n,r=t[e];if(r&&typeof r=="object")for(a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n=walk(r,a),n!==void 0?r[a]=n:delete r[a]);return reviver.call(t,e,r)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()),json2$1}var json2=json2Plugin;function json2Plugin(){return requireJson2(),{}}var engine=storeEngine,storages=all,plugins=[json2],store_legacy=engine.createStore(storages,plugins);const store$1=getDefaultExportFromCjs(store_legacy);var util=util$7,bind$1=util.bind,each$1=util.each,create=util.create,slice=util.slice,events=eventsPlugin$1;function eventsPlugin$1(){var t=_newPubSub();return{watch:e,unwatch:a,once:n,set:r,remove:i,clearAll:o};function e(s,l,u){return t.on(l,bind$1(this,u))}function a(s,l){t.off(l)}function n(s,l,u){t.once(l,bind$1(this,u))}function r(s,l,u){var c=this.get(l);s(),t.fire(l,u,c)}function i(s,l){var u=this.get(l);s(),t.fire(l,void 0,u)}function o(s){var l={};this.each(function(u,c){l[c]=u}),s(),each$1(l,function(u,c){t.fire(c,void 0,u)})}}function _newPubSub(){return create(_pubSubBase,{_id:0,_subSignals:{},_subCallbacks:{}})}var _pubSubBase={_id:null,_subCallbacks:null,_subSignals:null,on:function(t,e){return this._subCallbacks[t]||(this._subCallbacks[t]={}),this._id+=1,this._subCallbacks[t][this._id]=e,this._subSignals[this._id]=t,this._id},off:function(t){var e=this._subSignals[t];delete this._subCallbacks[e][t],delete this._subSignals[t]},once:function(t,e){var a=this.on(t,bind$1(this,function(){e.apply(this,arguments),this.off(a)}))},fire:function(t){var e=slice(arguments,1);each$1(this._subCallbacks[t],function(a){a.apply(this,e)})}},eventsPlugin=events,observe=[eventsPlugin,observePlugin];function observePlugin(){return{observe:t,unobserve:e};function t(a,n,r){var i=this.watch(n,r);return r(this.get(n)),i}function e(a,n){this.unwatch(n)}}const observePlugin$1=getDefaultExportFromCjs(observe);var flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(t){queueJob(t)}function queueJob(t){queue.includes(t)||queue.push(t),queueFlush()}function dequeueJob(t){let e=queue.indexOf(t);e!==-1&&e>lastFlushedIndex&&queue.splice(e,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let t=0;t<queue.length;t++)queue[t](),lastFlushedIndex=t;queue.length=0,lastFlushedIndex=-1,flushing=!1}var reactive,effect$3,release,raw,shouldSchedule=!0;function disableEffectScheduling(t){shouldSchedule=!1,t(),shouldSchedule=!0}function setReactivityEngine(t){reactive=t.reactive,release=t.release,effect$3=e=>t.effect(e,{scheduler:a=>{shouldSchedule?scheduler(a):a()}}),raw=t.raw}function overrideEffect(t){effect$3=t}function elementBoundEffect(t){let e=()=>{};return[n=>{let r=effect$3(n);return t._x_effects||(t._x_effects=new Set,t._x_runEffects=()=>{t._x_effects.forEach(i=>i())}),t._x_effects.add(r),e=()=>{r!==void 0&&(t._x_effects.delete(r),release(r))},r},()=>{e()}]}function dispatch(t,e,a={}){t.dispatchEvent(new CustomEvent(e,{detail:a,bubbles:!0,composed:!0,cancelable:!0}))}function walk(t,e){if(typeof ShadowRoot=="function"&&t instanceof ShadowRoot){Array.from(t.children).forEach(r=>walk(r,e));return}let a=!1;if(e(t,()=>a=!0),a)return;let n=t.firstElementChild;for(;n;)walk(n,e),n=n.nextElementSibling}function warn(t,...e){console.warn(`Alpine Warning: ${t}`,...e)}var started=!1;function start$1(){started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),dispatch(document,"alpine:init"),dispatch(document,"alpine:initializing"),startObservingMutations(),onElAdded(e=>initTree(e,walk)),onElRemoved(e=>destroyTree(e)),onAttributesAdded((e,a)=>{directives(e,a).forEach(n=>n())});let t=e=>!closestRoot(e.parentElement,!0);Array.from(document.querySelectorAll(allSelectors())).filter(t).forEach(e=>{initTree(e)}),dispatch(document,"alpine:initialized")}var rootSelectorCallbacks=[],initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map(t=>t())}function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map(t=>t())}function addRootSelector(t){rootSelectorCallbacks.push(t)}function addInitSelector(t){initSelectorCallbacks.push(t)}function closestRoot(t,e=!1){return findClosest(t,a=>{if((e?allSelectors():rootSelectors()).some(r=>a.matches(r)))return!0})}function findClosest(t,e){if(t){if(e(t))return t;if(t._x_teleportBack&&(t=t._x_teleportBack),!!t.parentElement)return findClosest(t.parentElement,e)}}function isRoot(t){return rootSelectors().some(e=>t.matches(e))}var initInterceptors=[];function interceptInit(t){initInterceptors.push(t)}function initTree(t,e=walk,a=()=>{}){deferHandlingDirectives(()=>{e(t,(n,r)=>{a(n,r),initInterceptors.forEach(i=>i(n,r)),directives(n,n.attributes).forEach(i=>i()),n._x_ignore&&r()})})}function destroyTree(t){walk(t,e=>{cleanupAttributes(e),cleanupElement(e)})}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElAdded(t){onElAddeds.push(t)}function onElRemoved(t,e){typeof e=="function"?(t._x_cleanups||(t._x_cleanups=[]),t._x_cleanups.push(e)):(e=t,onElRemoveds.push(e))}function onAttributesAdded(t){onAttributeAddeds.push(t)}function onAttributeRemoved(t,e,a){t._x_attributeCleanups||(t._x_attributeCleanups={}),t._x_attributeCleanups[e]||(t._x_attributeCleanups[e]=[]),t._x_attributeCleanups[e].push(a)}function cleanupAttributes(t,e){t._x_attributeCleanups&&Object.entries(t._x_attributeCleanups).forEach(([a,n])=>{(e===void 0||e.includes(a))&&(n.forEach(r=>r()),delete t._x_attributeCleanups[a])})}function cleanupElement(t){if(t._x_cleanups)for(;t._x_cleanups.length;)t._x_cleanups.pop()()}var observer=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){flushObserver(),observer.disconnect(),currentlyObserving=!1}var recordQueue=[],willProcessRecordQueue=!1;function flushObserver(){recordQueue=recordQueue.concat(observer.takeRecords()),recordQueue.length&&!willProcessRecordQueue&&(willProcessRecordQueue=!0,queueMicrotask(()=>{processRecordQueue(),willProcessRecordQueue=!1}))}function processRecordQueue(){onMutate(recordQueue),recordQueue.length=0}function mutateDom(t){if(!currentlyObserving)return t();stopObservingMutations();let e=t();return startObservingMutations(),e}var isCollecting=!1,deferredMutations=[];function deferMutations(){isCollecting=!0}function flushAndStopDeferringMutations(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]}function onMutate(t){if(isCollecting){deferredMutations=deferredMutations.concat(t);return}let e=[],a=[],n=new Map,r=new Map;for(let i=0;i<t.length;i++)if(!t[i].target._x_ignoreMutationObserver&&(t[i].type==="childList"&&(t[i].addedNodes.forEach(o=>o.nodeType===1&&e.push(o)),t[i].removedNodes.forEach(o=>o.nodeType===1&&a.push(o))),t[i].type==="attributes")){let o=t[i].target,s=t[i].attributeName,l=t[i].oldValue,u=()=>{n.has(o)||n.set(o,[]),n.get(o).push({name:s,value:o.getAttribute(s)})},c=()=>{r.has(o)||r.set(o,[]),r.get(o).push(s)};o.hasAttribute(s)&&l===null?u():o.hasAttribute(s)?(c(),u()):c()}r.forEach((i,o)=>{cleanupAttributes(o,i)}),n.forEach((i,o)=>{onAttributeAddeds.forEach(s=>s(o,i))});for(let i of a)e.includes(i)||(onElRemoveds.forEach(o=>o(i)),destroyTree(i));e.forEach(i=>{i._x_ignoreSelf=!0,i._x_ignore=!0});for(let i of e)a.includes(i)||i.isConnected&&(delete i._x_ignoreSelf,delete i._x_ignore,onElAddeds.forEach(o=>o(i)),i._x_ignore=!0,i._x_ignoreSelf=!0);e.forEach(i=>{delete i._x_ignoreSelf,delete i._x_ignore}),e=null,a=null,n=null,r=null}function scope(t){return mergeProxies(closestDataStack(t))}function addScopeToNode(t,e,a){return t._x_dataStack=[e,...closestDataStack(a||t)],()=>{t._x_dataStack=t._x_dataStack.filter(n=>n!==e)}}function closestDataStack(t){return t._x_dataStack?t._x_dataStack:typeof ShadowRoot=="function"&&t instanceof ShadowRoot?closestDataStack(t.host):t.parentNode?closestDataStack(t.parentNode):[]}function mergeProxies(t){let e=new Proxy({},{ownKeys:()=>Array.from(new Set(t.flatMap(a=>Object.keys(a)))),has:(a,n)=>t.some(r=>r.hasOwnProperty(n)),get:(a,n)=>(t.find(r=>{if(r.hasOwnProperty(n)){let i=Object.getOwnPropertyDescriptor(r,n);if(i.get&&i.get._x_alreadyBound||i.set&&i.set._x_alreadyBound)return!0;if((i.get||i.set)&&i.enumerable){let o=i.get,s=i.set,l=i;o=o&&o.bind(e),s=s&&s.bind(e),o&&(o._x_alreadyBound=!0),s&&(s._x_alreadyBound=!0),Object.defineProperty(r,n,{...l,get:o,set:s})}return!0}return!1})||{})[n],set:(a,n,r)=>{let i=t.find(o=>o.hasOwnProperty(n));return i?i[n]=r:t[t.length-1][n]=r,!0}});return e}function initInterceptors2(t){let e=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,a=(n,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([i,{value:o,enumerable:s}])=>{if(s===!1||o===void 0)return;let l=r===""?i:`${r}.${i}`;typeof o=="object"&&o!==null&&o._x_interceptor?n[i]=o.initialize(t,l,i):e(o)&&o!==n&&!(o instanceof Element)&&a(o,l)})};return a(t)}function interceptor(t,e=()=>{}){let a={initialValue:void 0,_x_interceptor:!0,initialize(n,r,i){return t(this.initialValue,()=>get$3(n,r),o=>set$3(n,r,o),r,i)}};return e(a),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let r=a.initialize.bind(a);a.initialize=(i,o,s)=>{let l=n.initialize(i,o,s);return a.initialValue=l,r(i,o,s)}}else a.initialValue=n;return a}}function get$3(t,e){return e.split(".").reduce((a,n)=>a[n],t)}function set$3(t,e,a){if(typeof e=="string"&&(e=e.split(".")),e.length===1)t[e[0]]=a;else{if(e.length===0)throw error;return t[e[0]]||(t[e[0]]={}),set$3(t[e[0]],e.slice(1),a)}}var magics={};function magic(t,e){magics[t]=e}function injectMagics(t,e){return Object.entries(magics).forEach(([a,n])=>{let r=null;function i(){if(r)return r;{let[o,s]=getElementBoundUtilities(e);return r={interceptor,...o},onElRemoved(e,s),r}}Object.defineProperty(t,`$${a}`,{get(){return n(e,i())},enumerable:!1})}),t}function tryCatch(t,e,a,...n){try{return a(...n)}catch(r){handleError(r,t,e)}}function handleError(t,e,a=void 0){Object.assign(t,{el:e,expression:a}),console.warn(`Alpine Expression Error: ${t.message}
${a?'Expression: "'+a+`"
-`:""}`,e),setTimeout(()=>{throw t},0)}var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(t){let e=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1;let a=t();return shouldAutoEvaluateFunctions=e,a}function evaluate(t,e,a={}){let n;return evaluateLater(t,e)(r=>n=r,a),n}function evaluateLater(...t){return theEvaluatorFunction(...t)}var theEvaluatorFunction=normalEvaluator;function setEvaluator(t){theEvaluatorFunction=t}function normalEvaluator(t,e){let a={};injectMagics(a,t);let n=[a,...closestDataStack(t)],r=typeof e=="function"?generateEvaluatorFromFunction(n,e):generateEvaluatorFromString(n,e,t);return tryCatch.bind(null,t,e,r)}function generateEvaluatorFromFunction(t,e){return(a=()=>{},{scope:n={},params:r=[]}={})=>{let i=e.apply(mergeProxies([n,...t]),r);runIfTypeOfFunction(a,i)}}var evaluatorMemo={};function generateFunctionFromString(t,e){if(evaluatorMemo[t])return evaluatorMemo[t];let a=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(t)||/^(let|const)\s/.test(t)?`(async()=>{ ${t} })()`:t,i=(()=>{try{return new a(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(o){return handleError(o,e,t),Promise.resolve()}})();return evaluatorMemo[t]=i,i}function generateEvaluatorFromString(t,e,a){let n=generateFunctionFromString(e,a);return(r=()=>{},{scope:i={},params:o=[]}={})=>{n.result=void 0,n.finished=!1;let s=mergeProxies([i,...t]);if(typeof n=="function"){let l=n(n,s).catch(u=>handleError(u,a,e));n.finished?(runIfTypeOfFunction(r,n.result,s,o,a),n.result=void 0):l.then(u=>{runIfTypeOfFunction(r,u,s,o,a)}).catch(u=>handleError(u,a,e)).finally(()=>n.result=void 0)}}}function runIfTypeOfFunction(t,e,a,n,r){if(shouldAutoEvaluateFunctions&&typeof e=="function"){let i=e.apply(a,n);i instanceof Promise?i.then(o=>runIfTypeOfFunction(t,o,a,n)).catch(o=>handleError(o,r,e)):t(i)}else typeof e=="object"&&e instanceof Promise?e.then(i=>t(i)):t(e)}var prefixAsString="x-";function prefix(t=""){return prefixAsString+t}function setPrefix(t){prefixAsString=t}var directiveHandlers={};function directive(t,e){return directiveHandlers[t]=e,{before(a){if(!directiveHandlers[a]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}const n=directiveOrder.indexOf(a);directiveOrder.splice(n>=0?n:directiveOrder.indexOf("DEFAULT"),0,t)}}}function directives(t,e,a){if(e=Array.from(e),t._x_virtualDirectives){let i=Object.entries(t._x_virtualDirectives).map(([s,l])=>({name:s,value:l})),o=attributesOnly(i);i=i.map(s=>o.find(l=>l.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),e=e.concat(i)}let n={};return e.map(toTransformedAttributes((i,o)=>n[i]=o)).filter(outNonAlpineAttributes).map(toParsedDirectives(n,a)).sort(byPriority).map(i=>getDirectiveHandler(t,i))}function attributesOnly(t){return Array.from(t).map(toTransformedAttributes()).filter(e=>!outNonAlpineAttributes(e))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function deferHandlingDirectives(t){isDeferringHandlers=!0;let e=Symbol();currentHandlerStackKey=e,directiveHandlerStacks.set(e,[]);let a=()=>{for(;directiveHandlerStacks.get(e).length;)directiveHandlerStacks.get(e).shift()();directiveHandlerStacks.delete(e)},n=()=>{isDeferringHandlers=!1,a()};t(a),n()}function getElementBoundUtilities(t){let e=[],a=s=>e.push(s),[n,r]=elementBoundEffect(t);return e.push(r),[{Alpine:alpine_default,effect:n,cleanup:a,evaluateLater:evaluateLater.bind(evaluateLater,t),evaluate:evaluate.bind(evaluate,t)},()=>e.forEach(s=>s())]}function getDirectiveHandler(t,e){let a=()=>{},n=directiveHandlers[e.type]||a,[r,i]=getElementBoundUtilities(t);onAttributeRemoved(t,e.original,i);let o=()=>{t._x_ignore||t._x_ignoreSelf||(n.inline&&n.inline(t,e,r),n=n.bind(n,t,e,r),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(n):n())};return o.runCleanups=i,o}var startingWith=(t,e)=>({name:a,value:n})=>(a.startsWith(t)&&(a=a.replace(t,e)),{name:a,value:n}),into=t=>t;function toTransformedAttributes(t=()=>{}){return({name:e,value:a})=>{let{name:n,value:r}=attributeTransformers.reduce((i,o)=>o(i),{name:e,value:a});return n!==e&&t(n,e),{name:n,value:r}}}var attributeTransformers=[];function mapAttributes(t){attributeTransformers.push(t)}function outNonAlpineAttributes({name:t}){return alpineAttributeRegex().test(t)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(t,e){return({name:a,value:n})=>{let r=a.match(alpineAttributeRegex()),i=a.match(/:([a-zA-Z0-9\-:]+)/),o=a.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=e||t[a]||a;return{type:r?r[1]:null,value:i?i[1]:null,modifiers:o.map(l=>l.replace(".","")),expression:n,original:s}}}var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(t,e){let a=directiveOrder.indexOf(t.type)===-1?DEFAULT:t.type,n=directiveOrder.indexOf(e.type)===-1?DEFAULT:e.type;return directiveOrder.indexOf(a)-directiveOrder.indexOf(n)}function dispatch(t,e,a={}){t.dispatchEvent(new CustomEvent(e,{detail:a,bubbles:!0,composed:!0,cancelable:!0}))}function walk(t,e){if(typeof ShadowRoot=="function"&&t instanceof ShadowRoot){Array.from(t.children).forEach(r=>walk(r,e));return}let a=!1;if(e(t,()=>a=!0),a)return;let n=t.firstElementChild;for(;n;)walk(n,e),n=n.nextElementSibling}function warn(t,...e){console.warn(`Alpine Warning: ${t}`,...e)}var started=!1;function start$1(){started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),dispatch(document,"alpine:init"),dispatch(document,"alpine:initializing"),startObservingMutations(),onElAdded(e=>initTree(e,walk)),onElRemoved(e=>destroyTree(e)),onAttributesAdded((e,a)=>{directives(e,a).forEach(n=>n())});let t=e=>!closestRoot(e.parentElement,!0);Array.from(document.querySelectorAll(allSelectors())).filter(t).forEach(e=>{initTree(e)}),dispatch(document,"alpine:initialized")}var rootSelectorCallbacks=[],initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map(t=>t())}function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map(t=>t())}function addRootSelector(t){rootSelectorCallbacks.push(t)}function addInitSelector(t){initSelectorCallbacks.push(t)}function closestRoot(t,e=!1){return findClosest(t,a=>{if((e?allSelectors():rootSelectors()).some(r=>a.matches(r)))return!0})}function findClosest(t,e){if(t){if(e(t))return t;if(t._x_teleportBack&&(t=t._x_teleportBack),!!t.parentElement)return findClosest(t.parentElement,e)}}function isRoot(t){return rootSelectors().some(e=>t.matches(e))}var initInterceptors2=[];function interceptInit(t){initInterceptors2.push(t)}function initTree(t,e=walk,a=()=>{}){deferHandlingDirectives(()=>{e(t,(n,r)=>{a(n,r),initInterceptors2.forEach(i=>i(n,r)),directives(n,n.attributes).forEach(i=>i()),n._x_ignore&&r()})})}function destroyTree(t){walk(t,e=>cleanupAttributes(e))}var tickStack=[],isHolding=!1;function nextTick(t=()=>{}){return queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks()})}),new Promise(e=>{tickStack.push(()=>{t(),e()})})}function releaseNextTicks(){for(isHolding=!1;tickStack.length;)tickStack.shift()()}function holdNextTicks(){isHolding=!0}function setClasses(t,e){return Array.isArray(e)?setClassesFromString(t,e.join(" ")):typeof e=="object"&&e!==null?setClassesFromObject(t,e):typeof e=="function"?setClasses(t,e()):setClassesFromString(t,e)}function setClassesFromString(t,e){let a=r=>r.split(" ").filter(i=>!t.classList.contains(i)).filter(Boolean),n=r=>(t.classList.add(...r),()=>{t.classList.remove(...r)});return e=e===!0?e="":e||"",n(a(e))}function setClassesFromObject(t,e){let a=s=>s.split(" ").filter(Boolean),n=Object.entries(e).flatMap(([s,l])=>l?a(s):!1).filter(Boolean),r=Object.entries(e).flatMap(([s,l])=>l?!1:a(s)).filter(Boolean),i=[],o=[];return r.forEach(s=>{t.classList.contains(s)&&(t.classList.remove(s),o.push(s))}),n.forEach(s=>{t.classList.contains(s)||(t.classList.add(s),i.push(s))}),()=>{o.forEach(s=>t.classList.add(s)),i.forEach(s=>t.classList.remove(s))}}function setStyles(t,e){return typeof e=="object"&&e!==null?setStylesFromObject(t,e):setStylesFromString(t,e)}function setStylesFromObject(t,e){let a={};return Object.entries(e).forEach(([n,r])=>{a[n]=t.style[n],n.startsWith("--")||(n=kebabCase(n)),t.style.setProperty(n,r)}),setTimeout(()=>{t.style.length===0&&t.removeAttribute("style")}),()=>{setStyles(t,a)}}function setStylesFromString(t,e){let a=t.getAttribute("style",e);return t.setAttribute("style",e),()=>{t.setAttribute("style",a||"")}}function kebabCase(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function once(t,e=()=>{}){let a=!1;return function(){a?e.apply(this,arguments):(a=!0,t.apply(this,arguments))}}directive("transition",(t,{value:e,modifiers:a,expression:n},{evaluate:r})=>{typeof n=="function"&&(n=r(n)),n!==!1&&(!n||typeof n=="boolean"?registerTransitionsFromHelper(t,a,e):registerTransitionsFromClassString(t,n,e))});function registerTransitionsFromClassString(t,e,a){registerTransitionObject(t,setClasses,""),{enter:r=>{t._x_transition.enter.during=r},"enter-start":r=>{t._x_transition.enter.start=r},"enter-end":r=>{t._x_transition.enter.end=r},leave:r=>{t._x_transition.leave.during=r},"leave-start":r=>{t._x_transition.leave.start=r},"leave-end":r=>{t._x_transition.leave.end=r}}[a](e)}function registerTransitionsFromHelper(t,e,a){registerTransitionObject(t,setStyles);let n=!e.includes("in")&&!e.includes("out")&&!a,r=n||e.includes("in")||["enter"].includes(a),i=n||e.includes("out")||["leave"].includes(a);e.includes("in")&&!n&&(e=e.filter((w,_)=>_<e.indexOf("out"))),e.includes("out")&&!n&&(e=e.filter((w,_)=>_>e.indexOf("out")));let o=!e.includes("opacity")&&!e.includes("scale"),s=o||e.includes("opacity"),l=o||e.includes("scale"),u=s?0:1,c=l?modifierValue(e,"scale",95)/100:1,d=modifierValue(e,"delay",0)/1e3,h=modifierValue(e,"origin","center"),m="opacity, transform",p=modifierValue(e,"duration",150)/1e3,v=modifierValue(e,"duration",75)/1e3,y="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(t._x_transition.enter.during={transformOrigin:h,transitionDelay:`${d}s`,transitionProperty:m,transitionDuration:`${p}s`,transitionTimingFunction:y},t._x_transition.enter.start={opacity:u,transform:`scale(${c})`},t._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(t._x_transition.leave.during={transformOrigin:h,transitionDelay:`${d}s`,transitionProperty:m,transitionDuration:`${v}s`,transitionTimingFunction:y},t._x_transition.leave.start={opacity:1,transform:"scale(1)"},t._x_transition.leave.end={opacity:u,transform:`scale(${c})`})}function registerTransitionObject(t,e,a={}){t._x_transition||(t._x_transition={enter:{during:a,start:a,end:a},leave:{during:a,start:a,end:a},in(n=()=>{},r=()=>{}){transition(t,e,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,r)},out(n=()=>{},r=()=>{}){transition(t,e,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,r)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(t,e,a,n){const r=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>r(a);if(e){t._x_transition&&(t._x_transition.enter||t._x_transition.leave)?t._x_transition.enter&&(Object.entries(t._x_transition.enter.during).length||Object.entries(t._x_transition.enter.start).length||Object.entries(t._x_transition.enter.end).length)?t._x_transition.in(a):i():t._x_transition?t._x_transition.in(a):i();return}t._x_hidePromise=t._x_transition?new Promise((o,s)=>{t._x_transition.out(()=>{},()=>o(n)),t._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=closestHide(t);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(t)):r(()=>{let s=l=>{let u=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(s)]).then(([c])=>c());return delete l._x_hidePromise,delete l._x_hideChildren,u};s(t).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function closestHide(t){let e=t.parentNode;if(e)return e._x_hidePromise?e:closestHide(e)}function transition(t,e,{during:a,start:n,end:r}={},i=()=>{},o=()=>{}){if(t._x_transitioning&&t._x_transitioning.cancel(),Object.keys(a).length===0&&Object.keys(n).length===0&&Object.keys(r).length===0){i(),o();return}let s,l,u;performTransition(t,{start(){s=e(t,n)},during(){l=e(t,a)},before:i,end(){s(),u=e(t,r)},after:o,cleanup(){l(),u()}})}function performTransition(t,e){let a,n,r,i=once(()=>{mutateDom(()=>{a=!0,n||e.before(),r||(e.end(),releaseNextTicks()),e.after(),t.isConnected&&e.cleanup(),delete t._x_transitioning})});t._x_transitioning={beforeCancels:[],beforeCancel(o){this.beforeCancels.push(o)},cancel:once(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},mutateDom(()=>{e.start(),e.during()}),holdNextTicks(),requestAnimationFrame(()=>{if(a)return;let o=Number(getComputedStyle(t).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,s=Number(getComputedStyle(t).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;o===0&&(o=Number(getComputedStyle(t).animationDuration.replace("s",""))*1e3),mutateDom(()=>{e.before()}),n=!0,requestAnimationFrame(()=>{a||(mutateDom(()=>{e.end()}),releaseNextTicks(),setTimeout(t._x_transitioning.finish,o+s),r=!0)})})}function modifierValue(t,e,a){if(t.indexOf(e)===-1)return a;const n=t[t.indexOf(e)+1];if(!n||e==="scale"&&isNaN(n))return a;if(e==="duration"||e==="delay"){let r=n.match(/([0-9]+)ms/);if(r)return r[1]}return e==="origin"&&["top","right","left","center","bottom"].includes(t[t.indexOf(e)+2])?[n,t[t.indexOf(e)+2]].join(" "):n}var isCloning=!1;function skipDuringClone(t,e=()=>{}){return(...a)=>isCloning?e(...a):t(...a)}function onlyDuringClone(t){return(...e)=>isCloning&&t(...e)}function clone$3(t,e){e._x_dataStack||(e._x_dataStack=t._x_dataStack),isCloning=!0,dontRegisterReactiveSideEffects(()=>{cloneTree(e)}),isCloning=!1}function cloneTree(t){let e=!1;initTree(t,(n,r)=>{walk(n,(i,o)=>{if(e&&isRoot(i))return o();e=!0,r(i,o)})})}function dontRegisterReactiveSideEffects(t){let e=effect$3;overrideEffect((a,n)=>{let r=e(a);return release(r),()=>{}}),t(),overrideEffect(e)}function bind(t,e,a,n=[]){switch(t._x_bindings||(t._x_bindings=reactive({})),t._x_bindings[e]=a,e=n.includes("camel")?camelCase$2(e):e,e){case"value":bindInputValue(t,a);break;case"style":bindStyles(t,a);break;case"class":bindClasses(t,a);break;case"selected":case"checked":bindAttributeAndProperty(t,e,a);break;default:bindAttribute(t,e,a);break}}function bindInputValue(t,e){if(t.type==="radio")t.attributes.value===void 0&&(t.value=e),window.fromModel&&(t.checked=checkedAttrLooseCompare(t.value,e));else if(t.type==="checkbox")Number.isInteger(e)?t.value=e:!Number.isInteger(e)&&!Array.isArray(e)&&typeof e!="boolean"&&![null,void 0].includes(e)?t.value=String(e):Array.isArray(e)?t.checked=e.some(a=>checkedAttrLooseCompare(a,t.value)):t.checked=!!e;else if(t.tagName==="SELECT")updateSelect(t,e);else{if(t.value===e)return;t.value=e}}function bindClasses(t,e){t._x_undoAddedClasses&&t._x_undoAddedClasses(),t._x_undoAddedClasses=setClasses(t,e)}function bindStyles(t,e){t._x_undoAddedStyles&&t._x_undoAddedStyles(),t._x_undoAddedStyles=setStyles(t,e)}function bindAttributeAndProperty(t,e,a){bindAttribute(t,e,a),setPropertyIfChanged(t,e,a)}function bindAttribute(t,e,a){[null,void 0,!1].includes(a)&&attributeShouldntBePreservedIfFalsy(e)?t.removeAttribute(e):(isBooleanAttr(e)&&(a=e),setIfChanged(t,e,a))}function setIfChanged(t,e,a){t.getAttribute(e)!=a&&t.setAttribute(e,a)}function setPropertyIfChanged(t,e,a){t[e]!==a&&(t[e]=a)}function updateSelect(t,e){const a=[].concat(e).map(n=>n+"");Array.from(t.options).forEach(n=>{n.selected=a.includes(n.value)})}function camelCase$2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function checkedAttrLooseCompare(t,e){return t==e}function isBooleanAttr(t){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(t)}function attributeShouldntBePreservedIfFalsy(t){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(t)}function getBinding(t,e,a){return t._x_bindings&&t._x_bindings[e]!==void 0?t._x_bindings[e]:getAttributeBinding(t,e,a)}function extractProp(t,e,a,n=!0){if(t._x_bindings&&t._x_bindings[e]!==void 0)return t._x_bindings[e];if(t._x_inlineBindings&&t._x_inlineBindings[e]!==void 0){let r=t._x_inlineBindings[e];return r.extract=n,dontAutoEvaluateFunctions(()=>evaluate(t,r.expression))}return getAttributeBinding(t,e,a)}function getAttributeBinding(t,e,a){let n=t.getAttribute(e);return n===null?typeof a=="function"?a():a:n===""?!0:isBooleanAttr(e)?!![e,"true"].includes(n):n}function debounce$2(t,e){var a;return function(){var n=this,r=arguments,i=function(){a=null,t.apply(n,r)};clearTimeout(a),a=setTimeout(i,e)}}function throttle(t,e){let a;return function(){let n=this,r=arguments;a||(t.apply(n,r),a=!0,setTimeout(()=>a=!1,e))}}function plugin(t){(Array.isArray(t)?t:[t]).forEach(a=>a(alpine_default))}var stores={},isReactive=!1;function store(t,e){if(isReactive||(stores=reactive(stores),isReactive=!0),e===void 0)return stores[t];stores[t]=e,typeof e=="object"&&e!==null&&e.hasOwnProperty("init")&&typeof e.init=="function"&&stores[t].init(),initInterceptors(stores[t])}function getStores(){return stores}var binds={};function bind2(t,e){let a=typeof e!="function"?()=>e:e;t instanceof Element?applyBindingsObject(t,a()):binds[t]=a}function injectBindingProviders(t){return Object.entries(binds).forEach(([e,a])=>{Object.defineProperty(t,e,{get(){return(...n)=>a(...n)}})}),t}function applyBindingsObject(t,e,a){let n=[];for(;n.length;)n.pop()();let r=Object.entries(e).map(([o,s])=>({name:o,value:s})),i=attributesOnly(r);r=r.map(o=>i.find(s=>s.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),directives(t,r,a).map(o=>{n.push(o.runCleanups),o()})}var datas={};function data(t,e){datas[t]=e}function injectDataProviders(t,e){return Object.entries(datas).forEach(([a,n])=>{Object.defineProperty(t,a,{get(){return(...r)=>n.bind(e)(...r)},enumerable:!1})}),t}var Alpine$1={get reactive(){return reactive},get release(){return release},get effect(){return effect$3},get raw(){return raw},version:"3.12.3",flushAndStopDeferringMutations,dontAutoEvaluateFunctions,disableEffectScheduling,startObservingMutations,stopObservingMutations,setReactivityEngine,closestDataStack,skipDuringClone,onlyDuringClone,addRootSelector,addInitSelector,addScopeToNode,deferMutations,mapAttributes,evaluateLater,interceptInit,setEvaluator,mergeProxies,extractProp,findClosest,closestRoot,destroyTree,interceptor,transition,setStyles,mutateDom,directive,throttle,debounce:debounce$2,evaluate,initTree,nextTick,prefixed:prefix,prefix:setPrefix,plugin,magic,store,start:start$1,clone:clone$3,bound:getBinding,$data:scope,walk,data,bind:bind2},alpine_default=Alpine$1;function makeMap(t,e){const a=Object.create(null),n=t.split(",");for(let r=0;r<n.length;r++)a[n[r]]=!0;return e?r=>!!a[r.toLowerCase()]:r=>!!a[r]}var EMPTY_OBJ=Object.freeze({}),extend=Object.assign,hasOwnProperty$b=Object.prototype.hasOwnProperty,hasOwn=(t,e)=>hasOwnProperty$b.call(t,e),isArray$d=Array.isArray,isMap=t=>toTypeString(t)==="[object Map]",isString=t=>typeof t=="string",isSymbol$6=t=>typeof t=="symbol",isObject$9=t=>t!==null&&typeof t=="object",objectToString$2=Object.prototype.toString,toTypeString=t=>objectToString$2.call(t),toRawType=t=>toTypeString(t).slice(8,-1),isIntegerKey=t=>isString(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,cacheStringFunction=t=>{const e=Object.create(null);return a=>e[a]||(e[a]=t(a))},capitalize$2=cacheStringFunction(t=>t.charAt(0).toUpperCase()+t.slice(1)),hasChanged=(t,e)=>t!==e&&(t===t||e===e),targetMap=new WeakMap,effectStack=[],activeEffect,ITERATE_KEY=Symbol("iterate"),MAP_KEY_ITERATE_KEY=Symbol("Map key iterate");function isEffect(t){return t&&t._isEffect===!0}function effect2(t,e=EMPTY_OBJ){isEffect(t)&&(t=t.raw);const a=createReactiveEffect(t,e);return e.lazy||a(),a}function stop(t){t.active&&(cleanup(t),t.options.onStop&&t.options.onStop(),t.active=!1)}var uid$1=0;function createReactiveEffect(t,e){const a=function(){if(!a.active)return t();if(!effectStack.includes(a)){cleanup(a);try{return enableTracking(),effectStack.push(a),activeEffect=a,t()}finally{effectStack.pop(),resetTracking(),activeEffect=effectStack[effectStack.length-1]}}};return a.id=uid$1++,a.allowRecurse=!!e.allowRecurse,a._isEffect=!0,a.active=!0,a.raw=t,a.deps=[],a.options=e,a}function cleanup(t){const{deps:e}=t;if(e.length){for(let a=0;a<e.length;a++)e[a].delete(t);e.length=0}}var shouldTrack=!0,trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function enableTracking(){trackStack.push(shouldTrack),shouldTrack=!0}function resetTracking(){const t=trackStack.pop();shouldTrack=t===void 0?!0:t}function track(t,e,a){if(!shouldTrack||activeEffect===void 0)return;let n=targetMap.get(t);n||targetMap.set(t,n=new Map);let r=n.get(a);r||n.set(a,r=new Set),r.has(activeEffect)||(r.add(activeEffect),activeEffect.deps.push(r),activeEffect.options.onTrack&&activeEffect.options.onTrack({effect:activeEffect,target:t,type:e,key:a}))}function trigger(t,e,a,n,r,i){const o=targetMap.get(t);if(!o)return;const s=new Set,l=c=>{c&&c.forEach(d=>{(d!==activeEffect||d.allowRecurse)&&s.add(d)})};if(e==="clear")o.forEach(l);else if(a==="length"&&isArray$d(t))o.forEach((c,d)=>{(d==="length"||d>=n)&&l(c)});else switch(a!==void 0&&l(o.get(a)),e){case"add":isArray$d(t)?isIntegerKey(a)&&l(o.get("length")):(l(o.get(ITERATE_KEY)),isMap(t)&&l(o.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$d(t)||(l(o.get(ITERATE_KEY)),isMap(t)&&l(o.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(t)&&l(o.get(ITERATE_KEY));break}const u=c=>{c.options.onTrigger&&c.options.onTrigger({effect:c,target:t,key:a,type:e,newValue:n,oldValue:r,oldTarget:i}),c.options.scheduler?c.options.scheduler(c):c()};s.forEach(u)}var isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(isSymbol$6)),get2=createGetter(),shallowGet=createGetter(!1,!0),readonlyGet=createGetter(!0),shallowReadonlyGet=createGetter(!0,!0),arrayInstrumentations={};["includes","indexOf","lastIndexOf"].forEach(t=>{const e=Array.prototype[t];arrayInstrumentations[t]=function(...a){const n=toRaw(this);for(let i=0,o=this.length;i<o;i++)track(n,"get",i+"");const r=e.apply(n,a);return r===-1||r===!1?e.apply(n,a.map(toRaw)):r}});["push","pop","shift","unshift","splice"].forEach(t=>{const e=Array.prototype[t];arrayInstrumentations[t]=function(...a){pauseTracking();const n=e.apply(this,a);return resetTracking(),n}});function createGetter(t=!1,e=!1){return function(n,r,i){if(r==="__v_isReactive")return!t;if(r==="__v_isReadonly")return t;if(r==="__v_raw"&&i===(t?e?shallowReadonlyMap:readonlyMap:e?shallowReactiveMap:reactiveMap).get(n))return n;const o=isArray$d(n);if(!t&&o&&hasOwn(arrayInstrumentations,r))return Reflect.get(arrayInstrumentations,r,i);const s=Reflect.get(n,r,i);return(isSymbol$6(r)?builtInSymbols.has(r):isNonTrackableKeys(r))||(t||track(n,"get",r),e)?s:isRef(s)?!o||!isIntegerKey(r)?s.value:s:isObject$9(s)?t?readonly(s):reactive2(s):s}}var set2=createSetter(),shallowSet=createSetter(!0);function createSetter(t=!1){return function(a,n,r,i){let o=a[n];if(!t&&(r=toRaw(r),o=toRaw(o),!isArray$d(a)&&isRef(o)&&!isRef(r)))return o.value=r,!0;const s=isArray$d(a)&&isIntegerKey(n)?Number(n)<a.length:hasOwn(a,n),l=Reflect.set(a,n,r,i);return a===toRaw(i)&&(s?hasChanged(r,o)&&trigger(a,"set",n,r,o):trigger(a,"add",n,r)),l}}function deleteProperty(t,e){const a=hasOwn(t,e),n=t[e],r=Reflect.deleteProperty(t,e);return r&&a&&trigger(t,"delete",e,void 0,n),r}function has$2(t,e){const a=Reflect.has(t,e);return(!isSymbol$6(e)||!builtInSymbols.has(e))&&track(t,"has",e),a}function ownKeys(t){return track(t,"iterate",isArray$d(t)?"length":ITERATE_KEY),Reflect.ownKeys(t)}var mutableHandlers={get:get2,set:set2,deleteProperty,has:has$2,ownKeys},readonlyHandlers={get:readonlyGet,set(t,e){return console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0},deleteProperty(t,e){return console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0}};extend({},mutableHandlers,{get:shallowGet,set:shallowSet});extend({},readonlyHandlers,{get:shallowReadonlyGet});var toReactive=t=>isObject$9(t)?reactive2(t):t,toReadonly=t=>isObject$9(t)?readonly(t):t,toShallow=t=>t,getProto=t=>Reflect.getPrototypeOf(t);function get$1$1(t,e,a=!1,n=!1){t=t.__v_raw;const r=toRaw(t),i=toRaw(e);e!==i&&!a&&track(r,"get",e),!a&&track(r,"get",i);const{has:o}=getProto(r),s=n?toShallow:a?toReadonly:toReactive;if(o.call(r,e))return s(t.get(e));if(o.call(r,i))return s(t.get(i));t!==r&&t.get(e)}function has$1$1(t,e=!1){const a=this.__v_raw,n=toRaw(a),r=toRaw(t);return t!==r&&!e&&track(n,"has",t),!e&&track(n,"has",r),t===r?a.has(t):a.has(t)||a.has(r)}function size(t,e=!1){return t=t.__v_raw,!e&&track(toRaw(t),"iterate",ITERATE_KEY),Reflect.get(t,"size",t)}function add(t){t=toRaw(t);const e=toRaw(this);return getProto(e).has.call(e,t)||(e.add(t),trigger(e,"add",t,t)),this}function set$1$1(t,e){e=toRaw(e);const a=toRaw(this),{has:n,get:r}=getProto(a);let i=n.call(a,t);i?checkIdentityKeys(a,n,t):(t=toRaw(t),i=n.call(a,t));const o=r.call(a,t);return a.set(t,e),i?hasChanged(e,o)&&trigger(a,"set",t,e,o):trigger(a,"add",t,e),this}function deleteEntry(t){const e=toRaw(this),{has:a,get:n}=getProto(e);let r=a.call(e,t);r?checkIdentityKeys(e,a,t):(t=toRaw(t),r=a.call(e,t));const i=n?n.call(e,t):void 0,o=e.delete(t);return r&&trigger(e,"delete",t,void 0,i),o}function clear(){const t=toRaw(this),e=t.size!==0,a=isMap(t)?new Map(t):new Set(t),n=t.clear();return e&&trigger(t,"clear",void 0,void 0,a),n}function createForEach(t,e){return function(n,r){const i=this,o=i.__v_raw,s=toRaw(o),l=e?toShallow:t?toReadonly:toReactive;return!t&&track(s,"iterate",ITERATE_KEY),o.forEach((u,c)=>n.call(r,l(u),l(c),i))}}function createIterableMethod(t,e,a){return function(...n){const r=this.__v_raw,i=toRaw(r),o=isMap(i),s=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,u=r[t](...n),c=a?toShallow:e?toReadonly:toReactive;return!e&&track(i,"iterate",l?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:d,done:h}=u.next();return h?{value:d,done:h}:{value:s?[c(d[0]),c(d[1])]:c(d),done:h}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(t){return function(...e){{const a=e[0]?`on key "${e[0]}" `:"";console.warn(`${capitalize$2(t)} operation ${a}failed: target is readonly.`,toRaw(this))}return t==="delete"?!1:this}}var mutableInstrumentations={get(t){return get$1$1(this,t)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},shallowInstrumentations={get(t){return get$1$1(this,t,!1,!0)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},readonlyInstrumentations={get(t){return get$1$1(this,t,!0)},get size(){return size(this,!0)},has(t){return has$1$1.call(this,t,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},shallowReadonlyInstrumentations={get(t){return get$1$1(this,t,!0,!0)},get size(){return size(this,!0)},has(t){return has$1$1.call(this,t,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)},iteratorMethods=["keys","values","entries",Symbol.iterator];iteratorMethods.forEach(t=>{mutableInstrumentations[t]=createIterableMethod(t,!1,!1),readonlyInstrumentations[t]=createIterableMethod(t,!0,!1),shallowInstrumentations[t]=createIterableMethod(t,!1,!0),shallowReadonlyInstrumentations[t]=createIterableMethod(t,!0,!0)});function createInstrumentationGetter(t,e){const a=e?t?shallowReadonlyInstrumentations:shallowInstrumentations:t?readonlyInstrumentations:mutableInstrumentations;return(n,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?n:Reflect.get(hasOwn(a,r)&&r in n?a:n,r,i)}var mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)};function checkIdentityKeys(t,e,a){const n=toRaw(a);if(n!==a&&e.call(t,n)){const r=toRawType(t);console.warn(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(t){return t.__v_skip||!Object.isExtensible(t)?0:targetTypeMap(toRawType(t))}function reactive2(t){return t&&t.__v_isReadonly?t:createReactiveObject(t,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function readonly(t){return createReactiveObject(t,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(t,e,a,n,r){if(!isObject$9(t))return console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=r.get(t);if(i)return i;const o=getTargetType(t);if(o===0)return t;const s=new Proxy(t,o===2?n:a);return r.set(t,s),s}function toRaw(t){return t&&toRaw(t.__v_raw)||t}function isRef(t){return!!(t&&t.__v_isRef===!0)}magic("nextTick",()=>nextTick);magic("dispatch",t=>dispatch.bind(dispatch,t));magic("watch",(t,{evaluateLater:e,effect:a})=>(n,r)=>{let i=e(n),o=!0,s,l=a(()=>i(u=>{JSON.stringify(u),o?s=u:queueMicrotask(()=>{r(u,s),s=u}),o=!1}));t._x_effects.delete(l)});magic("store",getStores);magic("data",t=>scope(t));magic("root",t=>closestRoot(t));magic("refs",t=>(t._x_refs_proxy||(t._x_refs_proxy=mergeProxies(getArrayOfRefObject(t))),t._x_refs_proxy));function getArrayOfRefObject(t){let e=[],a=t;for(;a;)a._x_refs&&e.push(a._x_refs),a=a.parentNode;return e}var globalIdMemo={};function findAndIncrementId(t){return globalIdMemo[t]||(globalIdMemo[t]=0),++globalIdMemo[t]}function closestIdRoot(t,e){return findClosest(t,a=>{if(a._x_ids&&a._x_ids[e])return!0})}function setIdRoot(t,e){t._x_ids||(t._x_ids={}),t._x_ids[e]||(t._x_ids[e]=findAndIncrementId(e))}magic("id",t=>(e,a=null)=>{let n=closestIdRoot(t,e),r=n?n._x_ids[e]:findAndIncrementId(e);return a?`${e}-${r}-${a}`:`${e}-${r}`});magic("el",t=>t);warnMissingPluginMagic("Focus","focus","focus");warnMissingPluginMagic("Persist","persist","persist");function warnMissingPluginMagic(t,e,a){magic(e,n=>warn(`You can't use [$${directiveName}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,n))}function entangle({get:t,set:e},{get:a,set:n}){let r=!0,i,o,s=effect$3(()=>{let l,u;r?(l=t(),n(l),u=a(),r=!1):(l=t(),u=a(),o=JSON.stringify(l),JSON.stringify(u),o!==i?(u=a(),n(l),u=l):(e(u),l=u)),i=JSON.stringify(l),JSON.stringify(u)});return()=>{release(s)}}directive("modelable",(t,{expression:e},{effect:a,evaluateLater:n,cleanup:r})=>{let i=n(e),o=()=>{let c;return i(d=>c=d),c},s=n(`${e} = __placeholder`),l=c=>s(()=>{},{scope:{__placeholder:c}}),u=o();l(u),queueMicrotask(()=>{if(!t._x_model)return;t._x_removeModelListeners.default();let c=t._x_model.get,d=t._x_model.set,h=entangle({get(){return c()},set(m){d(m)}},{get(){return o()},set(m){l(m)}});r(h)})});var teleportContainerDuringClone=document.createElement("div");directive("teleport",(t,{modifiers:e,expression:a},{cleanup:n})=>{t.tagName.toLowerCase()!=="template"&&warn("x-teleport can only be used on a <template> tag",t);let r=skipDuringClone(()=>document.querySelector(a),()=>teleportContainerDuringClone)();r||warn(`Cannot find x-teleport element for selector: "${a}"`);let i=t.content.cloneNode(!0).firstElementChild;t._x_teleport=i,i._x_teleportBack=t,t._x_forwardEvents&&t._x_forwardEvents.forEach(o=>{i.addEventListener(o,s=>{s.stopPropagation(),t.dispatchEvent(new s.constructor(s.type,s))})}),addScopeToNode(i,{},t),mutateDom(()=>{e.includes("prepend")?r.parentNode.insertBefore(i,r):e.includes("append")?r.parentNode.insertBefore(i,r.nextSibling):r.appendChild(i),initTree(i),i._x_ignore=!0}),n(()=>i.remove())});var handler=()=>{};handler.inline=(t,{modifiers:e},{cleanup:a})=>{e.includes("self")?t._x_ignoreSelf=!0:t._x_ignore=!0,a(()=>{e.includes("self")?delete t._x_ignoreSelf:delete t._x_ignore})};directive("ignore",handler);directive("effect",(t,{expression:e},{effect:a})=>a(evaluateLater(t,e)));function on(t,e,a,n){let r=t,i=l=>n(l),o={},s=(l,u)=>c=>u(l,c);if(a.includes("dot")&&(e=dotSyntax(e)),a.includes("camel")&&(e=camelCase2(e)),a.includes("passive")&&(o.passive=!0),a.includes("capture")&&(o.capture=!0),a.includes("window")&&(r=window),a.includes("document")&&(r=document),a.includes("debounce")){let l=a[a.indexOf("debounce")+1]||"invalid-wait",u=isNumeric$1(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=debounce$2(i,u)}if(a.includes("throttle")){let l=a[a.indexOf("throttle")+1]||"invalid-wait",u=isNumeric$1(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=throttle(i,u)}return a.includes("prevent")&&(i=s(i,(l,u)=>{u.preventDefault(),l(u)})),a.includes("stop")&&(i=s(i,(l,u)=>{u.stopPropagation(),l(u)})),a.includes("self")&&(i=s(i,(l,u)=>{u.target===t&&l(u)})),(a.includes("away")||a.includes("outside"))&&(r=document,i=s(i,(l,u)=>{t.contains(u.target)||u.target.isConnected!==!1&&(t.offsetWidth<1&&t.offsetHeight<1||t._x_isShown!==!1&&l(u))})),a.includes("once")&&(i=s(i,(l,u)=>{l(u),r.removeEventListener(e,i,o)})),i=s(i,(l,u)=>{isKeyEvent(e)&&isListeningForASpecificKeyThatHasntBeenPressed(u,a)||l(u)}),r.addEventListener(e,i,o),()=>{r.removeEventListener(e,i,o)}}function dotSyntax(t){return t.replace(/-/g,".")}function camelCase2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function isNumeric$1(t){return!Array.isArray(t)&&!isNaN(t)}function kebabCase2(t){return[" ","_"].includes(t)?t:t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function isKeyEvent(t){return["keydown","keyup"].includes(t)}function isListeningForASpecificKeyThatHasntBeenPressed(t,e){let a=e.filter(i=>!["window","document","prevent","stop","once","capture"].includes(i));if(a.includes("debounce")){let i=a.indexOf("debounce");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.includes("throttle")){let i=a.indexOf("throttle");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.length===0||a.length===1&&keyToModifiers(t.key).includes(a[0]))return!1;const r=["ctrl","shift","alt","meta","cmd","super"].filter(i=>a.includes(i));return a=a.filter(i=>!r.includes(i)),!(r.length>0&&r.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),t[`${o}Key`])).length===r.length&&keyToModifiers(t.key).includes(a[0]))}function keyToModifiers(t){if(!t)return[];t=kebabCase2(t);let e={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"=",minus:"-",underscore:"_"};return e[t]=t,Object.keys(e).map(a=>{if(e[a]===t)return a}).filter(a=>a)}directive("model",(t,{modifiers:e,expression:a},{effect:n,cleanup:r})=>{let i=t;e.includes("parent")&&(i=t.parentNode);let o=evaluateLater(i,a),s;typeof a=="string"?s=evaluateLater(i,`${a} = __placeholder`):typeof a=="function"&&typeof a()=="string"?s=evaluateLater(i,`${a()} = __placeholder`):s=()=>{};let l=()=>{let h;return o(m=>h=m),isGetterSetter(h)?h.get():h},u=h=>{let m;o(p=>m=p),isGetterSetter(m)?m.set(h):s(()=>{},{scope:{__placeholder:h}})};typeof a=="string"&&t.type==="radio"&&mutateDom(()=>{t.hasAttribute("name")||t.setAttribute("name",a)});var c=t.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(t.type)||e.includes("lazy")?"change":"input";let d=isCloning?()=>{}:on(t,c,e,h=>{u(getInputValue(t,e,h,l()))});if(e.includes("fill")&&[null,""].includes(l())&&t.dispatchEvent(new Event(c,{})),t._x_removeModelListeners||(t._x_removeModelListeners={}),t._x_removeModelListeners.default=d,r(()=>t._x_removeModelListeners.default()),t.form){let h=on(t.form,"reset",[],m=>{nextTick(()=>t._x_model&&t._x_model.set(t.value))});r(()=>h())}t._x_model={get(){return l()},set(h){u(h)}},t._x_forceModelUpdate=h=>{h=h===void 0?l():h,h===void 0&&typeof a=="string"&&a.match(/\./)&&(h=""),window.fromModel=!0,mutateDom(()=>bind(t,"value",h)),delete window.fromModel},n(()=>{let h=l();e.includes("unintrusive")&&document.activeElement.isSameNode(t)||t._x_forceModelUpdate(h)})});function getInputValue(t,e,a,n){return mutateDom(()=>{if(a instanceof CustomEvent&&a.detail!==void 0)return a.detail??a.target.value;if(t.type==="checkbox")if(Array.isArray(n)){let r=e.includes("number")?safeParseNumber(a.target.value):a.target.value;return a.target.checked?n.concat([r]):n.filter(i=>!checkedAttrLooseCompare2(i,r))}else return a.target.checked;else{if(t.tagName.toLowerCase()==="select"&&t.multiple)return e.includes("number")?Array.from(a.target.selectedOptions).map(r=>{let i=r.value||r.text;return safeParseNumber(i)}):Array.from(a.target.selectedOptions).map(r=>r.value||r.text);{let r=a.target.value;return e.includes("number")?safeParseNumber(r):e.includes("trim")?r.trim():r}}})}function safeParseNumber(t){let e=t?parseFloat(t):null;return isNumeric2(e)?e:t}function checkedAttrLooseCompare2(t,e){return t==e}function isNumeric2(t){return!Array.isArray(t)&&!isNaN(t)}function isGetterSetter(t){return t!==null&&typeof t=="object"&&typeof t.get=="function"&&typeof t.set=="function"}directive("cloak",t=>queueMicrotask(()=>mutateDom(()=>t.removeAttribute(prefix("cloak")))));addInitSelector(()=>`[${prefix("init")}]`);directive("init",skipDuringClone((t,{expression:e},{evaluate:a})=>typeof e=="string"?!!e.trim()&&a(e,{},!1):a(e,{},!1)));directive("text",(t,{expression:e},{effect:a,evaluateLater:n})=>{let r=n(e);a(()=>{r(i=>{mutateDom(()=>{t.textContent=i})})})});directive("html",(t,{expression:e},{effect:a,evaluateLater:n})=>{let r=n(e);a(()=>{r(i=>{mutateDom(()=>{t.innerHTML=i,t._x_ignoreSelf=!0,initTree(t),delete t._x_ignoreSelf})})})});mapAttributes(startingWith(":",into(prefix("bind:"))));var handler2=(t,{value:e,modifiers:a,expression:n,original:r},{effect:i})=>{if(!e){let s={};injectBindingProviders(s),evaluateLater(t,n)(u=>{applyBindingsObject(t,u,r)},{scope:s});return}if(e==="key")return storeKeyForXFor(t,n);if(t._x_inlineBindings&&t._x_inlineBindings[e]&&t._x_inlineBindings[e].extract)return;let o=evaluateLater(t,n);i(()=>o(s=>{s===void 0&&typeof n=="string"&&n.match(/\./)&&(s=""),mutateDom(()=>bind(t,e,s,a))}))};handler2.inline=(t,{value:e,modifiers:a,expression:n})=>{e&&(t._x_inlineBindings||(t._x_inlineBindings={}),t._x_inlineBindings[e]={expression:n,extract:!1})};directive("bind",handler2);function storeKeyForXFor(t,e){t._x_keyExpression=e}addRootSelector(()=>`[${prefix("data")}]`);directive("data",skipDuringClone((t,{expression:e},{cleanup:a})=>{e=e===""?"{}":e;let n={};injectMagics(n,t);let r={};injectDataProviders(r,n);let i=evaluate(t,e,{scope:r});(i===void 0||i===!0)&&(i={}),injectMagics(i,t);let o=reactive(i);initInterceptors(o);let s=addScopeToNode(t,o);o.init&&evaluate(t,o.init),a(()=>{o.destroy&&evaluate(t,o.destroy),s()})}));directive("show",(t,{modifiers:e,expression:a},{effect:n})=>{let r=evaluateLater(t,a);t._x_doHide||(t._x_doHide=()=>{mutateDom(()=>{t.style.setProperty("display","none",e.includes("important")?"important":void 0)})}),t._x_doShow||(t._x_doShow=()=>{mutateDom(()=>{t.style.length===1&&t.style.display==="none"?t.removeAttribute("style"):t.style.removeProperty("display")})});let i=()=>{t._x_doHide(),t._x_isShown=!1},o=()=>{t._x_doShow(),t._x_isShown=!0},s=()=>setTimeout(o),l=once(d=>d?o():i(),d=>{typeof t._x_toggleAndCascadeWithTransitions=="function"?t._x_toggleAndCascadeWithTransitions(t,d,o,i):d?s():i()}),u,c=!0;n(()=>r(d=>{!c&&d===u||(e.includes("immediate")&&(d?s():i()),l(d),u=d,c=!1)}))});directive("for",(t,{expression:e},{effect:a,cleanup:n})=>{let r=parseForExpression(e),i=evaluateLater(t,r.items),o=evaluateLater(t,t._x_keyExpression||"index");t._x_prevKeys=[],t._x_lookup={},a(()=>loop(t,r,i,o)),n(()=>{Object.values(t._x_lookup).forEach(s=>s.remove()),delete t._x_prevKeys,delete t._x_lookup})});function loop(t,e,a,n){let r=o=>typeof o=="object"&&!Array.isArray(o),i=t;a(o=>{isNumeric3(o)&&o>=0&&(o=Array.from(Array(o).keys(),y=>y+1)),o===void 0&&(o=[]);let s=t._x_lookup,l=t._x_prevKeys,u=[],c=[];if(r(o))o=Object.entries(o).map(([y,w])=>{let _=getIterationScopeVariables(e,w,y,o);n(D=>c.push(D),{scope:{index:y,..._}}),u.push(_)});else for(let y=0;y<o.length;y++){let w=getIterationScopeVariables(e,o[y],y,o);n(_=>c.push(_),{scope:{index:y,...w}}),u.push(w)}let d=[],h=[],m=[],p=[];for(let y=0;y<l.length;y++){let w=l[y];c.indexOf(w)===-1&&m.push(w)}l=l.filter(y=>!m.includes(y));let v="template";for(let y=0;y<c.length;y++){let w=c[y],_=l.indexOf(w);if(_===-1)l.splice(y,0,w),d.push([v,y]);else if(_!==y){let D=l.splice(y,1)[0],k=l.splice(_-1,1)[0];l.splice(y,0,k),l.splice(_,0,D),h.push([D,k])}else p.push(w);v=w}for(let y=0;y<m.length;y++){let w=m[y];s[w]._x_effects&&s[w]._x_effects.forEach(dequeueJob),s[w].remove(),s[w]=null,delete s[w]}for(let y=0;y<h.length;y++){let[w,_]=h[y],D=s[w],k=s[_],O=document.createElement("div");mutateDom(()=>{k||warn('x-for ":key" is undefined or invalid',i),k.after(O),D.after(k),k._x_currentIfEl&&k.after(k._x_currentIfEl),O.before(D),D._x_currentIfEl&&D.after(D._x_currentIfEl),O.remove()}),k._x_refreshXForScope(u[c.indexOf(_)])}for(let y=0;y<d.length;y++){let[w,_]=d[y],D=w==="template"?i:s[w];D._x_currentIfEl&&(D=D._x_currentIfEl);let k=u[_],O=c[_],N=document.importNode(i.content,!0).firstElementChild,F=reactive(k);addScopeToNode(N,F,i),N._x_refreshXForScope=g=>{Object.entries(g).forEach(([b,$])=>{F[b]=$})},mutateDom(()=>{D.after(N),initTree(N)}),typeof O=="object"&&warn("x-for key cannot be an object, it must be a string or an integer",i),s[O]=N}for(let y=0;y<p.length;y++)s[p[y]]._x_refreshXForScope(u[c.indexOf(p[y])]);i._x_prevKeys=c})}function parseForExpression(t){let e=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,a=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,r=t.match(n);if(!r)return;let i={};i.items=r[2].trim();let o=r[1].replace(a,"").trim(),s=o.match(e);return s?(i.item=o.replace(e,"").trim(),i.index=s[1].trim(),s[2]&&(i.collection=s[2].trim())):i.item=o,i}function getIterationScopeVariables(t,e,a,n){let r={};return/^\[.*\]$/.test(t.item)&&Array.isArray(e)?t.item.replace("[","").replace("]","").split(",").map(o=>o.trim()).forEach((o,s)=>{r[o]=e[s]}):/^\{.*\}$/.test(t.item)&&!Array.isArray(e)&&typeof e=="object"?t.item.replace("{","").replace("}","").split(",").map(o=>o.trim()).forEach(o=>{r[o]=e[o]}):r[t.item]=e,t.index&&(r[t.index]=a),t.collection&&(r[t.collection]=n),r}function isNumeric3(t){return!Array.isArray(t)&&!isNaN(t)}function handler3(){}handler3.inline=(t,{expression:e},{cleanup:a})=>{let n=closestRoot(t);n._x_refs||(n._x_refs={}),n._x_refs[e]=t,a(()=>delete n._x_refs[e])};directive("ref",handler3);directive("if",(t,{expression:e},{effect:a,cleanup:n})=>{let r=evaluateLater(t,e),i=()=>{if(t._x_currentIfEl)return t._x_currentIfEl;let s=t.content.cloneNode(!0).firstElementChild;return addScopeToNode(s,{},t),mutateDom(()=>{t.after(s),initTree(s)}),t._x_currentIfEl=s,t._x_undoIf=()=>{walk(s,l=>{l._x_effects&&l._x_effects.forEach(dequeueJob)}),s.remove(),delete t._x_currentIfEl},s},o=()=>{t._x_undoIf&&(t._x_undoIf(),delete t._x_undoIf)};a(()=>r(s=>{s?i():o()})),n(()=>t._x_undoIf&&t._x_undoIf())});directive("id",(t,{expression:e},{evaluate:a})=>{a(e).forEach(r=>setIdRoot(t,r))});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((t,{value:e,modifiers:a,expression:n},{cleanup:r})=>{let i=n?evaluateLater(t,n):()=>{};t.tagName.toLowerCase()==="template"&&(t._x_forwardEvents||(t._x_forwardEvents=[]),t._x_forwardEvents.includes(e)||t._x_forwardEvents.push(e));let o=on(t,e,a,s=>{i(()=>{},{scope:{$event:s},params:[s]})});r(()=>o())}));warnMissingPluginDirective("Collapse","collapse","collapse");warnMissingPluginDirective("Intersect","intersect","intersect");warnMissingPluginDirective("Focus","trap","focus");warnMissingPluginDirective("Mask","mask","mask");function warnMissingPluginDirective(t,e,a){directive(e,n=>warn(`You can't use [x-${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,n))}alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default,module_default=src_default,top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(t,e){return t.concat([e+"-"+start,e+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(t,e){return t.concat([e,e+"-"+start,e+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(t){return t?(t.nodeName||"").toLowerCase():null}function getWindow(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function isElement$1(t){var e=getWindow(t).Element;return t instanceof e||t instanceof Element}function isHTMLElement(t){var e=getWindow(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function isShadowRoot(t){if(typeof ShadowRoot>"u")return!1;var e=getWindow(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function applyStyles(t){var e=t.state;Object.keys(e.elements).forEach(function(a){var n=e.styles[a]||{},r=e.attributes[a]||{},i=e.elements[a];!isHTMLElement(i)||!getNodeName(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(o){var s=r[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function effect$2(t){var e=t.state,a={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,a.popper),e.styles=a,e.elements.arrow&&Object.assign(e.elements.arrow.style,a.arrow),function(){Object.keys(e.elements).forEach(function(n){var r=e.elements[n],i=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:a[n]),s=o.reduce(function(l,u){return l[u]="",l},{});!isHTMLElement(r)||!getNodeName(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(t){return t.split("-")[0]}var max=Math.max,min=Math.min,round$1=Math.round;function getUAString(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(t,e,a){e===void 0&&(e=!1),a===void 0&&(a=!1);var n=t.getBoundingClientRect(),r=1,i=1;e&&isHTMLElement(t)&&(r=t.offsetWidth>0&&round$1(n.width)/t.offsetWidth||1,i=t.offsetHeight>0&&round$1(n.height)/t.offsetHeight||1);var o=isElement$1(t)?getWindow(t):window,s=o.visualViewport,l=!isLayoutViewport()&&a,u=(n.left+(l&&s?s.offsetLeft:0))/r,c=(n.top+(l&&s?s.offsetTop:0))/i,d=n.width/r,h=n.height/i;return{width:d,height:h,top:c,right:u+d,bottom:c+h,left:u,x:u,y:c}}function getLayoutRect(t){var e=getBoundingClientRect(t),a=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-a)<=1&&(a=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:a,height:n}}function contains(t,e){var a=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(a&&isShadowRoot(a)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function getComputedStyle$2(t){return getWindow(t).getComputedStyle(t)}function isTableElement(t){return["table","td","th"].indexOf(getNodeName(t))>=0}function getDocumentElement(t){return((isElement$1(t)?t.ownerDocument:t.document)||window.document).documentElement}function getParentNode(t){return getNodeName(t)==="html"?t:t.assignedSlot||t.parentNode||(isShadowRoot(t)?t.host:null)||getDocumentElement(t)}function getTrueOffsetParent(t){return!isHTMLElement(t)||getComputedStyle$2(t).position==="fixed"?null:t.offsetParent}function getContainingBlock(t){var e=/firefox/i.test(getUAString()),a=/Trident/i.test(getUAString());if(a&&isHTMLElement(t)){var n=getComputedStyle$2(t);if(n.position==="fixed")return null}var r=getParentNode(t);for(isShadowRoot(r)&&(r=r.host);isHTMLElement(r)&&["html","body"].indexOf(getNodeName(r))<0;){var i=getComputedStyle$2(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function getOffsetParent(t){for(var e=getWindow(t),a=getTrueOffsetParent(t);a&&isTableElement(a)&&getComputedStyle$2(a).position==="static";)a=getTrueOffsetParent(a);return a&&(getNodeName(a)==="html"||getNodeName(a)==="body"&&getComputedStyle$2(a).position==="static")?e:a||getContainingBlock(t)||e}function getMainAxisFromPlacement(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function within$1(t,e,a){return max(t,min(e,a))}function withinMaxClamp(t,e,a){var n=within$1(t,e,a);return n>a?a:n}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(t){return Object.assign({},getFreshSideObject(),t)}function expandToHashMap(t,e){return e.reduce(function(a,n){return a[n]=t,a},{})}var toPaddingObject=function t(e,a){return e=typeof e=="function"?e(Object.assign({},a.rects,{placement:a.placement})):e,mergePaddingObject(typeof e!="number"?e:expandToHashMap(e,basePlacements))};function arrow(t){var e,a=t.state,n=t.name,r=t.options,i=a.elements.arrow,o=a.modifiersData.popperOffsets,s=getBasePlacement(a.placement),l=getMainAxisFromPlacement(s),u=[left,right].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!o)){var d=toPaddingObject(r.padding,a),h=getLayoutRect(i),m=l==="y"?top:left,p=l==="y"?bottom:right,v=a.rects.reference[c]+a.rects.reference[l]-o[l]-a.rects.popper[c],y=o[l]-a.rects.reference[l],w=getOffsetParent(i),_=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,D=v/2-y/2,k=d[m],O=_-h[c]-d[p],N=_/2-h[c]/2+D,F=within$1(k,N,O),g=l;a.modifiersData[n]=(e={},e[g]=F,e.centerOffset=F-N,e)}}function effect$1(t){var e=t.state,a=t.options,n=a.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||contains(e.elements.popper,r)&&(e.elements.arrow=r))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(t){return t.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(t,e){var a=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:round$1(a*r)/r||0,y:round$1(n*r)/r||0}}function mapToStyles(t){var e,a=t.popper,n=t.popperRect,r=t.placement,i=t.variation,o=t.offsets,s=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,h=o.x,m=h===void 0?0:h,p=o.y,v=p===void 0?0:p,y=typeof c=="function"?c({x:m,y:v}):{x:m,y:v};m=y.x,v=y.y;var w=o.hasOwnProperty("x"),_=o.hasOwnProperty("y"),D=left,k=top,O=window;if(u){var N=getOffsetParent(a),F="clientHeight",g="clientWidth";if(N===getWindow(a)&&(N=getDocumentElement(a),getComputedStyle$2(N).position!=="static"&&s==="absolute"&&(F="scrollHeight",g="scrollWidth")),N=N,r===top||(r===left||r===right)&&i===end){k=bottom;var b=d&&N===O&&O.visualViewport?O.visualViewport.height:N[F];v-=b-n.height,v*=l?1:-1}if(r===left||(r===top||r===bottom)&&i===end){D=right;var $=d&&N===O&&O.visualViewport?O.visualViewport.width:N[g];m-=$-n.width,m*=l?1:-1}}var S=Object.assign({position:s},u&&unsetSides),P=c===!0?roundOffsetsByDPR({x:m,y:v},getWindow(a)):{x:m,y:v};if(m=P.x,v=P.y,l){var M;return Object.assign({},S,(M={},M[k]=_?"0":"",M[D]=w?"0":"",M.transform=(O.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",M))}return Object.assign({},S,(e={},e[k]=_?v+"px":"",e[D]=w?m+"px":"",e.transform="",e))}function computeStyles(t){var e=t.state,a=t.options,n=a.gpuAcceleration,r=n===void 0?!0:n,i=a.adaptive,o=i===void 0?!0:i,s=a.roundOffsets,l=s===void 0?!0:s,u={placement:getBasePlacement(e.placement),variation:getVariation(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,mapToStyles(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,mapToStyles(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(t){var e=t.state,a=t.instance,n=t.options,r=n.scroll,i=r===void 0?!0:r,o=n.resize,s=o===void 0?!0:o,l=getWindow(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",a.update,passive)}),s&&l.addEventListener("resize",a.update,passive),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",a.update,passive)}),s&&l.removeEventListener("resize",a.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function t(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,function(e){return hash$1[e]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(t){return t.replace(/start|end/g,function(e){return hash[e]})}function getWindowScroll(t){var e=getWindow(t),a=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:a,scrollTop:n}}function getWindowScrollBarX(t){return getBoundingClientRect(getDocumentElement(t)).left+getWindowScroll(t).scrollLeft}function getViewportRect(t,e){var a=getWindow(t),n=getDocumentElement(t),r=a.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(r){i=r.width,o=r.height;var u=isLayoutViewport();(u||!u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:o,x:s+getWindowScrollBarX(t),y:l}}function getDocumentRect(t){var e,a=getDocumentElement(t),n=getWindowScroll(t),r=(e=t.ownerDocument)==null?void 0:e.body,i=max(a.scrollWidth,a.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=max(a.scrollHeight,a.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-n.scrollLeft+getWindowScrollBarX(t),l=-n.scrollTop;return getComputedStyle$2(r||a).direction==="rtl"&&(s+=max(a.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:s,y:l}}function isScrollParent(t){var e=getComputedStyle$2(t),a=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(a+r+n)}function getScrollParent(t){return["html","body","#document"].indexOf(getNodeName(t))>=0?t.ownerDocument.body:isHTMLElement(t)&&isScrollParent(t)?t:getScrollParent(getParentNode(t))}function listScrollParents(t,e){var a;e===void 0&&(e=[]);var n=getScrollParent(t),r=n===((a=t.ownerDocument)==null?void 0:a.body),i=getWindow(n),o=r?[i].concat(i.visualViewport||[],isScrollParent(n)?n:[]):n,s=e.concat(o);return r?s:s.concat(listScrollParents(getParentNode(o)))}function rectToClientRect(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function getInnerBoundingClientRect(t,e){var a=getBoundingClientRect(t,!1,e==="fixed");return a.top=a.top+t.clientTop,a.left=a.left+t.clientLeft,a.bottom=a.top+t.clientHeight,a.right=a.left+t.clientWidth,a.width=t.clientWidth,a.height=t.clientHeight,a.x=a.left,a.y=a.top,a}function getClientRectFromMixedType(t,e,a){return e===viewport?rectToClientRect(getViewportRect(t,a)):isElement$1(e)?getInnerBoundingClientRect(e,a):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var e=listScrollParents(getParentNode(t)),a=["absolute","fixed"].indexOf(getComputedStyle$2(t).position)>=0,n=a&&isHTMLElement(t)?getOffsetParent(t):t;return isElement$1(n)?e.filter(function(r){return isElement$1(r)&&contains(r,n)&&getNodeName(r)!=="body"}):[]}function getClippingRect(t,e,a,n){var r=e==="clippingParents"?getClippingParents(t):[].concat(e),i=[].concat(r,[a]),o=i[0],s=i.reduce(function(l,u){var c=getClientRectFromMixedType(t,u,n);return l.top=max(c.top,l.top),l.right=min(c.right,l.right),l.bottom=min(c.bottom,l.bottom),l.left=max(c.left,l.left),l},getClientRectFromMixedType(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function computeOffsets(t){var e=t.reference,a=t.element,n=t.placement,r=n?getBasePlacement(n):null,i=n?getVariation(n):null,o=e.x+e.width/2-a.width/2,s=e.y+e.height/2-a.height/2,l;switch(r){case top:l={x:o,y:e.y-a.height};break;case bottom:l={x:o,y:e.y+e.height};break;case right:l={x:e.x+e.width,y:s};break;case left:l={x:e.x-a.width,y:s};break;default:l={x:e.x,y:e.y}}var u=r?getMainAxisFromPlacement(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case start:l[u]=l[u]-(e[c]/2-a[c]/2);break;case end:l[u]=l[u]+(e[c]/2-a[c]/2);break}}return l}function detectOverflow(t,e){e===void 0&&(e={});var a=e,n=a.placement,r=n===void 0?t.placement:n,i=a.strategy,o=i===void 0?t.strategy:i,s=a.boundary,l=s===void 0?clippingParents:s,u=a.rootBoundary,c=u===void 0?viewport:u,d=a.elementContext,h=d===void 0?popper:d,m=a.altBoundary,p=m===void 0?!1:m,v=a.padding,y=v===void 0?0:v,w=mergePaddingObject(typeof y!="number"?y:expandToHashMap(y,basePlacements)),_=h===popper?reference:popper,D=t.rects.popper,k=t.elements[p?_:h],O=getClippingRect(isElement$1(k)?k:k.contextElement||getDocumentElement(t.elements.popper),l,c,o),N=getBoundingClientRect(t.elements.reference),F=computeOffsets({reference:N,element:D,strategy:"absolute",placement:r}),g=rectToClientRect(Object.assign({},D,F)),b=h===popper?g:N,$={top:O.top-b.top+w.top,bottom:b.bottom-O.bottom+w.bottom,left:O.left-b.left+w.left,right:b.right-O.right+w.right},S=t.modifiersData.offset;if(h===popper&&S){var P=S[r];Object.keys($).forEach(function(M){var C=[right,bottom].indexOf(M)>=0?1:-1,E=[top,bottom].indexOf(M)>=0?"y":"x";$[M]+=P[E]*C})}return $}function computeAutoPlacement(t,e){e===void 0&&(e={});var a=e,n=a.placement,r=a.boundary,i=a.rootBoundary,o=a.padding,s=a.flipVariations,l=a.allowedAutoPlacements,u=l===void 0?placements:l,c=getVariation(n),d=c?s?variationPlacements:variationPlacements.filter(function(p){return getVariation(p)===c}):basePlacements,h=d.filter(function(p){return u.indexOf(p)>=0});h.length===0&&(h=d);var m=h.reduce(function(p,v){return p[v]=detectOverflow(t,{placement:v,boundary:r,rootBoundary:i,padding:o})[getBasePlacement(v)],p},{});return Object.keys(m).sort(function(p,v){return m[p]-m[v]})}function getExpandedFallbackPlacements(t){if(getBasePlacement(t)===auto)return[];var e=getOppositePlacement(t);return[getOppositeVariationPlacement(t),e,getOppositeVariationPlacement(e)]}function flip(t){var e=t.state,a=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=a.mainAxis,i=r===void 0?!0:r,o=a.altAxis,s=o===void 0?!0:o,l=a.fallbackPlacements,u=a.padding,c=a.boundary,d=a.rootBoundary,h=a.altBoundary,m=a.flipVariations,p=m===void 0?!0:m,v=a.allowedAutoPlacements,y=e.options.placement,w=getBasePlacement(y),_=w===y,D=l||(_||!p?[getOppositePlacement(y)]:getExpandedFallbackPlacements(y)),k=[y].concat(D).reduce(function(B,V){return B.concat(getBasePlacement(V)===auto?computeAutoPlacement(e,{placement:V,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:v}):V)},[]),O=e.rects.reference,N=e.rects.popper,F=new Map,g=!0,b=k[0],$=0;$<k.length;$++){var S=k[$],P=getBasePlacement(S),M=getVariation(S)===start,C=[top,bottom].indexOf(P)>=0,E=C?"width":"height",T=detectOverflow(e,{placement:S,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),x=C?M?right:left:M?bottom:top;O[E]>N[E]&&(x=getOppositePlacement(x));var A=getOppositePlacement(x),L=[];if(i&&L.push(T[P]<=0),s&&L.push(T[x]<=0,T[A]<=0),L.every(function(B){return B})){b=S,g=!1;break}F.set(S,L)}if(g)for(var I=p?3:1,W=function(V){var H=k.find(function(G){var K=F.get(G);if(K)return K.slice(0,V).every(function(Y){return Y})});if(H)return b=H,"break"},z=I;z>0;z--){var U=W(z);if(U==="break")break}e.placement!==b&&(e.modifiersData[n]._skip=!0,e.placement=b,e.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(t,e,a){return a===void 0&&(a={x:0,y:0}),{top:t.top-e.height-a.y,right:t.right-e.width+a.x,bottom:t.bottom-e.height+a.y,left:t.left-e.width-a.x}}function isAnySideFullyClipped(t){return[top,right,bottom,left].some(function(e){return t[e]>=0})}function hide(t){var e=t.state,a=t.name,n=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=detectOverflow(e,{elementContext:"reference"}),s=detectOverflow(e,{altBoundary:!0}),l=getSideOffsets(o,n),u=getSideOffsets(s,r,i),c=isAnySideFullyClipped(l),d=isAnySideFullyClipped(u);e.modifiersData[a]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(t,e,a){var n=getBasePlacement(t),r=[left,top].indexOf(n)>=0?-1:1,i=typeof a=="function"?a(Object.assign({},e,{placement:t})):a,o=i[0],s=i[1];return o=o||0,s=(s||0)*r,[left,right].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function offset(t){var e=t.state,a=t.options,n=t.name,r=a.offset,i=r===void 0?[0,0]:r,o=placements.reduce(function(c,d){return c[d]=distanceAndSkiddingToXY(d,e.rects,i),c},{}),s=o[e.placement],l=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(t){var e=t.state,a=t.name;e.modifiersData[a]=computeOffsets({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(t){return t==="x"?"y":"x"}function preventOverflow(t){var e=t.state,a=t.options,n=t.name,r=a.mainAxis,i=r===void 0?!0:r,o=a.altAxis,s=o===void 0?!1:o,l=a.boundary,u=a.rootBoundary,c=a.altBoundary,d=a.padding,h=a.tether,m=h===void 0?!0:h,p=a.tetherOffset,v=p===void 0?0:p,y=detectOverflow(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),w=getBasePlacement(e.placement),_=getVariation(e.placement),D=!_,k=getMainAxisFromPlacement(w),O=getAltAxis(k),N=e.modifiersData.popperOffsets,F=e.rects.reference,g=e.rects.popper,b=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,$=typeof b=="number"?{mainAxis:b,altAxis:b}:Object.assign({mainAxis:0,altAxis:0},b),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(N){if(i){var M,C=k==="y"?top:left,E=k==="y"?bottom:right,T=k==="y"?"height":"width",x=N[k],A=x+y[C],L=x-y[E],I=m?-g[T]/2:0,W=_===start?F[T]:g[T],z=_===start?-g[T]:-F[T],U=e.elements.arrow,B=m&&U?getLayoutRect(U):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:getFreshSideObject(),H=V[C],G=V[E],K=within$1(0,F[T],B[T]),Y=D?F[T]/2-I-K-H-$.mainAxis:W-K-H-$.mainAxis,J=D?-F[T]/2+I+K+G+$.mainAxis:z+K+G+$.mainAxis,Q=e.elements.arrow&&getOffsetParent(e.elements.arrow),ee=Q?k==="y"?Q.clientTop||0:Q.clientLeft||0:0,Z=(M=S==null?void 0:S[k])!=null?M:0,X=x+Y-Z-ee,q=x+J-Z,ie=within$1(m?min(A,X):A,x,m?max(L,q):L);N[k]=ie,P[k]=ie-x}if(s){var oe,ge=k==="x"?top:left,pe=k==="x"?bottom:right,te=N[O],ae=O==="y"?"height":"width",se=te+y[ge],le=te-y[pe],re=[top,left].indexOf(w)!==-1,ue=(oe=S==null?void 0:S[O])!=null?oe:0,ce=re?se:te-F[ae]-g[ae]-ue+$.altAxis,fe=re?te+F[ae]+g[ae]-ue-$.altAxis:le,he=m&&re?withinMaxClamp(ce,te,fe):within$1(m?ce:se,te,m?fe:le);N[O]=he,P[O]=he-te}e.modifiersData[n]=P}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function getNodeScroll(t){return t===getWindow(t)||!isHTMLElement(t)?getWindowScroll(t):getHTMLElementScroll(t)}function isElementScaled(t){var e=t.getBoundingClientRect(),a=round$1(e.width)/t.offsetWidth||1,n=round$1(e.height)/t.offsetHeight||1;return a!==1||n!==1}function getCompositeRect(t,e,a){a===void 0&&(a=!1);var n=isHTMLElement(e),r=isHTMLElement(e)&&isElementScaled(e),i=getDocumentElement(e),o=getBoundingClientRect(t,r,a),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!a)&&((getNodeName(e)!=="body"||isScrollParent(i))&&(s=getNodeScroll(e)),isHTMLElement(e)?(l=getBoundingClientRect(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=getWindowScrollBarX(i))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function order(t){var e=new Map,a=new Set,n=[];t.forEach(function(i){e.set(i.name,i)});function r(i){a.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!a.has(s)){var l=e.get(s);l&&r(l)}}),n.push(i)}return t.forEach(function(i){a.has(i.name)||r(i)}),n}function orderModifiers(t){var e=order(t);return modifierPhases.reduce(function(a,n){return a.concat(e.filter(function(r){return r.phase===n}))},[])}function debounce$1(t){var e;return function(){return e||(e=new Promise(function(a){Promise.resolve().then(function(){e=void 0,a(t())})})),e}}function mergeByName(t){var e=t.reduce(function(a,n){var r=a[n.name];return a[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,a},{});return Object.keys(e).map(function(a){return e[a]})}var DEFAULT_OPTIONS$1={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function popperGenerator(t){t===void 0&&(t={});var e=t,a=e.defaultModifiers,n=a===void 0?[]:a,r=e.defaultOptions,i=r===void 0?DEFAULT_OPTIONS$1:r;return function(s,l,u){u===void 0&&(u=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS$1,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],h=!1,m={state:c,setOptions:function(w){var _=typeof w=="function"?w(c.options):w;v(),c.options=Object.assign({},i,c.options,_),c.scrollParents={reference:isElement$1(s)?listScrollParents(s):s.contextElement?listScrollParents(s.contextElement):[],popper:listScrollParents(l)};var D=orderModifiers(mergeByName([].concat(n,c.options.modifiers)));return c.orderedModifiers=D.filter(function(k){return k.enabled}),p(),m.update()},forceUpdate:function(){if(!h){var w=c.elements,_=w.reference,D=w.popper;if(areValidElements(_,D)){c.rects={reference:getCompositeRect(_,getOffsetParent(D),c.options.strategy==="fixed"),popper:getLayoutRect(D)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function($){return c.modifiersData[$.name]=Object.assign({},$.data)});for(var k=0;k<c.orderedModifiers.length;k++){if(c.reset===!0){c.reset=!1,k=-1;continue}var O=c.orderedModifiers[k],N=O.fn,F=O.options,g=F===void 0?{}:F,b=O.name;typeof N=="function"&&(c=N({state:c,options:g,name:b,instance:m})||c)}}}},update:debounce$1(function(){return new Promise(function(y){m.forceUpdate(),y(c)})}),destroy:function(){v(),h=!0}};if(!areValidElements(s,l))return m;m.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function p(){c.orderedModifiers.forEach(function(y){var w=y.name,_=y.options,D=_===void 0?{}:_,k=y.effect;if(typeof k=="function"){var O=k({state:c,name:w,instance:m,options:D}),N=function(){};d.push(O||N)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var createPopper$2=popperGenerator(),defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1],createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1}),defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});const Popper=Object.freeze(Object.defineProperty({__proto__:null,afterMain,afterRead,afterWrite,applyStyles:applyStyles$1,arrow:arrow$1,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,computeStyles:computeStyles$1,createPopper,createPopperBase:createPopper$2,createPopperLite:createPopper$1,detectOverflow,end,eventListeners,flip:flip$1,hide:hide$1,left,main,modifierPhases,offset:offset$1,placements,popper,popperGenerator,popperOffsets:popperOffsets$1,preventOverflow:preventOverflow$1,read,reference,right,start,top,variationPlacements,viewport,write},Symbol.toStringTag,{value:"Module"}));/*!
+`:""}`,e),setTimeout(()=>{throw t},0)}var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(t){let e=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1;let a=t();return shouldAutoEvaluateFunctions=e,a}function evaluate(t,e,a={}){let n;return evaluateLater(t,e)(r=>n=r,a),n}function evaluateLater(...t){return theEvaluatorFunction(...t)}var theEvaluatorFunction=normalEvaluator;function setEvaluator(t){theEvaluatorFunction=t}function normalEvaluator(t,e){let a={};injectMagics(a,t);let n=[a,...closestDataStack(t)],r=typeof e=="function"?generateEvaluatorFromFunction(n,e):generateEvaluatorFromString(n,e,t);return tryCatch.bind(null,t,e,r)}function generateEvaluatorFromFunction(t,e){return(a=()=>{},{scope:n={},params:r=[]}={})=>{let i=e.apply(mergeProxies([n,...t]),r);runIfTypeOfFunction(a,i)}}var evaluatorMemo={};function generateFunctionFromString(t,e){if(evaluatorMemo[t])return evaluatorMemo[t];let a=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t,i=(()=>{try{return new a(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(o){return handleError(o,e,t),Promise.resolve()}})();return evaluatorMemo[t]=i,i}function generateEvaluatorFromString(t,e,a){let n=generateFunctionFromString(e,a);return(r=()=>{},{scope:i={},params:o=[]}={})=>{n.result=void 0,n.finished=!1;let s=mergeProxies([i,...t]);if(typeof n=="function"){let l=n(n,s).catch(u=>handleError(u,a,e));n.finished?(runIfTypeOfFunction(r,n.result,s,o,a),n.result=void 0):l.then(u=>{runIfTypeOfFunction(r,u,s,o,a)}).catch(u=>handleError(u,a,e)).finally(()=>n.result=void 0)}}}function runIfTypeOfFunction(t,e,a,n,r){if(shouldAutoEvaluateFunctions&&typeof e=="function"){let i=e.apply(a,n);i instanceof Promise?i.then(o=>runIfTypeOfFunction(t,o,a,n)).catch(o=>handleError(o,r,e)):t(i)}else typeof e=="object"&&e instanceof Promise?e.then(i=>t(i)):t(e)}var prefixAsString="x-";function prefix(t=""){return prefixAsString+t}function setPrefix(t){prefixAsString=t}var directiveHandlers={};function directive(t,e){return directiveHandlers[t]=e,{before(a){if(!directiveHandlers[a]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}const n=directiveOrder.indexOf(a);directiveOrder.splice(n>=0?n:directiveOrder.indexOf("DEFAULT"),0,t)}}}function directives(t,e,a){if(e=Array.from(e),t._x_virtualDirectives){let i=Object.entries(t._x_virtualDirectives).map(([s,l])=>({name:s,value:l})),o=attributesOnly(i);i=i.map(s=>o.find(l=>l.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),e=e.concat(i)}let n={};return e.map(toTransformedAttributes((i,o)=>n[i]=o)).filter(outNonAlpineAttributes).map(toParsedDirectives(n,a)).sort(byPriority).map(i=>getDirectiveHandler(t,i))}function attributesOnly(t){return Array.from(t).map(toTransformedAttributes()).filter(e=>!outNonAlpineAttributes(e))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function deferHandlingDirectives(t){isDeferringHandlers=!0;let e=Symbol();currentHandlerStackKey=e,directiveHandlerStacks.set(e,[]);let a=()=>{for(;directiveHandlerStacks.get(e).length;)directiveHandlerStacks.get(e).shift()();directiveHandlerStacks.delete(e)},n=()=>{isDeferringHandlers=!1,a()};t(a),n()}function getElementBoundUtilities(t){let e=[],a=s=>e.push(s),[n,r]=elementBoundEffect(t);return e.push(r),[{Alpine:alpine_default,effect:n,cleanup:a,evaluateLater:evaluateLater.bind(evaluateLater,t),evaluate:evaluate.bind(evaluate,t)},()=>e.forEach(s=>s())]}function getDirectiveHandler(t,e){let a=()=>{},n=directiveHandlers[e.type]||a,[r,i]=getElementBoundUtilities(t);onAttributeRemoved(t,e.original,i);let o=()=>{t._x_ignore||t._x_ignoreSelf||(n.inline&&n.inline(t,e,r),n=n.bind(n,t,e,r),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(n):n())};return o.runCleanups=i,o}var startingWith=(t,e)=>({name:a,value:n})=>(a.startsWith(t)&&(a=a.replace(t,e)),{name:a,value:n}),into=t=>t;function toTransformedAttributes(t=()=>{}){return({name:e,value:a})=>{let{name:n,value:r}=attributeTransformers.reduce((i,o)=>o(i),{name:e,value:a});return n!==e&&t(n,e),{name:n,value:r}}}var attributeTransformers=[];function mapAttributes(t){attributeTransformers.push(t)}function outNonAlpineAttributes({name:t}){return alpineAttributeRegex().test(t)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(t,e){return({name:a,value:n})=>{let r=a.match(alpineAttributeRegex()),i=a.match(/:([a-zA-Z0-9\-:]+)/),o=a.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=e||t[a]||a;return{type:r?r[1]:null,value:i?i[1]:null,modifiers:o.map(l=>l.replace(".","")),expression:n,original:s}}}var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(t,e){let a=directiveOrder.indexOf(t.type)===-1?DEFAULT:t.type,n=directiveOrder.indexOf(e.type)===-1?DEFAULT:e.type;return directiveOrder.indexOf(a)-directiveOrder.indexOf(n)}var tickStack=[],isHolding=!1;function nextTick(t=()=>{}){return queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks()})}),new Promise(e=>{tickStack.push(()=>{t(),e()})})}function releaseNextTicks(){for(isHolding=!1;tickStack.length;)tickStack.shift()()}function holdNextTicks(){isHolding=!0}function setClasses(t,e){return Array.isArray(e)?setClassesFromString(t,e.join(" ")):typeof e=="object"&&e!==null?setClassesFromObject(t,e):typeof e=="function"?setClasses(t,e()):setClassesFromString(t,e)}function setClassesFromString(t,e){let a=r=>r.split(" ").filter(i=>!t.classList.contains(i)).filter(Boolean),n=r=>(t.classList.add(...r),()=>{t.classList.remove(...r)});return e=e===!0?e="":e||"",n(a(e))}function setClassesFromObject(t,e){let a=s=>s.split(" ").filter(Boolean),n=Object.entries(e).flatMap(([s,l])=>l?a(s):!1).filter(Boolean),r=Object.entries(e).flatMap(([s,l])=>l?!1:a(s)).filter(Boolean),i=[],o=[];return r.forEach(s=>{t.classList.contains(s)&&(t.classList.remove(s),o.push(s))}),n.forEach(s=>{t.classList.contains(s)||(t.classList.add(s),i.push(s))}),()=>{o.forEach(s=>t.classList.add(s)),i.forEach(s=>t.classList.remove(s))}}function setStyles(t,e){return typeof e=="object"&&e!==null?setStylesFromObject(t,e):setStylesFromString(t,e)}function setStylesFromObject(t,e){let a={};return Object.entries(e).forEach(([n,r])=>{a[n]=t.style[n],n.startsWith("--")||(n=kebabCase(n)),t.style.setProperty(n,r)}),setTimeout(()=>{t.style.length===0&&t.removeAttribute("style")}),()=>{setStyles(t,a)}}function setStylesFromString(t,e){let a=t.getAttribute("style",e);return t.setAttribute("style",e),()=>{t.setAttribute("style",a||"")}}function kebabCase(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function once(t,e=()=>{}){let a=!1;return function(){a?e.apply(this,arguments):(a=!0,t.apply(this,arguments))}}directive("transition",(t,{value:e,modifiers:a,expression:n},{evaluate:r})=>{typeof n=="function"&&(n=r(n)),n!==!1&&(!n||typeof n=="boolean"?registerTransitionsFromHelper(t,a,e):registerTransitionsFromClassString(t,n,e))});function registerTransitionsFromClassString(t,e,a){registerTransitionObject(t,setClasses,""),{enter:r=>{t._x_transition.enter.during=r},"enter-start":r=>{t._x_transition.enter.start=r},"enter-end":r=>{t._x_transition.enter.end=r},leave:r=>{t._x_transition.leave.during=r},"leave-start":r=>{t._x_transition.leave.start=r},"leave-end":r=>{t._x_transition.leave.end=r}}[a](e)}function registerTransitionsFromHelper(t,e,a){registerTransitionObject(t,setStyles);let n=!e.includes("in")&&!e.includes("out")&&!a,r=n||e.includes("in")||["enter"].includes(a),i=n||e.includes("out")||["leave"].includes(a);e.includes("in")&&!n&&(e=e.filter((w,_)=>_<e.indexOf("out"))),e.includes("out")&&!n&&(e=e.filter((w,_)=>_>e.indexOf("out")));let o=!e.includes("opacity")&&!e.includes("scale"),s=o||e.includes("opacity"),l=o||e.includes("scale"),u=s?0:1,c=l?modifierValue(e,"scale",95)/100:1,d=modifierValue(e,"delay",0)/1e3,h=modifierValue(e,"origin","center"),m="opacity, transform",p=modifierValue(e,"duration",150)/1e3,v=modifierValue(e,"duration",75)/1e3,y="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(t._x_transition.enter.during={transformOrigin:h,transitionDelay:`${d}s`,transitionProperty:m,transitionDuration:`${p}s`,transitionTimingFunction:y},t._x_transition.enter.start={opacity:u,transform:`scale(${c})`},t._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(t._x_transition.leave.during={transformOrigin:h,transitionDelay:`${d}s`,transitionProperty:m,transitionDuration:`${v}s`,transitionTimingFunction:y},t._x_transition.leave.start={opacity:1,transform:"scale(1)"},t._x_transition.leave.end={opacity:u,transform:`scale(${c})`})}function registerTransitionObject(t,e,a={}){t._x_transition||(t._x_transition={enter:{during:a,start:a,end:a},leave:{during:a,start:a,end:a},in(n=()=>{},r=()=>{}){transition(t,e,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,r)},out(n=()=>{},r=()=>{}){transition(t,e,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,r)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(t,e,a,n){const r=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let i=()=>r(a);if(e){t._x_transition&&(t._x_transition.enter||t._x_transition.leave)?t._x_transition.enter&&(Object.entries(t._x_transition.enter.during).length||Object.entries(t._x_transition.enter.start).length||Object.entries(t._x_transition.enter.end).length)?t._x_transition.in(a):i():t._x_transition?t._x_transition.in(a):i();return}t._x_hidePromise=t._x_transition?new Promise((o,s)=>{t._x_transition.out(()=>{},()=>o(n)),t._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=closestHide(t);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(t)):r(()=>{let s=l=>{let u=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(s)]).then(([c])=>c());return delete l._x_hidePromise,delete l._x_hideChildren,u};s(t).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function closestHide(t){let e=t.parentNode;if(e)return e._x_hidePromise?e:closestHide(e)}function transition(t,e,{during:a,start:n,end:r}={},i=()=>{},o=()=>{}){if(t._x_transitioning&&t._x_transitioning.cancel(),Object.keys(a).length===0&&Object.keys(n).length===0&&Object.keys(r).length===0){i(),o();return}let s,l,u;performTransition(t,{start(){s=e(t,n)},during(){l=e(t,a)},before:i,end(){s(),u=e(t,r)},after:o,cleanup(){l(),u()}})}function performTransition(t,e){let a,n,r,i=once(()=>{mutateDom(()=>{a=!0,n||e.before(),r||(e.end(),releaseNextTicks()),e.after(),t.isConnected&&e.cleanup(),delete t._x_transitioning})});t._x_transitioning={beforeCancels:[],beforeCancel(o){this.beforeCancels.push(o)},cancel:once(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},mutateDom(()=>{e.start(),e.during()}),holdNextTicks(),requestAnimationFrame(()=>{if(a)return;let o=Number(getComputedStyle(t).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,s=Number(getComputedStyle(t).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;o===0&&(o=Number(getComputedStyle(t).animationDuration.replace("s",""))*1e3),mutateDom(()=>{e.before()}),n=!0,requestAnimationFrame(()=>{a||(mutateDom(()=>{e.end()}),releaseNextTicks(),setTimeout(t._x_transitioning.finish,o+s),r=!0)})})}function modifierValue(t,e,a){if(t.indexOf(e)===-1)return a;const n=t[t.indexOf(e)+1];if(!n||e==="scale"&&isNaN(n))return a;if(e==="duration"||e==="delay"){let r=n.match(/([0-9]+)ms/);if(r)return r[1]}return e==="origin"&&["top","right","left","center","bottom"].includes(t[t.indexOf(e)+2])?[n,t[t.indexOf(e)+2]].join(" "):n}var isCloning=!1;function skipDuringClone(t,e=()=>{}){return(...a)=>isCloning?e(...a):t(...a)}function onlyDuringClone(t){return(...e)=>isCloning&&t(...e)}function cloneNode(t,e){t._x_dataStack&&(e._x_dataStack=t._x_dataStack,e.setAttribute("data-has-alpine-state",!0)),isCloning=!0,dontRegisterReactiveSideEffects(()=>{initTree(e,(a,n)=>{n(a,()=>{})})}),isCloning=!1}var isCloningLegacy=!1;function clone$3(t,e){e._x_dataStack||(e._x_dataStack=t._x_dataStack),isCloning=!0,isCloningLegacy=!0,dontRegisterReactiveSideEffects(()=>{cloneTree(e)}),isCloning=!1,isCloningLegacy=!1}function cloneTree(t){let e=!1;initTree(t,(n,r)=>{walk(n,(i,o)=>{if(e&&isRoot(i))return o();e=!0,r(i,o)})})}function dontRegisterReactiveSideEffects(t){let e=effect$3;overrideEffect((a,n)=>{let r=e(a);return release(r),()=>{}}),t(),overrideEffect(e)}function shouldSkipRegisteringDataDuringClone(t){return isCloning?isCloningLegacy?!0:t.hasAttribute("data-has-alpine-state"):!1}function bind(t,e,a,n=[]){switch(t._x_bindings||(t._x_bindings=reactive({})),t._x_bindings[e]=a,e=n.includes("camel")?camelCase$2(e):e,e){case"value":bindInputValue(t,a);break;case"style":bindStyles(t,a);break;case"class":bindClasses(t,a);break;case"selected":case"checked":bindAttributeAndProperty(t,e,a);break;default:bindAttribute(t,e,a);break}}function bindInputValue(t,e){if(t.type==="radio")t.attributes.value===void 0&&(t.value=e),window.fromModel&&(t.checked=checkedAttrLooseCompare(t.value,e));else if(t.type==="checkbox")Number.isInteger(e)?t.value=e:!Array.isArray(e)&&typeof e!="boolean"&&![null,void 0].includes(e)?t.value=String(e):Array.isArray(e)?t.checked=e.some(a=>checkedAttrLooseCompare(a,t.value)):t.checked=!!e;else if(t.tagName==="SELECT")updateSelect(t,e);else{if(t.value===e)return;t.value=e===void 0?"":e}}function bindClasses(t,e){t._x_undoAddedClasses&&t._x_undoAddedClasses(),t._x_undoAddedClasses=setClasses(t,e)}function bindStyles(t,e){t._x_undoAddedStyles&&t._x_undoAddedStyles(),t._x_undoAddedStyles=setStyles(t,e)}function bindAttributeAndProperty(t,e,a){bindAttribute(t,e,a),setPropertyIfChanged(t,e,a)}function bindAttribute(t,e,a){[null,void 0,!1].includes(a)&&attributeShouldntBePreservedIfFalsy(e)?t.removeAttribute(e):(isBooleanAttr(e)&&(a=e),setIfChanged(t,e,a))}function setIfChanged(t,e,a){t.getAttribute(e)!=a&&t.setAttribute(e,a)}function setPropertyIfChanged(t,e,a){t[e]!==a&&(t[e]=a)}function updateSelect(t,e){const a=[].concat(e).map(n=>n+"");Array.from(t.options).forEach(n=>{n.selected=a.includes(n.value)})}function camelCase$2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function checkedAttrLooseCompare(t,e){return t==e}function isBooleanAttr(t){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(t)}function attributeShouldntBePreservedIfFalsy(t){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(t)}function getBinding(t,e,a){return t._x_bindings&&t._x_bindings[e]!==void 0?t._x_bindings[e]:getAttributeBinding(t,e,a)}function extractProp(t,e,a,n=!0){if(t._x_bindings&&t._x_bindings[e]!==void 0)return t._x_bindings[e];if(t._x_inlineBindings&&t._x_inlineBindings[e]!==void 0){let r=t._x_inlineBindings[e];return r.extract=n,dontAutoEvaluateFunctions(()=>evaluate(t,r.expression))}return getAttributeBinding(t,e,a)}function getAttributeBinding(t,e,a){let n=t.getAttribute(e);return n===null?typeof a=="function"?a():a:n===""?!0:isBooleanAttr(e)?!![e,"true"].includes(n):n}function debounce$2(t,e){var a;return function(){var n=this,r=arguments,i=function(){a=null,t.apply(n,r)};clearTimeout(a),a=setTimeout(i,e)}}function throttle(t,e){let a;return function(){let n=this,r=arguments;a||(t.apply(n,r),a=!0,setTimeout(()=>a=!1,e))}}function entangle({get:t,set:e},{get:a,set:n}){let r=!0,i,o,s,l=effect$3(()=>{let u,c;r?(u=t(),n(JSON.parse(JSON.stringify(u))),c=a(),r=!1):(u=t(),c=a(),o=JSON.stringify(u),s=JSON.stringify(c),o!==i?(c=a(),n(u),c=u):(e(JSON.parse(s??null)),u=c)),i=JSON.stringify(u),JSON.stringify(c)});return()=>{release(l)}}function plugin(t){(Array.isArray(t)?t:[t]).forEach(a=>a(alpine_default))}var stores={},isReactive=!1;function store(t,e){if(isReactive||(stores=reactive(stores),isReactive=!0),e===void 0)return stores[t];stores[t]=e,typeof e=="object"&&e!==null&&e.hasOwnProperty("init")&&typeof e.init=="function"&&stores[t].init(),initInterceptors2(stores[t])}function getStores(){return stores}var binds={};function bind2(t,e){let a=typeof e!="function"?()=>e:e;return t instanceof Element?applyBindingsObject(t,a()):(binds[t]=a,()=>{})}function injectBindingProviders(t){return Object.entries(binds).forEach(([e,a])=>{Object.defineProperty(t,e,{get(){return(...n)=>a(...n)}})}),t}function applyBindingsObject(t,e,a){let n=[];for(;n.length;)n.pop()();let r=Object.entries(e).map(([o,s])=>({name:o,value:s})),i=attributesOnly(r);return r=r.map(o=>i.find(s=>s.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),directives(t,r,a).map(o=>{n.push(o.runCleanups),o()}),()=>{for(;n.length;)n.pop()()}}var datas={};function data(t,e){datas[t]=e}function injectDataProviders(t,e){return Object.entries(datas).forEach(([a,n])=>{Object.defineProperty(t,a,{get(){return(...r)=>n.bind(e)(...r)},enumerable:!1})}),t}var Alpine$1={get reactive(){return reactive},get release(){return release},get effect(){return effect$3},get raw(){return raw},version:"3.13.0",flushAndStopDeferringMutations,dontAutoEvaluateFunctions,disableEffectScheduling,startObservingMutations,stopObservingMutations,setReactivityEngine,onAttributeRemoved,onAttributesAdded,closestDataStack,skipDuringClone,onlyDuringClone,addRootSelector,addInitSelector,addScopeToNode,deferMutations,mapAttributes,evaluateLater,interceptInit,setEvaluator,mergeProxies,extractProp,findClosest,onElRemoved,closestRoot,destroyTree,interceptor,transition,setStyles,mutateDom,directive,entangle,throttle,debounce:debounce$2,evaluate,initTree,nextTick,prefixed:prefix,prefix:setPrefix,plugin,magic,store,start:start$1,clone:clone$3,cloneNode,bound:getBinding,$data:scope,walk,data,bind:bind2},alpine_default=Alpine$1;function makeMap(t,e){const a=Object.create(null),n=t.split(",");for(let r=0;r<n.length;r++)a[n[r]]=!0;return e?r=>!!a[r.toLowerCase()]:r=>!!a[r]}var EMPTY_OBJ=Object.freeze({}),hasOwnProperty$b=Object.prototype.hasOwnProperty,hasOwn=(t,e)=>hasOwnProperty$b.call(t,e),isArray$d=Array.isArray,isMap=t=>toTypeString(t)==="[object Map]",isString=t=>typeof t=="string",isSymbol$6=t=>typeof t=="symbol",isObject$9=t=>t!==null&&typeof t=="object",objectToString$2=Object.prototype.toString,toTypeString=t=>objectToString$2.call(t),toRawType=t=>toTypeString(t).slice(8,-1),isIntegerKey=t=>isString(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,cacheStringFunction=t=>{const e=Object.create(null);return a=>e[a]||(e[a]=t(a))},capitalize$2=cacheStringFunction(t=>t.charAt(0).toUpperCase()+t.slice(1)),hasChanged=(t,e)=>t!==e&&(t===t||e===e),targetMap=new WeakMap,effectStack=[],activeEffect,ITERATE_KEY=Symbol("iterate"),MAP_KEY_ITERATE_KEY=Symbol("Map key iterate");function isEffect(t){return t&&t._isEffect===!0}function effect2(t,e=EMPTY_OBJ){isEffect(t)&&(t=t.raw);const a=createReactiveEffect(t,e);return e.lazy||a(),a}function stop(t){t.active&&(cleanup(t),t.options.onStop&&t.options.onStop(),t.active=!1)}var uid$1=0;function createReactiveEffect(t,e){const a=function(){if(!a.active)return t();if(!effectStack.includes(a)){cleanup(a);try{return enableTracking(),effectStack.push(a),activeEffect=a,t()}finally{effectStack.pop(),resetTracking(),activeEffect=effectStack[effectStack.length-1]}}};return a.id=uid$1++,a.allowRecurse=!!e.allowRecurse,a._isEffect=!0,a.active=!0,a.raw=t,a.deps=[],a.options=e,a}function cleanup(t){const{deps:e}=t;if(e.length){for(let a=0;a<e.length;a++)e[a].delete(t);e.length=0}}var shouldTrack=!0,trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function enableTracking(){trackStack.push(shouldTrack),shouldTrack=!0}function resetTracking(){const t=trackStack.pop();shouldTrack=t===void 0?!0:t}function track(t,e,a){if(!shouldTrack||activeEffect===void 0)return;let n=targetMap.get(t);n||targetMap.set(t,n=new Map);let r=n.get(a);r||n.set(a,r=new Set),r.has(activeEffect)||(r.add(activeEffect),activeEffect.deps.push(r),activeEffect.options.onTrack&&activeEffect.options.onTrack({effect:activeEffect,target:t,type:e,key:a}))}function trigger(t,e,a,n,r,i){const o=targetMap.get(t);if(!o)return;const s=new Set,l=c=>{c&&c.forEach(d=>{(d!==activeEffect||d.allowRecurse)&&s.add(d)})};if(e==="clear")o.forEach(l);else if(a==="length"&&isArray$d(t))o.forEach((c,d)=>{(d==="length"||d>=n)&&l(c)});else switch(a!==void 0&&l(o.get(a)),e){case"add":isArray$d(t)?isIntegerKey(a)&&l(o.get("length")):(l(o.get(ITERATE_KEY)),isMap(t)&&l(o.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$d(t)||(l(o.get(ITERATE_KEY)),isMap(t)&&l(o.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(t)&&l(o.get(ITERATE_KEY));break}const u=c=>{c.options.onTrigger&&c.options.onTrigger({effect:c,target:t,key:a,type:e,newValue:n,oldValue:r,oldTarget:i}),c.options.scheduler?c.options.scheduler(c):c()};s.forEach(u)}var isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(isSymbol$6)),get2=createGetter(),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...a){const n=toRaw(this);for(let i=0,o=this.length;i<o;i++)track(n,"get",i+"");const r=n[e](...a);return r===-1||r===!1?n[e](...a.map(toRaw)):r}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...a){pauseTracking();const n=toRaw(this)[e].apply(this,a);return resetTracking(),n}}),t}function createGetter(t=!1,e=!1){return function(n,r,i){if(r==="__v_isReactive")return!t;if(r==="__v_isReadonly")return t;if(r==="__v_raw"&&i===(t?e?shallowReadonlyMap:readonlyMap:e?shallowReactiveMap:reactiveMap).get(n))return n;const o=isArray$d(n);if(!t&&o&&hasOwn(arrayInstrumentations,r))return Reflect.get(arrayInstrumentations,r,i);const s=Reflect.get(n,r,i);return(isSymbol$6(r)?builtInSymbols.has(r):isNonTrackableKeys(r))||(t||track(n,"get",r),e)?s:isRef(s)?!o||!isIntegerKey(r)?s.value:s:isObject$9(s)?t?readonly(s):reactive2(s):s}}var set2=createSetter();function createSetter(t=!1){return function(a,n,r,i){let o=a[n];if(!t&&(r=toRaw(r),o=toRaw(o),!isArray$d(a)&&isRef(o)&&!isRef(r)))return o.value=r,!0;const s=isArray$d(a)&&isIntegerKey(n)?Number(n)<a.length:hasOwn(a,n),l=Reflect.set(a,n,r,i);return a===toRaw(i)&&(s?hasChanged(r,o)&&trigger(a,"set",n,r,o):trigger(a,"add",n,r)),l}}function deleteProperty(t,e){const a=hasOwn(t,e),n=t[e],r=Reflect.deleteProperty(t,e);return r&&a&&trigger(t,"delete",e,void 0,n),r}function has$2(t,e){const a=Reflect.has(t,e);return(!isSymbol$6(e)||!builtInSymbols.has(e))&&track(t,"has",e),a}function ownKeys(t){return track(t,"iterate",isArray$d(t)?"length":ITERATE_KEY),Reflect.ownKeys(t)}var mutableHandlers={get:get2,set:set2,deleteProperty,has:has$2,ownKeys},readonlyHandlers={get:readonlyGet,set(t,e){return console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0},deleteProperty(t,e){return console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0}},toReactive=t=>isObject$9(t)?reactive2(t):t,toReadonly=t=>isObject$9(t)?readonly(t):t,toShallow=t=>t,getProto=t=>Reflect.getPrototypeOf(t);function get$1$1(t,e,a=!1,n=!1){t=t.__v_raw;const r=toRaw(t),i=toRaw(e);e!==i&&!a&&track(r,"get",e),!a&&track(r,"get",i);const{has:o}=getProto(r),s=n?toShallow:a?toReadonly:toReactive;if(o.call(r,e))return s(t.get(e));if(o.call(r,i))return s(t.get(i));t!==r&&t.get(e)}function has$1$1(t,e=!1){const a=this.__v_raw,n=toRaw(a),r=toRaw(t);return t!==r&&!e&&track(n,"has",t),!e&&track(n,"has",r),t===r?a.has(t):a.has(t)||a.has(r)}function size(t,e=!1){return t=t.__v_raw,!e&&track(toRaw(t),"iterate",ITERATE_KEY),Reflect.get(t,"size",t)}function add(t){t=toRaw(t);const e=toRaw(this);return getProto(e).has.call(e,t)||(e.add(t),trigger(e,"add",t,t)),this}function set$1$1(t,e){e=toRaw(e);const a=toRaw(this),{has:n,get:r}=getProto(a);let i=n.call(a,t);i?checkIdentityKeys(a,n,t):(t=toRaw(t),i=n.call(a,t));const o=r.call(a,t);return a.set(t,e),i?hasChanged(e,o)&&trigger(a,"set",t,e,o):trigger(a,"add",t,e),this}function deleteEntry(t){const e=toRaw(this),{has:a,get:n}=getProto(e);let r=a.call(e,t);r?checkIdentityKeys(e,a,t):(t=toRaw(t),r=a.call(e,t));const i=n?n.call(e,t):void 0,o=e.delete(t);return r&&trigger(e,"delete",t,void 0,i),o}function clear(){const t=toRaw(this),e=t.size!==0,a=isMap(t)?new Map(t):new Set(t),n=t.clear();return e&&trigger(t,"clear",void 0,void 0,a),n}function createForEach(t,e){return function(n,r){const i=this,o=i.__v_raw,s=toRaw(o),l=e?toShallow:t?toReadonly:toReactive;return!t&&track(s,"iterate",ITERATE_KEY),o.forEach((u,c)=>n.call(r,l(u),l(c),i))}}function createIterableMethod(t,e,a){return function(...n){const r=this.__v_raw,i=toRaw(r),o=isMap(i),s=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,u=r[t](...n),c=a?toShallow:e?toReadonly:toReactive;return!e&&track(i,"iterate",l?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:d,done:h}=u.next();return h?{value:d,done:h}:{value:s?[c(d[0]),c(d[1])]:c(d),done:h}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(t){return function(...e){{const a=e[0]?`on key "${e[0]}" `:"";console.warn(`${capitalize$2(t)} operation ${a}failed: target is readonly.`,toRaw(this))}return t==="delete"?!1:this}}function createInstrumentations(){const t={get(i){return get$1$1(this,i)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},e={get(i){return get$1$1(this,i,!1,!0)},get size(){return size(this)},has:has$1$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},a={get(i){return get$1$1(this,i,!0)},get size(){return size(this,!0)},has(i){return has$1$1.call(this,i,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},n={get(i){return get$1$1(this,i,!0,!0)},get size(){return size(this,!0)},has(i){return has$1$1.call(this,i,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=createIterableMethod(i,!1,!1),a[i]=createIterableMethod(i,!0,!1),e[i]=createIterableMethod(i,!1,!0),n[i]=createIterableMethod(i,!0,!0)}),[t,a,e,n]}var[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(t,e){const a=e?t?shallowReadonlyInstrumentations:shallowInstrumentations:t?readonlyInstrumentations:mutableInstrumentations;return(n,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?n:Reflect.get(hasOwn(a,r)&&r in n?a:n,r,i)}var mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)};function checkIdentityKeys(t,e,a){const n=toRaw(a);if(n!==a&&e.call(t,n)){const r=toRawType(t);console.warn(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(t){return t.__v_skip||!Object.isExtensible(t)?0:targetTypeMap(toRawType(t))}function reactive2(t){return t&&t.__v_isReadonly?t:createReactiveObject(t,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function readonly(t){return createReactiveObject(t,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(t,e,a,n,r){if(!isObject$9(t))return console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=r.get(t);if(i)return i;const o=getTargetType(t);if(o===0)return t;const s=new Proxy(t,o===2?n:a);return r.set(t,s),s}function toRaw(t){return t&&toRaw(t.__v_raw)||t}function isRef(t){return!!(t&&t.__v_isRef===!0)}magic("nextTick",()=>nextTick);magic("dispatch",t=>dispatch.bind(dispatch,t));magic("watch",(t,{evaluateLater:e,effect:a})=>(n,r)=>{let i=e(n),o=!0,s,l=a(()=>i(u=>{JSON.stringify(u),o?s=u:queueMicrotask(()=>{r(u,s),s=u}),o=!1}));t._x_effects.delete(l)});magic("store",getStores);magic("data",t=>scope(t));magic("root",t=>closestRoot(t));magic("refs",t=>(t._x_refs_proxy||(t._x_refs_proxy=mergeProxies(getArrayOfRefObject(t))),t._x_refs_proxy));function getArrayOfRefObject(t){let e=[],a=t;for(;a;)a._x_refs&&e.push(a._x_refs),a=a.parentNode;return e}var globalIdMemo={};function findAndIncrementId(t){return globalIdMemo[t]||(globalIdMemo[t]=0),++globalIdMemo[t]}function closestIdRoot(t,e){return findClosest(t,a=>{if(a._x_ids&&a._x_ids[e])return!0})}function setIdRoot(t,e){t._x_ids||(t._x_ids={}),t._x_ids[e]||(t._x_ids[e]=findAndIncrementId(e))}magic("id",t=>(e,a=null)=>{let n=closestIdRoot(t,e),r=n?n._x_ids[e]:findAndIncrementId(e);return a?`${e}-${r}-${a}`:`${e}-${r}`});magic("el",t=>t);warnMissingPluginMagic("Focus","focus","focus");warnMissingPluginMagic("Persist","persist","persist");function warnMissingPluginMagic(t,e,a){magic(e,n=>warn(`You can't use [$${directiveName}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,n))}directive("modelable",(t,{expression:e},{effect:a,evaluateLater:n,cleanup:r})=>{let i=n(e),o=()=>{let c;return i(d=>c=d),c},s=n(`${e} = __placeholder`),l=c=>s(()=>{},{scope:{__placeholder:c}}),u=o();l(u),queueMicrotask(()=>{if(!t._x_model)return;t._x_removeModelListeners.default();let c=t._x_model.get,d=t._x_model.set,h=entangle({get(){return c()},set(m){d(m)}},{get(){return o()},set(m){l(m)}});r(h)})});var teleportContainerDuringClone=document.createElement("div");directive("teleport",(t,{modifiers:e,expression:a},{cleanup:n})=>{t.tagName.toLowerCase()!=="template"&&warn("x-teleport can only be used on a <template> tag",t);let r=skipDuringClone(()=>document.querySelector(a),()=>teleportContainerDuringClone)();r||warn(`Cannot find x-teleport element for selector: "${a}"`);let i=t.content.cloneNode(!0).firstElementChild;t._x_teleport=i,i._x_teleportBack=t,t._x_forwardEvents&&t._x_forwardEvents.forEach(o=>{i.addEventListener(o,s=>{s.stopPropagation(),t.dispatchEvent(new s.constructor(s.type,s))})}),addScopeToNode(i,{},t),mutateDom(()=>{e.includes("prepend")?r.parentNode.insertBefore(i,r):e.includes("append")?r.parentNode.insertBefore(i,r.nextSibling):r.appendChild(i),initTree(i),i._x_ignore=!0}),n(()=>i.remove())});var handler=()=>{};handler.inline=(t,{modifiers:e},{cleanup:a})=>{e.includes("self")?t._x_ignoreSelf=!0:t._x_ignore=!0,a(()=>{e.includes("self")?delete t._x_ignoreSelf:delete t._x_ignore})};directive("ignore",handler);directive("effect",(t,{expression:e},{effect:a})=>a(evaluateLater(t,e)));function on(t,e,a,n){let r=t,i=l=>n(l),o={},s=(l,u)=>c=>u(l,c);if(a.includes("dot")&&(e=dotSyntax(e)),a.includes("camel")&&(e=camelCase2(e)),a.includes("passive")&&(o.passive=!0),a.includes("capture")&&(o.capture=!0),a.includes("window")&&(r=window),a.includes("document")&&(r=document),a.includes("debounce")){let l=a[a.indexOf("debounce")+1]||"invalid-wait",u=isNumeric$1(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=debounce$2(i,u)}if(a.includes("throttle")){let l=a[a.indexOf("throttle")+1]||"invalid-wait",u=isNumeric$1(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=throttle(i,u)}return a.includes("prevent")&&(i=s(i,(l,u)=>{u.preventDefault(),l(u)})),a.includes("stop")&&(i=s(i,(l,u)=>{u.stopPropagation(),l(u)})),a.includes("self")&&(i=s(i,(l,u)=>{u.target===t&&l(u)})),(a.includes("away")||a.includes("outside"))&&(r=document,i=s(i,(l,u)=>{t.contains(u.target)||u.target.isConnected!==!1&&(t.offsetWidth<1&&t.offsetHeight<1||t._x_isShown!==!1&&l(u))})),a.includes("once")&&(i=s(i,(l,u)=>{l(u),r.removeEventListener(e,i,o)})),i=s(i,(l,u)=>{isKeyEvent(e)&&isListeningForASpecificKeyThatHasntBeenPressed(u,a)||l(u)}),r.addEventListener(e,i,o),()=>{r.removeEventListener(e,i,o)}}function dotSyntax(t){return t.replace(/-/g,".")}function camelCase2(t){return t.toLowerCase().replace(/-(\w)/g,(e,a)=>a.toUpperCase())}function isNumeric$1(t){return!Array.isArray(t)&&!isNaN(t)}function kebabCase2(t){return[" ","_"].includes(t)?t:t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function isKeyEvent(t){return["keydown","keyup"].includes(t)}function isListeningForASpecificKeyThatHasntBeenPressed(t,e){let a=e.filter(i=>!["window","document","prevent","stop","once","capture"].includes(i));if(a.includes("debounce")){let i=a.indexOf("debounce");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.includes("throttle")){let i=a.indexOf("throttle");a.splice(i,isNumeric$1((a[i+1]||"invalid-wait").split("ms")[0])?2:1)}if(a.length===0||a.length===1&&keyToModifiers(t.key).includes(a[0]))return!1;const r=["ctrl","shift","alt","meta","cmd","super"].filter(i=>a.includes(i));return a=a.filter(i=>!r.includes(i)),!(r.length>0&&r.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),t[`${o}Key`])).length===r.length&&keyToModifiers(t.key).includes(a[0]))}function keyToModifiers(t){if(!t)return[];t=kebabCase2(t);let e={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"=",minus:"-",underscore:"_"};return e[t]=t,Object.keys(e).map(a=>{if(e[a]===t)return a}).filter(a=>a)}directive("model",(t,{modifiers:e,expression:a},{effect:n,cleanup:r})=>{let i=t;e.includes("parent")&&(i=t.parentNode);let o=evaluateLater(i,a),s;typeof a=="string"?s=evaluateLater(i,`${a} = __placeholder`):typeof a=="function"&&typeof a()=="string"?s=evaluateLater(i,`${a()} = __placeholder`):s=()=>{};let l=()=>{let h;return o(m=>h=m),isGetterSetter(h)?h.get():h},u=h=>{let m;o(p=>m=p),isGetterSetter(m)?m.set(h):s(()=>{},{scope:{__placeholder:h}})};typeof a=="string"&&t.type==="radio"&&mutateDom(()=>{t.hasAttribute("name")||t.setAttribute("name",a)});var c=t.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(t.type)||e.includes("lazy")?"change":"input";let d=isCloning?()=>{}:on(t,c,e,h=>{u(getInputValue(t,e,h,l()))});if(e.includes("fill")&&([null,""].includes(l())||t.type==="checkbox"&&Array.isArray(l()))&&t.dispatchEvent(new Event(c,{})),t._x_removeModelListeners||(t._x_removeModelListeners={}),t._x_removeModelListeners.default=d,r(()=>t._x_removeModelListeners.default()),t.form){let h=on(t.form,"reset",[],m=>{nextTick(()=>t._x_model&&t._x_model.set(t.value))});r(()=>h())}t._x_model={get(){return l()},set(h){u(h)}},t._x_forceModelUpdate=h=>{h===void 0&&typeof a=="string"&&a.match(/\./)&&(h=""),window.fromModel=!0,mutateDom(()=>bind(t,"value",h)),delete window.fromModel},n(()=>{let h=l();e.includes("unintrusive")&&document.activeElement.isSameNode(t)||t._x_forceModelUpdate(h)})});function getInputValue(t,e,a,n){return mutateDom(()=>{if(a instanceof CustomEvent&&a.detail!==void 0)return a.detail??a.target.value;if(t.type==="checkbox")if(Array.isArray(n)){let r=e.includes("number")?safeParseNumber(a.target.value):a.target.value;return a.target.checked?n.concat([r]):n.filter(i=>!checkedAttrLooseCompare2(i,r))}else return a.target.checked;else{if(t.tagName.toLowerCase()==="select"&&t.multiple)return e.includes("number")?Array.from(a.target.selectedOptions).map(r=>{let i=r.value||r.text;return safeParseNumber(i)}):Array.from(a.target.selectedOptions).map(r=>r.value||r.text);{let r=a.target.value;return e.includes("number")?safeParseNumber(r):e.includes("trim")?r.trim():r}}})}function safeParseNumber(t){let e=t?parseFloat(t):null;return isNumeric2(e)?e:t}function checkedAttrLooseCompare2(t,e){return t==e}function isNumeric2(t){return!Array.isArray(t)&&!isNaN(t)}function isGetterSetter(t){return t!==null&&typeof t=="object"&&typeof t.get=="function"&&typeof t.set=="function"}directive("cloak",t=>queueMicrotask(()=>mutateDom(()=>t.removeAttribute(prefix("cloak")))));addInitSelector(()=>`[${prefix("init")}]`);directive("init",skipDuringClone((t,{expression:e},{evaluate:a})=>typeof e=="string"?!!e.trim()&&a(e,{},!1):a(e,{},!1)));directive("text",(t,{expression:e},{effect:a,evaluateLater:n})=>{let r=n(e);a(()=>{r(i=>{mutateDom(()=>{t.textContent=i})})})});directive("html",(t,{expression:e},{effect:a,evaluateLater:n})=>{let r=n(e);a(()=>{r(i=>{mutateDom(()=>{t.innerHTML=i,t._x_ignoreSelf=!0,initTree(t),delete t._x_ignoreSelf})})})});mapAttributes(startingWith(":",into(prefix("bind:"))));var handler2=(t,{value:e,modifiers:a,expression:n,original:r},{effect:i})=>{if(!e){let s={};injectBindingProviders(s),evaluateLater(t,n)(u=>{applyBindingsObject(t,u,r)},{scope:s});return}if(e==="key")return storeKeyForXFor(t,n);if(t._x_inlineBindings&&t._x_inlineBindings[e]&&t._x_inlineBindings[e].extract)return;let o=evaluateLater(t,n);i(()=>o(s=>{s===void 0&&typeof n=="string"&&n.match(/\./)&&(s=""),mutateDom(()=>bind(t,e,s,a))}))};handler2.inline=(t,{value:e,modifiers:a,expression:n})=>{e&&(t._x_inlineBindings||(t._x_inlineBindings={}),t._x_inlineBindings[e]={expression:n,extract:!1})};directive("bind",handler2);function storeKeyForXFor(t,e){t._x_keyExpression=e}addRootSelector(()=>`[${prefix("data")}]`);directive("data",(t,{expression:e},{cleanup:a})=>{if(shouldSkipRegisteringDataDuringClone(t))return;e=e===""?"{}":e;let n={};injectMagics(n,t);let r={};injectDataProviders(r,n);let i=evaluate(t,e,{scope:r});(i===void 0||i===!0)&&(i={}),injectMagics(i,t);let o=reactive(i);initInterceptors2(o);let s=addScopeToNode(t,o);o.init&&evaluate(t,o.init),a(()=>{o.destroy&&evaluate(t,o.destroy),s()})});directive("show",(t,{modifiers:e,expression:a},{effect:n})=>{let r=evaluateLater(t,a);t._x_doHide||(t._x_doHide=()=>{mutateDom(()=>{t.style.setProperty("display","none",e.includes("important")?"important":void 0)})}),t._x_doShow||(t._x_doShow=()=>{mutateDom(()=>{t.style.length===1&&t.style.display==="none"?t.removeAttribute("style"):t.style.removeProperty("display")})});let i=()=>{t._x_doHide(),t._x_isShown=!1},o=()=>{t._x_doShow(),t._x_isShown=!0},s=()=>setTimeout(o),l=once(d=>d?o():i(),d=>{typeof t._x_toggleAndCascadeWithTransitions=="function"?t._x_toggleAndCascadeWithTransitions(t,d,o,i):d?s():i()}),u,c=!0;n(()=>r(d=>{!c&&d===u||(e.includes("immediate")&&(d?s():i()),l(d),u=d,c=!1)}))});directive("for",(t,{expression:e},{effect:a,cleanup:n})=>{let r=parseForExpression(e),i=evaluateLater(t,r.items),o=evaluateLater(t,t._x_keyExpression||"index");t._x_prevKeys=[],t._x_lookup={},a(()=>loop(t,r,i,o)),n(()=>{Object.values(t._x_lookup).forEach(s=>s.remove()),delete t._x_prevKeys,delete t._x_lookup})});function loop(t,e,a,n){let r=o=>typeof o=="object"&&!Array.isArray(o),i=t;a(o=>{isNumeric3(o)&&o>=0&&(o=Array.from(Array(o).keys(),y=>y+1)),o===void 0&&(o=[]);let s=t._x_lookup,l=t._x_prevKeys,u=[],c=[];if(r(o))o=Object.entries(o).map(([y,w])=>{let _=getIterationScopeVariables(e,w,y,o);n(D=>c.push(D),{scope:{index:y,..._}}),u.push(_)});else for(let y=0;y<o.length;y++){let w=getIterationScopeVariables(e,o[y],y,o);n(_=>c.push(_),{scope:{index:y,...w}}),u.push(w)}let d=[],h=[],m=[],p=[];for(let y=0;y<l.length;y++){let w=l[y];c.indexOf(w)===-1&&m.push(w)}l=l.filter(y=>!m.includes(y));let v="template";for(let y=0;y<c.length;y++){let w=c[y],_=l.indexOf(w);if(_===-1)l.splice(y,0,w),d.push([v,y]);else if(_!==y){let D=l.splice(y,1)[0],k=l.splice(_-1,1)[0];l.splice(y,0,k),l.splice(_,0,D),h.push([D,k])}else p.push(w);v=w}for(let y=0;y<m.length;y++){let w=m[y];s[w]._x_effects&&s[w]._x_effects.forEach(dequeueJob),s[w].remove(),s[w]=null,delete s[w]}for(let y=0;y<h.length;y++){let[w,_]=h[y],D=s[w],k=s[_],O=document.createElement("div");mutateDom(()=>{k||warn('x-for ":key" is undefined or invalid',i),k.after(O),D.after(k),k._x_currentIfEl&&k.after(k._x_currentIfEl),O.before(D),D._x_currentIfEl&&D.after(D._x_currentIfEl),O.remove()}),k._x_refreshXForScope(u[c.indexOf(_)])}for(let y=0;y<d.length;y++){let[w,_]=d[y],D=w==="template"?i:s[w];D._x_currentIfEl&&(D=D._x_currentIfEl);let k=u[_],O=c[_],N=document.importNode(i.content,!0).firstElementChild,F=reactive(k);addScopeToNode(N,F,i),N._x_refreshXForScope=g=>{Object.entries(g).forEach(([b,$])=>{F[b]=$})},mutateDom(()=>{D.after(N),initTree(N)}),typeof O=="object"&&warn("x-for key cannot be an object, it must be a string or an integer",i),s[O]=N}for(let y=0;y<p.length;y++)s[p[y]]._x_refreshXForScope(u[c.indexOf(p[y])]);i._x_prevKeys=c})}function parseForExpression(t){let e=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,a=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,r=t.match(n);if(!r)return;let i={};i.items=r[2].trim();let o=r[1].replace(a,"").trim(),s=o.match(e);return s?(i.item=o.replace(e,"").trim(),i.index=s[1].trim(),s[2]&&(i.collection=s[2].trim())):i.item=o,i}function getIterationScopeVariables(t,e,a,n){let r={};return/^\[.*\]$/.test(t.item)&&Array.isArray(e)?t.item.replace("[","").replace("]","").split(",").map(o=>o.trim()).forEach((o,s)=>{r[o]=e[s]}):/^\{.*\}$/.test(t.item)&&!Array.isArray(e)&&typeof e=="object"?t.item.replace("{","").replace("}","").split(",").map(o=>o.trim()).forEach(o=>{r[o]=e[o]}):r[t.item]=e,t.index&&(r[t.index]=a),t.collection&&(r[t.collection]=n),r}function isNumeric3(t){return!Array.isArray(t)&&!isNaN(t)}function handler3(){}handler3.inline=(t,{expression:e},{cleanup:a})=>{let n=closestRoot(t);n._x_refs||(n._x_refs={}),n._x_refs[e]=t,a(()=>delete n._x_refs[e])};directive("ref",handler3);directive("if",(t,{expression:e},{effect:a,cleanup:n})=>{let r=evaluateLater(t,e),i=()=>{if(t._x_currentIfEl)return t._x_currentIfEl;let s=t.content.cloneNode(!0).firstElementChild;return addScopeToNode(s,{},t),mutateDom(()=>{t.after(s),initTree(s)}),t._x_currentIfEl=s,t._x_undoIf=()=>{walk(s,l=>{l._x_effects&&l._x_effects.forEach(dequeueJob)}),s.remove(),delete t._x_currentIfEl},s},o=()=>{t._x_undoIf&&(t._x_undoIf(),delete t._x_undoIf)};a(()=>r(s=>{s?i():o()})),n(()=>t._x_undoIf&&t._x_undoIf())});directive("id",(t,{expression:e},{evaluate:a})=>{a(e).forEach(r=>setIdRoot(t,r))});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((t,{value:e,modifiers:a,expression:n},{cleanup:r})=>{let i=n?evaluateLater(t,n):()=>{};t.tagName.toLowerCase()==="template"&&(t._x_forwardEvents||(t._x_forwardEvents=[]),t._x_forwardEvents.includes(e)||t._x_forwardEvents.push(e));let o=on(t,e,a,s=>{i(()=>{},{scope:{$event:s},params:[s]})});r(()=>o())}));warnMissingPluginDirective("Collapse","collapse","collapse");warnMissingPluginDirective("Intersect","intersect","intersect");warnMissingPluginDirective("Focus","trap","focus");warnMissingPluginDirective("Mask","mask","mask");function warnMissingPluginDirective(t,e,a){directive(e,n=>warn(`You can't use [x-${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${a}`,n))}alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default,module_default=src_default,top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(t,e){return t.concat([e+"-"+start,e+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(t,e){return t.concat([e,e+"-"+start,e+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(t){return t?(t.nodeName||"").toLowerCase():null}function getWindow(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function isElement$1(t){var e=getWindow(t).Element;return t instanceof e||t instanceof Element}function isHTMLElement(t){var e=getWindow(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function isShadowRoot(t){if(typeof ShadowRoot>"u")return!1;var e=getWindow(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function applyStyles(t){var e=t.state;Object.keys(e.elements).forEach(function(a){var n=e.styles[a]||{},r=e.attributes[a]||{},i=e.elements[a];!isHTMLElement(i)||!getNodeName(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(o){var s=r[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function effect$2(t){var e=t.state,a={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,a.popper),e.styles=a,e.elements.arrow&&Object.assign(e.elements.arrow.style,a.arrow),function(){Object.keys(e.elements).forEach(function(n){var r=e.elements[n],i=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:a[n]),s=o.reduce(function(l,u){return l[u]="",l},{});!isHTMLElement(r)||!getNodeName(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(t){return t.split("-")[0]}var max=Math.max,min=Math.min,round$1=Math.round;function getUAString(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(t,e,a){e===void 0&&(e=!1),a===void 0&&(a=!1);var n=t.getBoundingClientRect(),r=1,i=1;e&&isHTMLElement(t)&&(r=t.offsetWidth>0&&round$1(n.width)/t.offsetWidth||1,i=t.offsetHeight>0&&round$1(n.height)/t.offsetHeight||1);var o=isElement$1(t)?getWindow(t):window,s=o.visualViewport,l=!isLayoutViewport()&&a,u=(n.left+(l&&s?s.offsetLeft:0))/r,c=(n.top+(l&&s?s.offsetTop:0))/i,d=n.width/r,h=n.height/i;return{width:d,height:h,top:c,right:u+d,bottom:c+h,left:u,x:u,y:c}}function getLayoutRect(t){var e=getBoundingClientRect(t),a=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-a)<=1&&(a=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:a,height:n}}function contains(t,e){var a=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(a&&isShadowRoot(a)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function getComputedStyle$2(t){return getWindow(t).getComputedStyle(t)}function isTableElement(t){return["table","td","th"].indexOf(getNodeName(t))>=0}function getDocumentElement(t){return((isElement$1(t)?t.ownerDocument:t.document)||window.document).documentElement}function getParentNode(t){return getNodeName(t)==="html"?t:t.assignedSlot||t.parentNode||(isShadowRoot(t)?t.host:null)||getDocumentElement(t)}function getTrueOffsetParent(t){return!isHTMLElement(t)||getComputedStyle$2(t).position==="fixed"?null:t.offsetParent}function getContainingBlock(t){var e=/firefox/i.test(getUAString()),a=/Trident/i.test(getUAString());if(a&&isHTMLElement(t)){var n=getComputedStyle$2(t);if(n.position==="fixed")return null}var r=getParentNode(t);for(isShadowRoot(r)&&(r=r.host);isHTMLElement(r)&&["html","body"].indexOf(getNodeName(r))<0;){var i=getComputedStyle$2(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function getOffsetParent(t){for(var e=getWindow(t),a=getTrueOffsetParent(t);a&&isTableElement(a)&&getComputedStyle$2(a).position==="static";)a=getTrueOffsetParent(a);return a&&(getNodeName(a)==="html"||getNodeName(a)==="body"&&getComputedStyle$2(a).position==="static")?e:a||getContainingBlock(t)||e}function getMainAxisFromPlacement(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function within$1(t,e,a){return max(t,min(e,a))}function withinMaxClamp(t,e,a){var n=within$1(t,e,a);return n>a?a:n}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(t){return Object.assign({},getFreshSideObject(),t)}function expandToHashMap(t,e){return e.reduce(function(a,n){return a[n]=t,a},{})}var toPaddingObject=function t(e,a){return e=typeof e=="function"?e(Object.assign({},a.rects,{placement:a.placement})):e,mergePaddingObject(typeof e!="number"?e:expandToHashMap(e,basePlacements))};function arrow(t){var e,a=t.state,n=t.name,r=t.options,i=a.elements.arrow,o=a.modifiersData.popperOffsets,s=getBasePlacement(a.placement),l=getMainAxisFromPlacement(s),u=[left,right].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!o)){var d=toPaddingObject(r.padding,a),h=getLayoutRect(i),m=l==="y"?top:left,p=l==="y"?bottom:right,v=a.rects.reference[c]+a.rects.reference[l]-o[l]-a.rects.popper[c],y=o[l]-a.rects.reference[l],w=getOffsetParent(i),_=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,D=v/2-y/2,k=d[m],O=_-h[c]-d[p],N=_/2-h[c]/2+D,F=within$1(k,N,O),g=l;a.modifiersData[n]=(e={},e[g]=F,e.centerOffset=F-N,e)}}function effect$1(t){var e=t.state,a=t.options,n=a.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||contains(e.elements.popper,r)&&(e.elements.arrow=r))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(t){return t.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(t,e){var a=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:round$1(a*r)/r||0,y:round$1(n*r)/r||0}}function mapToStyles(t){var e,a=t.popper,n=t.popperRect,r=t.placement,i=t.variation,o=t.offsets,s=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,h=o.x,m=h===void 0?0:h,p=o.y,v=p===void 0?0:p,y=typeof c=="function"?c({x:m,y:v}):{x:m,y:v};m=y.x,v=y.y;var w=o.hasOwnProperty("x"),_=o.hasOwnProperty("y"),D=left,k=top,O=window;if(u){var N=getOffsetParent(a),F="clientHeight",g="clientWidth";if(N===getWindow(a)&&(N=getDocumentElement(a),getComputedStyle$2(N).position!=="static"&&s==="absolute"&&(F="scrollHeight",g="scrollWidth")),N=N,r===top||(r===left||r===right)&&i===end){k=bottom;var b=d&&N===O&&O.visualViewport?O.visualViewport.height:N[F];v-=b-n.height,v*=l?1:-1}if(r===left||(r===top||r===bottom)&&i===end){D=right;var $=d&&N===O&&O.visualViewport?O.visualViewport.width:N[g];m-=$-n.width,m*=l?1:-1}}var S=Object.assign({position:s},u&&unsetSides),P=c===!0?roundOffsetsByDPR({x:m,y:v},getWindow(a)):{x:m,y:v};if(m=P.x,v=P.y,l){var M;return Object.assign({},S,(M={},M[k]=_?"0":"",M[D]=w?"0":"",M.transform=(O.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",M))}return Object.assign({},S,(e={},e[k]=_?v+"px":"",e[D]=w?m+"px":"",e.transform="",e))}function computeStyles(t){var e=t.state,a=t.options,n=a.gpuAcceleration,r=n===void 0?!0:n,i=a.adaptive,o=i===void 0?!0:i,s=a.roundOffsets,l=s===void 0?!0:s,u={placement:getBasePlacement(e.placement),variation:getVariation(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,mapToStyles(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,mapToStyles(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(t){var e=t.state,a=t.instance,n=t.options,r=n.scroll,i=r===void 0?!0:r,o=n.resize,s=o===void 0?!0:o,l=getWindow(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",a.update,passive)}),s&&l.addEventListener("resize",a.update,passive),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",a.update,passive)}),s&&l.removeEventListener("resize",a.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function t(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,function(e){return hash$1[e]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(t){return t.replace(/start|end/g,function(e){return hash[e]})}function getWindowScroll(t){var e=getWindow(t),a=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:a,scrollTop:n}}function getWindowScrollBarX(t){return getBoundingClientRect(getDocumentElement(t)).left+getWindowScroll(t).scrollLeft}function getViewportRect(t,e){var a=getWindow(t),n=getDocumentElement(t),r=a.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(r){i=r.width,o=r.height;var u=isLayoutViewport();(u||!u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:o,x:s+getWindowScrollBarX(t),y:l}}function getDocumentRect(t){var e,a=getDocumentElement(t),n=getWindowScroll(t),r=(e=t.ownerDocument)==null?void 0:e.body,i=max(a.scrollWidth,a.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=max(a.scrollHeight,a.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-n.scrollLeft+getWindowScrollBarX(t),l=-n.scrollTop;return getComputedStyle$2(r||a).direction==="rtl"&&(s+=max(a.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:s,y:l}}function isScrollParent(t){var e=getComputedStyle$2(t),a=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(a+r+n)}function getScrollParent(t){return["html","body","#document"].indexOf(getNodeName(t))>=0?t.ownerDocument.body:isHTMLElement(t)&&isScrollParent(t)?t:getScrollParent(getParentNode(t))}function listScrollParents(t,e){var a;e===void 0&&(e=[]);var n=getScrollParent(t),r=n===((a=t.ownerDocument)==null?void 0:a.body),i=getWindow(n),o=r?[i].concat(i.visualViewport||[],isScrollParent(n)?n:[]):n,s=e.concat(o);return r?s:s.concat(listScrollParents(getParentNode(o)))}function rectToClientRect(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function getInnerBoundingClientRect(t,e){var a=getBoundingClientRect(t,!1,e==="fixed");return a.top=a.top+t.clientTop,a.left=a.left+t.clientLeft,a.bottom=a.top+t.clientHeight,a.right=a.left+t.clientWidth,a.width=t.clientWidth,a.height=t.clientHeight,a.x=a.left,a.y=a.top,a}function getClientRectFromMixedType(t,e,a){return e===viewport?rectToClientRect(getViewportRect(t,a)):isElement$1(e)?getInnerBoundingClientRect(e,a):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var e=listScrollParents(getParentNode(t)),a=["absolute","fixed"].indexOf(getComputedStyle$2(t).position)>=0,n=a&&isHTMLElement(t)?getOffsetParent(t):t;return isElement$1(n)?e.filter(function(r){return isElement$1(r)&&contains(r,n)&&getNodeName(r)!=="body"}):[]}function getClippingRect(t,e,a,n){var r=e==="clippingParents"?getClippingParents(t):[].concat(e),i=[].concat(r,[a]),o=i[0],s=i.reduce(function(l,u){var c=getClientRectFromMixedType(t,u,n);return l.top=max(c.top,l.top),l.right=min(c.right,l.right),l.bottom=min(c.bottom,l.bottom),l.left=max(c.left,l.left),l},getClientRectFromMixedType(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function computeOffsets(t){var e=t.reference,a=t.element,n=t.placement,r=n?getBasePlacement(n):null,i=n?getVariation(n):null,o=e.x+e.width/2-a.width/2,s=e.y+e.height/2-a.height/2,l;switch(r){case top:l={x:o,y:e.y-a.height};break;case bottom:l={x:o,y:e.y+e.height};break;case right:l={x:e.x+e.width,y:s};break;case left:l={x:e.x-a.width,y:s};break;default:l={x:e.x,y:e.y}}var u=r?getMainAxisFromPlacement(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case start:l[u]=l[u]-(e[c]/2-a[c]/2);break;case end:l[u]=l[u]+(e[c]/2-a[c]/2);break}}return l}function detectOverflow(t,e){e===void 0&&(e={});var a=e,n=a.placement,r=n===void 0?t.placement:n,i=a.strategy,o=i===void 0?t.strategy:i,s=a.boundary,l=s===void 0?clippingParents:s,u=a.rootBoundary,c=u===void 0?viewport:u,d=a.elementContext,h=d===void 0?popper:d,m=a.altBoundary,p=m===void 0?!1:m,v=a.padding,y=v===void 0?0:v,w=mergePaddingObject(typeof y!="number"?y:expandToHashMap(y,basePlacements)),_=h===popper?reference:popper,D=t.rects.popper,k=t.elements[p?_:h],O=getClippingRect(isElement$1(k)?k:k.contextElement||getDocumentElement(t.elements.popper),l,c,o),N=getBoundingClientRect(t.elements.reference),F=computeOffsets({reference:N,element:D,strategy:"absolute",placement:r}),g=rectToClientRect(Object.assign({},D,F)),b=h===popper?g:N,$={top:O.top-b.top+w.top,bottom:b.bottom-O.bottom+w.bottom,left:O.left-b.left+w.left,right:b.right-O.right+w.right},S=t.modifiersData.offset;if(h===popper&&S){var P=S[r];Object.keys($).forEach(function(M){var C=[right,bottom].indexOf(M)>=0?1:-1,E=[top,bottom].indexOf(M)>=0?"y":"x";$[M]+=P[E]*C})}return $}function computeAutoPlacement(t,e){e===void 0&&(e={});var a=e,n=a.placement,r=a.boundary,i=a.rootBoundary,o=a.padding,s=a.flipVariations,l=a.allowedAutoPlacements,u=l===void 0?placements:l,c=getVariation(n),d=c?s?variationPlacements:variationPlacements.filter(function(p){return getVariation(p)===c}):basePlacements,h=d.filter(function(p){return u.indexOf(p)>=0});h.length===0&&(h=d);var m=h.reduce(function(p,v){return p[v]=detectOverflow(t,{placement:v,boundary:r,rootBoundary:i,padding:o})[getBasePlacement(v)],p},{});return Object.keys(m).sort(function(p,v){return m[p]-m[v]})}function getExpandedFallbackPlacements(t){if(getBasePlacement(t)===auto)return[];var e=getOppositePlacement(t);return[getOppositeVariationPlacement(t),e,getOppositeVariationPlacement(e)]}function flip(t){var e=t.state,a=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=a.mainAxis,i=r===void 0?!0:r,o=a.altAxis,s=o===void 0?!0:o,l=a.fallbackPlacements,u=a.padding,c=a.boundary,d=a.rootBoundary,h=a.altBoundary,m=a.flipVariations,p=m===void 0?!0:m,v=a.allowedAutoPlacements,y=e.options.placement,w=getBasePlacement(y),_=w===y,D=l||(_||!p?[getOppositePlacement(y)]:getExpandedFallbackPlacements(y)),k=[y].concat(D).reduce(function(B,V){return B.concat(getBasePlacement(V)===auto?computeAutoPlacement(e,{placement:V,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:v}):V)},[]),O=e.rects.reference,N=e.rects.popper,F=new Map,g=!0,b=k[0],$=0;$<k.length;$++){var S=k[$],P=getBasePlacement(S),M=getVariation(S)===start,C=[top,bottom].indexOf(P)>=0,E=C?"width":"height",T=detectOverflow(e,{placement:S,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),x=C?M?right:left:M?bottom:top;O[E]>N[E]&&(x=getOppositePlacement(x));var A=getOppositePlacement(x),L=[];if(i&&L.push(T[P]<=0),s&&L.push(T[x]<=0,T[A]<=0),L.every(function(B){return B})){b=S,g=!1;break}F.set(S,L)}if(g)for(var I=p?3:1,W=function(V){var H=k.find(function(G){var K=F.get(G);if(K)return K.slice(0,V).every(function(Y){return Y})});if(H)return b=H,"break"},z=I;z>0;z--){var U=W(z);if(U==="break")break}e.placement!==b&&(e.modifiersData[n]._skip=!0,e.placement=b,e.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(t,e,a){return a===void 0&&(a={x:0,y:0}),{top:t.top-e.height-a.y,right:t.right-e.width+a.x,bottom:t.bottom-e.height+a.y,left:t.left-e.width-a.x}}function isAnySideFullyClipped(t){return[top,right,bottom,left].some(function(e){return t[e]>=0})}function hide(t){var e=t.state,a=t.name,n=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=detectOverflow(e,{elementContext:"reference"}),s=detectOverflow(e,{altBoundary:!0}),l=getSideOffsets(o,n),u=getSideOffsets(s,r,i),c=isAnySideFullyClipped(l),d=isAnySideFullyClipped(u);e.modifiersData[a]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(t,e,a){var n=getBasePlacement(t),r=[left,top].indexOf(n)>=0?-1:1,i=typeof a=="function"?a(Object.assign({},e,{placement:t})):a,o=i[0],s=i[1];return o=o||0,s=(s||0)*r,[left,right].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function offset(t){var e=t.state,a=t.options,n=t.name,r=a.offset,i=r===void 0?[0,0]:r,o=placements.reduce(function(c,d){return c[d]=distanceAndSkiddingToXY(d,e.rects,i),c},{}),s=o[e.placement],l=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(t){var e=t.state,a=t.name;e.modifiersData[a]=computeOffsets({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(t){return t==="x"?"y":"x"}function preventOverflow(t){var e=t.state,a=t.options,n=t.name,r=a.mainAxis,i=r===void 0?!0:r,o=a.altAxis,s=o===void 0?!1:o,l=a.boundary,u=a.rootBoundary,c=a.altBoundary,d=a.padding,h=a.tether,m=h===void 0?!0:h,p=a.tetherOffset,v=p===void 0?0:p,y=detectOverflow(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),w=getBasePlacement(e.placement),_=getVariation(e.placement),D=!_,k=getMainAxisFromPlacement(w),O=getAltAxis(k),N=e.modifiersData.popperOffsets,F=e.rects.reference,g=e.rects.popper,b=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,$=typeof b=="number"?{mainAxis:b,altAxis:b}:Object.assign({mainAxis:0,altAxis:0},b),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(N){if(i){var M,C=k==="y"?top:left,E=k==="y"?bottom:right,T=k==="y"?"height":"width",x=N[k],A=x+y[C],L=x-y[E],I=m?-g[T]/2:0,W=_===start?F[T]:g[T],z=_===start?-g[T]:-F[T],U=e.elements.arrow,B=m&&U?getLayoutRect(U):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:getFreshSideObject(),H=V[C],G=V[E],K=within$1(0,F[T],B[T]),Y=D?F[T]/2-I-K-H-$.mainAxis:W-K-H-$.mainAxis,J=D?-F[T]/2+I+K+G+$.mainAxis:z+K+G+$.mainAxis,Q=e.elements.arrow&&getOffsetParent(e.elements.arrow),ee=Q?k==="y"?Q.clientTop||0:Q.clientLeft||0:0,Z=(M=S==null?void 0:S[k])!=null?M:0,X=x+Y-Z-ee,q=x+J-Z,ie=within$1(m?min(A,X):A,x,m?max(L,q):L);N[k]=ie,P[k]=ie-x}if(s){var oe,ge=k==="x"?top:left,pe=k==="x"?bottom:right,te=N[O],ae=O==="y"?"height":"width",se=te+y[ge],le=te-y[pe],re=[top,left].indexOf(w)!==-1,ue=(oe=S==null?void 0:S[O])!=null?oe:0,ce=re?se:te-F[ae]-g[ae]-ue+$.altAxis,fe=re?te+F[ae]+g[ae]-ue-$.altAxis:le,he=m&&re?withinMaxClamp(ce,te,fe):within$1(m?ce:se,te,m?fe:le);N[O]=he,P[O]=he-te}e.modifiersData[n]=P}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function getNodeScroll(t){return t===getWindow(t)||!isHTMLElement(t)?getWindowScroll(t):getHTMLElementScroll(t)}function isElementScaled(t){var e=t.getBoundingClientRect(),a=round$1(e.width)/t.offsetWidth||1,n=round$1(e.height)/t.offsetHeight||1;return a!==1||n!==1}function getCompositeRect(t,e,a){a===void 0&&(a=!1);var n=isHTMLElement(e),r=isHTMLElement(e)&&isElementScaled(e),i=getDocumentElement(e),o=getBoundingClientRect(t,r,a),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!a)&&((getNodeName(e)!=="body"||isScrollParent(i))&&(s=getNodeScroll(e)),isHTMLElement(e)?(l=getBoundingClientRect(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=getWindowScrollBarX(i))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function order(t){var e=new Map,a=new Set,n=[];t.forEach(function(i){e.set(i.name,i)});function r(i){a.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!a.has(s)){var l=e.get(s);l&&r(l)}}),n.push(i)}return t.forEach(function(i){a.has(i.name)||r(i)}),n}function orderModifiers(t){var e=order(t);return modifierPhases.reduce(function(a,n){return a.concat(e.filter(function(r){return r.phase===n}))},[])}function debounce$1(t){var e;return function(){return e||(e=new Promise(function(a){Promise.resolve().then(function(){e=void 0,a(t())})})),e}}function mergeByName(t){var e=t.reduce(function(a,n){var r=a[n.name];return a[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,a},{});return Object.keys(e).map(function(a){return e[a]})}var DEFAULT_OPTIONS$1={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function popperGenerator(t){t===void 0&&(t={});var e=t,a=e.defaultModifiers,n=a===void 0?[]:a,r=e.defaultOptions,i=r===void 0?DEFAULT_OPTIONS$1:r;return function(s,l,u){u===void 0&&(u=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS$1,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],h=!1,m={state:c,setOptions:function(w){var _=typeof w=="function"?w(c.options):w;v(),c.options=Object.assign({},i,c.options,_),c.scrollParents={reference:isElement$1(s)?listScrollParents(s):s.contextElement?listScrollParents(s.contextElement):[],popper:listScrollParents(l)};var D=orderModifiers(mergeByName([].concat(n,c.options.modifiers)));return c.orderedModifiers=D.filter(function(k){return k.enabled}),p(),m.update()},forceUpdate:function(){if(!h){var w=c.elements,_=w.reference,D=w.popper;if(areValidElements(_,D)){c.rects={reference:getCompositeRect(_,getOffsetParent(D),c.options.strategy==="fixed"),popper:getLayoutRect(D)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function($){return c.modifiersData[$.name]=Object.assign({},$.data)});for(var k=0;k<c.orderedModifiers.length;k++){if(c.reset===!0){c.reset=!1,k=-1;continue}var O=c.orderedModifiers[k],N=O.fn,F=O.options,g=F===void 0?{}:F,b=O.name;typeof N=="function"&&(c=N({state:c,options:g,name:b,instance:m})||c)}}}},update:debounce$1(function(){return new Promise(function(y){m.forceUpdate(),y(c)})}),destroy:function(){v(),h=!0}};if(!areValidElements(s,l))return m;m.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function p(){c.orderedModifiers.forEach(function(y){var w=y.name,_=y.options,D=_===void 0?{}:_,k=y.effect;if(typeof k=="function"){var O=k({state:c,name:w,instance:m,options:D}),N=function(){};d.push(O||N)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var createPopper$2=popperGenerator(),defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1],createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1}),defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});const Popper=Object.freeze(Object.defineProperty({__proto__:null,afterMain,afterRead,afterWrite,applyStyles:applyStyles$1,arrow:arrow$1,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,computeStyles:computeStyles$1,createPopper,createPopperBase:createPopper$2,createPopperLite:createPopper$1,detectOverflow,end,eventListeners,flip:flip$1,hide:hide$1,left,main,modifierPhases,offset:offset$1,placements,popper,popperGenerator,popperOffsets:popperOffsets$1,preventOverflow:preventOverflow$1,read,reference,right,start,top,variationPlacements,viewport,write},Symbol.toStringTag,{value:"Module"}));/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
@@ -21,18 +21,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function round(t){return t+.5|0}const lim=(t,e,a)=>Math.max(Math.min(t,a),e);function p2b(t){return lim(round(t*2.55),0,255)}function n2b(t){return lim(round(t*255),0,255)}function b2n(t){return lim(round(t/2.55)/100,0,1)}function n2p(t){return lim(round(t*100),0,100)}const map$1={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},hex=[..."0123456789ABCDEF"],h1=t=>hex[t&15],h2=t=>hex[(t&240)>>4]+hex[t&15],eq$5=t=>(t&240)>>4===(t&15),isShort=t=>eq$5(t.r)&&eq$5(t.g)&&eq$5(t.b)&&eq$5(t.a);function hexParse(t){var e=t.length,a;return t[0]==="#"&&(e===4||e===5?a={r:255&map$1[t[1]]*17,g:255&map$1[t[2]]*17,b:255&map$1[t[3]]*17,a:e===5?map$1[t[4]]*17:255}:(e===7||e===9)&&(a={r:map$1[t[1]]<<4|map$1[t[2]],g:map$1[t[3]]<<4|map$1[t[4]],b:map$1[t[5]]<<4|map$1[t[6]],a:e===9?map$1[t[7]]<<4|map$1[t[8]]:255})),a}const alpha=(t,e)=>t<255?e(t):"";function hexString(t){var e=isShort(t)?h1:h2;return t?"#"+e(t.r)+e(t.g)+e(t.b)+alpha(t.a,e):void 0}const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(t,e,a){const n=e*Math.min(a,1-a),r=(i,o=(i+t/30)%12)=>a-n*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function hsv2rgbn(t,e,a){const n=(r,i=(r+t/60)%6)=>a-a*e*Math.max(Math.min(i,4-i,1),0);return[n(5),n(3),n(1)]}function hwb2rgbn(t,e,a){const n=hsl2rgbn(t,1,.5);let r;for(e+a>1&&(r=1/(e+a),e*=r,a*=r),r=0;r<3;r++)n[r]*=1-e-a,n[r]+=e;return n}function hueValue(t,e,a,n,r){return t===r?(e-a)/n+(e<a?6:0):e===r?(a-t)/n+2:(t-e)/n+4}function rgb2hsl(t){const a=t.r/255,n=t.g/255,r=t.b/255,i=Math.max(a,n,r),o=Math.min(a,n,r),s=(i+o)/2;let l,u,c;return i!==o&&(c=i-o,u=s>.5?c/(2-i-o):c/(i+o),l=hueValue(a,n,r,c,i),l=l*60+.5),[l|0,u||0,s]}function calln(t,e,a,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,a,n)).map(n2b)}function hsl2rgb(t,e,a){return calln(hsl2rgbn,t,e,a)}function hwb2rgb(t,e,a){return calln(hwb2rgbn,t,e,a)}function hsv2rgb(t,e,a){return calln(hsv2rgbn,t,e,a)}function hue(t){return(t%360+360)%360}function hueParse(t){const e=HUE_RE.exec(t);let a=255,n;if(!e)return;e[5]!==n&&(a=e[6]?p2b(+e[5]):n2b(+e[5]));const r=hue(+e[2]),i=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?n=hwb2rgb(r,i,o):e[1]==="hsv"?n=hsv2rgb(r,i,o):n=hsl2rgb(r,i,o),{r:n[0],g:n[1],b:n[2],a}}function rotate(t,e){var a=rgb2hsl(t);a[0]=hue(a[0]+e),a=hsl2rgb(a),t.r=a[0],t.g=a[1],t.b=a[2]}function hslString(t){if(!t)return;const e=rgb2hsl(t),a=e[0],n=n2p(e[1]),r=n2p(e[2]);return t.a<255?`hsla(${a}, ${n}%, ${r}%, ${b2n(t.a)})`:`hsl(${a}, ${n}%, ${r}%)`}const map={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"},names$1={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"};function unpack(){const t={},e=Object.keys(names$1),a=Object.keys(map);let n,r,i,o,s;for(n=0;n<e.length;n++){for(o=s=e[n],r=0;r<a.length;r++)i=a[r],s=s.replace(i,map[i]);i=parseInt(names$1[o],16),t[s]=[i>>16&255,i>>8&255,i&255]}return t}let names;function nameParse(t){names||(names=unpack(),names.transparent=[0,0,0,0]);const e=names[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(t){const e=RGB_RE.exec(t);let a=255,n,r,i;if(e){if(e[7]!==n){const o=+e[7];a=e[8]?p2b(o):lim(o*255,0,255)}return n=+e[1],r=+e[3],i=+e[5],n=255&(e[2]?p2b(n):lim(n,0,255)),r=255&(e[4]?p2b(r):lim(r,0,255)),i=255&(e[6]?p2b(i):lim(i,0,255)),{r:n,g:r,b:i,a}}}function rgbString(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${b2n(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const to=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,from=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function interpolate$2(t,e,a){const n=from(b2n(t.r)),r=from(b2n(t.g)),i=from(b2n(t.b));return{r:n2b(to(n+a*(from(b2n(e.r))-n))),g:n2b(to(r+a*(from(b2n(e.g))-r))),b:n2b(to(i+a*(from(b2n(e.b))-i))),a:t.a+a*(e.a-t.a)}}function modHSL(t,e,a){if(t){let n=rgb2hsl(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*a,e===0?360:1)),n=hsl2rgb(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function clone$2(t,e){return t&&Object.assign(e||{},t)}function fromObject(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=n2b(t[3]))):(e=clone$2(t,{r:0,g:0,b:0,a:1}),e.a=n2b(e.a)),e}function functionParse(t){return t.charAt(0)==="r"?rgbParse(t):hueParse(t)}class Color{constructor(e){if(e instanceof Color)return e;const a=typeof e;let n;a==="object"?n=fromObject(e):a==="string"&&(n=hexParse(e)||nameParse(e)||functionParse(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=clone$2(this._rgb);return e&&(e.a=b2n(e.a)),e}set rgb(e){this._rgb=fromObject(e)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(e,a){if(e){const n=this.rgb,r=e.rgb;let i;const o=a===i?.5:a,s=2*o-1,l=n.a-r.a,u=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;i=1-u,n.r=255&u*n.r+i*r.r+.5,n.g=255&u*n.g+i*r.g+.5,n.b=255&u*n.b+i*r.b+.5,n.a=o*n.a+(1-o)*r.a,this.rgb=n}return this}interpolate(e,a){return e&&(this._rgb=interpolate$2(this._rgb,e._rgb,a)),this}clone(){return new Color(this.rgb)}alpha(e){return this._rgb.a=n2b(e),this}clearer(e){const a=this._rgb;return a.a*=1-e,this}greyscale(){const e=this._rgb,a=round(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=a,this}opaquer(e){const a=this._rgb;return a.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return modHSL(this._rgb,2,e),this}darken(e){return modHSL(this._rgb,2,-e),this}saturate(e){return modHSL(this._rgb,1,e),this}desaturate(e){return modHSL(this._rgb,1,-e),this}rotate(e){return rotate(this._rgb,e),this}}/*!
- * Chart.js v4.3.3
+ * Chart.js v4.4.0
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
- */function noop$2(){}const uid=(()=>{let t=0;return()=>t++})();function isNullOrUndef(t){return t===null||typeof t>"u"}function isArray$c(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function isObject$8(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function isNumberFinite(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function finiteOrDefault(t,e){return isNumberFinite(t)?t:e}function valueOrDefault(t,e){return typeof t>"u"?e:t}const toPercentage=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,toDimension=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function callback(t,e,a){if(t&&typeof t.call=="function")return t.apply(a,e)}function each(t,e,a,n){let r,i,o;if(isArray$c(t))if(i=t.length,n)for(r=i-1;r>=0;r--)e.call(a,t[r],r);else for(r=0;r<i;r++)e.call(a,t[r],r);else if(isObject$8(t))for(o=Object.keys(t),i=o.length,r=0;r<i;r++)e.call(a,t[o[r]],o[r])}function _elementsEqual(t,e){let a,n,r,i;if(!t||!e||t.length!==e.length)return!1;for(a=0,n=t.length;a<n;++a)if(r=t[a],i=e[a],r.datasetIndex!==i.datasetIndex||r.index!==i.index)return!1;return!0}function clone$1(t){if(isArray$c(t))return t.map(clone$1);if(isObject$8(t)){const e=Object.create(null),a=Object.keys(t),n=a.length;let r=0;for(;r<n;++r)e[a[r]]=clone$1(t[a[r]]);return e}return t}function isValidKey(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function _merger(t,e,a,n){if(!isValidKey(t))return;const r=e[t],i=a[t];isObject$8(r)&&isObject$8(i)?merge(r,i,n):e[t]=clone$1(i)}function merge(t,e,a){const n=isArray$c(e)?e:[e],r=n.length;if(!isObject$8(t))return t;a=a||{};const i=a.merger||_merger;let o;for(let s=0;s<r;++s){if(o=n[s],!isObject$8(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)i(l[u],t,o,a)}return t}function mergeIf(t,e){return merge(t,e,{merger:_mergerIf})}function _mergerIf(t,e,a){if(!isValidKey(t))return;const n=e[t],r=a[t];isObject$8(n)&&isObject$8(r)?mergeIf(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=clone$1(r))}const keyResolvers={"":t=>t,x:t=>t.x,y:t=>t.y};function _splitKey(t){const e=t.split("."),a=[];let n="";for(const r of e)n+=r,n.endsWith("\\")?n=n.slice(0,-1)+".":(a.push(n),n="");return a}function _getKeyResolver(t){const e=_splitKey(t);return a=>{for(const n of e){if(n==="")break;a=a&&a[n]}return a}}function resolveObjectKey(t,e){return(keyResolvers[e]||(keyResolvers[e]=_getKeyResolver(e)))(t)}function _capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}const defined$1=t=>typeof t<"u",isFunction$3=t=>typeof t=="function",setsEqual=(t,e)=>{if(t.size!==e.size)return!1;for(const a of t)if(!e.has(a))return!1;return!0};function _isClickEvent(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY$5=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=PI*2/3,log10=Math.log10,sign=Math.sign;function almostEquals(t,e,a){return Math.abs(t-e)<a}function niceNum(t){const e=Math.round(t);t=almostEquals(t,e,t/1e3)?e:t;const a=Math.pow(10,Math.floor(log10(t))),n=t/a;return(n<=1?1:n<=2?2:n<=5?5:10)*a}function _factorize(t){const e=[],a=Math.sqrt(t);let n;for(n=1;n<a;n++)t%n===0&&(e.push(n),e.push(t/n));return a===(a|0)&&e.push(a),e.sort((r,i)=>r-i).pop(),e}function isNumber(t){return!isNaN(parseFloat(t))&&isFinite(t)}function almostWhole(t,e){const a=Math.round(t);return a-e<=t&&a+e>=t}function _setMinAndMaxByKey(t,e,a){let n,r,i;for(n=0,r=t.length;n<r;n++)i=t[n][a],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function toRadians(t){return t*(PI/180)}function toDegrees(t){return t*(180/PI)}function _decimalPlaces(t){if(!isNumberFinite(t))return;let e=1,a=0;for(;Math.round(t*e)/e!==t;)e*=10,a++;return a}function getAngleFromPoint(t,e){const a=e.x-t.x,n=e.y-t.y,r=Math.sqrt(a*a+n*n);let i=Math.atan2(n,a);return i<-.5*PI&&(i+=TAU),{angle:i,distance:r}}function distanceBetweenPoints(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _angleDiff(t,e){return(t-e+PITAU)%TAU-PI}function _normalizeAngle(t){return(t%TAU+TAU)%TAU}function _angleBetween(t,e,a,n){const r=_normalizeAngle(t),i=_normalizeAngle(e),o=_normalizeAngle(a),s=_normalizeAngle(i-r),l=_normalizeAngle(o-r),u=_normalizeAngle(r-i),c=_normalizeAngle(r-o);return r===i||r===o||n&&i===o||s>l&&u<c}function _limitValue(t,e,a){return Math.max(e,Math.min(a,t))}function _int16Range(t){return _limitValue(t,-32768,32767)}function _isBetween(t,e,a,n=1e-6){return t>=Math.min(e,a)-n&&t<=Math.max(e,a)+n}function _lookup(t,e,a){a=a||(o=>t[o]<e);let n=t.length-1,r=0,i;for(;n-r>1;)i=r+n>>1,a(i)?r=i:n=i;return{lo:r,hi:n}}const _lookupByKey=(t,e,a,n)=>_lookup(t,a,n?r=>{const i=t[r][e];return i<a||i===a&&t[r+1][e]===a}:r=>t[r][e]<a),_rlookupByKey=(t,e,a)=>_lookup(t,a,n=>t[n][e]>=a);function _filterBetween(t,e,a){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>a;)r--;return n>0||r<t.length?t.slice(n,r):t}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),arrayEvents.forEach(a=>{const n="_onData"+_capitalize(a),r=t[a];Object.defineProperty(t,a,{configurable:!0,enumerable:!1,value(...i){const o=r.apply(this,i);return t._chartjs.listeners.forEach(s=>{typeof s[n]=="function"&&s[n](...i)}),o}})})}function unlistenArrayEvents(t,e){const a=t._chartjs;if(!a)return;const n=a.listeners,r=n.indexOf(e);r!==-1&&n.splice(r,1),!(n.length>0)&&(arrayEvents.forEach(i=>{delete t[i]}),delete t._chartjs)}function _arrayUnique(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const requestAnimFrame=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function throttled(t,e){let a=[],n=!1;return function(...r){a=r,n||(n=!0,requestAnimFrame.call(window,()=>{n=!1,t.apply(e,a)}))}}function debounce(t,e){let a;return function(...n){return e?(clearTimeout(a),a=setTimeout(t,e,n)):t.apply(this,n),e}}const _toLeftRightCenter=t=>t==="start"?"left":t==="end"?"right":"center",_alignStartEnd=(t,e,a)=>t==="start"?e:t==="end"?a:(e+a)/2,_textX=(t,e,a,n)=>t===(n?"left":"right")?a:t==="center"?(e+a)/2:e;function _getStartAndCountOfVisiblePoints(t,e,a){const n=e.length;let r=0,i=n;if(t._sorted){const{iScale:o,_parsed:s}=t,l=o.axis,{min:u,max:c,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(r=_limitValue(Math.min(_lookupByKey(s,l,u).lo,a?n:_lookupByKey(e,l,o.getPixelForValue(u)).lo),0,n-1)),h?i=_limitValue(Math.max(_lookupByKey(s,o.axis,c,!0).hi+1,a?0:_lookupByKey(e,l,o.getPixelForValue(c),!0).hi+1),r,n)-r:i=n-r}return{start:r,count:i}}function _scaleRangesChanged(t){const{xScale:e,yScale:a,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:a.min,ymax:a.max};if(!n)return t._scaleRanges=r,!0;const i=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==a.min||n.ymax!==a.max;return Object.assign(n,r),i}const atEdge=t=>t===0||t===1,elasticIn=(t,e,a)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*TAU/a)),elasticOut=(t,e,a)=>Math.pow(2,-10*t)*Math.sin((t-e)*TAU/a)+1,effects={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=>-Math.cos(t*HALF_PI)+1,easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),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=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic(t){return atEdge(t)?t:t<.5?.5*elasticIn(t*2,.1125,.45):.5+.5*elasticOut(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?effects.easeInBounce(t*2)*.5:effects.easeOutBounce(t*2-1)*.5+.5};function isPatternOrGradient(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function color(t){return isPatternOrGradient(t)?t:new Color(t)}function getHoverColor(t){return isPatternOrGradient(t)?t:new Color(t).saturate(.5).darken(.1).hexString()}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];function applyAnimationsDefaults(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),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:e=>e|0}}}})}function applyLayoutsDefaults(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const intlCache=new Map;function getNumberFormat(t,e){e=e||{};const a=t+JSON.stringify(e);let n=intlCache.get(a);return n||(n=new Intl.NumberFormat(t,e),intlCache.set(a,n)),n}function formatNumber$1(t,e,a){return getNumberFormat(e,a).format(t)}const formatters={values(t){return isArray$c(t)?t:""+t},numeric(t,e,a){if(t===0)return"0";const n=this.chart.options.locale;let r,i=t;if(a.length>1){const u=Math.max(Math.abs(a[0].value),Math.abs(a[a.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),i=calculateDelta(t,a)}const o=log10(Math.abs(i)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),formatNumber$1(t,n,l)},logarithmic(t,e,a){if(t===0)return"0";const n=a[e].significand||t/Math.pow(10,Math.floor(log10(t)));return[1,2,3,5,10,15].includes(n)||e>.8*a.length?formatters.numeric.call(this,t,e,a):""}};function calculateDelta(t,e){let a=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(a)>=1&&t!==Math.floor(t)&&(a=t-Math.floor(t)),a}var Ticks={formatters};function applyScaleDefaults(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,a)=>a.lineWidth,tickColor:(e,a)=>a.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:Ticks.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(t,e){if(!e)return t;const a=e.split(".");for(let n=0,r=a.length;n<r;++n){const i=a[n];t=t[i]||(t[i]=Object.create(null))}return t}function set$2(t,e,a){return typeof e=="string"?merge(getScope$1(t,e),a):merge(getScope$1(t,""),e)}class Defaults{constructor(e,a){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=n=>n.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=(n,r)=>getHoverColor(r.backgroundColor),this.hoverBorderColor=(n,r)=>getHoverColor(r.borderColor),this.hoverColor=(n,r)=>getHoverColor(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(a)}set(e,a){return set$2(this,e,a)}get(e){return getScope$1(this,e)}describe(e,a){return set$2(descriptors,e,a)}override(e,a){return set$2(overrides,e,a)}route(e,a,n,r){const i=getScope$1(this,e),o=getScope$1(this,n),s="_"+a;Object.defineProperties(i,{[s]:{value:i[a],writable:!0},[a]:{enumerable:!0,get(){const l=this[s],u=o[r];return isObject$8(l)?Object.assign({},u,l):valueOrDefault(l,u)},set(l){this[s]=l}}})}apply(e){e.forEach(a=>a(this))}}var defaults=new Defaults({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[applyAnimationsDefaults,applyLayoutsDefaults,applyScaleDefaults]);function toFontString(t){return!t||isNullOrUndef(t.size)||isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function _measureText(t,e,a,n,r){let i=e[r];return i||(i=e[r]=t.measureText(r).width,a.push(r)),i>n&&(n=i),n}function _longestText(t,e,a,n){n=n||{};let r=n.data=n.data||{},i=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},i=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const s=a.length;let l,u,c,d,h;for(l=0;l<s;l++)if(d=a[l],d!=null&&!isArray$c(d))o=_measureText(t,r,i,o,d);else if(isArray$c(d))for(u=0,c=d.length;u<c;u++)h=d[u],h!=null&&!isArray$c(h)&&(o=_measureText(t,r,i,o,h));t.restore();const m=i.length/2;if(m>a.length){for(l=0;l<m;l++)delete r[i[l]];i.splice(0,m)}return o}function _alignPixel(t,e,a){const n=t.currentDevicePixelRatio,r=a!==0?Math.max(a/2,.5):0;return Math.round((e-r)*n)/n+r}function clearCanvas(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function drawPoint(t,e,a,n){drawPointLegend(t,e,a,n,null)}function drawPointLegend(t,e,a,n,r){let i,o,s,l,u,c,d,h;const m=e.pointStyle,p=e.rotation,v=e.radius;let y=(p||0)*RAD_PER_DEG;if(m&&typeof m=="object"&&(i=m.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(a,n),t.rotate(y),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(v)||v<=0)){switch(t.beginPath(),m){default:r?t.ellipse(a,n,r/2,v,0,0,TAU):t.arc(a,n,v,0,TAU),t.closePath();break;case"triangle":c=r?r/2:v,t.moveTo(a+Math.sin(y)*c,n-Math.cos(y)*v),y+=TWO_THIRDS_PI,t.lineTo(a+Math.sin(y)*c,n-Math.cos(y)*v),y+=TWO_THIRDS_PI,t.lineTo(a+Math.sin(y)*c,n-Math.cos(y)*v),t.closePath();break;case"rectRounded":u=v*.516,l=v-u,o=Math.cos(y+QUARTER_PI)*l,d=Math.cos(y+QUARTER_PI)*(r?r/2-u:l),s=Math.sin(y+QUARTER_PI)*l,h=Math.sin(y+QUARTER_PI)*(r?r/2-u:l),t.arc(a-d,n-s,u,y-PI,y-HALF_PI),t.arc(a+h,n-o,u,y-HALF_PI,y),t.arc(a+d,n+s,u,y,y+HALF_PI),t.arc(a-h,n+o,u,y+HALF_PI,y+PI),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*v,c=r?r/2:l,t.rect(a-c,n-l,2*c,2*l);break}y+=QUARTER_PI;case"rectRot":d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+h,n-o),t.lineTo(a+d,n+s),t.lineTo(a-h,n+o),t.closePath();break;case"crossRot":y+=QUARTER_PI;case"cross":d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+d,n+s),t.moveTo(a+h,n-o),t.lineTo(a-h,n+o);break;case"star":d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+d,n+s),t.moveTo(a+h,n-o),t.lineTo(a-h,n+o),y+=QUARTER_PI,d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+d,n+s),t.moveTo(a+h,n-o),t.lineTo(a-h,n+o);break;case"line":o=r?r/2:Math.cos(y)*v,s=Math.sin(y)*v,t.moveTo(a-o,n-s),t.lineTo(a+o,n+s);break;case"dash":t.moveTo(a,n),t.lineTo(a+Math.cos(y)*(r?r/2:v),n+Math.sin(y)*v);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function _isPointInArea(t,e,a){return a=a||.5,!e||t&&t.x>e.left-a&&t.x<e.right+a&&t.y>e.top-a&&t.y<e.bottom+a}function clipArea(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function unclipArea(t){t.restore()}function _steppedLineTo(t,e,a,n,r){if(!e)return t.lineTo(a.x,a.y);if(r==="middle"){const i=(e.x+a.x)/2;t.lineTo(i,e.y),t.lineTo(i,a.y)}else r==="after"!=!!n?t.lineTo(e.x,a.y):t.lineTo(a.x,e.y);t.lineTo(a.x,a.y)}function _bezierCurveTo(t,e,a,n){if(!e)return t.lineTo(a.x,a.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?a.cp2x:a.cp1x,n?a.cp2y:a.cp1y,a.x,a.y)}function setRenderOpts(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),isNullOrUndef(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function decorateText(t,e,a,n,r){if(r.strikethrough||r.underline){const i=t.measureText(n),o=e-i.actualBoundingBoxLeft,s=e+i.actualBoundingBoxRight,l=a-i.actualBoundingBoxAscent,u=a+i.actualBoundingBoxDescent,c=r.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,c),t.lineTo(s,c),t.stroke()}}function drawBackdrop(t,e){const a=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=a}function renderText(t,e,a,n,r,i={}){const o=isArray$c(e)?e:[e],s=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(t.save(),t.font=r.string,setRenderOpts(t,i),l=0;l<o.length;++l)u=o[l],i.backdrop&&drawBackdrop(t,i.backdrop),s&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),isNullOrUndef(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(u,a,n,i.maxWidth)),t.fillText(u,a,n,i.maxWidth),decorateText(t,a,n,u,i),n+=Number(r.lineHeight);t.restore()}function addRoundedRectPath(t,e){const{x:a,y:n,w:r,h:i,radius:o}=e;t.arc(a+o.topLeft,n+o.topLeft,o.topLeft,-HALF_PI,PI,!0),t.lineTo(a,n+i-o.bottomLeft),t.arc(a+o.bottomLeft,n+i-o.bottomLeft,o.bottomLeft,PI,HALF_PI,!0),t.lineTo(a+r-o.bottomRight,n+i),t.arc(a+r-o.bottomRight,n+i-o.bottomRight,o.bottomRight,HALF_PI,0,!0),t.lineTo(a+r,n+o.topRight),t.arc(a+r-o.topRight,n+o.topRight,o.topRight,0,-HALF_PI,!0),t.lineTo(a+o.topLeft,n)}const LINE_HEIGHT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FONT_STYLE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function toLineHeight(t,e){const a=(""+t).match(LINE_HEIGHT);if(!a||a[1]==="normal")return e*1.2;switch(t=+a[2],a[3]){case"px":return t;case"%":t/=100;break}return e*t}const numberOrZero=t=>+t||0;function _readValueToProps(t,e){const a={},n=isObject$8(e),r=n?Object.keys(e):e,i=isObject$8(t)?n?o=>valueOrDefault(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of r)a[o]=numberOrZero(i(o));return a}function toTRBL(t){return _readValueToProps(t,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(t){return _readValueToProps(t,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(t){const e=toTRBL(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function toFont(t,e){t=t||{},e=e||defaults.font;let a=valueOrDefault(t.size,e.size);typeof a=="string"&&(a=parseInt(a,10));let n=valueOrDefault(t.style,e.style);n&&!(""+n).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:valueOrDefault(t.family,e.family),lineHeight:toLineHeight(valueOrDefault(t.lineHeight,e.lineHeight),a),size:a,style:n,weight:valueOrDefault(t.weight,e.weight),string:""};return r.string=toFontString(r),r}function resolve(t,e,a,n){let r=!0,i,o,s;for(i=0,o=t.length;i<o;++i)if(s=t[i],s!==void 0&&(e!==void 0&&typeof s=="function"&&(s=s(e),r=!1),a!==void 0&&isArray$c(s)&&(s=s[a%s.length],r=!1),s!==void 0))return n&&!r&&(n.cacheable=!1),s}function _addGrace(t,e,a){const{min:n,max:r}=t,i=toDimension(e,(r-n)/2),o=(s,l)=>a&&s===0?0:s+l;return{min:o(n,-Math.abs(i)),max:o(r,i)}}function createContext(t,e){return Object.assign(Object.create(t),e)}function _createResolver(t,e=[""],a,n,r=()=>t[0]){const i=a||t;typeof n>"u"&&(n=_resolve("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:s=>_createResolver([s,...t],e,i,n)};return new Proxy(o,{deleteProperty(s,l){return delete s[l],delete s._keys,delete t[0][l],!0},get(s,l){return _cached(s,l,()=>_resolveWithPrefixes(l,e,t,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(s,l){return getKeysFromAllScopes(s).includes(l)},ownKeys(s){return getKeysFromAllScopes(s)},set(s,l,u){const c=s._storage||(s._storage=r());return s[l]=c[l]=u,delete s._keys,!0}})}function _attachContext(t,e,a,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:a,_stack:new Set,_descriptors:_descriptors(t,n),setContext:i=>_attachContext(t,i,a,n),override:i=>_attachContext(t.override(i),e,a,n)};return new Proxy(r,{deleteProperty(i,o){return delete i[o],delete t[o],!0},get(i,o,s){return _cached(i,o,()=>_resolveWithContext(i,o,s))},getOwnPropertyDescriptor(i,o){return i._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(i,o,s){return t[o]=s,delete i[o],!0}})}function _descriptors(t,e={scriptable:!0,indexable:!0}){const{_scriptable:a=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:a,indexable:n,isScriptable:isFunction$3(a)?a:()=>a,isIndexable:isFunction$3(n)?n:()=>n}}const readKey=(t,e)=>t?t+_capitalize(e):e,needsSubResolver=(t,e)=>isObject$8(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function _cached(t,e,a){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=a();return t[e]=n,n}function _resolveWithContext(t,e,a){const{_proxy:n,_context:r,_subProxy:i,_descriptors:o}=t;let s=n[e];return isFunction$3(s)&&o.isScriptable(e)&&(s=_resolveScriptable(e,s,t,a)),isArray$c(s)&&s.length&&(s=_resolveArray(e,s,t,o.isIndexable)),needsSubResolver(e,s)&&(s=_attachContext(s,r,i&&i[e],o)),s}function _resolveScriptable(t,e,a,n){const{_proxy:r,_context:i,_subProxy:o,_stack:s}=a;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(i,o||n);return s.delete(t),needsSubResolver(t,l)&&(l=createSubResolver(r._scopes,r,t,l)),l}function _resolveArray(t,e,a,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=a;if(typeof i.index<"u"&&n(t))return e[i.index%e.length];if(isObject$8(e[0])){const l=e,u=r._scopes.filter(c=>c!==l);e=[];for(const c of l){const d=createSubResolver(u,r,t,c);e.push(_attachContext(d,i,o&&o[t],s))}}return e}function resolveFallback(t,e,a){return isFunction$3(t)?t(e,a):t}const getScope=(t,e)=>t===!0?e:typeof t=="string"?resolveObjectKey(e,t):void 0;function addScopes(t,e,a,n,r){for(const i of e){const o=getScope(a,i);if(o){t.add(o);const s=resolveFallback(o._fallback,a,r);if(typeof s<"u"&&s!==a&&s!==n)return s}else if(o===!1&&typeof n<"u"&&a!==n)return null}return!1}function createSubResolver(t,e,a,n){const r=e._rootScopes,i=resolveFallback(e._fallback,a,n),o=[...t,...r],s=new Set;s.add(n);let l=addScopesFromKey(s,o,a,i||a,n);return l===null||typeof i<"u"&&i!==a&&(l=addScopesFromKey(s,o,i,l,n),l===null)?!1:_createResolver(Array.from(s),[""],r,i,()=>subGetTarget(e,a,n))}function addScopesFromKey(t,e,a,n,r){for(;a;)a=addScopes(t,e,a,n,r);return a}function subGetTarget(t,e,a){const n=t._getTarget();e in n||(n[e]={});const r=n[e];return isArray$c(r)&&isObject$8(a)?a:r||{}}function _resolveWithPrefixes(t,e,a,n){let r;for(const i of e)if(r=_resolve(readKey(i,t),a),typeof r<"u")return needsSubResolver(t,r)?createSubResolver(a,n,t,r):r}function _resolve(t,e){for(const a of e){if(!a)continue;const n=a[t];if(typeof n<"u")return n}}function getKeysFromAllScopes(t){let e=t._keys;return e||(e=t._keys=resolveKeysFromAllScopes(t._scopes)),e}function resolveKeysFromAllScopes(t){const e=new Set;for(const a of t)for(const n of Object.keys(a).filter(r=>!r.startsWith("_")))e.add(n);return Array.from(e)}function _parseObjectDataRadialScale(t,e,a,n){const{iScale:r}=t,{key:i="r"}=this._parsing,o=new Array(n);let s,l,u,c;for(s=0,l=n;s<l;++s)u=s+a,c=e[u],o[s]={r:r.parse(resolveObjectKey(c,i),u)};return o}const EPSILON=Number.EPSILON||1e-14,getPoint=(t,e)=>e<t.length&&!t[e].skip&&t[e],getValueAxis=t=>t==="x"?"y":"x";function splineCurve(t,e,a,n){const r=t.skip?e:t,i=e,o=a.skip?e:a,s=distanceBetweenPoints(i,r),l=distanceBetweenPoints(o,i);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=n*u,h=n*c;return{previous:{x:i.x-d*(o.x-r.x),y:i.y-d*(o.y-r.y)},next:{x:i.x+h*(o.x-r.x),y:i.y+h*(o.y-r.y)}}}function monotoneAdjust(t,e,a){const n=t.length;let r,i,o,s,l,u=getPoint(t,0);for(let c=0;c<n-1;++c)if(l=u,u=getPoint(t,c+1),!(!l||!u)){if(almostEquals(e[c],0,EPSILON)){a[c]=a[c+1]=0;continue}r=a[c]/e[c],i=a[c+1]/e[c],s=Math.pow(r,2)+Math.pow(i,2),!(s<=9)&&(o=3/Math.sqrt(s),a[c]=r*o*e[c],a[c+1]=i*o*e[c])}}function monotoneCompute(t,e,a="x"){const n=getValueAxis(a),r=t.length;let i,o,s,l=getPoint(t,0);for(let u=0;u<r;++u){if(o=s,s=l,l=getPoint(t,u+1),!s)continue;const c=s[a],d=s[n];o&&(i=(c-o[a])/3,s[`cp1${a}`]=c-i,s[`cp1${n}`]=d-i*e[u]),l&&(i=(l[a]-c)/3,s[`cp2${a}`]=c+i,s[`cp2${n}`]=d+i*e[u])}}function splineCurveMonotone(t,e="x"){const a=getValueAxis(e),n=t.length,r=Array(n).fill(0),i=Array(n);let o,s,l,u=getPoint(t,0);for(o=0;o<n;++o)if(s=l,l=u,u=getPoint(t,o+1),!!l){if(u){const c=u[e]-l[e];r[o]=c!==0?(u[a]-l[a])/c:0}i[o]=s?u?sign(r[o-1])!==sign(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}monotoneAdjust(t,r,i),monotoneCompute(t,i,e)}function capControlPoint(t,e,a){return Math.max(Math.min(t,a),e)}function capBezierPoints(t,e){let a,n,r,i,o,s=_isPointInArea(t[0],e);for(a=0,n=t.length;a<n;++a)o=i,i=s,s=a<n-1&&_isPointInArea(t[a+1],e),i&&(r=t[a],o&&(r.cp1x=capControlPoint(r.cp1x,e.left,e.right),r.cp1y=capControlPoint(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=capControlPoint(r.cp2x,e.left,e.right),r.cp2y=capControlPoint(r.cp2y,e.top,e.bottom)))}function _updateBezierControlPoints(t,e,a,n,r){let i,o,s,l;if(e.spanGaps&&(t=t.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")splineCurveMonotone(t,r);else{let u=n?t[t.length-1]:t[0];for(i=0,o=t.length;i<o;++i)s=t[i],l=splineCurve(u,s,t[Math.min(i+1,o-(n?0:1))%o],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,u=s}e.capBezierPoints&&capBezierPoints(t,a)}function _isDomSupported(){return typeof window<"u"&&typeof document<"u"}function _getParentNode(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function parseMaxStyle(t,e,a){let n;return typeof t=="string"?(n=parseInt(t,10),t.indexOf("%")!==-1&&(n=n/100*e.parentNode[a])):n=t,n}const getComputedStyle$1=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function getStyle(t,e){return getComputedStyle$1(t).getPropertyValue(e)}const positions=["top","right","bottom","left"];function getPositionedStyle(t,e,a){const n={};a=a?"-"+a:"";for(let r=0;r<4;r++){const i=positions[r];n[i]=parseFloat(t[e+"-"+i+a])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const useOffsetPos=(t,e,a)=>(t>0||e>0)&&(!a||!a.shadowRoot);function getCanvasPosition(t,e){const a=t.touches,n=a&&a.length?a[0]:t,{offsetX:r,offsetY:i}=n;let o=!1,s,l;if(useOffsetPos(r,i,t.target))s=r,l=i;else{const u=e.getBoundingClientRect();s=n.clientX-u.left,l=n.clientY-u.top,o=!0}return{x:s,y:l,box:o}}function getRelativePosition(t,e){if("native"in t)return t;const{canvas:a,currentDevicePixelRatio:n}=e,r=getComputedStyle$1(a),i=r.boxSizing==="border-box",o=getPositionedStyle(r,"padding"),s=getPositionedStyle(r,"border","width"),{x:l,y:u,box:c}=getCanvasPosition(t,a),d=o.left+(c&&s.left),h=o.top+(c&&s.top);let{width:m,height:p}=e;return i&&(m-=o.width+s.width,p-=o.height+s.height),{x:Math.round((l-d)/m*a.width/n),y:Math.round((u-h)/p*a.height/n)}}function getContainerSize(t,e,a){let n,r;if(e===void 0||a===void 0){const i=_getParentNode(t);if(!i)e=t.clientWidth,a=t.clientHeight;else{const o=i.getBoundingClientRect(),s=getComputedStyle$1(i),l=getPositionedStyle(s,"border","width"),u=getPositionedStyle(s,"padding");e=o.width-u.width-l.width,a=o.height-u.height-l.height,n=parseMaxStyle(s.maxWidth,i,"clientWidth"),r=parseMaxStyle(s.maxHeight,i,"clientHeight")}}return{width:e,height:a,maxWidth:n||INFINITY$5,maxHeight:r||INFINITY$5}}const round1=t=>Math.round(t*10)/10;function getMaximumSize(t,e,a,n){const r=getComputedStyle$1(t),i=getPositionedStyle(r,"margin"),o=parseMaxStyle(r.maxWidth,t,"clientWidth")||INFINITY$5,s=parseMaxStyle(r.maxHeight,t,"clientHeight")||INFINITY$5,l=getContainerSize(t,e,a);let{width:u,height:c}=l;if(r.boxSizing==="content-box"){const h=getPositionedStyle(r,"border","width"),m=getPositionedStyle(r,"padding");u-=m.width+h.width,c-=m.height+h.height}return u=Math.max(0,u-i.width),c=Math.max(0,n?u/n:c-i.height),u=round1(Math.min(u,o,l.maxWidth)),c=round1(Math.min(c,s,l.maxHeight)),u&&!c&&(c=round1(u/2)),(e!==void 0||a!==void 0)&&n&&l.height&&c>l.height&&(c=l.height,u=round1(Math.floor(c*n))),{width:u,height:c}}function retinaScale(t,e,a){const n=e||1,r=Math.floor(t.height*n),i=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(a||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==n||o.height!==r||o.width!==i?(t.currentDevicePixelRatio=n,o.height=r,o.width=i,t.ctx.setTransform(n,0,0,n,0,0),!0):!1}const supportsEventListenerOptions=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return t}();function readUsedSize(t,e){const a=getStyle(t,e),n=a&&a.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function _pointInLine(t,e,a,n){return{x:t.x+a*(e.x-t.x),y:t.y+a*(e.y-t.y)}}function _steppedInterpolation(t,e,a,n){return{x:t.x+a*(e.x-t.x),y:n==="middle"?a<.5?t.y:e.y:n==="after"?a<1?t.y:e.y:a>0?e.y:t.y}}function _bezierInterpolation(t,e,a,n){const r={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},o=_pointInLine(t,r,a),s=_pointInLine(r,i,a),l=_pointInLine(i,e,a),u=_pointInLine(o,s,a),c=_pointInLine(s,l,a);return _pointInLine(u,c,a)}const getRightToLeftAdapter=function(t,e){return{x(a){return t+t+e-a},setWidth(a){e=a},textAlign(a){return a==="center"?a:a==="right"?"left":"right"},xPlus(a,n){return a-n},leftForLtr(a,n){return a-n}}},getLeftToRightAdapter=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function getRtlAdapter(t,e,a){return t?getRightToLeftAdapter(e,a):getLeftToRightAdapter()}function overrideTextDirection(t,e){let a,n;(e==="ltr"||e==="rtl")&&(a=t.canvas.style,n=[a.getPropertyValue("direction"),a.getPropertyPriority("direction")],a.setProperty("direction",e,"important"),t.prevTextDirection=n)}function restoreTextDirection(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function propertyFn(t){return t==="angle"?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(e,a)=>e-a,normalize:e=>e}}function normalizeSegment({start:t,end:e,count:a,loop:n,style:r}){return{start:t%a,end:e%a,loop:n&&(e-t+1)%a===0,style:r}}function getSegment(t,e,a){const{property:n,start:r,end:i}=a,{between:o,normalize:s}=propertyFn(n),l=e.length;let{start:u,end:c,loop:d}=t,h,m;if(d){for(u+=l,c+=l,h=0,m=l;h<m&&o(s(e[u%l][n]),r,i);++h)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:d,style:t.style}}function _boundSegment(t,e,a){if(!a)return[t];const{property:n,start:r,end:i}=a,o=e.length,{compare:s,between:l,normalize:u}=propertyFn(n),{start:c,end:d,loop:h,style:m}=getSegment(t,e,a),p=[];let v=!1,y=null,w,_,D;const k=()=>l(r,D,w)&&s(r,D)!==0,O=()=>s(i,w)===0||l(i,D,w),N=()=>v||k(),F=()=>!v||O();for(let g=c,b=c;g<=d;++g)_=e[g%o],!_.skip&&(w=u(_[n]),w!==D&&(v=l(w,r,i),y===null&&N()&&(y=s(w,r)===0?g:b),y!==null&&F()&&(p.push(normalizeSegment({start:y,end:g,loop:h,count:o,style:m})),y=null),b=g,D=w));return y!==null&&p.push(normalizeSegment({start:y,end:d,loop:h,count:o,style:m})),p}function _boundSegments(t,e){const a=[],n=t.segments;for(let r=0;r<n.length;r++){const i=_boundSegment(n[r],t.points,e);i.length&&a.push(...i)}return a}function findStartAndEnd(t,e,a,n){let r=0,i=e-1;if(a&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,a&&(i+=r);i>r&&t[i%e].skip;)i--;return i%=e,{start:r,end:i}}function solidSegments(t,e,a,n){const r=t.length,i=[];let o=e,s=t[e],l;for(l=e+1;l<=a;++l){const u=t[l%r];u.skip||u.stop?s.skip||(n=!1,i.push({start:e%r,end:(l-1)%r,loop:n}),e=o=u.stop?l:null):(o=l,s.skip&&(e=l)),s=u}return o!==null&&i.push({start:e%r,end:o%r,loop:n}),i}function _computeSegments(t,e){const a=t.points,n=t.options.spanGaps,r=a.length;if(!r)return[];const i=!!t._loop,{start:o,end:s}=findStartAndEnd(a,r,i,n);if(n===!0)return splitByStyles(t,[{start:o,end:s,loop:i}],a,e);const l=s<o?s+r:s,u=!!t._fullLoop&&o===0&&s===r-1;return splitByStyles(t,solidSegments(a,o,l,u),a,e)}function splitByStyles(t,e,a,n){return!n||!n.setContext||!a?e:doSplitByStyles(t,e,a,n)}function doSplitByStyles(t,e,a,n){const r=t._chart.getContext(),i=readStyle(t.options),{_datasetIndex:o,options:{spanGaps:s}}=t,l=a.length,u=[];let c=i,d=e[0].start,h=d;function m(p,v,y,w){const _=s?-1:1;if(p!==v){for(p+=l;a[p%l].skip;)p-=_;for(;a[v%l].skip;)v+=_;p%l!==v%l&&(u.push({start:p%l,end:v%l,loop:y,style:w}),c=w,d=v%l)}}for(const p of e){d=s?d:p.start;let v=a[d%l],y;for(h=d+1;h<=p.end;h++){const w=a[h%l];y=readStyle(n.setContext(createContext(r,{type:"segment",p0:v,p1:w,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),styleChanged(y,c)&&m(d,h-1,p.loop,c),v=w,c=y}d<h-1&&m(d,h-1,p.loop,c)}return u}function readStyle(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function styleChanged(t,e){if(!e)return!1;const a=[],n=function(r,i){return isPatternOrGradient(i)?(a.includes(i)||a.push(i),a.indexOf(i)):i};return JSON.stringify(t,n)!==JSON.stringify(e,n)}/*!
- * Chart.js v4.3.3
+ */function noop$2(){}const uid=(()=>{let t=0;return()=>t++})();function isNullOrUndef(t){return t===null||typeof t>"u"}function isArray$c(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function isObject$8(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function isNumberFinite(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function finiteOrDefault(t,e){return isNumberFinite(t)?t:e}function valueOrDefault(t,e){return typeof t>"u"?e:t}const toPercentage=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,toDimension=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function callback(t,e,a){if(t&&typeof t.call=="function")return t.apply(a,e)}function each(t,e,a,n){let r,i,o;if(isArray$c(t))if(i=t.length,n)for(r=i-1;r>=0;r--)e.call(a,t[r],r);else for(r=0;r<i;r++)e.call(a,t[r],r);else if(isObject$8(t))for(o=Object.keys(t),i=o.length,r=0;r<i;r++)e.call(a,t[o[r]],o[r])}function _elementsEqual(t,e){let a,n,r,i;if(!t||!e||t.length!==e.length)return!1;for(a=0,n=t.length;a<n;++a)if(r=t[a],i=e[a],r.datasetIndex!==i.datasetIndex||r.index!==i.index)return!1;return!0}function clone$1(t){if(isArray$c(t))return t.map(clone$1);if(isObject$8(t)){const e=Object.create(null),a=Object.keys(t),n=a.length;let r=0;for(;r<n;++r)e[a[r]]=clone$1(t[a[r]]);return e}return t}function isValidKey(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function _merger(t,e,a,n){if(!isValidKey(t))return;const r=e[t],i=a[t];isObject$8(r)&&isObject$8(i)?merge(r,i,n):e[t]=clone$1(i)}function merge(t,e,a){const n=isArray$c(e)?e:[e],r=n.length;if(!isObject$8(t))return t;a=a||{};const i=a.merger||_merger;let o;for(let s=0;s<r;++s){if(o=n[s],!isObject$8(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)i(l[u],t,o,a)}return t}function mergeIf(t,e){return merge(t,e,{merger:_mergerIf})}function _mergerIf(t,e,a){if(!isValidKey(t))return;const n=e[t],r=a[t];isObject$8(n)&&isObject$8(r)?mergeIf(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=clone$1(r))}const keyResolvers={"":t=>t,x:t=>t.x,y:t=>t.y};function _splitKey(t){const e=t.split("."),a=[];let n="";for(const r of e)n+=r,n.endsWith("\\")?n=n.slice(0,-1)+".":(a.push(n),n="");return a}function _getKeyResolver(t){const e=_splitKey(t);return a=>{for(const n of e){if(n==="")break;a=a&&a[n]}return a}}function resolveObjectKey(t,e){return(keyResolvers[e]||(keyResolvers[e]=_getKeyResolver(e)))(t)}function _capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}const defined$1=t=>typeof t<"u",isFunction$3=t=>typeof t=="function",setsEqual=(t,e)=>{if(t.size!==e.size)return!1;for(const a of t)if(!e.has(a))return!1;return!0};function _isClickEvent(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY$5=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=PI*2/3,log10=Math.log10,sign=Math.sign;function almostEquals(t,e,a){return Math.abs(t-e)<a}function niceNum(t){const e=Math.round(t);t=almostEquals(t,e,t/1e3)?e:t;const a=Math.pow(10,Math.floor(log10(t))),n=t/a;return(n<=1?1:n<=2?2:n<=5?5:10)*a}function _factorize(t){const e=[],a=Math.sqrt(t);let n;for(n=1;n<a;n++)t%n===0&&(e.push(n),e.push(t/n));return a===(a|0)&&e.push(a),e.sort((r,i)=>r-i).pop(),e}function isNumber(t){return!isNaN(parseFloat(t))&&isFinite(t)}function almostWhole(t,e){const a=Math.round(t);return a-e<=t&&a+e>=t}function _setMinAndMaxByKey(t,e,a){let n,r,i;for(n=0,r=t.length;n<r;n++)i=t[n][a],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function toRadians(t){return t*(PI/180)}function toDegrees(t){return t*(180/PI)}function _decimalPlaces(t){if(!isNumberFinite(t))return;let e=1,a=0;for(;Math.round(t*e)/e!==t;)e*=10,a++;return a}function getAngleFromPoint(t,e){const a=e.x-t.x,n=e.y-t.y,r=Math.sqrt(a*a+n*n);let i=Math.atan2(n,a);return i<-.5*PI&&(i+=TAU),{angle:i,distance:r}}function distanceBetweenPoints(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _angleDiff(t,e){return(t-e+PITAU)%TAU-PI}function _normalizeAngle(t){return(t%TAU+TAU)%TAU}function _angleBetween(t,e,a,n){const r=_normalizeAngle(t),i=_normalizeAngle(e),o=_normalizeAngle(a),s=_normalizeAngle(i-r),l=_normalizeAngle(o-r),u=_normalizeAngle(r-i),c=_normalizeAngle(r-o);return r===i||r===o||n&&i===o||s>l&&u<c}function _limitValue(t,e,a){return Math.max(e,Math.min(a,t))}function _int16Range(t){return _limitValue(t,-32768,32767)}function _isBetween(t,e,a,n=1e-6){return t>=Math.min(e,a)-n&&t<=Math.max(e,a)+n}function _lookup(t,e,a){a=a||(o=>t[o]<e);let n=t.length-1,r=0,i;for(;n-r>1;)i=r+n>>1,a(i)?r=i:n=i;return{lo:r,hi:n}}const _lookupByKey=(t,e,a,n)=>_lookup(t,a,n?r=>{const i=t[r][e];return i<a||i===a&&t[r+1][e]===a}:r=>t[r][e]<a),_rlookupByKey=(t,e,a)=>_lookup(t,a,n=>t[n][e]>=a);function _filterBetween(t,e,a){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>a;)r--;return n>0||r<t.length?t.slice(n,r):t}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),arrayEvents.forEach(a=>{const n="_onData"+_capitalize(a),r=t[a];Object.defineProperty(t,a,{configurable:!0,enumerable:!1,value(...i){const o=r.apply(this,i);return t._chartjs.listeners.forEach(s=>{typeof s[n]=="function"&&s[n](...i)}),o}})})}function unlistenArrayEvents(t,e){const a=t._chartjs;if(!a)return;const n=a.listeners,r=n.indexOf(e);r!==-1&&n.splice(r,1),!(n.length>0)&&(arrayEvents.forEach(i=>{delete t[i]}),delete t._chartjs)}function _arrayUnique(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const requestAnimFrame=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function throttled(t,e){let a=[],n=!1;return function(...r){a=r,n||(n=!0,requestAnimFrame.call(window,()=>{n=!1,t.apply(e,a)}))}}function debounce(t,e){let a;return function(...n){return e?(clearTimeout(a),a=setTimeout(t,e,n)):t.apply(this,n),e}}const _toLeftRightCenter=t=>t==="start"?"left":t==="end"?"right":"center",_alignStartEnd=(t,e,a)=>t==="start"?e:t==="end"?a:(e+a)/2,_textX=(t,e,a,n)=>t===(n?"left":"right")?a:t==="center"?(e+a)/2:e;function _getStartAndCountOfVisiblePoints(t,e,a){const n=e.length;let r=0,i=n;if(t._sorted){const{iScale:o,_parsed:s}=t,l=o.axis,{min:u,max:c,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(r=_limitValue(Math.min(_lookupByKey(s,l,u).lo,a?n:_lookupByKey(e,l,o.getPixelForValue(u)).lo),0,n-1)),h?i=_limitValue(Math.max(_lookupByKey(s,o.axis,c,!0).hi+1,a?0:_lookupByKey(e,l,o.getPixelForValue(c),!0).hi+1),r,n)-r:i=n-r}return{start:r,count:i}}function _scaleRangesChanged(t){const{xScale:e,yScale:a,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:a.min,ymax:a.max};if(!n)return t._scaleRanges=r,!0;const i=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==a.min||n.ymax!==a.max;return Object.assign(n,r),i}const atEdge=t=>t===0||t===1,elasticIn=(t,e,a)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*TAU/a)),elasticOut=(t,e,a)=>Math.pow(2,-10*t)*Math.sin((t-e)*TAU/a)+1,effects={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=>-Math.cos(t*HALF_PI)+1,easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),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=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic(t){return atEdge(t)?t:t<.5?.5*elasticIn(t*2,.1125,.45):.5+.5*elasticOut(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?effects.easeInBounce(t*2)*.5:effects.easeOutBounce(t*2-1)*.5+.5};function isPatternOrGradient(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function color(t){return isPatternOrGradient(t)?t:new Color(t)}function getHoverColor(t){return isPatternOrGradient(t)?t:new Color(t).saturate(.5).darken(.1).hexString()}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];function applyAnimationsDefaults(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),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:e=>e|0}}}})}function applyLayoutsDefaults(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const intlCache=new Map;function getNumberFormat(t,e){e=e||{};const a=t+JSON.stringify(e);let n=intlCache.get(a);return n||(n=new Intl.NumberFormat(t,e),intlCache.set(a,n)),n}function formatNumber$1(t,e,a){return getNumberFormat(e,a).format(t)}const formatters={values(t){return isArray$c(t)?t:""+t},numeric(t,e,a){if(t===0)return"0";const n=this.chart.options.locale;let r,i=t;if(a.length>1){const u=Math.max(Math.abs(a[0].value),Math.abs(a[a.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),i=calculateDelta(t,a)}const o=log10(Math.abs(i)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),formatNumber$1(t,n,l)},logarithmic(t,e,a){if(t===0)return"0";const n=a[e].significand||t/Math.pow(10,Math.floor(log10(t)));return[1,2,3,5,10,15].includes(n)||e>.8*a.length?formatters.numeric.call(this,t,e,a):""}};function calculateDelta(t,e){let a=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(a)>=1&&t!==Math.floor(t)&&(a=t-Math.floor(t)),a}var Ticks={formatters};function applyScaleDefaults(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:(e,a)=>a.lineWidth,tickColor:(e,a)=>a.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:Ticks.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(t,e){if(!e)return t;const a=e.split(".");for(let n=0,r=a.length;n<r;++n){const i=a[n];t=t[i]||(t[i]=Object.create(null))}return t}function set$2(t,e,a){return typeof e=="string"?merge(getScope$1(t,e),a):merge(getScope$1(t,""),e)}class Defaults{constructor(e,a){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=n=>n.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=(n,r)=>getHoverColor(r.backgroundColor),this.hoverBorderColor=(n,r)=>getHoverColor(r.borderColor),this.hoverColor=(n,r)=>getHoverColor(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(a)}set(e,a){return set$2(this,e,a)}get(e){return getScope$1(this,e)}describe(e,a){return set$2(descriptors,e,a)}override(e,a){return set$2(overrides,e,a)}route(e,a,n,r){const i=getScope$1(this,e),o=getScope$1(this,n),s="_"+a;Object.defineProperties(i,{[s]:{value:i[a],writable:!0},[a]:{enumerable:!0,get(){const l=this[s],u=o[r];return isObject$8(l)?Object.assign({},u,l):valueOrDefault(l,u)},set(l){this[s]=l}}})}apply(e){e.forEach(a=>a(this))}}var defaults=new Defaults({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[applyAnimationsDefaults,applyLayoutsDefaults,applyScaleDefaults]);function toFontString(t){return!t||isNullOrUndef(t.size)||isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function _measureText(t,e,a,n,r){let i=e[r];return i||(i=e[r]=t.measureText(r).width,a.push(r)),i>n&&(n=i),n}function _longestText(t,e,a,n){n=n||{};let r=n.data=n.data||{},i=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},i=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const s=a.length;let l,u,c,d,h;for(l=0;l<s;l++)if(d=a[l],d!=null&&!isArray$c(d))o=_measureText(t,r,i,o,d);else if(isArray$c(d))for(u=0,c=d.length;u<c;u++)h=d[u],h!=null&&!isArray$c(h)&&(o=_measureText(t,r,i,o,h));t.restore();const m=i.length/2;if(m>a.length){for(l=0;l<m;l++)delete r[i[l]];i.splice(0,m)}return o}function _alignPixel(t,e,a){const n=t.currentDevicePixelRatio,r=a!==0?Math.max(a/2,.5):0;return Math.round((e-r)*n)/n+r}function clearCanvas(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function drawPoint(t,e,a,n){drawPointLegend(t,e,a,n,null)}function drawPointLegend(t,e,a,n,r){let i,o,s,l,u,c,d,h;const m=e.pointStyle,p=e.rotation,v=e.radius;let y=(p||0)*RAD_PER_DEG;if(m&&typeof m=="object"&&(i=m.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(a,n),t.rotate(y),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(v)||v<=0)){switch(t.beginPath(),m){default:r?t.ellipse(a,n,r/2,v,0,0,TAU):t.arc(a,n,v,0,TAU),t.closePath();break;case"triangle":c=r?r/2:v,t.moveTo(a+Math.sin(y)*c,n-Math.cos(y)*v),y+=TWO_THIRDS_PI,t.lineTo(a+Math.sin(y)*c,n-Math.cos(y)*v),y+=TWO_THIRDS_PI,t.lineTo(a+Math.sin(y)*c,n-Math.cos(y)*v),t.closePath();break;case"rectRounded":u=v*.516,l=v-u,o=Math.cos(y+QUARTER_PI)*l,d=Math.cos(y+QUARTER_PI)*(r?r/2-u:l),s=Math.sin(y+QUARTER_PI)*l,h=Math.sin(y+QUARTER_PI)*(r?r/2-u:l),t.arc(a-d,n-s,u,y-PI,y-HALF_PI),t.arc(a+h,n-o,u,y-HALF_PI,y),t.arc(a+d,n+s,u,y,y+HALF_PI),t.arc(a-h,n+o,u,y+HALF_PI,y+PI),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*v,c=r?r/2:l,t.rect(a-c,n-l,2*c,2*l);break}y+=QUARTER_PI;case"rectRot":d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+h,n-o),t.lineTo(a+d,n+s),t.lineTo(a-h,n+o),t.closePath();break;case"crossRot":y+=QUARTER_PI;case"cross":d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+d,n+s),t.moveTo(a+h,n-o),t.lineTo(a-h,n+o);break;case"star":d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+d,n+s),t.moveTo(a+h,n-o),t.lineTo(a-h,n+o),y+=QUARTER_PI,d=Math.cos(y)*(r?r/2:v),o=Math.cos(y)*v,s=Math.sin(y)*v,h=Math.sin(y)*(r?r/2:v),t.moveTo(a-d,n-s),t.lineTo(a+d,n+s),t.moveTo(a+h,n-o),t.lineTo(a-h,n+o);break;case"line":o=r?r/2:Math.cos(y)*v,s=Math.sin(y)*v,t.moveTo(a-o,n-s),t.lineTo(a+o,n+s);break;case"dash":t.moveTo(a,n),t.lineTo(a+Math.cos(y)*(r?r/2:v),n+Math.sin(y)*v);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function _isPointInArea(t,e,a){return a=a||.5,!e||t&&t.x>e.left-a&&t.x<e.right+a&&t.y>e.top-a&&t.y<e.bottom+a}function clipArea(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function unclipArea(t){t.restore()}function _steppedLineTo(t,e,a,n,r){if(!e)return t.lineTo(a.x,a.y);if(r==="middle"){const i=(e.x+a.x)/2;t.lineTo(i,e.y),t.lineTo(i,a.y)}else r==="after"!=!!n?t.lineTo(e.x,a.y):t.lineTo(a.x,e.y);t.lineTo(a.x,a.y)}function _bezierCurveTo(t,e,a,n){if(!e)return t.lineTo(a.x,a.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?a.cp2x:a.cp1x,n?a.cp2y:a.cp1y,a.x,a.y)}function setRenderOpts(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),isNullOrUndef(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function decorateText(t,e,a,n,r){if(r.strikethrough||r.underline){const i=t.measureText(n),o=e-i.actualBoundingBoxLeft,s=e+i.actualBoundingBoxRight,l=a-i.actualBoundingBoxAscent,u=a+i.actualBoundingBoxDescent,c=r.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,c),t.lineTo(s,c),t.stroke()}}function drawBackdrop(t,e){const a=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=a}function renderText(t,e,a,n,r,i={}){const o=isArray$c(e)?e:[e],s=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(t.save(),t.font=r.string,setRenderOpts(t,i),l=0;l<o.length;++l)u=o[l],i.backdrop&&drawBackdrop(t,i.backdrop),s&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),isNullOrUndef(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(u,a,n,i.maxWidth)),t.fillText(u,a,n,i.maxWidth),decorateText(t,a,n,u,i),n+=Number(r.lineHeight);t.restore()}function addRoundedRectPath(t,e){const{x:a,y:n,w:r,h:i,radius:o}=e;t.arc(a+o.topLeft,n+o.topLeft,o.topLeft,1.5*PI,PI,!0),t.lineTo(a,n+i-o.bottomLeft),t.arc(a+o.bottomLeft,n+i-o.bottomLeft,o.bottomLeft,PI,HALF_PI,!0),t.lineTo(a+r-o.bottomRight,n+i),t.arc(a+r-o.bottomRight,n+i-o.bottomRight,o.bottomRight,HALF_PI,0,!0),t.lineTo(a+r,n+o.topRight),t.arc(a+r-o.topRight,n+o.topRight,o.topRight,0,-HALF_PI,!0),t.lineTo(a+o.topLeft,n)}const LINE_HEIGHT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FONT_STYLE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function toLineHeight(t,e){const a=(""+t).match(LINE_HEIGHT);if(!a||a[1]==="normal")return e*1.2;switch(t=+a[2],a[3]){case"px":return t;case"%":t/=100;break}return e*t}const numberOrZero=t=>+t||0;function _readValueToProps(t,e){const a={},n=isObject$8(e),r=n?Object.keys(e):e,i=isObject$8(t)?n?o=>valueOrDefault(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of r)a[o]=numberOrZero(i(o));return a}function toTRBL(t){return _readValueToProps(t,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(t){return _readValueToProps(t,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(t){const e=toTRBL(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function toFont(t,e){t=t||{},e=e||defaults.font;let a=valueOrDefault(t.size,e.size);typeof a=="string"&&(a=parseInt(a,10));let n=valueOrDefault(t.style,e.style);n&&!(""+n).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:valueOrDefault(t.family,e.family),lineHeight:toLineHeight(valueOrDefault(t.lineHeight,e.lineHeight),a),size:a,style:n,weight:valueOrDefault(t.weight,e.weight),string:""};return r.string=toFontString(r),r}function resolve(t,e,a,n){let r=!0,i,o,s;for(i=0,o=t.length;i<o;++i)if(s=t[i],s!==void 0&&(e!==void 0&&typeof s=="function"&&(s=s(e),r=!1),a!==void 0&&isArray$c(s)&&(s=s[a%s.length],r=!1),s!==void 0))return n&&!r&&(n.cacheable=!1),s}function _addGrace(t,e,a){const{min:n,max:r}=t,i=toDimension(e,(r-n)/2),o=(s,l)=>a&&s===0?0:s+l;return{min:o(n,-Math.abs(i)),max:o(r,i)}}function createContext(t,e){return Object.assign(Object.create(t),e)}function _createResolver(t,e=[""],a,n,r=()=>t[0]){const i=a||t;typeof n>"u"&&(n=_resolve("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:s=>_createResolver([s,...t],e,i,n)};return new Proxy(o,{deleteProperty(s,l){return delete s[l],delete s._keys,delete t[0][l],!0},get(s,l){return _cached(s,l,()=>_resolveWithPrefixes(l,e,t,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(s,l){return getKeysFromAllScopes(s).includes(l)},ownKeys(s){return getKeysFromAllScopes(s)},set(s,l,u){const c=s._storage||(s._storage=r());return s[l]=c[l]=u,delete s._keys,!0}})}function _attachContext(t,e,a,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:a,_stack:new Set,_descriptors:_descriptors(t,n),setContext:i=>_attachContext(t,i,a,n),override:i=>_attachContext(t.override(i),e,a,n)};return new Proxy(r,{deleteProperty(i,o){return delete i[o],delete t[o],!0},get(i,o,s){return _cached(i,o,()=>_resolveWithContext(i,o,s))},getOwnPropertyDescriptor(i,o){return i._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(i,o,s){return t[o]=s,delete i[o],!0}})}function _descriptors(t,e={scriptable:!0,indexable:!0}){const{_scriptable:a=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:a,indexable:n,isScriptable:isFunction$3(a)?a:()=>a,isIndexable:isFunction$3(n)?n:()=>n}}const readKey=(t,e)=>t?t+_capitalize(e):e,needsSubResolver=(t,e)=>isObject$8(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function _cached(t,e,a){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=a();return t[e]=n,n}function _resolveWithContext(t,e,a){const{_proxy:n,_context:r,_subProxy:i,_descriptors:o}=t;let s=n[e];return isFunction$3(s)&&o.isScriptable(e)&&(s=_resolveScriptable(e,s,t,a)),isArray$c(s)&&s.length&&(s=_resolveArray(e,s,t,o.isIndexable)),needsSubResolver(e,s)&&(s=_attachContext(s,r,i&&i[e],o)),s}function _resolveScriptable(t,e,a,n){const{_proxy:r,_context:i,_subProxy:o,_stack:s}=a;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(i,o||n);return s.delete(t),needsSubResolver(t,l)&&(l=createSubResolver(r._scopes,r,t,l)),l}function _resolveArray(t,e,a,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=a;if(typeof i.index<"u"&&n(t))return e[i.index%e.length];if(isObject$8(e[0])){const l=e,u=r._scopes.filter(c=>c!==l);e=[];for(const c of l){const d=createSubResolver(u,r,t,c);e.push(_attachContext(d,i,o&&o[t],s))}}return e}function resolveFallback(t,e,a){return isFunction$3(t)?t(e,a):t}const getScope=(t,e)=>t===!0?e:typeof t=="string"?resolveObjectKey(e,t):void 0;function addScopes(t,e,a,n,r){for(const i of e){const o=getScope(a,i);if(o){t.add(o);const s=resolveFallback(o._fallback,a,r);if(typeof s<"u"&&s!==a&&s!==n)return s}else if(o===!1&&typeof n<"u"&&a!==n)return null}return!1}function createSubResolver(t,e,a,n){const r=e._rootScopes,i=resolveFallback(e._fallback,a,n),o=[...t,...r],s=new Set;s.add(n);let l=addScopesFromKey(s,o,a,i||a,n);return l===null||typeof i<"u"&&i!==a&&(l=addScopesFromKey(s,o,i,l,n),l===null)?!1:_createResolver(Array.from(s),[""],r,i,()=>subGetTarget(e,a,n))}function addScopesFromKey(t,e,a,n,r){for(;a;)a=addScopes(t,e,a,n,r);return a}function subGetTarget(t,e,a){const n=t._getTarget();e in n||(n[e]={});const r=n[e];return isArray$c(r)&&isObject$8(a)?a:r||{}}function _resolveWithPrefixes(t,e,a,n){let r;for(const i of e)if(r=_resolve(readKey(i,t),a),typeof r<"u")return needsSubResolver(t,r)?createSubResolver(a,n,t,r):r}function _resolve(t,e){for(const a of e){if(!a)continue;const n=a[t];if(typeof n<"u")return n}}function getKeysFromAllScopes(t){let e=t._keys;return e||(e=t._keys=resolveKeysFromAllScopes(t._scopes)),e}function resolveKeysFromAllScopes(t){const e=new Set;for(const a of t)for(const n of Object.keys(a).filter(r=>!r.startsWith("_")))e.add(n);return Array.from(e)}function _parseObjectDataRadialScale(t,e,a,n){const{iScale:r}=t,{key:i="r"}=this._parsing,o=new Array(n);let s,l,u,c;for(s=0,l=n;s<l;++s)u=s+a,c=e[u],o[s]={r:r.parse(resolveObjectKey(c,i),u)};return o}const EPSILON=Number.EPSILON||1e-14,getPoint=(t,e)=>e<t.length&&!t[e].skip&&t[e],getValueAxis=t=>t==="x"?"y":"x";function splineCurve(t,e,a,n){const r=t.skip?e:t,i=e,o=a.skip?e:a,s=distanceBetweenPoints(i,r),l=distanceBetweenPoints(o,i);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=n*u,h=n*c;return{previous:{x:i.x-d*(o.x-r.x),y:i.y-d*(o.y-r.y)},next:{x:i.x+h*(o.x-r.x),y:i.y+h*(o.y-r.y)}}}function monotoneAdjust(t,e,a){const n=t.length;let r,i,o,s,l,u=getPoint(t,0);for(let c=0;c<n-1;++c)if(l=u,u=getPoint(t,c+1),!(!l||!u)){if(almostEquals(e[c],0,EPSILON)){a[c]=a[c+1]=0;continue}r=a[c]/e[c],i=a[c+1]/e[c],s=Math.pow(r,2)+Math.pow(i,2),!(s<=9)&&(o=3/Math.sqrt(s),a[c]=r*o*e[c],a[c+1]=i*o*e[c])}}function monotoneCompute(t,e,a="x"){const n=getValueAxis(a),r=t.length;let i,o,s,l=getPoint(t,0);for(let u=0;u<r;++u){if(o=s,s=l,l=getPoint(t,u+1),!s)continue;const c=s[a],d=s[n];o&&(i=(c-o[a])/3,s[`cp1${a}`]=c-i,s[`cp1${n}`]=d-i*e[u]),l&&(i=(l[a]-c)/3,s[`cp2${a}`]=c+i,s[`cp2${n}`]=d+i*e[u])}}function splineCurveMonotone(t,e="x"){const a=getValueAxis(e),n=t.length,r=Array(n).fill(0),i=Array(n);let o,s,l,u=getPoint(t,0);for(o=0;o<n;++o)if(s=l,l=u,u=getPoint(t,o+1),!!l){if(u){const c=u[e]-l[e];r[o]=c!==0?(u[a]-l[a])/c:0}i[o]=s?u?sign(r[o-1])!==sign(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}monotoneAdjust(t,r,i),monotoneCompute(t,i,e)}function capControlPoint(t,e,a){return Math.max(Math.min(t,a),e)}function capBezierPoints(t,e){let a,n,r,i,o,s=_isPointInArea(t[0],e);for(a=0,n=t.length;a<n;++a)o=i,i=s,s=a<n-1&&_isPointInArea(t[a+1],e),i&&(r=t[a],o&&(r.cp1x=capControlPoint(r.cp1x,e.left,e.right),r.cp1y=capControlPoint(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=capControlPoint(r.cp2x,e.left,e.right),r.cp2y=capControlPoint(r.cp2y,e.top,e.bottom)))}function _updateBezierControlPoints(t,e,a,n,r){let i,o,s,l;if(e.spanGaps&&(t=t.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")splineCurveMonotone(t,r);else{let u=n?t[t.length-1]:t[0];for(i=0,o=t.length;i<o;++i)s=t[i],l=splineCurve(u,s,t[Math.min(i+1,o-(n?0:1))%o],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,u=s}e.capBezierPoints&&capBezierPoints(t,a)}function _isDomSupported(){return typeof window<"u"&&typeof document<"u"}function _getParentNode(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function parseMaxStyle(t,e,a){let n;return typeof t=="string"?(n=parseInt(t,10),t.indexOf("%")!==-1&&(n=n/100*e.parentNode[a])):n=t,n}const getComputedStyle$1=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function getStyle(t,e){return getComputedStyle$1(t).getPropertyValue(e)}const positions=["top","right","bottom","left"];function getPositionedStyle(t,e,a){const n={};a=a?"-"+a:"";for(let r=0;r<4;r++){const i=positions[r];n[i]=parseFloat(t[e+"-"+i+a])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const useOffsetPos=(t,e,a)=>(t>0||e>0)&&(!a||!a.shadowRoot);function getCanvasPosition(t,e){const a=t.touches,n=a&&a.length?a[0]:t,{offsetX:r,offsetY:i}=n;let o=!1,s,l;if(useOffsetPos(r,i,t.target))s=r,l=i;else{const u=e.getBoundingClientRect();s=n.clientX-u.left,l=n.clientY-u.top,o=!0}return{x:s,y:l,box:o}}function getRelativePosition(t,e){if("native"in t)return t;const{canvas:a,currentDevicePixelRatio:n}=e,r=getComputedStyle$1(a),i=r.boxSizing==="border-box",o=getPositionedStyle(r,"padding"),s=getPositionedStyle(r,"border","width"),{x:l,y:u,box:c}=getCanvasPosition(t,a),d=o.left+(c&&s.left),h=o.top+(c&&s.top);let{width:m,height:p}=e;return i&&(m-=o.width+s.width,p-=o.height+s.height),{x:Math.round((l-d)/m*a.width/n),y:Math.round((u-h)/p*a.height/n)}}function getContainerSize(t,e,a){let n,r;if(e===void 0||a===void 0){const i=_getParentNode(t);if(!i)e=t.clientWidth,a=t.clientHeight;else{const o=i.getBoundingClientRect(),s=getComputedStyle$1(i),l=getPositionedStyle(s,"border","width"),u=getPositionedStyle(s,"padding");e=o.width-u.width-l.width,a=o.height-u.height-l.height,n=parseMaxStyle(s.maxWidth,i,"clientWidth"),r=parseMaxStyle(s.maxHeight,i,"clientHeight")}}return{width:e,height:a,maxWidth:n||INFINITY$5,maxHeight:r||INFINITY$5}}const round1=t=>Math.round(t*10)/10;function getMaximumSize(t,e,a,n){const r=getComputedStyle$1(t),i=getPositionedStyle(r,"margin"),o=parseMaxStyle(r.maxWidth,t,"clientWidth")||INFINITY$5,s=parseMaxStyle(r.maxHeight,t,"clientHeight")||INFINITY$5,l=getContainerSize(t,e,a);let{width:u,height:c}=l;if(r.boxSizing==="content-box"){const h=getPositionedStyle(r,"border","width"),m=getPositionedStyle(r,"padding");u-=m.width+h.width,c-=m.height+h.height}return u=Math.max(0,u-i.width),c=Math.max(0,n?u/n:c-i.height),u=round1(Math.min(u,o,l.maxWidth)),c=round1(Math.min(c,s,l.maxHeight)),u&&!c&&(c=round1(u/2)),(e!==void 0||a!==void 0)&&n&&l.height&&c>l.height&&(c=l.height,u=round1(Math.floor(c*n))),{width:u,height:c}}function retinaScale(t,e,a){const n=e||1,r=Math.floor(t.height*n),i=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(a||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==n||o.height!==r||o.width!==i?(t.currentDevicePixelRatio=n,o.height=r,o.width=i,t.ctx.setTransform(n,0,0,n,0,0),!0):!1}const supportsEventListenerOptions=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return t}();function readUsedSize(t,e){const a=getStyle(t,e),n=a&&a.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function _pointInLine(t,e,a,n){return{x:t.x+a*(e.x-t.x),y:t.y+a*(e.y-t.y)}}function _steppedInterpolation(t,e,a,n){return{x:t.x+a*(e.x-t.x),y:n==="middle"?a<.5?t.y:e.y:n==="after"?a<1?t.y:e.y:a>0?e.y:t.y}}function _bezierInterpolation(t,e,a,n){const r={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},o=_pointInLine(t,r,a),s=_pointInLine(r,i,a),l=_pointInLine(i,e,a),u=_pointInLine(o,s,a),c=_pointInLine(s,l,a);return _pointInLine(u,c,a)}const getRightToLeftAdapter=function(t,e){return{x(a){return t+t+e-a},setWidth(a){e=a},textAlign(a){return a==="center"?a:a==="right"?"left":"right"},xPlus(a,n){return a-n},leftForLtr(a,n){return a-n}}},getLeftToRightAdapter=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function getRtlAdapter(t,e,a){return t?getRightToLeftAdapter(e,a):getLeftToRightAdapter()}function overrideTextDirection(t,e){let a,n;(e==="ltr"||e==="rtl")&&(a=t.canvas.style,n=[a.getPropertyValue("direction"),a.getPropertyPriority("direction")],a.setProperty("direction",e,"important"),t.prevTextDirection=n)}function restoreTextDirection(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function propertyFn(t){return t==="angle"?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(e,a)=>e-a,normalize:e=>e}}function normalizeSegment({start:t,end:e,count:a,loop:n,style:r}){return{start:t%a,end:e%a,loop:n&&(e-t+1)%a===0,style:r}}function getSegment(t,e,a){const{property:n,start:r,end:i}=a,{between:o,normalize:s}=propertyFn(n),l=e.length;let{start:u,end:c,loop:d}=t,h,m;if(d){for(u+=l,c+=l,h=0,m=l;h<m&&o(s(e[u%l][n]),r,i);++h)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:d,style:t.style}}function _boundSegment(t,e,a){if(!a)return[t];const{property:n,start:r,end:i}=a,o=e.length,{compare:s,between:l,normalize:u}=propertyFn(n),{start:c,end:d,loop:h,style:m}=getSegment(t,e,a),p=[];let v=!1,y=null,w,_,D;const k=()=>l(r,D,w)&&s(r,D)!==0,O=()=>s(i,w)===0||l(i,D,w),N=()=>v||k(),F=()=>!v||O();for(let g=c,b=c;g<=d;++g)_=e[g%o],!_.skip&&(w=u(_[n]),w!==D&&(v=l(w,r,i),y===null&&N()&&(y=s(w,r)===0?g:b),y!==null&&F()&&(p.push(normalizeSegment({start:y,end:g,loop:h,count:o,style:m})),y=null),b=g,D=w));return y!==null&&p.push(normalizeSegment({start:y,end:d,loop:h,count:o,style:m})),p}function _boundSegments(t,e){const a=[],n=t.segments;for(let r=0;r<n.length;r++){const i=_boundSegment(n[r],t.points,e);i.length&&a.push(...i)}return a}function findStartAndEnd(t,e,a,n){let r=0,i=e-1;if(a&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,a&&(i+=r);i>r&&t[i%e].skip;)i--;return i%=e,{start:r,end:i}}function solidSegments(t,e,a,n){const r=t.length,i=[];let o=e,s=t[e],l;for(l=e+1;l<=a;++l){const u=t[l%r];u.skip||u.stop?s.skip||(n=!1,i.push({start:e%r,end:(l-1)%r,loop:n}),e=o=u.stop?l:null):(o=l,s.skip&&(e=l)),s=u}return o!==null&&i.push({start:e%r,end:o%r,loop:n}),i}function _computeSegments(t,e){const a=t.points,n=t.options.spanGaps,r=a.length;if(!r)return[];const i=!!t._loop,{start:o,end:s}=findStartAndEnd(a,r,i,n);if(n===!0)return splitByStyles(t,[{start:o,end:s,loop:i}],a,e);const l=s<o?s+r:s,u=!!t._fullLoop&&o===0&&s===r-1;return splitByStyles(t,solidSegments(a,o,l,u),a,e)}function splitByStyles(t,e,a,n){return!n||!n.setContext||!a?e:doSplitByStyles(t,e,a,n)}function doSplitByStyles(t,e,a,n){const r=t._chart.getContext(),i=readStyle(t.options),{_datasetIndex:o,options:{spanGaps:s}}=t,l=a.length,u=[];let c=i,d=e[0].start,h=d;function m(p,v,y,w){const _=s?-1:1;if(p!==v){for(p+=l;a[p%l].skip;)p-=_;for(;a[v%l].skip;)v+=_;p%l!==v%l&&(u.push({start:p%l,end:v%l,loop:y,style:w}),c=w,d=v%l)}}for(const p of e){d=s?d:p.start;let v=a[d%l],y;for(h=d+1;h<=p.end;h++){const w=a[h%l];y=readStyle(n.setContext(createContext(r,{type:"segment",p0:v,p1:w,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),styleChanged(y,c)&&m(d,h-1,p.loop,c),v=w,c=y}d<h-1&&m(d,h-1,p.loop,c)}return u}function readStyle(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function styleChanged(t,e){if(!e)return!1;const a=[],n=function(r,i){return isPatternOrGradient(i)?(a.includes(i)||a.push(i),a.indexOf(i)):i};return JSON.stringify(t,n)!==JSON.stringify(e,n)}/*!
+ * Chart.js v4.4.0
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
- */class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,a,n,r){const i=a.listeners[r],o=a.duration;i.forEach(s=>s({chart:e,initial:a.initial,numSteps:o,currentStep:Math.min(n-a.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let a=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;const i=n.items;let o=i.length-1,s=!1,l;for(;o>=0;--o)l=i[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(e),s=!0):(i[o]=i[i.length-1],i.pop());s&&(r.draw(),this._notify(r,n,e,"progress")),i.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),a+=i.length}),this._lastDate=e,a===0&&(this._running=!1)}_getAnims(e){const a=this._charts;let n=a.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},a.set(e,n)),n}listen(e,a,n){this._getAnims(e).listeners[a].push(n)}add(e,a){!a||!a.length||this._getAnims(e).items.push(...a)}has(e){return this._getAnims(e).items.length>0}start(e){const a=this._charts.get(e);a&&(a.running=!0,a.start=Date.now(),a.duration=a.items.reduce((n,r)=>Math.max(n,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const a=this._charts.get(e);return!(!a||!a.running||!a.items.length)}stop(e){const a=this._charts.get(e);if(!a||!a.items.length)return;const n=a.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();a.items=[],this._notify(e,a,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var animator=new Animator;const transparent="transparent",interpolators={boolean(t,e,a){return a>.5?e:t},color(t,e,a){const n=color(t||transparent),r=n.valid&&color(e||transparent);return r&&r.valid?r.mix(n,a).hexString():e},number(t,e,a){return t+(e-t)*a}};class Animation{constructor(e,a,n,r){const i=a[n];r=resolve([e.to,r,i,e.from]);const o=resolve([e.from,i,r]);this._active=!0,this._fn=e.fn||interpolators[e.type||typeof o],this._easing=effects[e.easing]||effects.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=a,this._prop=n,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(e,a,n){if(this._active){this._notify(!1);const r=this._target[this._prop],i=n-this._start,o=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=resolve([e.to,a,r,e.from]),this._from=resolve([e.from,r,a])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const a=e-this._start,n=this._duration,r=this._prop,i=this._from,o=this._loop,s=this._to;let l;if(this._active=i!==s&&(o||a<n),!this._active){this._target[r]=s,this._notify(!0);return}if(a<0){this._target[r]=i;return}l=a/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(i,s,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((a,n)=>{e.push({res:a,rej:n})})}_notify(e){const a=e?"res":"rej",n=this._promises||[];for(let r=0;r<n.length;r++)n[r][a]()}}class Animations{constructor(e,a){this._chart=e,this._properties=new Map,this.configure(a)}configure(e){if(!isObject$8(e))return;const a=Object.keys(defaults.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const i=e[r];if(!isObject$8(i))return;const o={};for(const s of a)o[s]=i[s];(isArray$c(i.properties)&&i.properties||[r]).forEach(s=>{(s===r||!n.has(s))&&n.set(s,o)})})}_animateOptions(e,a){const n=a.options,r=resolveTargetOptions(e,n);if(!r)return[];const i=this._createAnimations(r,n);return n.$shared&&awaitAll(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,a){const n=this._properties,r=[],i=e.$animations||(e.$animations={}),o=Object.keys(a),s=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(e,a));continue}const c=a[u];let d=i[u];const h=n.get(u);if(d)if(h&&d.active()){d.update(h,c,s);continue}else d.cancel();if(!h||!h.duration){e[u]=c;continue}i[u]=d=new Animation(h,e,u,c),r.push(d)}return r}update(e,a){if(this._properties.size===0){Object.assign(e,a);return}const n=this._createAnimations(e,a);if(n.length)return animator.add(this._chart,n),!0}}function awaitAll(t,e){const a=[],n=Object.keys(e);for(let r=0;r<n.length;r++){const i=t[n[r]];i&&i.active()&&a.push(i.wait())}return Promise.all(a)}function resolveTargetOptions(t,e){if(!e)return;let a=t.options;if(!a){t.options=e;return}return a.$shared&&(t.options=a=Object.assign({},a,{$shared:!1,$animations:{}})),a}function scaleClip(t,e){const a=t&&t.options||{},n=a.reverse,r=a.min===void 0?e:0,i=a.max===void 0?e:0;return{start:n?i:r,end:n?r:i}}function defaultClip(t,e,a){if(a===!1)return!1;const n=scaleClip(t,a),r=scaleClip(e,a);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}function toClip(t){let e,a,n,r;return isObject$8(t)?(e=t.top,a=t.right,n=t.bottom,r=t.left):e=a=n=r=t,{top:e,right:a,bottom:n,left:r,disabled:t===!1}}function getSortedDatasetIndices(t,e){const a=[],n=t._getSortedDatasetMetas(e);let r,i;for(r=0,i=n.length;r<i;++r)a.push(n[r].index);return a}function applyStack(t,e,a,n={}){const r=t.keys,i=n.mode==="single";let o,s,l,u;if(e!==null){for(o=0,s=r.length;o<s;++o){if(l=+r[o],l===a){if(n.all)continue;break}u=t.values[l],isNumberFinite(u)&&(i||e===0||sign(e)===sign(u))&&(e+=u)}return e}}function convertObjectDataToArray(t){const e=Object.keys(t),a=new Array(e.length);let n,r,i;for(n=0,r=e.length;n<r;++n)i=e[n],a[n]={x:i,y:t[i]};return a}function isStacked(t,e){const a=t&&t.options.stacked;return a||a===void 0&&e.stack!==void 0}function getStackKey(t,e,a){return`${t.id}.${e.id}.${a.stack||a.type}`}function getUserBounds(t){const{min:e,max:a,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?a:Number.POSITIVE_INFINITY}}function getOrCreateStack(t,e,a){const n=t[e]||(t[e]={});return n[a]||(n[a]={})}function getLastIndexInStack(t,e,a,n){for(const r of e.getMatchingVisibleMetas(n).reverse()){const i=t[r.index];if(a&&i>0||!a&&i<0)return r.index}return null}function updateStacks(t,e){const{chart:a,_cachedMeta:n}=t,r=a._stacks||(a._stacks={}),{iScale:i,vScale:o,index:s}=n,l=i.axis,u=o.axis,c=getStackKey(i,o,n),d=e.length;let h;for(let m=0;m<d;++m){const p=e[m],{[l]:v,[u]:y}=p,w=p._stacks||(p._stacks={});h=w[u]=getOrCreateStack(r,c,v),h[s]=y,h._top=getLastIndexInStack(h,o,!0,n.type),h._bottom=getLastIndexInStack(h,o,!1,n.type);const _=h._visualValues||(h._visualValues={});_[s]=y}}function getFirstScaleId(t,e){const a=t.scales;return Object.keys(a).filter(n=>a[n].axis===e).shift()}function createDatasetContext(t,e){return createContext(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function createDataContext(t,e,a){return createContext(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:a,index:e,mode:"default",type:"data"})}function clearStacks(t,e){const a=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const r of e){const i=r._stacks;if(!i||i[n]===void 0||i[n][a]===void 0)return;delete i[n][a],i[n]._visualValues!==void 0&&i[n]._visualValues[a]!==void 0&&delete i[n]._visualValues[a]}}}const isDirectUpdateMode=t=>t==="reset"||t==="none",cloneIfNotShared=(t,e)=>e?t:Object.assign({},t),createStack=(t,e,a)=>t&&!e.hidden&&e._stacked&&{keys:getSortedDatasetIndices(a,!0),values:null};class DatasetController{constructor(e,a){this.chart=e,this._ctx=e.ctx,this.index=a,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=isStacked(e.vScale,e),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(e){this.index!==e&&clearStacks(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,a=this._cachedMeta,n=this.getDataset(),r=(d,h,m,p)=>d==="x"?h:d==="r"?p:m,i=a.xAxisID=valueOrDefault(n.xAxisID,getFirstScaleId(e,"x")),o=a.yAxisID=valueOrDefault(n.yAxisID,getFirstScaleId(e,"y")),s=a.rAxisID=valueOrDefault(n.rAxisID,getFirstScaleId(e,"r")),l=a.indexAxis,u=a.iAxisID=r(l,i,o,s),c=a.vAxisID=r(l,o,i,s);a.xScale=this.getScaleForId(i),a.yScale=this.getScaleForId(o),a.rScale=this.getScaleForId(s),a.iScale=this.getScaleForId(u),a.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const a=this._cachedMeta;return e===a.iScale?a.vScale:a.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),e._stacked&&clearStacks(e)}_dataCheck(){const e=this.getDataset(),a=e.data||(e.data=[]),n=this._data;if(isObject$8(a))this._data=convertObjectDataToArray(a);else if(n!==a){if(n){unlistenArrayEvents(n,this);const r=this._cachedMeta;clearStacks(r),r._parsed=[]}a&&Object.isExtensible(a)&&listenArrayEvents(a,this),this._syncList=[],this._data=a}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const a=this._cachedMeta,n=this.getDataset();let r=!1;this._dataCheck();const i=a._stacked;a._stacked=isStacked(a.vScale,a),a.stack!==n.stack&&(r=!0,clearStacks(a),a.stack=n.stack),this._resyncElements(e),(r||i!==a._stacked)&&updateStacks(this,a._parsed)}configure(){const e=this.chart.config,a=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),a,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,a){const{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:o}=n,s=i.axis;let l=e===0&&a===r.length?!0:n._sorted,u=e>0&&n._parsed[e-1],c,d,h;if(this._parsing===!1)n._parsed=r,n._sorted=!0,h=r;else{isArray$c(r[e])?h=this.parseArrayData(n,r,e,a):isObject$8(r[e])?h=this.parseObjectData(n,r,e,a):h=this.parsePrimitiveData(n,r,e,a);const m=()=>d[s]===null||u&&d[s]<u[s];for(c=0;c<a;++c)n._parsed[c+e]=d=h[c],l&&(m()&&(l=!1),u=d);n._sorted=l}o&&updateStacks(this,h)}parsePrimitiveData(e,a,n,r){const{iScale:i,vScale:o}=e,s=i.axis,l=o.axis,u=i.getLabels(),c=i===o,d=new Array(r);let h,m,p;for(h=0,m=r;h<m;++h)p=h+n,d[h]={[s]:c||i.parse(u[p],p),[l]:o.parse(a[p],p)};return d}parseArrayData(e,a,n,r){const{xScale:i,yScale:o}=e,s=new Array(r);let l,u,c,d;for(l=0,u=r;l<u;++l)c=l+n,d=a[c],s[l]={x:i.parse(d[0],c),y:o.parse(d[1],c)};return s}parseObjectData(e,a,n,r){const{xScale:i,yScale:o}=e,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=new Array(r);let c,d,h,m;for(c=0,d=r;c<d;++c)h=c+n,m=a[h],u[c]={x:i.parse(resolveObjectKey(m,s),h),y:o.parse(resolveObjectKey(m,l),h)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,a,n){const r=this.chart,i=this._cachedMeta,o=a[e.axis],s={keys:getSortedDatasetIndices(r,!0),values:a._stacks[e.axis]._visualValues};return applyStack(s,o,i.index,{mode:n})}updateRangeFromParsed(e,a,n,r){const i=n[a.axis];let o=i===null?NaN:i;const s=r&&n._stacks[a.axis];r&&s&&(r.values=s,o=applyStack(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,a){const n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,o=r.length,s=this._getOtherScale(e),l=createStack(a,n,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=getUserBounds(s);let h,m;function p(){m=r[h];const v=m[s.axis];return!isNumberFinite(m[e.axis])||c>v||d<v}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(u,e,m,l),i));++h);if(i){for(h=o-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(u,e,m,l);break}}return u}getAllParsedValues(e){const a=this._cachedMeta._parsed,n=[];let r,i,o;for(r=0,i=a.length;r<i;++r)o=a[r][e.axis],isNumberFinite(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const a=this._cachedMeta,n=a.iScale,r=a.vScale,i=this.getParsed(e);return{label:n?""+n.getLabelForValue(i[n.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(e){const a=this._cachedMeta;this.update(e||"default"),a._clip=toClip(valueOrDefault(this.options.clip,defaultClip(a.xScale,a.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,a=this.chart,n=this._cachedMeta,r=n.data||[],i=a.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||r.length-s,u=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,i,s,l),c=s;c<s+l;++c){const d=r[c];d.hidden||(d.active&&u?o.push(d):d.draw(e,i))}for(c=0;c<o.length;++c)o[c].draw(e,i)}getStyle(e,a){const n=a?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,a,n){const r=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];i=o.$context||(o.$context=createDataContext(this.getContext(),e,o)),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!a,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,a){return this._resolveElementOptions(this.dataElementType.id,a,e)}_resolveElementOptions(e,a="default",n){const r=a==="active",i=this._cachedDataOpts,o=e+"-"+a,s=i[o],l=this.enableOptionSharing&&defined$1(n);if(s)return cloneIfNotShared(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,e),d=r?[`${e}Hover`,"hover",e,""]:[e,""],h=u.getOptionScopes(this.getDataset(),c),m=Object.keys(defaults.elements[e]),p=()=>this.getContext(n,r,a),v=u.resolveNamedOptions(h,m,p,d);return v.$shared&&(v.$shared=l,i[o]=Object.freeze(cloneIfNotShared(v,l))),v}_resolveAnimations(e,a,n){const r=this.chart,i=this._cachedDataOpts,o=`animation-${a}`,s=i[o];if(s)return s;let l;if(r.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,a),h=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(h,this.getContext(e,n,a))}const u=new Animations(r,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,a){return!a||isDirectUpdateMode(e)||this.chart._animationsDisabled}_getSharedOptions(e,a){const n=this.resolveDataElementOptions(e,a),r=this._sharedOptions,i=this.getSharedOptions(n),o=this.includeOptions(a,i)||i!==r;return this.updateSharedOptions(i,a,n),{sharedOptions:i,includeOptions:o}}updateElement(e,a,n,r){isDirectUpdateMode(r)?Object.assign(e,n):this._resolveAnimations(a,r).update(e,n)}updateSharedOptions(e,a,n){e&&!isDirectUpdateMode(a)&&this._resolveAnimations(void 0,a).update(e,n)}_setStyle(e,a,n,r){e.active=r;const i=this.getStyle(a,r);this._resolveAnimations(a,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,a,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,a,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const a=this._data,n=this._cachedMeta.data;for(const[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const r=n.length,i=a.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,a,n=!0){const r=this._cachedMeta,i=r.data,o=e+a;let s;const l=u=>{for(u.length+=a,s=u.length-1;s>=o;s--)u[s]=u[s-a]};for(l(i),s=e;s<o;++s)i[s]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(e,a),n&&this.updateElements(i,e,a,"reset")}updateElements(e,a,n,r){}_removeElements(e,a){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(e,a);n._stacked&&clearStacks(n,r)}n.data.splice(e,a)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[a,n,r]=e;this[a](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,a){a&&this._sync(["_removeElements",e,a]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(DatasetController,"defaults",{}),R(DatasetController,"datasetElementType",null),R(DatasetController,"dataElementType",null);function getAllScaleValues(t,e){if(!t._cache.$bar){const a=t.getMatchingVisibleMetas(e);let n=[];for(let r=0,i=a.length;r<i;r++)n=n.concat(a[r].controller.getAllParsedValues(t));t._cache.$bar=_arrayUnique(n.sort((r,i)=>r-i))}return t._cache.$bar}function computeMinSampleSize(t){const e=t.iScale,a=getAllScaleValues(e,t.type);let n=e._length,r,i,o,s;const l=()=>{o===32767||o===-32768||(defined$1(s)&&(n=Math.min(n,Math.abs(o-s)||n)),s=o)};for(r=0,i=a.length;r<i;++r)o=e.getPixelForValue(a[r]),l();for(s=void 0,r=0,i=e.ticks.length;r<i;++r)o=e.getPixelForTick(r),l();return n}function computeFitCategoryTraits(t,e,a,n){const r=a.barThickness;let i,o;return isNullOrUndef(r)?(i=e.min*a.categoryPercentage,o=a.barPercentage):(i=r*n,o=1),{chunk:i/n,ratio:o,start:e.pixels[t]-i/2}}function computeFlexCategoryTraits(t,e,a,n){const r=e.pixels,i=r[t];let o=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null;const l=a.categoryPercentage;o===null&&(o=i-(s===null?e.end-e.start:s-i)),s===null&&(s=i+i-o);const u=i-(i-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/n,ratio:a.barPercentage,start:u}}function parseFloatBar(t,e,a,n){const r=a.parse(t[0],n),i=a.parse(t[1],n),o=Math.min(r,i),s=Math.max(r,i);let l=o,u=s;Math.abs(o)>Math.abs(s)&&(l=s,u=o),e[a.axis]=u,e._custom={barStart:l,barEnd:u,start:r,end:i,min:o,max:s}}function parseValue(t,e,a,n){return isArray$c(t)?parseFloatBar(t,e,a,n):e[a.axis]=a.parse(t,n),e}function parseArrayOrPrimitive(t,e,a,n){const r=t.iScale,i=t.vScale,o=r.getLabels(),s=r===i,l=[];let u,c,d,h;for(u=a,c=a+n;u<c;++u)h=e[u],d={},d[r.axis]=s||r.parse(o[u],u),l.push(parseValue(h,d,i,u));return l}function isFloatBar(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function barSign(t,e,a){return t!==0?sign(t):(e.isHorizontal()?1:-1)*(e.min>=a?1:-1)}function borderProps(t){let e,a,n,r,i;return t.horizontal?(e=t.base>t.x,a="left",n="right"):(e=t.base<t.y,a="bottom",n="top"),e?(r="end",i="start"):(r="start",i="end"),{start:a,end:n,reverse:e,top:r,bottom:i}}function setBorderSkipped(t,e,a,n){let r=e.borderSkipped;const i={};if(!r){t.borderSkipped=i;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:s,reverse:l,top:u,bottom:c}=borderProps(t);r==="middle"&&a&&(t.enableBorderRadius=!0,(a._top||0)===n?r=u:(a._bottom||0)===n?r=c:(i[parseEdge(c,o,s,l)]=!0,r=u)),i[parseEdge(r,o,s,l)]=!0,t.borderSkipped=i}function parseEdge(t,e,a,n){return n?(t=swap(t,e,a),t=startEnd(t,a,e)):t=startEnd(t,e,a),t}function swap(t,e,a){return t===e?a:t===a?e:t}function startEnd(t,e,a){return t==="start"?e:t==="end"?a:t}function setInflateAmount(t,{inflateAmount:e},a){t.inflateAmount=e==="auto"?a===1?.33:0:e}class BarController extends DatasetController{parsePrimitiveData(e,a,n,r){return parseArrayOrPrimitive(e,a,n,r)}parseArrayData(e,a,n,r){return parseArrayOrPrimitive(e,a,n,r)}parseObjectData(e,a,n,r){const{iScale:i,vScale:o}=e,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=i.axis==="x"?s:l,c=o.axis==="x"?s:l,d=[];let h,m,p,v;for(h=n,m=n+r;h<m;++h)v=a[h],p={},p[i.axis]=i.parse(resolveObjectKey(v,u),h),d.push(parseValue(resolveObjectKey(v,c),p,o,h));return d}updateRangeFromParsed(e,a,n,r){super.updateRangeFromParsed(e,a,n,r);const i=n._custom;i&&a===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const a=this._cachedMeta,{iScale:n,vScale:r}=a,i=this.getParsed(e),o=i._custom,s=isFloatBar(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+n.getLabelForValue(i[n.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const a=this._cachedMeta;this.updateElements(a.data,0,a.data.length,e)}updateElements(e,a,n,r){const i=r==="reset",{index:o,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),u=s.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(a,r);for(let m=a;m<a+n;m++){const p=this.getParsed(m),v=i||isNullOrUndef(p[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,c),w=(p._stacks||{})[s.axis],_={horizontal:u,base:v.base,enableBorderRadius:!w||isFloatBar(p._custom)||o===w._top||o===w._bottom,x:u?v.head:y.center,y:u?y.center:v.head,height:u?y.size:Math.abs(v.size),width:u?Math.abs(v.size):y.size};h&&(_.options=d||this.resolveDataElementOptions(m,e[m].active?"active":r));const D=_.options||e[m].options;setBorderSkipped(_,D,w,o),setInflateAmount(_,D,c.ratio),this.updateElement(e[m],m,_,r)}}_getStacks(e,a){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=n.options.stacked,o=[],s=l=>{const u=l.controller.getParsed(a),c=u&&u[l.vScale.axis];if(isNullOrUndef(c)||isNaN(c))return!0};for(const l of r)if(!(a!==void 0&&s(l))&&((i===!1||o.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,a,n){const r=this._getStacks(e,n),i=a!==void 0?r.indexOf(a):-1;return i===-1?r.length-1:i}_getRuler(){const e=this.options,a=this._cachedMeta,n=a.iScale,r=[];let i,o;for(i=0,o=a.data.length;i<o;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));const s=e.barThickness;return{min:s||computeMinSampleSize(a),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:a,_stacked:n,index:r},options:{base:i,minBarLength:o}}=this,s=i||0,l=this.getParsed(e),u=l._custom,c=isFloatBar(u);let d=l[a.axis],h=0,m=n?this.applyStack(a,l,n):d,p,v;m!==d&&(h=m-d,m=d),c&&(d=u.barStart,m=u.barEnd-u.barStart,d!==0&&sign(d)!==sign(u.barEnd)&&(h=0),h+=d);const y=!isNullOrUndef(i)&&!c?i:h;let w=a.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=a.getPixelForValue(h+m):p=w,v=p-w,Math.abs(v)<o){v=barSign(v,a,s)*o,d===s&&(w-=v/2);const _=a.getPixelForDecimal(0),D=a.getPixelForDecimal(1),k=Math.min(_,D),O=Math.max(_,D);w=Math.max(Math.min(w,O),k),p=w+v,n&&!c&&(l._stacks[a.axis]._visualValues[r]=a.getValueForPixel(p)-a.getValueForPixel(w))}if(w===a.getPixelForValue(s)){const _=sign(v)*a.getLineWidthForValue(s)/2;w+=_,v-=_}return{size:v,base:w,head:p,center:p+v/2}}_calculateBarIndexPixels(e,a){const n=a.scale,r=this.options,i=r.skipNull,o=valueOrDefault(r.maxBarThickness,1/0);let s,l;if(a.grouped){const u=i?this._getStackCount(e):a.stackCount,c=r.barThickness==="flex"?computeFlexCategoryTraits(e,a,r,u):computeFitCategoryTraits(e,a,r,u),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0);s=c.start+c.chunk*d+c.chunk/2,l=Math.min(o,c.chunk*c.ratio)}else s=n.getPixelForValue(this.getParsed(e)[n.axis],e),l=Math.min(o,a.min*a.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const e=this._cachedMeta,a=e.vScale,n=e.data,r=n.length;let i=0;for(;i<r;++i)this.getParsed(i)[a.axis]!==null&&n[i].draw(this._ctx)}}R(BarController,"id","bar"),R(BarController,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(BarController,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function getRatioAndOffset(t,e,a){let n=1,r=1,i=0,o=0;if(e<TAU){const s=t,l=s+e,u=Math.cos(s),c=Math.sin(s),d=Math.cos(l),h=Math.sin(l),m=(D,k,O)=>_angleBetween(D,s,l,!0)?1:Math.max(k,k*a,O,O*a),p=(D,k,O)=>_angleBetween(D,s,l,!0)?-1:Math.min(k,k*a,O,O*a),v=m(0,u,d),y=m(HALF_PI,c,h),w=p(PI,u,d),_=p(PI+HALF_PI,c,h);n=(v-w)/2,r=(y-_)/2,i=-(v+w)/2,o=-(y+_)/2}return{ratioX:n,ratioY:r,offsetX:i,offsetY:o}}class DoughnutController extends DatasetController{constructor(e,a){super(e,a),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,a){const n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=l=>+n[l];if(isObject$8(n[e])){const{key:l="value"}=this._parsing;i=u=>+resolveObjectKey(n[u],l)}let o,s;for(o=e,s=e+a;o<s;++o)r._parsed[o]=i(o)}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let e=TAU,a=-TAU;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),o=r._getCircumference();e=Math.min(e,i),a=Math.max(a,i+o)}return{rotation:e,circumference:a-e}}update(e){const a=this.chart,{chartArea:n}=a,r=this._cachedMeta,i=r.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min(toPercentage(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:v}=getRatioAndOffset(d,c,l),y=(n.width-o)/h,w=(n.height-o)/m,_=Math.max(Math.min(y,w)/2,0),D=toDimension(this.options.radius,_),k=Math.max(D*l,0),O=(D-k)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=v*D,r.total=this.calculateTotal(),this.outerRadius=D-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*u,0),this.updateElements(i,0,i.length,e)}_circumference(e,a){const n=this.options,r=this._cachedMeta,i=this._getCircumference();return a&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/TAU)}updateElements(e,a,n,r){const i=r==="reset",o=this.chart,s=o.chartArea,u=o.options.animation,c=(s.left+s.right)/2,d=(s.top+s.bottom)/2,h=i&&u.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:v,includeOptions:y}=this._getSharedOptions(a,r);let w=this._getRotation(),_;for(_=0;_<a;++_)w+=this._circumference(_,i);for(_=a;_<a+n;++_){const D=this._circumference(_,i),k=e[_],O={x:c+this.offsetX,y:d+this.offsetY,startAngle:w,endAngle:w+D,circumference:D,outerRadius:p,innerRadius:m};y&&(O.options=v||this.resolveDataElementOptions(_,k.active?"active":r)),w+=D,this.updateElement(k,_,O,r)}}calculateTotal(){const e=this._cachedMeta,a=e.data;let n=0,r;for(r=0;r<a.length;r++){const i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!a[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){const a=this._cachedMeta.total;return a>0&&!isNaN(e)?TAU*(Math.abs(e)/a):0}getLabelAndValue(e){const a=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=formatNumber$1(a._parsed[e],n.options.locale);return{label:r[e]||"",value:i}}getMaxBorderWidth(e){let a=0;const n=this.chart;let r,i,o,s,l;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){o=n.getDatasetMeta(r),e=o.data,s=o.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)l=s.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(a=Math.max(a,l.borderWidth||0,l.hoverBorderWidth||0));return a}getMaxOffset(e){let a=0;for(let n=0,r=e.length;n<r;++n){const i=this.resolveDataElementOptions(n);a=Math.max(a,i.offset||0,i.hoverOffset||0)}return a}_getRingWeightOffset(e){let a=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(a+=this._getRingWeight(n));return a}_getRingWeight(e){return Math.max(valueOrDefault(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(DoughnutController,"id","doughnut"),R(DoughnutController,"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"}),R(DoughnutController,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),R(DoughnutController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const a=e.data;if(a.labels.length&&a.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return a.labels.map((i,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,a,n){n.chart.toggleDataVisibility(a.index),n.chart.update()}}}});class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const a=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=a,o=this.chart._animationsDisabled;let{start:s,count:l}=_getStartAndCountOfVisiblePoints(a,r,o);this._drawStart=s,this._drawCount=l,_scaleRangesChanged(a)&&(s=0,l=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:u},e),this.updateElements(r,s,l,e)}updateElements(e,a,n,r){const i=r==="reset",{iScale:o,vScale:s,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(a,r),h=o.axis,m=s.axis,{spanGaps:p,segment:v}=this.options,y=isNumber(p)?p:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||r==="none",_=a+n,D=e.length;let k=a>0&&this.getParsed(a-1);for(let O=0;O<D;++O){const N=e[O],F=w?N:{};if(O<a||O>=_){F.skip=!0;continue}const g=this.getParsed(O),b=isNullOrUndef(g[m]),$=F[h]=o.getPixelForValue(g[h],O),S=F[m]=i||b?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,g,l):g[m],O);F.skip=isNaN($)||isNaN(S)||b,F.stop=O>0&&Math.abs(g[h]-k[h])>y,v&&(F.parsed=g,F.raw=u.data[O]),d&&(F.options=c||this.resolveDataElementOptions(O,N.active?"active":r)),w||this.updateElement(N,O,F,r),k=g}}getMaxOverflow(){const e=this._cachedMeta,a=e.dataset,n=a.options&&a.options.borderWidth||0,r=e.data||[];if(!r.length)return n;const i=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}R(LineController,"id","line"),R(LineController,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(LineController,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class PolarAreaController extends DatasetController{constructor(e,a){super(e,a),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const a=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=formatNumber$1(a._parsed[e].r,n.options.locale);return{label:r[e]||"",value:i}}parseObjectData(e,a,n,r){return _parseObjectDataRadialScale.bind(this)(e,a,n,r)}update(e){const a=this._cachedMeta.data;this._updateRadius(),this.updateElements(a,0,a.length,e)}getMinMax(){const e=this._cachedMeta,a={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((n,r)=>{const i=this.getParsed(r).r;!isNaN(i)&&this.chart.getDataVisibility(r)&&(i<a.min&&(a.min=i),i>a.max&&(a.max=i))}),a}_updateRadius(){const e=this.chart,a=e.chartArea,n=e.options,r=Math.min(a.right-a.left,a.bottom-a.top),i=Math.max(r/2,0),o=Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0),s=(i-o)/e.getVisibleDatasetCount();this.outerRadius=i-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(e,a,n,r){const i=r==="reset",o=this.chart,l=o.options.animation,u=this._cachedMeta.rScale,c=u.xCenter,d=u.yCenter,h=u.getIndexAngle(0)-.5*PI;let m=h,p;const v=360/this.countVisibleElements();for(p=0;p<a;++p)m+=this._computeAngle(p,r,v);for(p=a;p<a+n;p++){const y=e[p];let w=m,_=m+this._computeAngle(p,r,v),D=o.getDataVisibility(p)?u.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=_,i&&(l.animateScale&&(D=0),l.animateRotate&&(w=_=h));const k={x:c,y:d,innerRadius:0,outerRadius:D,startAngle:w,endAngle:_,options:this.resolveDataElementOptions(p,y.active?"active":r)};this.updateElement(y,p,k,r)}}countVisibleElements(){const e=this._cachedMeta;let a=0;return e.data.forEach((n,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&a++}),a}_computeAngle(e,a,n){return this.chart.getDataVisibility(e)?toRadians(this.resolveDataElementOptions(e,a).angle||n):0}}R(PolarAreaController,"id","polarArea"),R(PolarAreaController,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(PolarAreaController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const a=e.data;if(a.labels.length&&a.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return a.labels.map((i,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,a,n){n.chart.toggleDataVisibility(a.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class PieController extends DoughnutController{}R(PieController,"id","pie"),R(PieController,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{constructor(e){R(this,"options");this.options=e||{}}static override(e){Object.assign(DateAdapterBase.prototype,e)}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(t,e,a,n){const{controller:r,data:i,_sorted:o}=t,s=r._cachedMeta.iScale;if(s&&e===s.axis&&e!=="r"&&o&&i.length){const l=s._reversePixels?_rlookupByKey:_lookupByKey;if(n){if(r._sharedOptions){const u=i[0],c=typeof u.getRange=="function"&&u.getRange(e);if(c){const d=l(i,e,a-c),h=l(i,e,a+c);return{lo:d.lo,hi:h.hi}}}}else return l(i,e,a)}return{lo:0,hi:i.length-1}}function evaluateInteractionItems(t,e,a,n,r){const i=t.getSortedVisibleDatasetMetas(),o=a[e];for(let s=0,l=i.length;s<l;++s){const{index:u,data:c}=i[s],{lo:d,hi:h}=binarySearch(i[s],e,o,r);for(let m=d;m<=h;++m){const p=c[m];p.skip||n(p,u,m)}}}function getDistanceMetricForAxis(t){const e=t.indexOf("x")!==-1,a=t.indexOf("y")!==-1;return function(n,r){const i=e?Math.abs(n.x-r.x):0,o=a?Math.abs(n.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}function getIntersectItems(t,e,a,n,r){const i=[];return!r&&!t.isPointInArea(e)||evaluateInteractionItems(t,a,e,function(s,l,u){!r&&!_isPointInArea(s,t.chartArea,0)||s.inRange(e.x,e.y,n)&&i.push({element:s,datasetIndex:l,index:u})},!0),i}function getNearestRadialItems(t,e,a,n){let r=[];function i(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],n),{angle:d}=getAngleFromPoint(o,{x:e.x,y:e.y});_angleBetween(d,u,c)&&r.push({element:o,datasetIndex:s,index:l})}return evaluateInteractionItems(t,a,e,i),r}function getNearestCartesianItems(t,e,a,n,r,i){let o=[];const s=getDistanceMetricForAxis(a);let l=Number.POSITIVE_INFINITY;function u(c,d,h){const m=c.inRange(e.x,e.y,r);if(n&&!m)return;const p=c.getCenterPoint(r);if(!(!!i||t.isPointInArea(p))&&!m)return;const y=s(e,p);y<l?(o=[{element:c,datasetIndex:d,index:h}],l=y):y===l&&o.push({element:c,datasetIndex:d,index:h})}return evaluateInteractionItems(t,a,e,u),o}function getNearestItems(t,e,a,n,r,i){return!i&&!t.isPointInArea(e)?[]:a==="r"&&!n?getNearestRadialItems(t,e,a,r):getNearestCartesianItems(t,e,a,n,r,i)}function getAxisItems(t,e,a,n,r){const i=[],o=a==="x"?"inXRange":"inYRange";let s=!1;return evaluateInteractionItems(t,a,e,(l,u,c)=>{l[o](e[a],r)&&(i.push({element:l,datasetIndex:u,index:c}),s=s||l.inRange(e.x,e.y,r))}),n&&!s?[]:i}var Interaction={evaluateInteractionItems,modes:{index(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"x",o=a.includeInvisible||!1,s=a.intersect?getIntersectItems(t,r,i,n,o):getNearestItems(t,r,i,!1,n,o),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"xy",o=a.includeInvisible||!1;let s=a.intersect?getIntersectItems(t,r,i,n,o):getNearestItems(t,r,i,!1,n,o);if(s.length>0){const l=s[0].datasetIndex,u=t.getDatasetMeta(l).data;s=[];for(let c=0;c<u.length;++c)s.push({element:u[c],datasetIndex:l,index:c})}return s},point(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"xy",o=a.includeInvisible||!1;return getIntersectItems(t,r,i,n,o)},nearest(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"xy",o=a.includeInvisible||!1;return getNearestItems(t,r,i,a.intersect,n,o)},x(t,e,a,n){const r=getRelativePosition(e,t);return getAxisItems(t,r,"x",a.intersect,n)},y(t,e,a,n){const r=getRelativePosition(e,t);return getAxisItems(t,r,"y",a.intersect,n)}}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(t,e){return t.filter(a=>a.pos===e)}function filterDynamicPositionByAxis(t,e){return t.filter(a=>STATIC_POSITIONS.indexOf(a.pos)===-1&&a.box.axis===e)}function sortByWeight(t,e){return t.sort((a,n)=>{const r=e?n:a,i=e?a:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function wrapBoxes(t){const e=[];let a,n,r,i,o,s;for(a=0,n=(t||[]).length;a<n;++a)r=t[a],{position:i,options:{stack:o,stackWeight:s=1}}=r,e.push({index:a,box:r,pos:i,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&i+o,stackWeight:s});return e}function buildStacks(t){const e={};for(const a of t){const{stack:n,pos:r,stackWeight:i}=a;if(!n||!STATIC_POSITIONS.includes(r))continue;const o=e[n]||(e[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return e}function setLayoutDims(t,e){const a=buildStacks(t),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e;let i,o,s;for(i=0,o=t.length;i<o;++i){s=t[i];const{fullSize:l}=s.box,u=a[s.stack],c=u&&s.stackWeight/u.weight;s.horizontal?(s.width=c?c*n:l&&e.availableWidth,s.height=r):(s.width=n,s.height=c?c*r:l&&e.availableHeight)}return a}function buildLayoutBoxes(t){const e=wrapBoxes(t),a=sortByWeight(e.filter(u=>u.box.fullSize),!0),n=sortByWeight(filterByPosition(e,"left"),!0),r=sortByWeight(filterByPosition(e,"right")),i=sortByWeight(filterByPosition(e,"top"),!0),o=sortByWeight(filterByPosition(e,"bottom")),s=filterDynamicPositionByAxis(e,"x"),l=filterDynamicPositionByAxis(e,"y");return{fullSize:a,leftAndTop:n.concat(i),rightAndBottom:r.concat(l).concat(o).concat(s),chartArea:filterByPosition(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:i.concat(o).concat(s)}}function getCombinedMax(t,e,a,n){return Math.max(t[a],e[a])+Math.max(t[n],e[n])}function updateMaxPadding(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 updateDims(t,e,a,n){const{pos:r,box:i}=a,o=t.maxPadding;if(!isObject$8(r)){a.size&&(t[r]-=a.size);const d=n[a.stack]||{size:0,count:1};d.size=Math.max(d.size,a.horizontal?i.height:i.width),a.size=d.size/d.count,t[r]+=a.size}i.getPadding&&updateMaxPadding(o,i.getPadding());const s=Math.max(0,e.outerWidth-getCombinedMax(o,t,"left","right")),l=Math.max(0,e.outerHeight-getCombinedMax(o,t,"top","bottom")),u=s!==t.w,c=l!==t.h;return t.w=s,t.h=l,a.horizontal?{same:u,other:c}:{same:c,other:u}}function handleMaxPadding(t){const e=t.maxPadding;function a(n){const r=Math.max(e[n]-t[n],0);return t[n]+=r,r}t.y+=a("top"),t.x+=a("left"),a("right"),a("bottom")}function getMargins(t,e){const a=e.maxPadding;function n(r){const i={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{i[o]=Math.max(e[o],a[o])}),i}return n(t?["left","right"]:["top","bottom"])}function fitBoxes(t,e,a,n){const r=[];let i,o,s,l,u,c;for(i=0,o=t.length,u=0;i<o;++i){s=t[i],l=s.box,l.update(s.width||e.w,s.height||e.h,getMargins(s.horizontal,e));const{same:d,other:h}=updateDims(e,a,s,n);u|=d&&r.length,c=c||h,l.fullSize||r.push(s)}return u&&fitBoxes(r,e,a,n)||c}function setBoxDims(t,e,a,n,r){t.top=a,t.left=e,t.right=e+n,t.bottom=a+r,t.width=n,t.height=r}function placeBoxes(t,e,a,n){const r=a.padding;let{x:i,y:o}=e;for(const s of t){const l=s.box,u=n[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/u.weight||1;if(s.horizontal){const d=e.w*c,h=u.size||l.height;defined$1(u.start)&&(o=u.start),l.fullSize?setBoxDims(l,r.left,o,a.outerWidth-r.right-r.left,h):setBoxDims(l,e.left+u.placed,o,d,h),u.start=o,u.placed+=d,o=l.bottom}else{const d=e.h*c,h=u.size||l.width;defined$1(u.start)&&(i=u.start),l.fullSize?setBoxDims(l,i,r.top,h,a.outerHeight-r.bottom-r.top):setBoxDims(l,i,e.top+u.placed,h,d),u.start=i,u.placed+=d,i=l.right}}e.x=i,e.y=o}var layouts={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(a){e.draw(a)}}]},t.boxes.push(e)},removeBox(t,e){const a=t.boxes?t.boxes.indexOf(e):-1;a!==-1&&t.boxes.splice(a,1)},configure(t,e,a){e.fullSize=a.fullSize,e.position=a.position,e.weight=a.weight},update(t,e,a,n){if(!t)return;const r=toPadding(t.options.layout.padding),i=Math.max(e-r.width,0),o=Math.max(a-r.height,0),s=buildLayoutBoxes(t.boxes),l=s.vertical,u=s.horizontal;each(t.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const c=l.reduce((v,y)=>y.box.options&&y.box.options.display===!1?v:v+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:a,padding:r,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},r);updateMaxPadding(h,toPadding(n));const m=Object.assign({maxPadding:h,w:i,h:o,x:r.left,y:r.top},r),p=setLayoutDims(l.concat(u),d);fitBoxes(s.fullSize,m,d,p),fitBoxes(l,m,d,p),fitBoxes(u,m,d,p)&&fitBoxes(l,m,d,p),handleMaxPadding(m),placeBoxes(s.leftAndTop,m,d,p),m.x+=m.w,m.y+=m.h,placeBoxes(s.rightAndBottom,m,d,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},each(s.chartArea,v=>{const y=v.box;Object.assign(y,t.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(e,a){}releaseContext(e){return!1}addEventListener(e,a,n){}removeEventListener(e,a,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,a,n,r){return a=Math.max(0,a||e.width),n=n||e.height,{width:a,height:Math.max(0,r?Math.floor(a/r):n)}}isAttached(e){return!0}updateConfig(e){}}class BasicPlatform extends BasePlatform{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=t=>t===null||t==="";function initCanvas(t,e){const a=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[EXPANDO_KEY]={initial:{height:n,width:r,style:{display:a.display,height:a.height,width:a.width}}},a.display=a.display||"block",a.boxSizing=a.boxSizing||"border-box",isNullOrEmpty(r)){const i=readUsedSize(t,"width");i!==void 0&&(t.width=i)}if(isNullOrEmpty(n))if(t.style.height==="")t.height=t.width/(e||2);else{const i=readUsedSize(t,"height");i!==void 0&&(t.height=i)}return t}const eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(t,e,a){t.addEventListener(e,a,eventListenerOptions)}function removeListener(t,e,a){t.canvas.removeEventListener(e,a,eventListenerOptions)}function fromNativeEvent(t,e){const a=EVENT_TYPES[t.type]||t.type,{x:n,y:r}=getRelativePosition(t,e);return{type:a,chart:e,native:t,x:n!==void 0?n:null,y:r!==void 0?r:null}}function nodeListContains(t,e){for(const a of t)if(a===e||a.contains(e))return!0}function createAttachObserver(t,e,a){const n=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const s of i)o=o||nodeListContains(s.addedNodes,n),o=o&&!nodeListContains(s.removedNodes,n);o&&a()});return r.observe(document,{childList:!0,subtree:!0}),r}function createDetachObserver(t,e,a){const n=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const s of i)o=o||nodeListContains(s.removedNodes,n),o=o&&!nodeListContains(s.addedNodes,n);o&&a()});return r.observe(document,{childList:!0,subtree:!0}),r}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const t=window.devicePixelRatio;t!==oldDevicePixelRatio&&(oldDevicePixelRatio=t,drpListeningCharts.forEach((e,a)=>{a.currentDevicePixelRatio!==t&&e()}))}function listenDevicePixelRatioChanges(t,e){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(t,e)}function unlistenDevicePixelRatioChanges(t){drpListeningCharts.delete(t),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(t,e,a){const n=t.canvas,r=n&&_getParentNode(n);if(!r)return;const i=throttled((s,l)=>{const u=r.clientWidth;a(s,l),u<r.clientWidth&&a()},window),o=new ResizeObserver(s=>{const l=s[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||i(u,c)});return o.observe(r),listenDevicePixelRatioChanges(t,i),o}function releaseObserver(t,e,a){a&&a.disconnect(),e==="resize"&&unlistenDevicePixelRatioChanges(t)}function createProxyAndListen(t,e,a){const n=t.canvas,r=throttled(i=>{t.ctx!==null&&a(fromNativeEvent(i,t))},t);return addListener(n,e,r),r}class DomPlatform extends BasePlatform{acquireContext(e,a){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(initCanvas(e,a),n):null}releaseContext(e){const a=e.canvas;if(!a[EXPANDO_KEY])return!1;const n=a[EXPANDO_KEY].initial;["height","width"].forEach(i=>{const o=n[i];isNullOrUndef(o)?a.removeAttribute(i):a.setAttribute(i,o)});const r=n.style||{};return Object.keys(r).forEach(i=>{a.style[i]=r[i]}),a.width=a.width,delete a[EXPANDO_KEY],!0}addEventListener(e,a,n){this.removeEventListener(e,a);const r=e.$proxies||(e.$proxies={}),o={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[a]||createProxyAndListen;r[a]=o(e,a,n)}removeEventListener(e,a){const n=e.$proxies||(e.$proxies={}),r=n[a];if(!r)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[a]||removeListener)(e,a,r),n[a]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,a,n,r){return getMaximumSize(e,a,n,r)}isAttached(e){const a=_getParentNode(e);return!!(a&&a.isConnected)}}function _detectPlatform(t){return!_isDomSupported()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?BasicPlatform:DomPlatform}var ne;let Element$1=(ne=class{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(e){const{x:a,y:n}=this.getProps(["x","y"],e);return{x:a,y:n}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(e,a){const n=this.$animations;if(!a||!n)return this;const r={};return e.forEach(i=>{r[i]=n[i]&&n[i].active()?n[i]._to:this[i]}),r}},R(ne,"defaults",{}),R(ne,"defaultRoutes"),ne);function autoSkip(t,e){const a=t.options.ticks,n=determineMaxTicks(t),r=Math.min(a.maxTicksLimit||n,n),i=a.major.enabled?getMajorIndices(e):[],o=i.length,s=i[0],l=i[o-1],u=[];if(o>r)return skipMajors(e,u,i,o/r),u;const c=calculateSpacing(i,e,r);if(o>0){let d,h;const m=o>1?Math.round((l-s)/(o-1)):null;for(skip(e,u,c,isNullOrUndef(m)?0:s-m,s),d=0,h=o-1;d<h;d++)skip(e,u,c,i[d],i[d+1]);return skip(e,u,c,l,isNullOrUndef(m)?e.length:l+m),u}return skip(e,u,c),u}function determineMaxTicks(t){const e=t.options.offset,a=t._tickSize(),n=t._length/a+(e?0:1),r=t._maxLength/a;return Math.floor(Math.min(n,r))}function calculateSpacing(t,e,a){const n=getEvenSpacing(t),r=e.length/a;if(!n)return Math.max(r,1);const i=_factorize(n);for(let o=0,s=i.length-1;o<s;o++){const l=i[o];if(l>r)return l}return Math.max(r,1)}function getMajorIndices(t){const e=[];let a,n;for(a=0,n=t.length;a<n;a++)t[a].major&&e.push(a);return e}function skipMajors(t,e,a,n){let r=0,i=a[0],o;for(n=Math.ceil(n),o=0;o<t.length;o++)o===i&&(e.push(t[o]),r++,i=a[r*n])}function skip(t,e,a,n,r){const i=valueOrDefault(n,0),o=Math.min(valueOrDefault(r,t.length),t.length);let s=0,l,u,c;for(a=Math.ceil(a),r&&(l=r-n,a=l/Math.floor(l/a)),c=i;c<0;)s++,c=Math.round(i+s*a);for(u=Math.max(i,0);u<o;u++)u===c&&(e.push(t[u]),s++,c=Math.round(i+s*a))}function getEvenSpacing(t){const e=t.length;let a,n;if(e<2)return!1;for(n=t[0],a=1;a<e;++a)if(t[a]-t[a-1]!==n)return!1;return n}const reverseAlign=t=>t==="left"?"right":t==="right"?"left":t,offsetFromEdge=(t,e,a)=>e==="top"||e==="left"?t[e]+a:t[e]-a,getTicksLimit=(t,e)=>Math.min(e||t,t);function sample(t,e){const a=[],n=t.length/e,r=t.length;let i=0;for(;i<r;i+=n)a.push(t[Math.floor(i)]);return a}function getPixelForGridLine(t,e,a){const n=t.ticks.length,r=Math.min(e,n-1),i=t._startPixel,o=t._endPixel,s=1e-6;let l=t.getPixelForTick(r),u;if(!(a&&(n===1?u=Math.max(l-i,o-l):e===0?u=(t.getPixelForTick(1)-l)/2:u=(l-t.getPixelForTick(r-1))/2,l+=r<e?u:-u,l<i-s||l>o+s)))return l}function garbageCollect(t,e){each(t,a=>{const n=a.gc,r=n.length/2;let i;if(r>e){for(i=0;i<r;++i)delete a.data[n[i]];n.splice(0,r)}})}function getTickMarkLength(t){return t.drawTicks?t.tickLength:0}function getTitleHeight(t,e){if(!t.display)return 0;const a=toFont(t.font,e),n=toPadding(t.padding);return(isArray$c(t.text)?t.text.length:1)*a.lineHeight+n.height}function createScaleContext(t,e){return createContext(t,{scale:e,type:"scale"})}function createTickContext(t,e,a){return createContext(t,{tick:a,index:e,type:"tick"})}function titleAlign(t,e,a){let n=_toLeftRightCenter(t);return(a&&e!=="right"||!a&&e==="right")&&(n=reverseAlign(n)),n}function titleArgs(t,e,a,n){const{top:r,left:i,bottom:o,right:s,chart:l}=t,{chartArea:u,scales:c}=l;let d=0,h,m,p;const v=o-r,y=s-i;if(t.isHorizontal()){if(m=_alignStartEnd(n,i,s),isObject$8(a)){const w=Object.keys(a)[0],_=a[w];p=c[w].getPixelForValue(_)+v-e}else a==="center"?p=(u.bottom+u.top)/2+v-e:p=offsetFromEdge(t,a,e);h=s-i}else{if(isObject$8(a)){const w=Object.keys(a)[0],_=a[w];m=c[w].getPixelForValue(_)-y+e}else a==="center"?m=(u.left+u.right)/2-y+e:m=offsetFromEdge(t,a,e);p=_alignStartEnd(n,o,r),d=a==="left"?-HALF_PI:HALF_PI}return{titleX:m,titleY:p,maxWidth:h,rotation:d}}class Scale extends Element$1{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,a){return e}getUserBounds(){let{_userMin:e,_userMax:a,_suggestedMin:n,_suggestedMax:r}=this;return e=finiteOrDefault(e,Number.POSITIVE_INFINITY),a=finiteOrDefault(a,Number.NEGATIVE_INFINITY),n=finiteOrDefault(n,Number.POSITIVE_INFINITY),r=finiteOrDefault(r,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(e,n),max:finiteOrDefault(a,r),minDefined:isNumberFinite(e),maxDefined:isNumberFinite(a)}}getMinMax(e){let{min:a,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),o;if(r&&i)return{min:a,max:n};const s=this.getMatchingVisibleMetas();for(let l=0,u=s.length;l<u;++l)o=s[l].controller.getMinMax(this,e),r||(a=Math.min(a,o.min)),i||(n=Math.max(n,o.max));return a=i&&a>n?n:a,n=r&&a>n?a:n,{min:finiteOrDefault(a,finiteOrDefault(n,a)),max:finiteOrDefault(n,finiteOrDefault(a,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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(e,a,n){const{beginAtZero:r,grace:i,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=a,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?sample(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,a,n;this.isHorizontal()?(a=this.left,n=this.right):(a=this.top,n=this.bottom,e=!e),this._startPixel=a,this._endPixel=n,this._reversePixels=e,this._length=n-a,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(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(){callback(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),callback(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const a=this.options.ticks;let n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=callback(a.callback,[i.value,n,e],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,a=e.ticks,n=getTicksLimit(this.ticks.length,e.ticks.maxTicksLimit),r=a.minRotation||0,i=a.maxRotation;let o=r,s,l,u;if(!this._isVisible()||!a.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}const c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,m=_limitValue(this.chart.width-d,0,this.maxWidth);s=e.offset?this.maxWidth/n:m/(n-1),d+6>s&&(s=m/(n-(e.offset?.5:1)),l=this.maxHeight-getTickMarkLength(e.grid)-a.padding-getTitleHeight(e.title,this.chart.options.font),u=Math.sqrt(d*d+h*h),o=toDegrees(Math.min(Math.asin(_limitValue((c.highest.height+6)/s,-1,1)),Math.asin(_limitValue(l/u,-1,1))-Math.asin(_limitValue(h/u,-1,1)))),o=Math.max(r,Math.min(i,o))),this.labelRotation=o}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:a,options:{ticks:n,title:r,grid:i}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const l=getTitleHeight(r,a.options.font);if(s?(e.width=this.maxWidth,e.height=getTickMarkLength(i)+l):(e.height=this.maxHeight,e.width=getTickMarkLength(i)+l),n.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:h}=this._getLabelSizes(),m=n.padding*2,p=toRadians(this.labelRotation),v=Math.cos(p),y=Math.sin(p);if(s){const w=n.mirror?0:y*d.width+v*h.height;e.height=Math.min(this.maxHeight,e.height+w+m)}else{const w=n.mirror?0:v*d.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+w+m)}this._calculatePadding(u,c,y,v)}}this._handleMargins(),s?(this.width=this._length=a.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=a.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,a,n,r){const{ticks:{align:i,padding:o},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;l?u?(h=r*e.width,m=n*a.height):(h=n*e.height,m=r*a.width):i==="start"?m=a.width:i==="end"?h=e.width:i!=="inner"&&(h=e.width/2,m=a.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((m-d+o)*this.width/(this.width-d),0)}else{let c=a.height/2,d=e.height/2;i==="start"?(c=0,d=e.height):i==="end"&&(c=a.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:a}=this.options;return a==="top"||a==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let a,n;for(a=0,n=e.length;a<n;a++)isNullOrUndef(e[a].label)&&(e.splice(a,1),n--,a--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const a=this.options.ticks.sampleSize;let n=this.ticks;a<n.length&&(n=sample(n,a)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,a,n){const{ctx:r,_longestTextCache:i}=this,o=[],s=[],l=Math.floor(a/getTicksLimit(a,n));let u=0,c=0,d,h,m,p,v,y,w,_,D,k,O;for(d=0;d<a;d+=l){if(p=e[d].label,v=this._resolveTickFontOptions(d),r.font=y=v.string,w=i[y]=i[y]||{data:{},gc:[]},_=v.lineHeight,D=k=0,!isNullOrUndef(p)&&!isArray$c(p))D=_measureText(r,w.data,w.gc,D,p),k=_;else if(isArray$c(p))for(h=0,m=p.length;h<m;++h)O=p[h],!isNullOrUndef(O)&&!isArray$c(O)&&(D=_measureText(r,w.data,w.gc,D,O),k+=_);o.push(D),s.push(k),u=Math.max(D,u),c=Math.max(k,c)}garbageCollect(i,a);const N=o.indexOf(u),F=s.indexOf(c),g=b=>({width:o[b]||0,height:s[b]||0});return{first:g(0),last:g(a-1),widest:g(N),highest:g(F),widths:o,heights:s}}getLabelForValue(e){return e}getPixelForValue(e,a){return NaN}getValueForPixel(e){}getPixelForTick(e){const a=this.ticks;return e<0||e>a.length-1?null:this.getPixelForValue(a[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const a=this._startPixel+e*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,a,0):a)}getDecimalForPixel(e){const a=(e-this._startPixel)/this._length;return this._reversePixels?1-a:a}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:a}=this;return e<0&&a<0?a:e>0&&a>0?e:0}getContext(e){const a=this.ticks||[];if(e>=0&&e<a.length){const n=a[e];return n.$context||(n.$context=createTickContext(this.getContext(),e,n))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,a=toRadians(this.labelRotation),n=Math.abs(Math.cos(a)),r=Math.abs(Math.sin(a)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,s=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return this.isHorizontal()?l*n>s*r?s/n:l/r:l*r<s*n?l/n:s/r}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const a=this.axis,n=this.chart,r=this.options,{grid:i,position:o,border:s}=r,l=i.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=getTickMarkLength(i),m=[],p=s.setContext(this.getContext()),v=p.display?p.width:0,y=v/2,w=function(T){return _alignPixel(n,T,v)};let _,D,k,O,N,F,g,b,$,S,P,M;if(o==="top")_=w(this.bottom),F=this.bottom-h,b=_-y,S=w(e.top)+y,M=e.bottom;else if(o==="bottom")_=w(this.top),S=e.top,M=w(e.bottom)-y,F=_+y,b=this.top+h;else if(o==="left")_=w(this.right),N=this.right-h,g=_-y,$=w(e.left)+y,P=e.right;else if(o==="right")_=w(this.left),$=e.left,P=w(e.right)-y,N=_+y,g=this.left+h;else if(a==="x"){if(o==="center")_=w((e.top+e.bottom)/2+.5);else if(isObject$8(o)){const T=Object.keys(o)[0],x=o[T];_=w(this.chart.scales[T].getPixelForValue(x))}S=e.top,M=e.bottom,F=_+y,b=F+h}else if(a==="y"){if(o==="center")_=w((e.left+e.right)/2);else if(isObject$8(o)){const T=Object.keys(o)[0],x=o[T];_=w(this.chart.scales[T].getPixelForValue(x))}N=_-y,g=N-h,$=e.left,P=e.right}const C=valueOrDefault(r.ticks.maxTicksLimit,d),E=Math.max(1,Math.ceil(d/C));for(D=0;D<d;D+=E){const T=this.getContext(D),x=i.setContext(T),A=s.setContext(T),L=x.lineWidth,I=x.color,W=A.dash||[],z=A.dashOffset,U=x.tickWidth,B=x.tickColor,V=x.tickBorderDash||[],H=x.tickBorderDashOffset;k=getPixelForGridLine(this,D,l),k!==void 0&&(O=_alignPixel(n,k,L),u?N=g=$=P=O:F=b=S=M=O,m.push({tx1:N,ty1:F,tx2:g,ty2:b,x1:$,y1:S,x2:P,y2:M,width:L,color:I,borderDash:W,borderDashOffset:z,tickWidth:U,tickColor:B,tickBorderDash:V,tickBorderDashOffset:H}))}return this._ticksLength=d,this._borderValue=_,m}_computeLabelItems(e){const a=this.axis,n=this.options,{position:r,ticks:i}=n,o=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=i,h=getTickMarkLength(n.grid),m=h+c,p=d?-c:m,v=-toRadians(this.labelRotation),y=[];let w,_,D,k,O,N,F,g,b,$,S,P,M="middle";if(r==="top")N=this.bottom-p,F=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+p,F=this._getXAxisLabelAlignment();else if(r==="left"){const E=this._getYAxisLabelAlignment(h);F=E.textAlign,O=E.x}else if(r==="right"){const E=this._getYAxisLabelAlignment(h);F=E.textAlign,O=E.x}else if(a==="x"){if(r==="center")N=(e.top+e.bottom)/2+m;else if(isObject$8(r)){const E=Object.keys(r)[0],T=r[E];N=this.chart.scales[E].getPixelForValue(T)+m}F=this._getXAxisLabelAlignment()}else if(a==="y"){if(r==="center")O=(e.left+e.right)/2-m;else if(isObject$8(r)){const E=Object.keys(r)[0],T=r[E];O=this.chart.scales[E].getPixelForValue(T)}F=this._getYAxisLabelAlignment(h).textAlign}a==="y"&&(l==="start"?M="top":l==="end"&&(M="bottom"));const C=this._getLabelSizes();for(w=0,_=s.length;w<_;++w){D=s[w],k=D.label;const E=i.setContext(this.getContext(w));g=this.getPixelForTick(w)+i.labelOffset,b=this._resolveTickFontOptions(w),$=b.lineHeight,S=isArray$c(k)?k.length:1;const T=S/2,x=E.color,A=E.textStrokeColor,L=E.textStrokeWidth;let I=F;o?(O=g,F==="inner"&&(w===_-1?I=this.options.reverse?"left":"right":w===0?I=this.options.reverse?"right":"left":I="center"),r==="top"?u==="near"||v!==0?P=-S*$+$/2:u==="center"?P=-C.highest.height/2-T*$+$:P=-C.highest.height+$/2:u==="near"||v!==0?P=$/2:u==="center"?P=C.highest.height/2-T*$:P=C.highest.height-S*$,d&&(P*=-1),v!==0&&!E.showLabelBackdrop&&(O+=$/2*Math.sin(v))):(N=g,P=(1-S)*$/2);let W;if(E.showLabelBackdrop){const z=toPadding(E.backdropPadding),U=C.heights[w],B=C.widths[w];let V=P-z.top,H=0-z.left;switch(M){case"middle":V-=U/2;break;case"bottom":V-=U;break}switch(F){case"center":H-=B/2;break;case"right":H-=B;break}W={left:H,top:V,width:B+z.width,height:U+z.height,color:E.backdropColor}}y.push({label:k,font:b,textOffset:P,options:{rotation:v,color:x,strokeColor:A,strokeWidth:L,textAlign:I,textBaseline:M,translation:[O,N],backdrop:W}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:a}=this.options;if(-toRadians(this.labelRotation))return e==="top"?"left":"right";let r="center";return a.align==="start"?r="left":a.align==="end"?r="right":a.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:a,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,o=this._getLabelSizes(),s=e+i,l=o.widest.width;let u,c;return a==="left"?r?(c=this.right+i,n==="near"?u="left":n==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-s,n==="near"?u="right":n==="center"?(u="center",c-=l/2):(u="left",c=this.left)):a==="right"?r?(c=this.left+i,n==="near"?u="right":n==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+s,n==="near"?u="left":n==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,a=this.options.position;if(a==="left"||a==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(a==="top"||a==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:a},left:n,top:r,width:i,height:o}=this;a&&(e.save(),e.fillStyle=a,e.fillRect(n,r,i,o),e.restore())}getLineWidthForValue(e){const a=this.options.grid;if(!this._isVisible()||!a.display)return 0;const r=this.ticks.findIndex(i=>i.value===e);return r>=0?a.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const a=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,o;const s=(l,u,c)=>{!c.width||!c.color||(n.save(),n.lineWidth=c.width,n.strokeStyle=c.color,n.setLineDash(c.borderDash||[]),n.lineDashOffset=c.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(u.x,u.y),n.stroke(),n.restore())};if(a.display)for(i=0,o=r.length;i<o;++i){const l=r[i];a.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),a.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:a,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),o=n.display?i.width:0;if(!o)return;const s=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,h;this.isHorizontal()?(u=_alignPixel(e,this.left,o)-o/2,c=_alignPixel(e,this.right,s)+s/2,d=h=l):(d=_alignPixel(e,this.top,o)-o/2,h=_alignPixel(e,this.bottom,s)+s/2,u=c=l),a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.beginPath(),a.moveTo(u,d),a.lineTo(c,h),a.stroke(),a.restore()}drawLabels(e){if(!this.options.ticks.display)return;const n=this.ctx,r=this._computeLabelArea();r&&clipArea(n,r);const i=this.getLabelItems(e);for(const o of i){const s=o.options,l=o.font,u=o.label,c=o.textOffset;renderText(n,u,0,c,l,s)}r&&unclipArea(n)}drawTitle(){const{ctx:e,options:{position:a,title:n,reverse:r}}=this;if(!n.display)return;const i=toFont(n.font),o=toPadding(n.padding),s=n.align;let l=i.lineHeight/2;a==="bottom"||a==="center"||isObject$8(a)?(l+=o.bottom,isArray$c(n.text)&&(l+=i.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:h}=titleArgs(this,l,a,s);renderText(e,n.text,0,0,i,{color:n.color,maxWidth:d,rotation:h,textAlign:titleAlign(s,a,r),textBaseline:"middle",translation:[u,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,a=e.ticks&&e.ticks.z||0,n=valueOrDefault(e.grid&&e.grid.z,-1),r=valueOrDefault(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Scale.prototype.draw?[{z:a,draw:i=>{this.draw(i)}}]:[{z:n,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:a,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const a=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let i,o;for(i=0,o=a.length;i<o;++i){const s=a[i];s[n]===this.id&&(!e||s.type===e)&&r.push(s)}return r}_resolveTickFontOptions(e){const a=this.options.ticks.setContext(this.getContext(e));return toFont(a.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class TypedRegistry{constructor(e,a,n){this.type=e,this.scope=a,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const a=Object.getPrototypeOf(e);let n;isIChartComponent(a)&&(n=this.register(a));const r=this.items,i=e.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in r||(r[i]=e,registerDefaults(e,o,n),this.override&&defaults.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const a=this.items,n=e.id,r=this.scope;n in a&&delete a[n],r&&n in defaults[r]&&(delete defaults[r][n],this.override&&delete overrides[n])}}function registerDefaults(t,e,a){const n=merge(Object.create(null),[a?defaults.get(a):{},defaults.get(e),t.defaults]);defaults.set(e,n),t.defaultRoutes&&routeDefaults(e,t.defaultRoutes),t.descriptors&&defaults.describe(e,t.descriptors)}function routeDefaults(t,e){Object.keys(e).forEach(a=>{const n=a.split("."),r=n.pop(),i=[t].concat(n).join("."),o=e[a].split("."),s=o.pop(),l=o.join(".");defaults.route(i,r,l,s)})}function isIChartComponent(t){return"id"in t&&"defaults"in t}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$1,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,a,n){[...a].forEach(r=>{const i=n||this._getRegistryForType(r);n||i.isForType(r)||i===this.plugins&&r.id?this._exec(e,i,r):each(r,o=>{const s=n||this._getRegistryForType(o);this._exec(e,s,o)})})}_exec(e,a,n){const r=_capitalize(e);callback(n["before"+r],[],n),a[e](n),callback(n["after"+r],[],n)}_getRegistryForType(e){for(let a=0;a<this._typedRegistries.length;a++){const n=this._typedRegistries[a];if(n.isForType(e))return n}return this.plugins}_get(e,a,n){const r=a.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+n+".");return r}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(e,a,n,r){a==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const i=r?this._descriptors(e).filter(r):this._descriptors(e),o=this._notify(i,e,a,n);return a==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,a,n,r){r=r||{};for(const i of e){const o=i.plugin,s=o[n],l=[a,r,i.options];if(callback(s,l,o)===!1&&r.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const a=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),a}_createDescriptors(e,a){const n=e&&e.config,r=valueOrDefault(n.options&&n.options.plugins,{}),i=allPlugins(n);return r===!1&&!a?[]:createDescriptors(e,i,r,a)}_notifyStateChanges(e){const a=this._oldCache||[],n=this._cache,r=(i,o)=>i.filter(s=>!o.some(l=>s.plugin.id===l.plugin.id));this._notify(r(a,n),e,"stop"),this._notify(r(n,a),e,"start")}}function allPlugins(t){const e={},a=[],n=Object.keys(registry.plugins.items);for(let i=0;i<n.length;i++)a.push(registry.getPlugin(n[i]));const r=t.plugins||[];for(let i=0;i<r.length;i++){const o=r[i];a.indexOf(o)===-1&&(a.push(o),e[o.id]=!0)}return{plugins:a,localIds:e}}function getOpts(t,e){return!e&&t===!1?null:t===!0?{}:t}function createDescriptors(t,{plugins:e,localIds:a},n,r){const i=[],o=t.getContext();for(const s of e){const l=s.id,u=getOpts(n[l],r);u!==null&&i.push({plugin:s,options:pluginOpts(t.config,{plugin:s,local:a[l]},u,o)})}return i}function pluginOpts(t,{plugin:e,local:a},n,r){const i=t.pluginScopeKeys(e),o=t.getOptionScopes(n,i);return a&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(t,e){const a=defaults.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||a.indexAxis||"x"}function getAxisFromDefaultScaleID(t,e){let a=t;return t==="_index_"?a=e:t==="_value_"&&(a=e==="x"?"y":"x"),a}function getDefaultScaleIDFromAxis(t,e){return t===e?"_index_":"_value_"}function idMatchesAxis(t){if(t==="x"||t==="y"||t==="r")return t}function axisFromPosition(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function determineAxis(t,...e){if(idMatchesAxis(t))return t;for(const a of e){const n=a.axis||axisFromPosition(a.position)||t.length>1&&idMatchesAxis(t[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(t,e,a){if(a[e+"AxisID"]===t)return{axis:e}}function retrieveAxisFromDatasets(t,e){if(e.data&&e.data.datasets){const a=e.data.datasets.filter(n=>n.xAxisID===t||n.yAxisID===t);if(a.length)return getAxisFromDataset(t,"x",a[0])||getAxisFromDataset(t,"y",a[0])}return{}}function mergeScaleConfig(t,e){const a=overrides[t.type]||{scales:{}},n=e.scales||{},r=getIndexAxis(t.type,e),i=Object.create(null);return Object.keys(n).forEach(o=>{const s=n[o];if(!isObject$8(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=determineAxis(o,s,retrieveAxisFromDatasets(o,t),defaults.scales[s.type]),u=getDefaultScaleIDFromAxis(l,r),c=a.scales||{};i[o]=mergeIf(Object.create(null),[{axis:l},s,c[l],c[u]])}),t.data.datasets.forEach(o=>{const s=o.type||t.type,l=o.indexAxis||getIndexAxis(s,e),c=(overrides[s]||{}).scales||{};Object.keys(c).forEach(d=>{const h=getAxisFromDefaultScaleID(d,l),m=o[h+"AxisID"]||h;i[m]=i[m]||Object.create(null),mergeIf(i[m],[{axis:h},n[m],c[d]])})}),Object.keys(i).forEach(o=>{const s=i[o];mergeIf(s,[defaults.scales[s.type],defaults.scale])}),i}function initOptions(t){const e=t.options||(t.options={});e.plugins=valueOrDefault(e.plugins,{}),e.scales=mergeScaleConfig(t,e)}function initData(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function initConfig(t){return t=t||{},t.data=initData(t.data),initOptions(t),t}const keyCache=new Map,keysCached=new Set;function cachedKeys(t,e){let a=keyCache.get(t);return a||(a=e(),keyCache.set(t,a),keysCached.add(a)),a}const addIfFound=(t,e,a)=>{const n=resolveObjectKey(e,a);n!==void 0&&t.add(n)};class Config{constructor(e){this._config=initConfig(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=initData(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),initOptions(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return cachedKeys(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,a){return cachedKeys(`${e}.transition.${a}`,()=>[[`datasets.${e}.transitions.${a}`,`transitions.${a}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,a){return cachedKeys(`${e}-${a}`,()=>[[`datasets.${e}.elements.${a}`,`datasets.${e}`,`elements.${a}`,""]])}pluginScopeKeys(e){const a=e.id,n=this.type;return cachedKeys(`${n}-plugin-${a}`,()=>[[`plugins.${a}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,a){const n=this._scopeCache;let r=n.get(e);return(!r||a)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,a,n){const{options:r,type:i}=this,o=this._cachedScopes(e,n),s=o.get(a);if(s)return s;const l=new Set;a.forEach(c=>{e&&(l.add(e),c.forEach(d=>addIfFound(l,e,d))),c.forEach(d=>addIfFound(l,r,d)),c.forEach(d=>addIfFound(l,overrides[i]||{},d)),c.forEach(d=>addIfFound(l,defaults,d)),c.forEach(d=>addIfFound(l,descriptors,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),keysCached.has(a)&&o.set(a,u),u}chartOptionScopes(){const{options:e,type:a}=this;return[e,overrides[a]||{},defaults.datasets[a]||{},{type:a},defaults,descriptors]}resolveNamedOptions(e,a,n,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:s}=getResolver(this._resolverCache,e,r);let l=o;if(needContext(o,a)){i.$shared=!1,n=isFunction$3(n)?n():n;const u=this.createResolver(e,n,s);l=_attachContext(o,n,u)}for(const u of a)i[u]=l[u];return i}createResolver(e,a,n=[""],r){const{resolver:i}=getResolver(this._resolverCache,e,n);return isObject$8(a)?_attachContext(i,a,void 0,r):i}}function getResolver(t,e,a){let n=t.get(e);n||(n=new Map,t.set(e,n));const r=a.join();let i=n.get(r);return i||(i={resolver:_createResolver(e,a),subPrefixes:a.filter(s=>!s.toLowerCase().includes("hover"))},n.set(r,i)),i}const hasFunction=t=>isObject$8(t)&&Object.getOwnPropertyNames(t).reduce((e,a)=>e||isFunction$3(t[a]),!1);function needContext(t,e){const{isScriptable:a,isIndexable:n}=_descriptors(t);for(const r of e){const i=a(r),o=n(r),s=(o||i)&&t[r];if(i&&(isFunction$3(s)||hasFunction(s))||o&&isArray$c(s))return!0}return!1}var version="4.3.3";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(t,e){return t==="top"||t==="bottom"||KNOWN_POSITIONS.indexOf(t)===-1&&e==="x"}function compare2Level(t,e){return function(a,n){return a[t]===n[t]?a[e]-n[e]:a[t]-n[t]}}function onAnimationsComplete(t){const e=t.chart,a=e.options.animation;e.notifyPlugins("afterRender"),callback(a&&a.onComplete,[t],e)}function onAnimationProgress(t){const e=t.chart,a=e.options.animation;callback(a&&a.onProgress,[t],e)}function getCanvas(t){return _isDomSupported()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const instances={},getChart=t=>{const e=getCanvas(t);return Object.values(instances).filter(a=>a.canvas===e).pop()};function moveNumericKeys(t,e,a){const n=Object.keys(t);for(const r of n){const i=+r;if(i>=e){const o=t[r];delete t[r],(a>0||i>e)&&(t[i+a]=o)}}}function determineLastEvent(t,e,a,n){return!a||t.type==="mouseout"?null:n?e:t}function getDatasetArea(t){const{xScale:e,yScale:a}=t;if(e&&a)return{left:e.left,right:e.right,top:a.top,bottom:a.bottom}}class Chart{static register(...e){registry.add(...e),invalidatePlugins()}static unregister(...e){registry.remove(...e),invalidatePlugins()}constructor(e,a){const n=this.config=new Config(a),r=getCanvas(e),i=getChart(r);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||_detectPlatform(r)),this.platform.updateConfig(n);const s=this.platform.acquireContext(r,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;if(this.id=uid(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:a},width:n,height:r,_aspectRatio:i}=this;return isNullOrUndef(e)?a&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(e,a){animator.running(this)?this._resizeBeforeDraw={width:e,height:a}:this._resize(e,a)}_resize(e,a){const n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,e,a,i),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,retinaScale(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),callback(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const a=this.options.scales||{};each(a,(n,r)=>{n.id=r})}buildOrUpdateScales(){const e=this.options,a=e.scales,n=this.scales,r=Object.keys(n).reduce((o,s)=>(o[s]=!1,o),{});let i=[];a&&(i=i.concat(Object.keys(a).map(o=>{const s=a[o],l=determineAxis(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),each(i,o=>{const s=o.options,l=s.id,u=determineAxis(l,s),c=valueOrDefault(s.type,o.dtype);(s.position===void 0||positionIsHorizontal(s.position,u)!==positionIsHorizontal(o.dposition))&&(s.position=o.dposition),r[l]=!0;let d=null;if(l in n&&n[l].type===c)d=n[l];else{const h=registry.getScale(c);d=new h({id:l,type:c,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(s,e)}),each(r,(o,s)=>{o||delete n[s]}),each(n,o=>{layouts.configure(this,o,o.options),layouts.addBox(this,o)})}_updateMetasets(){const e=this._metasets,a=this.data.datasets.length,n=e.length;if(e.sort((r,i)=>r.index-i.index),n>a){for(let r=a;r<n;++r)this._destroyDatasetMeta(r);e.splice(a,n-a)}this._sortedMetasets=e.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:a}}=this;e.length>a.length&&delete this._stacks,e.forEach((n,r)=>{a.filter(i=>i===n._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],a=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=a.length;n<r;n++){const i=a[n];let o=this.getDatasetMeta(n);const s=i.type||this.config.type;if(o.type&&o.type!==s&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=s,o.indexAxis=i.indexAxis||getIndexAxis(s,this.options),o.order=i.order||0,o.index=n,o.label=""+i.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const l=registry.getController(s),{datasetElementType:u,dataElementType:c}=defaults.datasets[s];Object.assign(l,{dataElementType:registry.getElement(c),datasetElementType:u&&registry.getElement(u)}),o.controller=new l(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){each(this.data.datasets,(e,a)=>{this.getDatasetMeta(a).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const a=this.config;a.update();const n=this._options=a.createResolver(a.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),h=!r&&i.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),r||each(i,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(compare2Level("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){each(this.scales,e=>{layouts.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,a=new Set(Object.keys(this._listeners)),n=new Set(e.events);(!setsEqual(a,n)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,a=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:i}of a){const o=n==="_removeElements"?-i:i;moveNumericKeys(e,r,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const a=this.data.datasets.length,n=i=>new Set(e.filter(o=>o[0]===i).map((o,s)=>s+","+o.splice(1).join(","))),r=n(0);for(let i=1;i<a;i++)if(!setsEqual(r,n(i)))return;return Array.from(r).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,e);const a=this.chartArea,n=a.width<=0||a.height<=0;this._layers=[],each(this.boxes,r=>{n&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,i)=>{r._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let a=0,n=this.data.datasets.length;a<n;++a)this.getDatasetMeta(a).controller.configure();for(let a=0,n=this.data.datasets.length;a<n;++a)this._updateDataset(a,isFunction$3(e)?e({datasetIndex:a}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,a){const n=this.getDatasetMeta(e),r={meta:n,index:e,mode:a,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(n.controller._update(a),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:n,height:r}=this._resizeBeforeDraw;this._resize(n,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const a=this._layers;for(e=0;e<a.length&&a[e].z<=0;++e)a[e].draw(this.chartArea);for(this._drawDatasets();e<a.length;++e)a[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const a=this._sortedMetasets,n=[];let r,i;for(r=0,i=a.length;r<i;++r){const o=a[r];(!e||o.visible)&&n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let a=e.length-1;a>=0;--a)this._drawDataset(e[a]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const a=this.ctx,n=e._clip,r=!n.disabled,i=getDatasetArea(e)||this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(r&&clipArea(a,{left:n.left===!1?0:i.left-n.left,right:n.right===!1?this.width:i.right+n.right,top:n.top===!1?0:i.top-n.top,bottom:n.bottom===!1?this.height:i.bottom+n.bottom}),e.controller.draw(),r&&unclipArea(a),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return _isPointInArea(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,a,n,r){const i=Interaction.modes[a];return typeof i=="function"?i(this,e,n,r):[]}getDatasetMeta(e){const a=this.data.datasets[e],n=this._metasets;let r=n.filter(i=>i&&i._dataset===a).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:a&&a.order||0,index:e,_dataset:a,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const a=this.data.datasets[e];if(!a)return!1;const n=this.getDatasetMeta(e);return typeof n.hidden=="boolean"?!n.hidden:!a.hidden}setDatasetVisibility(e,a){const n=this.getDatasetMeta(e);n.hidden=!a}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,a,n){const r=n?"show":"hide",i=this.getDatasetMeta(e),o=i.controller._resolveAnimations(void 0,r);defined$1(a)?(i.data[a].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),o.update(i,{visible:n}),this.update(s=>s.datasetIndex===e?r:void 0))}hide(e,a){this._updateVisibility(e,a,!1)}show(e,a){this._updateVisibility(e,a,!0)}_destroyDatasetMeta(e){const a=this._metasets[e];a&&a.controller&&a.controller._destroy(),delete this._metasets[e]}_stop(){let e,a;for(this.stop(),animator.remove(this),e=0,a=this.data.datasets.length;e<a;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:a}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),clearCanvas(e,a),this.platform.releaseContext(a),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,a=this.platform,n=(i,o)=>{a.addEventListener(this,i,o),e[i]=o},r=(i,o,s)=>{i.offsetX=o,i.offsetY=s,this._eventHandler(i)};each(this.options.events,i=>n(i,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,a=this.platform,n=(l,u)=>{a.addEventListener(this,l,u),e[l]=u},r=(l,u)=>{e[l]&&(a.removeEventListener(this,l,u),delete e[l])},i=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const s=()=>{r("attach",s),this.attached=!0,this.resize(),n("resize",i),n("detach",o)};o=()=>{this.attached=!1,r("resize",i),this._stop(),this._resize(0,0),n("attach",s)},a.isAttached(this.canvas)?s():o()}unbindEvents(){each(this._listeners,(e,a)=>{this.platform.removeEventListener(this,a,e)}),this._listeners={},each(this._responsiveListeners,(e,a)=>{this.platform.removeEventListener(this,a,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,a,n){const r=n?"set":"remove";let i,o,s,l;for(a==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+r+"DatasetHoverStyle"]()),s=0,l=e.length;s<l;++s){o=e[s];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[r+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const a=this._active||[],n=e.map(({datasetIndex:i,index:o})=>{const s=this.getDatasetMeta(i);if(!s)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:s.data[o],index:o}});!_elementsEqual(n,a)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,a))}notifyPlugins(e,a,n){return this._plugins.notify(this,e,a,n)}isPluginEnabled(e){return this._plugins._cache.filter(a=>a.plugin.id===e).length===1}_updateHoverStyles(e,a,n){const r=this.options.hover,i=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=i(a,e),s=n?e:i(e,a);o.length&&this.updateHoverStyle(o,r.mode,!1),s.length&&r.mode&&this.updateHoverStyle(s,r.mode,!0)}_eventHandler(e,a){const n={event:e,replay:a,cancelable:!0,inChartArea:this.isPointInArea(e)},r=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",n,r)===!1)return;const i=this._handleEvent(e,a,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,a,n){const{_active:r=[],options:i}=this,o=a,s=this._getActiveElements(e,r,n,o),l=_isClickEvent(e),u=determineLastEvent(e,this._lastEvent,n,l);n&&(this._lastEvent=null,callback(i.onHover,[e,s,this],this),l&&callback(i.onClick,[e,s,this],this));const c=!_elementsEqual(s,r);return(c||a)&&(this._active=s,this._updateHoverStyles(s,r,a)),this._lastEvent=u,c}_getActiveElements(e,a,n,r){if(e.type==="mouseout")return[];if(!n)return a;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}}R(Chart,"defaults",defaults),R(Chart,"instances",instances),R(Chart,"overrides",overrides),R(Chart,"registry",registry),R(Chart,"version",version),R(Chart,"getChart",getChart);function invalidatePlugins(){return each(Chart.instances,t=>t._plugins.invalidate())}function clipArc(t,e,a){const{startAngle:n,pixelMargin:r,x:i,y:o,outerRadius:s,innerRadius:l}=e;let u=r/s;t.beginPath(),t.arc(i,o,s,n-u,a+u),l>r?(u=r/l,t.arc(i,o,l,a+u,n-u,!0)):t.arc(i,o,r,a+HALF_PI,n-HALF_PI),t.closePath(),t.clip()}function toRadiusCorners(t){return _readValueToProps(t,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(t,e,a,n){const r=toRadiusCorners(t.options.borderRadius),i=(a-e)/2,o=Math.min(i,n*e/2),s=l=>{const u=(a-Math.min(i,l))*n/2;return _limitValue(l,0,Math.min(i,u))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:_limitValue(r.innerStart,0,o),innerEnd:_limitValue(r.innerEnd,0,o)}}function rThetaToXY(t,e,a,n){return{x:a+t*Math.cos(e),y:n+t*Math.sin(e)}}function pathArc(t,e,a,n,r,i){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=e,d=Math.max(e.outerRadius+n+a-u,0),h=c>0?c+n+a+u:0;let m=0;const p=r-l;if(n){const E=c>0?c-n:0,T=d>0?d-n:0,x=(E+T)/2,A=x!==0?p*x/(x+n):p;m=(p-A)/2}const v=Math.max(.001,p*d-a/PI)/d,y=(p-v)/2,w=l+y+m,_=r-y-m,{outerStart:D,outerEnd:k,innerStart:O,innerEnd:N}=parseBorderRadius$1(e,h,d,_-w),F=d-D,g=d-k,b=w+D/F,$=_-k/g,S=h+O,P=h+N,M=w+O/S,C=_-N/P;if(t.beginPath(),i){const E=(b+$)/2;if(t.arc(o,s,d,b,E),t.arc(o,s,d,E,$),k>0){const L=rThetaToXY(g,$,o,s);t.arc(L.x,L.y,k,$,_+HALF_PI)}const T=rThetaToXY(P,_,o,s);if(t.lineTo(T.x,T.y),N>0){const L=rThetaToXY(P,C,o,s);t.arc(L.x,L.y,N,_+HALF_PI,C+Math.PI)}const x=(_-N/h+(w+O/h))/2;if(t.arc(o,s,h,_-N/h,x,!0),t.arc(o,s,h,x,w+O/h,!0),O>0){const L=rThetaToXY(S,M,o,s);t.arc(L.x,L.y,O,M+Math.PI,w-HALF_PI)}const A=rThetaToXY(F,w,o,s);if(t.lineTo(A.x,A.y),D>0){const L=rThetaToXY(F,b,o,s);t.arc(L.x,L.y,D,w-HALF_PI,b)}}else{t.moveTo(o,s);const E=Math.cos(b)*d+o,T=Math.sin(b)*d+s;t.lineTo(E,T);const x=Math.cos($)*d+o,A=Math.sin($)*d+s;t.lineTo(x,A)}t.closePath()}function drawArc(t,e,a,n,r){const{fullCircles:i,startAngle:o,circumference:s}=e;let l=e.endAngle;if(i){pathArc(t,e,a,n,l,r);for(let u=0;u<i;++u)t.fill();isNaN(s)||(l=o+(s%TAU||TAU))}return pathArc(t,e,a,n,l,r),t.fill(),l}function drawBorder(t,e,a,n,r){const{fullCircles:i,startAngle:o,circumference:s,options:l}=e,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:h}=l,m=l.borderAlign==="inner";if(!u)return;t.setLineDash(d||[]),t.lineDashOffset=h,m?(t.lineWidth=u*2,t.lineJoin=c||"round"):(t.lineWidth=u,t.lineJoin=c||"bevel");let p=e.endAngle;if(i){pathArc(t,e,a,n,p,r);for(let v=0;v<i;++v)t.stroke();isNaN(s)||(p=o+(s%TAU||TAU))}m&&clipArc(t,e,p),i||(pathArc(t,e,a,n,p,r),t.stroke())}class ArcElement extends Element$1{constructor(a){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,a&&Object.assign(this,a)}inRange(a,n,r){const i=this.getProps(["x","y"],r),{angle:o,distance:s}=getAngleFromPoint(i,{x:a,y:n}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,v=valueOrDefault(h,u-l)>=TAU||_angleBetween(o,l,u),y=_isBetween(s,c+m,d+m);return v&&y}getCenterPoint(a){const{x:n,y:r,startAngle:i,endAngle:o,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],a),{offset:u,spacing:c}=this.options,d=(i+o)/2,h=(s+l+c+u)/2;return{x:n+Math.cos(d)*h,y:r+Math.sin(d)*h}}tooltipPosition(a){return this.getCenterPoint(a)}draw(a){const{options:n,circumference:r}=this,i=(n.offset||0)/4,o=(n.spacing||0)/2,s=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>TAU?Math.floor(r/TAU):0,r===0||this.innerRadius<0||this.outerRadius<0)return;a.save();const l=(this.startAngle+this.endAngle)/2;a.translate(Math.cos(l)*i,Math.sin(l)*i);const u=1-Math.sin(Math.min(PI,r||0)),c=i*u;a.fillStyle=n.backgroundColor,a.strokeStyle=n.borderColor,drawArc(a,this,c,o,s),drawBorder(a,this,c,o,s),a.restore()}}R(ArcElement,"id","arc"),R(ArcElement,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),R(ArcElement,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(ArcElement,"descriptors",{_scriptable:!0,_indexable:a=>a!=="borderDash"});function setStyle$1(t,e,a=e){t.lineCap=valueOrDefault(a.borderCapStyle,e.borderCapStyle),t.setLineDash(valueOrDefault(a.borderDash,e.borderDash)),t.lineDashOffset=valueOrDefault(a.borderDashOffset,e.borderDashOffset),t.lineJoin=valueOrDefault(a.borderJoinStyle,e.borderJoinStyle),t.lineWidth=valueOrDefault(a.borderWidth,e.borderWidth),t.strokeStyle=valueOrDefault(a.borderColor,e.borderColor)}function lineTo(t,e,a){t.lineTo(a.x,a.y)}function getLineMethod(t){return t.stepped?_steppedLineTo:t.tension||t.cubicInterpolationMode==="monotone"?_bezierCurveTo:lineTo}function pathVars(t,e,a={}){const n=t.length,{start:r=0,end:i=n-1}=a,{start:o,end:s}=e,l=Math.max(r,o),u=Math.min(i,s),c=r<o&&i<o||r>s&&i>s;return{count:n,start:l,loop:e.loop,ilen:u<l&&!c?n+u-l:u-l}}function pathSegment(t,e,a,n){const{points:r,options:i}=e,{count:o,start:s,loop:l,ilen:u}=pathVars(r,a,n),c=getLineMethod(i);let{move:d=!0,reverse:h}=n||{},m,p,v;for(m=0;m<=u;++m)p=r[(s+(h?u-m:m))%o],!p.skip&&(d?(t.moveTo(p.x,p.y),d=!1):c(t,v,p,h,i.stepped),v=p);return l&&(p=r[(s+(h?u:0))%o],c(t,v,p,h,i.stepped)),!!l}function fastPathSegment(t,e,a,n){const r=e.points,{count:i,start:o,ilen:s}=pathVars(r,a,n),{move:l=!0,reverse:u}=n||{};let c=0,d=0,h,m,p,v,y,w;const _=k=>(o+(u?s-k:k))%i,D=()=>{v!==y&&(t.lineTo(c,y),t.lineTo(c,v),t.lineTo(c,w))};for(l&&(m=r[_(0)],t.moveTo(m.x,m.y)),h=0;h<=s;++h){if(m=r[_(h)],m.skip)continue;const k=m.x,O=m.y,N=k|0;N===p?(O<v?v=O:O>y&&(y=O),c=(d*c+k)/++d):(D(),t.lineTo(k,O),p=N,d=0,v=y=O),w=O}D()}function _getSegmentMethod(t){const e=t.options,a=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!a?fastPathSegment:pathSegment}function _getInterpolationMethod(t){return t.stepped?_steppedInterpolation:t.tension||t.cubicInterpolationMode==="monotone"?_bezierInterpolation:_pointInLine}function strokePathWithCache(t,e,a,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,a,n)&&r.closePath()),setStyle$1(t,e.options),t.stroke(r)}function strokePathDirect(t,e,a,n){const{segments:r,options:i}=e,o=_getSegmentMethod(e);for(const s of r)setStyle$1(t,i,s.style),t.beginPath(),o(t,e,s,{start:a,end:a+n-1})&&t.closePath(),t.stroke()}const usePath2D=typeof Path2D=="function";function draw(t,e,a,n){usePath2D&&!e.options.segment?strokePathWithCache(t,e,a,n):strokePathDirect(t,e,a,n)}class LineElement extends Element$1{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,a){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,n,e,r,a),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const e=this.segments,a=this.points;return e.length&&a[e[0].start]}last(){const e=this.segments,a=this.points,n=e.length;return n&&a[e[n-1].end]}interpolate(e,a){const n=this.options,r=e[a],i=this.points,o=_boundSegments(this,{property:a,start:r,end:r});if(!o.length)return;const s=[],l=_getInterpolationMethod(n);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:h}=o[u],m=i[d],p=i[h];if(m===p){s.push(m);continue}const v=Math.abs((r-m[a])/(p[a]-m[a])),y=l(m,p,v,n.stepped);y[a]=e[a],s.push(y)}return s.length===1?s[0]:s}pathSegment(e,a,n){return _getSegmentMethod(this)(e,this,a,n)}path(e,a,n){const r=this.segments,i=_getSegmentMethod(this);let o=this._loop;a=a||0,n=n||this.points.length-a;for(const s of r)o&=i(e,this,s,{start:a,end:a+n-1});return!!o}draw(e,a,n,r){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),draw(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(LineElement,"id","line"),R(LineElement,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(LineElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(LineElement,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function inRange$1(t,e,a,n){const r=t.options,{[a]:i}=t.getProps([a],n);return Math.abs(e-i)<r.radius+r.hitRadius}class PointElement extends Element$1{constructor(a){super();R(this,"parsed");R(this,"skip");R(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,a&&Object.assign(this,a)}inRange(a,n,r){const i=this.options,{x:o,y:s}=this.getProps(["x","y"],r);return Math.pow(a-o,2)+Math.pow(n-s,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(a,n){return inRange$1(this,a,"x",n)}inYRange(a,n){return inRange$1(this,a,"y",n)}getCenterPoint(a){const{x:n,y:r}=this.getProps(["x","y"],a);return{x:n,y:r}}size(a){a=a||this.options||{};let n=a.radius||0;n=Math.max(n,n&&a.hoverRadius||0);const r=n&&a.borderWidth||0;return(n+r)*2}draw(a,n){const r=this.options;this.skip||r.radius<.1||!_isPointInArea(this,n,this.size(r)/2)||(a.strokeStyle=r.borderColor,a.lineWidth=r.borderWidth,a.fillStyle=r.backgroundColor,drawPoint(a,r,this.x,this.y))}getRange(){const a=this.options||{};return a.radius+a.hitRadius}}R(PointElement,"id","point"),R(PointElement,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(PointElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function getBarBounds(t,e){const{x:a,y:n,base:r,width:i,height:o}=t.getProps(["x","y","base","width","height"],e);let s,l,u,c,d;return t.horizontal?(d=o/2,s=Math.min(a,r),l=Math.max(a,r),u=n-d,c=n+d):(d=i/2,s=a-d,l=a+d,u=Math.min(n,r),c=Math.max(n,r)),{left:s,top:u,right:l,bottom:c}}function skipOrLimit(t,e,a,n){return t?0:_limitValue(e,a,n)}function parseBorderWidth(t,e,a){const n=t.options.borderWidth,r=t.borderSkipped,i=toTRBL(n);return{t:skipOrLimit(r.top,i.top,0,a),r:skipOrLimit(r.right,i.right,0,e),b:skipOrLimit(r.bottom,i.bottom,0,a),l:skipOrLimit(r.left,i.left,0,e)}}function parseBorderRadius(t,e,a){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,i=toTRBLCorners(r),o=Math.min(e,a),s=t.borderSkipped,l=n||isObject$8(r);return{topLeft:skipOrLimit(!l||s.top||s.left,i.topLeft,0,o),topRight:skipOrLimit(!l||s.top||s.right,i.topRight,0,o),bottomLeft:skipOrLimit(!l||s.bottom||s.left,i.bottomLeft,0,o),bottomRight:skipOrLimit(!l||s.bottom||s.right,i.bottomRight,0,o)}}function boundingRects(t){const e=getBarBounds(t),a=e.right-e.left,n=e.bottom-e.top,r=parseBorderWidth(t,a/2,n/2),i=parseBorderRadius(t,a/2,n/2);return{outer:{x:e.left,y:e.top,w:a,h:n,radius:i},inner:{x:e.left+r.l,y:e.top+r.t,w:a-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,i.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(r.b,r.r))}}}}function inRange(t,e,a,n){const r=e===null,i=a===null,s=t&&!(r&&i)&&getBarBounds(t,n);return s&&(r||_isBetween(e,s.left,s.right))&&(i||_isBetween(a,s.top,s.bottom))}function hasRadius(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function addNormalRectPath(t,e){t.rect(e.x,e.y,e.w,e.h)}function inflateRect(t,e,a={}){const n=t.x!==a.x?-e:0,r=t.y!==a.y?-e:0,i=(t.x+t.w!==a.x+a.w?e:0)-n,o=(t.y+t.h!==a.y+a.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+i,h:t.h+o,radius:t.radius}}class BarElement extends Element$1{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:a,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:o}=boundingRects(this),s=hasRadius(o.radius)?addRoundedRectPath:addNormalRectPath;e.save(),(o.w!==i.w||o.h!==i.h)&&(e.beginPath(),s(e,inflateRect(o,a,i)),e.clip(),s(e,inflateRect(i,-a,o)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),s(e,inflateRect(i,a)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,a,n){return inRange(this,e,a,n)}inXRange(e,a){return inRange(this,e,null,a)}inYRange(e,a){return inRange(this,null,e,a)}getCenterPoint(e){const{x:a,y:n,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(a+r)/2:a,y:i?n:(n+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}R(BarElement,"id","bar"),R(BarElement,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(BarElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const BORDER_COLORS=["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)"],BACKGROUND_COLORS=BORDER_COLORS.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function getBorderColor(t){return BORDER_COLORS[t%BORDER_COLORS.length]}function getBackgroundColor(t){return BACKGROUND_COLORS[t%BACKGROUND_COLORS.length]}function colorizeDefaultDataset(t,e){return t.borderColor=getBorderColor(e),t.backgroundColor=getBackgroundColor(e),++e}function colorizeDoughnutDataset(t,e){return t.backgroundColor=t.data.map(()=>getBorderColor(e++)),e}function colorizePolarAreaDataset(t,e){return t.backgroundColor=t.data.map(()=>getBackgroundColor(e++)),e}function getColorizer(t){let e=0;return(a,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof DoughnutController?e=colorizeDoughnutDataset(a,e):r instanceof PolarAreaController?e=colorizePolarAreaDataset(a,e):r&&(e=colorizeDefaultDataset(a,e))}}function containsColorsDefinitions(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function containsColorsDefinition(t){return t&&(t.borderColor||t.backgroundColor)}var plugin_colors={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,a){if(!a.enabled)return;const{data:{datasets:n},options:r}=t.config,{elements:i}=r;if(!a.forceOverride&&(containsColorsDefinitions(n)||containsColorsDefinition(r)||i&&containsColorsDefinitions(i)))return;const o=getColorizer(t);n.forEach(o)}};function _segments(t,e,a){const n=t.segments,r=t.points,i=e.points,o=[];for(const s of n){let{start:l,end:u}=s;u=_findSegmentEnd(l,u,r);const c=_getBounds(a,r[l],r[u],s.loop);if(!e.segments){o.push({source:s,target:c,start:r[l],end:r[u]});continue}const d=_boundSegments(e,c);for(const h of d){const m=_getBounds(a,i[h.start],i[h.end],h.loop),p=_boundSegment(s,r,m);for(const v of p)o.push({source:v,target:h,start:{[a]:_getEdge(c,m,"start",Math.max)},end:{[a]:_getEdge(c,m,"end",Math.min)}})}}return o}function _getBounds(t,e,a,n){if(n)return;let r=e[t],i=a[t];return t==="angle"&&(r=_normalizeAngle(r),i=_normalizeAngle(i)),{property:t,start:r,end:i}}function _pointsFromSegments(t,e){const{x:a=null,y:n=null}=t||{},r=e.points,i=[];return e.segments.forEach(({start:o,end:s})=>{s=_findSegmentEnd(o,s,r);const l=r[o],u=r[s];n!==null?(i.push({x:l.x,y:n}),i.push({x:u.x,y:n})):a!==null&&(i.push({x:a,y:l.y}),i.push({x:a,y:u.y}))}),i}function _findSegmentEnd(t,e,a){for(;e>t;e--){const n=a[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function _getEdge(t,e,a,n){return t&&e?n(t[a],e[a]):t?t[a]:e?e[a]:0}function _createBoundaryLine(t,e){let a=[],n=!1;return isArray$c(t)?(n=!0,a=t):a=_pointsFromSegments(t,e),a.length?new LineElement({points:a,options:{tension:0},_loop:n,_fullLoop:n}):null}function _shouldApplyFill(t){return t&&t.fill!==!1}function _resolveTarget(t,e,a){let r=t[e].fill;const i=[e];let o;if(!a)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!isNumberFinite(r))return r;if(o=t[r],!o)return!1;if(o.visible)return r;i.push(r),r=o.fill}return!1}function _decodeFill(t,e,a){const n=parseFillOption(t);if(isObject$8(n))return isNaN(n.value)?!1:n;let r=parseFloat(n);return isNumberFinite(r)&&Math.floor(r)===r?decodeTargetIndex(n[0],e,r,a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function decodeTargetIndex(t,e,a,n){return(t==="-"||t==="+")&&(a=e+a),a===e||a<0||a>=n?!1:a}function _getTargetPixel(t,e){let a=null;return t==="start"?a=e.bottom:t==="end"?a=e.top:isObject$8(t)?a=e.getPixelForValue(t.value):e.getBasePixel&&(a=e.getBasePixel()),a}function _getTargetValue(t,e,a){let n;return t==="start"?n=a:t==="end"?n=e.options.reverse?e.min:e.max:isObject$8(t)?n=t.value:n=e.getBaseValue(),n}function parseFillOption(t){const e=t.options,a=e.fill;let n=valueOrDefault(a&&a.target,a);return n===void 0&&(n=!!e.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function _buildStackLine(t){const{scale:e,index:a,line:n}=t,r=[],i=n.segments,o=n.points,s=getLinesBelow(e,a);s.push(_createBoundaryLine({x:null,y:e.bottom},n));for(let l=0;l<i.length;l++){const u=i[l];for(let c=u.start;c<=u.end;c++)addPointsBelow(r,o[c],s)}return new LineElement({points:r,options:{}})}function getLinesBelow(t,e){const a=[],n=t.getMatchingVisibleMetas("line");for(let r=0;r<n.length;r++){const i=n[r];if(i.index===e)break;i.hidden||a.unshift(i.dataset)}return a}function addPointsBelow(t,e,a){const n=[];for(let r=0;r<a.length;r++){const i=a[r],{first:o,last:s,point:l}=findPoint(i,e,"x");if(!(!l||o&&s)){if(o)n.unshift(l);else if(t.push(l),!s)break}}t.push(...n)}function findPoint(t,e,a){const n=t.interpolate(e,a);if(!n)return{};const r=n[a],i=t.segments,o=t.points;let s=!1,l=!1;for(let u=0;u<i.length;u++){const c=i[u],d=o[c.start][a],h=o[c.end][a];if(_isBetween(r,d,h)){s=r===d,l=r===h;break}}return{first:s,last:l,point:n}}class simpleArc{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,a,n){const{x:r,y:i,radius:o}=this;return a=a||{start:0,end:TAU},e.arc(r,i,o,a.end,a.start,!0),!n.bounds}interpolate(e){const{x:a,y:n,radius:r}=this,i=e.angle;return{x:a+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}}function _getTarget(t){const{chart:e,fill:a,line:n}=t;if(isNumberFinite(a))return getLineByIndex(e,a);if(a==="stack")return _buildStackLine(t);if(a==="shape")return!0;const r=computeBoundary(t);return r instanceof simpleArc?r:_createBoundaryLine(r,n)}function getLineByIndex(t,e){const a=t.getDatasetMeta(e);return a&&t.isDatasetVisible(e)?a.dataset:null}function computeBoundary(t){return(t.scale||{}).getPointPositionForValue?computeCircularBoundary(t):computeLinearBoundary(t)}function computeLinearBoundary(t){const{scale:e={},fill:a}=t,n=_getTargetPixel(a,e);if(isNumberFinite(n)){const r=e.isHorizontal();return{x:r?n:null,y:r?null:n}}return null}function computeCircularBoundary(t){const{scale:e,fill:a}=t,n=e.options,r=e.getLabels().length,i=n.reverse?e.max:e.min,o=_getTargetValue(a,e,i),s=[];if(n.grid.circular){const l=e.getPointPositionForValue(0,i);return new simpleArc({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<r;++l)s.push(e.getPointPositionForValue(l,o));return s}function _drawfill(t,e,a){const n=_getTarget(e),{line:r,scale:i,axis:o}=e,s=r.options,l=s.fill,u=s.backgroundColor,{above:c=u,below:d=u}=l||{};n&&r.points.length&&(clipArea(t,a),doFill(t,{line:r,target:n,above:c,below:d,area:a,scale:i,axis:o}),unclipArea(t))}function doFill(t,e){const{line:a,target:n,above:r,below:i,area:o,scale:s}=e,l=a._loop?"angle":e.axis;t.save(),l==="x"&&i!==r&&(clipVertical(t,n,o.top),fill(t,{line:a,target:n,color:r,scale:s,property:l}),t.restore(),t.save(),clipVertical(t,n,o.bottom)),fill(t,{line:a,target:n,color:i,scale:s,property:l}),t.restore()}function clipVertical(t,e,a){const{segments:n,points:r}=e;let i=!0,o=!1;t.beginPath();for(const s of n){const{start:l,end:u}=s,c=r[l],d=r[_findSegmentEnd(l,u,r)];i?(t.moveTo(c.x,c.y),i=!1):(t.lineTo(c.x,a),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,s,{move:o}),o?t.closePath():t.lineTo(d.x,a)}t.lineTo(e.first().x,a),t.closePath(),t.clip()}function fill(t,e){const{line:a,target:n,property:r,color:i,scale:o}=e,s=_segments(a,n,r);for(const{source:l,target:u,start:c,end:d}of s){const{style:{backgroundColor:h=i}={}}=l,m=n!==!0;t.save(),t.fillStyle=h,clipBounds(t,o,m&&_getBounds(r,c,d)),t.beginPath();const p=!!a.pathSegment(t,l);let v;if(m){p?t.closePath():interpolatedLineTo(t,n,d,r);const y=!!n.pathSegment(t,u,{move:p,reverse:!0});v=p&&y,v||interpolatedLineTo(t,n,c,r)}t.closePath(),t.fill(v?"evenodd":"nonzero"),t.restore()}}function clipBounds(t,e,a){const{top:n,bottom:r}=e.chart.chartArea,{property:i,start:o,end:s}=a||{};i==="x"&&(t.beginPath(),t.rect(o,n,s-o,r-n),t.clip())}function interpolatedLineTo(t,e,a,n){const r=e.interpolate(a,n);r&&t.lineTo(r.x,r.y)}var index$1={id:"filler",afterDatasetsUpdate(t,e,a){const n=(t.data.datasets||[]).length,r=[];let i,o,s,l;for(o=0;o<n;++o)i=t.getDatasetMeta(o),s=i.dataset,l=null,s&&s.options&&s instanceof LineElement&&(l={visible:t.isDatasetVisible(o),index:o,fill:_decodeFill(s,o,n),chart:t,axis:i.controller.options.indexAxis,scale:i.vScale,line:s}),i.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],!(!l||l.fill===!1)&&(l.fill=_resolveTarget(r,o,a.propagate))},beforeDraw(t,e,a){const n=a.drawTime==="beforeDraw",r=t.getSortedVisibleDatasetMetas(),i=t.chartArea;for(let o=r.length-1;o>=0;--o){const s=r[o].$filler;s&&(s.line.updateControlPoints(i,s.axis),n&&s.fill&&_drawfill(t.ctx,s,i))}},beforeDatasetsDraw(t,e,a){if(a.drawTime!=="beforeDatasetsDraw")return;const n=t.getSortedVisibleDatasetMetas();for(let r=n.length-1;r>=0;--r){const i=n[r].$filler;_shouldApplyFill(i)&&_drawfill(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,a){const n=e.meta.$filler;!_shouldApplyFill(n)||a.drawTime!=="beforeDatasetDraw"||_drawfill(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=(t,e)=>{let{boxHeight:a=e,boxWidth:n=e}=t;return t.usePointStyle&&(a=Math.min(a,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:a,itemHeight:Math.max(e,a)}},itemsEqual=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Legend extends Element$1{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,a,n){this.maxWidth=e,this.maxHeight=a,this._margins=n,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 e=this.options.labels||{};let a=callback(e.generateLabels,[this.chart],this)||[];e.filter&&(a=a.filter(n=>e.filter(n,this.chart.data))),e.sort&&(a=a.sort((n,r)=>e.sort(n,r,this.chart.data))),this.options.reverse&&a.reverse(),this.legendItems=a}fit(){const{options:e,ctx:a}=this;if(!e.display){this.width=this.height=0;return}const n=e.labels,r=toFont(n.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=getBoxSize(n,i);let u,c;a.font=r.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,i,s,l)+10):(c=this.maxHeight,u=this._fitCols(o,r,s,l)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,a,n,r){const{ctx:i,maxWidth:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=r+s;let d=e;i.textAlign="left",i.textBaseline="middle";let h=-1,m=-c;return this.legendItems.forEach((p,v)=>{const y=n+a/2+i.measureText(p.text).width;(v===0||u[u.length-1]+y+2*s>o)&&(d+=c,u[u.length-(v>0?0:1)]=0,m+=c,h++),l[v]={left:0,top:m,row:h,width:y,height:r},u[u.length-1]+=y+s}),d}_fitCols(e,a,n,r){const{ctx:i,maxHeight:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-e;let d=s,h=0,m=0,p=0,v=0;return this.legendItems.forEach((y,w)=>{const{itemWidth:_,itemHeight:D}=calculateItemSize(n,a,i,y,r);w>0&&m+D+2*s>c&&(d+=h+s,u.push({width:h,height:m}),p+=h+s,v++,h=m=0),l[w]={left:p,top:m,col:v,width:_,height:D},h=Math.max(h,_),m+=D+s}),d+=h,u.push({width:h,height:m}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:a,options:{align:n,labels:{padding:r},rtl:i}}=this,o=getRtlAdapter(i,this.left,this.width);if(this.isHorizontal()){let s=0,l=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[s]);for(const u of a)s!==u.row&&(s=u.row,l=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[s])),u.top+=this.top+e+r,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+r}else{let s=0,l=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[s].height);for(const u of a)u.col!==s&&(s=u.col,l=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+r,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;clipArea(e,this),this._draw(),unclipArea(e)}}_draw(){const{options:e,columnSizes:a,lineWidths:n,ctx:r}=this,{align:i,labels:o}=e,s=defaults.color,l=getRtlAdapter(e.rtl,this.left,this.width),u=toFont(o.font),{padding:c}=o,d=u.size,h=d/2;let m;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:p,boxHeight:v,itemHeight:y}=getBoxSize(o,d),w=function(N,F,g){if(isNaN(p)||p<=0||isNaN(v)||v<0)return;r.save();const b=valueOrDefault(g.lineWidth,1);if(r.fillStyle=valueOrDefault(g.fillStyle,s),r.lineCap=valueOrDefault(g.lineCap,"butt"),r.lineDashOffset=valueOrDefault(g.lineDashOffset,0),r.lineJoin=valueOrDefault(g.lineJoin,"miter"),r.lineWidth=b,r.strokeStyle=valueOrDefault(g.strokeStyle,s),r.setLineDash(valueOrDefault(g.lineDash,[])),o.usePointStyle){const $={radius:v*Math.SQRT2/2,pointStyle:g.pointStyle,rotation:g.rotation,borderWidth:b},S=l.xPlus(N,p/2),P=F+h;drawPointLegend(r,$,S,P,o.pointStyleWidth&&p)}else{const $=F+Math.max((d-v)/2,0),S=l.leftForLtr(N,p),P=toTRBLCorners(g.borderRadius);r.beginPath(),Object.values(P).some(M=>M!==0)?addRoundedRectPath(r,{x:S,y:$,w:p,h:v,radius:P}):r.rect(S,$,p,v),r.fill(),b!==0&&r.stroke()}r.restore()},_=function(N,F,g){renderText(r,g.text,N,F+y/2,u,{strikethrough:g.hidden,textAlign:l.textAlign(g.textAlign)})},D=this.isHorizontal(),k=this._computeTitleHeight();D?m={x:_alignStartEnd(i,this.left+c,this.right-n[0]),y:this.top+c+k,line:0}:m={x:this.left+c,y:_alignStartEnd(i,this.top+k+c,this.bottom-a[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const O=y+c;this.legendItems.forEach((N,F)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const g=r.measureText(N.text).width,b=l.textAlign(N.textAlign||(N.textAlign=o.textAlign)),$=p+h+g;let S=m.x,P=m.y;l.setWidth(this.width),D?F>0&&S+$+c>this.right&&(P=m.y+=O,m.line++,S=m.x=_alignStartEnd(i,this.left+c,this.right-n[m.line])):F>0&&P+O>this.bottom&&(S=m.x=S+a[m.line].width+c,m.line++,P=m.y=_alignStartEnd(i,this.top+k+c,this.bottom-a[m.line].height));const M=l.x(S);if(w(M,P,N),S=_textX(b,S+p+h,D?S+$:this.right,e.rtl),_(l.x(S),P,N),D)m.x+=$+c;else if(typeof N.text!="string"){const C=u.lineHeight;m.y+=calculateLegendItemHeight(N,C)+c}else m.y+=O}),restoreTextDirection(this.ctx,e.textDirection)}drawTitle(){const e=this.options,a=e.title,n=toFont(a.font),r=toPadding(a.padding);if(!a.display)return;const i=getRtlAdapter(e.rtl,this.left,this.width),o=this.ctx,s=a.position,l=n.size/2,u=r.top+l;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,d=_alignStartEnd(e.align,d,this.right-h);else{const p=this.columnSizes.reduce((v,y)=>Math.max(v,y.height),0);c=u+_alignStartEnd(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=_alignStartEnd(s,d,d+h);o.textAlign=i.textAlign(_toLeftRightCenter(s)),o.textBaseline="middle",o.strokeStyle=a.color,o.fillStyle=a.color,o.font=n.string,renderText(o,a.text,m,c,n)}_computeTitleHeight(){const e=this.options.title,a=toFont(e.font),n=toPadding(e.padding);return e.display?a.lineHeight+n.height:0}_getLegendItemAt(e,a){let n,r,i;if(_isBetween(e,this.left,this.right)&&_isBetween(a,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],_isBetween(e,r.left,r.left+r.width)&&_isBetween(a,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){const a=this.options;if(!isListened(e.type,a))return;const n=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,i=itemsEqual(r,n);r&&!i&&callback(a.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&callback(a.onHover,[e,n,this],this)}else n&&callback(a.onClick,[e,n,this],this)}}function calculateItemSize(t,e,a,n,r){const i=calculateItemWidth(n,t,e,a),o=calculateItemHeight(r,n,e.lineHeight);return{itemWidth:i,itemHeight:o}}function calculateItemWidth(t,e,a,n){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((i,o)=>i.length>o.length?i:o)),e+a.size/2+n.measureText(r).width}function calculateItemHeight(t,e,a){let n=t;return typeof e.text!="string"&&(n=calculateLegendItemHeight(e,a)),n}function calculateLegendItemHeight(t,e){const a=t.text?t.text.length:0;return e*a}function isListened(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var plugin_legend={id:"legend",_element:Legend,start(t,e,a){const n=t.legend=new Legend({ctx:t.ctx,options:a,chart:t});layouts.configure(t,n,a),layouts.addBox(t,n)},stop(t){layouts.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,a){const n=t.legend;layouts.configure(t,n,a),n.options=a},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,a){const n=e.datasetIndex,r=a.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.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:a,pointStyle:n,textAlign:r,color:i,useBorderRadius:o,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(a?0:void 0),c=toPadding(u.borderWidth);return{text:e[l.index].label,fillStyle:u.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:n||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:o&&(s||u.borderRadius),datasetIndex:l.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)}}};const positioners={average(t){if(!t.length)return!1;let e,a,n=0,r=0,i=0;for(e=0,a=t.length;e<a;++e){const o=t[e].element;if(o&&o.hasValue()){const s=o.tooltipPosition();n+=s.x,r+=s.y,++i}}return{x:n/i,y:r/i}},nearest(t,e){if(!t.length)return!1;let a=e.x,n=e.y,r=Number.POSITIVE_INFINITY,i,o,s;for(i=0,o=t.length;i<o;++i){const l=t[i].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=distanceBetweenPoints(e,u);c<r&&(r=c,s=l)}}if(s){const l=s.tooltipPosition();a=l.x,n=l.y}return{x:a,y:n}}};function pushOrConcat(t,e){return e&&(isArray$c(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function splitNewlines(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
+ */class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,a,n,r){const i=a.listeners[r],o=a.duration;i.forEach(s=>s({chart:e,initial:a.initial,numSteps:o,currentStep:Math.min(n-a.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let a=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;const i=n.items;let o=i.length-1,s=!1,l;for(;o>=0;--o)l=i[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(e),s=!0):(i[o]=i[i.length-1],i.pop());s&&(r.draw(),this._notify(r,n,e,"progress")),i.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),a+=i.length}),this._lastDate=e,a===0&&(this._running=!1)}_getAnims(e){const a=this._charts;let n=a.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},a.set(e,n)),n}listen(e,a,n){this._getAnims(e).listeners[a].push(n)}add(e,a){!a||!a.length||this._getAnims(e).items.push(...a)}has(e){return this._getAnims(e).items.length>0}start(e){const a=this._charts.get(e);a&&(a.running=!0,a.start=Date.now(),a.duration=a.items.reduce((n,r)=>Math.max(n,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const a=this._charts.get(e);return!(!a||!a.running||!a.items.length)}stop(e){const a=this._charts.get(e);if(!a||!a.items.length)return;const n=a.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();a.items=[],this._notify(e,a,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var animator=new Animator;const transparent="transparent",interpolators={boolean(t,e,a){return a>.5?e:t},color(t,e,a){const n=color(t||transparent),r=n.valid&&color(e||transparent);return r&&r.valid?r.mix(n,a).hexString():e},number(t,e,a){return t+(e-t)*a}};class Animation{constructor(e,a,n,r){const i=a[n];r=resolve([e.to,r,i,e.from]);const o=resolve([e.from,i,r]);this._active=!0,this._fn=e.fn||interpolators[e.type||typeof o],this._easing=effects[e.easing]||effects.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=a,this._prop=n,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(e,a,n){if(this._active){this._notify(!1);const r=this._target[this._prop],i=n-this._start,o=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=resolve([e.to,a,r,e.from]),this._from=resolve([e.from,r,a])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const a=e-this._start,n=this._duration,r=this._prop,i=this._from,o=this._loop,s=this._to;let l;if(this._active=i!==s&&(o||a<n),!this._active){this._target[r]=s,this._notify(!0);return}if(a<0){this._target[r]=i;return}l=a/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(i,s,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((a,n)=>{e.push({res:a,rej:n})})}_notify(e){const a=e?"res":"rej",n=this._promises||[];for(let r=0;r<n.length;r++)n[r][a]()}}class Animations{constructor(e,a){this._chart=e,this._properties=new Map,this.configure(a)}configure(e){if(!isObject$8(e))return;const a=Object.keys(defaults.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const i=e[r];if(!isObject$8(i))return;const o={};for(const s of a)o[s]=i[s];(isArray$c(i.properties)&&i.properties||[r]).forEach(s=>{(s===r||!n.has(s))&&n.set(s,o)})})}_animateOptions(e,a){const n=a.options,r=resolveTargetOptions(e,n);if(!r)return[];const i=this._createAnimations(r,n);return n.$shared&&awaitAll(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,a){const n=this._properties,r=[],i=e.$animations||(e.$animations={}),o=Object.keys(a),s=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(e,a));continue}const c=a[u];let d=i[u];const h=n.get(u);if(d)if(h&&d.active()){d.update(h,c,s);continue}else d.cancel();if(!h||!h.duration){e[u]=c;continue}i[u]=d=new Animation(h,e,u,c),r.push(d)}return r}update(e,a){if(this._properties.size===0){Object.assign(e,a);return}const n=this._createAnimations(e,a);if(n.length)return animator.add(this._chart,n),!0}}function awaitAll(t,e){const a=[],n=Object.keys(e);for(let r=0;r<n.length;r++){const i=t[n[r]];i&&i.active()&&a.push(i.wait())}return Promise.all(a)}function resolveTargetOptions(t,e){if(!e)return;let a=t.options;if(!a){t.options=e;return}return a.$shared&&(t.options=a=Object.assign({},a,{$shared:!1,$animations:{}})),a}function scaleClip(t,e){const a=t&&t.options||{},n=a.reverse,r=a.min===void 0?e:0,i=a.max===void 0?e:0;return{start:n?i:r,end:n?r:i}}function defaultClip(t,e,a){if(a===!1)return!1;const n=scaleClip(t,a),r=scaleClip(e,a);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}function toClip(t){let e,a,n,r;return isObject$8(t)?(e=t.top,a=t.right,n=t.bottom,r=t.left):e=a=n=r=t,{top:e,right:a,bottom:n,left:r,disabled:t===!1}}function getSortedDatasetIndices(t,e){const a=[],n=t._getSortedDatasetMetas(e);let r,i;for(r=0,i=n.length;r<i;++r)a.push(n[r].index);return a}function applyStack(t,e,a,n={}){const r=t.keys,i=n.mode==="single";let o,s,l,u;if(e!==null){for(o=0,s=r.length;o<s;++o){if(l=+r[o],l===a){if(n.all)continue;break}u=t.values[l],isNumberFinite(u)&&(i||e===0||sign(e)===sign(u))&&(e+=u)}return e}}function convertObjectDataToArray(t){const e=Object.keys(t),a=new Array(e.length);let n,r,i;for(n=0,r=e.length;n<r;++n)i=e[n],a[n]={x:i,y:t[i]};return a}function isStacked(t,e){const a=t&&t.options.stacked;return a||a===void 0&&e.stack!==void 0}function getStackKey(t,e,a){return`${t.id}.${e.id}.${a.stack||a.type}`}function getUserBounds(t){const{min:e,max:a,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?a:Number.POSITIVE_INFINITY}}function getOrCreateStack(t,e,a){const n=t[e]||(t[e]={});return n[a]||(n[a]={})}function getLastIndexInStack(t,e,a,n){for(const r of e.getMatchingVisibleMetas(n).reverse()){const i=t[r.index];if(a&&i>0||!a&&i<0)return r.index}return null}function updateStacks(t,e){const{chart:a,_cachedMeta:n}=t,r=a._stacks||(a._stacks={}),{iScale:i,vScale:o,index:s}=n,l=i.axis,u=o.axis,c=getStackKey(i,o,n),d=e.length;let h;for(let m=0;m<d;++m){const p=e[m],{[l]:v,[u]:y}=p,w=p._stacks||(p._stacks={});h=w[u]=getOrCreateStack(r,c,v),h[s]=y,h._top=getLastIndexInStack(h,o,!0,n.type),h._bottom=getLastIndexInStack(h,o,!1,n.type);const _=h._visualValues||(h._visualValues={});_[s]=y}}function getFirstScaleId(t,e){const a=t.scales;return Object.keys(a).filter(n=>a[n].axis===e).shift()}function createDatasetContext(t,e){return createContext(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function createDataContext(t,e,a){return createContext(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:a,index:e,mode:"default",type:"data"})}function clearStacks(t,e){const a=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const r of e){const i=r._stacks;if(!i||i[n]===void 0||i[n][a]===void 0)return;delete i[n][a],i[n]._visualValues!==void 0&&i[n]._visualValues[a]!==void 0&&delete i[n]._visualValues[a]}}}const isDirectUpdateMode=t=>t==="reset"||t==="none",cloneIfNotShared=(t,e)=>e?t:Object.assign({},t),createStack=(t,e,a)=>t&&!e.hidden&&e._stacked&&{keys:getSortedDatasetIndices(a,!0),values:null};class DatasetController{constructor(e,a){this.chart=e,this._ctx=e.ctx,this.index=a,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=isStacked(e.vScale,e),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(e){this.index!==e&&clearStacks(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,a=this._cachedMeta,n=this.getDataset(),r=(d,h,m,p)=>d==="x"?h:d==="r"?p:m,i=a.xAxisID=valueOrDefault(n.xAxisID,getFirstScaleId(e,"x")),o=a.yAxisID=valueOrDefault(n.yAxisID,getFirstScaleId(e,"y")),s=a.rAxisID=valueOrDefault(n.rAxisID,getFirstScaleId(e,"r")),l=a.indexAxis,u=a.iAxisID=r(l,i,o,s),c=a.vAxisID=r(l,o,i,s);a.xScale=this.getScaleForId(i),a.yScale=this.getScaleForId(o),a.rScale=this.getScaleForId(s),a.iScale=this.getScaleForId(u),a.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const a=this._cachedMeta;return e===a.iScale?a.vScale:a.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),e._stacked&&clearStacks(e)}_dataCheck(){const e=this.getDataset(),a=e.data||(e.data=[]),n=this._data;if(isObject$8(a))this._data=convertObjectDataToArray(a);else if(n!==a){if(n){unlistenArrayEvents(n,this);const r=this._cachedMeta;clearStacks(r),r._parsed=[]}a&&Object.isExtensible(a)&&listenArrayEvents(a,this),this._syncList=[],this._data=a}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const a=this._cachedMeta,n=this.getDataset();let r=!1;this._dataCheck();const i=a._stacked;a._stacked=isStacked(a.vScale,a),a.stack!==n.stack&&(r=!0,clearStacks(a),a.stack=n.stack),this._resyncElements(e),(r||i!==a._stacked)&&updateStacks(this,a._parsed)}configure(){const e=this.chart.config,a=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),a,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,a){const{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:o}=n,s=i.axis;let l=e===0&&a===r.length?!0:n._sorted,u=e>0&&n._parsed[e-1],c,d,h;if(this._parsing===!1)n._parsed=r,n._sorted=!0,h=r;else{isArray$c(r[e])?h=this.parseArrayData(n,r,e,a):isObject$8(r[e])?h=this.parseObjectData(n,r,e,a):h=this.parsePrimitiveData(n,r,e,a);const m=()=>d[s]===null||u&&d[s]<u[s];for(c=0;c<a;++c)n._parsed[c+e]=d=h[c],l&&(m()&&(l=!1),u=d);n._sorted=l}o&&updateStacks(this,h)}parsePrimitiveData(e,a,n,r){const{iScale:i,vScale:o}=e,s=i.axis,l=o.axis,u=i.getLabels(),c=i===o,d=new Array(r);let h,m,p;for(h=0,m=r;h<m;++h)p=h+n,d[h]={[s]:c||i.parse(u[p],p),[l]:o.parse(a[p],p)};return d}parseArrayData(e,a,n,r){const{xScale:i,yScale:o}=e,s=new Array(r);let l,u,c,d;for(l=0,u=r;l<u;++l)c=l+n,d=a[c],s[l]={x:i.parse(d[0],c),y:o.parse(d[1],c)};return s}parseObjectData(e,a,n,r){const{xScale:i,yScale:o}=e,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=new Array(r);let c,d,h,m;for(c=0,d=r;c<d;++c)h=c+n,m=a[h],u[c]={x:i.parse(resolveObjectKey(m,s),h),y:o.parse(resolveObjectKey(m,l),h)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,a,n){const r=this.chart,i=this._cachedMeta,o=a[e.axis],s={keys:getSortedDatasetIndices(r,!0),values:a._stacks[e.axis]._visualValues};return applyStack(s,o,i.index,{mode:n})}updateRangeFromParsed(e,a,n,r){const i=n[a.axis];let o=i===null?NaN:i;const s=r&&n._stacks[a.axis];r&&s&&(r.values=s,o=applyStack(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,a){const n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,o=r.length,s=this._getOtherScale(e),l=createStack(a,n,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=getUserBounds(s);let h,m;function p(){m=r[h];const v=m[s.axis];return!isNumberFinite(m[e.axis])||c>v||d<v}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(u,e,m,l),i));++h);if(i){for(h=o-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(u,e,m,l);break}}return u}getAllParsedValues(e){const a=this._cachedMeta._parsed,n=[];let r,i,o;for(r=0,i=a.length;r<i;++r)o=a[r][e.axis],isNumberFinite(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const a=this._cachedMeta,n=a.iScale,r=a.vScale,i=this.getParsed(e);return{label:n?""+n.getLabelForValue(i[n.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(e){const a=this._cachedMeta;this.update(e||"default"),a._clip=toClip(valueOrDefault(this.options.clip,defaultClip(a.xScale,a.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,a=this.chart,n=this._cachedMeta,r=n.data||[],i=a.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||r.length-s,u=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,i,s,l),c=s;c<s+l;++c){const d=r[c];d.hidden||(d.active&&u?o.push(d):d.draw(e,i))}for(c=0;c<o.length;++c)o[c].draw(e,i)}getStyle(e,a){const n=a?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,a,n){const r=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];i=o.$context||(o.$context=createDataContext(this.getContext(),e,o)),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!a,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,a){return this._resolveElementOptions(this.dataElementType.id,a,e)}_resolveElementOptions(e,a="default",n){const r=a==="active",i=this._cachedDataOpts,o=e+"-"+a,s=i[o],l=this.enableOptionSharing&&defined$1(n);if(s)return cloneIfNotShared(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,e),d=r?[`${e}Hover`,"hover",e,""]:[e,""],h=u.getOptionScopes(this.getDataset(),c),m=Object.keys(defaults.elements[e]),p=()=>this.getContext(n,r,a),v=u.resolveNamedOptions(h,m,p,d);return v.$shared&&(v.$shared=l,i[o]=Object.freeze(cloneIfNotShared(v,l))),v}_resolveAnimations(e,a,n){const r=this.chart,i=this._cachedDataOpts,o=`animation-${a}`,s=i[o];if(s)return s;let l;if(r.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,a),h=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(h,this.getContext(e,n,a))}const u=new Animations(r,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,a){return!a||isDirectUpdateMode(e)||this.chart._animationsDisabled}_getSharedOptions(e,a){const n=this.resolveDataElementOptions(e,a),r=this._sharedOptions,i=this.getSharedOptions(n),o=this.includeOptions(a,i)||i!==r;return this.updateSharedOptions(i,a,n),{sharedOptions:i,includeOptions:o}}updateElement(e,a,n,r){isDirectUpdateMode(r)?Object.assign(e,n):this._resolveAnimations(a,r).update(e,n)}updateSharedOptions(e,a,n){e&&!isDirectUpdateMode(a)&&this._resolveAnimations(void 0,a).update(e,n)}_setStyle(e,a,n,r){e.active=r;const i=this.getStyle(a,r);this._resolveAnimations(a,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,a,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,a,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const a=this._data,n=this._cachedMeta.data;for(const[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const r=n.length,i=a.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,a,n=!0){const r=this._cachedMeta,i=r.data,o=e+a;let s;const l=u=>{for(u.length+=a,s=u.length-1;s>=o;s--)u[s]=u[s-a]};for(l(i),s=e;s<o;++s)i[s]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(e,a),n&&this.updateElements(i,e,a,"reset")}updateElements(e,a,n,r){}_removeElements(e,a){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(e,a);n._stacked&&clearStacks(n,r)}n.data.splice(e,a)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[a,n,r]=e;this[a](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,a){a&&this._sync(["_removeElements",e,a]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(DatasetController,"defaults",{}),R(DatasetController,"datasetElementType",null),R(DatasetController,"dataElementType",null);function getAllScaleValues(t,e){if(!t._cache.$bar){const a=t.getMatchingVisibleMetas(e);let n=[];for(let r=0,i=a.length;r<i;r++)n=n.concat(a[r].controller.getAllParsedValues(t));t._cache.$bar=_arrayUnique(n.sort((r,i)=>r-i))}return t._cache.$bar}function computeMinSampleSize(t){const e=t.iScale,a=getAllScaleValues(e,t.type);let n=e._length,r,i,o,s;const l=()=>{o===32767||o===-32768||(defined$1(s)&&(n=Math.min(n,Math.abs(o-s)||n)),s=o)};for(r=0,i=a.length;r<i;++r)o=e.getPixelForValue(a[r]),l();for(s=void 0,r=0,i=e.ticks.length;r<i;++r)o=e.getPixelForTick(r),l();return n}function computeFitCategoryTraits(t,e,a,n){const r=a.barThickness;let i,o;return isNullOrUndef(r)?(i=e.min*a.categoryPercentage,o=a.barPercentage):(i=r*n,o=1),{chunk:i/n,ratio:o,start:e.pixels[t]-i/2}}function computeFlexCategoryTraits(t,e,a,n){const r=e.pixels,i=r[t];let o=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null;const l=a.categoryPercentage;o===null&&(o=i-(s===null?e.end-e.start:s-i)),s===null&&(s=i+i-o);const u=i-(i-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/n,ratio:a.barPercentage,start:u}}function parseFloatBar(t,e,a,n){const r=a.parse(t[0],n),i=a.parse(t[1],n),o=Math.min(r,i),s=Math.max(r,i);let l=o,u=s;Math.abs(o)>Math.abs(s)&&(l=s,u=o),e[a.axis]=u,e._custom={barStart:l,barEnd:u,start:r,end:i,min:o,max:s}}function parseValue(t,e,a,n){return isArray$c(t)?parseFloatBar(t,e,a,n):e[a.axis]=a.parse(t,n),e}function parseArrayOrPrimitive(t,e,a,n){const r=t.iScale,i=t.vScale,o=r.getLabels(),s=r===i,l=[];let u,c,d,h;for(u=a,c=a+n;u<c;++u)h=e[u],d={},d[r.axis]=s||r.parse(o[u],u),l.push(parseValue(h,d,i,u));return l}function isFloatBar(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function barSign(t,e,a){return t!==0?sign(t):(e.isHorizontal()?1:-1)*(e.min>=a?1:-1)}function borderProps(t){let e,a,n,r,i;return t.horizontal?(e=t.base>t.x,a="left",n="right"):(e=t.base<t.y,a="bottom",n="top"),e?(r="end",i="start"):(r="start",i="end"),{start:a,end:n,reverse:e,top:r,bottom:i}}function setBorderSkipped(t,e,a,n){let r=e.borderSkipped;const i={};if(!r){t.borderSkipped=i;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:s,reverse:l,top:u,bottom:c}=borderProps(t);r==="middle"&&a&&(t.enableBorderRadius=!0,(a._top||0)===n?r=u:(a._bottom||0)===n?r=c:(i[parseEdge(c,o,s,l)]=!0,r=u)),i[parseEdge(r,o,s,l)]=!0,t.borderSkipped=i}function parseEdge(t,e,a,n){return n?(t=swap(t,e,a),t=startEnd(t,a,e)):t=startEnd(t,e,a),t}function swap(t,e,a){return t===e?a:t===a?e:t}function startEnd(t,e,a){return t==="start"?e:t==="end"?a:t}function setInflateAmount(t,{inflateAmount:e},a){t.inflateAmount=e==="auto"?a===1?.33:0:e}class BarController extends DatasetController{parsePrimitiveData(e,a,n,r){return parseArrayOrPrimitive(e,a,n,r)}parseArrayData(e,a,n,r){return parseArrayOrPrimitive(e,a,n,r)}parseObjectData(e,a,n,r){const{iScale:i,vScale:o}=e,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=i.axis==="x"?s:l,c=o.axis==="x"?s:l,d=[];let h,m,p,v;for(h=n,m=n+r;h<m;++h)v=a[h],p={},p[i.axis]=i.parse(resolveObjectKey(v,u),h),d.push(parseValue(resolveObjectKey(v,c),p,o,h));return d}updateRangeFromParsed(e,a,n,r){super.updateRangeFromParsed(e,a,n,r);const i=n._custom;i&&a===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const a=this._cachedMeta,{iScale:n,vScale:r}=a,i=this.getParsed(e),o=i._custom,s=isFloatBar(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+n.getLabelForValue(i[n.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const a=this._cachedMeta;this.updateElements(a.data,0,a.data.length,e)}updateElements(e,a,n,r){const i=r==="reset",{index:o,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),u=s.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(a,r);for(let m=a;m<a+n;m++){const p=this.getParsed(m),v=i||isNullOrUndef(p[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,c),w=(p._stacks||{})[s.axis],_={horizontal:u,base:v.base,enableBorderRadius:!w||isFloatBar(p._custom)||o===w._top||o===w._bottom,x:u?v.head:y.center,y:u?y.center:v.head,height:u?y.size:Math.abs(v.size),width:u?Math.abs(v.size):y.size};h&&(_.options=d||this.resolveDataElementOptions(m,e[m].active?"active":r));const D=_.options||e[m].options;setBorderSkipped(_,D,w,o),setInflateAmount(_,D,c.ratio),this.updateElement(e[m],m,_,r)}}_getStacks(e,a){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=n.options.stacked,o=[],s=l=>{const u=l.controller.getParsed(a),c=u&&u[l.vScale.axis];if(isNullOrUndef(c)||isNaN(c))return!0};for(const l of r)if(!(a!==void 0&&s(l))&&((i===!1||o.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,a,n){const r=this._getStacks(e,n),i=a!==void 0?r.indexOf(a):-1;return i===-1?r.length-1:i}_getRuler(){const e=this.options,a=this._cachedMeta,n=a.iScale,r=[];let i,o;for(i=0,o=a.data.length;i<o;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));const s=e.barThickness;return{min:s||computeMinSampleSize(a),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:a,_stacked:n,index:r},options:{base:i,minBarLength:o}}=this,s=i||0,l=this.getParsed(e),u=l._custom,c=isFloatBar(u);let d=l[a.axis],h=0,m=n?this.applyStack(a,l,n):d,p,v;m!==d&&(h=m-d,m=d),c&&(d=u.barStart,m=u.barEnd-u.barStart,d!==0&&sign(d)!==sign(u.barEnd)&&(h=0),h+=d);const y=!isNullOrUndef(i)&&!c?i:h;let w=a.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=a.getPixelForValue(h+m):p=w,v=p-w,Math.abs(v)<o){v=barSign(v,a,s)*o,d===s&&(w-=v/2);const _=a.getPixelForDecimal(0),D=a.getPixelForDecimal(1),k=Math.min(_,D),O=Math.max(_,D);w=Math.max(Math.min(w,O),k),p=w+v,n&&!c&&(l._stacks[a.axis]._visualValues[r]=a.getValueForPixel(p)-a.getValueForPixel(w))}if(w===a.getPixelForValue(s)){const _=sign(v)*a.getLineWidthForValue(s)/2;w+=_,v-=_}return{size:v,base:w,head:p,center:p+v/2}}_calculateBarIndexPixels(e,a){const n=a.scale,r=this.options,i=r.skipNull,o=valueOrDefault(r.maxBarThickness,1/0);let s,l;if(a.grouped){const u=i?this._getStackCount(e):a.stackCount,c=r.barThickness==="flex"?computeFlexCategoryTraits(e,a,r,u):computeFitCategoryTraits(e,a,r,u),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0);s=c.start+c.chunk*d+c.chunk/2,l=Math.min(o,c.chunk*c.ratio)}else s=n.getPixelForValue(this.getParsed(e)[n.axis],e),l=Math.min(o,a.min*a.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const e=this._cachedMeta,a=e.vScale,n=e.data,r=n.length;let i=0;for(;i<r;++i)this.getParsed(i)[a.axis]!==null&&n[i].draw(this._ctx)}}R(BarController,"id","bar"),R(BarController,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(BarController,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function getRatioAndOffset(t,e,a){let n=1,r=1,i=0,o=0;if(e<TAU){const s=t,l=s+e,u=Math.cos(s),c=Math.sin(s),d=Math.cos(l),h=Math.sin(l),m=(D,k,O)=>_angleBetween(D,s,l,!0)?1:Math.max(k,k*a,O,O*a),p=(D,k,O)=>_angleBetween(D,s,l,!0)?-1:Math.min(k,k*a,O,O*a),v=m(0,u,d),y=m(HALF_PI,c,h),w=p(PI,u,d),_=p(PI+HALF_PI,c,h);n=(v-w)/2,r=(y-_)/2,i=-(v+w)/2,o=-(y+_)/2}return{ratioX:n,ratioY:r,offsetX:i,offsetY:o}}class DoughnutController extends DatasetController{constructor(e,a){super(e,a),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,a){const n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=l=>+n[l];if(isObject$8(n[e])){const{key:l="value"}=this._parsing;i=u=>+resolveObjectKey(n[u],l)}let o,s;for(o=e,s=e+a;o<s;++o)r._parsed[o]=i(o)}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let e=TAU,a=-TAU;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),o=r._getCircumference();e=Math.min(e,i),a=Math.max(a,i+o)}return{rotation:e,circumference:a-e}}update(e){const a=this.chart,{chartArea:n}=a,r=this._cachedMeta,i=r.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min(toPercentage(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:v}=getRatioAndOffset(d,c,l),y=(n.width-o)/h,w=(n.height-o)/m,_=Math.max(Math.min(y,w)/2,0),D=toDimension(this.options.radius,_),k=Math.max(D*l,0),O=(D-k)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=v*D,r.total=this.calculateTotal(),this.outerRadius=D-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*u,0),this.updateElements(i,0,i.length,e)}_circumference(e,a){const n=this.options,r=this._cachedMeta,i=this._getCircumference();return a&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/TAU)}updateElements(e,a,n,r){const i=r==="reset",o=this.chart,s=o.chartArea,u=o.options.animation,c=(s.left+s.right)/2,d=(s.top+s.bottom)/2,h=i&&u.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:v,includeOptions:y}=this._getSharedOptions(a,r);let w=this._getRotation(),_;for(_=0;_<a;++_)w+=this._circumference(_,i);for(_=a;_<a+n;++_){const D=this._circumference(_,i),k=e[_],O={x:c+this.offsetX,y:d+this.offsetY,startAngle:w,endAngle:w+D,circumference:D,outerRadius:p,innerRadius:m};y&&(O.options=v||this.resolveDataElementOptions(_,k.active?"active":r)),w+=D,this.updateElement(k,_,O,r)}}calculateTotal(){const e=this._cachedMeta,a=e.data;let n=0,r;for(r=0;r<a.length;r++){const i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!a[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){const a=this._cachedMeta.total;return a>0&&!isNaN(e)?TAU*(Math.abs(e)/a):0}getLabelAndValue(e){const a=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=formatNumber$1(a._parsed[e],n.options.locale);return{label:r[e]||"",value:i}}getMaxBorderWidth(e){let a=0;const n=this.chart;let r,i,o,s,l;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){o=n.getDatasetMeta(r),e=o.data,s=o.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)l=s.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(a=Math.max(a,l.borderWidth||0,l.hoverBorderWidth||0));return a}getMaxOffset(e){let a=0;for(let n=0,r=e.length;n<r;++n){const i=this.resolveDataElementOptions(n);a=Math.max(a,i.offset||0,i.hoverOffset||0)}return a}_getRingWeightOffset(e){let a=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(a+=this._getRingWeight(n));return a}_getRingWeight(e){return Math.max(valueOrDefault(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(DoughnutController,"id","doughnut"),R(DoughnutController,"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"}),R(DoughnutController,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),R(DoughnutController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const a=e.data;if(a.labels.length&&a.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return a.labels.map((i,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,a,n){n.chart.toggleDataVisibility(a.index),n.chart.update()}}}});class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const a=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=a,o=this.chart._animationsDisabled;let{start:s,count:l}=_getStartAndCountOfVisiblePoints(a,r,o);this._drawStart=s,this._drawCount=l,_scaleRangesChanged(a)&&(s=0,l=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:u},e),this.updateElements(r,s,l,e)}updateElements(e,a,n,r){const i=r==="reset",{iScale:o,vScale:s,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(a,r),h=o.axis,m=s.axis,{spanGaps:p,segment:v}=this.options,y=isNumber(p)?p:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||r==="none",_=a+n,D=e.length;let k=a>0&&this.getParsed(a-1);for(let O=0;O<D;++O){const N=e[O],F=w?N:{};if(O<a||O>=_){F.skip=!0;continue}const g=this.getParsed(O),b=isNullOrUndef(g[m]),$=F[h]=o.getPixelForValue(g[h],O),S=F[m]=i||b?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,g,l):g[m],O);F.skip=isNaN($)||isNaN(S)||b,F.stop=O>0&&Math.abs(g[h]-k[h])>y,v&&(F.parsed=g,F.raw=u.data[O]),d&&(F.options=c||this.resolveDataElementOptions(O,N.active?"active":r)),w||this.updateElement(N,O,F,r),k=g}}getMaxOverflow(){const e=this._cachedMeta,a=e.dataset,n=a.options&&a.options.borderWidth||0,r=e.data||[];if(!r.length)return n;const i=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}R(LineController,"id","line"),R(LineController,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(LineController,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class PolarAreaController extends DatasetController{constructor(e,a){super(e,a),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const a=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=formatNumber$1(a._parsed[e].r,n.options.locale);return{label:r[e]||"",value:i}}parseObjectData(e,a,n,r){return _parseObjectDataRadialScale.bind(this)(e,a,n,r)}update(e){const a=this._cachedMeta.data;this._updateRadius(),this.updateElements(a,0,a.length,e)}getMinMax(){const e=this._cachedMeta,a={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((n,r)=>{const i=this.getParsed(r).r;!isNaN(i)&&this.chart.getDataVisibility(r)&&(i<a.min&&(a.min=i),i>a.max&&(a.max=i))}),a}_updateRadius(){const e=this.chart,a=e.chartArea,n=e.options,r=Math.min(a.right-a.left,a.bottom-a.top),i=Math.max(r/2,0),o=Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0),s=(i-o)/e.getVisibleDatasetCount();this.outerRadius=i-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(e,a,n,r){const i=r==="reset",o=this.chart,l=o.options.animation,u=this._cachedMeta.rScale,c=u.xCenter,d=u.yCenter,h=u.getIndexAngle(0)-.5*PI;let m=h,p;const v=360/this.countVisibleElements();for(p=0;p<a;++p)m+=this._computeAngle(p,r,v);for(p=a;p<a+n;p++){const y=e[p];let w=m,_=m+this._computeAngle(p,r,v),D=o.getDataVisibility(p)?u.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=_,i&&(l.animateScale&&(D=0),l.animateRotate&&(w=_=h));const k={x:c,y:d,innerRadius:0,outerRadius:D,startAngle:w,endAngle:_,options:this.resolveDataElementOptions(p,y.active?"active":r)};this.updateElement(y,p,k,r)}}countVisibleElements(){const e=this._cachedMeta;let a=0;return e.data.forEach((n,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&a++}),a}_computeAngle(e,a,n){return this.chart.getDataVisibility(e)?toRadians(this.resolveDataElementOptions(e,a).angle||n):0}}R(PolarAreaController,"id","polarArea"),R(PolarAreaController,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(PolarAreaController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const a=e.data;if(a.labels.length&&a.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return a.labels.map((i,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,a,n){n.chart.toggleDataVisibility(a.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class PieController extends DoughnutController{}R(PieController,"id","pie"),R(PieController,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{constructor(e){R(this,"options");this.options=e||{}}static override(e){Object.assign(DateAdapterBase.prototype,e)}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(t,e,a,n){const{controller:r,data:i,_sorted:o}=t,s=r._cachedMeta.iScale;if(s&&e===s.axis&&e!=="r"&&o&&i.length){const l=s._reversePixels?_rlookupByKey:_lookupByKey;if(n){if(r._sharedOptions){const u=i[0],c=typeof u.getRange=="function"&&u.getRange(e);if(c){const d=l(i,e,a-c),h=l(i,e,a+c);return{lo:d.lo,hi:h.hi}}}}else return l(i,e,a)}return{lo:0,hi:i.length-1}}function evaluateInteractionItems(t,e,a,n,r){const i=t.getSortedVisibleDatasetMetas(),o=a[e];for(let s=0,l=i.length;s<l;++s){const{index:u,data:c}=i[s],{lo:d,hi:h}=binarySearch(i[s],e,o,r);for(let m=d;m<=h;++m){const p=c[m];p.skip||n(p,u,m)}}}function getDistanceMetricForAxis(t){const e=t.indexOf("x")!==-1,a=t.indexOf("y")!==-1;return function(n,r){const i=e?Math.abs(n.x-r.x):0,o=a?Math.abs(n.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}function getIntersectItems(t,e,a,n,r){const i=[];return!r&&!t.isPointInArea(e)||evaluateInteractionItems(t,a,e,function(s,l,u){!r&&!_isPointInArea(s,t.chartArea,0)||s.inRange(e.x,e.y,n)&&i.push({element:s,datasetIndex:l,index:u})},!0),i}function getNearestRadialItems(t,e,a,n){let r=[];function i(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],n),{angle:d}=getAngleFromPoint(o,{x:e.x,y:e.y});_angleBetween(d,u,c)&&r.push({element:o,datasetIndex:s,index:l})}return evaluateInteractionItems(t,a,e,i),r}function getNearestCartesianItems(t,e,a,n,r,i){let o=[];const s=getDistanceMetricForAxis(a);let l=Number.POSITIVE_INFINITY;function u(c,d,h){const m=c.inRange(e.x,e.y,r);if(n&&!m)return;const p=c.getCenterPoint(r);if(!(!!i||t.isPointInArea(p))&&!m)return;const y=s(e,p);y<l?(o=[{element:c,datasetIndex:d,index:h}],l=y):y===l&&o.push({element:c,datasetIndex:d,index:h})}return evaluateInteractionItems(t,a,e,u),o}function getNearestItems(t,e,a,n,r,i){return!i&&!t.isPointInArea(e)?[]:a==="r"&&!n?getNearestRadialItems(t,e,a,r):getNearestCartesianItems(t,e,a,n,r,i)}function getAxisItems(t,e,a,n,r){const i=[],o=a==="x"?"inXRange":"inYRange";let s=!1;return evaluateInteractionItems(t,a,e,(l,u,c)=>{l[o](e[a],r)&&(i.push({element:l,datasetIndex:u,index:c}),s=s||l.inRange(e.x,e.y,r))}),n&&!s?[]:i}var Interaction={evaluateInteractionItems,modes:{index(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"x",o=a.includeInvisible||!1,s=a.intersect?getIntersectItems(t,r,i,n,o):getNearestItems(t,r,i,!1,n,o),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"xy",o=a.includeInvisible||!1;let s=a.intersect?getIntersectItems(t,r,i,n,o):getNearestItems(t,r,i,!1,n,o);if(s.length>0){const l=s[0].datasetIndex,u=t.getDatasetMeta(l).data;s=[];for(let c=0;c<u.length;++c)s.push({element:u[c],datasetIndex:l,index:c})}return s},point(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"xy",o=a.includeInvisible||!1;return getIntersectItems(t,r,i,n,o)},nearest(t,e,a,n){const r=getRelativePosition(e,t),i=a.axis||"xy",o=a.includeInvisible||!1;return getNearestItems(t,r,i,a.intersect,n,o)},x(t,e,a,n){const r=getRelativePosition(e,t);return getAxisItems(t,r,"x",a.intersect,n)},y(t,e,a,n){const r=getRelativePosition(e,t);return getAxisItems(t,r,"y",a.intersect,n)}}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(t,e){return t.filter(a=>a.pos===e)}function filterDynamicPositionByAxis(t,e){return t.filter(a=>STATIC_POSITIONS.indexOf(a.pos)===-1&&a.box.axis===e)}function sortByWeight(t,e){return t.sort((a,n)=>{const r=e?n:a,i=e?a:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function wrapBoxes(t){const e=[];let a,n,r,i,o,s;for(a=0,n=(t||[]).length;a<n;++a)r=t[a],{position:i,options:{stack:o,stackWeight:s=1}}=r,e.push({index:a,box:r,pos:i,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&i+o,stackWeight:s});return e}function buildStacks(t){const e={};for(const a of t){const{stack:n,pos:r,stackWeight:i}=a;if(!n||!STATIC_POSITIONS.includes(r))continue;const o=e[n]||(e[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return e}function setLayoutDims(t,e){const a=buildStacks(t),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e;let i,o,s;for(i=0,o=t.length;i<o;++i){s=t[i];const{fullSize:l}=s.box,u=a[s.stack],c=u&&s.stackWeight/u.weight;s.horizontal?(s.width=c?c*n:l&&e.availableWidth,s.height=r):(s.width=n,s.height=c?c*r:l&&e.availableHeight)}return a}function buildLayoutBoxes(t){const e=wrapBoxes(t),a=sortByWeight(e.filter(u=>u.box.fullSize),!0),n=sortByWeight(filterByPosition(e,"left"),!0),r=sortByWeight(filterByPosition(e,"right")),i=sortByWeight(filterByPosition(e,"top"),!0),o=sortByWeight(filterByPosition(e,"bottom")),s=filterDynamicPositionByAxis(e,"x"),l=filterDynamicPositionByAxis(e,"y");return{fullSize:a,leftAndTop:n.concat(i),rightAndBottom:r.concat(l).concat(o).concat(s),chartArea:filterByPosition(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:i.concat(o).concat(s)}}function getCombinedMax(t,e,a,n){return Math.max(t[a],e[a])+Math.max(t[n],e[n])}function updateMaxPadding(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 updateDims(t,e,a,n){const{pos:r,box:i}=a,o=t.maxPadding;if(!isObject$8(r)){a.size&&(t[r]-=a.size);const d=n[a.stack]||{size:0,count:1};d.size=Math.max(d.size,a.horizontal?i.height:i.width),a.size=d.size/d.count,t[r]+=a.size}i.getPadding&&updateMaxPadding(o,i.getPadding());const s=Math.max(0,e.outerWidth-getCombinedMax(o,t,"left","right")),l=Math.max(0,e.outerHeight-getCombinedMax(o,t,"top","bottom")),u=s!==t.w,c=l!==t.h;return t.w=s,t.h=l,a.horizontal?{same:u,other:c}:{same:c,other:u}}function handleMaxPadding(t){const e=t.maxPadding;function a(n){const r=Math.max(e[n]-t[n],0);return t[n]+=r,r}t.y+=a("top"),t.x+=a("left"),a("right"),a("bottom")}function getMargins(t,e){const a=e.maxPadding;function n(r){const i={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{i[o]=Math.max(e[o],a[o])}),i}return n(t?["left","right"]:["top","bottom"])}function fitBoxes(t,e,a,n){const r=[];let i,o,s,l,u,c;for(i=0,o=t.length,u=0;i<o;++i){s=t[i],l=s.box,l.update(s.width||e.w,s.height||e.h,getMargins(s.horizontal,e));const{same:d,other:h}=updateDims(e,a,s,n);u|=d&&r.length,c=c||h,l.fullSize||r.push(s)}return u&&fitBoxes(r,e,a,n)||c}function setBoxDims(t,e,a,n,r){t.top=a,t.left=e,t.right=e+n,t.bottom=a+r,t.width=n,t.height=r}function placeBoxes(t,e,a,n){const r=a.padding;let{x:i,y:o}=e;for(const s of t){const l=s.box,u=n[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/u.weight||1;if(s.horizontal){const d=e.w*c,h=u.size||l.height;defined$1(u.start)&&(o=u.start),l.fullSize?setBoxDims(l,r.left,o,a.outerWidth-r.right-r.left,h):setBoxDims(l,e.left+u.placed,o,d,h),u.start=o,u.placed+=d,o=l.bottom}else{const d=e.h*c,h=u.size||l.width;defined$1(u.start)&&(i=u.start),l.fullSize?setBoxDims(l,i,r.top,h,a.outerHeight-r.bottom-r.top):setBoxDims(l,i,e.top+u.placed,h,d),u.start=i,u.placed+=d,i=l.right}}e.x=i,e.y=o}var layouts={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(a){e.draw(a)}}]},t.boxes.push(e)},removeBox(t,e){const a=t.boxes?t.boxes.indexOf(e):-1;a!==-1&&t.boxes.splice(a,1)},configure(t,e,a){e.fullSize=a.fullSize,e.position=a.position,e.weight=a.weight},update(t,e,a,n){if(!t)return;const r=toPadding(t.options.layout.padding),i=Math.max(e-r.width,0),o=Math.max(a-r.height,0),s=buildLayoutBoxes(t.boxes),l=s.vertical,u=s.horizontal;each(t.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const c=l.reduce((v,y)=>y.box.options&&y.box.options.display===!1?v:v+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:a,padding:r,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},r);updateMaxPadding(h,toPadding(n));const m=Object.assign({maxPadding:h,w:i,h:o,x:r.left,y:r.top},r),p=setLayoutDims(l.concat(u),d);fitBoxes(s.fullSize,m,d,p),fitBoxes(l,m,d,p),fitBoxes(u,m,d,p)&&fitBoxes(l,m,d,p),handleMaxPadding(m),placeBoxes(s.leftAndTop,m,d,p),m.x+=m.w,m.y+=m.h,placeBoxes(s.rightAndBottom,m,d,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},each(s.chartArea,v=>{const y=v.box;Object.assign(y,t.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(e,a){}releaseContext(e){return!1}addEventListener(e,a,n){}removeEventListener(e,a,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,a,n,r){return a=Math.max(0,a||e.width),n=n||e.height,{width:a,height:Math.max(0,r?Math.floor(a/r):n)}}isAttached(e){return!0}updateConfig(e){}}class BasicPlatform extends BasePlatform{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=t=>t===null||t==="";function initCanvas(t,e){const a=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[EXPANDO_KEY]={initial:{height:n,width:r,style:{display:a.display,height:a.height,width:a.width}}},a.display=a.display||"block",a.boxSizing=a.boxSizing||"border-box",isNullOrEmpty(r)){const i=readUsedSize(t,"width");i!==void 0&&(t.width=i)}if(isNullOrEmpty(n))if(t.style.height==="")t.height=t.width/(e||2);else{const i=readUsedSize(t,"height");i!==void 0&&(t.height=i)}return t}const eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(t,e,a){t.addEventListener(e,a,eventListenerOptions)}function removeListener(t,e,a){t.canvas.removeEventListener(e,a,eventListenerOptions)}function fromNativeEvent(t,e){const a=EVENT_TYPES[t.type]||t.type,{x:n,y:r}=getRelativePosition(t,e);return{type:a,chart:e,native:t,x:n!==void 0?n:null,y:r!==void 0?r:null}}function nodeListContains(t,e){for(const a of t)if(a===e||a.contains(e))return!0}function createAttachObserver(t,e,a){const n=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const s of i)o=o||nodeListContains(s.addedNodes,n),o=o&&!nodeListContains(s.removedNodes,n);o&&a()});return r.observe(document,{childList:!0,subtree:!0}),r}function createDetachObserver(t,e,a){const n=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const s of i)o=o||nodeListContains(s.removedNodes,n),o=o&&!nodeListContains(s.addedNodes,n);o&&a()});return r.observe(document,{childList:!0,subtree:!0}),r}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const t=window.devicePixelRatio;t!==oldDevicePixelRatio&&(oldDevicePixelRatio=t,drpListeningCharts.forEach((e,a)=>{a.currentDevicePixelRatio!==t&&e()}))}function listenDevicePixelRatioChanges(t,e){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(t,e)}function unlistenDevicePixelRatioChanges(t){drpListeningCharts.delete(t),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(t,e,a){const n=t.canvas,r=n&&_getParentNode(n);if(!r)return;const i=throttled((s,l)=>{const u=r.clientWidth;a(s,l),u<r.clientWidth&&a()},window),o=new ResizeObserver(s=>{const l=s[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||i(u,c)});return o.observe(r),listenDevicePixelRatioChanges(t,i),o}function releaseObserver(t,e,a){a&&a.disconnect(),e==="resize"&&unlistenDevicePixelRatioChanges(t)}function createProxyAndListen(t,e,a){const n=t.canvas,r=throttled(i=>{t.ctx!==null&&a(fromNativeEvent(i,t))},t);return addListener(n,e,r),r}class DomPlatform extends BasePlatform{acquireContext(e,a){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(initCanvas(e,a),n):null}releaseContext(e){const a=e.canvas;if(!a[EXPANDO_KEY])return!1;const n=a[EXPANDO_KEY].initial;["height","width"].forEach(i=>{const o=n[i];isNullOrUndef(o)?a.removeAttribute(i):a.setAttribute(i,o)});const r=n.style||{};return Object.keys(r).forEach(i=>{a.style[i]=r[i]}),a.width=a.width,delete a[EXPANDO_KEY],!0}addEventListener(e,a,n){this.removeEventListener(e,a);const r=e.$proxies||(e.$proxies={}),o={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[a]||createProxyAndListen;r[a]=o(e,a,n)}removeEventListener(e,a){const n=e.$proxies||(e.$proxies={}),r=n[a];if(!r)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[a]||removeListener)(e,a,r),n[a]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,a,n,r){return getMaximumSize(e,a,n,r)}isAttached(e){const a=_getParentNode(e);return!!(a&&a.isConnected)}}function _detectPlatform(t){return!_isDomSupported()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?BasicPlatform:DomPlatform}var ne;let Element$1=(ne=class{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(e){const{x:a,y:n}=this.getProps(["x","y"],e);return{x:a,y:n}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(e,a){const n=this.$animations;if(!a||!n)return this;const r={};return e.forEach(i=>{r[i]=n[i]&&n[i].active()?n[i]._to:this[i]}),r}},R(ne,"defaults",{}),R(ne,"defaultRoutes"),ne);function autoSkip(t,e){const a=t.options.ticks,n=determineMaxTicks(t),r=Math.min(a.maxTicksLimit||n,n),i=a.major.enabled?getMajorIndices(e):[],o=i.length,s=i[0],l=i[o-1],u=[];if(o>r)return skipMajors(e,u,i,o/r),u;const c=calculateSpacing(i,e,r);if(o>0){let d,h;const m=o>1?Math.round((l-s)/(o-1)):null;for(skip(e,u,c,isNullOrUndef(m)?0:s-m,s),d=0,h=o-1;d<h;d++)skip(e,u,c,i[d],i[d+1]);return skip(e,u,c,l,isNullOrUndef(m)?e.length:l+m),u}return skip(e,u,c),u}function determineMaxTicks(t){const e=t.options.offset,a=t._tickSize(),n=t._length/a+(e?0:1),r=t._maxLength/a;return Math.floor(Math.min(n,r))}function calculateSpacing(t,e,a){const n=getEvenSpacing(t),r=e.length/a;if(!n)return Math.max(r,1);const i=_factorize(n);for(let o=0,s=i.length-1;o<s;o++){const l=i[o];if(l>r)return l}return Math.max(r,1)}function getMajorIndices(t){const e=[];let a,n;for(a=0,n=t.length;a<n;a++)t[a].major&&e.push(a);return e}function skipMajors(t,e,a,n){let r=0,i=a[0],o;for(n=Math.ceil(n),o=0;o<t.length;o++)o===i&&(e.push(t[o]),r++,i=a[r*n])}function skip(t,e,a,n,r){const i=valueOrDefault(n,0),o=Math.min(valueOrDefault(r,t.length),t.length);let s=0,l,u,c;for(a=Math.ceil(a),r&&(l=r-n,a=l/Math.floor(l/a)),c=i;c<0;)s++,c=Math.round(i+s*a);for(u=Math.max(i,0);u<o;u++)u===c&&(e.push(t[u]),s++,c=Math.round(i+s*a))}function getEvenSpacing(t){const e=t.length;let a,n;if(e<2)return!1;for(n=t[0],a=1;a<e;++a)if(t[a]-t[a-1]!==n)return!1;return n}const reverseAlign=t=>t==="left"?"right":t==="right"?"left":t,offsetFromEdge=(t,e,a)=>e==="top"||e==="left"?t[e]+a:t[e]-a,getTicksLimit=(t,e)=>Math.min(e||t,t);function sample(t,e){const a=[],n=t.length/e,r=t.length;let i=0;for(;i<r;i+=n)a.push(t[Math.floor(i)]);return a}function getPixelForGridLine(t,e,a){const n=t.ticks.length,r=Math.min(e,n-1),i=t._startPixel,o=t._endPixel,s=1e-6;let l=t.getPixelForTick(r),u;if(!(a&&(n===1?u=Math.max(l-i,o-l):e===0?u=(t.getPixelForTick(1)-l)/2:u=(l-t.getPixelForTick(r-1))/2,l+=r<e?u:-u,l<i-s||l>o+s)))return l}function garbageCollect(t,e){each(t,a=>{const n=a.gc,r=n.length/2;let i;if(r>e){for(i=0;i<r;++i)delete a.data[n[i]];n.splice(0,r)}})}function getTickMarkLength(t){return t.drawTicks?t.tickLength:0}function getTitleHeight(t,e){if(!t.display)return 0;const a=toFont(t.font,e),n=toPadding(t.padding);return(isArray$c(t.text)?t.text.length:1)*a.lineHeight+n.height}function createScaleContext(t,e){return createContext(t,{scale:e,type:"scale"})}function createTickContext(t,e,a){return createContext(t,{tick:a,index:e,type:"tick"})}function titleAlign(t,e,a){let n=_toLeftRightCenter(t);return(a&&e!=="right"||!a&&e==="right")&&(n=reverseAlign(n)),n}function titleArgs(t,e,a,n){const{top:r,left:i,bottom:o,right:s,chart:l}=t,{chartArea:u,scales:c}=l;let d=0,h,m,p;const v=o-r,y=s-i;if(t.isHorizontal()){if(m=_alignStartEnd(n,i,s),isObject$8(a)){const w=Object.keys(a)[0],_=a[w];p=c[w].getPixelForValue(_)+v-e}else a==="center"?p=(u.bottom+u.top)/2+v-e:p=offsetFromEdge(t,a,e);h=s-i}else{if(isObject$8(a)){const w=Object.keys(a)[0],_=a[w];m=c[w].getPixelForValue(_)-y+e}else a==="center"?m=(u.left+u.right)/2-y+e:m=offsetFromEdge(t,a,e);p=_alignStartEnd(n,o,r),d=a==="left"?-HALF_PI:HALF_PI}return{titleX:m,titleY:p,maxWidth:h,rotation:d}}class Scale extends Element$1{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,a){return e}getUserBounds(){let{_userMin:e,_userMax:a,_suggestedMin:n,_suggestedMax:r}=this;return e=finiteOrDefault(e,Number.POSITIVE_INFINITY),a=finiteOrDefault(a,Number.NEGATIVE_INFINITY),n=finiteOrDefault(n,Number.POSITIVE_INFINITY),r=finiteOrDefault(r,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(e,n),max:finiteOrDefault(a,r),minDefined:isNumberFinite(e),maxDefined:isNumberFinite(a)}}getMinMax(e){let{min:a,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),o;if(r&&i)return{min:a,max:n};const s=this.getMatchingVisibleMetas();for(let l=0,u=s.length;l<u;++l)o=s[l].controller.getMinMax(this,e),r||(a=Math.min(a,o.min)),i||(n=Math.max(n,o.max));return a=i&&a>n?n:a,n=r&&a>n?a:n,{min:finiteOrDefault(a,finiteOrDefault(n,a)),max:finiteOrDefault(n,finiteOrDefault(a,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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(e,a,n){const{beginAtZero:r,grace:i,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=a,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?sample(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,a,n;this.isHorizontal()?(a=this.left,n=this.right):(a=this.top,n=this.bottom,e=!e),this._startPixel=a,this._endPixel=n,this._reversePixels=e,this._length=n-a,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(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(){callback(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),callback(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const a=this.options.ticks;let n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=callback(a.callback,[i.value,n,e],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,a=e.ticks,n=getTicksLimit(this.ticks.length,e.ticks.maxTicksLimit),r=a.minRotation||0,i=a.maxRotation;let o=r,s,l,u;if(!this._isVisible()||!a.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}const c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,m=_limitValue(this.chart.width-d,0,this.maxWidth);s=e.offset?this.maxWidth/n:m/(n-1),d+6>s&&(s=m/(n-(e.offset?.5:1)),l=this.maxHeight-getTickMarkLength(e.grid)-a.padding-getTitleHeight(e.title,this.chart.options.font),u=Math.sqrt(d*d+h*h),o=toDegrees(Math.min(Math.asin(_limitValue((c.highest.height+6)/s,-1,1)),Math.asin(_limitValue(l/u,-1,1))-Math.asin(_limitValue(h/u,-1,1)))),o=Math.max(r,Math.min(i,o))),this.labelRotation=o}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:a,options:{ticks:n,title:r,grid:i}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const l=getTitleHeight(r,a.options.font);if(s?(e.width=this.maxWidth,e.height=getTickMarkLength(i)+l):(e.height=this.maxHeight,e.width=getTickMarkLength(i)+l),n.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:h}=this._getLabelSizes(),m=n.padding*2,p=toRadians(this.labelRotation),v=Math.cos(p),y=Math.sin(p);if(s){const w=n.mirror?0:y*d.width+v*h.height;e.height=Math.min(this.maxHeight,e.height+w+m)}else{const w=n.mirror?0:v*d.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+w+m)}this._calculatePadding(u,c,y,v)}}this._handleMargins(),s?(this.width=this._length=a.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=a.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,a,n,r){const{ticks:{align:i,padding:o},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;l?u?(h=r*e.width,m=n*a.height):(h=n*e.height,m=r*a.width):i==="start"?m=a.width:i==="end"?h=e.width:i!=="inner"&&(h=e.width/2,m=a.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((m-d+o)*this.width/(this.width-d),0)}else{let c=a.height/2,d=e.height/2;i==="start"?(c=0,d=e.height):i==="end"&&(c=a.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:a}=this.options;return a==="top"||a==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let a,n;for(a=0,n=e.length;a<n;a++)isNullOrUndef(e[a].label)&&(e.splice(a,1),n--,a--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const a=this.options.ticks.sampleSize;let n=this.ticks;a<n.length&&(n=sample(n,a)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,a,n){const{ctx:r,_longestTextCache:i}=this,o=[],s=[],l=Math.floor(a/getTicksLimit(a,n));let u=0,c=0,d,h,m,p,v,y,w,_,D,k,O;for(d=0;d<a;d+=l){if(p=e[d].label,v=this._resolveTickFontOptions(d),r.font=y=v.string,w=i[y]=i[y]||{data:{},gc:[]},_=v.lineHeight,D=k=0,!isNullOrUndef(p)&&!isArray$c(p))D=_measureText(r,w.data,w.gc,D,p),k=_;else if(isArray$c(p))for(h=0,m=p.length;h<m;++h)O=p[h],!isNullOrUndef(O)&&!isArray$c(O)&&(D=_measureText(r,w.data,w.gc,D,O),k+=_);o.push(D),s.push(k),u=Math.max(D,u),c=Math.max(k,c)}garbageCollect(i,a);const N=o.indexOf(u),F=s.indexOf(c),g=b=>({width:o[b]||0,height:s[b]||0});return{first:g(0),last:g(a-1),widest:g(N),highest:g(F),widths:o,heights:s}}getLabelForValue(e){return e}getPixelForValue(e,a){return NaN}getValueForPixel(e){}getPixelForTick(e){const a=this.ticks;return e<0||e>a.length-1?null:this.getPixelForValue(a[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const a=this._startPixel+e*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,a,0):a)}getDecimalForPixel(e){const a=(e-this._startPixel)/this._length;return this._reversePixels?1-a:a}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:a}=this;return e<0&&a<0?a:e>0&&a>0?e:0}getContext(e){const a=this.ticks||[];if(e>=0&&e<a.length){const n=a[e];return n.$context||(n.$context=createTickContext(this.getContext(),e,n))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,a=toRadians(this.labelRotation),n=Math.abs(Math.cos(a)),r=Math.abs(Math.sin(a)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,s=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return this.isHorizontal()?l*n>s*r?s/n:l/r:l*r<s*n?l/n:s/r}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const a=this.axis,n=this.chart,r=this.options,{grid:i,position:o,border:s}=r,l=i.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=getTickMarkLength(i),m=[],p=s.setContext(this.getContext()),v=p.display?p.width:0,y=v/2,w=function(T){return _alignPixel(n,T,v)};let _,D,k,O,N,F,g,b,$,S,P,M;if(o==="top")_=w(this.bottom),F=this.bottom-h,b=_-y,S=w(e.top)+y,M=e.bottom;else if(o==="bottom")_=w(this.top),S=e.top,M=w(e.bottom)-y,F=_+y,b=this.top+h;else if(o==="left")_=w(this.right),N=this.right-h,g=_-y,$=w(e.left)+y,P=e.right;else if(o==="right")_=w(this.left),$=e.left,P=w(e.right)-y,N=_+y,g=this.left+h;else if(a==="x"){if(o==="center")_=w((e.top+e.bottom)/2+.5);else if(isObject$8(o)){const T=Object.keys(o)[0],x=o[T];_=w(this.chart.scales[T].getPixelForValue(x))}S=e.top,M=e.bottom,F=_+y,b=F+h}else if(a==="y"){if(o==="center")_=w((e.left+e.right)/2);else if(isObject$8(o)){const T=Object.keys(o)[0],x=o[T];_=w(this.chart.scales[T].getPixelForValue(x))}N=_-y,g=N-h,$=e.left,P=e.right}const C=valueOrDefault(r.ticks.maxTicksLimit,d),E=Math.max(1,Math.ceil(d/C));for(D=0;D<d;D+=E){const T=this.getContext(D),x=i.setContext(T),A=s.setContext(T),L=x.lineWidth,I=x.color,W=A.dash||[],z=A.dashOffset,U=x.tickWidth,B=x.tickColor,V=x.tickBorderDash||[],H=x.tickBorderDashOffset;k=getPixelForGridLine(this,D,l),k!==void 0&&(O=_alignPixel(n,k,L),u?N=g=$=P=O:F=b=S=M=O,m.push({tx1:N,ty1:F,tx2:g,ty2:b,x1:$,y1:S,x2:P,y2:M,width:L,color:I,borderDash:W,borderDashOffset:z,tickWidth:U,tickColor:B,tickBorderDash:V,tickBorderDashOffset:H}))}return this._ticksLength=d,this._borderValue=_,m}_computeLabelItems(e){const a=this.axis,n=this.options,{position:r,ticks:i}=n,o=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=i,h=getTickMarkLength(n.grid),m=h+c,p=d?-c:m,v=-toRadians(this.labelRotation),y=[];let w,_,D,k,O,N,F,g,b,$,S,P,M="middle";if(r==="top")N=this.bottom-p,F=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+p,F=this._getXAxisLabelAlignment();else if(r==="left"){const E=this._getYAxisLabelAlignment(h);F=E.textAlign,O=E.x}else if(r==="right"){const E=this._getYAxisLabelAlignment(h);F=E.textAlign,O=E.x}else if(a==="x"){if(r==="center")N=(e.top+e.bottom)/2+m;else if(isObject$8(r)){const E=Object.keys(r)[0],T=r[E];N=this.chart.scales[E].getPixelForValue(T)+m}F=this._getXAxisLabelAlignment()}else if(a==="y"){if(r==="center")O=(e.left+e.right)/2-m;else if(isObject$8(r)){const E=Object.keys(r)[0],T=r[E];O=this.chart.scales[E].getPixelForValue(T)}F=this._getYAxisLabelAlignment(h).textAlign}a==="y"&&(l==="start"?M="top":l==="end"&&(M="bottom"));const C=this._getLabelSizes();for(w=0,_=s.length;w<_;++w){D=s[w],k=D.label;const E=i.setContext(this.getContext(w));g=this.getPixelForTick(w)+i.labelOffset,b=this._resolveTickFontOptions(w),$=b.lineHeight,S=isArray$c(k)?k.length:1;const T=S/2,x=E.color,A=E.textStrokeColor,L=E.textStrokeWidth;let I=F;o?(O=g,F==="inner"&&(w===_-1?I=this.options.reverse?"left":"right":w===0?I=this.options.reverse?"right":"left":I="center"),r==="top"?u==="near"||v!==0?P=-S*$+$/2:u==="center"?P=-C.highest.height/2-T*$+$:P=-C.highest.height+$/2:u==="near"||v!==0?P=$/2:u==="center"?P=C.highest.height/2-T*$:P=C.highest.height-S*$,d&&(P*=-1),v!==0&&!E.showLabelBackdrop&&(O+=$/2*Math.sin(v))):(N=g,P=(1-S)*$/2);let W;if(E.showLabelBackdrop){const z=toPadding(E.backdropPadding),U=C.heights[w],B=C.widths[w];let V=P-z.top,H=0-z.left;switch(M){case"middle":V-=U/2;break;case"bottom":V-=U;break}switch(F){case"center":H-=B/2;break;case"right":H-=B;break}W={left:H,top:V,width:B+z.width,height:U+z.height,color:E.backdropColor}}y.push({label:k,font:b,textOffset:P,options:{rotation:v,color:x,strokeColor:A,strokeWidth:L,textAlign:I,textBaseline:M,translation:[O,N],backdrop:W}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:a}=this.options;if(-toRadians(this.labelRotation))return e==="top"?"left":"right";let r="center";return a.align==="start"?r="left":a.align==="end"?r="right":a.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:a,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,o=this._getLabelSizes(),s=e+i,l=o.widest.width;let u,c;return a==="left"?r?(c=this.right+i,n==="near"?u="left":n==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-s,n==="near"?u="right":n==="center"?(u="center",c-=l/2):(u="left",c=this.left)):a==="right"?r?(c=this.left+i,n==="near"?u="right":n==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+s,n==="near"?u="left":n==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,a=this.options.position;if(a==="left"||a==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(a==="top"||a==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:a},left:n,top:r,width:i,height:o}=this;a&&(e.save(),e.fillStyle=a,e.fillRect(n,r,i,o),e.restore())}getLineWidthForValue(e){const a=this.options.grid;if(!this._isVisible()||!a.display)return 0;const r=this.ticks.findIndex(i=>i.value===e);return r>=0?a.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const a=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,o;const s=(l,u,c)=>{!c.width||!c.color||(n.save(),n.lineWidth=c.width,n.strokeStyle=c.color,n.setLineDash(c.borderDash||[]),n.lineDashOffset=c.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(u.x,u.y),n.stroke(),n.restore())};if(a.display)for(i=0,o=r.length;i<o;++i){const l=r[i];a.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),a.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:a,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),o=n.display?i.width:0;if(!o)return;const s=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,h;this.isHorizontal()?(u=_alignPixel(e,this.left,o)-o/2,c=_alignPixel(e,this.right,s)+s/2,d=h=l):(d=_alignPixel(e,this.top,o)-o/2,h=_alignPixel(e,this.bottom,s)+s/2,u=c=l),a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.beginPath(),a.moveTo(u,d),a.lineTo(c,h),a.stroke(),a.restore()}drawLabels(e){if(!this.options.ticks.display)return;const n=this.ctx,r=this._computeLabelArea();r&&clipArea(n,r);const i=this.getLabelItems(e);for(const o of i){const s=o.options,l=o.font,u=o.label,c=o.textOffset;renderText(n,u,0,c,l,s)}r&&unclipArea(n)}drawTitle(){const{ctx:e,options:{position:a,title:n,reverse:r}}=this;if(!n.display)return;const i=toFont(n.font),o=toPadding(n.padding),s=n.align;let l=i.lineHeight/2;a==="bottom"||a==="center"||isObject$8(a)?(l+=o.bottom,isArray$c(n.text)&&(l+=i.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:h}=titleArgs(this,l,a,s);renderText(e,n.text,0,0,i,{color:n.color,maxWidth:d,rotation:h,textAlign:titleAlign(s,a,r),textBaseline:"middle",translation:[u,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,a=e.ticks&&e.ticks.z||0,n=valueOrDefault(e.grid&&e.grid.z,-1),r=valueOrDefault(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Scale.prototype.draw?[{z:a,draw:i=>{this.draw(i)}}]:[{z:n,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:a,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const a=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let i,o;for(i=0,o=a.length;i<o;++i){const s=a[i];s[n]===this.id&&(!e||s.type===e)&&r.push(s)}return r}_resolveTickFontOptions(e){const a=this.options.ticks.setContext(this.getContext(e));return toFont(a.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class TypedRegistry{constructor(e,a,n){this.type=e,this.scope=a,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const a=Object.getPrototypeOf(e);let n;isIChartComponent(a)&&(n=this.register(a));const r=this.items,i=e.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in r||(r[i]=e,registerDefaults(e,o,n),this.override&&defaults.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const a=this.items,n=e.id,r=this.scope;n in a&&delete a[n],r&&n in defaults[r]&&(delete defaults[r][n],this.override&&delete overrides[n])}}function registerDefaults(t,e,a){const n=merge(Object.create(null),[a?defaults.get(a):{},defaults.get(e),t.defaults]);defaults.set(e,n),t.defaultRoutes&&routeDefaults(e,t.defaultRoutes),t.descriptors&&defaults.describe(e,t.descriptors)}function routeDefaults(t,e){Object.keys(e).forEach(a=>{const n=a.split("."),r=n.pop(),i=[t].concat(n).join("."),o=e[a].split("."),s=o.pop(),l=o.join(".");defaults.route(i,r,l,s)})}function isIChartComponent(t){return"id"in t&&"defaults"in t}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$1,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,a,n){[...a].forEach(r=>{const i=n||this._getRegistryForType(r);n||i.isForType(r)||i===this.plugins&&r.id?this._exec(e,i,r):each(r,o=>{const s=n||this._getRegistryForType(o);this._exec(e,s,o)})})}_exec(e,a,n){const r=_capitalize(e);callback(n["before"+r],[],n),a[e](n),callback(n["after"+r],[],n)}_getRegistryForType(e){for(let a=0;a<this._typedRegistries.length;a++){const n=this._typedRegistries[a];if(n.isForType(e))return n}return this.plugins}_get(e,a,n){const r=a.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+n+".");return r}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(e,a,n,r){a==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const i=r?this._descriptors(e).filter(r):this._descriptors(e),o=this._notify(i,e,a,n);return a==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,a,n,r){r=r||{};for(const i of e){const o=i.plugin,s=o[n],l=[a,r,i.options];if(callback(s,l,o)===!1&&r.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const a=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),a}_createDescriptors(e,a){const n=e&&e.config,r=valueOrDefault(n.options&&n.options.plugins,{}),i=allPlugins(n);return r===!1&&!a?[]:createDescriptors(e,i,r,a)}_notifyStateChanges(e){const a=this._oldCache||[],n=this._cache,r=(i,o)=>i.filter(s=>!o.some(l=>s.plugin.id===l.plugin.id));this._notify(r(a,n),e,"stop"),this._notify(r(n,a),e,"start")}}function allPlugins(t){const e={},a=[],n=Object.keys(registry.plugins.items);for(let i=0;i<n.length;i++)a.push(registry.getPlugin(n[i]));const r=t.plugins||[];for(let i=0;i<r.length;i++){const o=r[i];a.indexOf(o)===-1&&(a.push(o),e[o.id]=!0)}return{plugins:a,localIds:e}}function getOpts(t,e){return!e&&t===!1?null:t===!0?{}:t}function createDescriptors(t,{plugins:e,localIds:a},n,r){const i=[],o=t.getContext();for(const s of e){const l=s.id,u=getOpts(n[l],r);u!==null&&i.push({plugin:s,options:pluginOpts(t.config,{plugin:s,local:a[l]},u,o)})}return i}function pluginOpts(t,{plugin:e,local:a},n,r){const i=t.pluginScopeKeys(e),o=t.getOptionScopes(n,i);return a&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(t,e){const a=defaults.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||a.indexAxis||"x"}function getAxisFromDefaultScaleID(t,e){let a=t;return t==="_index_"?a=e:t==="_value_"&&(a=e==="x"?"y":"x"),a}function getDefaultScaleIDFromAxis(t,e){return t===e?"_index_":"_value_"}function idMatchesAxis(t){if(t==="x"||t==="y"||t==="r")return t}function axisFromPosition(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function determineAxis(t,...e){if(idMatchesAxis(t))return t;for(const a of e){const n=a.axis||axisFromPosition(a.position)||t.length>1&&idMatchesAxis(t[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(t,e,a){if(a[e+"AxisID"]===t)return{axis:e}}function retrieveAxisFromDatasets(t,e){if(e.data&&e.data.datasets){const a=e.data.datasets.filter(n=>n.xAxisID===t||n.yAxisID===t);if(a.length)return getAxisFromDataset(t,"x",a[0])||getAxisFromDataset(t,"y",a[0])}return{}}function mergeScaleConfig(t,e){const a=overrides[t.type]||{scales:{}},n=e.scales||{},r=getIndexAxis(t.type,e),i=Object.create(null);return Object.keys(n).forEach(o=>{const s=n[o];if(!isObject$8(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=determineAxis(o,s,retrieveAxisFromDatasets(o,t),defaults.scales[s.type]),u=getDefaultScaleIDFromAxis(l,r),c=a.scales||{};i[o]=mergeIf(Object.create(null),[{axis:l},s,c[l],c[u]])}),t.data.datasets.forEach(o=>{const s=o.type||t.type,l=o.indexAxis||getIndexAxis(s,e),c=(overrides[s]||{}).scales||{};Object.keys(c).forEach(d=>{const h=getAxisFromDefaultScaleID(d,l),m=o[h+"AxisID"]||h;i[m]=i[m]||Object.create(null),mergeIf(i[m],[{axis:h},n[m],c[d]])})}),Object.keys(i).forEach(o=>{const s=i[o];mergeIf(s,[defaults.scales[s.type],defaults.scale])}),i}function initOptions(t){const e=t.options||(t.options={});e.plugins=valueOrDefault(e.plugins,{}),e.scales=mergeScaleConfig(t,e)}function initData(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function initConfig(t){return t=t||{},t.data=initData(t.data),initOptions(t),t}const keyCache=new Map,keysCached=new Set;function cachedKeys(t,e){let a=keyCache.get(t);return a||(a=e(),keyCache.set(t,a),keysCached.add(a)),a}const addIfFound=(t,e,a)=>{const n=resolveObjectKey(e,a);n!==void 0&&t.add(n)};class Config{constructor(e){this._config=initConfig(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=initData(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),initOptions(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return cachedKeys(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,a){return cachedKeys(`${e}.transition.${a}`,()=>[[`datasets.${e}.transitions.${a}`,`transitions.${a}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,a){return cachedKeys(`${e}-${a}`,()=>[[`datasets.${e}.elements.${a}`,`datasets.${e}`,`elements.${a}`,""]])}pluginScopeKeys(e){const a=e.id,n=this.type;return cachedKeys(`${n}-plugin-${a}`,()=>[[`plugins.${a}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,a){const n=this._scopeCache;let r=n.get(e);return(!r||a)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,a,n){const{options:r,type:i}=this,o=this._cachedScopes(e,n),s=o.get(a);if(s)return s;const l=new Set;a.forEach(c=>{e&&(l.add(e),c.forEach(d=>addIfFound(l,e,d))),c.forEach(d=>addIfFound(l,r,d)),c.forEach(d=>addIfFound(l,overrides[i]||{},d)),c.forEach(d=>addIfFound(l,defaults,d)),c.forEach(d=>addIfFound(l,descriptors,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),keysCached.has(a)&&o.set(a,u),u}chartOptionScopes(){const{options:e,type:a}=this;return[e,overrides[a]||{},defaults.datasets[a]||{},{type:a},defaults,descriptors]}resolveNamedOptions(e,a,n,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:s}=getResolver(this._resolverCache,e,r);let l=o;if(needContext(o,a)){i.$shared=!1,n=isFunction$3(n)?n():n;const u=this.createResolver(e,n,s);l=_attachContext(o,n,u)}for(const u of a)i[u]=l[u];return i}createResolver(e,a,n=[""],r){const{resolver:i}=getResolver(this._resolverCache,e,n);return isObject$8(a)?_attachContext(i,a,void 0,r):i}}function getResolver(t,e,a){let n=t.get(e);n||(n=new Map,t.set(e,n));const r=a.join();let i=n.get(r);return i||(i={resolver:_createResolver(e,a),subPrefixes:a.filter(s=>!s.toLowerCase().includes("hover"))},n.set(r,i)),i}const hasFunction=t=>isObject$8(t)&&Object.getOwnPropertyNames(t).reduce((e,a)=>e||isFunction$3(t[a]),!1);function needContext(t,e){const{isScriptable:a,isIndexable:n}=_descriptors(t);for(const r of e){const i=a(r),o=n(r),s=(o||i)&&t[r];if(i&&(isFunction$3(s)||hasFunction(s))||o&&isArray$c(s))return!0}return!1}var version="4.4.0";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(t,e){return t==="top"||t==="bottom"||KNOWN_POSITIONS.indexOf(t)===-1&&e==="x"}function compare2Level(t,e){return function(a,n){return a[t]===n[t]?a[e]-n[e]:a[t]-n[t]}}function onAnimationsComplete(t){const e=t.chart,a=e.options.animation;e.notifyPlugins("afterRender"),callback(a&&a.onComplete,[t],e)}function onAnimationProgress(t){const e=t.chart,a=e.options.animation;callback(a&&a.onProgress,[t],e)}function getCanvas(t){return _isDomSupported()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const instances={},getChart=t=>{const e=getCanvas(t);return Object.values(instances).filter(a=>a.canvas===e).pop()};function moveNumericKeys(t,e,a){const n=Object.keys(t);for(const r of n){const i=+r;if(i>=e){const o=t[r];delete t[r],(a>0||i>e)&&(t[i+a]=o)}}}function determineLastEvent(t,e,a,n){return!a||t.type==="mouseout"?null:n?e:t}function getSizeForArea(t,e,a){return t.options.clip?t[a]:e[a]}function getDatasetArea(t,e){const{xScale:a,yScale:n}=t;return a&&n?{left:getSizeForArea(a,e,"left"),right:getSizeForArea(a,e,"right"),top:getSizeForArea(n,e,"top"),bottom:getSizeForArea(n,e,"bottom")}:e}class Chart{static register(...e){registry.add(...e),invalidatePlugins()}static unregister(...e){registry.remove(...e),invalidatePlugins()}constructor(e,a){const n=this.config=new Config(a),r=getCanvas(e),i=getChart(r);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||_detectPlatform(r)),this.platform.updateConfig(n);const s=this.platform.acquireContext(r,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;if(this.id=uid(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:a},width:n,height:r,_aspectRatio:i}=this;return isNullOrUndef(e)?a&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(e,a){animator.running(this)?this._resizeBeforeDraw={width:e,height:a}:this._resize(e,a)}_resize(e,a){const n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,e,a,i),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,retinaScale(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),callback(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const a=this.options.scales||{};each(a,(n,r)=>{n.id=r})}buildOrUpdateScales(){const e=this.options,a=e.scales,n=this.scales,r=Object.keys(n).reduce((o,s)=>(o[s]=!1,o),{});let i=[];a&&(i=i.concat(Object.keys(a).map(o=>{const s=a[o],l=determineAxis(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),each(i,o=>{const s=o.options,l=s.id,u=determineAxis(l,s),c=valueOrDefault(s.type,o.dtype);(s.position===void 0||positionIsHorizontal(s.position,u)!==positionIsHorizontal(o.dposition))&&(s.position=o.dposition),r[l]=!0;let d=null;if(l in n&&n[l].type===c)d=n[l];else{const h=registry.getScale(c);d=new h({id:l,type:c,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(s,e)}),each(r,(o,s)=>{o||delete n[s]}),each(n,o=>{layouts.configure(this,o,o.options),layouts.addBox(this,o)})}_updateMetasets(){const e=this._metasets,a=this.data.datasets.length,n=e.length;if(e.sort((r,i)=>r.index-i.index),n>a){for(let r=a;r<n;++r)this._destroyDatasetMeta(r);e.splice(a,n-a)}this._sortedMetasets=e.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:a}}=this;e.length>a.length&&delete this._stacks,e.forEach((n,r)=>{a.filter(i=>i===n._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],a=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=a.length;n<r;n++){const i=a[n];let o=this.getDatasetMeta(n);const s=i.type||this.config.type;if(o.type&&o.type!==s&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=s,o.indexAxis=i.indexAxis||getIndexAxis(s,this.options),o.order=i.order||0,o.index=n,o.label=""+i.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const l=registry.getController(s),{datasetElementType:u,dataElementType:c}=defaults.datasets[s];Object.assign(l,{dataElementType:registry.getElement(c),datasetElementType:u&&registry.getElement(u)}),o.controller=new l(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){each(this.data.datasets,(e,a)=>{this.getDatasetMeta(a).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const a=this.config;a.update();const n=this._options=a.createResolver(a.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),h=!r&&i.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),r||each(i,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(compare2Level("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){each(this.scales,e=>{layouts.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,a=new Set(Object.keys(this._listeners)),n=new Set(e.events);(!setsEqual(a,n)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,a=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:i}of a){const o=n==="_removeElements"?-i:i;moveNumericKeys(e,r,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const a=this.data.datasets.length,n=i=>new Set(e.filter(o=>o[0]===i).map((o,s)=>s+","+o.splice(1).join(","))),r=n(0);for(let i=1;i<a;i++)if(!setsEqual(r,n(i)))return;return Array.from(r).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,e);const a=this.chartArea,n=a.width<=0||a.height<=0;this._layers=[],each(this.boxes,r=>{n&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,i)=>{r._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let a=0,n=this.data.datasets.length;a<n;++a)this.getDatasetMeta(a).controller.configure();for(let a=0,n=this.data.datasets.length;a<n;++a)this._updateDataset(a,isFunction$3(e)?e({datasetIndex:a}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,a){const n=this.getDatasetMeta(e),r={meta:n,index:e,mode:a,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(n.controller._update(a),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:n,height:r}=this._resizeBeforeDraw;this._resize(n,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const a=this._layers;for(e=0;e<a.length&&a[e].z<=0;++e)a[e].draw(this.chartArea);for(this._drawDatasets();e<a.length;++e)a[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const a=this._sortedMetasets,n=[];let r,i;for(r=0,i=a.length;r<i;++r){const o=a[r];(!e||o.visible)&&n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let a=e.length-1;a>=0;--a)this._drawDataset(e[a]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const a=this.ctx,n=e._clip,r=!n.disabled,i=getDatasetArea(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(r&&clipArea(a,{left:n.left===!1?0:i.left-n.left,right:n.right===!1?this.width:i.right+n.right,top:n.top===!1?0:i.top-n.top,bottom:n.bottom===!1?this.height:i.bottom+n.bottom}),e.controller.draw(),r&&unclipArea(a),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return _isPointInArea(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,a,n,r){const i=Interaction.modes[a];return typeof i=="function"?i(this,e,n,r):[]}getDatasetMeta(e){const a=this.data.datasets[e],n=this._metasets;let r=n.filter(i=>i&&i._dataset===a).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:a&&a.order||0,index:e,_dataset:a,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const a=this.data.datasets[e];if(!a)return!1;const n=this.getDatasetMeta(e);return typeof n.hidden=="boolean"?!n.hidden:!a.hidden}setDatasetVisibility(e,a){const n=this.getDatasetMeta(e);n.hidden=!a}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,a,n){const r=n?"show":"hide",i=this.getDatasetMeta(e),o=i.controller._resolveAnimations(void 0,r);defined$1(a)?(i.data[a].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),o.update(i,{visible:n}),this.update(s=>s.datasetIndex===e?r:void 0))}hide(e,a){this._updateVisibility(e,a,!1)}show(e,a){this._updateVisibility(e,a,!0)}_destroyDatasetMeta(e){const a=this._metasets[e];a&&a.controller&&a.controller._destroy(),delete this._metasets[e]}_stop(){let e,a;for(this.stop(),animator.remove(this),e=0,a=this.data.datasets.length;e<a;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:a}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),clearCanvas(e,a),this.platform.releaseContext(a),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,a=this.platform,n=(i,o)=>{a.addEventListener(this,i,o),e[i]=o},r=(i,o,s)=>{i.offsetX=o,i.offsetY=s,this._eventHandler(i)};each(this.options.events,i=>n(i,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,a=this.platform,n=(l,u)=>{a.addEventListener(this,l,u),e[l]=u},r=(l,u)=>{e[l]&&(a.removeEventListener(this,l,u),delete e[l])},i=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const s=()=>{r("attach",s),this.attached=!0,this.resize(),n("resize",i),n("detach",o)};o=()=>{this.attached=!1,r("resize",i),this._stop(),this._resize(0,0),n("attach",s)},a.isAttached(this.canvas)?s():o()}unbindEvents(){each(this._listeners,(e,a)=>{this.platform.removeEventListener(this,a,e)}),this._listeners={},each(this._responsiveListeners,(e,a)=>{this.platform.removeEventListener(this,a,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,a,n){const r=n?"set":"remove";let i,o,s,l;for(a==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+r+"DatasetHoverStyle"]()),s=0,l=e.length;s<l;++s){o=e[s];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[r+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const a=this._active||[],n=e.map(({datasetIndex:i,index:o})=>{const s=this.getDatasetMeta(i);if(!s)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:s.data[o],index:o}});!_elementsEqual(n,a)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,a))}notifyPlugins(e,a,n){return this._plugins.notify(this,e,a,n)}isPluginEnabled(e){return this._plugins._cache.filter(a=>a.plugin.id===e).length===1}_updateHoverStyles(e,a,n){const r=this.options.hover,i=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=i(a,e),s=n?e:i(e,a);o.length&&this.updateHoverStyle(o,r.mode,!1),s.length&&r.mode&&this.updateHoverStyle(s,r.mode,!0)}_eventHandler(e,a){const n={event:e,replay:a,cancelable:!0,inChartArea:this.isPointInArea(e)},r=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",n,r)===!1)return;const i=this._handleEvent(e,a,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,a,n){const{_active:r=[],options:i}=this,o=a,s=this._getActiveElements(e,r,n,o),l=_isClickEvent(e),u=determineLastEvent(e,this._lastEvent,n,l);n&&(this._lastEvent=null,callback(i.onHover,[e,s,this],this),l&&callback(i.onClick,[e,s,this],this));const c=!_elementsEqual(s,r);return(c||a)&&(this._active=s,this._updateHoverStyles(s,r,a)),this._lastEvent=u,c}_getActiveElements(e,a,n,r){if(e.type==="mouseout")return[];if(!n)return a;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}}R(Chart,"defaults",defaults),R(Chart,"instances",instances),R(Chart,"overrides",overrides),R(Chart,"registry",registry),R(Chart,"version",version),R(Chart,"getChart",getChart);function invalidatePlugins(){return each(Chart.instances,t=>t._plugins.invalidate())}function clipArc(t,e,a){const{startAngle:n,pixelMargin:r,x:i,y:o,outerRadius:s,innerRadius:l}=e;let u=r/s;t.beginPath(),t.arc(i,o,s,n-u,a+u),l>r?(u=r/l,t.arc(i,o,l,a+u,n-u,!0)):t.arc(i,o,r,a+HALF_PI,n-HALF_PI),t.closePath(),t.clip()}function toRadiusCorners(t){return _readValueToProps(t,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(t,e,a,n){const r=toRadiusCorners(t.options.borderRadius),i=(a-e)/2,o=Math.min(i,n*e/2),s=l=>{const u=(a-Math.min(i,l))*n/2;return _limitValue(l,0,Math.min(i,u))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:_limitValue(r.innerStart,0,o),innerEnd:_limitValue(r.innerEnd,0,o)}}function rThetaToXY(t,e,a,n){return{x:a+t*Math.cos(e),y:n+t*Math.sin(e)}}function pathArc(t,e,a,n,r,i){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=e,d=Math.max(e.outerRadius+n+a-u,0),h=c>0?c+n+a+u:0;let m=0;const p=r-l;if(n){const E=c>0?c-n:0,T=d>0?d-n:0,x=(E+T)/2,A=x!==0?p*x/(x+n):p;m=(p-A)/2}const v=Math.max(.001,p*d-a/PI)/d,y=(p-v)/2,w=l+y+m,_=r-y-m,{outerStart:D,outerEnd:k,innerStart:O,innerEnd:N}=parseBorderRadius$1(e,h,d,_-w),F=d-D,g=d-k,b=w+D/F,$=_-k/g,S=h+O,P=h+N,M=w+O/S,C=_-N/P;if(t.beginPath(),i){const E=(b+$)/2;if(t.arc(o,s,d,b,E),t.arc(o,s,d,E,$),k>0){const L=rThetaToXY(g,$,o,s);t.arc(L.x,L.y,k,$,_+HALF_PI)}const T=rThetaToXY(P,_,o,s);if(t.lineTo(T.x,T.y),N>0){const L=rThetaToXY(P,C,o,s);t.arc(L.x,L.y,N,_+HALF_PI,C+Math.PI)}const x=(_-N/h+(w+O/h))/2;if(t.arc(o,s,h,_-N/h,x,!0),t.arc(o,s,h,x,w+O/h,!0),O>0){const L=rThetaToXY(S,M,o,s);t.arc(L.x,L.y,O,M+Math.PI,w-HALF_PI)}const A=rThetaToXY(F,w,o,s);if(t.lineTo(A.x,A.y),D>0){const L=rThetaToXY(F,b,o,s);t.arc(L.x,L.y,D,w-HALF_PI,b)}}else{t.moveTo(o,s);const E=Math.cos(b)*d+o,T=Math.sin(b)*d+s;t.lineTo(E,T);const x=Math.cos($)*d+o,A=Math.sin($)*d+s;t.lineTo(x,A)}t.closePath()}function drawArc(t,e,a,n,r){const{fullCircles:i,startAngle:o,circumference:s}=e;let l=e.endAngle;if(i){pathArc(t,e,a,n,l,r);for(let u=0;u<i;++u)t.fill();isNaN(s)||(l=o+(s%TAU||TAU))}return pathArc(t,e,a,n,l,r),t.fill(),l}function drawBorder(t,e,a,n,r){const{fullCircles:i,startAngle:o,circumference:s,options:l}=e,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:h}=l,m=l.borderAlign==="inner";if(!u)return;t.setLineDash(d||[]),t.lineDashOffset=h,m?(t.lineWidth=u*2,t.lineJoin=c||"round"):(t.lineWidth=u,t.lineJoin=c||"bevel");let p=e.endAngle;if(i){pathArc(t,e,a,n,p,r);for(let v=0;v<i;++v)t.stroke();isNaN(s)||(p=o+(s%TAU||TAU))}m&&clipArc(t,e,p),i||(pathArc(t,e,a,n,p,r),t.stroke())}class ArcElement extends Element$1{constructor(a){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,a&&Object.assign(this,a)}inRange(a,n,r){const i=this.getProps(["x","y"],r),{angle:o,distance:s}=getAngleFromPoint(i,{x:a,y:n}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,v=valueOrDefault(h,u-l)>=TAU||_angleBetween(o,l,u),y=_isBetween(s,c+m,d+m);return v&&y}getCenterPoint(a){const{x:n,y:r,startAngle:i,endAngle:o,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],a),{offset:u,spacing:c}=this.options,d=(i+o)/2,h=(s+l+c+u)/2;return{x:n+Math.cos(d)*h,y:r+Math.sin(d)*h}}tooltipPosition(a){return this.getCenterPoint(a)}draw(a){const{options:n,circumference:r}=this,i=(n.offset||0)/4,o=(n.spacing||0)/2,s=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>TAU?Math.floor(r/TAU):0,r===0||this.innerRadius<0||this.outerRadius<0)return;a.save();const l=(this.startAngle+this.endAngle)/2;a.translate(Math.cos(l)*i,Math.sin(l)*i);const u=1-Math.sin(Math.min(PI,r||0)),c=i*u;a.fillStyle=n.backgroundColor,a.strokeStyle=n.borderColor,drawArc(a,this,c,o,s),drawBorder(a,this,c,o,s),a.restore()}}R(ArcElement,"id","arc"),R(ArcElement,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),R(ArcElement,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(ArcElement,"descriptors",{_scriptable:!0,_indexable:a=>a!=="borderDash"});function setStyle$1(t,e,a=e){t.lineCap=valueOrDefault(a.borderCapStyle,e.borderCapStyle),t.setLineDash(valueOrDefault(a.borderDash,e.borderDash)),t.lineDashOffset=valueOrDefault(a.borderDashOffset,e.borderDashOffset),t.lineJoin=valueOrDefault(a.borderJoinStyle,e.borderJoinStyle),t.lineWidth=valueOrDefault(a.borderWidth,e.borderWidth),t.strokeStyle=valueOrDefault(a.borderColor,e.borderColor)}function lineTo(t,e,a){t.lineTo(a.x,a.y)}function getLineMethod(t){return t.stepped?_steppedLineTo:t.tension||t.cubicInterpolationMode==="monotone"?_bezierCurveTo:lineTo}function pathVars(t,e,a={}){const n=t.length,{start:r=0,end:i=n-1}=a,{start:o,end:s}=e,l=Math.max(r,o),u=Math.min(i,s),c=r<o&&i<o||r>s&&i>s;return{count:n,start:l,loop:e.loop,ilen:u<l&&!c?n+u-l:u-l}}function pathSegment(t,e,a,n){const{points:r,options:i}=e,{count:o,start:s,loop:l,ilen:u}=pathVars(r,a,n),c=getLineMethod(i);let{move:d=!0,reverse:h}=n||{},m,p,v;for(m=0;m<=u;++m)p=r[(s+(h?u-m:m))%o],!p.skip&&(d?(t.moveTo(p.x,p.y),d=!1):c(t,v,p,h,i.stepped),v=p);return l&&(p=r[(s+(h?u:0))%o],c(t,v,p,h,i.stepped)),!!l}function fastPathSegment(t,e,a,n){const r=e.points,{count:i,start:o,ilen:s}=pathVars(r,a,n),{move:l=!0,reverse:u}=n||{};let c=0,d=0,h,m,p,v,y,w;const _=k=>(o+(u?s-k:k))%i,D=()=>{v!==y&&(t.lineTo(c,y),t.lineTo(c,v),t.lineTo(c,w))};for(l&&(m=r[_(0)],t.moveTo(m.x,m.y)),h=0;h<=s;++h){if(m=r[_(h)],m.skip)continue;const k=m.x,O=m.y,N=k|0;N===p?(O<v?v=O:O>y&&(y=O),c=(d*c+k)/++d):(D(),t.lineTo(k,O),p=N,d=0,v=y=O),w=O}D()}function _getSegmentMethod(t){const e=t.options,a=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!a?fastPathSegment:pathSegment}function _getInterpolationMethod(t){return t.stepped?_steppedInterpolation:t.tension||t.cubicInterpolationMode==="monotone"?_bezierInterpolation:_pointInLine}function strokePathWithCache(t,e,a,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,a,n)&&r.closePath()),setStyle$1(t,e.options),t.stroke(r)}function strokePathDirect(t,e,a,n){const{segments:r,options:i}=e,o=_getSegmentMethod(e);for(const s of r)setStyle$1(t,i,s.style),t.beginPath(),o(t,e,s,{start:a,end:a+n-1})&&t.closePath(),t.stroke()}const usePath2D=typeof Path2D=="function";function draw(t,e,a,n){usePath2D&&!e.options.segment?strokePathWithCache(t,e,a,n):strokePathDirect(t,e,a,n)}class LineElement extends Element$1{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,a){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,n,e,r,a),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const e=this.segments,a=this.points;return e.length&&a[e[0].start]}last(){const e=this.segments,a=this.points,n=e.length;return n&&a[e[n-1].end]}interpolate(e,a){const n=this.options,r=e[a],i=this.points,o=_boundSegments(this,{property:a,start:r,end:r});if(!o.length)return;const s=[],l=_getInterpolationMethod(n);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:h}=o[u],m=i[d],p=i[h];if(m===p){s.push(m);continue}const v=Math.abs((r-m[a])/(p[a]-m[a])),y=l(m,p,v,n.stepped);y[a]=e[a],s.push(y)}return s.length===1?s[0]:s}pathSegment(e,a,n){return _getSegmentMethod(this)(e,this,a,n)}path(e,a,n){const r=this.segments,i=_getSegmentMethod(this);let o=this._loop;a=a||0,n=n||this.points.length-a;for(const s of r)o&=i(e,this,s,{start:a,end:a+n-1});return!!o}draw(e,a,n,r){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),draw(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(LineElement,"id","line"),R(LineElement,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(LineElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(LineElement,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function inRange$1(t,e,a,n){const r=t.options,{[a]:i}=t.getProps([a],n);return Math.abs(e-i)<r.radius+r.hitRadius}class PointElement extends Element$1{constructor(a){super();R(this,"parsed");R(this,"skip");R(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,a&&Object.assign(this,a)}inRange(a,n,r){const i=this.options,{x:o,y:s}=this.getProps(["x","y"],r);return Math.pow(a-o,2)+Math.pow(n-s,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(a,n){return inRange$1(this,a,"x",n)}inYRange(a,n){return inRange$1(this,a,"y",n)}getCenterPoint(a){const{x:n,y:r}=this.getProps(["x","y"],a);return{x:n,y:r}}size(a){a=a||this.options||{};let n=a.radius||0;n=Math.max(n,n&&a.hoverRadius||0);const r=n&&a.borderWidth||0;return(n+r)*2}draw(a,n){const r=this.options;this.skip||r.radius<.1||!_isPointInArea(this,n,this.size(r)/2)||(a.strokeStyle=r.borderColor,a.lineWidth=r.borderWidth,a.fillStyle=r.backgroundColor,drawPoint(a,r,this.x,this.y))}getRange(){const a=this.options||{};return a.radius+a.hitRadius}}R(PointElement,"id","point"),R(PointElement,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(PointElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function getBarBounds(t,e){const{x:a,y:n,base:r,width:i,height:o}=t.getProps(["x","y","base","width","height"],e);let s,l,u,c,d;return t.horizontal?(d=o/2,s=Math.min(a,r),l=Math.max(a,r),u=n-d,c=n+d):(d=i/2,s=a-d,l=a+d,u=Math.min(n,r),c=Math.max(n,r)),{left:s,top:u,right:l,bottom:c}}function skipOrLimit(t,e,a,n){return t?0:_limitValue(e,a,n)}function parseBorderWidth(t,e,a){const n=t.options.borderWidth,r=t.borderSkipped,i=toTRBL(n);return{t:skipOrLimit(r.top,i.top,0,a),r:skipOrLimit(r.right,i.right,0,e),b:skipOrLimit(r.bottom,i.bottom,0,a),l:skipOrLimit(r.left,i.left,0,e)}}function parseBorderRadius(t,e,a){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,i=toTRBLCorners(r),o=Math.min(e,a),s=t.borderSkipped,l=n||isObject$8(r);return{topLeft:skipOrLimit(!l||s.top||s.left,i.topLeft,0,o),topRight:skipOrLimit(!l||s.top||s.right,i.topRight,0,o),bottomLeft:skipOrLimit(!l||s.bottom||s.left,i.bottomLeft,0,o),bottomRight:skipOrLimit(!l||s.bottom||s.right,i.bottomRight,0,o)}}function boundingRects(t){const e=getBarBounds(t),a=e.right-e.left,n=e.bottom-e.top,r=parseBorderWidth(t,a/2,n/2),i=parseBorderRadius(t,a/2,n/2);return{outer:{x:e.left,y:e.top,w:a,h:n,radius:i},inner:{x:e.left+r.l,y:e.top+r.t,w:a-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,i.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(r.b,r.r))}}}}function inRange(t,e,a,n){const r=e===null,i=a===null,s=t&&!(r&&i)&&getBarBounds(t,n);return s&&(r||_isBetween(e,s.left,s.right))&&(i||_isBetween(a,s.top,s.bottom))}function hasRadius(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function addNormalRectPath(t,e){t.rect(e.x,e.y,e.w,e.h)}function inflateRect(t,e,a={}){const n=t.x!==a.x?-e:0,r=t.y!==a.y?-e:0,i=(t.x+t.w!==a.x+a.w?e:0)-n,o=(t.y+t.h!==a.y+a.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+i,h:t.h+o,radius:t.radius}}class BarElement extends Element$1{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:a,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:o}=boundingRects(this),s=hasRadius(o.radius)?addRoundedRectPath:addNormalRectPath;e.save(),(o.w!==i.w||o.h!==i.h)&&(e.beginPath(),s(e,inflateRect(o,a,i)),e.clip(),s(e,inflateRect(i,-a,o)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),s(e,inflateRect(i,a)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,a,n){return inRange(this,e,a,n)}inXRange(e,a){return inRange(this,e,null,a)}inYRange(e,a){return inRange(this,null,e,a)}getCenterPoint(e){const{x:a,y:n,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(a+r)/2:a,y:i?n:(n+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}R(BarElement,"id","bar"),R(BarElement,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(BarElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const BORDER_COLORS=["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)"],BACKGROUND_COLORS=BORDER_COLORS.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function getBorderColor(t){return BORDER_COLORS[t%BORDER_COLORS.length]}function getBackgroundColor(t){return BACKGROUND_COLORS[t%BACKGROUND_COLORS.length]}function colorizeDefaultDataset(t,e){return t.borderColor=getBorderColor(e),t.backgroundColor=getBackgroundColor(e),++e}function colorizeDoughnutDataset(t,e){return t.backgroundColor=t.data.map(()=>getBorderColor(e++)),e}function colorizePolarAreaDataset(t,e){return t.backgroundColor=t.data.map(()=>getBackgroundColor(e++)),e}function getColorizer(t){let e=0;return(a,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof DoughnutController?e=colorizeDoughnutDataset(a,e):r instanceof PolarAreaController?e=colorizePolarAreaDataset(a,e):r&&(e=colorizeDefaultDataset(a,e))}}function containsColorsDefinitions(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function containsColorsDefinition(t){return t&&(t.borderColor||t.backgroundColor)}var plugin_colors={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,a){if(!a.enabled)return;const{data:{datasets:n},options:r}=t.config,{elements:i}=r;if(!a.forceOverride&&(containsColorsDefinitions(n)||containsColorsDefinition(r)||i&&containsColorsDefinitions(i)))return;const o=getColorizer(t);n.forEach(o)}};function _segments(t,e,a){const n=t.segments,r=t.points,i=e.points,o=[];for(const s of n){let{start:l,end:u}=s;u=_findSegmentEnd(l,u,r);const c=_getBounds(a,r[l],r[u],s.loop);if(!e.segments){o.push({source:s,target:c,start:r[l],end:r[u]});continue}const d=_boundSegments(e,c);for(const h of d){const m=_getBounds(a,i[h.start],i[h.end],h.loop),p=_boundSegment(s,r,m);for(const v of p)o.push({source:v,target:h,start:{[a]:_getEdge(c,m,"start",Math.max)},end:{[a]:_getEdge(c,m,"end",Math.min)}})}}return o}function _getBounds(t,e,a,n){if(n)return;let r=e[t],i=a[t];return t==="angle"&&(r=_normalizeAngle(r),i=_normalizeAngle(i)),{property:t,start:r,end:i}}function _pointsFromSegments(t,e){const{x:a=null,y:n=null}=t||{},r=e.points,i=[];return e.segments.forEach(({start:o,end:s})=>{s=_findSegmentEnd(o,s,r);const l=r[o],u=r[s];n!==null?(i.push({x:l.x,y:n}),i.push({x:u.x,y:n})):a!==null&&(i.push({x:a,y:l.y}),i.push({x:a,y:u.y}))}),i}function _findSegmentEnd(t,e,a){for(;e>t;e--){const n=a[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function _getEdge(t,e,a,n){return t&&e?n(t[a],e[a]):t?t[a]:e?e[a]:0}function _createBoundaryLine(t,e){let a=[],n=!1;return isArray$c(t)?(n=!0,a=t):a=_pointsFromSegments(t,e),a.length?new LineElement({points:a,options:{tension:0},_loop:n,_fullLoop:n}):null}function _shouldApplyFill(t){return t&&t.fill!==!1}function _resolveTarget(t,e,a){let r=t[e].fill;const i=[e];let o;if(!a)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!isNumberFinite(r))return r;if(o=t[r],!o)return!1;if(o.visible)return r;i.push(r),r=o.fill}return!1}function _decodeFill(t,e,a){const n=parseFillOption(t);if(isObject$8(n))return isNaN(n.value)?!1:n;let r=parseFloat(n);return isNumberFinite(r)&&Math.floor(r)===r?decodeTargetIndex(n[0],e,r,a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function decodeTargetIndex(t,e,a,n){return(t==="-"||t==="+")&&(a=e+a),a===e||a<0||a>=n?!1:a}function _getTargetPixel(t,e){let a=null;return t==="start"?a=e.bottom:t==="end"?a=e.top:isObject$8(t)?a=e.getPixelForValue(t.value):e.getBasePixel&&(a=e.getBasePixel()),a}function _getTargetValue(t,e,a){let n;return t==="start"?n=a:t==="end"?n=e.options.reverse?e.min:e.max:isObject$8(t)?n=t.value:n=e.getBaseValue(),n}function parseFillOption(t){const e=t.options,a=e.fill;let n=valueOrDefault(a&&a.target,a);return n===void 0&&(n=!!e.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function _buildStackLine(t){const{scale:e,index:a,line:n}=t,r=[],i=n.segments,o=n.points,s=getLinesBelow(e,a);s.push(_createBoundaryLine({x:null,y:e.bottom},n));for(let l=0;l<i.length;l++){const u=i[l];for(let c=u.start;c<=u.end;c++)addPointsBelow(r,o[c],s)}return new LineElement({points:r,options:{}})}function getLinesBelow(t,e){const a=[],n=t.getMatchingVisibleMetas("line");for(let r=0;r<n.length;r++){const i=n[r];if(i.index===e)break;i.hidden||a.unshift(i.dataset)}return a}function addPointsBelow(t,e,a){const n=[];for(let r=0;r<a.length;r++){const i=a[r],{first:o,last:s,point:l}=findPoint(i,e,"x");if(!(!l||o&&s)){if(o)n.unshift(l);else if(t.push(l),!s)break}}t.push(...n)}function findPoint(t,e,a){const n=t.interpolate(e,a);if(!n)return{};const r=n[a],i=t.segments,o=t.points;let s=!1,l=!1;for(let u=0;u<i.length;u++){const c=i[u],d=o[c.start][a],h=o[c.end][a];if(_isBetween(r,d,h)){s=r===d,l=r===h;break}}return{first:s,last:l,point:n}}class simpleArc{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,a,n){const{x:r,y:i,radius:o}=this;return a=a||{start:0,end:TAU},e.arc(r,i,o,a.end,a.start,!0),!n.bounds}interpolate(e){const{x:a,y:n,radius:r}=this,i=e.angle;return{x:a+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}}function _getTarget(t){const{chart:e,fill:a,line:n}=t;if(isNumberFinite(a))return getLineByIndex(e,a);if(a==="stack")return _buildStackLine(t);if(a==="shape")return!0;const r=computeBoundary(t);return r instanceof simpleArc?r:_createBoundaryLine(r,n)}function getLineByIndex(t,e){const a=t.getDatasetMeta(e);return a&&t.isDatasetVisible(e)?a.dataset:null}function computeBoundary(t){return(t.scale||{}).getPointPositionForValue?computeCircularBoundary(t):computeLinearBoundary(t)}function computeLinearBoundary(t){const{scale:e={},fill:a}=t,n=_getTargetPixel(a,e);if(isNumberFinite(n)){const r=e.isHorizontal();return{x:r?n:null,y:r?null:n}}return null}function computeCircularBoundary(t){const{scale:e,fill:a}=t,n=e.options,r=e.getLabels().length,i=n.reverse?e.max:e.min,o=_getTargetValue(a,e,i),s=[];if(n.grid.circular){const l=e.getPointPositionForValue(0,i);return new simpleArc({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<r;++l)s.push(e.getPointPositionForValue(l,o));return s}function _drawfill(t,e,a){const n=_getTarget(e),{line:r,scale:i,axis:o}=e,s=r.options,l=s.fill,u=s.backgroundColor,{above:c=u,below:d=u}=l||{};n&&r.points.length&&(clipArea(t,a),doFill(t,{line:r,target:n,above:c,below:d,area:a,scale:i,axis:o}),unclipArea(t))}function doFill(t,e){const{line:a,target:n,above:r,below:i,area:o,scale:s}=e,l=a._loop?"angle":e.axis;t.save(),l==="x"&&i!==r&&(clipVertical(t,n,o.top),fill(t,{line:a,target:n,color:r,scale:s,property:l}),t.restore(),t.save(),clipVertical(t,n,o.bottom)),fill(t,{line:a,target:n,color:i,scale:s,property:l}),t.restore()}function clipVertical(t,e,a){const{segments:n,points:r}=e;let i=!0,o=!1;t.beginPath();for(const s of n){const{start:l,end:u}=s,c=r[l],d=r[_findSegmentEnd(l,u,r)];i?(t.moveTo(c.x,c.y),i=!1):(t.lineTo(c.x,a),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,s,{move:o}),o?t.closePath():t.lineTo(d.x,a)}t.lineTo(e.first().x,a),t.closePath(),t.clip()}function fill(t,e){const{line:a,target:n,property:r,color:i,scale:o}=e,s=_segments(a,n,r);for(const{source:l,target:u,start:c,end:d}of s){const{style:{backgroundColor:h=i}={}}=l,m=n!==!0;t.save(),t.fillStyle=h,clipBounds(t,o,m&&_getBounds(r,c,d)),t.beginPath();const p=!!a.pathSegment(t,l);let v;if(m){p?t.closePath():interpolatedLineTo(t,n,d,r);const y=!!n.pathSegment(t,u,{move:p,reverse:!0});v=p&&y,v||interpolatedLineTo(t,n,c,r)}t.closePath(),t.fill(v?"evenodd":"nonzero"),t.restore()}}function clipBounds(t,e,a){const{top:n,bottom:r}=e.chart.chartArea,{property:i,start:o,end:s}=a||{};i==="x"&&(t.beginPath(),t.rect(o,n,s-o,r-n),t.clip())}function interpolatedLineTo(t,e,a,n){const r=e.interpolate(a,n);r&&t.lineTo(r.x,r.y)}var index$1={id:"filler",afterDatasetsUpdate(t,e,a){const n=(t.data.datasets||[]).length,r=[];let i,o,s,l;for(o=0;o<n;++o)i=t.getDatasetMeta(o),s=i.dataset,l=null,s&&s.options&&s instanceof LineElement&&(l={visible:t.isDatasetVisible(o),index:o,fill:_decodeFill(s,o,n),chart:t,axis:i.controller.options.indexAxis,scale:i.vScale,line:s}),i.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],!(!l||l.fill===!1)&&(l.fill=_resolveTarget(r,o,a.propagate))},beforeDraw(t,e,a){const n=a.drawTime==="beforeDraw",r=t.getSortedVisibleDatasetMetas(),i=t.chartArea;for(let o=r.length-1;o>=0;--o){const s=r[o].$filler;s&&(s.line.updateControlPoints(i,s.axis),n&&s.fill&&_drawfill(t.ctx,s,i))}},beforeDatasetsDraw(t,e,a){if(a.drawTime!=="beforeDatasetsDraw")return;const n=t.getSortedVisibleDatasetMetas();for(let r=n.length-1;r>=0;--r){const i=n[r].$filler;_shouldApplyFill(i)&&_drawfill(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,a){const n=e.meta.$filler;!_shouldApplyFill(n)||a.drawTime!=="beforeDatasetDraw"||_drawfill(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=(t,e)=>{let{boxHeight:a=e,boxWidth:n=e}=t;return t.usePointStyle&&(a=Math.min(a,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:a,itemHeight:Math.max(e,a)}},itemsEqual=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Legend extends Element$1{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,a,n){this.maxWidth=e,this.maxHeight=a,this._margins=n,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 e=this.options.labels||{};let a=callback(e.generateLabels,[this.chart],this)||[];e.filter&&(a=a.filter(n=>e.filter(n,this.chart.data))),e.sort&&(a=a.sort((n,r)=>e.sort(n,r,this.chart.data))),this.options.reverse&&a.reverse(),this.legendItems=a}fit(){const{options:e,ctx:a}=this;if(!e.display){this.width=this.height=0;return}const n=e.labels,r=toFont(n.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=getBoxSize(n,i);let u,c;a.font=r.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,i,s,l)+10):(c=this.maxHeight,u=this._fitCols(o,r,s,l)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,a,n,r){const{ctx:i,maxWidth:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=r+s;let d=e;i.textAlign="left",i.textBaseline="middle";let h=-1,m=-c;return this.legendItems.forEach((p,v)=>{const y=n+a/2+i.measureText(p.text).width;(v===0||u[u.length-1]+y+2*s>o)&&(d+=c,u[u.length-(v>0?0:1)]=0,m+=c,h++),l[v]={left:0,top:m,row:h,width:y,height:r},u[u.length-1]+=y+s}),d}_fitCols(e,a,n,r){const{ctx:i,maxHeight:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-e;let d=s,h=0,m=0,p=0,v=0;return this.legendItems.forEach((y,w)=>{const{itemWidth:_,itemHeight:D}=calculateItemSize(n,a,i,y,r);w>0&&m+D+2*s>c&&(d+=h+s,u.push({width:h,height:m}),p+=h+s,v++,h=m=0),l[w]={left:p,top:m,col:v,width:_,height:D},h=Math.max(h,_),m+=D+s}),d+=h,u.push({width:h,height:m}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:a,options:{align:n,labels:{padding:r},rtl:i}}=this,o=getRtlAdapter(i,this.left,this.width);if(this.isHorizontal()){let s=0,l=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[s]);for(const u of a)s!==u.row&&(s=u.row,l=_alignStartEnd(n,this.left+r,this.right-this.lineWidths[s])),u.top+=this.top+e+r,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+r}else{let s=0,l=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[s].height);for(const u of a)u.col!==s&&(s=u.col,l=_alignStartEnd(n,this.top+e+r,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+r,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;clipArea(e,this),this._draw(),unclipArea(e)}}_draw(){const{options:e,columnSizes:a,lineWidths:n,ctx:r}=this,{align:i,labels:o}=e,s=defaults.color,l=getRtlAdapter(e.rtl,this.left,this.width),u=toFont(o.font),{padding:c}=o,d=u.size,h=d/2;let m;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:p,boxHeight:v,itemHeight:y}=getBoxSize(o,d),w=function(N,F,g){if(isNaN(p)||p<=0||isNaN(v)||v<0)return;r.save();const b=valueOrDefault(g.lineWidth,1);if(r.fillStyle=valueOrDefault(g.fillStyle,s),r.lineCap=valueOrDefault(g.lineCap,"butt"),r.lineDashOffset=valueOrDefault(g.lineDashOffset,0),r.lineJoin=valueOrDefault(g.lineJoin,"miter"),r.lineWidth=b,r.strokeStyle=valueOrDefault(g.strokeStyle,s),r.setLineDash(valueOrDefault(g.lineDash,[])),o.usePointStyle){const $={radius:v*Math.SQRT2/2,pointStyle:g.pointStyle,rotation:g.rotation,borderWidth:b},S=l.xPlus(N,p/2),P=F+h;drawPointLegend(r,$,S,P,o.pointStyleWidth&&p)}else{const $=F+Math.max((d-v)/2,0),S=l.leftForLtr(N,p),P=toTRBLCorners(g.borderRadius);r.beginPath(),Object.values(P).some(M=>M!==0)?addRoundedRectPath(r,{x:S,y:$,w:p,h:v,radius:P}):r.rect(S,$,p,v),r.fill(),b!==0&&r.stroke()}r.restore()},_=function(N,F,g){renderText(r,g.text,N,F+y/2,u,{strikethrough:g.hidden,textAlign:l.textAlign(g.textAlign)})},D=this.isHorizontal(),k=this._computeTitleHeight();D?m={x:_alignStartEnd(i,this.left+c,this.right-n[0]),y:this.top+c+k,line:0}:m={x:this.left+c,y:_alignStartEnd(i,this.top+k+c,this.bottom-a[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const O=y+c;this.legendItems.forEach((N,F)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const g=r.measureText(N.text).width,b=l.textAlign(N.textAlign||(N.textAlign=o.textAlign)),$=p+h+g;let S=m.x,P=m.y;l.setWidth(this.width),D?F>0&&S+$+c>this.right&&(P=m.y+=O,m.line++,S=m.x=_alignStartEnd(i,this.left+c,this.right-n[m.line])):F>0&&P+O>this.bottom&&(S=m.x=S+a[m.line].width+c,m.line++,P=m.y=_alignStartEnd(i,this.top+k+c,this.bottom-a[m.line].height));const M=l.x(S);if(w(M,P,N),S=_textX(b,S+p+h,D?S+$:this.right,e.rtl),_(l.x(S),P,N),D)m.x+=$+c;else if(typeof N.text!="string"){const C=u.lineHeight;m.y+=calculateLegendItemHeight(N,C)+c}else m.y+=O}),restoreTextDirection(this.ctx,e.textDirection)}drawTitle(){const e=this.options,a=e.title,n=toFont(a.font),r=toPadding(a.padding);if(!a.display)return;const i=getRtlAdapter(e.rtl,this.left,this.width),o=this.ctx,s=a.position,l=n.size/2,u=r.top+l;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,d=_alignStartEnd(e.align,d,this.right-h);else{const p=this.columnSizes.reduce((v,y)=>Math.max(v,y.height),0);c=u+_alignStartEnd(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=_alignStartEnd(s,d,d+h);o.textAlign=i.textAlign(_toLeftRightCenter(s)),o.textBaseline="middle",o.strokeStyle=a.color,o.fillStyle=a.color,o.font=n.string,renderText(o,a.text,m,c,n)}_computeTitleHeight(){const e=this.options.title,a=toFont(e.font),n=toPadding(e.padding);return e.display?a.lineHeight+n.height:0}_getLegendItemAt(e,a){let n,r,i;if(_isBetween(e,this.left,this.right)&&_isBetween(a,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],_isBetween(e,r.left,r.left+r.width)&&_isBetween(a,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){const a=this.options;if(!isListened(e.type,a))return;const n=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,i=itemsEqual(r,n);r&&!i&&callback(a.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&callback(a.onHover,[e,n,this],this)}else n&&callback(a.onClick,[e,n,this],this)}}function calculateItemSize(t,e,a,n,r){const i=calculateItemWidth(n,t,e,a),o=calculateItemHeight(r,n,e.lineHeight);return{itemWidth:i,itemHeight:o}}function calculateItemWidth(t,e,a,n){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((i,o)=>i.length>o.length?i:o)),e+a.size/2+n.measureText(r).width}function calculateItemHeight(t,e,a){let n=t;return typeof e.text!="string"&&(n=calculateLegendItemHeight(e,a)),n}function calculateLegendItemHeight(t,e){const a=t.text?t.text.length:0;return e*a}function isListened(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var plugin_legend={id:"legend",_element:Legend,start(t,e,a){const n=t.legend=new Legend({ctx:t.ctx,options:a,chart:t});layouts.configure(t,n,a),layouts.addBox(t,n)},stop(t){layouts.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,a){const n=t.legend;layouts.configure(t,n,a),n.options=a},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,a){const n=e.datasetIndex,r=a.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.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:a,pointStyle:n,textAlign:r,color:i,useBorderRadius:o,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(a?0:void 0),c=toPadding(u.borderWidth);return{text:e[l.index].label,fillStyle:u.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:n||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:o&&(s||u.borderRadius),datasetIndex:l.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)}}};const positioners={average(t){if(!t.length)return!1;let e,a,n=0,r=0,i=0;for(e=0,a=t.length;e<a;++e){const o=t[e].element;if(o&&o.hasValue()){const s=o.tooltipPosition();n+=s.x,r+=s.y,++i}}return{x:n/i,y:r/i}},nearest(t,e){if(!t.length)return!1;let a=e.x,n=e.y,r=Number.POSITIVE_INFINITY,i,o,s;for(i=0,o=t.length;i<o;++i){const l=t[i].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=distanceBetweenPoints(e,u);c<r&&(r=c,s=l)}}if(s){const l=s.tooltipPosition();a=l.x,n=l.y}return{x:a,y:n}}};function pushOrConcat(t,e){return e&&(isArray$c(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function splitNewlines(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
`)>-1?t.split(`
-`):t}function createTooltipItem(t,e){const{element:a,datasetIndex:n,index:r}=e,i=t.getDatasetMeta(n).controller,{label:o,value:s}=i.getLabelAndValue(r);return{chart:t,label:o,parsed:i.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:s,dataset:i.getDataset(),dataIndex:r,datasetIndex:n,element:a}}function getTooltipSize(t,e){const a=t.chart.ctx,{body:n,footer:r,title:i}=t,{boxWidth:o,boxHeight:s}=e,l=toFont(e.bodyFont),u=toFont(e.titleFont),c=toFont(e.footerFont),d=i.length,h=r.length,m=n.length,p=toPadding(e.padding);let v=p.height,y=0,w=n.reduce((k,O)=>k+O.before.length+O.lines.length+O.after.length,0);if(w+=t.beforeBody.length+t.afterBody.length,d&&(v+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),w){const k=e.displayColors?Math.max(s,l.lineHeight):l.lineHeight;v+=m*k+(w-m)*l.lineHeight+(w-1)*e.bodySpacing}h&&(v+=e.footerMarginTop+h*c.lineHeight+(h-1)*e.footerSpacing);let _=0;const D=function(k){y=Math.max(y,a.measureText(k).width+_)};return a.save(),a.font=u.string,each(t.title,D),a.font=l.string,each(t.beforeBody.concat(t.afterBody),D),_=e.displayColors?o+2+e.boxPadding:0,each(n,k=>{each(k.before,D),each(k.lines,D),each(k.after,D)}),_=0,a.font=c.string,each(t.footer,D),a.restore(),y+=p.width,{width:y,height:v}}function determineYAlign(t,e){const{y:a,height:n}=e;return a<n/2?"top":a>t.height-n/2?"bottom":"center"}function doesNotFitWithAlign(t,e,a,n){const{x:r,width:i}=n,o=a.caretSize+a.caretPadding;if(t==="left"&&r+i+o>e.width||t==="right"&&r-i-o<0)return!0}function determineXAlign(t,e,a,n){const{x:r,width:i}=a,{width:o,chartArea:{left:s,right:l}}=t;let u="center";return n==="center"?u=r<=(s+l)/2?"left":"right":r<=i/2?u="left":r>=o-i/2&&(u="right"),doesNotFitWithAlign(u,t,e,a)&&(u="center"),u}function determineAlignment(t,e,a){const n=a.yAlign||e.yAlign||determineYAlign(t,a);return{xAlign:a.xAlign||e.xAlign||determineXAlign(t,e,a,n),yAlign:n}}function alignX(t,e){let{x:a,width:n}=t;return e==="right"?a-=n:e==="center"&&(a-=n/2),a}function alignY(t,e,a){let{y:n,height:r}=t;return e==="top"?n+=a:e==="bottom"?n-=r+a:n-=r/2,n}function getBackgroundPoint(t,e,a,n){const{caretSize:r,caretPadding:i,cornerRadius:o}=t,{xAlign:s,yAlign:l}=a,u=r+i,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:m}=toTRBLCorners(o);let p=alignX(e,s);const v=alignY(e,l,u);return l==="center"?s==="left"?p+=u:s==="right"&&(p-=u):s==="left"?p-=Math.max(c,h)+r:s==="right"&&(p+=Math.max(d,m)+r),{x:_limitValue(p,0,n.width-e.width),y:_limitValue(v,0,n.height-e.height)}}function getAlignedX(t,e,a){const n=toPadding(a.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-n.right:t.x+n.left}function getBeforeAfterBodyLines(t){return pushOrConcat([],splitNewlines(t))}function createTooltipContext(t,e,a){return createContext(t,{tooltip:e,tooltipItems:a,type:"tooltip"})}function overrideCallbacks(t,e){const a=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return a?t.override(a):t}const defaultCallbacks={beforeTitle:noop$2,title(t){if(t.length>0){const e=t[0],a=e.chart.data.labels,n=a?a.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return a[e.dataIndex]}return""},afterTitle:noop$2,beforeBody:noop$2,beforeLabel:noop$2,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const a=t.formattedValue;return isNullOrUndef(a)||(e+=a),e},labelColor(t){const a=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:a.borderColor,backgroundColor:a.backgroundColor,borderWidth:a.borderWidth,borderDash:a.borderDash,borderDashOffset:a.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const a=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:a.pointStyle,rotation:a.rotation}},afterLabel:noop$2,afterBody:noop$2,beforeFooter:noop$2,footer:noop$2,afterFooter:noop$2};function invokeCallbackWithFallback(t,e,a,n){const r=t[e].call(a,n);return typeof r>"u"?defaultCallbacks[e].call(a,n):r}class Tooltip extends Element$1{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const a=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&a.options.animation&&n.animations,i=new Animations(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,a){const{callbacks:n}=a,r=invokeCallbackWithFallback(n,"beforeTitle",this,e),i=invokeCallbackWithFallback(n,"title",this,e),o=invokeCallbackWithFallback(n,"afterTitle",this,e);let s=[];return s=pushOrConcat(s,splitNewlines(r)),s=pushOrConcat(s,splitNewlines(i)),s=pushOrConcat(s,splitNewlines(o)),s}getBeforeBody(e,a){return getBeforeAfterBodyLines(invokeCallbackWithFallback(a.callbacks,"beforeBody",this,e))}getBody(e,a){const{callbacks:n}=a,r=[];return each(e,i=>{const o={before:[],lines:[],after:[]},s=overrideCallbacks(n,i);pushOrConcat(o.before,splitNewlines(invokeCallbackWithFallback(s,"beforeLabel",this,i))),pushOrConcat(o.lines,invokeCallbackWithFallback(s,"label",this,i)),pushOrConcat(o.after,splitNewlines(invokeCallbackWithFallback(s,"afterLabel",this,i))),r.push(o)}),r}getAfterBody(e,a){return getBeforeAfterBodyLines(invokeCallbackWithFallback(a.callbacks,"afterBody",this,e))}getFooter(e,a){const{callbacks:n}=a,r=invokeCallbackWithFallback(n,"beforeFooter",this,e),i=invokeCallbackWithFallback(n,"footer",this,e),o=invokeCallbackWithFallback(n,"afterFooter",this,e);let s=[];return s=pushOrConcat(s,splitNewlines(r)),s=pushOrConcat(s,splitNewlines(i)),s=pushOrConcat(s,splitNewlines(o)),s}_createItems(e){const a=this._active,n=this.chart.data,r=[],i=[],o=[];let s=[],l,u;for(l=0,u=a.length;l<u;++l)s.push(createTooltipItem(this.chart,a[l]));return e.filter&&(s=s.filter((c,d,h)=>e.filter(c,d,h,n))),e.itemSort&&(s=s.sort((c,d)=>e.itemSort(c,d,n))),each(s,c=>{const d=overrideCallbacks(e.callbacks,c);r.push(invokeCallbackWithFallback(d,"labelColor",this,c)),i.push(invokeCallbackWithFallback(d,"labelPointStyle",this,c)),o.push(invokeCallbackWithFallback(d,"labelTextColor",this,c))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=s,s}update(e,a){const n=this.options.setContext(this.getContext()),r=this._active;let i,o=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{const s=positioners[n.position].call(this,r,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=getTooltipSize(this,n),u=Object.assign({},s,l),c=determineAlignment(this.chart,n,u),d=getBackgroundPoint(n,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:a})}drawCaret(e,a,n,r){const i=this.getCaretPosition(e,n,r);a.lineTo(i.x1,i.y1),a.lineTo(i.x2,i.y2),a.lineTo(i.x3,i.y3)}getCaretPosition(e,a,n){const{xAlign:r,yAlign:i}=this,{caretSize:o,cornerRadius:s}=n,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=toTRBLCorners(s),{x:h,y:m}=e,{width:p,height:v}=a;let y,w,_,D,k,O;return i==="center"?(k=m+v/2,r==="left"?(y=h,w=y-o,D=k+o,O=k-o):(y=h+p,w=y+o,D=k-o,O=k+o),_=y):(r==="left"?w=h+Math.max(l,c)+o:r==="right"?w=h+p-Math.max(u,d)-o:w=this.caretX,i==="top"?(D=m,k=D-o,y=w-o,_=w+o):(D=m+v,k=D+o,y=w+o,_=w-o),O=D),{x1:y,x2:w,x3:_,y1:D,y2:k,y3:O}}drawTitle(e,a,n){const r=this.title,i=r.length;let o,s,l;if(i){const u=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.titleAlign,n),a.textAlign=u.textAlign(n.titleAlign),a.textBaseline="middle",o=toFont(n.titleFont),s=n.titleSpacing,a.fillStyle=n.titleColor,a.font=o.string,l=0;l<i;++l)a.fillText(r[l],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+s,l+1===i&&(e.y+=n.titleMarginBottom-s)}}_drawColorBox(e,a,n,r,i){const o=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:l,boxWidth:u}=i,c=toFont(i.bodyFont),d=getAlignedX(this,"left",i),h=r.x(d),m=l<c.lineHeight?(c.lineHeight-l)/2:0,p=a.y+m;if(i.usePointStyle){const v={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},y=r.leftForLtr(h,u)+u/2,w=p+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,drawPoint(e,v,y,w),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,drawPoint(e,v,y,w)}else{e.lineWidth=isObject$8(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const v=r.leftForLtr(h,u),y=r.leftForLtr(r.xPlus(h,1),u-2),w=toTRBLCorners(o.borderRadius);Object.values(w).some(_=>_!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,addRoundedRectPath(e,{x:v,y:p,w:u,h:l,radius:w}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:y,y:p+1,w:u-2,h:l-2,radius:w}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(v,p,u,l),e.strokeRect(v,p,u,l),e.fillStyle=o.backgroundColor,e.fillRect(y,p+1,u-2,l-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,a,n){const{body:r}=this,{bodySpacing:i,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:c}=n,d=toFont(n.bodyFont);let h=d.lineHeight,m=0;const p=getRtlAdapter(n.rtl,this.x,this.width),v=function(g){a.fillText(g,p.x(e.x+m),e.y+h/2),e.y+=h+i},y=p.textAlign(o);let w,_,D,k,O,N,F;for(a.textAlign=o,a.textBaseline="middle",a.font=d.string,e.x=getAlignedX(this,y,n),a.fillStyle=n.bodyColor,each(this.beforeBody,v),m=s&&y!=="right"?o==="center"?u/2+c:u+2+c:0,k=0,N=r.length;k<N;++k){for(w=r[k],_=this.labelTextColors[k],a.fillStyle=_,each(w.before,v),D=w.lines,s&&D.length&&(this._drawColorBox(a,e,k,p,n),h=Math.max(d.lineHeight,l)),O=0,F=D.length;O<F;++O)v(D[O]),h=d.lineHeight;each(w.after,v)}m=0,h=d.lineHeight,each(this.afterBody,v),e.y-=i}drawFooter(e,a,n){const r=this.footer,i=r.length;let o,s;if(i){const l=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.footerAlign,n),e.y+=n.footerMarginTop,a.textAlign=l.textAlign(n.footerAlign),a.textBaseline="middle",o=toFont(n.footerFont),a.fillStyle=n.footerColor,a.font=o.string,s=0;s<i;++s)a.fillText(r[s],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+n.footerSpacing}}drawBackground(e,a,n,r){const{xAlign:i,yAlign:o}=this,{x:s,y:l}=e,{width:u,height:c}=n,{topLeft:d,topRight:h,bottomLeft:m,bottomRight:p}=toTRBLCorners(r.cornerRadius);a.fillStyle=r.backgroundColor,a.strokeStyle=r.borderColor,a.lineWidth=r.borderWidth,a.beginPath(),a.moveTo(s+d,l),o==="top"&&this.drawCaret(e,a,n,r),a.lineTo(s+u-h,l),a.quadraticCurveTo(s+u,l,s+u,l+h),o==="center"&&i==="right"&&this.drawCaret(e,a,n,r),a.lineTo(s+u,l+c-p),a.quadraticCurveTo(s+u,l+c,s+u-p,l+c),o==="bottom"&&this.drawCaret(e,a,n,r),a.lineTo(s+m,l+c),a.quadraticCurveTo(s,l+c,s,l+c-m),o==="center"&&i==="left"&&this.drawCaret(e,a,n,r),a.lineTo(s,l+d),a.quadraticCurveTo(s,l,s+d,l),a.closePath(),a.fill(),r.borderWidth>0&&a.stroke()}_updateAnimationTarget(e){const a=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){const o=positioners[e.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=getTooltipSize(this,e),l=Object.assign({},o,this._size),u=determineAlignment(a,e,l),c=getBackgroundPoint(e,l,u,a);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const a=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(a);const r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=toPadding(a.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;a.enabled&&s&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,a),overrideTextDirection(e,a.textDirection),i.y+=o.top,this.drawTitle(i,e,a),this.drawBody(i,e,a),this.drawFooter(i,e,a),restoreTextDirection(e,a.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,a){const n=this._active,r=e.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),i=!_elementsEqual(n,r),o=this._positionChanged(r,a);(i||o)&&(this._active=r,this._eventPosition=a,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,a,n=!0){if(a&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,i=this._active||[],o=this._getActiveElements(e,i,a,n),s=this._positionChanged(o,e),l=a||!_elementsEqual(o,i)||s;return l&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,a))),l}_getActiveElements(e,a,n,r){const i=this.options;if(e.type==="mouseout")return[];if(!r)return a;const o=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&o.reverse(),o}_positionChanged(e,a){const{caretX:n,caretY:r,options:i}=this,o=positioners[i.position].call(this,e,a);return o!==!1&&(n!==o.x||r!==o.y)}}R(Tooltip,"positioners",positioners);var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(t,e,a){a&&(t.tooltip=new Tooltip({chart:t,options:a}))},beforeUpdate(t,e,a){t.tooltip&&t.tooltip.initialize(a)},reset(t,e,a){t.tooltip&&t.tooltip.initialize(a)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const a={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...a,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",a)}},afterEvent(t,e){if(t.tooltip){const a=e.replay;t.tooltip.handleEvent(e.event,a,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:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(t,e,a,n)=>(typeof e=="string"?(a=t.push(e)-1,n.unshift({index:a,label:e})):isNaN(e)&&(a=null),a);function findOrAddLabel(t,e,a,n){const r=t.indexOf(e);if(r===-1)return addIfString(t,e,a,n);const i=t.lastIndexOf(e);return r!==i?a:r}const validIndex=(t,e)=>t===null?null:_limitValue(Math.round(t),0,e);function _getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class CategoryScale extends Scale{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const a=this._addedLabels;if(a.length){const n=this.getLabels();for(const{index:r,label:i}of a)n[r]===i&&n.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,a){if(isNullOrUndef(e))return null;const n=this.getLabels();return a=isFinite(a)&&n[a]===e?a:findOrAddLabel(n,e,valueOrDefault(a,e),this._addedLabels),validIndex(a,n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:a}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(n=0),a||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const e=this.min,a=this.max,n=this.options.offset,r=[];let i=this.getLabels();i=e===0&&a===i.length-1?i:i.slice(e,a+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=e;o<=a;o++)r.push({value:o});return r}getLabelForValue(e){return _getLabelForValue.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const a=this.ticks;return e<0||e>a.length-1?null:this.getPixelForValue(a[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}R(CategoryScale,"id","category"),R(CategoryScale,"defaults",{ticks:{callback:_getLabelForValue}});function generateTicks$1(t,e){const a=[],{bounds:r,step:i,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:h}=t,m=i||1,p=c-1,{min:v,max:y}=e,w=!isNullOrUndef(o),_=!isNullOrUndef(s),D=!isNullOrUndef(u),k=(y-v)/(d+1);let O=niceNum((y-v)/p/m)*m,N,F,g,b;if(O<1e-14&&!w&&!_)return[{value:v},{value:y}];b=Math.ceil(y/O)-Math.floor(v/O),b>p&&(O=niceNum(b*O/p/m)*m),isNullOrUndef(l)||(N=Math.pow(10,l),O=Math.ceil(O*N)/N),r==="ticks"?(F=Math.floor(v/O)*O,g=Math.ceil(y/O)*O):(F=v,g=y),w&&_&&i&&almostWhole((s-o)/i,O/1e3)?(b=Math.round(Math.min((s-o)/O,c)),O=(s-o)/b,F=o,g=s):D?(F=w?o:F,g=_?s:g,b=u-1,O=(g-F)/b):(b=(g-F)/O,almostEquals(b,Math.round(b),O/1e3)?b=Math.round(b):b=Math.ceil(b));const $=Math.max(_decimalPlaces(O),_decimalPlaces(F));N=Math.pow(10,isNullOrUndef(l)?$:l),F=Math.round(F*N)/N,g=Math.round(g*N)/N;let S=0;for(w&&(h&&F!==o?(a.push({value:o}),F<o&&S++,almostEquals(Math.round((F+S*O)*N)/N,o,relativeLabelSize(o,k,t))&&S++):F<o&&S++);S<b;++S){const P=Math.round((F+S*O)*N)/N;if(_&&P>s)break;a.push({value:P})}return _&&h&&g!==s?a.length&&almostEquals(a[a.length-1].value,s,relativeLabelSize(s,k,t))?a[a.length-1].value=s:a.push({value:s}):(!_||g===s)&&a.push({value:g}),a}function relativeLabelSize(t,e,{horizontal:a,minRotation:n}){const r=toRadians(n),i=(a?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/i,o)}class LinearScaleBase extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,a){return isNullOrUndef(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:a,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this;const o=l=>r=a?r:l,s=l=>i=n?i:l;if(e){const l=sign(r),u=sign(i);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(r===i){let l=i===0?1:Math.abs(i*.05);s(i+l),e||o(r-l)}this.min=r,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:a,stepSize:n}=e,r;return n?(r=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),a=a||11),a&&(r=Math.min(a,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,a=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r={maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:a.precision,step:a.stepSize,count:a.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:a.minRotation||0,includeBounds:a.includeBounds!==!1},i=this._range||this,o=generateTicks$1(r,i);return e.bounds==="ticks"&&_setMinAndMaxByKey(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let a=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const r=(n-a)/Math.max(e.length-1,1)/2;a-=r,n+=r}this._startValue=a,this._endValue=n,this._valueRange=n-a}getLabelForValue(e){return formatNumber$1(e,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:e,max:a}=this.getMinMax(!0);this.min=isNumberFinite(e)?e:0,this.max=isNumberFinite(a)?a:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),a=e?this.width:this.height,n=toRadians(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(a/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}R(LinearScale,"id","linear"),R(LinearScale,"defaults",{ticks:{callback:Ticks.formatters.numeric}});const log10Floor=t=>Math.floor(log10(t)),changeExponent=(t,e)=>Math.pow(10,log10Floor(t)+e);function isMajor(t){return t/Math.pow(10,log10Floor(t))===1}function steps(t,e,a){const n=Math.pow(10,a),r=Math.floor(t/n);return Math.ceil(e/n)-r}function startExp(t,e){const a=e-t;let n=log10Floor(a);for(;steps(t,e,n)>10;)n++;for(;steps(t,e,n)<10;)n--;return Math.min(n,log10Floor(t))}function generateTicks(t,{min:e,max:a}){e=finiteOrDefault(t.min,e);const n=[],r=log10Floor(e);let i=startExp(e,a),o=i<0?Math.pow(10,Math.abs(i)):1;const s=Math.pow(10,i),l=r>i?Math.pow(10,r):0,u=Math.round((e-l)*o)/o,c=Math.floor((e-l)/s/10)*s*10;let d=Math.floor((u-c)/Math.pow(10,i)),h=finiteOrDefault(t.min,Math.round((l+c+d*Math.pow(10,i))*o)/o);for(;h<a;)n.push({value:h,major:isMajor(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,o=i>=0?1:o),h=Math.round((l+c+d*Math.pow(10,i))*o)/o;const m=finiteOrDefault(t.max,h);return n.push({value:m,major:isMajor(m),significand:d}),n}class LogarithmicScale extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,a){const n=LinearScaleBase.prototype.parse.apply(this,[e,a]);if(n===0){this._zero=!0;return}return isNumberFinite(n)&&n>0?n:null}determineDataLimits(){const{min:e,max:a}=this.getMinMax(!0);this.min=isNumberFinite(e)?Math.max(0,e):null,this.max=isNumberFinite(a)?Math.max(0,a):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!isNumberFinite(this._userMin)&&(this.min=e===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:a}=this.getUserBounds();let n=this.min,r=this.max;const i=s=>n=e?n:s,o=s=>r=a?r:s;n===r&&(n<=0?(i(1),o(10)):(i(changeExponent(n,-1)),o(changeExponent(r,1)))),n<=0&&i(changeExponent(r,-1)),r<=0&&o(changeExponent(n,1)),this.min=n,this.max=r}buildTicks(){const e=this.options,a={min:this._userMin,max:this._userMax},n=generateTicks(a,this);return e.bounds==="ticks"&&_setMinAndMaxByKey(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(e){return e===void 0?"0":formatNumber$1(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=log10(e),this._valueRange=log10(this.max)-log10(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(log10(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const a=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+a*this._valueRange)}}R(LogarithmicScale,"id","logarithmic"),R(LogarithmicScale,"defaults",{ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}});function getTickBackdropHeight(t){const e=t.ticks;if(e.display&&t.display){const a=toPadding(e.backdropPadding);return valueOrDefault(e.font&&e.font.size,defaults.font.size)+a.height}return 0}function measureLabelSize(t,e,a){return a=isArray$c(a)?a:[a],{w:_longestText(t,e.string,a),h:a.length*e.lineHeight}}function determineLimits(t,e,a,n,r){return t===n||t===r?{start:e-a/2,end:e+a/2}:t<n||t>r?{start:e-a,end:e}:{start:e,end:e+a}}function fitWithPointLabels(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},a=Object.assign({},e),n=[],r=[],i=t._pointLabels.length,o=t.options.pointLabels,s=o.centerPointLabels?PI/i:0;for(let l=0;l<i;l++){const u=o.setContext(t.getPointLabelContext(l));r[l]=u.padding;const c=t.getPointPosition(l,t.drawingArea+r[l],s),d=toFont(u.font),h=measureLabelSize(t.ctx,d,t._pointLabels[l]);n[l]=h;const m=_normalizeAngle(t.getIndexAngle(l)+s),p=Math.round(toDegrees(m)),v=determineLimits(p,c.x,h.w,0,180),y=determineLimits(p,c.y,h.h,90,270);updateLimits(a,e,m,v,y)}t.setCenterPoint(e.l-a.l,a.r-e.r,e.t-a.t,a.b-e.b),t._pointLabelItems=buildPointLabelItems(t,n,r)}function updateLimits(t,e,a,n,r){const i=Math.abs(Math.sin(a)),o=Math.abs(Math.cos(a));let s=0,l=0;n.start<e.l?(s=(e.l-n.start)/i,t.l=Math.min(t.l,e.l-s)):n.end>e.r&&(s=(n.end-e.r)/i,t.r=Math.max(t.r,e.r+s)),r.start<e.t?(l=(e.t-r.start)/o,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function createPointLabelItem(t,e,a){const n=t.drawingArea,{extra:r,additionalAngle:i,padding:o,size:s}=a,l=t.getPointPosition(e,n+r+o,i),u=Math.round(toDegrees(_normalizeAngle(l.angle+HALF_PI))),c=yForAngle(l.y,s.h,u),d=getTextAlignForAngle(u),h=leftForTextAlign(l.x,s.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:h,top:c,right:h+s.w,bottom:c+s.h}}function isNotOverlapped(t,e){if(!e)return!0;const{left:a,top:n,right:r,bottom:i}=t;return!(_isPointInArea({x:a,y:n},e)||_isPointInArea({x:a,y:i},e)||_isPointInArea({x:r,y:n},e)||_isPointInArea({x:r,y:i},e))}function buildPointLabelItems(t,e,a){const n=[],r=t._pointLabels.length,i=t.options,{centerPointLabels:o,display:s}=i.pointLabels,l={extra:getTickBackdropHeight(i)/2,additionalAngle:o?PI/r:0};let u;for(let c=0;c<r;c++){l.padding=a[c],l.size=e[c];const d=createPointLabelItem(t,c,l);n.push(d),s==="auto"&&(d.visible=isNotOverlapped(d,u),d.visible&&(u=d))}return n}function getTextAlignForAngle(t){return t===0||t===180?"center":t<180?"left":"right"}function leftForTextAlign(t,e,a){return a==="right"?t-=e:a==="center"&&(t-=e/2),t}function yForAngle(t,e,a){return a===90||a===270?t-=e/2:(a>270||a<90)&&(t-=e),t}function drawPointLabelBox(t,e,a){const{left:n,top:r,right:i,bottom:o}=a,{backdropColor:s}=e;if(!isNullOrUndef(s)){const l=toTRBLCorners(e.borderRadius),u=toPadding(e.backdropPadding);t.fillStyle=s;const c=n-u.left,d=r-u.top,h=i-n+u.width,m=o-r+u.height;Object.values(l).some(p=>p!==0)?(t.beginPath(),addRoundedRectPath(t,{x:c,y:d,w:h,h:m,radius:l}),t.fill()):t.fillRect(c,d,h,m)}}function drawPointLabels(t,e){const{ctx:a,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){const i=t._pointLabelItems[r];if(!i.visible)continue;const o=n.setContext(t.getPointLabelContext(r));drawPointLabelBox(a,o,i);const s=toFont(o.font),{x:l,y:u,textAlign:c}=i;renderText(a,t._pointLabels[r],l,u+s.lineHeight/2,s,{color:o.color,textAlign:c,textBaseline:"middle"})}}function pathRadiusLine(t,e,a,n){const{ctx:r}=t;if(a)r.arc(t.xCenter,t.yCenter,e,0,TAU);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let o=1;o<n;o++)i=t.getPointPosition(o,e),r.lineTo(i.x,i.y)}}function drawRadiusLine(t,e,a,n,r){const i=t.ctx,o=e.circular,{color:s,lineWidth:l}=e;!o&&!n||!s||!l||a<0||(i.save(),i.strokeStyle=s,i.lineWidth=l,i.setLineDash(r.dash),i.lineDashOffset=r.dashOffset,i.beginPath(),pathRadiusLine(t,a,o,n),i.closePath(),i.stroke(),i.restore())}function createPointLabelContext(t,e,a){return createContext(t,{label:a,index:e,type:"pointLabel"})}class RadialLinearScale extends LinearScaleBase{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=toPadding(getTickBackdropHeight(this.options)/2),a=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+a/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(a,n)/2)}determineDataLimits(){const{min:e,max:a}=this.getMinMax(!1);this.min=isNumberFinite(e)&&!isNaN(e)?e:0,this.max=isNumberFinite(a)&&!isNaN(a)?a:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(e){LinearScaleBase.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((a,n)=>{const r=callback(this.options.pointLabels.callback,[a,n],this);return r||r===0?r:""}).filter((a,n)=>this.chart.getDataVisibility(n))}fit(){const e=this.options;e.display&&e.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,a,n,r){this.xCenter+=Math.floor((e-a)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,a,n,r))}getIndexAngle(e){const a=TAU/(this._pointLabels.length||1),n=this.options.startAngle||0;return _normalizeAngle(e*a+toRadians(n))}getDistanceFromCenterForValue(e){if(isNullOrUndef(e))return NaN;const a=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*a:(e-this.min)*a}getValueForDistanceFromCenter(e){if(isNullOrUndef(e))return NaN;const a=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-a:this.min+a}getPointLabelContext(e){const a=this._pointLabels||[];if(e>=0&&e<a.length){const n=a[e];return createPointLabelContext(this.getContext(),e,n)}}getPointPosition(e,a,n=0){const r=this.getIndexAngle(e)-HALF_PI+n;return{x:Math.cos(r)*a+this.xCenter,y:Math.sin(r)*a+this.yCenter,angle:r}}getPointPositionForValue(e,a){return this.getPointPosition(e,this.getDistanceFromCenterForValue(a))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:a,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:a,top:n,right:r,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:a}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),a,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,a=this.options,{angleLines:n,grid:r,border:i}=a,o=this._pointLabels.length;let s,l,u;if(a.pointLabels.display&&drawPointLabels(this,o),r.display&&this.ticks.forEach((c,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(c.value);const h=this.getContext(d),m=r.setContext(h),p=i.setContext(h);drawRadiusLine(this,m,l,o,p)}}),n.display){for(e.save(),s=o-1;s>=0;s--){const c=n.setContext(this.getPointLabelContext(s)),{color:d,lineWidth:h}=c;!h||!d||(e.lineWidth=h,e.strokeStyle=d,e.setLineDash(c.borderDash),e.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(a.ticks.reverse?this.min:this.max),u=this.getPointPosition(s,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,a=this.options,n=a.ticks;if(!n.display)return;const r=this.getIndexAngle(0);let i,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!a.reverse)return;const u=n.setContext(this.getContext(l)),c=toFont(u.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){e.font=c.string,o=e.measureText(s.label).width,e.fillStyle=u.backdropColor;const d=toPadding(u.backdropPadding);e.fillRect(-o/2-d.left,-i-c.size/2-d.top,o+d.width,c.size+d.height)}renderText(e,s.label,0,-i,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}R(RadialLinearScale,"id","radialLinear"),R(RadialLinearScale,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),R(RadialLinearScale,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(RadialLinearScale,"descriptors",{angleLines:{_fallback:"grid"}});const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(t,e){return t-e}function parse(t,e){if(isNullOrUndef(e))return null;const a=t._adapter,{parser:n,round:r,isoWeekday:i}=t._parseOpts;let o=e;return typeof n=="function"&&(o=n(o)),isNumberFinite(o)||(o=typeof n=="string"?a.parse(o,n):a.parse(o)),o===null?null:(r&&(o=r==="week"&&(isNumber(i)||i===!0)?a.startOf(o,"isoWeek",i):a.startOf(o,r)),+o)}function determineUnitForAutoTicks(t,e,a,n){const r=UNITS.length;for(let i=UNITS.indexOf(t);i<r-1;++i){const o=INTERVALS[UNITS[i]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((a-e)/(s*o.size))<=n)return UNITS[i]}return UNITS[r-1]}function determineUnitForFormatting(t,e,a,n,r){for(let i=UNITS.length-1;i>=UNITS.indexOf(a);i--){const o=UNITS[i];if(INTERVALS[o].common&&t._adapter.diff(r,n,o)>=e-1)return o}return UNITS[a?UNITS.indexOf(a):0]}function determineMajorUnit(t){for(let e=UNITS.indexOf(t)+1,a=UNITS.length;e<a;++e)if(INTERVALS[UNITS[e]].common)return UNITS[e]}function addTick(t,e,a){if(!a)t[e]=!0;else if(a.length){const{lo:n,hi:r}=_lookup(a,e),i=a[n]>=e?a[n]:a[r];t[i]=!0}}function setMajorTicks(t,e,a,n){const r=t._adapter,i=+r.startOf(e[0].value,n),o=e[e.length-1].value;let s,l;for(s=i;s<=o;s=+r.add(s,1,n))l=a[s],l>=0&&(e[l].major=!0);return e}function ticksFromTimestamps(t,e,a){const n=[],r={},i=e.length;let o,s;for(o=0;o<i;++o)s=e[o],r[s]=o,n.push({value:s,major:!1});return i===0||!a?n:setMajorTicks(t,n,r,a)}class TimeScale extends Scale{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,a={}){const n=e.time||(e.time={}),r=this._adapter=new adapters._date(e.adapters.date);r.init(a),mergeIf(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=a.normalized}parse(e,a){return e===void 0?null:parse(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,a=this._adapter,n=e.time.unit||"day";let{min:r,max:i,minDefined:o,maxDefined:s}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(r=Math.min(r,u.min)),!s&&!isNaN(u.max)&&(i=Math.max(i,u.max))}(!o||!s)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=isNumberFinite(r)&&!isNaN(r)?r:+a.startOf(Date.now(),n),i=isNumberFinite(i)&&!isNaN(i)?i:+a.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let a=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(a=e[0],n=e[e.length-1]),{min:a,max:n}}buildTicks(){const e=this.options,a=e.time,n=e.ticks,r=n.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const i=this.min,o=this.max,s=_filterBetween(r,i,o);return this._unit=a.unit||(n.autoSkip?determineUnitForAutoTicks(a.minUnit,this.min,this.max,this._getLabelCapacity(i)):determineUnitForFormatting(this,s.length,a.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:determineMajorUnit(this._unit),this.initOffsets(r),e.reverse&&s.reverse(),ticksFromTimestamps(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let a=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?a=1-r:a=(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?n=i:n=(i-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;a=_limitValue(a,0,o),n=_limitValue(n,0,o),this._offsets={start:a,end:n,factor:1/(a+1+n)}}_generate(){const e=this._adapter,a=this.min,n=this.max,r=this.options,i=r.time,o=i.unit||determineUnitForAutoTicks(i.minUnit,a,n,this._getLabelCapacity(a)),s=valueOrDefault(r.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,u=isNumber(l)||l===!0,c={};let d=a,h,m;if(u&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,u?"day":o),e.diff(n,a,o)>1e5*s)throw new Error(a+" and "+n+" are too far apart with stepSize of "+s+" "+o);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=d,m=0;h<n;h=+e.add(h,s,o),m++)addTick(c,h,p);return(h===n||r.bounds==="ticks"||m===1)&&addTick(c,h,p),Object.keys(c).sort(sorter).map(v=>+v)}getLabelForValue(e){const a=this._adapter,n=this.options.time;return n.tooltipFormat?a.format(e,n.tooltipFormat):a.format(e,n.displayFormats.datetime)}format(e,a){const r=this.options.time.displayFormats,i=this._unit,o=a||r[i];return this._adapter.format(e,o)}_tickFormatFunction(e,a,n,r){const i=this.options,o=i.ticks.callback;if(o)return callback(o,[e,a,n],this);const s=i.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],d=u&&s[u],h=n[a],m=u&&d&&h&&h.major;return this._adapter.format(e,r||(m?d:c))}generateTickLabels(e){let a,n,r;for(a=0,n=e.length;a<n;++a)r=e[a],r.label=this._tickFormatFunction(r.value,a,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const a=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((a.start+n)*a.factor)}getValueForPixel(e){const a=this._offsets,n=this.getDecimalForPixel(e)/a.factor-a.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const a=this.options.ticks,n=this.ctx.measureText(e).width,r=toRadians(this.isHorizontal()?a.maxRotation:a.minRotation),i=Math.cos(r),o=Math.sin(r),s=this._resolveTickFontOptions(0).size;return{w:n*i+s*o,h:n*o+s*i}}_getLabelCapacity(e){const a=this.options.time,n=a.displayFormats,r=n[a.unit]||n.millisecond,i=this._tickFormatFunction(e,0,ticksFromTimestamps(this,[e],this._majorUnit),r),o=this._getLabelSize(i),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s:1}getDataTimestamps(){let e=this._cache.data||[],a,n;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(a=0,n=r.length;a<n;++a)e=e.concat(r[a].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let a,n;if(e.length)return e;const r=this.getLabels();for(a=0,n=r.length;a<n;++a)e.push(parse(this,r[a]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _arrayUnique(e.sort(sorter))}}R(TimeScale,"id","time"),R(TimeScale,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function interpolate$1(t,e,a){let n=0,r=t.length-1,i,o,s,l;a?(e>=t[n].pos&&e<=t[r].pos&&({lo:n,hi:r}=_lookupByKey(t,"pos",e)),{pos:i,time:s}=t[n],{pos:o,time:l}=t[r]):(e>=t[n].time&&e<=t[r].time&&({lo:n,hi:r}=_lookupByKey(t,"time",e)),{time:i,pos:s}=t[n],{time:o,pos:l}=t[r]);const u=o-i;return u?s+(l-s)*(e-i)/u:s}class TimeSeriesScale extends TimeScale{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),a=this._table=this.buildLookupTable(e);this._minPos=interpolate$1(a,this.min),this._tableRange=interpolate$1(a,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:a,max:n}=this,r=[],i=[];let o,s,l,u,c;for(o=0,s=e.length;o<s;++o)u=e[o],u>=a&&u<=n&&r.push(u);if(r.length<2)return[{time:a,pos:0},{time:n,pos:1}];for(o=0,s=r.length;o<s;++o)c=r[o+1],l=r[o-1],u=r[o],Math.round((c+l)/2)!==u&&i.push({time:u,pos:o/(s-1)});return i}_generate(){const e=this.min,a=this.max;let n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(a)||n.length===1)&&n.push(a),n.sort((r,i)=>r-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const a=this.getDataTimestamps(),n=this.getLabelTimestamps();return a.length&&n.length?e=this.normalize(a.concat(n)):e=a.length?a:n,e=this._cache.all=e,e}getDecimalForValue(e){return(interpolate$1(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const a=this._offsets,n=this.getDecimalForPixel(e)/a.factor-a.end;return interpolate$1(this._table,n*this._tableRange+this._minPos,!0)}}R(TimeSeriesScale,"id","timeseries"),R(TimeSeriesScale,"defaults",TimeScale.defaults);function getDefaultChartSettings(t){return t==="sankey"?{type:"sankey",data:{datasets:[]}}:t==="pie"?{type:"pie",data:{datasets:[]}}:t==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(e){let a=e.dataset.currency_code;return formatMoney(e.raw,a)}}}},maintainAspectRatio:!1,scales:{}}}:t==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(e){let a=e.dataset.currency_code;return formatMoney(e.raw,a)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let blue=new Color("#36a2eb"),red=new Color("#ff6384"),green=new Color("#4bc0c0"),orange=new Color("#ff9f40"),purple=new Color("#9966ff"),yellow=new Color("#ffcd56"),grey=new Color("#c9cbcf"),index=0;window.theme==="dark"&&(red.darken(.3).desaturate(.3),green.darken(.3).desaturate(.3),blue.darken(.3).desaturate(.3),orange.darken(.3).desaturate(.3));let allColors=[red,orange,blue,green,purple,yellow,grey,green];function getColors(t,e){let a={borderColor:red.rgbString(),backgroundColor:red.rgbString()},n;switch(t){default:let i=Math.floor(index/2)%allColors.length;n=new Color(allColors[i].rgbString()),n.lighten(.38),a={borderColor:allColors[i].hexString(),backgroundColor:n.hexString()};break;case"spent":n=new Color(blue.rgbString()),n.lighten(.38),a={borderColor:blue.rgbString(),backgroundColor:n.rgbString()};break;case"left":n=new Color(green.rgbString()),n.lighten(.38),a={borderColor:green.rgbString(),backgroundColor:n.rgbString()};break;case"overspent":n=new Color(red.rgbString()),n.lighten(.22),console.log("#ffb1c1 vs "+n.hexString()),a={borderColor:red.rgbString(),backgroundColor:n.rgbString()};break}return index++,e==="border"?a.borderColor:e==="background"?a.backgroundColor:"#FF0000"}let currencies$2=[],chart$4=null,chartData$2=null,afterPromises$5=!1;const CHART_CACHE_KEY="dashboard-accounts-chart",ACCOUNTS_CACHE_KEY="dashboard-accounts-data",accounts=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,setVariable("autoConversion",this.autoConversion)},getFreshData(){const t=window.store.get("cacheValid");let e=window.store.get(CHART_CACHE_KEY);if(t&&typeof e<"u"){this.drawChart(this.generateOptions(e)),this.loading=!1;return}new Dashboard$2().dashboard(new Date(window.store.get("start")),new Date(window.store.get("end")),null).then(n=>{this.chartData=n.data,window.store.set(CHART_CACHE_KEY,n.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(t){currencies$2=[];let e=getDefaultChartSettings("line");for(let a=0;a<t.length;a++)if(t.hasOwnProperty(a)){let n="y",r=t[a],i={},o=[];a===0&&(e.data.labels=Object.keys(r.entries)),i.label=r.label,this.autoConversion&&(currencies$2.push(r.native_code),i.currency_code=r.native_code,o=Object.values(r.native_entries),n="y"+r.native_code),this.autoConversion||(n="y"+r.currency_code,i.currency_code=r.currency_code,currencies$2.push(r.currency_code),o=Object.values(r.entries)),i.yAxisID=n,i.data=o,e.data.datasets.push(i)}for(let a in currencies$2)if(currencies$2.hasOwnProperty(a)){let n="y"+currencies$2[a];e.options.scales.hasOwnProperty(n)||(e.options.scales[n]={id:a,type:"linear",position:parseInt(a)===1?"right":"left",ticks:{callback:function(r,i,o){return formatMoney(r,currencies$2[a])}}})}return e},loadChart(){if(this.loading!==!0){if(this.loading=!0,chartData$2===null){this.getFreshData();return}this.drawChart(this.generateOptions(chartData$2)),this.loading=!1}},drawChart(t){if(chart$4!==null){chart$4.options=t.options,chart$4.data=t.data,chart$4.update();return}chart$4=new Chart(document.querySelector("#account-chart"),t)},loadAccounts(){if(this.loadingAccounts===!0)return;if(this.loadingAccounts=!0,this.accountList.length>0){this.loadingAccounts=!1;return}const t=window.store.get("cacheValid");let e=window.store.get(ACCOUNTS_CACHE_KEY);if(t&&typeof e<"u"){this.accountList=e,this.loadingAccounts=!1;return}const a=10;let n=0,r=0,i=[];Promise.all([getVariable("frontpageAccounts")]).then(o=>{n=o[0].length;for(let s in o[0]){let l=o[0];if(l.hasOwnProperty(s)){let u=l[s];new Get$3().get(u,new Date(window.store.get("end"))).then(c=>{let d=c.data.data;new Get$3().transactions(d.id,1).then(h=>{let m=[];for(let p=0;p<h.data.data.length&&!(p>=a);p++){let v=h.data.data[p],y={title:v.attributes.group_title===null?"":v.attributes.group_title,id:v.id,transactions:[]};for(let w=0;w<v.attributes.transactions.length;w++){let _=v.attributes.transactions[w];y.transactions.push({description:_.description,id:v.id,type:_.type,amount_raw:parseFloat(_.amount),amount:formatMoney(_.amount,_.currency_code),native_amount_raw:parseFloat(_.native_amount),native_amount:formatMoney(_.native_amount,_.native_code)})}m.push(y)}i.push({name:d.attributes.name,order:d.attributes.order,id:d.id,balance_raw:parseFloat(d.attributes.current_balance),balance:formatMoney(d.attributes.current_balance,d.attributes.currency_code),native_balance_raw:parseFloat(d.attributes.native_current_balance),native_balance:formatMoney(d.attributes.native_current_balance,d.attributes.native_code),groups:m}),console.log(d.attributes),r++,r===n&&(i.sort((p,v)=>p.order-v.order),this.accountList=i,this.loadingAccounts=!1,window.store.set(ACCOUNTS_CACHE_KEY,i))})})}}})},init(){Promise.all([getVariable("viewRange","1M"),getVariable("autoConversion",!1),getVariable("language","en-US")]).then(t=>{this.autoConversion=t[1],afterPromises$5=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{afterPromises$5&&(chartData$2=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{afterPromises$5&&(this.loadChart(),this.loadAccounts())})}});let Dashboard$1=class{dashboard(e,a){let n=format$1(e,"y-MM-dd"),r=format$1(a,"y-MM-dd");return api.get("/api/v2/chart/budget/dashboard",{params:{start:n,end:r}})}};var isArray$a=Array.isArray,isArray_1=isArray$a;const isArray$b=getDefaultExportFromCjs(isArray_1);var freeGlobal$1=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root$8=freeGlobal||freeSelf||Function("return this")(),_root=root$8,root$7=_root,Symbol$6=root$7.Symbol,_Symbol=Symbol$6,Symbol$5=_Symbol,objectProto$d=Object.prototype,hasOwnProperty$a=objectProto$d.hasOwnProperty,nativeObjectToString$1=objectProto$d.toString,symToStringTag$1=Symbol$5?Symbol$5.toStringTag:void 0;function getRawTag$1(t){var e=hasOwnProperty$a.call(t,symToStringTag$1),a=t[symToStringTag$1];try{t[symToStringTag$1]=void 0;var n=!0}catch{}var r=nativeObjectToString$1.call(t);return n&&(e?t[symToStringTag$1]=a:delete t[symToStringTag$1]),r}var _getRawTag=getRawTag$1,objectProto$c=Object.prototype,nativeObjectToString=objectProto$c.toString;function objectToString$1(t){return nativeObjectToString.call(t)}var _objectToString=objectToString$1,Symbol$4=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$4?Symbol$4.toStringTag:void 0;function baseGetTag$5(t){return t==null?t===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(t)?getRawTag(t):objectToString(t)}var _baseGetTag=baseGetTag$5;function isObjectLike$5(t){return t!=null&&typeof t=="object"}var isObjectLike_1=isObjectLike$5,baseGetTag$4=_baseGetTag,isObjectLike$4=isObjectLike_1,symbolTag$1="[object Symbol]";function isSymbol$5(t){return typeof t=="symbol"||isObjectLike$4(t)&&baseGetTag$4(t)==symbolTag$1}var isSymbol_1=isSymbol$5,isArray$9=isArray_1,isSymbol$4=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$3(t,e){if(isArray$9(t))return!1;var a=typeof t;return a=="number"||a=="symbol"||a=="boolean"||t==null||isSymbol$4(t)?!0:reIsPlainProp.test(t)||!reIsDeepProp.test(t)||e!=null&&t in Object(e)}var _isKey=isKey$3;function isObject$6(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var isObject_1=isObject$6;const isObject$7=getDefaultExportFromCjs(isObject_1);var baseGetTag$3=_baseGetTag,isObject$5=isObject_1,asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(t){if(!isObject$5(t))return!1;var e=baseGetTag$3(t);return e==funcTag$1||e==genTag||e==asyncTag||e==proxyTag}var isFunction_1=isFunction$2,root$6=_root,coreJsData$1=root$6["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function isMasked$1(t){return!!maskSrcKey&&maskSrcKey in t}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$2(t){if(t!=null){try{return funcToString$1.call(t)}catch{}try{return t+""}catch{}}return""}var _toSource=toSource$2,isFunction$1=isFunction_1,isMasked=_isMasked,isObject$4=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$b=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$9=objectProto$b.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$9).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(t){if(!isObject$4(t)||isMasked(t))return!1;var e=isFunction$1(t)?reIsNative:reIsHostCtor;return e.test(toSource$1(t))}var _baseIsNative=baseIsNative$1;function getValue$1(t,e){return t==null?void 0:t[e]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$7(t,e){var a=getValue(t,e);return baseIsNative(a)?a:void 0}var _getNative=getNative$7,getNative$6=_getNative,nativeCreate$4=getNative$6(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$a=Object.prototype,hasOwnProperty$8=objectProto$a.hasOwnProperty;function hashGet$1(t){var e=this.__data__;if(nativeCreate$2){var a=e[t];return a===HASH_UNDEFINED$2?void 0:a}return hasOwnProperty$8.call(e,t)?e[t]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$9=Object.prototype,hasOwnProperty$7=objectProto$9.hasOwnProperty;function hashHas$1(t){var e=this.__data__;return nativeCreate$1?e[t]!==void 0:hasOwnProperty$7.call(e,t)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(t,e){var a=this.__data__;return this.size+=this.has(t)?0:1,a[t]=nativeCreate&&e===void 0?HASH_UNDEFINED$1:e,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(t){var e=-1,a=t==null?0:t.length;for(this.clear();++e<a;){var n=t[e];this.set(n[0],n[1])}}Hash$1.prototype.clear=hashClear;Hash$1.prototype.delete=hashDelete;Hash$1.prototype.get=hashGet;Hash$1.prototype.has=hashHas;Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$4(t,e){return t===e||t!==t&&e!==e}var eq_1=eq$4,eq$3=eq_1;function assocIndexOf$4(t,e){for(var a=t.length;a--;)if(eq$3(t[a][0],e))return a;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(t){var e=this.__data__,a=assocIndexOf$3(e,t);if(a<0)return!1;var n=e.length-1;return a==n?e.pop():splice.call(e,a,1),--this.size,!0}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(t){var e=this.__data__,a=assocIndexOf$2(e,t);return a<0?void 0:e[a][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(t){return assocIndexOf$1(this.__data__,t)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(t,e){var a=this.__data__,n=assocIndexOf(a,t);return n<0?(++this.size,a.push([t,e])):a[n][1]=e,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(t){var e=-1,a=t==null?0:t.length;for(this.clear();++e<a;){var n=t[e];this.set(n[0],n[1])}}ListCache$4.prototype.clear=listCacheClear;ListCache$4.prototype.delete=listCacheDelete;ListCache$4.prototype.get=listCacheGet;ListCache$4.prototype.has=listCacheHas;ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4,getNative$5=_getNative,root$5=_root,Map$4=getNative$5(root$5,"Map"),_Map=Map$4,Hash=_Hash,ListCache$3=_ListCache,Map$3=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map$3||ListCache$3),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(t,e){var a=t.__data__;return isKeyable(e)?a[typeof e=="string"?"string":"hash"]:a.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(t){var e=getMapData$3(this,t).delete(t);return this.size-=e?1:0,e}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(t){return getMapData$2(this,t).get(t)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(t){return getMapData$1(this,t).has(t)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(t,e){var a=getMapData(this,t),n=a.size;return a.set(t,e),this.size+=a.size==n?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$3(t){var e=-1,a=t==null?0:t.length;for(this.clear();++e<a;){var n=t[e];this.set(n[0],n[1])}}MapCache$3.prototype.clear=mapCacheClear;MapCache$3.prototype.delete=mapCacheDelete;MapCache$3.prototype.get=mapCacheGet;MapCache$3.prototype.has=mapCacheHas;MapCache$3.prototype.set=mapCacheSet;var _MapCache=MapCache$3,MapCache$2=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(FUNC_ERROR_TEXT);var a=function(){var n=arguments,r=e?e.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=t.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(memoize$1.Cache||MapCache$2),a}memoize$1.Cache=MapCache$2;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(t){var e=memoize(t,function(n){return a.size===MAX_MEMOIZE_SIZE&&a.clear(),n}),a=e.cache;return e}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(rePropName,function(a,n,r,i){e.push(r?i.replace(reEscapeChar,"$1"):n||a)}),e}),_stringToPath=stringToPath$1;function arrayMap$2(t,e){for(var a=-1,n=t==null?0:t.length,r=Array(n);++a<n;)r[a]=e(t[a],a,t);return r}var _arrayMap=arrayMap$2,Symbol$3=_Symbol,arrayMap$1=_arrayMap,isArray$8=isArray_1,isSymbol$3=isSymbol_1,INFINITY$4=1/0,symbolProto$1=Symbol$3?Symbol$3.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString$1(t){if(typeof t=="string")return t;if(isArray$8(t))return arrayMap$1(t,baseToString$1)+"";if(isSymbol$3(t))return symbolToString?symbolToString.call(t):"";var e=t+"";return e=="0"&&1/t==-INFINITY$4?"-0":e}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$6(t){return t==null?"":baseToString(t)}var toString_1=toString$6,isArray$7=isArray_1,isKey$2=_isKey,stringToPath=_stringToPath,toString$5=toString_1;function castPath$3(t,e){return isArray$7(t)?t:isKey$2(t,e)?[t]:stringToPath(toString$5(t))}var _castPath=castPath$3,isSymbol$2=isSymbol_1,INFINITY$3=1/0;function toKey$5(t){if(typeof t=="string"||isSymbol$2(t))return t;var e=t+"";return e=="0"&&1/t==-INFINITY$3?"-0":e}var _toKey=toKey$5,castPath$2=_castPath,toKey$4=_toKey;function baseGet$3(t,e){e=castPath$2(e,t);for(var a=0,n=e.length;t!=null&&a<n;)t=t[toKey$4(e[a++])];return a&&a==n?t:void 0}var _baseGet=baseGet$3,baseGet$2=_baseGet;function get$1(t,e,a){var n=t==null?void 0:baseGet$2(t,e);return n===void 0?a:n}var get_1=get$1;const get$2=getDefaultExportFromCjs(get_1);var objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function baseHas$1(t,e){return t!=null&&hasOwnProperty$6.call(t,e)}var _baseHas=baseHas$1,baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1,argsTag$2="[object Arguments]";function baseIsArguments$1(t){return isObjectLike$3(t)&&baseGetTag$2(t)==argsTag$2}var _baseIsArguments=baseIsArguments$1,baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1,objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty,propertyIsEnumerable$1=objectProto$7.propertyIsEnumerable,isArguments$3=baseIsArguments(function(){return arguments}())?baseIsArguments:function(t){return isObjectLike$2(t)&&hasOwnProperty$5.call(t,"callee")&&!propertyIsEnumerable$1.call(t,"callee")},isArguments_1=isArguments$3,MAX_SAFE_INTEGER$3=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$4(t,e){var a=typeof t;return e=e??MAX_SAFE_INTEGER$3,!!e&&(a=="number"||a!="symbol"&&reIsUint.test(t))&&t>-1&&t%1==0&&t<e}var _isIndex=isIndex$4,MAX_SAFE_INTEGER$2=9007199254740991;function isLength$3(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER$2}var isLength_1=isLength$3,castPath$1=_castPath,isArguments$2=isArguments_1,isArray$6=isArray_1,isIndex$3=_isIndex,isLength$2=isLength_1,toKey$3=_toKey;function hasPath$2(t,e,a){e=castPath$1(e,t);for(var n=-1,r=e.length,i=!1;++n<r;){var o=toKey$3(e[n]);if(!(i=t!=null&&a(t,o)))break;t=t[o]}return i||++n!=r?i:(r=t==null?0:t.length,!!r&&isLength$2(r)&&isIndex$3(o,r)&&(isArray$6(t)||isArguments$2(t)))}var _hasPath=hasPath$2,baseHas=_baseHas,hasPath$1=_hasPath;function has(t,e){return t!=null&&hasPath$1(t,e,baseHas)}var has_1=has;const has$1=getDefaultExportFromCjs(has_1);var getNative$4=_getNative,defineProperty$2=function(){try{var t=getNative$4(Object,"defineProperty");return t({},"",{}),t}catch{}}(),_defineProperty=defineProperty$2,defineProperty$1=_defineProperty;function baseAssignValue$1(t,e,a){e=="__proto__"&&defineProperty$1?defineProperty$1(t,e,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[e]=a}var _baseAssignValue=baseAssignValue$1,baseAssignValue=_baseAssignValue,eq$2=eq_1,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function assignValue$2(t,e,a){var n=t[e];(!(hasOwnProperty$4.call(t,e)&&eq$2(n,a))||a===void 0&&!(e in t))&&baseAssignValue(t,e,a)}var _assignValue=assignValue$2,assignValue$1=_assignValue,castPath=_castPath,isIndex$2=_isIndex,isObject$3=isObject_1,toKey$2=_toKey;function baseSet$1(t,e,a,n){if(!isObject$3(t))return t;e=castPath(e,t);for(var r=-1,i=e.length,o=i-1,s=t;s!=null&&++r<i;){var l=toKey$2(e[r]),u=a;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(r!=o){var c=s[l];u=n?n(c,l,s):void 0,u===void 0&&(u=isObject$3(c)?c:isIndex$2(e[r+1])?[]:{})}assignValue$1(s,l,u),s=s[l]}return t}var _baseSet=baseSet$1,baseSet=_baseSet;function set(t,e,a){return t==null?t:baseSet(t,e,a)}var set_1=set;const set$1=getDefaultExportFromCjs(set_1);var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(t){return this.__data__.set(t,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(t){return this.__data__.has(t)}var _setCacheHas=setCacheHas$1,MapCache$1=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$2(t){var e=-1,a=t==null?0:t.length;for(this.__data__=new MapCache$1;++e<a;)this.add(t[e])}SetCache$2.prototype.add=SetCache$2.prototype.push=setCacheAdd;SetCache$2.prototype.has=setCacheHas;var _SetCache=SetCache$2;function baseFindIndex$1(t,e,a,n){for(var r=t.length,i=a+(n?1:-1);n?i--:++i<r;)if(e(t[i],i,t))return i;return-1}var _baseFindIndex=baseFindIndex$1;function baseIsNaN$1(t){return t!==t}var _baseIsNaN=baseIsNaN$1;function strictIndexOf$1(t,e,a){for(var n=a-1,r=t.length;++n<r;)if(t[n]===e)return n;return-1}var _strictIndexOf=strictIndexOf$1,baseFindIndex=_baseFindIndex,baseIsNaN=_baseIsNaN,strictIndexOf=_strictIndexOf;function baseIndexOf$1(t,e,a){return e===e?strictIndexOf(t,e,a):baseFindIndex(t,baseIsNaN,a)}var _baseIndexOf=baseIndexOf$1,baseIndexOf=_baseIndexOf;function arrayIncludes$1(t,e){var a=t==null?0:t.length;return!!a&&baseIndexOf(t,e,0)>-1}var _arrayIncludes=arrayIncludes$1;function arrayIncludesWith$1(t,e,a){for(var n=-1,r=t==null?0:t.length;++n<r;)if(a(e,t[n]))return!0;return!1}var _arrayIncludesWith=arrayIncludesWith$1;function cacheHas$2(t,e){return t.has(e)}var _cacheHas=cacheHas$2,getNative$3=_getNative,root$4=_root,Set$3=getNative$3(root$4,"Set"),_Set=Set$3;function noop$1(){}var noop_1=noop$1;function setToArray$3(t){var e=-1,a=Array(t.size);return t.forEach(function(n){a[++e]=n}),a}var _setToArray=setToArray$3,Set$2=_Set,noop=noop_1,setToArray$2=_setToArray,INFINITY$2=1/0,createSet$1=Set$2&&1/setToArray$2(new Set$2([,-0]))[1]==INFINITY$2?function(t){return new Set$2(t)}:noop,_createSet=createSet$1,SetCache$1=_SetCache,arrayIncludes=_arrayIncludes,arrayIncludesWith=_arrayIncludesWith,cacheHas$1=_cacheHas,createSet=_createSet,setToArray$1=_setToArray,LARGE_ARRAY_SIZE$1=200;function baseUniq$1(t,e,a){var n=-1,r=arrayIncludes,i=t.length,o=!0,s=[],l=s;if(a)o=!1,r=arrayIncludesWith;else if(i>=LARGE_ARRAY_SIZE$1){var u=e?null:createSet(t);if(u)return setToArray$1(u);o=!1,r=cacheHas$1,l=new SetCache$1}else l=e?[]:s;e:for(;++n<i;){var c=t[n],d=e?e(c):c;if(c=a||c!==0?c:0,o&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;e&&l.push(d),s.push(c)}else r(l,d,a)||(l!==s&&l.push(d),s.push(c))}return s}var _baseUniq=baseUniq$1,baseUniq=_baseUniq;function uniq(t){return t&&t.length?baseUniq(t):[]}var uniq_1=uniq;const uniq$1=getDefaultExportFromCjs(uniq_1),defaultLocaleResolver=(t,e)=>{const a=[],n=[];return a.push(e),e||a.push(t.locale),t.enableFallback&&a.push(t.defaultLocale),a.filter(Boolean).map(r=>r.toString()).forEach(function(r){if(n.includes(r)||n.push(r),!t.enableFallback)return;const i=r.split("-");i.length===3&&n.push(`${i[0]}-${i[1]}`),n.push(i[0])}),uniq$1(n)};class Locales{constructor(e){this.i18n=e,this.registry={},this.register("default",defaultLocaleResolver)}register(e,a){if(typeof a!="function"){const n=a;a=()=>n}this.registry[e]=a}get(e){let a=this.registry[e]||this.registry[this.i18n.locale]||this.registry.default;return typeof a=="function"&&(a=a(this.i18n,e)),a instanceof Array||(a=[a]),a}}const en=(t,e)=>{const a=String(t).split("."),n=!a[1],r=Number(a[0])==t,i=r&&a[0].slice(-1),o=r&&a[0].slice(-2);return e?i==1&&o!=11?"one":i==2&&o!=12?"two":i==3&&o!=13?"few":"other":t==1&&n?"one":"other"};function useMakePlural({pluralizer:t,includeZero:e=!0,ordinal:a=!1}){return function(n,r){return[e&&r===0?"zero":"",t(r,a)].filter(Boolean)}}const defaultPluralizer=useMakePlural({pluralizer:en,includeZero:!0});class Pluralization{constructor(e){this.i18n=e,this.registry={},this.register("default",defaultPluralizer)}register(e,a){this.registry[e]=a}get(e){return this.registry[e]||this.registry[this.i18n.locale]||this.registry.default}}function baseSlice$1(t,e,a){var n=-1,r=t.length;e<0&&(e=-e>r?0:r+e),a=a>r?r:a,a<0&&(a+=r),r=e>a?0:a-e>>>0,e>>>=0;for(var i=Array(r);++n<r;)i[n]=t[n+e];return i}var _baseSlice=baseSlice$1,baseSlice=_baseSlice;function castSlice$1(t,e,a){var n=t.length;return a=a===void 0?n:a,!e&&a>=n?t:baseSlice(t,e,a)}var _castSlice=castSlice$1,rsAstralRange$2="\\ud800-\\udfff",rsComboMarksRange$3="\\u0300-\\u036f",reComboHalfMarksRange$3="\\ufe20-\\ufe2f",rsComboSymbolsRange$3="\\u20d0-\\u20ff",rsComboRange$3=rsComboMarksRange$3+reComboHalfMarksRange$3+rsComboSymbolsRange$3,rsVarRange$2="\\ufe0e\\ufe0f",rsZWJ$2="\\u200d",reHasUnicode=RegExp("["+rsZWJ$2+rsAstralRange$2+rsComboRange$3+rsVarRange$2+"]");function hasUnicode$2(t){return reHasUnicode.test(t)}var _hasUnicode=hasUnicode$2;function asciiToArray$1(t){return t.split("")}var _asciiToArray=asciiToArray$1,rsAstralRange$1="\\ud800-\\udfff",rsComboMarksRange$2="\\u0300-\\u036f",reComboHalfMarksRange$2="\\ufe20-\\ufe2f",rsComboSymbolsRange$2="\\u20d0-\\u20ff",rsComboRange$2=rsComboMarksRange$2+reComboHalfMarksRange$2+rsComboSymbolsRange$2,rsVarRange$1="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange$1+"]",rsCombo$2="["+rsComboRange$2+"]",rsFitz$1="\\ud83c[\\udffb-\\udfff]",rsModifier$1="(?:"+rsCombo$2+"|"+rsFitz$1+")",rsNonAstral$1="[^"+rsAstralRange$1+"]",rsRegional$1="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair$1="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ$1="\\u200d",reOptMod$1=rsModifier$1+"?",rsOptVar$1="["+rsVarRange$1+"]?",rsOptJoin$1="(?:"+rsZWJ$1+"(?:"+[rsNonAstral$1,rsRegional$1,rsSurrPair$1].join("|")+")"+rsOptVar$1+reOptMod$1+")*",rsSeq$1=rsOptVar$1+reOptMod$1+rsOptJoin$1,rsSymbol="(?:"+[rsNonAstral$1+rsCombo$2+"?",rsCombo$2,rsRegional$1,rsSurrPair$1,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz$1+"(?="+rsFitz$1+")|"+rsSymbol+rsSeq$1,"g");function unicodeToArray$1(t){return t.match(reUnicode)||[]}var _unicodeToArray=unicodeToArray$1,asciiToArray=_asciiToArray,hasUnicode$1=_hasUnicode,unicodeToArray=_unicodeToArray;function stringToArray$1(t){return hasUnicode$1(t)?unicodeToArray(t):asciiToArray(t)}var _stringToArray=stringToArray$1,castSlice=_castSlice,hasUnicode=_hasUnicode,stringToArray=_stringToArray,toString$4=toString_1;function createCaseFirst$1(t){return function(e){e=toString$4(e);var a=hasUnicode(e)?stringToArray(e):void 0,n=a?a[0]:e.charAt(0),r=a?castSlice(a,1).join(""):e.slice(1);return n[t]()+r}}var _createCaseFirst=createCaseFirst$1,createCaseFirst=_createCaseFirst,upperFirst$1=createCaseFirst("toUpperCase"),upperFirst_1=upperFirst$1,toString$3=toString_1,upperFirst=upperFirst_1;function capitalize$1(t){return upperFirst(toString$3(t).toLowerCase())}var capitalize_1=capitalize$1;function arrayReduce$1(t,e,a,n){var r=-1,i=t==null?0:t.length;for(n&&i&&(a=t[++r]);++r<i;)a=e(a,t[r],r,t);return a}var _arrayReduce=arrayReduce$1;function basePropertyOf$1(t){return function(e){return t==null?void 0:t[e]}}var _basePropertyOf=basePropertyOf$1,basePropertyOf=_basePropertyOf,deburredLetters={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},deburrLetter$1=basePropertyOf(deburredLetters),_deburrLetter=deburrLetter$1,deburrLetter=_deburrLetter,toString$2=toString_1,reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rsComboMarksRange$1="\\u0300-\\u036f",reComboHalfMarksRange$1="\\ufe20-\\ufe2f",rsComboSymbolsRange$1="\\u20d0-\\u20ff",rsComboRange$1=rsComboMarksRange$1+reComboHalfMarksRange$1+rsComboSymbolsRange$1,rsCombo$1="["+rsComboRange$1+"]",reComboMark=RegExp(rsCombo$1,"g");function deburr$1(t){return t=toString$2(t),t&&t.replace(reLatin,deburrLetter).replace(reComboMark,"")}var deburr_1=deburr$1,reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function asciiWords$1(t){return t.match(reAsciiWord)||[]}var _asciiWords=asciiWords$1,reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function hasUnicodeWord$1(t){return reHasUnicodeWord.test(t)}var _hasUnicodeWord=hasUnicodeWord$1,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsDingbatRange="\\u2700-\\u27bf",rsLowerRange="a-z\\xdf-\\xf6\\xf8-\\xff",rsMathOpRange="\\xac\\xb1\\xd7\\xf7",rsNonCharRange="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rsPunctuationRange="\\u2000-\\u206f",rsSpaceRange=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rsUpperRange="A-Z\\xc0-\\xd6\\xd8-\\xde",rsVarRange="\\ufe0e\\ufe0f",rsBreakRange=rsMathOpRange+rsNonCharRange+rsPunctuationRange+rsSpaceRange,rsApos$1="['’]",rsBreak="["+rsBreakRange+"]",rsCombo="["+rsComboRange+"]",rsDigits="\\d+",rsDingbat="["+rsDingbatRange+"]",rsLower="["+rsLowerRange+"]",rsMisc="[^"+rsAstralRange+rsBreakRange+rsDigits+rsDingbatRange+rsLowerRange+rsUpperRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper="["+rsUpperRange+"]",rsZWJ="\\u200d",rsMiscLower="(?:"+rsLower+"|"+rsMisc+")",rsMiscUpper="(?:"+rsUpper+"|"+rsMisc+")",rsOptContrLower="(?:"+rsApos$1+"(?:d|ll|m|re|s|t|ve))?",rsOptContrUpper="(?:"+rsApos$1+"(?:D|LL|M|RE|S|T|VE))?",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsOrdLower="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rsOrdUpper="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsEmoji="(?:"+[rsDingbat,rsRegional,rsSurrPair].join("|")+")"+rsSeq,reUnicodeWord=RegExp([rsUpper+"?"+rsLower+"+"+rsOptContrLower+"(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsMiscUpper+"+"+rsOptContrUpper+"(?="+[rsBreak,rsUpper+rsMiscLower,"$"].join("|")+")",rsUpper+"?"+rsMiscLower+"+"+rsOptContrLower,rsUpper+"+"+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join("|"),"g");function unicodeWords$1(t){return t.match(reUnicodeWord)||[]}var _unicodeWords=unicodeWords$1,asciiWords=_asciiWords,hasUnicodeWord=_hasUnicodeWord,toString$1=toString_1,unicodeWords=_unicodeWords;function words$1(t,e,a){return t=toString$1(t),e=a?void 0:e,e===void 0?hasUnicodeWord(t)?unicodeWords(t):asciiWords(t):t.match(e)||[]}var words_1=words$1,arrayReduce=_arrayReduce,deburr=deburr_1,words=words_1,rsApos="['’]",reApos=RegExp(rsApos,"g");function createCompounder$1(t){return function(e){return arrayReduce(words(deburr(e).replace(reApos,"")),t,"")}}var _createCompounder=createCompounder$1,capitalize=capitalize_1,createCompounder=_createCompounder,camelCase=createCompounder(function(t,e,a){return e=e.toLowerCase(),t+(a?capitalize(e):e)}),camelCase_1=camelCase;const camelCase$1=getDefaultExportFromCjs(camelCase_1);function camelCaseKeys(t){return t?Object.keys(t).reduce((e,a)=>(e[camelCase$1(a)]=t[a],e),{}):{}}function isSet(t){return t!=null}function createTranslationOptions(t,e,a){let n=[{scope:e}];if(isSet(a.defaults)&&(n=n.concat(a.defaults)),isSet(a.defaultValue)){const r=typeof a.defaultValue=="function"?a.defaultValue(t,e,a):a.defaultValue;n.push({message:r}),delete a.defaultValue}return n}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$1=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(t){var e,a,n,r=_.prototype={constructor:_,toString:null,valueOf:null},i=new _(1),o=20,s=4,l=-7,u=21,c=-1e7,d=1e7,h=!1,m=1,p=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},y="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function _(g,b){var $,S,P,M,C,E,T,x,A=this;if(!(A instanceof _))return new _(g,b);if(b==null){if(g&&g._isBigNumber===!0){A.s=g.s,!g.c||g.e>d?A.c=A.e=null:g.e<c?A.c=[A.e=0]:(A.e=g.e,A.c=g.c.slice());return}if((E=typeof g=="number")&&g*0==0){if(A.s=1/g<0?(g=-g,-1):1,g===~~g){for(M=0,C=g;C>=10;C/=10,M++);M>d?A.c=A.e=null:(A.e=M,A.c=[g]);return}x=String(g)}else{if(!isNumeric.test(x=String(g)))return n(A,x,E);A.s=x.charCodeAt(0)==45?(x=x.slice(1),-1):1}(M=x.indexOf("."))>-1&&(x=x.replace(".","")),(C=x.search(/e/i))>0?(M<0&&(M=C),M+=+x.slice(C+1),x=x.substring(0,C)):M<0&&(M=x.length)}else{if(intCheck(b,2,y.length,"Base"),b==10&&w)return A=new _(g),N(A,o+A.e+1,s);if(x=String(g),E=typeof g=="number"){if(g*0!=0)return n(A,x,E,b);if(A.s=1/g<0?(x=x.slice(1),-1):1,_.DEBUG&&x.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+g)}else A.s=x.charCodeAt(0)===45?(x=x.slice(1),-1):1;for($=y.slice(0,b),M=C=0,T=x.length;C<T;C++)if($.indexOf(S=x.charAt(C))<0){if(S=="."){if(C>M){M=T;continue}}else if(!P&&(x==x.toUpperCase()&&(x=x.toLowerCase())||x==x.toLowerCase()&&(x=x.toUpperCase()))){P=!0,C=-1,M=0;continue}return n(A,String(g),E,b)}E=!1,x=a(x,b,10,A.s),(M=x.indexOf("."))>-1?x=x.replace(".",""):M=x.length}for(C=0;x.charCodeAt(C)===48;C++);for(T=x.length;x.charCodeAt(--T)===48;);if(x=x.slice(C,++T)){if(T-=C,E&&_.DEBUG&&T>15&&(g>MAX_SAFE_INTEGER$1||g!==mathfloor(g)))throw Error(tooManyDigits+A.s*g);if((M=M-C-1)>d)A.c=A.e=null;else if(M<c)A.c=[A.e=0];else{if(A.e=M,A.c=[],C=(M+1)%LOG_BASE,M<0&&(C+=LOG_BASE),C<T){for(C&&A.c.push(+x.slice(0,C)),T-=LOG_BASE;C<T;)A.c.push(+x.slice(C,C+=LOG_BASE));C=LOG_BASE-(x=x.slice(C)).length}else C-=T;for(;C--;x+="0");A.c.push(+x)}}else A.c=[A.e=0]}_.clone=clone,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(g){var b,$;if(g!=null)if(typeof g=="object"){if(g.hasOwnProperty(b="DECIMAL_PLACES")&&($=g[b],intCheck($,0,MAX,b),o=$),g.hasOwnProperty(b="ROUNDING_MODE")&&($=g[b],intCheck($,0,8,b),s=$),g.hasOwnProperty(b="EXPONENTIAL_AT")&&($=g[b],$&&$.pop?(intCheck($[0],-MAX,0,b),intCheck($[1],0,MAX,b),l=$[0],u=$[1]):(intCheck($,-MAX,MAX,b),l=-(u=$<0?-$:$))),g.hasOwnProperty(b="RANGE"))if($=g[b],$&&$.pop)intCheck($[0],-MAX,-1,b),intCheck($[1],1,MAX,b),c=$[0],d=$[1];else if(intCheck($,-MAX,MAX,b),$)c=-(d=$<0?-$:$);else throw Error(bignumberError+b+" cannot be zero: "+$);if(g.hasOwnProperty(b="CRYPTO"))if($=g[b],$===!!$)if($)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=$;else throw h=!$,Error(bignumberError+"crypto unavailable");else h=$;else throw Error(bignumberError+b+" not true or false: "+$);if(g.hasOwnProperty(b="MODULO_MODE")&&($=g[b],intCheck($,0,9,b),m=$),g.hasOwnProperty(b="POW_PRECISION")&&($=g[b],intCheck($,0,MAX,b),p=$),g.hasOwnProperty(b="FORMAT"))if($=g[b],typeof $=="object")v=$;else throw Error(bignumberError+b+" not an object: "+$);if(g.hasOwnProperty(b="ALPHABET"))if($=g[b],typeof $=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test($))w=$.slice(0,10)=="0123456789",y=$;else throw Error(bignumberError+b+" invalid: "+$)}else throw Error(bignumberError+"Object expected: "+g);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,u],RANGE:[c,d],CRYPTO:h,MODULO_MODE:m,POW_PRECISION:p,FORMAT:v,ALPHABET:y}},_.isBigNumber=function(g){if(!g||g._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var b,$,S=g.c,P=g.e,M=g.s;e:if({}.toString.call(S)=="[object Array]"){if((M===1||M===-1)&&P>=-MAX&&P<=MAX&&P===mathfloor(P)){if(S[0]===0){if(P===0&&S.length===1)return!0;break e}if(b=(P+1)%LOG_BASE,b<1&&(b+=LOG_BASE),String(S[0]).length==b){for(b=0;b<S.length;b++)if($=S[b],$<0||$>=BASE||$!==mathfloor($))break e;if($!==0)return!0}}}else if(S===null&&P===null&&(M===null||M===1||M===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+g)},_.maximum=_.max=function(){return k(arguments,r.lt)},_.minimum=_.min=function(){return k(arguments,r.gt)},_.random=function(){var g=9007199254740992,b=Math.random()*g&2097151?function(){return mathfloor(Math.random()*g)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function($){var S,P,M,C,E,T=0,x=[],A=new _(i);if($==null?$=o:intCheck($,0,MAX),C=mathceil($/LOG_BASE),h)if(crypto.getRandomValues){for(S=crypto.getRandomValues(new Uint32Array(C*=2));T<C;)E=S[T]*131072+(S[T+1]>>>11),E>=9e15?(P=crypto.getRandomValues(new Uint32Array(2)),S[T]=P[0],S[T+1]=P[1]):(x.push(E%1e14),T+=2);T=C/2}else if(crypto.randomBytes){for(S=crypto.randomBytes(C*=7);T<C;)E=(S[T]&31)*281474976710656+S[T+1]*1099511627776+S[T+2]*4294967296+S[T+3]*16777216+(S[T+4]<<16)+(S[T+5]<<8)+S[T+6],E>=9e15?crypto.randomBytes(7).copy(S,T):(x.push(E%1e14),T+=7);T=C/7}else throw h=!1,Error(bignumberError+"crypto unavailable");if(!h)for(;T<C;)E=b(),E<9e15&&(x[T++]=E%1e14);for(C=x[--T],$%=LOG_BASE,C&&$&&(E=POWS_TEN[LOG_BASE-$],x[T]=mathfloor(C/E)*E);x[T]===0;x.pop(),T--);if(T<0)x=[M=0];else{for(M=-1;x[0]===0;x.splice(0,1),M-=LOG_BASE);for(T=1,E=x[0];E>=10;E/=10,T++);T<LOG_BASE&&(M-=LOG_BASE-T)}return A.e=M,A.c=x,A}}(),_.sum=function(){for(var g=1,b=arguments,$=new _(b[0]);g<b.length;)$=$.plus(b[g++]);return $},a=function(){var g="0123456789";function b($,S,P,M){for(var C,E=[0],T,x=0,A=$.length;x<A;){for(T=E.length;T--;E[T]*=S);for(E[0]+=M.indexOf($.charAt(x++)),C=0;C<E.length;C++)E[C]>P-1&&(E[C+1]==null&&(E[C+1]=0),E[C+1]+=E[C]/P|0,E[C]%=P)}return E.reverse()}return function($,S,P,M,C){var E,T,x,A,L,I,W,z,U=$.indexOf("."),B=o,V=s;for(U>=0&&(A=p,p=0,$=$.replace(".",""),z=new _(S),I=z.pow($.length-U),p=A,z.c=b(toFixedPoint(coeffToString(I.c),I.e,"0"),10,P,g),z.e=z.c.length),W=b($,S,P,C?(E=y,g):(E=g,y)),x=A=W.length;W[--A]==0;W.pop());if(!W[0])return E.charAt(0);if(U<0?--x:(I.c=W,I.e=x,I.s=M,I=e(I,z,B,V,P),W=I.c,L=I.r,x=I.e),T=x+B+1,U=W[T],A=P/2,L=L||T<0||W[T+1]!=null,L=V<4?(U!=null||L)&&(V==0||V==(I.s<0?3:2)):U>A||U==A&&(V==4||L||V==6&&W[T-1]&1||V==(I.s<0?8:7)),T<1||!W[0])$=L?toFixedPoint(E.charAt(1),-B,E.charAt(0)):E.charAt(0);else{if(W.length=T,L)for(--P;++W[--T]>P;)W[T]=0,T||(++x,W=[1].concat(W));for(A=W.length;!W[--A];);for(U=0,$="";U<=A;$+=E.charAt(W[U++]));$=toFixedPoint($,x,E.charAt(0))}return $}}(),e=function(){function g(S,P,M){var C,E,T,x,A=0,L=S.length,I=P%SQRT_BASE,W=P/SQRT_BASE|0;for(S=S.slice();L--;)T=S[L]%SQRT_BASE,x=S[L]/SQRT_BASE|0,C=W*T+x*I,E=I*T+C%SQRT_BASE*SQRT_BASE+A,A=(E/M|0)+(C/SQRT_BASE|0)+W*x,S[L]=E%M;return A&&(S=[A].concat(S)),S}function b(S,P,M,C){var E,T;if(M!=C)T=M>C?1:-1;else for(E=T=0;E<M;E++)if(S[E]!=P[E]){T=S[E]>P[E]?1:-1;break}return T}function $(S,P,M,C){for(var E=0;M--;)S[M]-=E,E=S[M]<P[M]?1:0,S[M]=E*C+S[M]-P[M];for(;!S[0]&&S.length>1;S.splice(0,1));}return function(S,P,M,C,E){var T,x,A,L,I,W,z,U,B,V,H,G,K,Y,J,Q,ee,Z=S.s==P.s?1:-1,X=S.c,q=P.c;if(!X||!X[0]||!q||!q[0])return new _(!S.s||!P.s||(X?q&&X[0]==q[0]:!q)?NaN:X&&X[0]==0||!q?Z*0:Z/0);for(U=new _(Z),B=U.c=[],x=S.e-P.e,Z=M+x+1,E||(E=BASE,x=bitFloor(S.e/LOG_BASE)-bitFloor(P.e/LOG_BASE),Z=Z/LOG_BASE|0),A=0;q[A]==(X[A]||0);A++);if(q[A]>(X[A]||0)&&x--,Z<0)B.push(1),L=!0;else{for(Y=X.length,Q=q.length,A=0,Z+=2,I=mathfloor(E/(q[0]+1)),I>1&&(q=g(q,I,E),X=g(X,I,E),Q=q.length,Y=X.length),K=Q,V=X.slice(0,Q),H=V.length;H<Q;V[H++]=0);ee=q.slice(),ee=[0].concat(ee),J=q[0],q[1]>=E/2&&J++;do{if(I=0,T=b(q,V,Q,H),T<0){if(G=V[0],Q!=H&&(G=G*E+(V[1]||0)),I=mathfloor(G/J),I>1)for(I>=E&&(I=E-1),W=g(q,I,E),z=W.length,H=V.length;b(W,V,z,H)==1;)I--,$(W,Q<z?ee:q,z,E),z=W.length,T=1;else I==0&&(T=I=1),W=q.slice(),z=W.length;if(z<H&&(W=[0].concat(W)),$(V,W,H,E),H=V.length,T==-1)for(;b(q,V,Q,H)<1;)I++,$(V,Q<H?ee:q,H,E),H=V.length}else T===0&&(I++,V=[0]);B[A++]=I,V[0]?V[H++]=X[K]||0:(V=[X[K]],H=1)}while((K++<Y||V[0]!=null)&&Z--);L=V[0]!=null,B[0]||B.splice(0,1)}if(E==BASE){for(A=1,Z=B[0];Z>=10;Z/=10,A++);N(U,M+(U.e=A+x*LOG_BASE-1)+1,C,L)}else U.e=x,U.r=+L;return U}}();function D(g,b,$,S){var P,M,C,E,T;if($==null?$=s:intCheck($,0,8),!g.c)return g.toString();if(P=g.c[0],C=g.e,b==null)T=coeffToString(g.c),T=S==1||S==2&&(C<=l||C>=u)?toExponential(T,C):toFixedPoint(T,C,"0");else if(g=N(new _(g),b,$),M=g.e,T=coeffToString(g.c),E=T.length,S==1||S==2&&(b<=M||M<=l)){for(;E<b;T+="0",E++);T=toExponential(T,M)}else if(b-=C,T=toFixedPoint(T,M,"0"),M+1>E){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=M-E,b>0)for(M+1==E&&(T+=".");b--;T+="0");return g.s<0&&P?"-"+T:T}function k(g,b){for(var $,S=1,P=new _(g[0]);S<g.length;S++)if($=new _(g[S]),$.s)b.call(P,$)&&(P=$);else{P=$;break}return P}function O(g,b,$){for(var S=1,P=b.length;!b[--P];b.pop());for(P=b[0];P>=10;P/=10,S++);return($=S+$*LOG_BASE-1)>d?g.c=g.e=null:$<c?g.c=[g.e=0]:(g.e=$,g.c=b),g}n=function(){var g=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,$=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(M,C,E,T){var x,A=E?C:C.replace(P,"");if(S.test(A))M.s=isNaN(A)?null:A<0?-1:1;else{if(!E&&(A=A.replace(g,function(L,I,W){return x=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!T||T==x?I:L}),T&&(x=T,A=A.replace(b,"$1").replace($,"0.$1")),C!=A))return new _(A,x);if(_.DEBUG)throw Error(bignumberError+"Not a"+(T?" base "+T:"")+" number: "+C);M.s=null}M.c=M.e=null}}();function N(g,b,$,S){var P,M,C,E,T,x,A,L=g.c,I=POWS_TEN;if(L){e:{for(P=1,E=L[0];E>=10;E/=10,P++);if(M=b-P,M<0)M+=LOG_BASE,C=b,T=L[x=0],A=T/I[P-C-1]%10|0;else if(x=mathceil((M+1)/LOG_BASE),x>=L.length)if(S){for(;L.length<=x;L.push(0));T=A=0,P=1,M%=LOG_BASE,C=M-LOG_BASE+1}else break e;else{for(T=E=L[x],P=1;E>=10;E/=10,P++);M%=LOG_BASE,C=M-LOG_BASE+P,A=C<0?0:T/I[P-C-1]%10|0}if(S=S||b<0||L[x+1]!=null||(C<0?T:T%I[P-C-1]),S=$<4?(A||S)&&($==0||$==(g.s<0?3:2)):A>5||A==5&&($==4||S||$==6&&(M>0?C>0?T/I[P-C]:0:L[x-1])%10&1||$==(g.s<0?8:7)),b<1||!L[0])return L.length=0,S?(b-=g.e+1,L[0]=I[(LOG_BASE-b%LOG_BASE)%LOG_BASE],g.e=-b||0):L[0]=g.e=0,g;if(M==0?(L.length=x,E=1,x--):(L.length=x+1,E=I[LOG_BASE-M],L[x]=C>0?mathfloor(T/I[P-C]%I[C])*E:0),S)for(;;)if(x==0){for(M=1,C=L[0];C>=10;C/=10,M++);for(C=L[0]+=E,E=1;C>=10;C/=10,E++);M!=E&&(g.e++,L[0]==BASE&&(L[0]=1));break}else{if(L[x]+=E,L[x]!=BASE)break;L[x--]=0,E=1}for(M=L.length;L[--M]===0;L.pop());}g.e>d?g.c=g.e=null:g.e<c&&(g.c=[g.e=0])}return g}function F(g){var b,$=g.e;return $===null?g.toString():(b=coeffToString(g.c),b=$<=l||$>=u?toExponential(b,$):toFixedPoint(b,$,"0"),g.s<0?"-"+b:b)}return r.absoluteValue=r.abs=function(){var g=new _(this);return g.s<0&&(g.s=1),g},r.comparedTo=function(g,b){return compare(this,new _(g,b))},r.decimalPlaces=r.dp=function(g,b){var $,S,P,M=this;if(g!=null)return intCheck(g,0,MAX),b==null?b=s:intCheck(b,0,8),N(new _(M),g+M.e+1,b);if(!($=M.c))return null;if(S=((P=$.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,P=$[P])for(;P%10==0;P/=10,S--);return S<0&&(S=0),S},r.dividedBy=r.div=function(g,b){return e(this,new _(g,b),o,s)},r.dividedToIntegerBy=r.idiv=function(g,b){return e(this,new _(g,b),0,1)},r.exponentiatedBy=r.pow=function(g,b){var $,S,P,M,C,E,T,x,A,L=this;if(g=new _(g),g.c&&!g.isInteger())throw Error(bignumberError+"Exponent not an integer: "+F(g));if(b!=null&&(b=new _(b)),E=g.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!g.c||!g.c[0])return A=new _(Math.pow(+F(L),E?g.s*(2-isOdd(g)):+F(g))),b?A.mod(b):A;if(T=g.s<0,b){if(b.c?!b.c[0]:!b.s)return new _(NaN);S=!T&&L.isInteger()&&b.isInteger(),S&&(L=L.mod(b))}else{if(g.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||E&&L.c[1]>=24e7:L.c[0]<8e13||E&&L.c[0]<=9999975e7)))return M=L.s<0&&isOdd(g)?-0:0,L.e>-1&&(M=1/M),new _(T?1/M:M);p&&(M=mathceil(p/LOG_BASE+2))}for(E?($=new _(.5),T&&(g.s=1),x=isOdd(g)):(P=Math.abs(+F(g)),x=P%2),A=new _(i);;){if(x){if(A=A.times(L),!A.c)break;M?A.c.length>M&&(A.c.length=M):S&&(A=A.mod(b))}if(P){if(P=mathfloor(P/2),P===0)break;x=P%2}else if(g=g.times($),N(g,g.e+1,1),g.e>14)x=isOdd(g);else{if(P=+F(g),P===0)break;x=P%2}L=L.times(L),M?L.c&&L.c.length>M&&(L.c.length=M):S&&(L=L.mod(b))}return S?A:(T&&(A=i.div(A)),b?A.mod(b):M?N(A,p,s,C):A)},r.integerValue=function(g){var b=new _(this);return g==null?g=s:intCheck(g,0,8),N(b,b.e+1,g)},r.isEqualTo=r.eq=function(g,b){return compare(this,new _(g,b))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(g,b){return compare(this,new _(g,b))>0},r.isGreaterThanOrEqualTo=r.gte=function(g,b){return(b=compare(this,new _(g,b)))===1||b===0},r.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},r.isLessThan=r.lt=function(g,b){return compare(this,new _(g,b))<0},r.isLessThanOrEqualTo=r.lte=function(g,b){return(b=compare(this,new _(g,b)))===-1||b===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(g,b){var $,S,P,M,C=this,E=C.s;if(g=new _(g,b),b=g.s,!E||!b)return new _(NaN);if(E!=b)return g.s=-b,C.plus(g);var T=C.e/LOG_BASE,x=g.e/LOG_BASE,A=C.c,L=g.c;if(!T||!x){if(!A||!L)return A?(g.s=-b,g):new _(L?C:NaN);if(!A[0]||!L[0])return L[0]?(g.s=-b,g):new _(A[0]?C:s==3?-0:0)}if(T=bitFloor(T),x=bitFloor(x),A=A.slice(),E=T-x){for((M=E<0)?(E=-E,P=A):(x=T,P=L),P.reverse(),b=E;b--;P.push(0));P.reverse()}else for(S=(M=(E=A.length)<(b=L.length))?E:b,E=b=0;b<S;b++)if(A[b]!=L[b]){M=A[b]<L[b];break}if(M&&(P=A,A=L,L=P,g.s=-g.s),b=(S=L.length)-($=A.length),b>0)for(;b--;A[$++]=0);for(b=BASE-1;S>E;){if(A[--S]<L[S]){for($=S;$&&!A[--$];A[$]=b);--A[$],A[S]+=BASE}A[S]-=L[S]}for(;A[0]==0;A.splice(0,1),--x);return A[0]?O(g,A,x):(g.s=s==3?-1:1,g.c=[g.e=0],g)},r.modulo=r.mod=function(g,b){var $,S,P=this;return g=new _(g,b),!P.c||!g.s||g.c&&!g.c[0]?new _(NaN):!g.c||P.c&&!P.c[0]?new _(P):(m==9?(S=g.s,g.s=1,$=e(P,g,0,3),g.s=S,$.s*=S):$=e(P,g,0,m),g=P.minus($.times(g)),!g.c[0]&&m==1&&(g.s=P.s),g)},r.multipliedBy=r.times=function(g,b){var $,S,P,M,C,E,T,x,A,L,I,W,z,U,B,V=this,H=V.c,G=(g=new _(g,b)).c;if(!H||!G||!H[0]||!G[0])return!V.s||!g.s||H&&!H[0]&&!G||G&&!G[0]&&!H?g.c=g.e=g.s=null:(g.s*=V.s,!H||!G?g.c=g.e=null:(g.c=[0],g.e=0)),g;for(S=bitFloor(V.e/LOG_BASE)+bitFloor(g.e/LOG_BASE),g.s*=V.s,T=H.length,L=G.length,T<L&&(z=H,H=G,G=z,P=T,T=L,L=P),P=T+L,z=[];P--;z.push(0));for(U=BASE,B=SQRT_BASE,P=L;--P>=0;){for($=0,I=G[P]%B,W=G[P]/B|0,C=T,M=P+C;M>P;)x=H[--C]%B,A=H[C]/B|0,E=W*x+A*I,x=I*x+E%B*B+z[M]+$,$=(x/U|0)+(E/B|0)+W*A,z[M--]=x%U;z[M]=$}return $?++S:z.splice(0,1),O(g,z,S)},r.negated=function(){var g=new _(this);return g.s=-g.s||null,g},r.plus=function(g,b){var $,S=this,P=S.s;if(g=new _(g,b),b=g.s,!P||!b)return new _(NaN);if(P!=b)return g.s=-b,S.minus(g);var M=S.e/LOG_BASE,C=g.e/LOG_BASE,E=S.c,T=g.c;if(!M||!C){if(!E||!T)return new _(P/0);if(!E[0]||!T[0])return T[0]?g:new _(E[0]?S:P*0)}if(M=bitFloor(M),C=bitFloor(C),E=E.slice(),P=M-C){for(P>0?(C=M,$=T):(P=-P,$=E),$.reverse();P--;$.push(0));$.reverse()}for(P=E.length,b=T.length,P-b<0&&($=T,T=E,E=$,b=P),P=0;b;)P=(E[--b]=E[b]+T[b]+P)/BASE|0,E[b]=BASE===E[b]?0:E[b]%BASE;return P&&(E=[P].concat(E),++C),O(g,E,C)},r.precision=r.sd=function(g,b){var $,S,P,M=this;if(g!=null&&g!==!!g)return intCheck(g,1,MAX),b==null?b=s:intCheck(b,0,8),N(new _(M),g,b);if(!($=M.c))return null;if(P=$.length-1,S=P*LOG_BASE+1,P=$[P]){for(;P%10==0;P/=10,S--);for(P=$[0];P>=10;P/=10,S++);}return g&&M.e+1>S&&(S=M.e+1),S},r.shiftedBy=function(g){return intCheck(g,-MAX_SAFE_INTEGER$1,MAX_SAFE_INTEGER$1),this.times("1e"+g)},r.squareRoot=r.sqrt=function(){var g,b,$,S,P,M=this,C=M.c,E=M.s,T=M.e,x=o+4,A=new _("0.5");if(E!==1||!C||!C[0])return new _(!E||E<0&&(!C||C[0])?NaN:C?M:1/0);if(E=Math.sqrt(+F(M)),E==0||E==1/0?(b=coeffToString(C),(b.length+T)%2==0&&(b+="0"),E=Math.sqrt(+b),T=bitFloor((T+1)/2)-(T<0||T%2),E==1/0?b="5e"+T:(b=E.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),$=new _(b)):$=new _(E+""),$.c[0]){for(T=$.e,E=T+x,E<3&&(E=0);;)if(P=$,$=A.times(P.plus(e(M,P,x,1))),coeffToString(P.c).slice(0,E)===(b=coeffToString($.c)).slice(0,E))if($.e<T&&--E,b=b.slice(E-3,E+1),b=="9999"||!S&&b=="4999"){if(!S&&(N(P,P.e+o+2,0),P.times(P).eq(M))){$=P;break}x+=4,E+=4,S=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(N($,$.e+o+2,1),g=!$.times($).eq(M));break}}return N($,$.e+o+1,s,g)},r.toExponential=function(g,b){return g!=null&&(intCheck(g,0,MAX),g++),D(this,g,b,1)},r.toFixed=function(g,b){return g!=null&&(intCheck(g,0,MAX),g=g+this.e+1),D(this,g,b)},r.toFormat=function(g,b,$){var S,P=this;if($==null)g!=null&&b&&typeof b=="object"?($=b,b=null):g&&typeof g=="object"?($=g,g=b=null):$=v;else if(typeof $!="object")throw Error(bignumberError+"Argument not an object: "+$);if(S=P.toFixed(g,b),P.c){var M,C=S.split("."),E=+$.groupSize,T=+$.secondaryGroupSize,x=$.groupSeparator||"",A=C[0],L=C[1],I=P.s<0,W=I?A.slice(1):A,z=W.length;if(T&&(M=E,E=T,T=M,z-=M),E>0&&z>0){for(M=z%E||E,A=W.substr(0,M);M<z;M+=E)A+=x+W.substr(M,E);T>0&&(A+=x+W.slice(M)),I&&(A="-"+A)}S=L?A+($.decimalSeparator||"")+((T=+$.fractionGroupSize)?L.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+($.fractionGroupSeparator||"")):L):A}return($.prefix||"")+S+($.suffix||"")},r.toFraction=function(g){var b,$,S,P,M,C,E,T,x,A,L,I,W=this,z=W.c;if(g!=null&&(E=new _(g),!E.isInteger()&&(E.c||E.s!==1)||E.lt(i)))throw Error(bignumberError+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+F(E));if(!z)return new _(W);for(b=new _(i),x=$=new _(i),S=T=new _(i),I=coeffToString(z),M=b.e=I.length-W.e-1,b.c[0]=POWS_TEN[(C=M%LOG_BASE)<0?LOG_BASE+C:C],g=!g||E.comparedTo(b)>0?M>0?b:x:E,C=d,d=1/0,E=new _(I),T.c[0]=0;A=e(E,b,0,1),P=$.plus(A.times(S)),P.comparedTo(g)!=1;)$=S,S=P,x=T.plus(A.times(P=x)),T=P,b=E.minus(A.times(P=b)),E=P;return P=e(g.minus($),S,0,1),T=T.plus(P.times(x)),$=$.plus(P.times(S)),T.s=x.s=W.s,M=M*2,L=e(x,S,M,s).minus(W).abs().comparedTo(e(T,$,M,s).minus(W).abs())<1?[x,S]:[T,$],d=C,L},r.toNumber=function(){return+F(this)},r.toPrecision=function(g,b){return g!=null&&intCheck(g,1,MAX),D(this,g,b,2)},r.toString=function(g){var b,$=this,S=$.s,P=$.e;return P===null?S?(b="Infinity",S<0&&(b="-"+b)):b="NaN":(g==null?b=P<=l||P>=u?toExponential(coeffToString($.c),P):toFixedPoint(coeffToString($.c),P,"0"):g===10&&w?($=N(new _($),o+P+1,s),b=toFixedPoint(coeffToString($.c),$.e,"0")):(intCheck(g,2,y.length,"Base"),b=a(toFixedPoint(coeffToString($.c),P,"0"),10,g,S,!0)),S<0&&$.c[0]&&(b="-"+b)),b},r.valueOf=r.toJSON=function(){return F(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,t!=null&&_.set(t),_}function bitFloor(t){var e=t|0;return t>0||t===e?e:e-1}function coeffToString(t){for(var e,a,n=1,r=t.length,i=t[0]+"";n<r;){for(e=t[n++]+"",a=LOG_BASE-e.length;a--;e="0"+e);i+=e}for(r=i.length;i.charCodeAt(--r)===48;);return i.slice(0,r+1||1)}function compare(t,e){var a,n,r=t.c,i=e.c,o=t.s,s=e.s,l=t.e,u=e.e;if(!o||!s)return null;if(a=r&&!r[0],n=i&&!i[0],a||n)return a?n?0:-s:o;if(o!=s)return o;if(a=o<0,n=l==u,!r||!i)return n?0:!r^a?1:-1;if(!n)return l>u^a?1:-1;for(s=(l=r.length)<(u=i.length)?l:u,o=0;o<s;o++)if(r[o]!=i[o])return r[o]>i[o]^a?1:-1;return l==u?0:l>u^a?1:-1}function intCheck(t,e,a,n){if(t<e||t>a||t!==mathfloor(t))throw Error(bignumberError+(n||"Argument")+(typeof t=="number"?t<e||t>a?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function isOdd(t){var e=t.c.length-1;return bitFloor(t.e/LOG_BASE)==e&&t.c[e]%2!=0}function toExponential(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function toFixedPoint(t,e,a){var n,r;if(e<0){for(r=a+".";++e;r+=a);t=r+t}else if(n=t.length,++e>n){for(r=a,e-=n;--e;r+=a);t+=r}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}var BigNumber=clone(),RoundingModeMap;(function(t){t[t.up=BigNumber.ROUND_UP]="up",t[t.down=BigNumber.ROUND_DOWN]="down",t[t.truncate=BigNumber.ROUND_DOWN]="truncate",t[t.halfUp=BigNumber.ROUND_HALF_UP]="halfUp",t[t.default=BigNumber.ROUND_HALF_UP]="default",t[t.halfDown=BigNumber.ROUND_HALF_DOWN]="halfDown",t[t.halfEven=BigNumber.ROUND_HALF_EVEN]="halfEven",t[t.banker=BigNumber.ROUND_HALF_EVEN]="banker",t[t.ceiling=BigNumber.ROUND_CEIL]="ceiling",t[t.ceil=BigNumber.ROUND_CEIL]="ceil",t[t.floor=BigNumber.ROUND_FLOOR]="floor"})(RoundingModeMap||(RoundingModeMap={}));function expandRoundMode(t){var e;return(e=RoundingModeMap[t])!==null&&e!==void 0?e:RoundingModeMap.default}var MAX_SAFE_INTEGER=9007199254740991,nativeFloor=Math.floor;function baseRepeat$1(t,e){var a="";if(!t||e<1||e>MAX_SAFE_INTEGER)return a;do e%2&&(a+=t),e=nativeFloor(e/2),e&&(t+=t);while(e);return a}var _baseRepeat=baseRepeat$1,isFunction=isFunction_1,isLength$1=isLength_1;function isArrayLike$4(t){return t!=null&&isLength$1(t.length)&&!isFunction(t)}var isArrayLike_1=isArrayLike$4,eq$1=eq_1,isArrayLike$3=isArrayLike_1,isIndex$1=_isIndex,isObject$2=isObject_1;function isIterateeCall$3(t,e,a){if(!isObject$2(a))return!1;var n=typeof e;return(n=="number"?isArrayLike$3(a)&&isIndex$1(e,a.length):n=="string"&&e in a)?eq$1(a[e],t):!1}var _isIterateeCall=isIterateeCall$3,reWhitespace=/\s/;function trimmedEndIndex$1(t){for(var e=t.length;e--&&reWhitespace.test(t.charAt(e)););return e}var _trimmedEndIndex=trimmedEndIndex$1,trimmedEndIndex=_trimmedEndIndex,reTrimStart=/^\s+/;function baseTrim$1(t){return t&&t.slice(0,trimmedEndIndex(t)+1).replace(reTrimStart,"")}var _baseTrim=baseTrim$1,baseTrim=_baseTrim,isObject$1=isObject_1,isSymbol$1=isSymbol_1,NAN=0/0,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber$1(t){if(typeof t=="number")return t;if(isSymbol$1(t))return NAN;if(isObject$1(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=isObject$1(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=baseTrim(t);var a=reIsBinary.test(t);return a||reIsOctal.test(t)?freeParseInt(t.slice(2),a?2:8):reIsBadHex.test(t)?NAN:+t}var toNumber_1=toNumber$1,toNumber=toNumber_1,INFINITY$1=1/0,MAX_INTEGER=17976931348623157e292;function toFinite$2(t){if(!t)return t===0?t:0;if(t=toNumber(t),t===INFINITY$1||t===-INFINITY$1){var e=t<0?-1:1;return e*MAX_INTEGER}return t===t?t:0}var toFinite_1=toFinite$2,toFinite$1=toFinite_1;function toInteger$1(t){var e=toFinite$1(t),a=e%1;return e===e?a?e-a:e:0}var toInteger_1=toInteger$1,baseRepeat=_baseRepeat,isIterateeCall$2=_isIterateeCall,toInteger=toInteger_1,toString=toString_1;function repeat(t,e,a){return(a?isIterateeCall$2(t,e,a):e===void 0)?e=1:e=toInteger(e),baseRepeat(toString(t),e)}var repeat_1=repeat;const repeat$1=getDefaultExportFromCjs(repeat_1);function digitCount(t){return t.isZero()?1:Math.floor(Math.log10(t.abs().toNumber())+1)}function getAbsolutePrecision(t,{precision:e,significant:a}){return a&&e!==null&&e>0?e-digitCount(t):e}function roundNumber(t,e){const a=getAbsolutePrecision(t,e);if(a===null)return t.toString();const n=expandRoundMode(e.roundMode);if(a>=0)return t.toFixed(a,n);const r=Math.pow(10,Math.abs(a));return t=new BigNumber(t.div(r).toFixed(0,n)).times(r),t.toString()}function replaceInFormat(t,{formattedNumber:e,unit:a}){return t.replace("%n",e).replace("%u",a)}function computeSignificand({significand:t,whole:e,precision:a}){if(e==="0"||a===null)return t;const n=Math.max(0,a-e.length);return(t??"").substr(0,n)}function formatNumber(t,e){var a,n,r;const i=new BigNumber(t);if(e.raise&&!i.isFinite())throw new Error(`"${t}" is not a valid numeric value`);const o=roundNumber(i,e),s=new BigNumber(o),l=s.lt(0),u=s.isZero();let[c,d]=o.split(".");const h=[];let m;const p=(a=e.format)!==null&&a!==void 0?a:"%n",v=(n=e.negativeFormat)!==null&&n!==void 0?n:`-${p}`,y=l&&!u?v:p;for(c=c.replace("-","");c.length>0;)h.unshift(c.substr(Math.max(0,c.length-3),3)),c=c.substr(0,c.length-3);return c=h.join(""),m=h.join(e.delimiter),e.significant?d=computeSignificand({whole:c,significand:d,precision:e.precision}):d=d??repeat$1("0",(r=e.precision)!==null&&r!==void 0?r:0),e.stripInsignificantZeros&&d&&(d=d.replace(/0+$/,"")),i.isNaN()&&(m=t.toString()),d&&i.isFinite()&&(m+=(e.separator||".")+d),replaceInFormat(y,{formattedNumber:m,unit:e.unit})}function getFullScope(t,e,a){let n="";return(e instanceof String||typeof e=="string")&&(n=e),e instanceof Array&&(n=e.join(t.defaultSeparator)),a.scope&&(n=[a.scope,n].join(t.defaultSeparator)),n}function inferType(t){var e,a;if(t===null)return"null";const n=typeof t;return n!=="object"?n:((a=(e=t==null?void 0:t.constructor)===null||e===void 0?void 0:e.name)===null||a===void 0?void 0:a.toLowerCase())||"object"}function interpolate(t,e,a){a=Object.keys(a).reduce((r,i)=>(r[t.transformKey(i)]=a[i],r),{});const n=e.match(t.placeholder);if(!n)return e;for(;n.length;){let r;const i=n.shift(),o=i.replace(t.placeholder,"$1");isSet(a[o])?r=a[o].toString().replace(/\$/gm,"_#$#_"):o in a?r=t.nullPlaceholder(t,i,e,a):r=t.missingPlaceholder(t,i,e,a);const s=new RegExp(i.replace(/\{/gm,"\\{").replace(/\}/gm,"\\}"));e=e.replace(s,r)}return e.replace(/_#\$#_/g,"$")}function lookup(t,e,a={}){a=Object.assign({},a);const n="locale"in a?a.locale:t.locale,r=inferType(n),i=t.locales.get(r==="string"?n:typeof n).slice();e=getFullScope(t,e,a).split(t.defaultSeparator).map(s=>t.transformKey(s)).join(".");const o=i.map(s=>get$2(t.translations,[s,e].join(".")));return o.push(a.defaultValue),o.find(s=>isSet(s))}function numberToDelimited(t,e){const a=new BigNumber(t);if(!a.isFinite())return t.toString();if(!e.delimiterPattern.global)throw new Error(`options.delimiterPattern must be a global regular expression; received ${e.delimiterPattern}`);let[n,r]=a.toString().split(".");return n=n.replace(e.delimiterPattern,i=>`${i}${e.delimiter}`),[n,r].filter(Boolean).join(e.separator)}function arrayPush$2(t,e){for(var a=-1,n=e.length,r=t.length;++a<n;)t[r+a]=e[a];return t}var _arrayPush=arrayPush$2,Symbol$2=_Symbol,isArguments$1=isArguments_1,isArray$5=isArray_1,spreadableSymbol=Symbol$2?Symbol$2.isConcatSpreadable:void 0;function isFlattenable$1(t){return isArray$5(t)||isArguments$1(t)||!!(spreadableSymbol&&t&&t[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush$1=_arrayPush,isFlattenable=_isFlattenable;function baseFlatten$2(t,e,a,n,r){var i=-1,o=t.length;for(a||(a=isFlattenable),r||(r=[]);++i<o;){var s=t[i];e>0&&a(s)?e>1?baseFlatten$2(s,e-1,a,n,r):arrayPush$1(r,s):n||(r[r.length]=s)}return r}var _baseFlatten=baseFlatten$2,ListCache$2=_ListCache;function stackClear$1(){this.__data__=new ListCache$2,this.size=0}var _stackClear=stackClear$1;function stackDelete$1(t){var e=this.__data__,a=e.delete(t);return this.size=e.size,a}var _stackDelete=stackDelete$1;function stackGet$1(t){return this.__data__.get(t)}var _stackGet=stackGet$1;function stackHas$1(t){return this.__data__.has(t)}var _stackHas=stackHas$1,ListCache$1=_ListCache,Map$2=_Map,MapCache=_MapCache,LARGE_ARRAY_SIZE=200;function stackSet$1(t,e){var a=this.__data__;if(a instanceof ListCache$1){var n=a.__data__;if(!Map$2||n.length<LARGE_ARRAY_SIZE-1)return n.push([t,e]),this.size=++a.size,this;a=this.__data__=new MapCache(n)}return a.set(t,e),this.size=a.size,this}var _stackSet=stackSet$1,ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$2(t){var e=this.__data__=new ListCache(t);this.size=e.size}Stack$2.prototype.clear=stackClear;Stack$2.prototype.delete=stackDelete;Stack$2.prototype.get=stackGet;Stack$2.prototype.has=stackHas;Stack$2.prototype.set=stackSet;var _Stack=Stack$2;function arraySome$1(t,e){for(var a=-1,n=t==null?0:t.length;++a<n;)if(e(t[a],a,t))return!0;return!1}var _arraySome=arraySome$1,SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays$2(t,e,a,n,r,i){var o=a&COMPARE_PARTIAL_FLAG$5,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(t),c=i.get(e);if(u&&c)return u==e&&c==t;var d=-1,h=!0,m=a&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(i.set(t,e),i.set(e,t);++d<s;){var p=t[d],v=e[d];if(n)var y=o?n(v,p,d,e,t,i):n(p,v,d,t,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(m){if(!arraySome(e,function(w,_){if(!cacheHas(m,_)&&(p===w||r(p,w,a,n,i)))return m.push(_)})){h=!1;break}}else if(!(p===v||r(p,v,a,n,i))){h=!1;break}}return i.delete(t),i.delete(e),h}var _equalArrays=equalArrays$2,root$3=_root,Uint8Array$2=root$3.Uint8Array,_Uint8Array=Uint8Array$2;function mapToArray$1(t){var e=-1,a=Array(t.size);return t.forEach(function(n,r){a[++e]=[r,n]}),a}var _mapToArray=mapToArray$1,Symbol$1=_Symbol,Uint8Array$1=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(t,e,a,n,r,i,o){switch(a){case dataViewTag$2:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case arrayBufferTag$1:return!(t.byteLength!=e.byteLength||!i(new Uint8Array$1(t),new Uint8Array$1(e)));case boolTag$1:case dateTag$1:case numberTag$1:return eq(+t,+e);case errorTag$1:return t.name==e.name&&t.message==e.message;case regexpTag$1:case stringTag$1:return t==e+"";case mapTag$2:var s=mapToArray;case setTag$2:var l=n&COMPARE_PARTIAL_FLAG$4;if(s||(s=setToArray),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=COMPARE_UNORDERED_FLAG$2,o.set(t,e);var c=equalArrays$1(s(t),s(e),n,r,i,o);return o.delete(t),c;case symbolTag:if(symbolValueOf)return symbolValueOf.call(t)==symbolValueOf.call(e)}return!1}var _equalByTag=equalByTag$1,arrayPush=_arrayPush,isArray$4=isArray_1;function baseGetAllKeys$1(t,e,a){var n=e(t);return isArray$4(t)?n:arrayPush(n,a(t))}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(t,e){for(var a=-1,n=t==null?0:t.length,r=0,i=[];++a<n;){var o=t[a];e(o,a,t)&&(i[r++]=o)}return i}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[]}var stubArray_1=stubArray$1,arrayFilter=_arrayFilter,stubArray=stubArray_1,objectProto$5=Object.prototype,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols$1=nativeGetSymbols?function(t){return t==null?[]:(t=Object(t),arrayFilter(nativeGetSymbols(t),function(e){return propertyIsEnumerable.call(t,e)}))}:stubArray,_getSymbols=getSymbols$1;function baseTimes$1(t,e){for(var a=-1,n=Array(t);++a<t;)n[a]=e(a);return n}var _baseTimes=baseTimes$1,isBuffer$2={exports:{}};function stubFalse(){return!1}var stubFalse_1=stubFalse;isBuffer$2.exports;(function(t,e){var a=_root,n=stubFalse_1,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o?a.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;t.exports=u})(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports,baseGetTag$1=_baseGetTag,isLength=isLength_1,isObjectLike$1=isObjectLike_1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0;typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=!1;function baseIsTypedArray$1(t){return isObjectLike$1(t)&&isLength(t.length)&&!!typedArrayTags[baseGetTag$1(t)]}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$2(t){return function(e){return t(e)}}var _baseUnary=baseUnary$2,_nodeUtil={exports:{}};_nodeUtil.exports;(function(t,e){var a=_freeGlobal,n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i&&a.process,s=function(){try{var l=r&&r.require&&r.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s})(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports,baseIsTypedArray=_baseIsTypedArray,baseUnary$1=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray$2=nodeIsTypedArray?baseUnary$1(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$2,baseTimes=_baseTimes,isArguments=isArguments_1,isArray$3=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(t,e){var a=isArray$3(t),n=!a&&isArguments(t),r=!a&&!n&&isBuffer$1(t),i=!a&&!n&&!r&&isTypedArray$1(t),o=a||n||r||i,s=o?baseTimes(t.length,String):[],l=s.length;for(var u in t)(e||hasOwnProperty$3.call(t,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||isIndex(u,l)))&&s.push(u);return s}var _arrayLikeKeys=arrayLikeKeys$1,objectProto$3=Object.prototype;function isPrototype$1(t){var e=t&&t.constructor,a=typeof e=="function"&&e.prototype||objectProto$3;return t===a}var _isPrototype=isPrototype$1;function overArg$1(t,e){return function(a){return t(e(a))}}var _overArg=overArg$1,overArg=_overArg,nativeKeys$1=overArg(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype=_isPrototype,nativeKeys=_nativeKeys,objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(t){if(!isPrototype(t))return nativeKeys(t);var e=[];for(var a in Object(t))hasOwnProperty$2.call(t,a)&&a!="constructor"&&e.push(a);return e}var _baseKeys=baseKeys$1,arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike$2=isArrayLike_1;function keys$3(t){return isArrayLike$2(t)?arrayLikeKeys(t):baseKeys(t)}var keys_1=keys$3,baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys$2=keys_1;function getAllKeys$1(t){return baseGetAllKeys(t,keys$2,getSymbols)}var _getAllKeys=getAllKeys$1,getAllKeys=_getAllKeys,COMPARE_PARTIAL_FLAG$3=1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(t,e,a,n,r,i){var o=a&COMPARE_PARTIAL_FLAG$3,s=getAllKeys(t),l=s.length,u=getAllKeys(e),c=u.length;if(l!=c&&!o)return!1;for(var d=l;d--;){var h=s[d];if(!(o?h in e:hasOwnProperty$1.call(e,h)))return!1}var m=i.get(t),p=i.get(e);if(m&&p)return m==e&&p==t;var v=!0;i.set(t,e),i.set(e,t);for(var y=o;++d<l;){h=s[d];var w=t[h],_=e[h];if(n)var D=o?n(_,w,h,e,t,i):n(w,_,h,t,e,i);if(!(D===void 0?w===_||r(w,_,a,n,i):D)){v=!1;break}y||(y=h=="constructor")}if(v&&!y){var k=t.constructor,O=e.constructor;k!=O&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof O=="function"&&O instanceof O)&&(v=!1)}return i.delete(t),i.delete(e),v}var _equalObjects=equalObjects$1,getNative$2=_getNative,root$2=_root,DataView$1=getNative$2(root$2,"DataView"),_DataView=DataView$1,getNative$1=_getNative,root$1=_root,Promise$2=getNative$1(root$1,"Promise"),_Promise=Promise$2,getNative=_getNative,root=_root,WeakMap$2=getNative(root,"WeakMap"),_WeakMap=WeakMap$2,DataView=_DataView,Map$1=_Map,Promise$1=_Promise,Set$1=_Set,WeakMap$1=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource,mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]",dataViewTag="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag$1=baseGetTag;(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map$1&&getTag$1(new Map$1)!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set$1&&getTag$1(new Set$1)!=setTag||WeakMap$1&&getTag$1(new WeakMap$1)!=weakMapTag)&&(getTag$1=function(t){var e=baseGetTag(t),a=e==objectTag$1?t.constructor:void 0,n=a?toSource(a):"";if(n)switch(n){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return e});var _getTag=getTag$1,Stack$1=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray$2=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1,COMPARE_PARTIAL_FLAG$2=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(t,e,a,n,r,i){var o=isArray$2(t),s=isArray$2(e),l=o?arrayTag:getTag(t),u=s?arrayTag:getTag(e);l=l==argsTag?objectTag:l,u=u==argsTag?objectTag:u;var c=l==objectTag,d=u==objectTag,h=l==u;if(h&&isBuffer(t)){if(!isBuffer(e))return!1;o=!0,c=!1}if(h&&!c)return i||(i=new Stack$1),o||isTypedArray(t)?equalArrays(t,e,a,n,r,i):equalByTag(t,e,l,a,n,r,i);if(!(a&COMPARE_PARTIAL_FLAG$2)){var m=c&&hasOwnProperty.call(t,"__wrapped__"),p=d&&hasOwnProperty.call(e,"__wrapped__");if(m||p){var v=m?t.value():t,y=p?e.value():e;return i||(i=new Stack$1),r(v,y,a,n,i)}}return h?(i||(i=new Stack$1),equalObjects(t,e,a,n,r,i)):!1}var _baseIsEqualDeep=baseIsEqualDeep$1,baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$2(t,e,a,n,r){return t===e?!0:t==null||e==null||!isObjectLike(t)&&!isObjectLike(e)?t!==t&&e!==e:baseIsEqualDeep(t,e,a,n,baseIsEqual$2,r)}var _baseIsEqual=baseIsEqual$2,Stack=_Stack,baseIsEqual$1=_baseIsEqual,COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch$1(t,e,a,n){var r=a.length,i=r,o=!n;if(t==null)return!i;for(t=Object(t);r--;){var s=a[r];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++r<i;){s=a[r];var l=s[0],u=t[l],c=s[1];if(o&&s[2]){if(u===void 0&&!(l in t))return!1}else{var d=new Stack;if(n)var h=n(u,c,l,t,e,d);if(!(h===void 0?baseIsEqual$1(c,u,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,n,d):h))return!1}}return!0}var _baseIsMatch=baseIsMatch$1,isObject=isObject_1;function isStrictComparable$2(t){return t===t&&!isObject(t)}var _isStrictComparable=isStrictComparable$2,isStrictComparable$1=_isStrictComparable,keys$1=keys_1;function getMatchData$1(t){for(var e=keys$1(t),a=e.length;a--;){var n=e[a],r=t[n];e[a]=[n,r,isStrictComparable$1(r)]}return e}var _getMatchData=getMatchData$1;function matchesStrictComparable$2(t,e){return function(a){return a==null?!1:a[t]===e&&(e!==void 0||t in Object(a))}}var _matchesStrictComparable=matchesStrictComparable$2,baseIsMatch=_baseIsMatch,getMatchData=_getMatchData,matchesStrictComparable$1=_matchesStrictComparable;function baseMatches$1(t){var e=getMatchData(t);return e.length==1&&e[0][2]?matchesStrictComparable$1(e[0][0],e[0][1]):function(a){return a===t||baseIsMatch(a,t,e)}}var _baseMatches=baseMatches$1;function baseHasIn$1(t,e){return t!=null&&e in Object(t)}var _baseHasIn=baseHasIn$1,baseHasIn=_baseHasIn,hasPath=_hasPath;function hasIn$1(t,e){return t!=null&&hasPath(t,e,baseHasIn)}var hasIn_1=hasIn$1,baseIsEqual=_baseIsEqual,get=get_1,hasIn=hasIn_1,isKey$1=_isKey,isStrictComparable=_isStrictComparable,matchesStrictComparable=_matchesStrictComparable,toKey$1=_toKey,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty$1(t,e){return isKey$1(t)&&isStrictComparable(e)?matchesStrictComparable(toKey$1(t),e):function(a){var n=get(a,t);return n===void 0&&n===e?hasIn(a,t):baseIsEqual(e,n,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}var _baseMatchesProperty=baseMatchesProperty$1;function identity$4(t){return t}var identity_1=identity$4;function baseProperty$1(t){return function(e){return e==null?void 0:e[t]}}var _baseProperty=baseProperty$1,baseGet$1=_baseGet;function basePropertyDeep$1(t){return function(e){return baseGet$1(e,t)}}var _basePropertyDeep=basePropertyDeep$1,baseProperty=_baseProperty,basePropertyDeep=_basePropertyDeep,isKey=_isKey,toKey=_toKey;function property$1(t){return isKey(t)?baseProperty(toKey(t)):basePropertyDeep(t)}var property_1=property$1,baseMatches=_baseMatches,baseMatchesProperty=_baseMatchesProperty,identity$3=identity_1,isArray$1=isArray_1,property=property_1;function baseIteratee$1(t){return typeof t=="function"?t:t==null?identity$3:typeof t=="object"?isArray$1(t)?baseMatchesProperty(t[0],t[1]):baseMatches(t):property(t)}var _baseIteratee=baseIteratee$1;function createBaseFor$1(t){return function(e,a,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var l=o[t?s:++r];if(a(i[l],l,i)===!1)break}return e}}var _createBaseFor=createBaseFor$1,createBaseFor=_createBaseFor,baseFor$1=createBaseFor(),_baseFor=baseFor$1,baseFor=_baseFor,keys=keys_1;function baseForOwn$1(t,e){return t&&baseFor(t,e,keys)}var _baseForOwn=baseForOwn$1,isArrayLike$1=isArrayLike_1;function createBaseEach$1(t,e){return function(a,n){if(a==null)return a;if(!isArrayLike$1(a))return t(a,n);for(var r=a.length,i=e?r:-1,o=Object(a);(e?i--:++i<r)&&n(o[i],i,o)!==!1;);return a}}var _createBaseEach=createBaseEach$1,baseForOwn=_baseForOwn,createBaseEach=_createBaseEach,baseEach$1=createBaseEach(baseForOwn),_baseEach=baseEach$1,baseEach=_baseEach,isArrayLike=isArrayLike_1;function baseMap$1(t,e){var a=-1,n=isArrayLike(t)?Array(t.length):[];return baseEach(t,function(r,i,o){n[++a]=e(r,i,o)}),n}var _baseMap=baseMap$1;function baseSortBy$1(t,e){var a=t.length;for(t.sort(e);a--;)t[a]=t[a].value;return t}var _baseSortBy=baseSortBy$1,isSymbol=isSymbol_1;function compareAscending$1(t,e){if(t!==e){var a=t!==void 0,n=t===null,r=t===t,i=isSymbol(t),o=e!==void 0,s=e===null,l=e===e,u=isSymbol(e);if(!s&&!u&&!i&&t>e||i&&o&&l&&!s&&!u||n&&o&&l||!a&&l||!r)return 1;if(!n&&!i&&!u&&t<e||u&&a&&r&&!n&&!i||s&&a&&r||!o&&r||!l)return-1}return 0}var _compareAscending=compareAscending$1,compareAscending=_compareAscending;function compareMultiple$1(t,e,a){for(var n=-1,r=t.criteria,i=e.criteria,o=r.length,s=a.length;++n<o;){var l=compareAscending(r[n],i[n]);if(l){if(n>=s)return l;var u=a[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}var _compareMultiple=compareMultiple$1,arrayMap=_arrayMap,baseGet=_baseGet,baseIteratee=_baseIteratee,baseMap=_baseMap,baseSortBy=_baseSortBy,baseUnary=_baseUnary,compareMultiple=_compareMultiple,identity$2=identity_1,isArray=isArray_1;function baseOrderBy$1(t,e,a){e.length?e=arrayMap(e,function(i){return isArray(i)?function(o){return baseGet(o,i.length===1?i[0]:i)}:i}):e=[identity$2];var n=-1;e=arrayMap(e,baseUnary(baseIteratee));var r=baseMap(t,function(i,o,s){var l=arrayMap(e,function(u){return u(i)});return{criteria:l,index:++n,value:i}});return baseSortBy(r,function(i,o){return compareMultiple(i,o,a)})}var _baseOrderBy=baseOrderBy$1;function apply$1(t,e,a){switch(a.length){case 0:return t.call(e);case 1:return t.call(e,a[0]);case 2:return t.call(e,a[0],a[1]);case 3:return t.call(e,a[0],a[1],a[2])}return t.apply(e,a)}var _apply=apply$1,apply=_apply,nativeMax$1=Math.max;function overRest$1(t,e,a){return e=nativeMax$1(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,i=nativeMax$1(n.length-e,0),o=Array(i);++r<i;)o[r]=n[e+r];r=-1;for(var s=Array(e+1);++r<e;)s[r]=n[r];return s[e]=a(o),apply(t,this,s)}}var _overRest=overRest$1;function constant$1(t){return function(){return t}}var constant_1=constant$1,constant=constant_1,defineProperty=_defineProperty,identity$1=identity_1,baseSetToString$1=defineProperty?function(t,e){return defineProperty(t,"toString",{configurable:!0,enumerable:!1,value:constant(e),writable:!0})}:identity$1,_baseSetToString=baseSetToString$1,HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut$1(t){var e=0,a=0;return function(){var n=nativeNow(),r=HOT_SPAN-(n-a);if(a=n,r>0){if(++e>=HOT_COUNT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var _shortOut=shortOut$1,baseSetToString=_baseSetToString,shortOut=_shortOut,setToString$1=shortOut(baseSetToString),_setToString=setToString$1,identity=identity_1,overRest=_overRest,setToString=_setToString;function baseRest$1(t,e){return setToString(overRest(t,e,identity),t+"")}var _baseRest=baseRest$1,baseFlatten$1=_baseFlatten,baseOrderBy=_baseOrderBy,baseRest=_baseRest,isIterateeCall$1=_isIterateeCall,sortBy=baseRest(function(t,e){if(t==null)return[];var a=e.length;return a>1&&isIterateeCall$1(t,e[0],e[1])?e=[]:a>2&&isIterateeCall$1(e[0],e[1],e[2])&&(e=[e[0]]),baseOrderBy(t,baseFlatten$1(e,1),[])}),sortBy_1=sortBy;const sortBy$1=getDefaultExportFromCjs(sortBy_1);function baseZipObject$1(t,e,a){for(var n=-1,r=t.length,i=e.length,o={};++n<r;){var s=n<i?e[n]:void 0;a(o,t[n],s)}return o}var _baseZipObject=baseZipObject$1,assignValue=_assignValue,baseZipObject=_baseZipObject;function zipObject(t,e){return baseZipObject(t||[],e||[],assignValue)}var zipObject_1=zipObject;const zipObject$1=getDefaultExportFromCjs(zipObject_1),DECIMAL_UNITS={0:"unit",1:"ten",2:"hundred",3:"thousand",6:"million",9:"billion",12:"trillion",15:"quadrillion","-1":"deci","-2":"centi","-3":"mili","-6":"micro","-9":"nano","-12":"pico","-15":"femto"},INVERTED_DECIMAL_UNITS=zipObject$1(Object.values(DECIMAL_UNITS),Object.keys(DECIMAL_UNITS).map(t=>parseInt(t,10)));function numberToHuman(t,e,a){const n={roundMode:a.roundMode,precision:a.precision,significant:a.significant};let r;if(inferType(a.units)==="string"){const d=a.units;if(r=lookup(t,d),!r)throw new Error(`The scope "${t.locale}${t.defaultSeparator}${getFullScope(t,d,{})}" couldn't be found`)}else r=a.units;let i=roundNumber(new BigNumber(e),n);const o=d=>sortBy$1(Object.keys(d).map(h=>INVERTED_DECIMAL_UNITS[h]),h=>h*-1),s=(d,h)=>{const m=d.isZero()?0:Math.floor(Math.log10(d.abs().toNumber()));return o(h).find(p=>m>=p)||0},l=(d,h)=>{const m=DECIMAL_UNITS[h.toString()];return d[m]||""},u=s(new BigNumber(i),r),c=l(r,u);if(i=roundNumber(new BigNumber(i).div(Math.pow(10,u)),n),a.stripInsignificantZeros){let[d,h]=i.split(".");h=(h||"").replace(/0+$/,""),i=d,h&&(i+=`${a.separator}${h}`)}return a.format.replace("%n",i||"0").replace("%u",c).trim()}const STORAGE_UNITS=["byte","kb","mb","gb","tb","pb","eb"];function numberToHumanSize(t,e,a){const n=expandRoundMode(a.roundMode),r=1024,i=new BigNumber(e).abs(),o=i.lt(r);let s;const l=(p,v)=>{const y=v.length-1,w=new BigNumber(Math.log(p.toNumber())).div(Math.log(r)).integerValue(BigNumber.ROUND_DOWN).toNumber();return Math.min(y,w)},u=p=>`number.human.storage_units.units.${o?"byte":p[c]}`,c=l(i,STORAGE_UNITS);o?s=i.integerValue():s=new BigNumber(roundNumber(i.div(Math.pow(r,c)),{significant:a.significant,precision:a.precision,roundMode:a.roundMode}));const d=t.translate("number.human.storage_units.format",{defaultValue:"%n %u"}),h=t.translate(u(STORAGE_UNITS),{count:i.integerValue().toNumber()});let m=s.toFixed(a.precision,n);return a.stripInsignificantZeros&&(m=m.replace(/(\..*?)0+$/,"$1").replace(/\.$/,"")),d.replace("%n",m).replace("%u",h)}function parseDate(t){if(t instanceof Date)return t;if(typeof t=="number"){const n=new Date;return n.setTime(t),n}const e=new String(t).match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})(?:[.,](\d{1,3}))?)?(Z|\+00:?00)?/);if(e){const n=e.slice(1,8).map(h=>parseInt(h,10)||0);n[1]-=1;const[r,i,o,s,l,u,c]=n;return e[8]?new Date(Date.UTC(r,i,o,s,l,u,c)):new Date(r,i,o,s,l,u,c)}t.match(/([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d+:\d+:\d+) ([+-]\d+) (\d+)/)&&new Date().setTime(Date.parse([RegExp.$1,RegExp.$2,RegExp.$3,RegExp.$6,RegExp.$4,RegExp.$5].join(" ")));const a=new Date;return a.setTime(Date.parse(t)),a}function pluralize({i18n:t,count:e,scope:a,options:n,baseScope:r}){n=Object.assign({},n);let i,o;if(typeof a=="object"&&a?i=a:i=lookup(t,a,n),!i)return t.missingTranslation.get(a,n);const l=t.pluralization.get(n.locale)(t,e),u=[];for(;l.length;){const c=l.shift();if(isSet(i[c])){o=i[c];break}u.push(c)}return isSet(o)?(n.count=e,t.interpolate(t,o,n)):t.missingTranslation.get(r.split(t.defaultSeparator).concat([u[0]]),n)}var baseFlatten=_baseFlatten,INFINITY=1/0;function flattenDeep(t){var e=t==null?0:t.length;return e?baseFlatten(t,INFINITY):[]}var flattenDeep_1=flattenDeep;const flattenDeep$1=getDefaultExportFromCjs(flattenDeep_1);class PropertyFlatList{constructor(e){this.target=e}call(){const e=flattenDeep$1(Object.keys(this.target).map(a=>this.compute(this.target[a],a)));return e.sort(),e}compute(e,a){return!isArray$b(e)&&isObject$7(e)?Object.keys(e).map(n=>this.compute(e[n],`${a}.${n}`)):a}}function propertyFlatList(t){return new PropertyFlatList(t).call()}const DEFAULT_OPTIONS={meridian:{am:"AM",pm:"PM"},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbrDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],monthNames:[null,"January","February","March","April","May","June","July","August","September","October","November","December"],abbrMonthNames:[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function strftime(t,e,a={}){const{abbrDayNames:n,dayNames:r,abbrMonthNames:i,monthNames:o,meridian:s}=Object.assign(Object.assign({},DEFAULT_OPTIONS),a);if(isNaN(t.getTime()))throw new Error("strftime() requires a valid date object, but received an invalid date.");const l=t.getDay(),u=t.getDate(),c=t.getFullYear(),d=t.getMonth()+1,h=t.getHours();let m=h;const p=h>11?"pm":"am",v=t.getSeconds(),y=t.getMinutes(),w=t.getTimezoneOffset(),_=Math.floor(Math.abs(w/60)),D=Math.abs(w)-_*60,k=(w>0?"-":"+")+(_.toString().length<2?"0"+_:_)+(D.toString().length<2?"0"+D:D);return m>12?m=m-12:m===0&&(m=12),e=e.replace("%a",n[l]),e=e.replace("%A",r[l]),e=e.replace("%b",i[d]),e=e.replace("%B",o[d]),e=e.replace("%d",u.toString().padStart(2,"0")),e=e.replace("%e",u.toString()),e=e.replace("%-d",u.toString()),e=e.replace("%H",h.toString().padStart(2,"0")),e=e.replace("%-H",h.toString()),e=e.replace("%k",h.toString()),e=e.replace("%I",m.toString().padStart(2,"0")),e=e.replace("%-I",m.toString()),e=e.replace("%l",m.toString()),e=e.replace("%m",d.toString().padStart(2,"0")),e=e.replace("%-m",d.toString()),e=e.replace("%M",y.toString().padStart(2,"0")),e=e.replace("%-M",y.toString()),e=e.replace("%p",s[p]),e=e.replace("%P",s[p].toLowerCase()),e=e.replace("%S",v.toString().padStart(2,"0")),e=e.replace("%-S",v.toString()),e=e.replace("%w",l.toString()),e=e.replace("%y",c.toString().padStart(2,"0").substr(-2)),e=e.replace("%-y",c.toString().padStart(2,"0").substr(-2).replace(/^0+/,"")),e=e.replace("%Y",c.toString()),e=e.replace(/%z/i,k),e}var nativeCeil=Math.ceil,nativeMax=Math.max;function baseRange$1(t,e,a,n){for(var r=-1,i=nativeMax(nativeCeil((e-t)/(a||1)),0),o=Array(i);i--;)o[n?i:++r]=t,t+=a;return o}var _baseRange=baseRange$1,baseRange=_baseRange,isIterateeCall=_isIterateeCall,toFinite=toFinite_1;function createRange$1(t){return function(e,a,n){return n&&typeof n!="number"&&isIterateeCall(e,a,n)&&(a=n=void 0),e=toFinite(e),a===void 0?(a=e,e=0):a=toFinite(a),n=n===void 0?e<a?1:-1:toFinite(n),baseRange(e,a,n,t)}}var _createRange=createRange$1,createRange=_createRange,range=createRange(),range_1=range;const range$1=getDefaultExportFromCjs(range_1),within=(t,e,a)=>a>=t&&a<=e;function timeAgoInWords(t,e,a,n={}){const r=n.scope||"datetime.distance_in_words",i=(F,g=0)=>t.t(F,{count:g,scope:r});e=parseDate(e),a=parseDate(a);let o=e.getTime()/1e3,s=a.getTime()/1e3;o>s&&([e,a,o,s]=[a,e,s,o]);const l=Math.round(s-o),u=Math.round((s-o)/60),d=u/60/24,h=Math.round(u/60),m=Math.round(d),p=Math.round(m/30);if(within(0,1,u))return n.includeSeconds?within(0,4,l)?i("less_than_x_seconds",5):within(5,9,l)?i("less_than_x_seconds",10):within(10,19,l)?i("less_than_x_seconds",20):within(20,39,l)?i("half_a_minute"):within(40,59,l)?i("less_than_x_minutes",1):i("x_minutes",1):u===0?i("less_than_x_minutes",1):i("x_minutes",u);if(within(2,44,u))return i("x_minutes",u);if(within(45,89,u))return i("about_x_hours",1);if(within(90,1439,u))return i("about_x_hours",h);if(within(1440,2519,u))return i("x_days",1);if(within(2520,43199,u))return i("x_days",m);if(within(43200,86399,u))return i("about_x_months",Math.round(u/43200));if(within(86400,525599,u))return i("x_months",p);let v=e.getFullYear();e.getMonth()+1>=3&&(v+=1);let y=a.getFullYear();a.getMonth()+1<3&&(y-=1);const w=v>y?0:range$1(v,y).filter(F=>new Date(F,1,29).getMonth()==1).length,_=525600,D=w*1440,k=u-D,O=Math.trunc(k/_),N=parseFloat((k/_-O).toPrecision(3));return N<.25?i("about_x_years",O):N<.75?i("over_x_years",O):i("almost_x_years",O+1)}const guessStrategy=function(t,e){e instanceof Array&&(e=e.join(t.defaultSeparator));const a=e.split(t.defaultSeparator).slice(-1)[0];return t.missingTranslationPrefix+a.replace("_"," ").replace(/([a-z])([A-Z])/g,(n,r,i)=>`${r} ${i.toLowerCase()}`)},messageStrategy=(t,e,a)=>{const n=getFullScope(t,e,a),r="locale"in a?a.locale:t.locale,i=inferType(r);return`[missing "${[i=="string"?r:i,n].join(t.defaultSeparator)}" translation]`},errorStrategy=(t,e,a)=>{const n=getFullScope(t,e,a),r=[t.locale,n].join(t.defaultSeparator);throw new Error(`Missing translation: ${r}`)};class MissingTranslation{constructor(e){this.i18n=e,this.registry={},this.register("guess",guessStrategy),this.register("message",messageStrategy),this.register("error",errorStrategy)}register(e,a){this.registry[e]=a}get(e,a){var n;return this.registry[(n=a.missingBehavior)!==null&&n!==void 0?n:this.i18n.missingBehavior](this.i18n,e,a)}}var __awaiter=globalThis&&globalThis.__awaiter||function(t,e,a,n){function r(i){return i instanceof a?i:new a(function(o){o(i)})}return new(a||(a=Promise))(function(i,o){function s(c){try{u(n.next(c))}catch(d){o(d)}}function l(c){try{u(n.throw(c))}catch(d){o(d)}}function u(c){c.done?i(c.value):r(c.value).then(s,l)}u((n=n.apply(t,e||[])).next())})};const DEFAULT_I18N_OPTIONS={defaultLocale:"en",availableLocales:["en"],locale:"en",defaultSeparator:".",placeholder:/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,enableFallback:!1,missingBehavior:"message",missingTranslationPrefix:"",missingPlaceholder:(t,e)=>`[missing "${e}" value]`,nullPlaceholder:(t,e,a,n)=>t.missingPlaceholder(t,e,a,n),transformKey:t=>t};class I18n{constructor(e={},a={}){this._locale=DEFAULT_I18N_OPTIONS.locale,this._defaultLocale=DEFAULT_I18N_OPTIONS.defaultLocale,this._version=0,this.onChangeHandlers=[],this.translations={},this.availableLocales=[],this.t=this.translate,this.p=this.pluralize,this.l=this.localize,this.distanceOfTimeInWords=this.timeAgoInWords;const{locale:n,enableFallback:r,missingBehavior:i,missingTranslationPrefix:o,missingPlaceholder:s,nullPlaceholder:l,defaultLocale:u,defaultSeparator:c,placeholder:d,transformKey:h}=Object.assign(Object.assign({},DEFAULT_I18N_OPTIONS),a);this.locale=n,this.defaultLocale=u,this.defaultSeparator=c,this.enableFallback=r,this.locale=n,this.missingBehavior=i,this.missingTranslationPrefix=o,this.missingPlaceholder=s,this.nullPlaceholder=l,this.placeholder=d,this.pluralization=new Pluralization(this),this.locales=new Locales(this),this.missingTranslation=new MissingTranslation(this),this.transformKey=h,this.interpolate=interpolate,this.store(e)}store(e){propertyFlatList(e).forEach(n=>set$1(this.translations,n,get$2(e,n))),this.hasChanged()}get locale(){return this._locale||this.defaultLocale||"en"}set locale(e){if(typeof e!="string")throw new Error(`Expected newLocale to be a string; got ${inferType(e)}`);const a=this._locale!==e;this._locale=e,a&&this.hasChanged()}get defaultLocale(){return this._defaultLocale||"en"}set defaultLocale(e){if(typeof e!="string")throw new Error(`Expected newLocale to be a string; got ${inferType(e)}`);const a=this._defaultLocale!==e;this._defaultLocale=e,a&&this.hasChanged()}translate(e,a){a=Object.assign({},a);const n=createTranslationOptions(this,e,a);let r;return n.some(o=>(isSet(o.scope)?r=lookup(this,o.scope,a):isSet(o.message)&&(r=o.message),r!=null))?(typeof r=="string"?r=this.interpolate(this,r,a):typeof r=="object"&&r&&isSet(a.count)&&(r=pluralize({i18n:this,count:a.count||0,scope:r,options:a,baseScope:getFullScope(this,e,a)})),a&&r instanceof Array&&(r=r.map(o=>typeof o=="string"?interpolate(this,o,a):o)),r):this.missingTranslation.get(e,a)}pluralize(e,a,n){return pluralize({i18n:this,count:e,scope:a,options:Object.assign({},n),baseScope:getFullScope(this,a,n??{})})}localize(e,a,n){if(n=Object.assign({},n),a==null)return"";switch(e){case"currency":return this.numberToCurrency(a);case"number":return formatNumber(a,Object.assign({delimiter:",",precision:3,separator:".",significant:!1,stripInsignificantZeros:!1},lookup(this,"number.format")));case"percentage":return this.numberToPercentage(a);default:{let r;return e.match(/^(date|time)/)?r=this.toTime(e,a):r=a.toString(),interpolate(this,r,n)}}}toTime(e,a){const n=parseDate(a),r=lookup(this,e);return n.toString().match(/invalid/i)||!r?n.toString():this.strftime(n,r)}numberToCurrency(e,a={}){return formatNumber(e,Object.assign(Object.assign(Object.assign({delimiter:",",format:"%u%n",precision:2,separator:".",significant:!1,stripInsignificantZeros:!1,unit:"$"},camelCaseKeys(this.get("number.format"))),camelCaseKeys(this.get("number.currency.format"))),a))}numberToPercentage(e,a={}){return formatNumber(e,Object.assign(Object.assign(Object.assign({delimiter:"",format:"%n%",precision:3,stripInsignificantZeros:!1,separator:".",significant:!1},camelCaseKeys(this.get("number.format"))),camelCaseKeys(this.get("number.percentage.format"))),a))}numberToHumanSize(e,a={}){return numberToHumanSize(this,e,Object.assign(Object.assign(Object.assign({delimiter:"",precision:3,significant:!0,stripInsignificantZeros:!0,units:{billion:"Billion",million:"Million",quadrillion:"Quadrillion",thousand:"Thousand",trillion:"Trillion",unit:""}},camelCaseKeys(this.get("number.human.format"))),camelCaseKeys(this.get("number.human.storage_units"))),a))}numberToHuman(e,a={}){return numberToHuman(this,e,Object.assign(Object.assign(Object.assign({delimiter:"",separator:".",precision:3,significant:!0,stripInsignificantZeros:!0,format:"%n %u",roundMode:"default",units:{billion:"Billion",million:"Million",quadrillion:"Quadrillion",thousand:"Thousand",trillion:"Trillion",unit:""}},camelCaseKeys(this.get("number.human.format"))),camelCaseKeys(this.get("number.human.decimal_units"))),a))}numberToRounded(e,a){return formatNumber(e,Object.assign({unit:"",precision:3,significant:!1,separator:".",delimiter:"",stripInsignificantZeros:!1},a))}numberToDelimited(e,a={}){return numberToDelimited(e,Object.assign({delimiterPattern:/(\d)(?=(\d\d\d)+(?!\d))/g,delimiter:",",separator:"."},a))}withLocale(e,a){return __awaiter(this,void 0,void 0,function*(){const n=this.locale;try{this.locale=e,yield a()}finally{this.locale=n}})}strftime(e,a,n={}){return strftime(e,a,Object.assign(Object.assign(Object.assign({},camelCaseKeys(lookup(this,"date"))),{meridian:{am:lookup(this,"time.am")||"AM",pm:lookup(this,"time.pm")||"PM"}}),n))}update(e,a,n={strict:!1}){if(n.strict&&!has$1(this.translations,e))throw new Error(`The path "${e}" is not currently defined`);const r=get$2(this.translations,e),i=inferType(r),o=inferType(a);if(n.strict&&i!==o)throw new Error(`The current type for "${e}" is "${i}", but you're trying to override it with "${o}"`);let s;o==="object"?s=Object.assign(Object.assign({},r),a):s=a,set$1(this.translations,e,s),this.hasChanged()}toSentence(e,a={}){const{wordsConnector:n,twoWordsConnector:r,lastWordConnector:i}=Object.assign(Object.assign({wordsConnector:", ",twoWordsConnector:" and ",lastWordConnector:", and "},camelCaseKeys(lookup(this,"support.array"))),a),o=e.length;switch(o){case 0:return"";case 1:return`${e[0]}`;case 2:return e.join(r);default:return[e.slice(0,o-1).join(n),i,e[o-1]].join("")}}timeAgoInWords(e,a,n={}){return timeAgoInWords(this,e,a,n)}onChange(e){return this.onChangeHandlers.push(e),()=>{this.onChangeHandlers.splice(this.onChangeHandlers.indexOf(e),1)}}get version(){return this._version}formatNumber(e,a){return formatNumber(e,a)}get(e){return lookup(this,e)}runCallbacks(){this.onChangeHandlers.forEach(e=>e(this))}hasChanged(){this._version+=1,this.runCallbacks()}}async function loadTranslations(t,e){const n=await(await fetch(`./v2/i18n/${e}.json`)).json();t.store(n)}let currencies$1=[],chart$3=null,chartData$1=null,afterPromises$4=!1,i18n$3;const CACHE_KEY$4="dashboard-budgets-chart",budgets=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,chartData$1!==null){this.drawChart(this.generateOptions(chartData$1)),this.loading=!1;return}this.getFreshData()}},drawChart(t){if(chart$3!==null){chart$3.data.datasets=t.data.datasets,chart$3.update();return}chart$3=new Chart(document.querySelector("#budget-chart"),t)},getFreshData(){const t=window.store.get("cacheValid");let e=window.store.get(CACHE_KEY$4);if(t&&typeof e<"u"){chartData$1=e,this.drawChart(this.generateOptions(chartData$1)),this.loading=!1;return}new Dashboard$1().dashboard(new Date(window.store.get("start")),new Date(window.store.get("end")),null).then(n=>{chartData$1=n.data,this.drawChart(this.generateOptions(chartData$1)),window.store.set(CACHE_KEY$4,chartData$1),this.loading=!1})},generateOptions(t){currencies$1=[];let e=getDefaultChartSettings("column");e.options.locale=window.store.get("locale").replace("_","-"),e.options.plugins={tooltip:{callbacks:{title:function(a){return a.label},label:function(a){let n=a.dataset.label||"";return n&&(n+=": "),n+" "+formatMoney(a.parsed.y,currencies$1[a.parsed.x]??"EUR")}}}},e.data={labels:[],datasets:[{label:i18n$3.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:getColors("spent","background"),borderColor:getColors("spent","border")},{label:i18n$3.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:getColors("left","background"),borderColor:getColors("left","border")},{label:i18n$3.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:getColors("overspent","background"),borderColor:getColors("overspent","border")}]};for(const a in t)if(t.hasOwnProperty(a)){let n=t[a],r=n.label+" ("+n.currency_code+")";e.data.labels.push(r),this.autoConversion&&(currencies$1.push(n.native_code),e.data.datasets[0].data.push(parseFloat(n.native_entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(n.native_entries.left)),e.data.datasets[2].data.push(parseFloat(n.native_entries.overspent))),this.autoConversion||(currencies$1.push(n.currency_code),e.data.datasets[0].data.push(parseFloat(n.entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(n.entries.left)),e.data.datasets[2].data.push(parseFloat(n.entries.overspent)))}return e.options.scales={y:{ticks:{callback:function(a){return formatMoney(a,currencies$1[0])}}}},e},init(){Promise.all([getVariable("autoConversion",!1),getVariable("language","en-US")]).then(t=>{i18n$3=new I18n,i18n$3.locale=t[1],loadTranslations(i18n$3,t[1]).then(()=>{this.autoConversion=t[0],afterPromises$4=!0,this.loading===!1&&this.loadChart()})}),window.store.observe("end",()=>{afterPromises$4&&this.loading===!1&&(chartData$1=null,this.loadChart())}),window.store.observe("autoConversion",t=>{afterPromises$4&&(this.autoConversion=t,this.loading===!1&&this.loadChart())})}});class Dashboard{dashboard(e,a){let n=format$1(e,"y-MM-dd"),r=format$1(a,"y-MM-dd");return api.get("/api/v2/chart/category/dashboard",{params:{start:n,end:r}})}}let currencies=[],chart$2=null,chartData=null,afterPromises$3=!1;const CACHE_KEY$3="dashboard-categories-chart",categories=()=>({loading:!1,autoConversion:!1,generateOptions(t){currencies=[];let e=getDefaultChartSettings("column"),a={};for(const r in t)if(t.hasOwnProperty(r)){let i=t[r],o=i.currency_code;this.autoConversion&&(o=i.native_code),a.hasOwnProperty(o)||(a[o]={name:o,yAxisID:"",data:{}},currencies.push(o))}for(const r in t)if(t.hasOwnProperty(r)){let i=t[r],o=i.currency_code;this.autoConversion&&(o=i.native_code);for(const s in a)if(a.hasOwnProperty(s)){let l=0;o===s&&(l=parseFloat(i.amount),""+i.currency_code,this.autoConversion&&(l=parseFloat(i.native_amount),""+i.native_code)),a[s].data.hasOwnProperty(i.label)&&(a[s].data[i.label]=a[s].data[i.label]+l),a[s].data.hasOwnProperty(i.label)||(a[s].data[i.label]=l)}e.data.labels.includes(i.label)||e.data.labels.push(i.label)}let n=0;for(const r in a){console.log("series");let i="y"+r,o={label:r,currency_code:r,yAxisID:i,data:[]};for(const s in a[r].data)o.data.push(a[r].data[s]);e.data.datasets.push(o),e.options.scales.hasOwnProperty(i)||(e.options.scales[i]={beginAtZero:!0,type:"linear",position:n===1?"right":"left",ticks:{callback:function(s,l,u){return formatMoney(s,r)}}},n++)}return e},drawChart(t){if(chart$2!==null){chart$2.options=t.options,chart$2.data=t.data,chart$2.update();return}chart$2=new Chart(document.querySelector("#category-chart"),t)},getFreshData(){const t=window.store.get("cacheValid");let e=window.store.get(CACHE_KEY$3);if(t&&typeof e<"u"){chartData=e,this.drawChart(this.generateOptions(chartData)),this.loading=!1;return}new Dashboard().dashboard(new Date(window.store.get("start")),new Date(window.store.get("end")),null).then(n=>{chartData=n.data,this.drawChart(this.generateOptions(n.data)),window.store.set(CACHE_KEY$3,chartData),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,chartData!==null){this.drawChart(this.generateOptions(chartData)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([getVariable("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],afterPromises$3=!0,this.loadChart()}),window.store.observe("end",()=>{afterPromises$3&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",t=>{afterPromises$3&&(this.autoConversion=t,this.loadChart())})}});let Get$2=class{get(e){return api.get("/api/v2/transactions",{params:e})}};/*!
+`):t}function createTooltipItem(t,e){const{element:a,datasetIndex:n,index:r}=e,i=t.getDatasetMeta(n).controller,{label:o,value:s}=i.getLabelAndValue(r);return{chart:t,label:o,parsed:i.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:s,dataset:i.getDataset(),dataIndex:r,datasetIndex:n,element:a}}function getTooltipSize(t,e){const a=t.chart.ctx,{body:n,footer:r,title:i}=t,{boxWidth:o,boxHeight:s}=e,l=toFont(e.bodyFont),u=toFont(e.titleFont),c=toFont(e.footerFont),d=i.length,h=r.length,m=n.length,p=toPadding(e.padding);let v=p.height,y=0,w=n.reduce((k,O)=>k+O.before.length+O.lines.length+O.after.length,0);if(w+=t.beforeBody.length+t.afterBody.length,d&&(v+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),w){const k=e.displayColors?Math.max(s,l.lineHeight):l.lineHeight;v+=m*k+(w-m)*l.lineHeight+(w-1)*e.bodySpacing}h&&(v+=e.footerMarginTop+h*c.lineHeight+(h-1)*e.footerSpacing);let _=0;const D=function(k){y=Math.max(y,a.measureText(k).width+_)};return a.save(),a.font=u.string,each(t.title,D),a.font=l.string,each(t.beforeBody.concat(t.afterBody),D),_=e.displayColors?o+2+e.boxPadding:0,each(n,k=>{each(k.before,D),each(k.lines,D),each(k.after,D)}),_=0,a.font=c.string,each(t.footer,D),a.restore(),y+=p.width,{width:y,height:v}}function determineYAlign(t,e){const{y:a,height:n}=e;return a<n/2?"top":a>t.height-n/2?"bottom":"center"}function doesNotFitWithAlign(t,e,a,n){const{x:r,width:i}=n,o=a.caretSize+a.caretPadding;if(t==="left"&&r+i+o>e.width||t==="right"&&r-i-o<0)return!0}function determineXAlign(t,e,a,n){const{x:r,width:i}=a,{width:o,chartArea:{left:s,right:l}}=t;let u="center";return n==="center"?u=r<=(s+l)/2?"left":"right":r<=i/2?u="left":r>=o-i/2&&(u="right"),doesNotFitWithAlign(u,t,e,a)&&(u="center"),u}function determineAlignment(t,e,a){const n=a.yAlign||e.yAlign||determineYAlign(t,a);return{xAlign:a.xAlign||e.xAlign||determineXAlign(t,e,a,n),yAlign:n}}function alignX(t,e){let{x:a,width:n}=t;return e==="right"?a-=n:e==="center"&&(a-=n/2),a}function alignY(t,e,a){let{y:n,height:r}=t;return e==="top"?n+=a:e==="bottom"?n-=r+a:n-=r/2,n}function getBackgroundPoint(t,e,a,n){const{caretSize:r,caretPadding:i,cornerRadius:o}=t,{xAlign:s,yAlign:l}=a,u=r+i,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:m}=toTRBLCorners(o);let p=alignX(e,s);const v=alignY(e,l,u);return l==="center"?s==="left"?p+=u:s==="right"&&(p-=u):s==="left"?p-=Math.max(c,h)+r:s==="right"&&(p+=Math.max(d,m)+r),{x:_limitValue(p,0,n.width-e.width),y:_limitValue(v,0,n.height-e.height)}}function getAlignedX(t,e,a){const n=toPadding(a.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-n.right:t.x+n.left}function getBeforeAfterBodyLines(t){return pushOrConcat([],splitNewlines(t))}function createTooltipContext(t,e,a){return createContext(t,{tooltip:e,tooltipItems:a,type:"tooltip"})}function overrideCallbacks(t,e){const a=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return a?t.override(a):t}const defaultCallbacks={beforeTitle:noop$2,title(t){if(t.length>0){const e=t[0],a=e.chart.data.labels,n=a?a.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return a[e.dataIndex]}return""},afterTitle:noop$2,beforeBody:noop$2,beforeLabel:noop$2,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const a=t.formattedValue;return isNullOrUndef(a)||(e+=a),e},labelColor(t){const a=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:a.borderColor,backgroundColor:a.backgroundColor,borderWidth:a.borderWidth,borderDash:a.borderDash,borderDashOffset:a.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const a=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:a.pointStyle,rotation:a.rotation}},afterLabel:noop$2,afterBody:noop$2,beforeFooter:noop$2,footer:noop$2,afterFooter:noop$2};function invokeCallbackWithFallback(t,e,a,n){const r=t[e].call(a,n);return typeof r>"u"?defaultCallbacks[e].call(a,n):r}class Tooltip extends Element$1{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const a=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&a.options.animation&&n.animations,i=new Animations(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,a){const{callbacks:n}=a,r=invokeCallbackWithFallback(n,"beforeTitle",this,e),i=invokeCallbackWithFallback(n,"title",this,e),o=invokeCallbackWithFallback(n,"afterTitle",this,e);let s=[];return s=pushOrConcat(s,splitNewlines(r)),s=pushOrConcat(s,splitNewlines(i)),s=pushOrConcat(s,splitNewlines(o)),s}getBeforeBody(e,a){return getBeforeAfterBodyLines(invokeCallbackWithFallback(a.callbacks,"beforeBody",this,e))}getBody(e,a){const{callbacks:n}=a,r=[];return each(e,i=>{const o={before:[],lines:[],after:[]},s=overrideCallbacks(n,i);pushOrConcat(o.before,splitNewlines(invokeCallbackWithFallback(s,"beforeLabel",this,i))),pushOrConcat(o.lines,invokeCallbackWithFallback(s,"label",this,i)),pushOrConcat(o.after,splitNewlines(invokeCallbackWithFallback(s,"afterLabel",this,i))),r.push(o)}),r}getAfterBody(e,a){return getBeforeAfterBodyLines(invokeCallbackWithFallback(a.callbacks,"afterBody",this,e))}getFooter(e,a){const{callbacks:n}=a,r=invokeCallbackWithFallback(n,"beforeFooter",this,e),i=invokeCallbackWithFallback(n,"footer",this,e),o=invokeCallbackWithFallback(n,"afterFooter",this,e);let s=[];return s=pushOrConcat(s,splitNewlines(r)),s=pushOrConcat(s,splitNewlines(i)),s=pushOrConcat(s,splitNewlines(o)),s}_createItems(e){const a=this._active,n=this.chart.data,r=[],i=[],o=[];let s=[],l,u;for(l=0,u=a.length;l<u;++l)s.push(createTooltipItem(this.chart,a[l]));return e.filter&&(s=s.filter((c,d,h)=>e.filter(c,d,h,n))),e.itemSort&&(s=s.sort((c,d)=>e.itemSort(c,d,n))),each(s,c=>{const d=overrideCallbacks(e.callbacks,c);r.push(invokeCallbackWithFallback(d,"labelColor",this,c)),i.push(invokeCallbackWithFallback(d,"labelPointStyle",this,c)),o.push(invokeCallbackWithFallback(d,"labelTextColor",this,c))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=s,s}update(e,a){const n=this.options.setContext(this.getContext()),r=this._active;let i,o=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{const s=positioners[n.position].call(this,r,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=getTooltipSize(this,n),u=Object.assign({},s,l),c=determineAlignment(this.chart,n,u),d=getBackgroundPoint(n,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:a})}drawCaret(e,a,n,r){const i=this.getCaretPosition(e,n,r);a.lineTo(i.x1,i.y1),a.lineTo(i.x2,i.y2),a.lineTo(i.x3,i.y3)}getCaretPosition(e,a,n){const{xAlign:r,yAlign:i}=this,{caretSize:o,cornerRadius:s}=n,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=toTRBLCorners(s),{x:h,y:m}=e,{width:p,height:v}=a;let y,w,_,D,k,O;return i==="center"?(k=m+v/2,r==="left"?(y=h,w=y-o,D=k+o,O=k-o):(y=h+p,w=y+o,D=k-o,O=k+o),_=y):(r==="left"?w=h+Math.max(l,c)+o:r==="right"?w=h+p-Math.max(u,d)-o:w=this.caretX,i==="top"?(D=m,k=D-o,y=w-o,_=w+o):(D=m+v,k=D+o,y=w+o,_=w-o),O=D),{x1:y,x2:w,x3:_,y1:D,y2:k,y3:O}}drawTitle(e,a,n){const r=this.title,i=r.length;let o,s,l;if(i){const u=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.titleAlign,n),a.textAlign=u.textAlign(n.titleAlign),a.textBaseline="middle",o=toFont(n.titleFont),s=n.titleSpacing,a.fillStyle=n.titleColor,a.font=o.string,l=0;l<i;++l)a.fillText(r[l],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+s,l+1===i&&(e.y+=n.titleMarginBottom-s)}}_drawColorBox(e,a,n,r,i){const o=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:l,boxWidth:u}=i,c=toFont(i.bodyFont),d=getAlignedX(this,"left",i),h=r.x(d),m=l<c.lineHeight?(c.lineHeight-l)/2:0,p=a.y+m;if(i.usePointStyle){const v={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},y=r.leftForLtr(h,u)+u/2,w=p+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,drawPoint(e,v,y,w),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,drawPoint(e,v,y,w)}else{e.lineWidth=isObject$8(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const v=r.leftForLtr(h,u),y=r.leftForLtr(r.xPlus(h,1),u-2),w=toTRBLCorners(o.borderRadius);Object.values(w).some(_=>_!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,addRoundedRectPath(e,{x:v,y:p,w:u,h:l,radius:w}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:y,y:p+1,w:u-2,h:l-2,radius:w}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(v,p,u,l),e.strokeRect(v,p,u,l),e.fillStyle=o.backgroundColor,e.fillRect(y,p+1,u-2,l-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,a,n){const{body:r}=this,{bodySpacing:i,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:c}=n,d=toFont(n.bodyFont);let h=d.lineHeight,m=0;const p=getRtlAdapter(n.rtl,this.x,this.width),v=function(g){a.fillText(g,p.x(e.x+m),e.y+h/2),e.y+=h+i},y=p.textAlign(o);let w,_,D,k,O,N,F;for(a.textAlign=o,a.textBaseline="middle",a.font=d.string,e.x=getAlignedX(this,y,n),a.fillStyle=n.bodyColor,each(this.beforeBody,v),m=s&&y!=="right"?o==="center"?u/2+c:u+2+c:0,k=0,N=r.length;k<N;++k){for(w=r[k],_=this.labelTextColors[k],a.fillStyle=_,each(w.before,v),D=w.lines,s&&D.length&&(this._drawColorBox(a,e,k,p,n),h=Math.max(d.lineHeight,l)),O=0,F=D.length;O<F;++O)v(D[O]),h=d.lineHeight;each(w.after,v)}m=0,h=d.lineHeight,each(this.afterBody,v),e.y-=i}drawFooter(e,a,n){const r=this.footer,i=r.length;let o,s;if(i){const l=getRtlAdapter(n.rtl,this.x,this.width);for(e.x=getAlignedX(this,n.footerAlign,n),e.y+=n.footerMarginTop,a.textAlign=l.textAlign(n.footerAlign),a.textBaseline="middle",o=toFont(n.footerFont),a.fillStyle=n.footerColor,a.font=o.string,s=0;s<i;++s)a.fillText(r[s],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+n.footerSpacing}}drawBackground(e,a,n,r){const{xAlign:i,yAlign:o}=this,{x:s,y:l}=e,{width:u,height:c}=n,{topLeft:d,topRight:h,bottomLeft:m,bottomRight:p}=toTRBLCorners(r.cornerRadius);a.fillStyle=r.backgroundColor,a.strokeStyle=r.borderColor,a.lineWidth=r.borderWidth,a.beginPath(),a.moveTo(s+d,l),o==="top"&&this.drawCaret(e,a,n,r),a.lineTo(s+u-h,l),a.quadraticCurveTo(s+u,l,s+u,l+h),o==="center"&&i==="right"&&this.drawCaret(e,a,n,r),a.lineTo(s+u,l+c-p),a.quadraticCurveTo(s+u,l+c,s+u-p,l+c),o==="bottom"&&this.drawCaret(e,a,n,r),a.lineTo(s+m,l+c),a.quadraticCurveTo(s,l+c,s,l+c-m),o==="center"&&i==="left"&&this.drawCaret(e,a,n,r),a.lineTo(s,l+d),a.quadraticCurveTo(s,l,s+d,l),a.closePath(),a.fill(),r.borderWidth>0&&a.stroke()}_updateAnimationTarget(e){const a=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){const o=positioners[e.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=getTooltipSize(this,e),l=Object.assign({},o,this._size),u=determineAlignment(a,e,l),c=getBackgroundPoint(e,l,u,a);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const a=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(a);const r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=toPadding(a.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;a.enabled&&s&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,a),overrideTextDirection(e,a.textDirection),i.y+=o.top,this.drawTitle(i,e,a),this.drawBody(i,e,a),this.drawFooter(i,e,a),restoreTextDirection(e,a.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,a){const n=this._active,r=e.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),i=!_elementsEqual(n,r),o=this._positionChanged(r,a);(i||o)&&(this._active=r,this._eventPosition=a,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,a,n=!0){if(a&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,i=this._active||[],o=this._getActiveElements(e,i,a,n),s=this._positionChanged(o,e),l=a||!_elementsEqual(o,i)||s;return l&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,a))),l}_getActiveElements(e,a,n,r){const i=this.options;if(e.type==="mouseout")return[];if(!r)return a;const o=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&o.reverse(),o}_positionChanged(e,a){const{caretX:n,caretY:r,options:i}=this,o=positioners[i.position].call(this,e,a);return o!==!1&&(n!==o.x||r!==o.y)}}R(Tooltip,"positioners",positioners);var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(t,e,a){a&&(t.tooltip=new Tooltip({chart:t,options:a}))},beforeUpdate(t,e,a){t.tooltip&&t.tooltip.initialize(a)},reset(t,e,a){t.tooltip&&t.tooltip.initialize(a)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const a={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...a,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",a)}},afterEvent(t,e){if(t.tooltip){const a=e.replay;t.tooltip.handleEvent(e.event,a,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:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(t,e,a,n)=>(typeof e=="string"?(a=t.push(e)-1,n.unshift({index:a,label:e})):isNaN(e)&&(a=null),a);function findOrAddLabel(t,e,a,n){const r=t.indexOf(e);if(r===-1)return addIfString(t,e,a,n);const i=t.lastIndexOf(e);return r!==i?a:r}const validIndex=(t,e)=>t===null?null:_limitValue(Math.round(t),0,e);function _getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class CategoryScale extends Scale{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const a=this._addedLabels;if(a.length){const n=this.getLabels();for(const{index:r,label:i}of a)n[r]===i&&n.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,a){if(isNullOrUndef(e))return null;const n=this.getLabels();return a=isFinite(a)&&n[a]===e?a:findOrAddLabel(n,e,valueOrDefault(a,e),this._addedLabels),validIndex(a,n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:a}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(n=0),a||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const e=this.min,a=this.max,n=this.options.offset,r=[];let i=this.getLabels();i=e===0&&a===i.length-1?i:i.slice(e,a+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=e;o<=a;o++)r.push({value:o});return r}getLabelForValue(e){return _getLabelForValue.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const a=this.ticks;return e<0||e>a.length-1?null:this.getPixelForValue(a[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}R(CategoryScale,"id","category"),R(CategoryScale,"defaults",{ticks:{callback:_getLabelForValue}});function generateTicks$1(t,e){const a=[],{bounds:r,step:i,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:h}=t,m=i||1,p=c-1,{min:v,max:y}=e,w=!isNullOrUndef(o),_=!isNullOrUndef(s),D=!isNullOrUndef(u),k=(y-v)/(d+1);let O=niceNum((y-v)/p/m)*m,N,F,g,b;if(O<1e-14&&!w&&!_)return[{value:v},{value:y}];b=Math.ceil(y/O)-Math.floor(v/O),b>p&&(O=niceNum(b*O/p/m)*m),isNullOrUndef(l)||(N=Math.pow(10,l),O=Math.ceil(O*N)/N),r==="ticks"?(F=Math.floor(v/O)*O,g=Math.ceil(y/O)*O):(F=v,g=y),w&&_&&i&&almostWhole((s-o)/i,O/1e3)?(b=Math.round(Math.min((s-o)/O,c)),O=(s-o)/b,F=o,g=s):D?(F=w?o:F,g=_?s:g,b=u-1,O=(g-F)/b):(b=(g-F)/O,almostEquals(b,Math.round(b),O/1e3)?b=Math.round(b):b=Math.ceil(b));const $=Math.max(_decimalPlaces(O),_decimalPlaces(F));N=Math.pow(10,isNullOrUndef(l)?$:l),F=Math.round(F*N)/N,g=Math.round(g*N)/N;let S=0;for(w&&(h&&F!==o?(a.push({value:o}),F<o&&S++,almostEquals(Math.round((F+S*O)*N)/N,o,relativeLabelSize(o,k,t))&&S++):F<o&&S++);S<b;++S){const P=Math.round((F+S*O)*N)/N;if(_&&P>s)break;a.push({value:P})}return _&&h&&g!==s?a.length&&almostEquals(a[a.length-1].value,s,relativeLabelSize(s,k,t))?a[a.length-1].value=s:a.push({value:s}):(!_||g===s)&&a.push({value:g}),a}function relativeLabelSize(t,e,{horizontal:a,minRotation:n}){const r=toRadians(n),i=(a?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/i,o)}class LinearScaleBase extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,a){return isNullOrUndef(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:a,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this;const o=l=>r=a?r:l,s=l=>i=n?i:l;if(e){const l=sign(r),u=sign(i);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(r===i){let l=i===0?1:Math.abs(i*.05);s(i+l),e||o(r-l)}this.min=r,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:a,stepSize:n}=e,r;return n?(r=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),a=a||11),a&&(r=Math.min(a,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,a=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r={maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:a.precision,step:a.stepSize,count:a.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:a.minRotation||0,includeBounds:a.includeBounds!==!1},i=this._range||this,o=generateTicks$1(r,i);return e.bounds==="ticks"&&_setMinAndMaxByKey(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let a=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const r=(n-a)/Math.max(e.length-1,1)/2;a-=r,n+=r}this._startValue=a,this._endValue=n,this._valueRange=n-a}getLabelForValue(e){return formatNumber$1(e,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:e,max:a}=this.getMinMax(!0);this.min=isNumberFinite(e)?e:0,this.max=isNumberFinite(a)?a:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),a=e?this.width:this.height,n=toRadians(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(a/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}R(LinearScale,"id","linear"),R(LinearScale,"defaults",{ticks:{callback:Ticks.formatters.numeric}});const log10Floor=t=>Math.floor(log10(t)),changeExponent=(t,e)=>Math.pow(10,log10Floor(t)+e);function isMajor(t){return t/Math.pow(10,log10Floor(t))===1}function steps(t,e,a){const n=Math.pow(10,a),r=Math.floor(t/n);return Math.ceil(e/n)-r}function startExp(t,e){const a=e-t;let n=log10Floor(a);for(;steps(t,e,n)>10;)n++;for(;steps(t,e,n)<10;)n--;return Math.min(n,log10Floor(t))}function generateTicks(t,{min:e,max:a}){e=finiteOrDefault(t.min,e);const n=[],r=log10Floor(e);let i=startExp(e,a),o=i<0?Math.pow(10,Math.abs(i)):1;const s=Math.pow(10,i),l=r>i?Math.pow(10,r):0,u=Math.round((e-l)*o)/o,c=Math.floor((e-l)/s/10)*s*10;let d=Math.floor((u-c)/Math.pow(10,i)),h=finiteOrDefault(t.min,Math.round((l+c+d*Math.pow(10,i))*o)/o);for(;h<a;)n.push({value:h,major:isMajor(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,o=i>=0?1:o),h=Math.round((l+c+d*Math.pow(10,i))*o)/o;const m=finiteOrDefault(t.max,h);return n.push({value:m,major:isMajor(m),significand:d}),n}class LogarithmicScale extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,a){const n=LinearScaleBase.prototype.parse.apply(this,[e,a]);if(n===0){this._zero=!0;return}return isNumberFinite(n)&&n>0?n:null}determineDataLimits(){const{min:e,max:a}=this.getMinMax(!0);this.min=isNumberFinite(e)?Math.max(0,e):null,this.max=isNumberFinite(a)?Math.max(0,a):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!isNumberFinite(this._userMin)&&(this.min=e===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:a}=this.getUserBounds();let n=this.min,r=this.max;const i=s=>n=e?n:s,o=s=>r=a?r:s;n===r&&(n<=0?(i(1),o(10)):(i(changeExponent(n,-1)),o(changeExponent(r,1)))),n<=0&&i(changeExponent(r,-1)),r<=0&&o(changeExponent(n,1)),this.min=n,this.max=r}buildTicks(){const e=this.options,a={min:this._userMin,max:this._userMax},n=generateTicks(a,this);return e.bounds==="ticks"&&_setMinAndMaxByKey(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(e){return e===void 0?"0":formatNumber$1(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=log10(e),this._valueRange=log10(this.max)-log10(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(log10(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const a=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+a*this._valueRange)}}R(LogarithmicScale,"id","logarithmic"),R(LogarithmicScale,"defaults",{ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}});function getTickBackdropHeight(t){const e=t.ticks;if(e.display&&t.display){const a=toPadding(e.backdropPadding);return valueOrDefault(e.font&&e.font.size,defaults.font.size)+a.height}return 0}function measureLabelSize(t,e,a){return a=isArray$c(a)?a:[a],{w:_longestText(t,e.string,a),h:a.length*e.lineHeight}}function determineLimits(t,e,a,n,r){return t===n||t===r?{start:e-a/2,end:e+a/2}:t<n||t>r?{start:e-a,end:e}:{start:e,end:e+a}}function fitWithPointLabels(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},a=Object.assign({},e),n=[],r=[],i=t._pointLabels.length,o=t.options.pointLabels,s=o.centerPointLabels?PI/i:0;for(let l=0;l<i;l++){const u=o.setContext(t.getPointLabelContext(l));r[l]=u.padding;const c=t.getPointPosition(l,t.drawingArea+r[l],s),d=toFont(u.font),h=measureLabelSize(t.ctx,d,t._pointLabels[l]);n[l]=h;const m=_normalizeAngle(t.getIndexAngle(l)+s),p=Math.round(toDegrees(m)),v=determineLimits(p,c.x,h.w,0,180),y=determineLimits(p,c.y,h.h,90,270);updateLimits(a,e,m,v,y)}t.setCenterPoint(e.l-a.l,a.r-e.r,e.t-a.t,a.b-e.b),t._pointLabelItems=buildPointLabelItems(t,n,r)}function updateLimits(t,e,a,n,r){const i=Math.abs(Math.sin(a)),o=Math.abs(Math.cos(a));let s=0,l=0;n.start<e.l?(s=(e.l-n.start)/i,t.l=Math.min(t.l,e.l-s)):n.end>e.r&&(s=(n.end-e.r)/i,t.r=Math.max(t.r,e.r+s)),r.start<e.t?(l=(e.t-r.start)/o,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function createPointLabelItem(t,e,a){const n=t.drawingArea,{extra:r,additionalAngle:i,padding:o,size:s}=a,l=t.getPointPosition(e,n+r+o,i),u=Math.round(toDegrees(_normalizeAngle(l.angle+HALF_PI))),c=yForAngle(l.y,s.h,u),d=getTextAlignForAngle(u),h=leftForTextAlign(l.x,s.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:h,top:c,right:h+s.w,bottom:c+s.h}}function isNotOverlapped(t,e){if(!e)return!0;const{left:a,top:n,right:r,bottom:i}=t;return!(_isPointInArea({x:a,y:n},e)||_isPointInArea({x:a,y:i},e)||_isPointInArea({x:r,y:n},e)||_isPointInArea({x:r,y:i},e))}function buildPointLabelItems(t,e,a){const n=[],r=t._pointLabels.length,i=t.options,{centerPointLabels:o,display:s}=i.pointLabels,l={extra:getTickBackdropHeight(i)/2,additionalAngle:o?PI/r:0};let u;for(let c=0;c<r;c++){l.padding=a[c],l.size=e[c];const d=createPointLabelItem(t,c,l);n.push(d),s==="auto"&&(d.visible=isNotOverlapped(d,u),d.visible&&(u=d))}return n}function getTextAlignForAngle(t){return t===0||t===180?"center":t<180?"left":"right"}function leftForTextAlign(t,e,a){return a==="right"?t-=e:a==="center"&&(t-=e/2),t}function yForAngle(t,e,a){return a===90||a===270?t-=e/2:(a>270||a<90)&&(t-=e),t}function drawPointLabelBox(t,e,a){const{left:n,top:r,right:i,bottom:o}=a,{backdropColor:s}=e;if(!isNullOrUndef(s)){const l=toTRBLCorners(e.borderRadius),u=toPadding(e.backdropPadding);t.fillStyle=s;const c=n-u.left,d=r-u.top,h=i-n+u.width,m=o-r+u.height;Object.values(l).some(p=>p!==0)?(t.beginPath(),addRoundedRectPath(t,{x:c,y:d,w:h,h:m,radius:l}),t.fill()):t.fillRect(c,d,h,m)}}function drawPointLabels(t,e){const{ctx:a,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){const i=t._pointLabelItems[r];if(!i.visible)continue;const o=n.setContext(t.getPointLabelContext(r));drawPointLabelBox(a,o,i);const s=toFont(o.font),{x:l,y:u,textAlign:c}=i;renderText(a,t._pointLabels[r],l,u+s.lineHeight/2,s,{color:o.color,textAlign:c,textBaseline:"middle"})}}function pathRadiusLine(t,e,a,n){const{ctx:r}=t;if(a)r.arc(t.xCenter,t.yCenter,e,0,TAU);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let o=1;o<n;o++)i=t.getPointPosition(o,e),r.lineTo(i.x,i.y)}}function drawRadiusLine(t,e,a,n,r){const i=t.ctx,o=e.circular,{color:s,lineWidth:l}=e;!o&&!n||!s||!l||a<0||(i.save(),i.strokeStyle=s,i.lineWidth=l,i.setLineDash(r.dash),i.lineDashOffset=r.dashOffset,i.beginPath(),pathRadiusLine(t,a,o,n),i.closePath(),i.stroke(),i.restore())}function createPointLabelContext(t,e,a){return createContext(t,{label:a,index:e,type:"pointLabel"})}class RadialLinearScale extends LinearScaleBase{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=toPadding(getTickBackdropHeight(this.options)/2),a=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+a/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(a,n)/2)}determineDataLimits(){const{min:e,max:a}=this.getMinMax(!1);this.min=isNumberFinite(e)&&!isNaN(e)?e:0,this.max=isNumberFinite(a)&&!isNaN(a)?a:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(e){LinearScaleBase.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((a,n)=>{const r=callback(this.options.pointLabels.callback,[a,n],this);return r||r===0?r:""}).filter((a,n)=>this.chart.getDataVisibility(n))}fit(){const e=this.options;e.display&&e.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,a,n,r){this.xCenter+=Math.floor((e-a)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,a,n,r))}getIndexAngle(e){const a=TAU/(this._pointLabels.length||1),n=this.options.startAngle||0;return _normalizeAngle(e*a+toRadians(n))}getDistanceFromCenterForValue(e){if(isNullOrUndef(e))return NaN;const a=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*a:(e-this.min)*a}getValueForDistanceFromCenter(e){if(isNullOrUndef(e))return NaN;const a=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-a:this.min+a}getPointLabelContext(e){const a=this._pointLabels||[];if(e>=0&&e<a.length){const n=a[e];return createPointLabelContext(this.getContext(),e,n)}}getPointPosition(e,a,n=0){const r=this.getIndexAngle(e)-HALF_PI+n;return{x:Math.cos(r)*a+this.xCenter,y:Math.sin(r)*a+this.yCenter,angle:r}}getPointPositionForValue(e,a){return this.getPointPosition(e,this.getDistanceFromCenterForValue(a))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:a,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:a,top:n,right:r,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:a}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),a,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,a=this.options,{angleLines:n,grid:r,border:i}=a,o=this._pointLabels.length;let s,l,u;if(a.pointLabels.display&&drawPointLabels(this,o),r.display&&this.ticks.forEach((c,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(c.value);const h=this.getContext(d),m=r.setContext(h),p=i.setContext(h);drawRadiusLine(this,m,l,o,p)}}),n.display){for(e.save(),s=o-1;s>=0;s--){const c=n.setContext(this.getPointLabelContext(s)),{color:d,lineWidth:h}=c;!h||!d||(e.lineWidth=h,e.strokeStyle=d,e.setLineDash(c.borderDash),e.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(a.ticks.reverse?this.min:this.max),u=this.getPointPosition(s,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,a=this.options,n=a.ticks;if(!n.display)return;const r=this.getIndexAngle(0);let i,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!a.reverse)return;const u=n.setContext(this.getContext(l)),c=toFont(u.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){e.font=c.string,o=e.measureText(s.label).width,e.fillStyle=u.backdropColor;const d=toPadding(u.backdropPadding);e.fillRect(-o/2-d.left,-i-c.size/2-d.top,o+d.width,c.size+d.height)}renderText(e,s.label,0,-i,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}R(RadialLinearScale,"id","radialLinear"),R(RadialLinearScale,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),R(RadialLinearScale,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(RadialLinearScale,"descriptors",{angleLines:{_fallback:"grid"}});const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(t,e){return t-e}function parse(t,e){if(isNullOrUndef(e))return null;const a=t._adapter,{parser:n,round:r,isoWeekday:i}=t._parseOpts;let o=e;return typeof n=="function"&&(o=n(o)),isNumberFinite(o)||(o=typeof n=="string"?a.parse(o,n):a.parse(o)),o===null?null:(r&&(o=r==="week"&&(isNumber(i)||i===!0)?a.startOf(o,"isoWeek",i):a.startOf(o,r)),+o)}function determineUnitForAutoTicks(t,e,a,n){const r=UNITS.length;for(let i=UNITS.indexOf(t);i<r-1;++i){const o=INTERVALS[UNITS[i]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((a-e)/(s*o.size))<=n)return UNITS[i]}return UNITS[r-1]}function determineUnitForFormatting(t,e,a,n,r){for(let i=UNITS.length-1;i>=UNITS.indexOf(a);i--){const o=UNITS[i];if(INTERVALS[o].common&&t._adapter.diff(r,n,o)>=e-1)return o}return UNITS[a?UNITS.indexOf(a):0]}function determineMajorUnit(t){for(let e=UNITS.indexOf(t)+1,a=UNITS.length;e<a;++e)if(INTERVALS[UNITS[e]].common)return UNITS[e]}function addTick(t,e,a){if(!a)t[e]=!0;else if(a.length){const{lo:n,hi:r}=_lookup(a,e),i=a[n]>=e?a[n]:a[r];t[i]=!0}}function setMajorTicks(t,e,a,n){const r=t._adapter,i=+r.startOf(e[0].value,n),o=e[e.length-1].value;let s,l;for(s=i;s<=o;s=+r.add(s,1,n))l=a[s],l>=0&&(e[l].major=!0);return e}function ticksFromTimestamps(t,e,a){const n=[],r={},i=e.length;let o,s;for(o=0;o<i;++o)s=e[o],r[s]=o,n.push({value:s,major:!1});return i===0||!a?n:setMajorTicks(t,n,r,a)}class TimeScale extends Scale{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,a={}){const n=e.time||(e.time={}),r=this._adapter=new adapters._date(e.adapters.date);r.init(a),mergeIf(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=a.normalized}parse(e,a){return e===void 0?null:parse(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,a=this._adapter,n=e.time.unit||"day";let{min:r,max:i,minDefined:o,maxDefined:s}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(r=Math.min(r,u.min)),!s&&!isNaN(u.max)&&(i=Math.max(i,u.max))}(!o||!s)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=isNumberFinite(r)&&!isNaN(r)?r:+a.startOf(Date.now(),n),i=isNumberFinite(i)&&!isNaN(i)?i:+a.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let a=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(a=e[0],n=e[e.length-1]),{min:a,max:n}}buildTicks(){const e=this.options,a=e.time,n=e.ticks,r=n.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const i=this.min,o=this.max,s=_filterBetween(r,i,o);return this._unit=a.unit||(n.autoSkip?determineUnitForAutoTicks(a.minUnit,this.min,this.max,this._getLabelCapacity(i)):determineUnitForFormatting(this,s.length,a.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:determineMajorUnit(this._unit),this.initOffsets(r),e.reverse&&s.reverse(),ticksFromTimestamps(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let a=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?a=1-r:a=(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?n=i:n=(i-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;a=_limitValue(a,0,o),n=_limitValue(n,0,o),this._offsets={start:a,end:n,factor:1/(a+1+n)}}_generate(){const e=this._adapter,a=this.min,n=this.max,r=this.options,i=r.time,o=i.unit||determineUnitForAutoTicks(i.minUnit,a,n,this._getLabelCapacity(a)),s=valueOrDefault(r.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,u=isNumber(l)||l===!0,c={};let d=a,h,m;if(u&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,u?"day":o),e.diff(n,a,o)>1e5*s)throw new Error(a+" and "+n+" are too far apart with stepSize of "+s+" "+o);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=d,m=0;h<n;h=+e.add(h,s,o),m++)addTick(c,h,p);return(h===n||r.bounds==="ticks"||m===1)&&addTick(c,h,p),Object.keys(c).sort(sorter).map(v=>+v)}getLabelForValue(e){const a=this._adapter,n=this.options.time;return n.tooltipFormat?a.format(e,n.tooltipFormat):a.format(e,n.displayFormats.datetime)}format(e,a){const r=this.options.time.displayFormats,i=this._unit,o=a||r[i];return this._adapter.format(e,o)}_tickFormatFunction(e,a,n,r){const i=this.options,o=i.ticks.callback;if(o)return callback(o,[e,a,n],this);const s=i.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],d=u&&s[u],h=n[a],m=u&&d&&h&&h.major;return this._adapter.format(e,r||(m?d:c))}generateTickLabels(e){let a,n,r;for(a=0,n=e.length;a<n;++a)r=e[a],r.label=this._tickFormatFunction(r.value,a,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const a=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((a.start+n)*a.factor)}getValueForPixel(e){const a=this._offsets,n=this.getDecimalForPixel(e)/a.factor-a.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const a=this.options.ticks,n=this.ctx.measureText(e).width,r=toRadians(this.isHorizontal()?a.maxRotation:a.minRotation),i=Math.cos(r),o=Math.sin(r),s=this._resolveTickFontOptions(0).size;return{w:n*i+s*o,h:n*o+s*i}}_getLabelCapacity(e){const a=this.options.time,n=a.displayFormats,r=n[a.unit]||n.millisecond,i=this._tickFormatFunction(e,0,ticksFromTimestamps(this,[e],this._majorUnit),r),o=this._getLabelSize(i),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s:1}getDataTimestamps(){let e=this._cache.data||[],a,n;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(a=0,n=r.length;a<n;++a)e=e.concat(r[a].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let a,n;if(e.length)return e;const r=this.getLabels();for(a=0,n=r.length;a<n;++a)e.push(parse(this,r[a]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _arrayUnique(e.sort(sorter))}}R(TimeScale,"id","time"),R(TimeScale,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function interpolate$1(t,e,a){let n=0,r=t.length-1,i,o,s,l;a?(e>=t[n].pos&&e<=t[r].pos&&({lo:n,hi:r}=_lookupByKey(t,"pos",e)),{pos:i,time:s}=t[n],{pos:o,time:l}=t[r]):(e>=t[n].time&&e<=t[r].time&&({lo:n,hi:r}=_lookupByKey(t,"time",e)),{time:i,pos:s}=t[n],{time:o,pos:l}=t[r]);const u=o-i;return u?s+(l-s)*(e-i)/u:s}class TimeSeriesScale extends TimeScale{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),a=this._table=this.buildLookupTable(e);this._minPos=interpolate$1(a,this.min),this._tableRange=interpolate$1(a,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:a,max:n}=this,r=[],i=[];let o,s,l,u,c;for(o=0,s=e.length;o<s;++o)u=e[o],u>=a&&u<=n&&r.push(u);if(r.length<2)return[{time:a,pos:0},{time:n,pos:1}];for(o=0,s=r.length;o<s;++o)c=r[o+1],l=r[o-1],u=r[o],Math.round((c+l)/2)!==u&&i.push({time:u,pos:o/(s-1)});return i}_generate(){const e=this.min,a=this.max;let n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(a)||n.length===1)&&n.push(a),n.sort((r,i)=>r-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const a=this.getDataTimestamps(),n=this.getLabelTimestamps();return a.length&&n.length?e=this.normalize(a.concat(n)):e=a.length?a:n,e=this._cache.all=e,e}getDecimalForValue(e){return(interpolate$1(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const a=this._offsets,n=this.getDecimalForPixel(e)/a.factor-a.end;return interpolate$1(this._table,n*this._tableRange+this._minPos,!0)}}R(TimeSeriesScale,"id","timeseries"),R(TimeSeriesScale,"defaults",TimeScale.defaults);function getDefaultChartSettings(t){return t==="sankey"?{type:"sankey",data:{datasets:[]}}:t==="pie"?{type:"pie",data:{datasets:[]}}:t==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(e){let a=e.dataset.currency_code;return formatMoney(e.raw,a)}}}},maintainAspectRatio:!1,scales:{}}}:t==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(e){let a=e.dataset.currency_code;return formatMoney(e.raw,a)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let blue=new Color("#36a2eb"),red=new Color("#ff6384"),green=new Color("#4bc0c0"),orange=new Color("#ff9f40"),purple=new Color("#9966ff"),yellow=new Color("#ffcd56"),grey=new Color("#c9cbcf"),index=0;window.theme==="dark"&&(red.darken(.3).desaturate(.3),green.darken(.3).desaturate(.3),blue.darken(.3).desaturate(.3),orange.darken(.3).desaturate(.3));let allColors=[red,orange,blue,green,purple,yellow,grey,green];function getColors(t,e){let a={borderColor:red.rgbString(),backgroundColor:red.rgbString()},n;switch(t){default:let i=Math.floor(index/2)%allColors.length;n=new Color(allColors[i].rgbString()),n.lighten(.38),a={borderColor:allColors[i].hexString(),backgroundColor:n.hexString()};break;case"spent":n=new Color(blue.rgbString()),n.lighten(.38),a={borderColor:blue.rgbString(),backgroundColor:n.rgbString()};break;case"left":n=new Color(green.rgbString()),n.lighten(.38),a={borderColor:green.rgbString(),backgroundColor:n.rgbString()};break;case"overspent":n=new Color(red.rgbString()),n.lighten(.22),a={borderColor:red.rgbString(),backgroundColor:n.rgbString()};break}return index++,e==="border"?a.borderColor:e==="background"?a.backgroundColor:"#FF0000"}let currencies$2=[],chart$4=null,chartData$2=null,afterPromises$5=!1;const CHART_CACHE_KEY="dashboard-accounts-chart",ACCOUNTS_CACHE_KEY="dashboard-accounts-data",accounts=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,setVariable("autoConversion",this.autoConversion)},getFreshData(){const t=window.store.get("cacheValid");let e=window.store.get(CHART_CACHE_KEY);if(t&&typeof e<"u"){this.drawChart(this.generateOptions(e)),this.loading=!1;return}new Dashboard$2().dashboard(new Date(window.store.get("start")),new Date(window.store.get("end")),null).then(n=>{this.chartData=n.data,window.store.set(CHART_CACHE_KEY,n.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(t){currencies$2=[];let e=getDefaultChartSettings("line");for(let a=0;a<t.length;a++)if(t.hasOwnProperty(a)){let n="y",r=t[a],i={},o=[];a===0&&(e.data.labels=Object.keys(r.entries)),i.label=r.label,this.autoConversion&&(currencies$2.push(r.native_code),i.currency_code=r.native_code,o=Object.values(r.native_entries),n="y"+r.native_code),this.autoConversion||(n="y"+r.currency_code,i.currency_code=r.currency_code,currencies$2.push(r.currency_code),o=Object.values(r.entries)),i.yAxisID=n,i.data=o,e.data.datasets.push(i)}for(let a in currencies$2)if(currencies$2.hasOwnProperty(a)){let n="y"+currencies$2[a];e.options.scales.hasOwnProperty(n)||(e.options.scales[n]={id:a,type:"linear",position:parseInt(a)===1?"right":"left",ticks:{callback:function(r,i,o){return formatMoney(r,currencies$2[a])}}})}return e},loadChart(){if(this.loading!==!0){if(this.loading=!0,chartData$2===null){this.getFreshData();return}this.drawChart(this.generateOptions(chartData$2)),this.loading=!1}},drawChart(t){if(chart$4!==null){chart$4.options=t.options,chart$4.data=t.data,chart$4.update();return}chart$4=new Chart(document.querySelector("#account-chart"),t)},loadAccounts(){if(this.loadingAccounts===!0)return;if(this.loadingAccounts=!0,this.accountList.length>0){this.loadingAccounts=!1;return}const t=window.store.get("cacheValid");let e=window.store.get(ACCOUNTS_CACHE_KEY);if(t&&typeof e<"u"){this.accountList=e,this.loadingAccounts=!1;return}const a=10;let n=0,r=0,i=[];Promise.all([getVariable("frontpageAccounts")]).then(o=>{n=o[0].length;for(let s in o[0]){let l=o[0];if(l.hasOwnProperty(s)){let u=l[s];new Get$3().get(u,new Date(window.store.get("end"))).then(c=>{let d=c.data.data;new Get$3().transactions(d.id,1).then(h=>{let m=[];for(let p=0;p<h.data.data.length&&!(p>=a);p++){let v=h.data.data[p],y={title:v.attributes.group_title===null?"":v.attributes.group_title,id:v.id,transactions:[]};for(let w=0;w<v.attributes.transactions.length;w++){let _=v.attributes.transactions[w];y.transactions.push({description:_.description,id:v.id,type:_.type,amount_raw:parseFloat(_.amount),amount:formatMoney(_.amount,_.currency_code),native_amount_raw:parseFloat(_.native_amount),native_amount:formatMoney(_.native_amount,_.native_code)})}m.push(y)}i.push({name:d.attributes.name,order:d.attributes.order,id:d.id,balance_raw:parseFloat(d.attributes.current_balance),balance:formatMoney(d.attributes.current_balance,d.attributes.currency_code),native_balance_raw:parseFloat(d.attributes.native_current_balance),native_balance:formatMoney(d.attributes.native_current_balance,d.attributes.native_code),groups:m}),r++,r===n&&(i.sort((p,v)=>p.order-v.order),this.accountList=i,this.loadingAccounts=!1,window.store.set(ACCOUNTS_CACHE_KEY,i))})})}}})},init(){Promise.all([getVariable("viewRange","1M"),getVariable("autoConversion",!1),getVariable("language","en-US")]).then(t=>{this.autoConversion=t[1],afterPromises$5=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{afterPromises$5&&(chartData$2=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{afterPromises$5&&(this.loadChart(),this.loadAccounts())})}});let Dashboard$1=class{dashboard(e,a){let n=format$1(e,"y-MM-dd"),r=format$1(a,"y-MM-dd");return api.get("/api/v2/chart/budget/dashboard",{params:{start:n,end:r}})}};var isArray$a=Array.isArray,isArray_1=isArray$a;const isArray$b=getDefaultExportFromCjs(isArray_1);var freeGlobal$1=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root$8=freeGlobal||freeSelf||Function("return this")(),_root=root$8,root$7=_root,Symbol$6=root$7.Symbol,_Symbol=Symbol$6,Symbol$5=_Symbol,objectProto$d=Object.prototype,hasOwnProperty$a=objectProto$d.hasOwnProperty,nativeObjectToString$1=objectProto$d.toString,symToStringTag$1=Symbol$5?Symbol$5.toStringTag:void 0;function getRawTag$1(t){var e=hasOwnProperty$a.call(t,symToStringTag$1),a=t[symToStringTag$1];try{t[symToStringTag$1]=void 0;var n=!0}catch{}var r=nativeObjectToString$1.call(t);return n&&(e?t[symToStringTag$1]=a:delete t[symToStringTag$1]),r}var _getRawTag=getRawTag$1,objectProto$c=Object.prototype,nativeObjectToString=objectProto$c.toString;function objectToString$1(t){return nativeObjectToString.call(t)}var _objectToString=objectToString$1,Symbol$4=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$4?Symbol$4.toStringTag:void 0;function baseGetTag$5(t){return t==null?t===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(t)?getRawTag(t):objectToString(t)}var _baseGetTag=baseGetTag$5;function isObjectLike$5(t){return t!=null&&typeof t=="object"}var isObjectLike_1=isObjectLike$5,baseGetTag$4=_baseGetTag,isObjectLike$4=isObjectLike_1,symbolTag$1="[object Symbol]";function isSymbol$5(t){return typeof t=="symbol"||isObjectLike$4(t)&&baseGetTag$4(t)==symbolTag$1}var isSymbol_1=isSymbol$5,isArray$9=isArray_1,isSymbol$4=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$3(t,e){if(isArray$9(t))return!1;var a=typeof t;return a=="number"||a=="symbol"||a=="boolean"||t==null||isSymbol$4(t)?!0:reIsPlainProp.test(t)||!reIsDeepProp.test(t)||e!=null&&t in Object(e)}var _isKey=isKey$3;function isObject$6(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var isObject_1=isObject$6;const isObject$7=getDefaultExportFromCjs(isObject_1);var baseGetTag$3=_baseGetTag,isObject$5=isObject_1,asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(t){if(!isObject$5(t))return!1;var e=baseGetTag$3(t);return e==funcTag$1||e==genTag||e==asyncTag||e==proxyTag}var isFunction_1=isFunction$2,root$6=_root,coreJsData$1=root$6["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function isMasked$1(t){return!!maskSrcKey&&maskSrcKey in t}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$2(t){if(t!=null){try{return funcToString$1.call(t)}catch{}try{return t+""}catch{}}return""}var _toSource=toSource$2,isFunction$1=isFunction_1,isMasked=_isMasked,isObject$4=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$b=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$9=objectProto$b.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$9).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(t){if(!isObject$4(t)||isMasked(t))return!1;var e=isFunction$1(t)?reIsNative:reIsHostCtor;return e.test(toSource$1(t))}var _baseIsNative=baseIsNative$1;function getValue$1(t,e){return t==null?void 0:t[e]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$7(t,e){var a=getValue(t,e);return baseIsNative(a)?a:void 0}var _getNative=getNative$7,getNative$6=_getNative,nativeCreate$4=getNative$6(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$a=Object.prototype,hasOwnProperty$8=objectProto$a.hasOwnProperty;function hashGet$1(t){var e=this.__data__;if(nativeCreate$2){var a=e[t];return a===HASH_UNDEFINED$2?void 0:a}return hasOwnProperty$8.call(e,t)?e[t]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$9=Object.prototype,hasOwnProperty$7=objectProto$9.hasOwnProperty;function hashHas$1(t){var e=this.__data__;return nativeCreate$1?e[t]!==void 0:hasOwnProperty$7.call(e,t)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(t,e){var a=this.__data__;return this.size+=this.has(t)?0:1,a[t]=nativeCreate&&e===void 0?HASH_UNDEFINED$1:e,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(t){var e=-1,a=t==null?0:t.length;for(this.clear();++e<a;){var n=t[e];this.set(n[0],n[1])}}Hash$1.prototype.clear=hashClear;Hash$1.prototype.delete=hashDelete;Hash$1.prototype.get=hashGet;Hash$1.prototype.has=hashHas;Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$4(t,e){return t===e||t!==t&&e!==e}var eq_1=eq$4,eq$3=eq_1;function assocIndexOf$4(t,e){for(var a=t.length;a--;)if(eq$3(t[a][0],e))return a;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(t){var e=this.__data__,a=assocIndexOf$3(e,t);if(a<0)return!1;var n=e.length-1;return a==n?e.pop():splice.call(e,a,1),--this.size,!0}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(t){var e=this.__data__,a=assocIndexOf$2(e,t);return a<0?void 0:e[a][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(t){return assocIndexOf$1(this.__data__,t)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(t,e){var a=this.__data__,n=assocIndexOf(a,t);return n<0?(++this.size,a.push([t,e])):a[n][1]=e,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(t){var e=-1,a=t==null?0:t.length;for(this.clear();++e<a;){var n=t[e];this.set(n[0],n[1])}}ListCache$4.prototype.clear=listCacheClear;ListCache$4.prototype.delete=listCacheDelete;ListCache$4.prototype.get=listCacheGet;ListCache$4.prototype.has=listCacheHas;ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4,getNative$5=_getNative,root$5=_root,Map$4=getNative$5(root$5,"Map"),_Map=Map$4,Hash=_Hash,ListCache$3=_ListCache,Map$3=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map$3||ListCache$3),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(t,e){var a=t.__data__;return isKeyable(e)?a[typeof e=="string"?"string":"hash"]:a.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(t){var e=getMapData$3(this,t).delete(t);return this.size-=e?1:0,e}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(t){return getMapData$2(this,t).get(t)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(t){return getMapData$1(this,t).has(t)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(t,e){var a=getMapData(this,t),n=a.size;return a.set(t,e),this.size+=a.size==n?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$3(t){var e=-1,a=t==null?0:t.length;for(this.clear();++e<a;){var n=t[e];this.set(n[0],n[1])}}MapCache$3.prototype.clear=mapCacheClear;MapCache$3.prototype.delete=mapCacheDelete;MapCache$3.prototype.get=mapCacheGet;MapCache$3.prototype.has=mapCacheHas;MapCache$3.prototype.set=mapCacheSet;var _MapCache=MapCache$3,MapCache$2=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(FUNC_ERROR_TEXT);var a=function(){var n=arguments,r=e?e.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=t.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(memoize$1.Cache||MapCache$2),a}memoize$1.Cache=MapCache$2;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(t){var e=memoize(t,function(n){return a.size===MAX_MEMOIZE_SIZE&&a.clear(),n}),a=e.cache;return e}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(rePropName,function(a,n,r,i){e.push(r?i.replace(reEscapeChar,"$1"):n||a)}),e}),_stringToPath=stringToPath$1;function arrayMap$2(t,e){for(var a=-1,n=t==null?0:t.length,r=Array(n);++a<n;)r[a]=e(t[a],a,t);return r}var _arrayMap=arrayMap$2,Symbol$3=_Symbol,arrayMap$1=_arrayMap,isArray$8=isArray_1,isSymbol$3=isSymbol_1,INFINITY$4=1/0,symbolProto$1=Symbol$3?Symbol$3.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString$1(t){if(typeof t=="string")return t;if(isArray$8(t))return arrayMap$1(t,baseToString$1)+"";if(isSymbol$3(t))return symbolToString?symbolToString.call(t):"";var e=t+"";return e=="0"&&1/t==-INFINITY$4?"-0":e}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$6(t){return t==null?"":baseToString(t)}var toString_1=toString$6,isArray$7=isArray_1,isKey$2=_isKey,stringToPath=_stringToPath,toString$5=toString_1;function castPath$3(t,e){return isArray$7(t)?t:isKey$2(t,e)?[t]:stringToPath(toString$5(t))}var _castPath=castPath$3,isSymbol$2=isSymbol_1,INFINITY$3=1/0;function toKey$5(t){if(typeof t=="string"||isSymbol$2(t))return t;var e=t+"";return e=="0"&&1/t==-INFINITY$3?"-0":e}var _toKey=toKey$5,castPath$2=_castPath,toKey$4=_toKey;function baseGet$3(t,e){e=castPath$2(e,t);for(var a=0,n=e.length;t!=null&&a<n;)t=t[toKey$4(e[a++])];return a&&a==n?t:void 0}var _baseGet=baseGet$3,baseGet$2=_baseGet;function get$1(t,e,a){var n=t==null?void 0:baseGet$2(t,e);return n===void 0?a:n}var get_1=get$1;const get$2=getDefaultExportFromCjs(get_1);var objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function baseHas$1(t,e){return t!=null&&hasOwnProperty$6.call(t,e)}var _baseHas=baseHas$1,baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1,argsTag$2="[object Arguments]";function baseIsArguments$1(t){return isObjectLike$3(t)&&baseGetTag$2(t)==argsTag$2}var _baseIsArguments=baseIsArguments$1,baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1,objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty,propertyIsEnumerable$1=objectProto$7.propertyIsEnumerable,isArguments$3=baseIsArguments(function(){return arguments}())?baseIsArguments:function(t){return isObjectLike$2(t)&&hasOwnProperty$5.call(t,"callee")&&!propertyIsEnumerable$1.call(t,"callee")},isArguments_1=isArguments$3,MAX_SAFE_INTEGER$3=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$4(t,e){var a=typeof t;return e=e??MAX_SAFE_INTEGER$3,!!e&&(a=="number"||a!="symbol"&&reIsUint.test(t))&&t>-1&&t%1==0&&t<e}var _isIndex=isIndex$4,MAX_SAFE_INTEGER$2=9007199254740991;function isLength$3(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER$2}var isLength_1=isLength$3,castPath$1=_castPath,isArguments$2=isArguments_1,isArray$6=isArray_1,isIndex$3=_isIndex,isLength$2=isLength_1,toKey$3=_toKey;function hasPath$2(t,e,a){e=castPath$1(e,t);for(var n=-1,r=e.length,i=!1;++n<r;){var o=toKey$3(e[n]);if(!(i=t!=null&&a(t,o)))break;t=t[o]}return i||++n!=r?i:(r=t==null?0:t.length,!!r&&isLength$2(r)&&isIndex$3(o,r)&&(isArray$6(t)||isArguments$2(t)))}var _hasPath=hasPath$2,baseHas=_baseHas,hasPath$1=_hasPath;function has(t,e){return t!=null&&hasPath$1(t,e,baseHas)}var has_1=has;const has$1=getDefaultExportFromCjs(has_1);var getNative$4=_getNative,defineProperty$2=function(){try{var t=getNative$4(Object,"defineProperty");return t({},"",{}),t}catch{}}(),_defineProperty=defineProperty$2,defineProperty$1=_defineProperty;function baseAssignValue$1(t,e,a){e=="__proto__"&&defineProperty$1?defineProperty$1(t,e,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[e]=a}var _baseAssignValue=baseAssignValue$1,baseAssignValue=_baseAssignValue,eq$2=eq_1,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function assignValue$2(t,e,a){var n=t[e];(!(hasOwnProperty$4.call(t,e)&&eq$2(n,a))||a===void 0&&!(e in t))&&baseAssignValue(t,e,a)}var _assignValue=assignValue$2,assignValue$1=_assignValue,castPath=_castPath,isIndex$2=_isIndex,isObject$3=isObject_1,toKey$2=_toKey;function baseSet$1(t,e,a,n){if(!isObject$3(t))return t;e=castPath(e,t);for(var r=-1,i=e.length,o=i-1,s=t;s!=null&&++r<i;){var l=toKey$2(e[r]),u=a;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(r!=o){var c=s[l];u=n?n(c,l,s):void 0,u===void 0&&(u=isObject$3(c)?c:isIndex$2(e[r+1])?[]:{})}assignValue$1(s,l,u),s=s[l]}return t}var _baseSet=baseSet$1,baseSet=_baseSet;function set(t,e,a){return t==null?t:baseSet(t,e,a)}var set_1=set;const set$1=getDefaultExportFromCjs(set_1);var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(t){return this.__data__.set(t,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(t){return this.__data__.has(t)}var _setCacheHas=setCacheHas$1,MapCache$1=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$2(t){var e=-1,a=t==null?0:t.length;for(this.__data__=new MapCache$1;++e<a;)this.add(t[e])}SetCache$2.prototype.add=SetCache$2.prototype.push=setCacheAdd;SetCache$2.prototype.has=setCacheHas;var _SetCache=SetCache$2;function baseFindIndex$1(t,e,a,n){for(var r=t.length,i=a+(n?1:-1);n?i--:++i<r;)if(e(t[i],i,t))return i;return-1}var _baseFindIndex=baseFindIndex$1;function baseIsNaN$1(t){return t!==t}var _baseIsNaN=baseIsNaN$1;function strictIndexOf$1(t,e,a){for(var n=a-1,r=t.length;++n<r;)if(t[n]===e)return n;return-1}var _strictIndexOf=strictIndexOf$1,baseFindIndex=_baseFindIndex,baseIsNaN=_baseIsNaN,strictIndexOf=_strictIndexOf;function baseIndexOf$1(t,e,a){return e===e?strictIndexOf(t,e,a):baseFindIndex(t,baseIsNaN,a)}var _baseIndexOf=baseIndexOf$1,baseIndexOf=_baseIndexOf;function arrayIncludes$1(t,e){var a=t==null?0:t.length;return!!a&&baseIndexOf(t,e,0)>-1}var _arrayIncludes=arrayIncludes$1;function arrayIncludesWith$1(t,e,a){for(var n=-1,r=t==null?0:t.length;++n<r;)if(a(e,t[n]))return!0;return!1}var _arrayIncludesWith=arrayIncludesWith$1;function cacheHas$2(t,e){return t.has(e)}var _cacheHas=cacheHas$2,getNative$3=_getNative,root$4=_root,Set$3=getNative$3(root$4,"Set"),_Set=Set$3;function noop$1(){}var noop_1=noop$1;function setToArray$3(t){var e=-1,a=Array(t.size);return t.forEach(function(n){a[++e]=n}),a}var _setToArray=setToArray$3,Set$2=_Set,noop=noop_1,setToArray$2=_setToArray,INFINITY$2=1/0,createSet$1=Set$2&&1/setToArray$2(new Set$2([,-0]))[1]==INFINITY$2?function(t){return new Set$2(t)}:noop,_createSet=createSet$1,SetCache$1=_SetCache,arrayIncludes=_arrayIncludes,arrayIncludesWith=_arrayIncludesWith,cacheHas$1=_cacheHas,createSet=_createSet,setToArray$1=_setToArray,LARGE_ARRAY_SIZE$1=200;function baseUniq$1(t,e,a){var n=-1,r=arrayIncludes,i=t.length,o=!0,s=[],l=s;if(a)o=!1,r=arrayIncludesWith;else if(i>=LARGE_ARRAY_SIZE$1){var u=e?null:createSet(t);if(u)return setToArray$1(u);o=!1,r=cacheHas$1,l=new SetCache$1}else l=e?[]:s;e:for(;++n<i;){var c=t[n],d=e?e(c):c;if(c=a||c!==0?c:0,o&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;e&&l.push(d),s.push(c)}else r(l,d,a)||(l!==s&&l.push(d),s.push(c))}return s}var _baseUniq=baseUniq$1,baseUniq=_baseUniq;function uniq(t){return t&&t.length?baseUniq(t):[]}var uniq_1=uniq;const uniq$1=getDefaultExportFromCjs(uniq_1),defaultLocaleResolver=(t,e)=>{const a=[],n=[];return a.push(e),e||a.push(t.locale),t.enableFallback&&a.push(t.defaultLocale),a.filter(Boolean).map(r=>r.toString()).forEach(function(r){if(n.includes(r)||n.push(r),!t.enableFallback)return;const i=r.split("-");i.length===3&&n.push(`${i[0]}-${i[1]}`),n.push(i[0])}),uniq$1(n)};class Locales{constructor(e){this.i18n=e,this.registry={},this.register("default",defaultLocaleResolver)}register(e,a){if(typeof a!="function"){const n=a;a=()=>n}this.registry[e]=a}get(e){let a=this.registry[e]||this.registry[this.i18n.locale]||this.registry.default;return typeof a=="function"&&(a=a(this.i18n,e)),a instanceof Array||(a=[a]),a}}const en=(t,e)=>{const a=String(t).split("."),n=!a[1],r=Number(a[0])==t,i=r&&a[0].slice(-1),o=r&&a[0].slice(-2);return e?i==1&&o!=11?"one":i==2&&o!=12?"two":i==3&&o!=13?"few":"other":t==1&&n?"one":"other"};function useMakePlural({pluralizer:t,includeZero:e=!0,ordinal:a=!1}){return function(n,r){return[e&&r===0?"zero":"",t(r,a)].filter(Boolean)}}const defaultPluralizer=useMakePlural({pluralizer:en,includeZero:!0});class Pluralization{constructor(e){this.i18n=e,this.registry={},this.register("default",defaultPluralizer)}register(e,a){this.registry[e]=a}get(e){return this.registry[e]||this.registry[this.i18n.locale]||this.registry.default}}function baseSlice$1(t,e,a){var n=-1,r=t.length;e<0&&(e=-e>r?0:r+e),a=a>r?r:a,a<0&&(a+=r),r=e>a?0:a-e>>>0,e>>>=0;for(var i=Array(r);++n<r;)i[n]=t[n+e];return i}var _baseSlice=baseSlice$1,baseSlice=_baseSlice;function castSlice$1(t,e,a){var n=t.length;return a=a===void 0?n:a,!e&&a>=n?t:baseSlice(t,e,a)}var _castSlice=castSlice$1,rsAstralRange$2="\\ud800-\\udfff",rsComboMarksRange$3="\\u0300-\\u036f",reComboHalfMarksRange$3="\\ufe20-\\ufe2f",rsComboSymbolsRange$3="\\u20d0-\\u20ff",rsComboRange$3=rsComboMarksRange$3+reComboHalfMarksRange$3+rsComboSymbolsRange$3,rsVarRange$2="\\ufe0e\\ufe0f",rsZWJ$2="\\u200d",reHasUnicode=RegExp("["+rsZWJ$2+rsAstralRange$2+rsComboRange$3+rsVarRange$2+"]");function hasUnicode$2(t){return reHasUnicode.test(t)}var _hasUnicode=hasUnicode$2;function asciiToArray$1(t){return t.split("")}var _asciiToArray=asciiToArray$1,rsAstralRange$1="\\ud800-\\udfff",rsComboMarksRange$2="\\u0300-\\u036f",reComboHalfMarksRange$2="\\ufe20-\\ufe2f",rsComboSymbolsRange$2="\\u20d0-\\u20ff",rsComboRange$2=rsComboMarksRange$2+reComboHalfMarksRange$2+rsComboSymbolsRange$2,rsVarRange$1="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange$1+"]",rsCombo$2="["+rsComboRange$2+"]",rsFitz$1="\\ud83c[\\udffb-\\udfff]",rsModifier$1="(?:"+rsCombo$2+"|"+rsFitz$1+")",rsNonAstral$1="[^"+rsAstralRange$1+"]",rsRegional$1="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair$1="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ$1="\\u200d",reOptMod$1=rsModifier$1+"?",rsOptVar$1="["+rsVarRange$1+"]?",rsOptJoin$1="(?:"+rsZWJ$1+"(?:"+[rsNonAstral$1,rsRegional$1,rsSurrPair$1].join("|")+")"+rsOptVar$1+reOptMod$1+")*",rsSeq$1=rsOptVar$1+reOptMod$1+rsOptJoin$1,rsSymbol="(?:"+[rsNonAstral$1+rsCombo$2+"?",rsCombo$2,rsRegional$1,rsSurrPair$1,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz$1+"(?="+rsFitz$1+")|"+rsSymbol+rsSeq$1,"g");function unicodeToArray$1(t){return t.match(reUnicode)||[]}var _unicodeToArray=unicodeToArray$1,asciiToArray=_asciiToArray,hasUnicode$1=_hasUnicode,unicodeToArray=_unicodeToArray;function stringToArray$1(t){return hasUnicode$1(t)?unicodeToArray(t):asciiToArray(t)}var _stringToArray=stringToArray$1,castSlice=_castSlice,hasUnicode=_hasUnicode,stringToArray=_stringToArray,toString$4=toString_1;function createCaseFirst$1(t){return function(e){e=toString$4(e);var a=hasUnicode(e)?stringToArray(e):void 0,n=a?a[0]:e.charAt(0),r=a?castSlice(a,1).join(""):e.slice(1);return n[t]()+r}}var _createCaseFirst=createCaseFirst$1,createCaseFirst=_createCaseFirst,upperFirst$1=createCaseFirst("toUpperCase"),upperFirst_1=upperFirst$1,toString$3=toString_1,upperFirst=upperFirst_1;function capitalize$1(t){return upperFirst(toString$3(t).toLowerCase())}var capitalize_1=capitalize$1;function arrayReduce$1(t,e,a,n){var r=-1,i=t==null?0:t.length;for(n&&i&&(a=t[++r]);++r<i;)a=e(a,t[r],r,t);return a}var _arrayReduce=arrayReduce$1;function basePropertyOf$1(t){return function(e){return t==null?void 0:t[e]}}var _basePropertyOf=basePropertyOf$1,basePropertyOf=_basePropertyOf,deburredLetters={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},deburrLetter$1=basePropertyOf(deburredLetters),_deburrLetter=deburrLetter$1,deburrLetter=_deburrLetter,toString$2=toString_1,reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rsComboMarksRange$1="\\u0300-\\u036f",reComboHalfMarksRange$1="\\ufe20-\\ufe2f",rsComboSymbolsRange$1="\\u20d0-\\u20ff",rsComboRange$1=rsComboMarksRange$1+reComboHalfMarksRange$1+rsComboSymbolsRange$1,rsCombo$1="["+rsComboRange$1+"]",reComboMark=RegExp(rsCombo$1,"g");function deburr$1(t){return t=toString$2(t),t&&t.replace(reLatin,deburrLetter).replace(reComboMark,"")}var deburr_1=deburr$1,reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function asciiWords$1(t){return t.match(reAsciiWord)||[]}var _asciiWords=asciiWords$1,reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function hasUnicodeWord$1(t){return reHasUnicodeWord.test(t)}var _hasUnicodeWord=hasUnicodeWord$1,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsDingbatRange="\\u2700-\\u27bf",rsLowerRange="a-z\\xdf-\\xf6\\xf8-\\xff",rsMathOpRange="\\xac\\xb1\\xd7\\xf7",rsNonCharRange="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rsPunctuationRange="\\u2000-\\u206f",rsSpaceRange=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rsUpperRange="A-Z\\xc0-\\xd6\\xd8-\\xde",rsVarRange="\\ufe0e\\ufe0f",rsBreakRange=rsMathOpRange+rsNonCharRange+rsPunctuationRange+rsSpaceRange,rsApos$1="['’]",rsBreak="["+rsBreakRange+"]",rsCombo="["+rsComboRange+"]",rsDigits="\\d+",rsDingbat="["+rsDingbatRange+"]",rsLower="["+rsLowerRange+"]",rsMisc="[^"+rsAstralRange+rsBreakRange+rsDigits+rsDingbatRange+rsLowerRange+rsUpperRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper="["+rsUpperRange+"]",rsZWJ="\\u200d",rsMiscLower="(?:"+rsLower+"|"+rsMisc+")",rsMiscUpper="(?:"+rsUpper+"|"+rsMisc+")",rsOptContrLower="(?:"+rsApos$1+"(?:d|ll|m|re|s|t|ve))?",rsOptContrUpper="(?:"+rsApos$1+"(?:D|LL|M|RE|S|T|VE))?",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsOrdLower="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rsOrdUpper="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsEmoji="(?:"+[rsDingbat,rsRegional,rsSurrPair].join("|")+")"+rsSeq,reUnicodeWord=RegExp([rsUpper+"?"+rsLower+"+"+rsOptContrLower+"(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsMiscUpper+"+"+rsOptContrUpper+"(?="+[rsBreak,rsUpper+rsMiscLower,"$"].join("|")+")",rsUpper+"?"+rsMiscLower+"+"+rsOptContrLower,rsUpper+"+"+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join("|"),"g");function unicodeWords$1(t){return t.match(reUnicodeWord)||[]}var _unicodeWords=unicodeWords$1,asciiWords=_asciiWords,hasUnicodeWord=_hasUnicodeWord,toString$1=toString_1,unicodeWords=_unicodeWords;function words$1(t,e,a){return t=toString$1(t),e=a?void 0:e,e===void 0?hasUnicodeWord(t)?unicodeWords(t):asciiWords(t):t.match(e)||[]}var words_1=words$1,arrayReduce=_arrayReduce,deburr=deburr_1,words=words_1,rsApos="['’]",reApos=RegExp(rsApos,"g");function createCompounder$1(t){return function(e){return arrayReduce(words(deburr(e).replace(reApos,"")),t,"")}}var _createCompounder=createCompounder$1,capitalize=capitalize_1,createCompounder=_createCompounder,camelCase=createCompounder(function(t,e,a){return e=e.toLowerCase(),t+(a?capitalize(e):e)}),camelCase_1=camelCase;const camelCase$1=getDefaultExportFromCjs(camelCase_1);function camelCaseKeys(t){return t?Object.keys(t).reduce((e,a)=>(e[camelCase$1(a)]=t[a],e),{}):{}}function isSet(t){return t!=null}function createTranslationOptions(t,e,a){let n=[{scope:e}];if(isSet(a.defaults)&&(n=n.concat(a.defaults)),isSet(a.defaultValue)){const r=typeof a.defaultValue=="function"?a.defaultValue(t,e,a):a.defaultValue;n.push({message:r}),delete a.defaultValue}return n}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$1=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(t){var e,a,n,r=_.prototype={constructor:_,toString:null,valueOf:null},i=new _(1),o=20,s=4,l=-7,u=21,c=-1e7,d=1e7,h=!1,m=1,p=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},y="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function _(g,b){var $,S,P,M,C,E,T,x,A=this;if(!(A instanceof _))return new _(g,b);if(b==null){if(g&&g._isBigNumber===!0){A.s=g.s,!g.c||g.e>d?A.c=A.e=null:g.e<c?A.c=[A.e=0]:(A.e=g.e,A.c=g.c.slice());return}if((E=typeof g=="number")&&g*0==0){if(A.s=1/g<0?(g=-g,-1):1,g===~~g){for(M=0,C=g;C>=10;C/=10,M++);M>d?A.c=A.e=null:(A.e=M,A.c=[g]);return}x=String(g)}else{if(!isNumeric.test(x=String(g)))return n(A,x,E);A.s=x.charCodeAt(0)==45?(x=x.slice(1),-1):1}(M=x.indexOf("."))>-1&&(x=x.replace(".","")),(C=x.search(/e/i))>0?(M<0&&(M=C),M+=+x.slice(C+1),x=x.substring(0,C)):M<0&&(M=x.length)}else{if(intCheck(b,2,y.length,"Base"),b==10&&w)return A=new _(g),N(A,o+A.e+1,s);if(x=String(g),E=typeof g=="number"){if(g*0!=0)return n(A,x,E,b);if(A.s=1/g<0?(x=x.slice(1),-1):1,_.DEBUG&&x.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+g)}else A.s=x.charCodeAt(0)===45?(x=x.slice(1),-1):1;for($=y.slice(0,b),M=C=0,T=x.length;C<T;C++)if($.indexOf(S=x.charAt(C))<0){if(S=="."){if(C>M){M=T;continue}}else if(!P&&(x==x.toUpperCase()&&(x=x.toLowerCase())||x==x.toLowerCase()&&(x=x.toUpperCase()))){P=!0,C=-1,M=0;continue}return n(A,String(g),E,b)}E=!1,x=a(x,b,10,A.s),(M=x.indexOf("."))>-1?x=x.replace(".",""):M=x.length}for(C=0;x.charCodeAt(C)===48;C++);for(T=x.length;x.charCodeAt(--T)===48;);if(x=x.slice(C,++T)){if(T-=C,E&&_.DEBUG&&T>15&&(g>MAX_SAFE_INTEGER$1||g!==mathfloor(g)))throw Error(tooManyDigits+A.s*g);if((M=M-C-1)>d)A.c=A.e=null;else if(M<c)A.c=[A.e=0];else{if(A.e=M,A.c=[],C=(M+1)%LOG_BASE,M<0&&(C+=LOG_BASE),C<T){for(C&&A.c.push(+x.slice(0,C)),T-=LOG_BASE;C<T;)A.c.push(+x.slice(C,C+=LOG_BASE));C=LOG_BASE-(x=x.slice(C)).length}else C-=T;for(;C--;x+="0");A.c.push(+x)}}else A.c=[A.e=0]}_.clone=clone,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(g){var b,$;if(g!=null)if(typeof g=="object"){if(g.hasOwnProperty(b="DECIMAL_PLACES")&&($=g[b],intCheck($,0,MAX,b),o=$),g.hasOwnProperty(b="ROUNDING_MODE")&&($=g[b],intCheck($,0,8,b),s=$),g.hasOwnProperty(b="EXPONENTIAL_AT")&&($=g[b],$&&$.pop?(intCheck($[0],-MAX,0,b),intCheck($[1],0,MAX,b),l=$[0],u=$[1]):(intCheck($,-MAX,MAX,b),l=-(u=$<0?-$:$))),g.hasOwnProperty(b="RANGE"))if($=g[b],$&&$.pop)intCheck($[0],-MAX,-1,b),intCheck($[1],1,MAX,b),c=$[0],d=$[1];else if(intCheck($,-MAX,MAX,b),$)c=-(d=$<0?-$:$);else throw Error(bignumberError+b+" cannot be zero: "+$);if(g.hasOwnProperty(b="CRYPTO"))if($=g[b],$===!!$)if($)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=$;else throw h=!$,Error(bignumberError+"crypto unavailable");else h=$;else throw Error(bignumberError+b+" not true or false: "+$);if(g.hasOwnProperty(b="MODULO_MODE")&&($=g[b],intCheck($,0,9,b),m=$),g.hasOwnProperty(b="POW_PRECISION")&&($=g[b],intCheck($,0,MAX,b),p=$),g.hasOwnProperty(b="FORMAT"))if($=g[b],typeof $=="object")v=$;else throw Error(bignumberError+b+" not an object: "+$);if(g.hasOwnProperty(b="ALPHABET"))if($=g[b],typeof $=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test($))w=$.slice(0,10)=="0123456789",y=$;else throw Error(bignumberError+b+" invalid: "+$)}else throw Error(bignumberError+"Object expected: "+g);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,u],RANGE:[c,d],CRYPTO:h,MODULO_MODE:m,POW_PRECISION:p,FORMAT:v,ALPHABET:y}},_.isBigNumber=function(g){if(!g||g._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var b,$,S=g.c,P=g.e,M=g.s;e:if({}.toString.call(S)=="[object Array]"){if((M===1||M===-1)&&P>=-MAX&&P<=MAX&&P===mathfloor(P)){if(S[0]===0){if(P===0&&S.length===1)return!0;break e}if(b=(P+1)%LOG_BASE,b<1&&(b+=LOG_BASE),String(S[0]).length==b){for(b=0;b<S.length;b++)if($=S[b],$<0||$>=BASE||$!==mathfloor($))break e;if($!==0)return!0}}}else if(S===null&&P===null&&(M===null||M===1||M===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+g)},_.maximum=_.max=function(){return k(arguments,-1)},_.minimum=_.min=function(){return k(arguments,1)},_.random=function(){var g=9007199254740992,b=Math.random()*g&2097151?function(){return mathfloor(Math.random()*g)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function($){var S,P,M,C,E,T=0,x=[],A=new _(i);if($==null?$=o:intCheck($,0,MAX),C=mathceil($/LOG_BASE),h)if(crypto.getRandomValues){for(S=crypto.getRandomValues(new Uint32Array(C*=2));T<C;)E=S[T]*131072+(S[T+1]>>>11),E>=9e15?(P=crypto.getRandomValues(new Uint32Array(2)),S[T]=P[0],S[T+1]=P[1]):(x.push(E%1e14),T+=2);T=C/2}else if(crypto.randomBytes){for(S=crypto.randomBytes(C*=7);T<C;)E=(S[T]&31)*281474976710656+S[T+1]*1099511627776+S[T+2]*4294967296+S[T+3]*16777216+(S[T+4]<<16)+(S[T+5]<<8)+S[T+6],E>=9e15?crypto.randomBytes(7).copy(S,T):(x.push(E%1e14),T+=7);T=C/7}else throw h=!1,Error(bignumberError+"crypto unavailable");if(!h)for(;T<C;)E=b(),E<9e15&&(x[T++]=E%1e14);for(C=x[--T],$%=LOG_BASE,C&&$&&(E=POWS_TEN[LOG_BASE-$],x[T]=mathfloor(C/E)*E);x[T]===0;x.pop(),T--);if(T<0)x=[M=0];else{for(M=-1;x[0]===0;x.splice(0,1),M-=LOG_BASE);for(T=1,E=x[0];E>=10;E/=10,T++);T<LOG_BASE&&(M-=LOG_BASE-T)}return A.e=M,A.c=x,A}}(),_.sum=function(){for(var g=1,b=arguments,$=new _(b[0]);g<b.length;)$=$.plus(b[g++]);return $},a=function(){var g="0123456789";function b($,S,P,M){for(var C,E=[0],T,x=0,A=$.length;x<A;){for(T=E.length;T--;E[T]*=S);for(E[0]+=M.indexOf($.charAt(x++)),C=0;C<E.length;C++)E[C]>P-1&&(E[C+1]==null&&(E[C+1]=0),E[C+1]+=E[C]/P|0,E[C]%=P)}return E.reverse()}return function($,S,P,M,C){var E,T,x,A,L,I,W,z,U=$.indexOf("."),B=o,V=s;for(U>=0&&(A=p,p=0,$=$.replace(".",""),z=new _(S),I=z.pow($.length-U),p=A,z.c=b(toFixedPoint(coeffToString(I.c),I.e,"0"),10,P,g),z.e=z.c.length),W=b($,S,P,C?(E=y,g):(E=g,y)),x=A=W.length;W[--A]==0;W.pop());if(!W[0])return E.charAt(0);if(U<0?--x:(I.c=W,I.e=x,I.s=M,I=e(I,z,B,V,P),W=I.c,L=I.r,x=I.e),T=x+B+1,U=W[T],A=P/2,L=L||T<0||W[T+1]!=null,L=V<4?(U!=null||L)&&(V==0||V==(I.s<0?3:2)):U>A||U==A&&(V==4||L||V==6&&W[T-1]&1||V==(I.s<0?8:7)),T<1||!W[0])$=L?toFixedPoint(E.charAt(1),-B,E.charAt(0)):E.charAt(0);else{if(W.length=T,L)for(--P;++W[--T]>P;)W[T]=0,T||(++x,W=[1].concat(W));for(A=W.length;!W[--A];);for(U=0,$="";U<=A;$+=E.charAt(W[U++]));$=toFixedPoint($,x,E.charAt(0))}return $}}(),e=function(){function g(S,P,M){var C,E,T,x,A=0,L=S.length,I=P%SQRT_BASE,W=P/SQRT_BASE|0;for(S=S.slice();L--;)T=S[L]%SQRT_BASE,x=S[L]/SQRT_BASE|0,C=W*T+x*I,E=I*T+C%SQRT_BASE*SQRT_BASE+A,A=(E/M|0)+(C/SQRT_BASE|0)+W*x,S[L]=E%M;return A&&(S=[A].concat(S)),S}function b(S,P,M,C){var E,T;if(M!=C)T=M>C?1:-1;else for(E=T=0;E<M;E++)if(S[E]!=P[E]){T=S[E]>P[E]?1:-1;break}return T}function $(S,P,M,C){for(var E=0;M--;)S[M]-=E,E=S[M]<P[M]?1:0,S[M]=E*C+S[M]-P[M];for(;!S[0]&&S.length>1;S.splice(0,1));}return function(S,P,M,C,E){var T,x,A,L,I,W,z,U,B,V,H,G,K,Y,J,Q,ee,Z=S.s==P.s?1:-1,X=S.c,q=P.c;if(!X||!X[0]||!q||!q[0])return new _(!S.s||!P.s||(X?q&&X[0]==q[0]:!q)?NaN:X&&X[0]==0||!q?Z*0:Z/0);for(U=new _(Z),B=U.c=[],x=S.e-P.e,Z=M+x+1,E||(E=BASE,x=bitFloor(S.e/LOG_BASE)-bitFloor(P.e/LOG_BASE),Z=Z/LOG_BASE|0),A=0;q[A]==(X[A]||0);A++);if(q[A]>(X[A]||0)&&x--,Z<0)B.push(1),L=!0;else{for(Y=X.length,Q=q.length,A=0,Z+=2,I=mathfloor(E/(q[0]+1)),I>1&&(q=g(q,I,E),X=g(X,I,E),Q=q.length,Y=X.length),K=Q,V=X.slice(0,Q),H=V.length;H<Q;V[H++]=0);ee=q.slice(),ee=[0].concat(ee),J=q[0],q[1]>=E/2&&J++;do{if(I=0,T=b(q,V,Q,H),T<0){if(G=V[0],Q!=H&&(G=G*E+(V[1]||0)),I=mathfloor(G/J),I>1)for(I>=E&&(I=E-1),W=g(q,I,E),z=W.length,H=V.length;b(W,V,z,H)==1;)I--,$(W,Q<z?ee:q,z,E),z=W.length,T=1;else I==0&&(T=I=1),W=q.slice(),z=W.length;if(z<H&&(W=[0].concat(W)),$(V,W,H,E),H=V.length,T==-1)for(;b(q,V,Q,H)<1;)I++,$(V,Q<H?ee:q,H,E),H=V.length}else T===0&&(I++,V=[0]);B[A++]=I,V[0]?V[H++]=X[K]||0:(V=[X[K]],H=1)}while((K++<Y||V[0]!=null)&&Z--);L=V[0]!=null,B[0]||B.splice(0,1)}if(E==BASE){for(A=1,Z=B[0];Z>=10;Z/=10,A++);N(U,M+(U.e=A+x*LOG_BASE-1)+1,C,L)}else U.e=x,U.r=+L;return U}}();function D(g,b,$,S){var P,M,C,E,T;if($==null?$=s:intCheck($,0,8),!g.c)return g.toString();if(P=g.c[0],C=g.e,b==null)T=coeffToString(g.c),T=S==1||S==2&&(C<=l||C>=u)?toExponential(T,C):toFixedPoint(T,C,"0");else if(g=N(new _(g),b,$),M=g.e,T=coeffToString(g.c),E=T.length,S==1||S==2&&(b<=M||M<=l)){for(;E<b;T+="0",E++);T=toExponential(T,M)}else if(b-=C,T=toFixedPoint(T,M,"0"),M+1>E){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=M-E,b>0)for(M+1==E&&(T+=".");b--;T+="0");return g.s<0&&P?"-"+T:T}function k(g,b){for(var $,S,P=1,M=new _(g[0]);P<g.length;P++)S=new _(g[P]),(!S.s||($=compare(M,S))===b||$===0&&M.s===b)&&(M=S);return M}function O(g,b,$){for(var S=1,P=b.length;!b[--P];b.pop());for(P=b[0];P>=10;P/=10,S++);return($=S+$*LOG_BASE-1)>d?g.c=g.e=null:$<c?g.c=[g.e=0]:(g.e=$,g.c=b),g}n=function(){var g=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,$=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(M,C,E,T){var x,A=E?C:C.replace(P,"");if(S.test(A))M.s=isNaN(A)?null:A<0?-1:1;else{if(!E&&(A=A.replace(g,function(L,I,W){return x=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!T||T==x?I:L}),T&&(x=T,A=A.replace(b,"$1").replace($,"0.$1")),C!=A))return new _(A,x);if(_.DEBUG)throw Error(bignumberError+"Not a"+(T?" base "+T:"")+" number: "+C);M.s=null}M.c=M.e=null}}();function N(g,b,$,S){var P,M,C,E,T,x,A,L=g.c,I=POWS_TEN;if(L){e:{for(P=1,E=L[0];E>=10;E/=10,P++);if(M=b-P,M<0)M+=LOG_BASE,C=b,T=L[x=0],A=mathfloor(T/I[P-C-1]%10);else if(x=mathceil((M+1)/LOG_BASE),x>=L.length)if(S){for(;L.length<=x;L.push(0));T=A=0,P=1,M%=LOG_BASE,C=M-LOG_BASE+1}else break e;else{for(T=E=L[x],P=1;E>=10;E/=10,P++);M%=LOG_BASE,C=M-LOG_BASE+P,A=C<0?0:mathfloor(T/I[P-C-1]%10)}if(S=S||b<0||L[x+1]!=null||(C<0?T:T%I[P-C-1]),S=$<4?(A||S)&&($==0||$==(g.s<0?3:2)):A>5||A==5&&($==4||S||$==6&&(M>0?C>0?T/I[P-C]:0:L[x-1])%10&1||$==(g.s<0?8:7)),b<1||!L[0])return L.length=0,S?(b-=g.e+1,L[0]=I[(LOG_BASE-b%LOG_BASE)%LOG_BASE],g.e=-b||0):L[0]=g.e=0,g;if(M==0?(L.length=x,E=1,x--):(L.length=x+1,E=I[LOG_BASE-M],L[x]=C>0?mathfloor(T/I[P-C]%I[C])*E:0),S)for(;;)if(x==0){for(M=1,C=L[0];C>=10;C/=10,M++);for(C=L[0]+=E,E=1;C>=10;C/=10,E++);M!=E&&(g.e++,L[0]==BASE&&(L[0]=1));break}else{if(L[x]+=E,L[x]!=BASE)break;L[x--]=0,E=1}for(M=L.length;L[--M]===0;L.pop());}g.e>d?g.c=g.e=null:g.e<c&&(g.c=[g.e=0])}return g}function F(g){var b,$=g.e;return $===null?g.toString():(b=coeffToString(g.c),b=$<=l||$>=u?toExponential(b,$):toFixedPoint(b,$,"0"),g.s<0?"-"+b:b)}return r.absoluteValue=r.abs=function(){var g=new _(this);return g.s<0&&(g.s=1),g},r.comparedTo=function(g,b){return compare(this,new _(g,b))},r.decimalPlaces=r.dp=function(g,b){var $,S,P,M=this;if(g!=null)return intCheck(g,0,MAX),b==null?b=s:intCheck(b,0,8),N(new _(M),g+M.e+1,b);if(!($=M.c))return null;if(S=((P=$.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,P=$[P])for(;P%10==0;P/=10,S--);return S<0&&(S=0),S},r.dividedBy=r.div=function(g,b){return e(this,new _(g,b),o,s)},r.dividedToIntegerBy=r.idiv=function(g,b){return e(this,new _(g,b),0,1)},r.exponentiatedBy=r.pow=function(g,b){var $,S,P,M,C,E,T,x,A,L=this;if(g=new _(g),g.c&&!g.isInteger())throw Error(bignumberError+"Exponent not an integer: "+F(g));if(b!=null&&(b=new _(b)),E=g.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!g.c||!g.c[0])return A=new _(Math.pow(+F(L),E?g.s*(2-isOdd(g)):+F(g))),b?A.mod(b):A;if(T=g.s<0,b){if(b.c?!b.c[0]:!b.s)return new _(NaN);S=!T&&L.isInteger()&&b.isInteger(),S&&(L=L.mod(b))}else{if(g.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||E&&L.c[1]>=24e7:L.c[0]<8e13||E&&L.c[0]<=9999975e7)))return M=L.s<0&&isOdd(g)?-0:0,L.e>-1&&(M=1/M),new _(T?1/M:M);p&&(M=mathceil(p/LOG_BASE+2))}for(E?($=new _(.5),T&&(g.s=1),x=isOdd(g)):(P=Math.abs(+F(g)),x=P%2),A=new _(i);;){if(x){if(A=A.times(L),!A.c)break;M?A.c.length>M&&(A.c.length=M):S&&(A=A.mod(b))}if(P){if(P=mathfloor(P/2),P===0)break;x=P%2}else if(g=g.times($),N(g,g.e+1,1),g.e>14)x=isOdd(g);else{if(P=+F(g),P===0)break;x=P%2}L=L.times(L),M?L.c&&L.c.length>M&&(L.c.length=M):S&&(L=L.mod(b))}return S?A:(T&&(A=i.div(A)),b?A.mod(b):M?N(A,p,s,C):A)},r.integerValue=function(g){var b=new _(this);return g==null?g=s:intCheck(g,0,8),N(b,b.e+1,g)},r.isEqualTo=r.eq=function(g,b){return compare(this,new _(g,b))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(g,b){return compare(this,new _(g,b))>0},r.isGreaterThanOrEqualTo=r.gte=function(g,b){return(b=compare(this,new _(g,b)))===1||b===0},r.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},r.isLessThan=r.lt=function(g,b){return compare(this,new _(g,b))<0},r.isLessThanOrEqualTo=r.lte=function(g,b){return(b=compare(this,new _(g,b)))===-1||b===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(g,b){var $,S,P,M,C=this,E=C.s;if(g=new _(g,b),b=g.s,!E||!b)return new _(NaN);if(E!=b)return g.s=-b,C.plus(g);var T=C.e/LOG_BASE,x=g.e/LOG_BASE,A=C.c,L=g.c;if(!T||!x){if(!A||!L)return A?(g.s=-b,g):new _(L?C:NaN);if(!A[0]||!L[0])return L[0]?(g.s=-b,g):new _(A[0]?C:s==3?-0:0)}if(T=bitFloor(T),x=bitFloor(x),A=A.slice(),E=T-x){for((M=E<0)?(E=-E,P=A):(x=T,P=L),P.reverse(),b=E;b--;P.push(0));P.reverse()}else for(S=(M=(E=A.length)<(b=L.length))?E:b,E=b=0;b<S;b++)if(A[b]!=L[b]){M=A[b]<L[b];break}if(M&&(P=A,A=L,L=P,g.s=-g.s),b=(S=L.length)-($=A.length),b>0)for(;b--;A[$++]=0);for(b=BASE-1;S>E;){if(A[--S]<L[S]){for($=S;$&&!A[--$];A[$]=b);--A[$],A[S]+=BASE}A[S]-=L[S]}for(;A[0]==0;A.splice(0,1),--x);return A[0]?O(g,A,x):(g.s=s==3?-1:1,g.c=[g.e=0],g)},r.modulo=r.mod=function(g,b){var $,S,P=this;return g=new _(g,b),!P.c||!g.s||g.c&&!g.c[0]?new _(NaN):!g.c||P.c&&!P.c[0]?new _(P):(m==9?(S=g.s,g.s=1,$=e(P,g,0,3),g.s=S,$.s*=S):$=e(P,g,0,m),g=P.minus($.times(g)),!g.c[0]&&m==1&&(g.s=P.s),g)},r.multipliedBy=r.times=function(g,b){var $,S,P,M,C,E,T,x,A,L,I,W,z,U,B,V=this,H=V.c,G=(g=new _(g,b)).c;if(!H||!G||!H[0]||!G[0])return!V.s||!g.s||H&&!H[0]&&!G||G&&!G[0]&&!H?g.c=g.e=g.s=null:(g.s*=V.s,!H||!G?g.c=g.e=null:(g.c=[0],g.e=0)),g;for(S=bitFloor(V.e/LOG_BASE)+bitFloor(g.e/LOG_BASE),g.s*=V.s,T=H.length,L=G.length,T<L&&(z=H,H=G,G=z,P=T,T=L,L=P),P=T+L,z=[];P--;z.push(0));for(U=BASE,B=SQRT_BASE,P=L;--P>=0;){for($=0,I=G[P]%B,W=G[P]/B|0,C=T,M=P+C;M>P;)x=H[--C]%B,A=H[C]/B|0,E=W*x+A*I,x=I*x+E%B*B+z[M]+$,$=(x/U|0)+(E/B|0)+W*A,z[M--]=x%U;z[M]=$}return $?++S:z.splice(0,1),O(g,z,S)},r.negated=function(){var g=new _(this);return g.s=-g.s||null,g},r.plus=function(g,b){var $,S=this,P=S.s;if(g=new _(g,b),b=g.s,!P||!b)return new _(NaN);if(P!=b)return g.s=-b,S.minus(g);var M=S.e/LOG_BASE,C=g.e/LOG_BASE,E=S.c,T=g.c;if(!M||!C){if(!E||!T)return new _(P/0);if(!E[0]||!T[0])return T[0]?g:new _(E[0]?S:P*0)}if(M=bitFloor(M),C=bitFloor(C),E=E.slice(),P=M-C){for(P>0?(C=M,$=T):(P=-P,$=E),$.reverse();P--;$.push(0));$.reverse()}for(P=E.length,b=T.length,P-b<0&&($=T,T=E,E=$,b=P),P=0;b;)P=(E[--b]=E[b]+T[b]+P)/BASE|0,E[b]=BASE===E[b]?0:E[b]%BASE;return P&&(E=[P].concat(E),++C),O(g,E,C)},r.precision=r.sd=function(g,b){var $,S,P,M=this;if(g!=null&&g!==!!g)return intCheck(g,1,MAX),b==null?b=s:intCheck(b,0,8),N(new _(M),g,b);if(!($=M.c))return null;if(P=$.length-1,S=P*LOG_BASE+1,P=$[P]){for(;P%10==0;P/=10,S--);for(P=$[0];P>=10;P/=10,S++);}return g&&M.e+1>S&&(S=M.e+1),S},r.shiftedBy=function(g){return intCheck(g,-MAX_SAFE_INTEGER$1,MAX_SAFE_INTEGER$1),this.times("1e"+g)},r.squareRoot=r.sqrt=function(){var g,b,$,S,P,M=this,C=M.c,E=M.s,T=M.e,x=o+4,A=new _("0.5");if(E!==1||!C||!C[0])return new _(!E||E<0&&(!C||C[0])?NaN:C?M:1/0);if(E=Math.sqrt(+F(M)),E==0||E==1/0?(b=coeffToString(C),(b.length+T)%2==0&&(b+="0"),E=Math.sqrt(+b),T=bitFloor((T+1)/2)-(T<0||T%2),E==1/0?b="5e"+T:(b=E.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),$=new _(b)):$=new _(E+""),$.c[0]){for(T=$.e,E=T+x,E<3&&(E=0);;)if(P=$,$=A.times(P.plus(e(M,P,x,1))),coeffToString(P.c).slice(0,E)===(b=coeffToString($.c)).slice(0,E))if($.e<T&&--E,b=b.slice(E-3,E+1),b=="9999"||!S&&b=="4999"){if(!S&&(N(P,P.e+o+2,0),P.times(P).eq(M))){$=P;break}x+=4,E+=4,S=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(N($,$.e+o+2,1),g=!$.times($).eq(M));break}}return N($,$.e+o+1,s,g)},r.toExponential=function(g,b){return g!=null&&(intCheck(g,0,MAX),g++),D(this,g,b,1)},r.toFixed=function(g,b){return g!=null&&(intCheck(g,0,MAX),g=g+this.e+1),D(this,g,b)},r.toFormat=function(g,b,$){var S,P=this;if($==null)g!=null&&b&&typeof b=="object"?($=b,b=null):g&&typeof g=="object"?($=g,g=b=null):$=v;else if(typeof $!="object")throw Error(bignumberError+"Argument not an object: "+$);if(S=P.toFixed(g,b),P.c){var M,C=S.split("."),E=+$.groupSize,T=+$.secondaryGroupSize,x=$.groupSeparator||"",A=C[0],L=C[1],I=P.s<0,W=I?A.slice(1):A,z=W.length;if(T&&(M=E,E=T,T=M,z-=M),E>0&&z>0){for(M=z%E||E,A=W.substr(0,M);M<z;M+=E)A+=x+W.substr(M,E);T>0&&(A+=x+W.slice(M)),I&&(A="-"+A)}S=L?A+($.decimalSeparator||"")+((T=+$.fractionGroupSize)?L.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+($.fractionGroupSeparator||"")):L):A}return($.prefix||"")+S+($.suffix||"")},r.toFraction=function(g){var b,$,S,P,M,C,E,T,x,A,L,I,W=this,z=W.c;if(g!=null&&(E=new _(g),!E.isInteger()&&(E.c||E.s!==1)||E.lt(i)))throw Error(bignumberError+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+F(E));if(!z)return new _(W);for(b=new _(i),x=$=new _(i),S=T=new _(i),I=coeffToString(z),M=b.e=I.length-W.e-1,b.c[0]=POWS_TEN[(C=M%LOG_BASE)<0?LOG_BASE+C:C],g=!g||E.comparedTo(b)>0?M>0?b:x:E,C=d,d=1/0,E=new _(I),T.c[0]=0;A=e(E,b,0,1),P=$.plus(A.times(S)),P.comparedTo(g)!=1;)$=S,S=P,x=T.plus(A.times(P=x)),T=P,b=E.minus(A.times(P=b)),E=P;return P=e(g.minus($),S,0,1),T=T.plus(P.times(x)),$=$.plus(P.times(S)),T.s=x.s=W.s,M=M*2,L=e(x,S,M,s).minus(W).abs().comparedTo(e(T,$,M,s).minus(W).abs())<1?[x,S]:[T,$],d=C,L},r.toNumber=function(){return+F(this)},r.toPrecision=function(g,b){return g!=null&&intCheck(g,1,MAX),D(this,g,b,2)},r.toString=function(g){var b,$=this,S=$.s,P=$.e;return P===null?S?(b="Infinity",S<0&&(b="-"+b)):b="NaN":(g==null?b=P<=l||P>=u?toExponential(coeffToString($.c),P):toFixedPoint(coeffToString($.c),P,"0"):g===10&&w?($=N(new _($),o+P+1,s),b=toFixedPoint(coeffToString($.c),$.e,"0")):(intCheck(g,2,y.length,"Base"),b=a(toFixedPoint(coeffToString($.c),P,"0"),10,g,S,!0)),S<0&&$.c[0]&&(b="-"+b)),b},r.valueOf=r.toJSON=function(){return F(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,t!=null&&_.set(t),_}function bitFloor(t){var e=t|0;return t>0||t===e?e:e-1}function coeffToString(t){for(var e,a,n=1,r=t.length,i=t[0]+"";n<r;){for(e=t[n++]+"",a=LOG_BASE-e.length;a--;e="0"+e);i+=e}for(r=i.length;i.charCodeAt(--r)===48;);return i.slice(0,r+1||1)}function compare(t,e){var a,n,r=t.c,i=e.c,o=t.s,s=e.s,l=t.e,u=e.e;if(!o||!s)return null;if(a=r&&!r[0],n=i&&!i[0],a||n)return a?n?0:-s:o;if(o!=s)return o;if(a=o<0,n=l==u,!r||!i)return n?0:!r^a?1:-1;if(!n)return l>u^a?1:-1;for(s=(l=r.length)<(u=i.length)?l:u,o=0;o<s;o++)if(r[o]!=i[o])return r[o]>i[o]^a?1:-1;return l==u?0:l>u^a?1:-1}function intCheck(t,e,a,n){if(t<e||t>a||t!==mathfloor(t))throw Error(bignumberError+(n||"Argument")+(typeof t=="number"?t<e||t>a?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function isOdd(t){var e=t.c.length-1;return bitFloor(t.e/LOG_BASE)==e&&t.c[e]%2!=0}function toExponential(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function toFixedPoint(t,e,a){var n,r;if(e<0){for(r=a+".";++e;r+=a);t=r+t}else if(n=t.length,++e>n){for(r=a,e-=n;--e;r+=a);t+=r}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}var BigNumber=clone(),RoundingModeMap;(function(t){t[t.up=BigNumber.ROUND_UP]="up",t[t.down=BigNumber.ROUND_DOWN]="down",t[t.truncate=BigNumber.ROUND_DOWN]="truncate",t[t.halfUp=BigNumber.ROUND_HALF_UP]="halfUp",t[t.default=BigNumber.ROUND_HALF_UP]="default",t[t.halfDown=BigNumber.ROUND_HALF_DOWN]="halfDown",t[t.halfEven=BigNumber.ROUND_HALF_EVEN]="halfEven",t[t.banker=BigNumber.ROUND_HALF_EVEN]="banker",t[t.ceiling=BigNumber.ROUND_CEIL]="ceiling",t[t.ceil=BigNumber.ROUND_CEIL]="ceil",t[t.floor=BigNumber.ROUND_FLOOR]="floor"})(RoundingModeMap||(RoundingModeMap={}));function expandRoundMode(t){var e;return(e=RoundingModeMap[t])!==null&&e!==void 0?e:RoundingModeMap.default}var MAX_SAFE_INTEGER=9007199254740991,nativeFloor=Math.floor;function baseRepeat$1(t,e){var a="";if(!t||e<1||e>MAX_SAFE_INTEGER)return a;do e%2&&(a+=t),e=nativeFloor(e/2),e&&(t+=t);while(e);return a}var _baseRepeat=baseRepeat$1,isFunction=isFunction_1,isLength$1=isLength_1;function isArrayLike$4(t){return t!=null&&isLength$1(t.length)&&!isFunction(t)}var isArrayLike_1=isArrayLike$4,eq$1=eq_1,isArrayLike$3=isArrayLike_1,isIndex$1=_isIndex,isObject$2=isObject_1;function isIterateeCall$3(t,e,a){if(!isObject$2(a))return!1;var n=typeof e;return(n=="number"?isArrayLike$3(a)&&isIndex$1(e,a.length):n=="string"&&e in a)?eq$1(a[e],t):!1}var _isIterateeCall=isIterateeCall$3,reWhitespace=/\s/;function trimmedEndIndex$1(t){for(var e=t.length;e--&&reWhitespace.test(t.charAt(e)););return e}var _trimmedEndIndex=trimmedEndIndex$1,trimmedEndIndex=_trimmedEndIndex,reTrimStart=/^\s+/;function baseTrim$1(t){return t&&t.slice(0,trimmedEndIndex(t)+1).replace(reTrimStart,"")}var _baseTrim=baseTrim$1,baseTrim=_baseTrim,isObject$1=isObject_1,isSymbol$1=isSymbol_1,NAN=0/0,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber$1(t){if(typeof t=="number")return t;if(isSymbol$1(t))return NAN;if(isObject$1(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=isObject$1(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=baseTrim(t);var a=reIsBinary.test(t);return a||reIsOctal.test(t)?freeParseInt(t.slice(2),a?2:8):reIsBadHex.test(t)?NAN:+t}var toNumber_1=toNumber$1,toNumber=toNumber_1,INFINITY$1=1/0,MAX_INTEGER=17976931348623157e292;function toFinite$2(t){if(!t)return t===0?t:0;if(t=toNumber(t),t===INFINITY$1||t===-INFINITY$1){var e=t<0?-1:1;return e*MAX_INTEGER}return t===t?t:0}var toFinite_1=toFinite$2,toFinite$1=toFinite_1;function toInteger$1(t){var e=toFinite$1(t),a=e%1;return e===e?a?e-a:e:0}var toInteger_1=toInteger$1,baseRepeat=_baseRepeat,isIterateeCall$2=_isIterateeCall,toInteger=toInteger_1,toString=toString_1;function repeat(t,e,a){return(a?isIterateeCall$2(t,e,a):e===void 0)?e=1:e=toInteger(e),baseRepeat(toString(t),e)}var repeat_1=repeat;const repeat$1=getDefaultExportFromCjs(repeat_1);function digitCount(t){return t.isZero()?1:Math.floor(Math.log10(t.abs().toNumber())+1)}function getAbsolutePrecision(t,{precision:e,significant:a}){return a&&e!==null&&e>0?e-digitCount(t):e}function roundNumber(t,e){const a=getAbsolutePrecision(t,e);if(a===null)return t.toString();const n=expandRoundMode(e.roundMode);if(a>=0)return t.toFixed(a,n);const r=Math.pow(10,Math.abs(a));return t=new BigNumber(t.div(r).toFixed(0,n)).times(r),t.toString()}function replaceInFormat(t,{formattedNumber:e,unit:a}){return t.replace("%n",e).replace("%u",a)}function computeSignificand({significand:t,whole:e,precision:a}){if(e==="0"||a===null)return t;const n=Math.max(0,a-e.length);return(t??"").substr(0,n)}function formatNumber(t,e){var a,n,r;const i=new BigNumber(t);if(e.raise&&!i.isFinite())throw new Error(`"${t}" is not a valid numeric value`);const o=roundNumber(i,e),s=new BigNumber(o),l=s.lt(0),u=s.isZero();let[c,d]=o.split(".");const h=[];let m;const p=(a=e.format)!==null&&a!==void 0?a:"%n",v=(n=e.negativeFormat)!==null&&n!==void 0?n:`-${p}`,y=l&&!u?v:p;for(c=c.replace("-","");c.length>0;)h.unshift(c.substr(Math.max(0,c.length-3),3)),c=c.substr(0,c.length-3);return c=h.join(""),m=h.join(e.delimiter),e.significant?d=computeSignificand({whole:c,significand:d,precision:e.precision}):d=d??repeat$1("0",(r=e.precision)!==null&&r!==void 0?r:0),e.stripInsignificantZeros&&d&&(d=d.replace(/0+$/,"")),i.isNaN()&&(m=t.toString()),d&&i.isFinite()&&(m+=(e.separator||".")+d),replaceInFormat(y,{formattedNumber:m,unit:e.unit})}function getFullScope(t,e,a){let n="";return(e instanceof String||typeof e=="string")&&(n=e),e instanceof Array&&(n=e.join(t.defaultSeparator)),a.scope&&(n=[a.scope,n].join(t.defaultSeparator)),n}function inferType(t){var e,a;if(t===null)return"null";const n=typeof t;return n!=="object"?n:((a=(e=t==null?void 0:t.constructor)===null||e===void 0?void 0:e.name)===null||a===void 0?void 0:a.toLowerCase())||"object"}function interpolate(t,e,a){a=Object.keys(a).reduce((r,i)=>(r[t.transformKey(i)]=a[i],r),{});const n=e.match(t.placeholder);if(!n)return e;for(;n.length;){let r;const i=n.shift(),o=i.replace(t.placeholder,"$1");isSet(a[o])?r=a[o].toString().replace(/\$/gm,"_#$#_"):o in a?r=t.nullPlaceholder(t,i,e,a):r=t.missingPlaceholder(t,i,e,a);const s=new RegExp(i.replace(/\{/gm,"\\{").replace(/\}/gm,"\\}"));e=e.replace(s,r)}return e.replace(/_#\$#_/g,"$")}function lookup(t,e,a={}){a=Object.assign({},a);const n="locale"in a?a.locale:t.locale,r=inferType(n),i=t.locales.get(r==="string"?n:typeof n).slice();e=getFullScope(t,e,a).split(t.defaultSeparator).map(s=>t.transformKey(s)).join(".");const o=i.map(s=>get$2(t.translations,[s,e].join(".")));return o.push(a.defaultValue),o.find(s=>isSet(s))}function numberToDelimited(t,e){const a=new BigNumber(t);if(!a.isFinite())return t.toString();if(!e.delimiterPattern.global)throw new Error(`options.delimiterPattern must be a global regular expression; received ${e.delimiterPattern}`);let[n,r]=a.toString().split(".");return n=n.replace(e.delimiterPattern,i=>`${i}${e.delimiter}`),[n,r].filter(Boolean).join(e.separator)}function arrayPush$2(t,e){for(var a=-1,n=e.length,r=t.length;++a<n;)t[r+a]=e[a];return t}var _arrayPush=arrayPush$2,Symbol$2=_Symbol,isArguments$1=isArguments_1,isArray$5=isArray_1,spreadableSymbol=Symbol$2?Symbol$2.isConcatSpreadable:void 0;function isFlattenable$1(t){return isArray$5(t)||isArguments$1(t)||!!(spreadableSymbol&&t&&t[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush$1=_arrayPush,isFlattenable=_isFlattenable;function baseFlatten$2(t,e,a,n,r){var i=-1,o=t.length;for(a||(a=isFlattenable),r||(r=[]);++i<o;){var s=t[i];e>0&&a(s)?e>1?baseFlatten$2(s,e-1,a,n,r):arrayPush$1(r,s):n||(r[r.length]=s)}return r}var _baseFlatten=baseFlatten$2,ListCache$2=_ListCache;function stackClear$1(){this.__data__=new ListCache$2,this.size=0}var _stackClear=stackClear$1;function stackDelete$1(t){var e=this.__data__,a=e.delete(t);return this.size=e.size,a}var _stackDelete=stackDelete$1;function stackGet$1(t){return this.__data__.get(t)}var _stackGet=stackGet$1;function stackHas$1(t){return this.__data__.has(t)}var _stackHas=stackHas$1,ListCache$1=_ListCache,Map$2=_Map,MapCache=_MapCache,LARGE_ARRAY_SIZE=200;function stackSet$1(t,e){var a=this.__data__;if(a instanceof ListCache$1){var n=a.__data__;if(!Map$2||n.length<LARGE_ARRAY_SIZE-1)return n.push([t,e]),this.size=++a.size,this;a=this.__data__=new MapCache(n)}return a.set(t,e),this.size=a.size,this}var _stackSet=stackSet$1,ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$2(t){var e=this.__data__=new ListCache(t);this.size=e.size}Stack$2.prototype.clear=stackClear;Stack$2.prototype.delete=stackDelete;Stack$2.prototype.get=stackGet;Stack$2.prototype.has=stackHas;Stack$2.prototype.set=stackSet;var _Stack=Stack$2;function arraySome$1(t,e){for(var a=-1,n=t==null?0:t.length;++a<n;)if(e(t[a],a,t))return!0;return!1}var _arraySome=arraySome$1,SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays$2(t,e,a,n,r,i){var o=a&COMPARE_PARTIAL_FLAG$5,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(t),c=i.get(e);if(u&&c)return u==e&&c==t;var d=-1,h=!0,m=a&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(i.set(t,e),i.set(e,t);++d<s;){var p=t[d],v=e[d];if(n)var y=o?n(v,p,d,e,t,i):n(p,v,d,t,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(m){if(!arraySome(e,function(w,_){if(!cacheHas(m,_)&&(p===w||r(p,w,a,n,i)))return m.push(_)})){h=!1;break}}else if(!(p===v||r(p,v,a,n,i))){h=!1;break}}return i.delete(t),i.delete(e),h}var _equalArrays=equalArrays$2,root$3=_root,Uint8Array$2=root$3.Uint8Array,_Uint8Array=Uint8Array$2;function mapToArray$1(t){var e=-1,a=Array(t.size);return t.forEach(function(n,r){a[++e]=[r,n]}),a}var _mapToArray=mapToArray$1,Symbol$1=_Symbol,Uint8Array$1=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(t,e,a,n,r,i,o){switch(a){case dataViewTag$2:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case arrayBufferTag$1:return!(t.byteLength!=e.byteLength||!i(new Uint8Array$1(t),new Uint8Array$1(e)));case boolTag$1:case dateTag$1:case numberTag$1:return eq(+t,+e);case errorTag$1:return t.name==e.name&&t.message==e.message;case regexpTag$1:case stringTag$1:return t==e+"";case mapTag$2:var s=mapToArray;case setTag$2:var l=n&COMPARE_PARTIAL_FLAG$4;if(s||(s=setToArray),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=COMPARE_UNORDERED_FLAG$2,o.set(t,e);var c=equalArrays$1(s(t),s(e),n,r,i,o);return o.delete(t),c;case symbolTag:if(symbolValueOf)return symbolValueOf.call(t)==symbolValueOf.call(e)}return!1}var _equalByTag=equalByTag$1,arrayPush=_arrayPush,isArray$4=isArray_1;function baseGetAllKeys$1(t,e,a){var n=e(t);return isArray$4(t)?n:arrayPush(n,a(t))}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(t,e){for(var a=-1,n=t==null?0:t.length,r=0,i=[];++a<n;){var o=t[a];e(o,a,t)&&(i[r++]=o)}return i}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[]}var stubArray_1=stubArray$1,arrayFilter=_arrayFilter,stubArray=stubArray_1,objectProto$5=Object.prototype,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols$1=nativeGetSymbols?function(t){return t==null?[]:(t=Object(t),arrayFilter(nativeGetSymbols(t),function(e){return propertyIsEnumerable.call(t,e)}))}:stubArray,_getSymbols=getSymbols$1;function baseTimes$1(t,e){for(var a=-1,n=Array(t);++a<t;)n[a]=e(a);return n}var _baseTimes=baseTimes$1,isBuffer$2={exports:{}};function stubFalse(){return!1}var stubFalse_1=stubFalse;isBuffer$2.exports;(function(t,e){var a=_root,n=stubFalse_1,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o?a.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;t.exports=u})(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports,baseGetTag$1=_baseGetTag,isLength=isLength_1,isObjectLike$1=isObjectLike_1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0;typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=!1;function baseIsTypedArray$1(t){return isObjectLike$1(t)&&isLength(t.length)&&!!typedArrayTags[baseGetTag$1(t)]}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$2(t){return function(e){return t(e)}}var _baseUnary=baseUnary$2,_nodeUtil={exports:{}};_nodeUtil.exports;(function(t,e){var a=_freeGlobal,n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i&&a.process,s=function(){try{var l=r&&r.require&&r.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s})(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports,baseIsTypedArray=_baseIsTypedArray,baseUnary$1=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray$2=nodeIsTypedArray?baseUnary$1(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$2,baseTimes=_baseTimes,isArguments=isArguments_1,isArray$3=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(t,e){var a=isArray$3(t),n=!a&&isArguments(t),r=!a&&!n&&isBuffer$1(t),i=!a&&!n&&!r&&isTypedArray$1(t),o=a||n||r||i,s=o?baseTimes(t.length,String):[],l=s.length;for(var u in t)(e||hasOwnProperty$3.call(t,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||isIndex(u,l)))&&s.push(u);return s}var _arrayLikeKeys=arrayLikeKeys$1,objectProto$3=Object.prototype;function isPrototype$1(t){var e=t&&t.constructor,a=typeof e=="function"&&e.prototype||objectProto$3;return t===a}var _isPrototype=isPrototype$1;function overArg$1(t,e){return function(a){return t(e(a))}}var _overArg=overArg$1,overArg=_overArg,nativeKeys$1=overArg(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype=_isPrototype,nativeKeys=_nativeKeys,objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(t){if(!isPrototype(t))return nativeKeys(t);var e=[];for(var a in Object(t))hasOwnProperty$2.call(t,a)&&a!="constructor"&&e.push(a);return e}var _baseKeys=baseKeys$1,arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike$2=isArrayLike_1;function keys$3(t){return isArrayLike$2(t)?arrayLikeKeys(t):baseKeys(t)}var keys_1=keys$3,baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys$2=keys_1;function getAllKeys$1(t){return baseGetAllKeys(t,keys$2,getSymbols)}var _getAllKeys=getAllKeys$1,getAllKeys=_getAllKeys,COMPARE_PARTIAL_FLAG$3=1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(t,e,a,n,r,i){var o=a&COMPARE_PARTIAL_FLAG$3,s=getAllKeys(t),l=s.length,u=getAllKeys(e),c=u.length;if(l!=c&&!o)return!1;for(var d=l;d--;){var h=s[d];if(!(o?h in e:hasOwnProperty$1.call(e,h)))return!1}var m=i.get(t),p=i.get(e);if(m&&p)return m==e&&p==t;var v=!0;i.set(t,e),i.set(e,t);for(var y=o;++d<l;){h=s[d];var w=t[h],_=e[h];if(n)var D=o?n(_,w,h,e,t,i):n(w,_,h,t,e,i);if(!(D===void 0?w===_||r(w,_,a,n,i):D)){v=!1;break}y||(y=h=="constructor")}if(v&&!y){var k=t.constructor,O=e.constructor;k!=O&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof O=="function"&&O instanceof O)&&(v=!1)}return i.delete(t),i.delete(e),v}var _equalObjects=equalObjects$1,getNative$2=_getNative,root$2=_root,DataView$1=getNative$2(root$2,"DataView"),_DataView=DataView$1,getNative$1=_getNative,root$1=_root,Promise$2=getNative$1(root$1,"Promise"),_Promise=Promise$2,getNative=_getNative,root=_root,WeakMap$2=getNative(root,"WeakMap"),_WeakMap=WeakMap$2,DataView=_DataView,Map$1=_Map,Promise$1=_Promise,Set$1=_Set,WeakMap$1=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource,mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]",dataViewTag="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag$1=baseGetTag;(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map$1&&getTag$1(new Map$1)!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set$1&&getTag$1(new Set$1)!=setTag||WeakMap$1&&getTag$1(new WeakMap$1)!=weakMapTag)&&(getTag$1=function(t){var e=baseGetTag(t),a=e==objectTag$1?t.constructor:void 0,n=a?toSource(a):"";if(n)switch(n){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return e});var _getTag=getTag$1,Stack$1=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray$2=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1,COMPARE_PARTIAL_FLAG$2=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(t,e,a,n,r,i){var o=isArray$2(t),s=isArray$2(e),l=o?arrayTag:getTag(t),u=s?arrayTag:getTag(e);l=l==argsTag?objectTag:l,u=u==argsTag?objectTag:u;var c=l==objectTag,d=u==objectTag,h=l==u;if(h&&isBuffer(t)){if(!isBuffer(e))return!1;o=!0,c=!1}if(h&&!c)return i||(i=new Stack$1),o||isTypedArray(t)?equalArrays(t,e,a,n,r,i):equalByTag(t,e,l,a,n,r,i);if(!(a&COMPARE_PARTIAL_FLAG$2)){var m=c&&hasOwnProperty.call(t,"__wrapped__"),p=d&&hasOwnProperty.call(e,"__wrapped__");if(m||p){var v=m?t.value():t,y=p?e.value():e;return i||(i=new Stack$1),r(v,y,a,n,i)}}return h?(i||(i=new Stack$1),equalObjects(t,e,a,n,r,i)):!1}var _baseIsEqualDeep=baseIsEqualDeep$1,baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$2(t,e,a,n,r){return t===e?!0:t==null||e==null||!isObjectLike(t)&&!isObjectLike(e)?t!==t&&e!==e:baseIsEqualDeep(t,e,a,n,baseIsEqual$2,r)}var _baseIsEqual=baseIsEqual$2,Stack=_Stack,baseIsEqual$1=_baseIsEqual,COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch$1(t,e,a,n){var r=a.length,i=r,o=!n;if(t==null)return!i;for(t=Object(t);r--;){var s=a[r];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++r<i;){s=a[r];var l=s[0],u=t[l],c=s[1];if(o&&s[2]){if(u===void 0&&!(l in t))return!1}else{var d=new Stack;if(n)var h=n(u,c,l,t,e,d);if(!(h===void 0?baseIsEqual$1(c,u,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,n,d):h))return!1}}return!0}var _baseIsMatch=baseIsMatch$1,isObject=isObject_1;function isStrictComparable$2(t){return t===t&&!isObject(t)}var _isStrictComparable=isStrictComparable$2,isStrictComparable$1=_isStrictComparable,keys$1=keys_1;function getMatchData$1(t){for(var e=keys$1(t),a=e.length;a--;){var n=e[a],r=t[n];e[a]=[n,r,isStrictComparable$1(r)]}return e}var _getMatchData=getMatchData$1;function matchesStrictComparable$2(t,e){return function(a){return a==null?!1:a[t]===e&&(e!==void 0||t in Object(a))}}var _matchesStrictComparable=matchesStrictComparable$2,baseIsMatch=_baseIsMatch,getMatchData=_getMatchData,matchesStrictComparable$1=_matchesStrictComparable;function baseMatches$1(t){var e=getMatchData(t);return e.length==1&&e[0][2]?matchesStrictComparable$1(e[0][0],e[0][1]):function(a){return a===t||baseIsMatch(a,t,e)}}var _baseMatches=baseMatches$1;function baseHasIn$1(t,e){return t!=null&&e in Object(t)}var _baseHasIn=baseHasIn$1,baseHasIn=_baseHasIn,hasPath=_hasPath;function hasIn$1(t,e){return t!=null&&hasPath(t,e,baseHasIn)}var hasIn_1=hasIn$1,baseIsEqual=_baseIsEqual,get=get_1,hasIn=hasIn_1,isKey$1=_isKey,isStrictComparable=_isStrictComparable,matchesStrictComparable=_matchesStrictComparable,toKey$1=_toKey,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty$1(t,e){return isKey$1(t)&&isStrictComparable(e)?matchesStrictComparable(toKey$1(t),e):function(a){var n=get(a,t);return n===void 0&&n===e?hasIn(a,t):baseIsEqual(e,n,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}var _baseMatchesProperty=baseMatchesProperty$1;function identity$4(t){return t}var identity_1=identity$4;function baseProperty$1(t){return function(e){return e==null?void 0:e[t]}}var _baseProperty=baseProperty$1,baseGet$1=_baseGet;function basePropertyDeep$1(t){return function(e){return baseGet$1(e,t)}}var _basePropertyDeep=basePropertyDeep$1,baseProperty=_baseProperty,basePropertyDeep=_basePropertyDeep,isKey=_isKey,toKey=_toKey;function property$1(t){return isKey(t)?baseProperty(toKey(t)):basePropertyDeep(t)}var property_1=property$1,baseMatches=_baseMatches,baseMatchesProperty=_baseMatchesProperty,identity$3=identity_1,isArray$1=isArray_1,property=property_1;function baseIteratee$1(t){return typeof t=="function"?t:t==null?identity$3:typeof t=="object"?isArray$1(t)?baseMatchesProperty(t[0],t[1]):baseMatches(t):property(t)}var _baseIteratee=baseIteratee$1;function createBaseFor$1(t){return function(e,a,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var l=o[t?s:++r];if(a(i[l],l,i)===!1)break}return e}}var _createBaseFor=createBaseFor$1,createBaseFor=_createBaseFor,baseFor$1=createBaseFor(),_baseFor=baseFor$1,baseFor=_baseFor,keys=keys_1;function baseForOwn$1(t,e){return t&&baseFor(t,e,keys)}var _baseForOwn=baseForOwn$1,isArrayLike$1=isArrayLike_1;function createBaseEach$1(t,e){return function(a,n){if(a==null)return a;if(!isArrayLike$1(a))return t(a,n);for(var r=a.length,i=e?r:-1,o=Object(a);(e?i--:++i<r)&&n(o[i],i,o)!==!1;);return a}}var _createBaseEach=createBaseEach$1,baseForOwn=_baseForOwn,createBaseEach=_createBaseEach,baseEach$1=createBaseEach(baseForOwn),_baseEach=baseEach$1,baseEach=_baseEach,isArrayLike=isArrayLike_1;function baseMap$1(t,e){var a=-1,n=isArrayLike(t)?Array(t.length):[];return baseEach(t,function(r,i,o){n[++a]=e(r,i,o)}),n}var _baseMap=baseMap$1;function baseSortBy$1(t,e){var a=t.length;for(t.sort(e);a--;)t[a]=t[a].value;return t}var _baseSortBy=baseSortBy$1,isSymbol=isSymbol_1;function compareAscending$1(t,e){if(t!==e){var a=t!==void 0,n=t===null,r=t===t,i=isSymbol(t),o=e!==void 0,s=e===null,l=e===e,u=isSymbol(e);if(!s&&!u&&!i&&t>e||i&&o&&l&&!s&&!u||n&&o&&l||!a&&l||!r)return 1;if(!n&&!i&&!u&&t<e||u&&a&&r&&!n&&!i||s&&a&&r||!o&&r||!l)return-1}return 0}var _compareAscending=compareAscending$1,compareAscending=_compareAscending;function compareMultiple$1(t,e,a){for(var n=-1,r=t.criteria,i=e.criteria,o=r.length,s=a.length;++n<o;){var l=compareAscending(r[n],i[n]);if(l){if(n>=s)return l;var u=a[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}var _compareMultiple=compareMultiple$1,arrayMap=_arrayMap,baseGet=_baseGet,baseIteratee=_baseIteratee,baseMap=_baseMap,baseSortBy=_baseSortBy,baseUnary=_baseUnary,compareMultiple=_compareMultiple,identity$2=identity_1,isArray=isArray_1;function baseOrderBy$1(t,e,a){e.length?e=arrayMap(e,function(i){return isArray(i)?function(o){return baseGet(o,i.length===1?i[0]:i)}:i}):e=[identity$2];var n=-1;e=arrayMap(e,baseUnary(baseIteratee));var r=baseMap(t,function(i,o,s){var l=arrayMap(e,function(u){return u(i)});return{criteria:l,index:++n,value:i}});return baseSortBy(r,function(i,o){return compareMultiple(i,o,a)})}var _baseOrderBy=baseOrderBy$1;function apply$1(t,e,a){switch(a.length){case 0:return t.call(e);case 1:return t.call(e,a[0]);case 2:return t.call(e,a[0],a[1]);case 3:return t.call(e,a[0],a[1],a[2])}return t.apply(e,a)}var _apply=apply$1,apply=_apply,nativeMax$1=Math.max;function overRest$1(t,e,a){return e=nativeMax$1(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,i=nativeMax$1(n.length-e,0),o=Array(i);++r<i;)o[r]=n[e+r];r=-1;for(var s=Array(e+1);++r<e;)s[r]=n[r];return s[e]=a(o),apply(t,this,s)}}var _overRest=overRest$1;function constant$1(t){return function(){return t}}var constant_1=constant$1,constant=constant_1,defineProperty=_defineProperty,identity$1=identity_1,baseSetToString$1=defineProperty?function(t,e){return defineProperty(t,"toString",{configurable:!0,enumerable:!1,value:constant(e),writable:!0})}:identity$1,_baseSetToString=baseSetToString$1,HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut$1(t){var e=0,a=0;return function(){var n=nativeNow(),r=HOT_SPAN-(n-a);if(a=n,r>0){if(++e>=HOT_COUNT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var _shortOut=shortOut$1,baseSetToString=_baseSetToString,shortOut=_shortOut,setToString$1=shortOut(baseSetToString),_setToString=setToString$1,identity=identity_1,overRest=_overRest,setToString=_setToString;function baseRest$1(t,e){return setToString(overRest(t,e,identity),t+"")}var _baseRest=baseRest$1,baseFlatten$1=_baseFlatten,baseOrderBy=_baseOrderBy,baseRest=_baseRest,isIterateeCall$1=_isIterateeCall,sortBy=baseRest(function(t,e){if(t==null)return[];var a=e.length;return a>1&&isIterateeCall$1(t,e[0],e[1])?e=[]:a>2&&isIterateeCall$1(e[0],e[1],e[2])&&(e=[e[0]]),baseOrderBy(t,baseFlatten$1(e,1),[])}),sortBy_1=sortBy;const sortBy$1=getDefaultExportFromCjs(sortBy_1);function baseZipObject$1(t,e,a){for(var n=-1,r=t.length,i=e.length,o={};++n<r;){var s=n<i?e[n]:void 0;a(o,t[n],s)}return o}var _baseZipObject=baseZipObject$1,assignValue=_assignValue,baseZipObject=_baseZipObject;function zipObject(t,e){return baseZipObject(t||[],e||[],assignValue)}var zipObject_1=zipObject;const zipObject$1=getDefaultExportFromCjs(zipObject_1),DECIMAL_UNITS={0:"unit",1:"ten",2:"hundred",3:"thousand",6:"million",9:"billion",12:"trillion",15:"quadrillion","-1":"deci","-2":"centi","-3":"mili","-6":"micro","-9":"nano","-12":"pico","-15":"femto"},INVERTED_DECIMAL_UNITS=zipObject$1(Object.values(DECIMAL_UNITS),Object.keys(DECIMAL_UNITS).map(t=>parseInt(t,10)));function numberToHuman(t,e,a){const n={roundMode:a.roundMode,precision:a.precision,significant:a.significant};let r;if(inferType(a.units)==="string"){const d=a.units;if(r=lookup(t,d),!r)throw new Error(`The scope "${t.locale}${t.defaultSeparator}${getFullScope(t,d,{})}" couldn't be found`)}else r=a.units;let i=roundNumber(new BigNumber(e),n);const o=d=>sortBy$1(Object.keys(d).map(h=>INVERTED_DECIMAL_UNITS[h]),h=>h*-1),s=(d,h)=>{const m=d.isZero()?0:Math.floor(Math.log10(d.abs().toNumber()));return o(h).find(p=>m>=p)||0},l=(d,h)=>{const m=DECIMAL_UNITS[h.toString()];return d[m]||""},u=s(new BigNumber(i),r),c=l(r,u);if(i=roundNumber(new BigNumber(i).div(Math.pow(10,u)),n),a.stripInsignificantZeros){let[d,h]=i.split(".");h=(h||"").replace(/0+$/,""),i=d,h&&(i+=`${a.separator}${h}`)}return a.format.replace("%n",i||"0").replace("%u",c).trim()}const STORAGE_UNITS=["byte","kb","mb","gb","tb","pb","eb"];function numberToHumanSize(t,e,a){const n=expandRoundMode(a.roundMode),r=1024,i=new BigNumber(e).abs(),o=i.lt(r);let s;const l=(p,v)=>{const y=v.length-1,w=new BigNumber(Math.log(p.toNumber())).div(Math.log(r)).integerValue(BigNumber.ROUND_DOWN).toNumber();return Math.min(y,w)},u=p=>`number.human.storage_units.units.${o?"byte":p[c]}`,c=l(i,STORAGE_UNITS);o?s=i.integerValue():s=new BigNumber(roundNumber(i.div(Math.pow(r,c)),{significant:a.significant,precision:a.precision,roundMode:a.roundMode}));const d=t.translate("number.human.storage_units.format",{defaultValue:"%n %u"}),h=t.translate(u(STORAGE_UNITS),{count:i.integerValue().toNumber()});let m=s.toFixed(a.precision,n);return a.stripInsignificantZeros&&(m=m.replace(/(\..*?)0+$/,"$1").replace(/\.$/,"")),d.replace("%n",m).replace("%u",h)}function parseDate(t){if(t instanceof Date)return t;if(typeof t=="number"){const n=new Date;return n.setTime(t),n}const e=new String(t).match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})(?:[.,](\d{1,3}))?)?(Z|\+00:?00)?/);if(e){const n=e.slice(1,8).map(h=>parseInt(h,10)||0);n[1]-=1;const[r,i,o,s,l,u,c]=n;return e[8]?new Date(Date.UTC(r,i,o,s,l,u,c)):new Date(r,i,o,s,l,u,c)}t.match(/([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d+:\d+:\d+) ([+-]\d+) (\d+)/)&&new Date().setTime(Date.parse([RegExp.$1,RegExp.$2,RegExp.$3,RegExp.$6,RegExp.$4,RegExp.$5].join(" ")));const a=new Date;return a.setTime(Date.parse(t)),a}function pluralize({i18n:t,count:e,scope:a,options:n,baseScope:r}){n=Object.assign({},n);let i,o;if(typeof a=="object"&&a?i=a:i=lookup(t,a,n),!i)return t.missingTranslation.get(a,n);const l=t.pluralization.get(n.locale)(t,e),u=[];for(;l.length;){const c=l.shift();if(isSet(i[c])){o=i[c];break}u.push(c)}return isSet(o)?(n.count=e,t.interpolate(t,o,n)):t.missingTranslation.get(r.split(t.defaultSeparator).concat([u[0]]),n)}var baseFlatten=_baseFlatten,INFINITY=1/0;function flattenDeep(t){var e=t==null?0:t.length;return e?baseFlatten(t,INFINITY):[]}var flattenDeep_1=flattenDeep;const flattenDeep$1=getDefaultExportFromCjs(flattenDeep_1);class PropertyFlatList{constructor(e){this.target=e}call(){const e=flattenDeep$1(Object.keys(this.target).map(a=>this.compute(this.target[a],a)));return e.sort(),e}compute(e,a){return!isArray$b(e)&&isObject$7(e)?Object.keys(e).map(n=>this.compute(e[n],`${a}.${n}`)):a}}function propertyFlatList(t){return new PropertyFlatList(t).call()}const DEFAULT_OPTIONS={meridian:{am:"AM",pm:"PM"},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbrDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],monthNames:[null,"January","February","March","April","May","June","July","August","September","October","November","December"],abbrMonthNames:[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function strftime(t,e,a={}){const{abbrDayNames:n,dayNames:r,abbrMonthNames:i,monthNames:o,meridian:s}=Object.assign(Object.assign({},DEFAULT_OPTIONS),a);if(isNaN(t.getTime()))throw new Error("strftime() requires a valid date object, but received an invalid date.");const l=t.getDay(),u=t.getDate(),c=t.getFullYear(),d=t.getMonth()+1,h=t.getHours();let m=h;const p=h>11?"pm":"am",v=t.getSeconds(),y=t.getMinutes(),w=t.getTimezoneOffset(),_=Math.floor(Math.abs(w/60)),D=Math.abs(w)-_*60,k=(w>0?"-":"+")+(_.toString().length<2?"0"+_:_)+(D.toString().length<2?"0"+D:D);return m>12?m=m-12:m===0&&(m=12),e=e.replace("%a",n[l]),e=e.replace("%A",r[l]),e=e.replace("%b",i[d]),e=e.replace("%B",o[d]),e=e.replace("%d",u.toString().padStart(2,"0")),e=e.replace("%e",u.toString()),e=e.replace("%-d",u.toString()),e=e.replace("%H",h.toString().padStart(2,"0")),e=e.replace("%-H",h.toString()),e=e.replace("%k",h.toString()),e=e.replace("%I",m.toString().padStart(2,"0")),e=e.replace("%-I",m.toString()),e=e.replace("%l",m.toString()),e=e.replace("%m",d.toString().padStart(2,"0")),e=e.replace("%-m",d.toString()),e=e.replace("%M",y.toString().padStart(2,"0")),e=e.replace("%-M",y.toString()),e=e.replace("%p",s[p]),e=e.replace("%P",s[p].toLowerCase()),e=e.replace("%S",v.toString().padStart(2,"0")),e=e.replace("%-S",v.toString()),e=e.replace("%w",l.toString()),e=e.replace("%y",c.toString().padStart(2,"0").substr(-2)),e=e.replace("%-y",c.toString().padStart(2,"0").substr(-2).replace(/^0+/,"")),e=e.replace("%Y",c.toString()),e=e.replace(/%z/i,k),e}var nativeCeil=Math.ceil,nativeMax=Math.max;function baseRange$1(t,e,a,n){for(var r=-1,i=nativeMax(nativeCeil((e-t)/(a||1)),0),o=Array(i);i--;)o[n?i:++r]=t,t+=a;return o}var _baseRange=baseRange$1,baseRange=_baseRange,isIterateeCall=_isIterateeCall,toFinite=toFinite_1;function createRange$1(t){return function(e,a,n){return n&&typeof n!="number"&&isIterateeCall(e,a,n)&&(a=n=void 0),e=toFinite(e),a===void 0?(a=e,e=0):a=toFinite(a),n=n===void 0?e<a?1:-1:toFinite(n),baseRange(e,a,n,t)}}var _createRange=createRange$1,createRange=_createRange,range=createRange(),range_1=range;const range$1=getDefaultExportFromCjs(range_1),within=(t,e,a)=>a>=t&&a<=e;function timeAgoInWords(t,e,a,n={}){const r=n.scope||"datetime.distance_in_words",i=(F,g=0)=>t.t(F,{count:g,scope:r});e=parseDate(e),a=parseDate(a);let o=e.getTime()/1e3,s=a.getTime()/1e3;o>s&&([e,a,o,s]=[a,e,s,o]);const l=Math.round(s-o),u=Math.round((s-o)/60),d=u/60/24,h=Math.round(u/60),m=Math.round(d),p=Math.round(m/30);if(within(0,1,u))return n.includeSeconds?within(0,4,l)?i("less_than_x_seconds",5):within(5,9,l)?i("less_than_x_seconds",10):within(10,19,l)?i("less_than_x_seconds",20):within(20,39,l)?i("half_a_minute"):within(40,59,l)?i("less_than_x_minutes",1):i("x_minutes",1):u===0?i("less_than_x_minutes",1):i("x_minutes",u);if(within(2,44,u))return i("x_minutes",u);if(within(45,89,u))return i("about_x_hours",1);if(within(90,1439,u))return i("about_x_hours",h);if(within(1440,2519,u))return i("x_days",1);if(within(2520,43199,u))return i("x_days",m);if(within(43200,86399,u))return i("about_x_months",Math.round(u/43200));if(within(86400,525599,u))return i("x_months",p);let v=e.getFullYear();e.getMonth()+1>=3&&(v+=1);let y=a.getFullYear();a.getMonth()+1<3&&(y-=1);const w=v>y?0:range$1(v,y).filter(F=>new Date(F,1,29).getMonth()==1).length,_=525600,D=w*1440,k=u-D,O=Math.trunc(k/_),N=parseFloat((k/_-O).toPrecision(3));return N<.25?i("about_x_years",O):N<.75?i("over_x_years",O):i("almost_x_years",O+1)}const guessStrategy=function(t,e){e instanceof Array&&(e=e.join(t.defaultSeparator));const a=e.split(t.defaultSeparator).slice(-1)[0];return t.missingTranslationPrefix+a.replace("_"," ").replace(/([a-z])([A-Z])/g,(n,r,i)=>`${r} ${i.toLowerCase()}`)},messageStrategy=(t,e,a)=>{const n=getFullScope(t,e,a),r="locale"in a?a.locale:t.locale,i=inferType(r);return`[missing "${[i=="string"?r:i,n].join(t.defaultSeparator)}" translation]`},errorStrategy=(t,e,a)=>{const n=getFullScope(t,e,a),r=[t.locale,n].join(t.defaultSeparator);throw new Error(`Missing translation: ${r}`)};class MissingTranslation{constructor(e){this.i18n=e,this.registry={},this.register("guess",guessStrategy),this.register("message",messageStrategy),this.register("error",errorStrategy)}register(e,a){this.registry[e]=a}get(e,a){var n;return this.registry[(n=a.missingBehavior)!==null&&n!==void 0?n:this.i18n.missingBehavior](this.i18n,e,a)}}var __awaiter=globalThis&&globalThis.__awaiter||function(t,e,a,n){function r(i){return i instanceof a?i:new a(function(o){o(i)})}return new(a||(a=Promise))(function(i,o){function s(c){try{u(n.next(c))}catch(d){o(d)}}function l(c){try{u(n.throw(c))}catch(d){o(d)}}function u(c){c.done?i(c.value):r(c.value).then(s,l)}u((n=n.apply(t,e||[])).next())})};const DEFAULT_I18N_OPTIONS={defaultLocale:"en",availableLocales:["en"],locale:"en",defaultSeparator:".",placeholder:/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,enableFallback:!1,missingBehavior:"message",missingTranslationPrefix:"",missingPlaceholder:(t,e)=>`[missing "${e}" value]`,nullPlaceholder:(t,e,a,n)=>t.missingPlaceholder(t,e,a,n),transformKey:t=>t};class I18n{constructor(e={},a={}){this._locale=DEFAULT_I18N_OPTIONS.locale,this._defaultLocale=DEFAULT_I18N_OPTIONS.defaultLocale,this._version=0,this.onChangeHandlers=[],this.translations={},this.availableLocales=[],this.t=this.translate,this.p=this.pluralize,this.l=this.localize,this.distanceOfTimeInWords=this.timeAgoInWords;const{locale:n,enableFallback:r,missingBehavior:i,missingTranslationPrefix:o,missingPlaceholder:s,nullPlaceholder:l,defaultLocale:u,defaultSeparator:c,placeholder:d,transformKey:h}=Object.assign(Object.assign({},DEFAULT_I18N_OPTIONS),a);this.locale=n,this.defaultLocale=u,this.defaultSeparator=c,this.enableFallback=r,this.locale=n,this.missingBehavior=i,this.missingTranslationPrefix=o,this.missingPlaceholder=s,this.nullPlaceholder=l,this.placeholder=d,this.pluralization=new Pluralization(this),this.locales=new Locales(this),this.missingTranslation=new MissingTranslation(this),this.transformKey=h,this.interpolate=interpolate,this.store(e)}store(e){propertyFlatList(e).forEach(n=>set$1(this.translations,n,get$2(e,n))),this.hasChanged()}get locale(){return this._locale||this.defaultLocale||"en"}set locale(e){if(typeof e!="string")throw new Error(`Expected newLocale to be a string; got ${inferType(e)}`);const a=this._locale!==e;this._locale=e,a&&this.hasChanged()}get defaultLocale(){return this._defaultLocale||"en"}set defaultLocale(e){if(typeof e!="string")throw new Error(`Expected newLocale to be a string; got ${inferType(e)}`);const a=this._defaultLocale!==e;this._defaultLocale=e,a&&this.hasChanged()}translate(e,a){a=Object.assign({},a);const n=createTranslationOptions(this,e,a);let r;return n.some(o=>(isSet(o.scope)?r=lookup(this,o.scope,a):isSet(o.message)&&(r=o.message),r!=null))?(typeof r=="string"?r=this.interpolate(this,r,a):typeof r=="object"&&r&&isSet(a.count)&&(r=pluralize({i18n:this,count:a.count||0,scope:r,options:a,baseScope:getFullScope(this,e,a)})),a&&r instanceof Array&&(r=r.map(o=>typeof o=="string"?interpolate(this,o,a):o)),r):this.missingTranslation.get(e,a)}pluralize(e,a,n){return pluralize({i18n:this,count:e,scope:a,options:Object.assign({},n),baseScope:getFullScope(this,a,n??{})})}localize(e,a,n){if(n=Object.assign({},n),a==null)return"";switch(e){case"currency":return this.numberToCurrency(a);case"number":return formatNumber(a,Object.assign({delimiter:",",precision:3,separator:".",significant:!1,stripInsignificantZeros:!1},lookup(this,"number.format")));case"percentage":return this.numberToPercentage(a);default:{let r;return e.match(/^(date|time)/)?r=this.toTime(e,a):r=a.toString(),interpolate(this,r,n)}}}toTime(e,a){const n=parseDate(a),r=lookup(this,e);return n.toString().match(/invalid/i)||!r?n.toString():this.strftime(n,r)}numberToCurrency(e,a={}){return formatNumber(e,Object.assign(Object.assign(Object.assign({delimiter:",",format:"%u%n",precision:2,separator:".",significant:!1,stripInsignificantZeros:!1,unit:"$"},camelCaseKeys(this.get("number.format"))),camelCaseKeys(this.get("number.currency.format"))),a))}numberToPercentage(e,a={}){return formatNumber(e,Object.assign(Object.assign(Object.assign({delimiter:"",format:"%n%",precision:3,stripInsignificantZeros:!1,separator:".",significant:!1},camelCaseKeys(this.get("number.format"))),camelCaseKeys(this.get("number.percentage.format"))),a))}numberToHumanSize(e,a={}){return numberToHumanSize(this,e,Object.assign(Object.assign(Object.assign({delimiter:"",precision:3,significant:!0,stripInsignificantZeros:!0,units:{billion:"Billion",million:"Million",quadrillion:"Quadrillion",thousand:"Thousand",trillion:"Trillion",unit:""}},camelCaseKeys(this.get("number.human.format"))),camelCaseKeys(this.get("number.human.storage_units"))),a))}numberToHuman(e,a={}){return numberToHuman(this,e,Object.assign(Object.assign(Object.assign({delimiter:"",separator:".",precision:3,significant:!0,stripInsignificantZeros:!0,format:"%n %u",roundMode:"default",units:{billion:"Billion",million:"Million",quadrillion:"Quadrillion",thousand:"Thousand",trillion:"Trillion",unit:""}},camelCaseKeys(this.get("number.human.format"))),camelCaseKeys(this.get("number.human.decimal_units"))),a))}numberToRounded(e,a){return formatNumber(e,Object.assign({unit:"",precision:3,significant:!1,separator:".",delimiter:"",stripInsignificantZeros:!1},a))}numberToDelimited(e,a={}){return numberToDelimited(e,Object.assign({delimiterPattern:/(\d)(?=(\d\d\d)+(?!\d))/g,delimiter:",",separator:"."},a))}withLocale(e,a){return __awaiter(this,void 0,void 0,function*(){const n=this.locale;try{this.locale=e,yield a()}finally{this.locale=n}})}strftime(e,a,n={}){return strftime(e,a,Object.assign(Object.assign(Object.assign({},camelCaseKeys(lookup(this,"date"))),{meridian:{am:lookup(this,"time.am")||"AM",pm:lookup(this,"time.pm")||"PM"}}),n))}update(e,a,n={strict:!1}){if(n.strict&&!has$1(this.translations,e))throw new Error(`The path "${e}" is not currently defined`);const r=get$2(this.translations,e),i=inferType(r),o=inferType(a);if(n.strict&&i!==o)throw new Error(`The current type for "${e}" is "${i}", but you're trying to override it with "${o}"`);let s;o==="object"?s=Object.assign(Object.assign({},r),a):s=a,set$1(this.translations,e,s),this.hasChanged()}toSentence(e,a={}){const{wordsConnector:n,twoWordsConnector:r,lastWordConnector:i}=Object.assign(Object.assign({wordsConnector:", ",twoWordsConnector:" and ",lastWordConnector:", and "},camelCaseKeys(lookup(this,"support.array"))),a),o=e.length;switch(o){case 0:return"";case 1:return`${e[0]}`;case 2:return e.join(r);default:return[e.slice(0,o-1).join(n),i,e[o-1]].join("")}}timeAgoInWords(e,a,n={}){return timeAgoInWords(this,e,a,n)}onChange(e){return this.onChangeHandlers.push(e),()=>{this.onChangeHandlers.splice(this.onChangeHandlers.indexOf(e),1)}}get version(){return this._version}formatNumber(e,a){return formatNumber(e,a)}get(e){return lookup(this,e)}runCallbacks(){this.onChangeHandlers.forEach(e=>e(this))}hasChanged(){this._version+=1,this.runCallbacks()}}async function loadTranslations(t,e){const n=await(await fetch(`./v2/i18n/${e}.json`)).json();t.store(n)}let currencies$1=[],chart$3=null,chartData$1=null,afterPromises$4=!1,i18n$3;const CACHE_KEY$4="dashboard-budgets-chart",budgets=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,chartData$1!==null){this.drawChart(this.generateOptions(chartData$1)),this.loading=!1;return}this.getFreshData()}},drawChart(t){if(chart$3!==null){chart$3.data.datasets=t.data.datasets,chart$3.update();return}chart$3=new Chart(document.querySelector("#budget-chart"),t)},getFreshData(){const t=window.store.get("cacheValid");let e=window.store.get(CACHE_KEY$4);if(t&&typeof e<"u"){chartData$1=e,this.drawChart(this.generateOptions(chartData$1)),this.loading=!1;return}new Dashboard$1().dashboard(new Date(window.store.get("start")),new Date(window.store.get("end")),null).then(n=>{chartData$1=n.data,this.drawChart(this.generateOptions(chartData$1)),window.store.set(CACHE_KEY$4,chartData$1),this.loading=!1})},generateOptions(t){currencies$1=[];let e=getDefaultChartSettings("column");e.options.locale=window.store.get("locale").replace("_","-"),e.options.plugins={tooltip:{callbacks:{title:function(a){return a.label},label:function(a){let n=a.dataset.label||"";return n&&(n+=": "),n+" "+formatMoney(a.parsed.y,currencies$1[a.parsed.x]??"EUR")}}}},e.data={labels:[],datasets:[{label:i18n$3.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:getColors("spent","background"),borderColor:getColors("spent","border")},{label:i18n$3.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:getColors("left","background"),borderColor:getColors("left","border")},{label:i18n$3.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:getColors("overspent","background"),borderColor:getColors("overspent","border")}]};for(const a in t)if(t.hasOwnProperty(a)){let n=t[a],r=n.label+" ("+n.currency_code+")";e.data.labels.push(r),this.autoConversion&&(currencies$1.push(n.native_code),e.data.datasets[0].data.push(parseFloat(n.native_entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(n.native_entries.left)),e.data.datasets[2].data.push(parseFloat(n.native_entries.overspent))),this.autoConversion||(currencies$1.push(n.currency_code),e.data.datasets[0].data.push(parseFloat(n.entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(n.entries.left)),e.data.datasets[2].data.push(parseFloat(n.entries.overspent)))}return e.options.scales={y:{ticks:{callback:function(a){return formatMoney(a,currencies$1[0])}}}},e},init(){Promise.all([getVariable("autoConversion",!1),getVariable("language","en-US")]).then(t=>{i18n$3=new I18n,i18n$3.locale=t[1],loadTranslations(i18n$3,t[1]).then(()=>{this.autoConversion=t[0],afterPromises$4=!0,this.loading===!1&&this.loadChart()})}),window.store.observe("end",()=>{afterPromises$4&&this.loading===!1&&(chartData$1=null,this.loadChart())}),window.store.observe("autoConversion",t=>{afterPromises$4&&(this.autoConversion=t,this.loading===!1&&this.loadChart())})}});class Dashboard{dashboard(e,a){let n=format$1(e,"y-MM-dd"),r=format$1(a,"y-MM-dd");return api.get("/api/v2/chart/category/dashboard",{params:{start:n,end:r}})}}let currencies=[],chart$2=null,chartData=null,afterPromises$3=!1;const CACHE_KEY$3="dashboard-categories-chart",categories=()=>({loading:!1,autoConversion:!1,generateOptions(t){currencies=[];let e=getDefaultChartSettings("column"),a={};for(const r in t)if(t.hasOwnProperty(r)){let i=t[r],o=i.currency_code;this.autoConversion&&(o=i.native_code),a.hasOwnProperty(o)||(a[o]={name:o,yAxisID:"",data:{}},currencies.push(o))}for(const r in t)if(t.hasOwnProperty(r)){let i=t[r],o=i.currency_code;this.autoConversion&&(o=i.native_code);for(const s in a)if(a.hasOwnProperty(s)){let l=0;o===s&&(l=parseFloat(i.amount),""+i.currency_code,this.autoConversion&&(l=parseFloat(i.native_amount),""+i.native_code)),a[s].data.hasOwnProperty(i.label)&&(a[s].data[i.label]=a[s].data[i.label]+l),a[s].data.hasOwnProperty(i.label)||(a[s].data[i.label]=l)}e.data.labels.includes(i.label)||e.data.labels.push(i.label)}let n=0;for(const r in a){let i="y"+r,o={label:r,currency_code:r,yAxisID:i,data:[]};for(const s in a[r].data)o.data.push(a[r].data[s]);e.data.datasets.push(o),e.options.scales.hasOwnProperty(i)||(e.options.scales[i]={beginAtZero:!0,type:"linear",position:n===1?"right":"left",ticks:{callback:function(s,l,u){return formatMoney(s,r)}}},n++)}return e},drawChart(t){if(chart$2!==null){chart$2.options=t.options,chart$2.data=t.data,chart$2.update();return}chart$2=new Chart(document.querySelector("#category-chart"),t)},getFreshData(){const t=window.store.get("cacheValid");let e=window.store.get(CACHE_KEY$3);if(t&&typeof e<"u"){chartData=e,this.drawChart(this.generateOptions(chartData)),this.loading=!1;return}new Dashboard().dashboard(new Date(window.store.get("start")),new Date(window.store.get("end")),null).then(n=>{chartData=n.data,this.drawChart(this.generateOptions(n.data)),window.store.set(CACHE_KEY$3,chartData),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,chartData!==null){this.drawChart(this.generateOptions(chartData)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([getVariable("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],afterPromises$3=!0,this.loadChart()}),window.store.observe("end",()=>{afterPromises$3&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",t=>{afterPromises$3&&(this.autoConversion=t,this.loadChart())})}});let Get$2=class{get(e){return api.get("/api/v2/transactions",{params:e})}};/*!
* chartjs-chart-sankey v0.12.0
* https://github.com/kurkle/chartjs-chart-sankey#readme
* (c) 2022 Jukka Kurkela
diff --git a/public/build/manifest.json b/public/build/manifest.json
index 49d1dd87de..230c2a15fb 100644
--- a/public/build/manifest.json
+++ b/public/build/manifest.json
@@ -30,10 +30,10 @@
"integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6"
},
"resources/assets/v2/pages/dashboard/dashboard.js": {
- "file": "assets/dashboard-767a50a1.js",
+ "file": "assets/dashboard-3bf5d492.js",
"isEntry": true,
"src": "resources/assets/v2/pages/dashboard/dashboard.js",
- "integrity": "sha384-IHFHBTu2Ag0GEIYzgrhY5c1H/PQHLghtTMCJBvV4HjiQHVJ+Al1FSRX3Ro92N3NT"
+ "integrity": "sha384-VbU3St9S+FpNVXcyT3HOrAFKugS69Q2RP7bTQfzoGWwlKhO23L7kJhx513OQ9smw"
},
"resources/assets/v2/sass/app.scss": {
"file": "assets/app-28a195fd.css",
diff --git a/resources/assets/v2/pages/dashboard/accounts.js b/resources/assets/v2/pages/dashboard/accounts.js
index dcb66c99f2..c2c1b67d66 100644
--- a/resources/assets/v2/pages/dashboard/accounts.js
+++ b/resources/assets/v2/pages/dashboard/accounts.js
@@ -224,7 +224,7 @@ export default () => ({
native_balance: formatMoney(parent.attributes.native_current_balance, parent.attributes.native_code),
groups: groups,
});
- console.log(parent.attributes);
+ // console.log(parent.attributes);
count++;
if (count === totalAccounts) {
accounts.sort((a, b) => a.order - b.order); // b - a for reverse sort
diff --git a/resources/assets/v2/pages/dashboard/categories.js b/resources/assets/v2/pages/dashboard/categories.js
index d88e6babf1..c1d4f6c32a 100644
--- a/resources/assets/v2/pages/dashboard/categories.js
+++ b/resources/assets/v2/pages/dashboard/categories.js
@@ -105,7 +105,7 @@ export default () => ({
// loop the series and create ChartJS-compatible data sets.
let count = 0;
for (const i in series) {
- console.log('series');
+ // console.log('series');
let yAxisID = 'y' + i;
let dataset = {
label: i,
diff --git a/resources/assets/v2/support/get-colors.js b/resources/assets/v2/support/get-colors.js
index 7c6d0eacaf..9d60317da7 100644
--- a/resources/assets/v2/support/get-colors.js
+++ b/resources/assets/v2/support/get-colors.js
@@ -95,7 +95,7 @@ function getColors(type, field) {
case 'overspent':
background = new Color(red.rgbString());
background.lighten(0.22);
- console.log('#ffb1c1 vs ' + background.hexString());
+ // console.log('#ffb1c1 vs ' + background.hexString());
colors = {
borderColor: red.rgbString(),
backgroundColor: background.rgbString(),