lorgg-v2-components 0.0.113 → 0.0.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -807,7 +807,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
807
807
 
808
808
  `,`1) content: element.innerHTML
809
809
  `,"2) content: () => element.cloneNode(true)"].join(" "))}var o=a.reduce(function(l,c){var u=c&&QI(c,r);return u&&l.push(u),l},[]);return Co(e)?o[0]:o}At.defaultProps=kn;At.setDefaultProps=xI;At.currentInput=fr;Object.assign({},jw,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});At.setDefaultProps({render:db});const fb={cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},isRoot:{type:Boolean,required:!0},quantityNeeded:{type:Number,required:!1,default:void 0},deckList:{type:Object,required:!1,default(){return{}}},isDeckBuilder:{type:Boolean,required:!1,default:!1},userCardQuantity:{type:Object,required:!1,default:void 0},showTippyLocation:{type:String,required:!1,default:null}},TI=["alt","src"],DI={key:0,class:"quantity-ticks-container"},LI={key:0},OI={key:0,class:"card-info-quantity-possessed"},MI={key:1,class:"line"},NI={class:"card-info-title"},PI={class:"card-info-text"},HI={key:2,class:"line"},RI={key:3,class:"card-info-text"},VI={key:1,class:"associated-card-container"},KI=i.defineComponent({__name:"CardItem",props:fb,setup(e){const t=e,n=i.ref(null),r=i.ref(null);let a=null;const A=i.ref(!1),s=Ro(t.cardProp,t.cardCodeProp),o=i.computed(()=>s.value===void 0?null:t.quantityNeeded!=null&&t.userCardQuantity!=null&&s.value.cardCode in t.userCardQuantity&&t.quantityNeeded>t.userCardQuantity[s.value.cardCode]?"bad":null),l=i.computed(()=>{if(s.value===void 0)return[];const y=[];if(t.isRoot)for(const g of s.value.associatedCardRefs)y.push(jt().cardJsonObject[g]);return y}),c=i.computed(()=>{if(s.value===void 0)return[];const y=[];for(const g of s.value.keywordRefs){const v=we().dataJson.keywords.find(_=>_.nameRef===g);v&&y.push(v)}return y}),u=i.computed(()=>t.isRoot&&(t.userCardQuantity!=null||s.value&&(s.value.keywordRefs.length>0||s.value.associatedCardRefs.length>0))),d=i.computed(()=>{var y;return t.userCardQuantity==null||s.value&&!(s.value.cardCode in t.userCardQuantity)?0:t.userCardQuantity[((y=s.value)==null?void 0:y.cardCode)??0]}),f=i.computed(()=>s.value===void 0?null:t.isDeckBuilder&&t.deckList[s.value.cardCode]===3?"disabled":null);i.watch(()=>t.showTippyLocation,y=>{a&&(y?(a.setProps({placement:y}),a.show()):a.hide())});function h(){window.addEventListener("keyup",y=>{y.key=="Shift"&&(A.value=!1)})}function p(){window.addEventListener("keydown",y=>{y.key=="Shift"&&(A.value=!0)})}function m(y){return s.value===void 0?null:t.isDeckBuilder?!(s.value.cardCode in t.deckList)||y>t.deckList[s.value.cardCode]?"disabled":null:y>d.value?"disabled":null}return i.onMounted(()=>{(s.value===void 0||t.userCardQuantity!=null||s.value.keywordRefs.length>0||s.value.associatedCardRefs.length>0)&&(a=At(n.value,{allowHTML:!0,content:r.value,placement:"right-start",duration:0,role:"card-info",maxWidth:"50vw",touch:!1})),(s.value===void 0||s.value.associatedCardRefs.length>0)&&(h(),p())}),(y,g)=>{var _,B,b;const v=i.resolveComponent("CardItem",!0);return i.openBlock(),i.createElementBlock("div",{class:"card-item-container",onMouseover:g[0]||(g[0]=w=>!0),onMouseleave:g[1]||(g[1]=w=>!1)},[i.createElementVNode("img",{ref_key:"cardItem",ref:n,alt:(_=i.unref(s))==null?void 0:_.name,class:i.normalizeClass(["card-item",f.value]),src:`https://lor.gg/storage/cards/card/en_us/${(B=i.unref(s))==null?void 0:B.cardCode}.webp`},null,10,TI),(y.isDeckBuilder||y.userCardQuantity!=null)&&((b=i.unref(s))!=null&&b.collectible)?(i.openBlock(),i.createElementBlock("div",DI,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(3,w=>i.createElementVNode("div",{key:w,class:i.normalizeClass(["quantity-tick",m(w)])},null,2)),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"cardInfo",ref:r,class:i.normalizeClass(A.value?null:"card-info")},[!A.value&&u.value&&i.unref(s)?(i.openBlock(),i.createElementBlock("div",LI,[d.value!==void 0?(i.openBlock(),i.createElementBlock("div",OI,[i.createTextVNode(i.toDisplayString("You have: ")+" "),i.createElementVNode("b",{class:i.normalizeClass(o.value)},i.toDisplayString(d.value+" / "+(y.quantityNeeded||3)),3)])):i.createCommentVNode("",!0),d.value!==void 0&&(i.unref(s).keywordRefs.length>0||i.unref(s).associatedCardRefs.length>0)?(i.openBlock(),i.createElementBlock("hr",MI)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,w=>(i.openBlock(),i.createElementBlock("div",{key:w.nameRef,class:"card-info-section"},[i.createElementVNode("h4",NI,i.toDisplayString(w.name),1),i.createElementVNode("p",PI,i.toDisplayString(w.description),1)]))),128)),i.unref(s).keywordRefs.length>0&&i.unref(s).associatedCardRefs.length>0?(i.openBlock(),i.createElementBlock("hr",HI)):i.createCommentVNode("",!0),i.unref(s).associatedCardRefs.length>0?(i.openBlock(),i.createElementBlock("div",RI,i.toDisplayString("Hold Shift to see Associated Cards"))):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",VI,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,w=>(i.openBlock(),i.createBlock(v,{key:w.cardCode,"card-code-prop":w.cardCode,"is-deck-builder":!1,"is-root":!1,class:"associated-card"},null,8,["card-code-prop"]))),128))]))],2)],32)}}});const M=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},Wa=M(KI,[["__scopeId","data-v-d8fb3406"]]),$I=i.defineComponent({__name:"RevealCarousel",props:Z5,setup(e){var o;const t=e,n=[G5],r=i.ref(null),a=i.ref((o=r.value)==null?void 0:o.clientWidth),A=i.computed(()=>a.value===void 0?!0:a.value<400);function s(){var l;a.value=(l=r.value)==null?void 0:l.clientWidth}return i.onMounted(()=>{window.addEventListener("resize",s),s()}),i.onUnmounted(()=>{window.removeEventListener("resize",s)}),(l,c)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"revealCarousel",ref:r,class:"reveal-carousel"},[i.createVNode(i.unref($w),{"slides-per-view":"auto","space-between":15,"centered-slides":A.value,navigation:!0,modules:n},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.cardCodes,u=>(i.openBlock(),i.createBlock(i.unref(Ww),{key:u},{default:i.withCtx(()=>[i.createVNode(Wa,{class:"card-item-called","card-code-prop":u,"is-root":!0},null,8,["card-code-prop"])]),_:2},1024))),128))]),_:1},8,["centered-slides"])],512))}});const gg=M($I,[["__scopeId","data-v-430f2bb4"]]),hb={fetchSeachResult:{type:Function,required:!0,default:()=>[]}},WI={cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},ignoreCardItem:{type:Boolean,required:!1,default:void 0},color:{type:String,required:!1,default:void 0},name:{type:String,required:!1,default:void 0},manaNumber:{type:Number,required:!1,default:void 0},routerLink:{type:Object,required:!1,default:"404"},quantityNumber:{type:Number,required:!1,default:void 0},maintainAspectRatio:{type:Boolean,required:!1,default:!0},showPlusMinus:{type:Boolean,required:!1,default:!1}},GI="data:image/svg+xml;base64,ICA8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMxIDM2Ij4KICAgIDxkZWZzPgogICAgICA8bGluZWFyR3JhZGllbnQKICAgICAgICBpZD0iYSIKICAgICAgICB4MT0iLjA4IgogICAgICAgIHkxPSIuODIiCiAgICAgICAgeDI9IjEiCiAgICAgICAgeTI9Ii4xOSIKICAgICAgICBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIKICAgICAgPgogICAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzA0NjZjOCIgLz4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMDNhOWUiIC8+CiAgICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8L2RlZnM+CiAgICA8ZyB0cmFuc2Zvcm09InJvdGF0ZSg5MCAxNS41IDE1LjUpIiBmaWxsPSJ1cmwoI2EpIj4KICAgICAgPHBhdGgKICAgICAgICBkPSJNMjMuNTUgMzAuNWgtMTEuMWE1LjUyIDUuNTIgMCAwIDEtNC43NS0yLjc0bC01LjUyLTkuNWE1LjUxIDUuNTEgMCAwIDEgMC01LjUybDUuNTItOS41QTUuNTIgNS41MiAwIDAgMSAxMi40NS41aDExLjFhNS41MiA1LjUyIDAgMCAxIDQuNzUgMi43NGw1LjUyIDkuNWMuOTkgMS43Ljk5IDMuODIgMCA1LjUybC01LjUyIDkuNWE1LjUyIDUuNTIgMCAwIDEtNC43NSAyLjc0WiIKICAgICAgLz4KICAgICAgPHBhdGgKICAgICAgICBkPSJNMTIuNDUgMWMtMS43NyAwLTMuNDMuOTUtNC4zMiAyLjQ5bC01LjUyIDkuNWE1LjAxIDUuMDEgMCAwIDAgMCA1LjAybDUuNTIgOS41QTUuMDIgNS4wMiAwIDAgMCAxMi40NSAzMGgxMS4xYzEuNzcgMCAzLjQzLS45NSA0LjMyLTIuNDlsNS41Mi05LjVjLjktMS41NS45LTMuNDcgMC01LjAybC01LjUyLTkuNUE1LjAyIDUuMDIgMCAwIDAgMjMuNTUgMWgtMTEuMW0wLTFoMTEuMWE2IDYgMCAwIDEgNS4xOCAyLjk5bDUuNTIgOS41YTYgNiAwIDAgMSAwIDYuMDJsLTUuNTIgOS41QTYgNiAwIDAgMSAyMy41NSAzMWgtMTEuMWE2IDYgMCAwIDEtNS4xOC0yLjk5bC01LjUyLTkuNWE2IDYgMCAwIDEgMC02LjAybDUuNTItOS41QTYgNiAwIDAgMSAxMi40NSAwWiIKICAgICAgICBmaWxsPSIjZmZjNTNlIgogICAgICAvPgogICAgPC9nPgogIDwvc3ZnPg==",zI=["src"],jo=i.defineComponent({__name:"ManaHexagonIcon",setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("img",{src:i.unref(GI)},null,8,zI))}});function Av(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Av(Object(n),!0).forEach(function(r){on(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Av(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function au(e){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(e)}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jI(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,A;for(A=0;A<r.length;A++)a=r[A],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function YI(e,t){if(e==null)return{};var n=jI(e,t),r,a;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(a=0;a<A.length;a++)r=A[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Uh(e){return qI(e)||XI(e)||JI(e)||ZI()}function qI(e){if(Array.isArray(e))return Qh(e)}function XI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JI(e,t){if(e){if(typeof e=="string")return Qh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qh(e,t)}}function Qh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
810
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var eU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pb={exports:{}};(function(e){(function(t){var n=function(g,v,_){if(!c(v)||d(v)||f(v)||h(v)||l(v))return v;var B,b=0,w=0;if(u(v))for(B=[],w=v.length;b<w;b++)B.push(n(g,v[b],_));else{B={};for(var C in v)Object.prototype.hasOwnProperty.call(v,C)&&(B[g(C,_)]=n(g,v[C],_))}return B},r=function(g,v){v=v||{};var _=v.separator||"_",B=v.split||/(?=[A-Z])/;return g.split(B).join(_)},a=function(g){return p(g)?g:(g=g.replace(/[\-_\s]+(.)?/g,function(v,_){return _?_.toUpperCase():""}),g.substr(0,1).toLowerCase()+g.substr(1))},A=function(g){var v=a(g);return v.substr(0,1).toUpperCase()+v.substr(1)},s=function(g,v){return r(g,v).toLowerCase()},o=Object.prototype.toString,l=function(g){return typeof g=="function"},c=function(g){return g===Object(g)},u=function(g){return o.call(g)=="[object Array]"},d=function(g){return o.call(g)=="[object Date]"},f=function(g){return o.call(g)=="[object RegExp]"},h=function(g){return o.call(g)=="[object Boolean]"},p=function(g){return g=g-0,g===g},m=function(g,v){var _=v&&"process"in v?v.process:v;return typeof _!="function"?g:function(B,b){return _(B,g,b)}},y={camelize:a,decamelize:s,pascalize:A,depascalize:s,camelizeKeys:function(g,v){return n(m(a,v),g)},decamelizeKeys:function(g,v){return n(m(s,v),g,v)},pascalizeKeys:function(g,v){return n(m(A,v),g)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=y:t.humps=y})(eU)})(pb);var tU=pb.exports,nU=["class","style"];function rU(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),a=tU.camelize(n.slice(0,r)),A=n.slice(r+1).trim();return t[a]=A,t},{})}function aU(e){return e.split(/\s+/).reduce(function(t,n){return t[n]=!0,t},{})}function mg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(l){return mg(l)}),a=Object.keys(e.attributes||{}).reduce(function(l,c){var u=e.attributes[c];switch(c){case"class":l.class=aU(u);break;case"style":l.style=rU(u);break;default:l.attrs[c]=u}return l},{attrs:{},class:{},style:{}});n.class;var A=n.style,s=A===void 0?{}:A,o=YI(n,nU);return i.h(e.tag,qn(qn(qn({},t),{},{class:a.class,style:qn(qn({},a.style),s)},a.attrs),o),r)}var gb=!1;try{gb=process.env.NODE_ENV==="production"}catch{}function AU(){if(!gb&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function zi(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?on({},e,t):{}}function sU(e){var t,n=(t={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-inverse":e.inverse,"fa-flip":e.flip===!0,"fa-flip-horizontal":e.flip==="horizontal"||e.flip==="both","fa-flip-vertical":e.flip==="vertical"||e.flip==="both"},on(t,"fa-".concat(e.size),e.size!==null),on(t,"fa-rotate-".concat(e.rotation),e.rotation!==null),on(t,"fa-pull-".concat(e.pull),e.pull!==null),on(t,"fa-swap-opacity",e.swapOpacity),on(t,"fa-bounce",e.bounce),on(t,"fa-shake",e.shake),on(t,"fa-beat",e.beat),on(t,"fa-fade",e.fade),on(t,"fa-beat-fade",e.beatFade),on(t,"fa-flash",e.flash),on(t,"fa-spin-pulse",e.spinPulse),on(t,"fa-spin-reverse",e.spinReverse),t);return Object.keys(n).map(function(r){return n[r]?r:null}).filter(function(r){return r})}function sv(e){if(e&&au(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(eu.icon)return eu.icon(e);if(e===null)return null;if(au(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}var Ue=i.defineComponent({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(t){return[!0,!1,"horizontal","vertical","both"].indexOf(t)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(t){return["right","left"].indexOf(t)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(t){return[90,180,270].indexOf(Number.parseInt(t,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(t){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(t)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(t,n){var r=n.attrs,a=i.computed(function(){return sv(t.icon)}),A=i.computed(function(){return zi("classes",sU(t))}),s=i.computed(function(){return zi("transform",typeof t.transform=="string"?eu.transform(t.transform):t.transform)}),o=i.computed(function(){return zi("mask",sv(t.mask))}),l=i.computed(function(){return h8(a.value,qn(qn(qn(qn({},A.value),s.value),o.value),{},{symbol:t.symbol,title:t.title}))});i.watch(l,function(u){if(!u)return AU("Could not find one or more icon(s)",a.value,o.value)},{immediate:!0});var c=i.computed(function(){return l.value?mg(l.value.abstract[0],{},r):null});return function(){return c.value}}});i.defineComponent({name:"FontAwesomeLayers",props:{fixedWidth:{type:Boolean,default:!1}},setup:function(t,n){var r=n.slots,a=Uw.familyPrefix,A=i.computed(function(){return["".concat(a,"-layers")].concat(Uh(t.fixedWidth?["".concat(a,"-fw")]:[]))});return function(){return i.h("div",{class:A.value},r.default?r.default():[])}}});i.defineComponent({name:"FontAwesomeLayersText",props:{value:{type:[String,Number],default:""},transform:{type:[String,Object],default:null},counter:{type:Boolean,default:!1},position:{type:String,default:null,validator:function(t){return["bottom-left","bottom-right","top-left","top-right"].indexOf(t)>-1}}},setup:function(t,n){var r=n.attrs,a=Uw.familyPrefix,A=i.computed(function(){return zi("classes",[].concat(Uh(t.counter?["".concat(a,"-layers-counter")]:[]),Uh(t.position?["".concat(a,"-layers-").concat(t.position)]:[])))}),s=i.computed(function(){return zi("transform",typeof t.transform=="string"?eu.transform(t.transform):t.transform)}),o=i.computed(function(){var c=p8(t.value.toString(),qn(qn({},s.value),A.value)),u=c.abstract;return t.counter&&(u[0].attributes.class=u[0].attributes.class.replace("fa-layers-text","")),u[0]}),l=i.computed(function(){return mg(o.value,{},r)});return function(){return l.value}}});const iU={class:"card-slice"},oU={key:0,class:"mana-hexagon"},lU={class:"mana-number"},cU={class:"card-name"},uU={key:1,class:"quantity"},dU={class:"quantity-background"},fU={class:"num-quantity"},hU={class:"plus-minus-content"},pU={class:"plus-minus-quantity"},gU=i.defineComponent({__name:"CardSliceItem",props:WI,emits:["update:card-quantity"],setup(e,{emit:t}){const n=e,r=Ro(n.cardProp,n.cardCodeProp,!1),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.ref(null),l=i.computed(()=>{let d=n.color;return!d&&r.value&&(d=pA(r.value,null,!0)),d||(d="var(--color-background-2-rgb)"),{"--color":d}}),c=i.computed(()=>r.value?"https://lor.gg/storage/cards/slice/"+r.value.cardCode+"-slice.webp":""),u=i.computed(()=>{const d=["card-slice-wrapper"];return n.maintainAspectRatio&&d.push("maintain-aspect-ratio"),d});return i.onMounted(()=>{n.ignoreCardItem||At(a.value,{content:s.value,placement:"right",arrow:!0,touch:!1,duration:0,role:"card-image",onShown:d=>{const f=d.popper.innerHTML.includes("right")?"right-start":"left-start";o.value=f},onHidden:()=>{o.value=null}})}),(d,f)=>{const h=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(h,{to:n.routerLink},{default:i.withCtx(()=>{var p,m;return[i.createElementVNode("div",{ref_key:"cardSlice",ref:a,class:i.normalizeClass(u.value)},[i.createElementVNode("div",iU,[i.createElementVNode("div",{class:"card-image",style:i.normalizeStyle({backgroundImage:`url(${c.value})`})},null,4),i.createElementVNode("div",{class:"region-gradient",style:i.normalizeStyle(l.value)},null,4),i.unref(r)||n.manaNumber!==void 0&&n.manaNumber!==null?(i.openBlock(),i.createElementBlock("div",oU,[i.createVNode(jo,{class:"hexagon-icon"}),i.createElementVNode("div",lU,i.toDisplayString(n.manaNumber??((p=i.unref(r))==null?void 0:p.cost)),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",cU,i.toDisplayString(n.name??((m=i.unref(r))==null?void 0:m.name)),1),n.quantityNumber!==void 0&&n.quantityNumber!==null?(i.openBlock(),i.createElementBlock("div",uU,[i.createElementVNode("div",dU,[i.createElementVNode("p",fU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0),n.showPlusMinus?(i.openBlock(),i.createElementBlock("div",{key:2,class:"plus-minus",onClick:f[2]||(f[2]=i.withModifiers(()=>{},["prevent"]))},[i.createElementVNode("div",hU,[i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[0]||(f[0]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:-1})},["prevent"]))},[i.createVNode(i.unref(Ue),{icon:"minus",class:"icon"})]),i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[1]||(f[1]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:1})},["prevent"]))},[i.createVNode(i.unref(Ue),{icon:"plus",class:"icon"})]),i.createElementVNode("div",pU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0)])],2),i.createElementVNode("div",{ref_key:"cardItemWrapper",ref:s,class:"card-item-container"},[i.unref(r)&&!d.ignoreCardItem?(i.openBlock(),i.createBlock(Wa,{key:0,ref_key:"cardItem",ref:A,"is-root":!0,"card-prop":i.unref(r),"quantity-needed":n.quantityNumber,"show-tippy-location":o.value,class:"card-image-hover"},null,8,["card-prop","quantity-needed","show-tippy-location"])):i.createCommentVNode("",!0)],512)]}),_:1},8,["to"])}}});const fn=M(gU,[["__scopeId","data-v-a1e91ff3"]]);function cr(e){return[null,void 0].indexOf(e)!==-1}function mU(e,t,n){const{object:r,valueProp:a,mode:A}=i.toRefs(e),s=i.getCurrentInstance().proxy,o=n.iv,l=(d,f=!0)=>{o.value=u(d);const h=c(d);t.emit("change",h,s),f&&(t.emit("input",h),t.emit("update:modelValue",h))},c=d=>r.value||cr(d)?d:Array.isArray(d)?d.map(f=>f[a.value]):d[a.value],u=d=>cr(d)?A.value==="single"?{}:[]:d;return{update:l}}function vU(e,t){const{value:n,modelValue:r,mode:a,valueProp:A}=i.toRefs(e),s=i.ref(a.value!=="single"?[]:{}),o=r&&r.value!==void 0?r:n,l=i.computed(()=>a.value==="single"?s.value[A.value]:s.value.map(u=>u[A.value])),c=i.computed(()=>a.value!=="single"?s.value.map(u=>u[A.value]).join(","):s.value[A.value]);return{iv:s,internalValue:s,ev:o,externalValue:o,textValue:c,plainValue:l}}function BU(e,t,n){const{regex:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=n.isOpen,s=n.open,o=i.ref(null),l=i.ref(null),c=()=>{o.value=""},u=h=>{o.value=h.target.value},d=h=>{if(r&&r.value){let p=r.value;typeof p=="string"&&(p=new RegExp(p)),h.key.match(p)||h.preventDefault()}},f=h=>{if(r&&r.value){let m=(h.clipboardData||window.clipboardData).getData("Text"),y=r.value;typeof y=="string"&&(y=new RegExp(y)),m.split("").every(g=>!!g.match(y))||h.preventDefault()}t.emit("paste",h,a)};return i.watch(o,h=>{!A.value&&h&&s(),t.emit("search-change",h,a)}),{search:o,input:l,clearSearch:c,handleSearchInput:u,handleKeypress:d,handlePaste:f}}function yU(e,t,n){const{groupSelect:r,mode:a,groups:A,disabledProp:s}=i.toRefs(e),o=i.ref(null),l=u=>{u===void 0||u!==null&&u[s.value]||A.value&&u&&u.group&&(a.value==="single"||!r.value)||(o.value=u)};return{pointer:o,setPointer:l,clearPointer:()=>{l(null)}}}function uf(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(new RegExp(/æ/g),"ae").replace(new RegExp(/œ/g),"oe").replace(new RegExp(/ø/g),"o").replace(/\p{Diacritic}/gu,"")}function wU(e){return Object.prototype.toString.call(e)==="[object Object]"}function bU(e,t){const n=t.slice().sort();return e.length===t.length&&e.slice().sort().every(function(r,a){return r===n[a]})}function _U(e,t,n){const{options:r,mode:a,trackBy:A,limit:s,hideSelected:o,createTag:l,createOption:c,label:u,appendNewTag:d,appendNewOption:f,multipleLabel:h,object:p,loading:m,delay:y,resolveOnLoad:g,minChars:v,filterResults:_,clearOnSearch:B,clearOnSelect:b,valueProp:w,allowAbsent:C,groupLabel:k,canDeselect:S,max:T,strict:U,closeOnSelect:F,closeOnDeselect:Q,groups:Y,reverse:X,infinite:j,groupOptions:K,groupHideEmpty:oe,groupSelect:$,onCreate:ae,disabledProp:ce,searchStart:me,searchFilter:Ee}=i.toRefs(e),fe=i.getCurrentInstance().proxy,ne=n.iv,N=n.ev,te=n.search,Pe=n.clearSearch,ot=n.update,xt=n.pointer,vt=n.clearPointer,Qn=n.focus,x=n.deactivate,E=n.close,D=n.localize,W=i.ref([]),ie=i.ref([]),he=i.ref(!1),Ft=i.ref(null),ht=i.ref(j.value&&s.value===-1?10:s.value),Bn=i.computed(()=>l.value||c.value||!1),$e=i.computed(()=>d.value!==void 0?d.value:f.value!==void 0?f.value:!0),O=i.computed(()=>{if(Y.value){let I=et.value||[],G=[];return I.forEach(xe=>{Wd(xe[K.value]).forEach(Bt=>{G.push(Object.assign({},Bt,xe[ce.value]?{[ce.value]:!0}:{}))})}),G}else{let I=Wd(ie.value||[]);return W.value.length&&(I=I.concat(W.value)),I}}),P=i.computed(()=>{let I=O.value;return X.value&&(I=I.reverse()),la.value.length&&(I=la.value.concat(I)),$d(I)}),Ze=i.computed(()=>{let I=P.value;return ht.value>0&&(I=I.slice(0,ht.value)),I}),et=i.computed(()=>{if(!Y.value)return[];let I=[],G=ie.value||[];return W.value.length&&I.push({[k.value]:" ",[K.value]:[...W.value],__CREATE__:!0}),I.concat(G)}),Ar=i.computed(()=>{let I=[...et.value].map(G=>({...G}));return la.value.length&&(I[0]&&I[0].__CREATE__?I[0][K.value]=[...la.value,...I[0][K.value]]:I=[{[k.value]:" ",[K.value]:[...la.value],__CREATE__:!0}].concat(I)),I}),Tn=i.computed(()=>{if(!Y.value)return[];let I=Ar.value;return aE((I||[]).map((G,xe)=>{const Bt=Wd(G[K.value]);return{...G,index:xe,group:!0,[K.value]:$d(Bt,!1).map(ci=>Object.assign({},ci,G[ce.value]?{[ce.value]:!0}:{})),__VISIBLE__:$d(Bt).map(ci=>Object.assign({},ci,G[ce.value]?{[ce.value]:!0}:{}))}}))}),Dn=i.computed(()=>{switch(a.value){case"single":return!cr(ne.value[w.value]);case"multiple":case"tags":return!cr(ne.value)&&ne.value.length>0}}),zn=i.computed(()=>h!==void 0&&h.value!==void 0?h.value(ne.value,fe):ne.value&&ne.value.length>1?`${ne.value.length} options selected`:"1 option selected"),ii=i.computed(()=>!O.value.length&&!he.value&&!la.value.length),JA=i.computed(()=>O.value.length>0&&Ze.value.length==0&&(te.value&&Y.value||!Y.value)),la=i.computed(()=>Bn.value===!1||!te.value?[]:tE(te.value)!==-1?[]:[{[w.value]:te.value,[L.value]:te.value,[u.value]:te.value,__CREATE__:!0}]),L=i.computed(()=>A.value||u.value),re=i.computed(()=>{switch(a.value){case"single":return null;case"multiple":case"tags":return[]}}),ue=i.computed(()=>m.value||he.value),Se=I=>{switch(typeof I!="object"&&(I=Ir(I)),a.value){case"single":ot(I);break;case"multiple":case"tags":ot(ne.value.concat(I));break}t.emit("select",Dt(I),I,fe)},ye=I=>{switch(typeof I!="object"&&(I=Ir(I)),a.value){case"single":oi();break;case"tags":case"multiple":ot(Array.isArray(I)?ne.value.filter(G=>I.map(xe=>xe[w.value]).indexOf(G[w.value])===-1):ne.value.filter(G=>G[w.value]!=I[w.value]));break}t.emit("deselect",Dt(I),I,fe)},Dt=I=>p.value?I:I[w.value],Xt=I=>{ye(I)},ca=(I,G)=>{if(G.button!==0){G.preventDefault();return}Xt(I)},oi=()=>{t.emit("clear",fe),ot(re.value)},Pt=I=>{if(I.group!==void 0)return a.value==="single"?!1:eE(I[K.value])&&I[K.value].length;switch(a.value){case"single":return!cr(ne.value)&&ne.value[w.value]==I[w.value];case"tags":case"multiple":return!cr(ne.value)&&ne.value.map(G=>G[w.value]).indexOf(I[w.value])!==-1}},AA=I=>I[ce.value]===!0,ua=()=>T===void 0||T.value===-1||!Dn.value&&T.value>0?!1:ne.value.length>=T.value,da=I=>{if(!AA(I)){if(ae&&ae.value&&!Pt(I)&&I.__CREATE__&&(I={...I},delete I.__CREATE__,I=ae.value(I,fe),I instanceof Promise)){he.value=!0,I.then(G=>{he.value=!1,yl(G)});return}yl(I)}},yl=I=>{switch(I.__CREATE__&&(I={...I},delete I.__CREATE__),a.value){case"single":if(I&&Pt(I)){S.value&&ye(I),Q.value&&(vt(),E());return}I&&fa(I),b.value&&Pe(),F.value&&(vt(),E()),I&&Se(I);break;case"multiple":if(I&&Pt(I)){ye(I),Q.value&&(vt(),E());return}if(ua()){t.emit("max",fe);return}I&&(fa(I),Se(I)),b.value&&Pe(),o.value&&vt(),F.value&&E();break;case"tags":if(I&&Pt(I)){ye(I),Q.value&&(vt(),E());return}if(ua()){t.emit("max",fe);return}I&&fa(I),b.value&&Pe(),I&&Se(I),o.value&&vt(),F.value&&E();break}F.value||Qn()},li=I=>{if(!(AA(I)||a.value==="single"||!$.value)){switch(a.value){case"multiple":case"tags":Z3(I[K.value])?ye(I[K.value]):Se(I[K.value].filter(G=>ne.value.map(xe=>xe[w.value]).indexOf(G[w.value])===-1).filter(G=>!G[ce.value]).filter((G,xe)=>ne.value.length+1+xe<=T.value||T.value===-1));break}F.value&&x()}},fa=I=>{Ir(I[w.value])===void 0&&Bn.value&&(t.emit("tag",I[w.value],fe),t.emit("option",I[w.value],fe),t.emit("create",I[w.value],fe),$e.value&&rE(I),Pe())},J3=()=>{a.value!=="single"&&Se(Ze.value.filter(I=>!I.disabled&&!Pt(I)))},Z3=I=>I.find(G=>!Pt(G)&&!G[ce.value])===void 0,eE=I=>I.find(G=>!Pt(G))===void 0,Ir=I=>O.value[O.value.map(G=>String(G[w.value])).indexOf(String(I))],tE=(I,G=!0)=>O.value.map(xe=>parseInt(xe[L.value])==xe[L.value]?parseInt(xe[L.value]):xe[L.value]).indexOf(parseInt(I)==I?parseInt(I):I),nE=I=>["tags","multiple"].indexOf(a.value)!==-1&&o.value&&Pt(I),rE=I=>{W.value.push(I)},aE=I=>oe.value?I.filter(G=>te.value?G.__VISIBLE__.length:G[K.value].length):I.filter(G=>te.value?G.__VISIBLE__.length:!0),$d=(I,G=!0)=>{let xe=I;if(te.value&&_.value){let Bt=Ee.value;Bt||(Bt=(ci,Toe)=>{let k1=uf(D(ci[L.value]),U.value);return me.value?k1.startsWith(uf(te.value,U.value)):k1.indexOf(uf(te.value,U.value))!==-1}),xe=xe.filter(Bt)}return o.value&&G&&(xe=xe.filter(Bt=>!nE(Bt))),xe},Wd=I=>{let G=I;return wU(G)&&(G=Object.keys(G).map(xe=>{let Bt=G[xe];return{[w.value]:xe,[L.value]:Bt,[u.value]:Bt}})),G=G.map(xe=>typeof xe=="object"?xe:{[w.value]:xe,[L.value]:xe,[u.value]:xe}),G},wl=()=>{cr(N.value)||(ne.value=_l(N.value))},bl=I=>(he.value=!0,new Promise((G,xe)=>{r.value(te.value,fe).then(Bt=>{ie.value=Bt||[],typeof I=="function"&&I(Bt),he.value=!1}).catch(Bt=>{console.error(Bt),ie.value=[],he.value=!1}).finally(()=>{G()})})),Gd=()=>{if(Dn.value)if(a.value==="single"){let I=Ir(ne.value[w.value]);if(I!==void 0){let G=I[u.value];ne.value[u.value]=G,p.value&&(N.value[u.value]=G)}}else ne.value.forEach((I,G)=>{let xe=Ir(ne.value[G][w.value]);if(xe!==void 0){let Bt=xe[u.value];ne.value[G][u.value]=Bt,p.value&&(N.value[G][u.value]=Bt)}})},AE=I=>{bl(I)},_l=I=>cr(I)?a.value==="single"?{}:[]:p.value?I:a.value==="single"?Ir(I)||(C.value?{[u.value]:I,[w.value]:I,[L.value]:I}:{}):I.filter(G=>!!Ir(G)||C.value).map(G=>Ir(G)||{[u.value]:G,[w.value]:G,[L.value]:G}),E1=()=>{Ft.value=i.watch(te,I=>{I.length<v.value||!I&&v.value!==0||(he.value=!0,B.value&&(ie.value=[]),setTimeout(()=>{I==te.value&&r.value(te.value,fe).then(G=>{(I==te.value||!te.value)&&(ie.value=G,xt.value=Ze.value.filter(xe=>xe[ce.value]!==!0)[0]||null,he.value=!1)}).catch(G=>{console.error(G)})},y.value))},{flush:"sync"})};if(a.value!=="single"&&!cr(N.value)&&!Array.isArray(N.value))throw new Error(`v-model must be an array when using "${a.value}" mode`);return r&&typeof r.value=="function"?g.value?bl(wl):p.value==!0&&wl():(ie.value=r.value,wl()),y.value>-1&&E1(),i.watch(y,(I,G)=>{Ft.value&&Ft.value(),I>=0&&E1()}),i.watch(N,I=>{if(cr(I)){ot(_l(I),!1);return}switch(a.value){case"single":(p.value?I[w.value]!=ne.value[w.value]:I!=ne.value[w.value])&&ot(_l(I),!1);break;case"multiple":case"tags":bU(p.value?I.map(G=>G[w.value]):I,ne.value.map(G=>G[w.value]))||ot(_l(I),!1);break}},{deep:!0}),i.watch(r,(I,G)=>{typeof e.options=="function"?g.value&&(!G||I&&I.toString()!==G.toString())&&bl():(ie.value=e.options,Object.keys(ne.value).length||wl(),Gd())}),i.watch(u,Gd),{pfo:P,fo:Ze,filteredOptions:Ze,hasSelected:Dn,multipleLabelText:zn,eo:O,extendedOptions:O,eg:et,extendedGroups:et,fg:Tn,filteredGroups:Tn,noOptions:ii,noResults:JA,resolving:he,busy:ue,offset:ht,select:Se,deselect:ye,remove:Xt,selectAll:J3,clear:oi,isSelected:Pt,isDisabled:AA,isMax:ua,getOption:Ir,handleOptionClick:da,handleGroupClick:li,handleTagRemove:ca,refreshOptions:AE,resolveOptions:bl,refreshLabels:Gd}}function CU(e,t,n){const{valueProp:r,showOptions:a,searchable:A,groupLabel:s,groups:o,mode:l,groupSelect:c,disabledProp:u,groupOptions:d}=i.toRefs(e),f=n.fo,h=n.fg,p=n.handleOptionClick,m=n.handleGroupClick,y=n.search,g=n.pointer,v=n.setPointer,_=n.clearPointer,B=n.multiselect,b=n.isOpen,w=i.computed(()=>f.value.filter(N=>!N[u.value])),C=i.computed(()=>h.value.filter(N=>!N[u.value])),k=i.computed(()=>l.value!=="single"&&c.value),S=i.computed(()=>g.value&&g.value.group),T=i.computed(()=>fe(g.value)),U=i.computed(()=>{const N=S.value?g.value:fe(g.value),te=C.value.map(ot=>ot[s.value]).indexOf(N[s.value]);let Pe=C.value[te-1];return Pe===void 0&&(Pe=Q.value),Pe}),F=i.computed(()=>{let N=C.value.map(te=>te.label).indexOf(S.value?g.value[s.value]:fe(g.value)[s.value])+1;return C.value.length<=N&&(N=0),C.value[N]}),Q=i.computed(()=>[...C.value].slice(-1)[0]),Y=i.computed(()=>g.value.__VISIBLE__.filter(N=>!N[u.value])[0]),X=i.computed(()=>{const N=T.value.__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])-1]}),j=i.computed(()=>{const N=fe(g.value).__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])+1]}),K=i.computed(()=>[...U.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),oe=i.computed(()=>[...Q.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),$=N=>g.value&&(!N.group&&g.value[r.value]===N[r.value]||N.group!==void 0&&g.value[s.value]===N[s.value])?!0:void 0,ae=()=>{v(w.value[0]||null)},ce=()=>{!g.value||g.value[u.value]===!0||(S.value?m(g.value):p(g.value))},me=()=>{if(g.value===null)v((o.value&&k.value?C.value[0].__CREATE__?w.value[0]:C.value[0]:w.value[0])||null);else if(o.value&&k.value){let N=S.value?Y.value:j.value;N===void 0&&(N=F.value,N.__CREATE__&&(N=N[d.value][0])),v(N||null)}else{let N=w.value.map(te=>te[r.value]).indexOf(g.value[r.value])+1;w.value.length<=N&&(N=0),v(w.value[N]||null)}i.nextTick(()=>{ne()})},Ee=()=>{if(g.value===null){let N=w.value[w.value.length-1];o.value&&k.value&&(N=oe.value,N===void 0&&(N=Q.value)),v(N||null)}else if(o.value&&k.value){let N=S.value?K.value:X.value;N===void 0&&(N=S.value?U.value:T.value,N.__CREATE__&&(N=K.value,N===void 0&&(N=U.value))),v(N||null)}else{let N=w.value.map(te=>te[r.value]).indexOf(g.value[r.value])-1;N<0&&(N=w.value.length-1),v(w.value[N]||null)}i.nextTick(()=>{ne()})},fe=N=>C.value.find(te=>te.__VISIBLE__.map(Pe=>Pe[r.value]).indexOf(N[r.value])!==-1),ne=()=>{let N=B.value.querySelector("[data-pointed]");if(!N)return;let te=N.parentElement.parentElement;o.value&&(te=S.value?N.parentElement.parentElement.parentElement:N.parentElement.parentElement.parentElement.parentElement),N.offsetTop+N.offsetHeight>te.clientHeight+te.scrollTop&&(te.scrollTop=N.offsetTop+N.offsetHeight-te.clientHeight),N.offsetTop<te.scrollTop&&(te.scrollTop=N.offsetTop)};return i.watch(y,N=>{A.value&&(N.length&&a.value?ae():_())}),i.watch(b,N=>{if(N){let te=B.value.querySelectorAll("[data-selected]")[0];if(!te)return;let Pe=te.parentElement.parentElement;i.nextTick(()=>{Pe.scrollTop>0||(Pe.scrollTop=te.offsetTop)})}}),{pointer:g,canPointGroups:k,isPointed:$,setPointerFirst:ae,selectPointer:ce,forwardPointer:me,backwardPointer:Ee}}function EU(e,t,n){const{disabled:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=i.ref(!1);return{isOpen:A,open:()=>{A.value||r.value||(A.value=!0,t.emit("open",a))},close:()=>{A.value&&(A.value=!1,t.emit("close",a))}}}function kU(e,t,n){const{searchable:r,disabled:a,clearOnBlur:A}=i.toRefs(e),s=n.input,o=n.open,l=n.close,c=n.clearSearch,u=n.isOpen,d=i.ref(null),f=i.ref(null),h=i.ref(null),p=i.ref(!1),m=i.ref(!1),y=i.computed(()=>r.value||a.value?-1:0),g=()=>{r.value&&s.value.blur(),f.value.blur()},v=()=>{r.value&&!a.value&&s.value.focus()},_=(S=!0)=>{a.value||(p.value=!0,S&&o())},B=()=>{p.value=!1,setTimeout(()=>{p.value||(l(),A.value&&c())},1)};return{multiselect:d,wrapper:f,tags:h,tabindex:y,isActive:p,mouseClicked:m,blur:g,focus:v,activate:_,deactivate:B,handleFocusIn:S=>{S.target.closest("[data-tags]")&&S.target.nodeName!=="INPUT"||S.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{B()},handleCaretClick:()=>{B(),g()},handleMousedown:S=>{m.value=!0,u.value&&(S.target.isEqualNode(f.value)||S.target.isEqualNode(h.value))?setTimeout(()=>{B()},0):document.activeElement.isEqualNode(f.value)&&!u.value&&_(),setTimeout(()=>{m.value=!1},0)}}}function SU(e,t,n){const{mode:r,addTagOn:a,openDirection:A,searchable:s,showOptions:o,valueProp:l,groups:c,addOptionOn:u,createTag:d,createOption:f,reverse:h}=i.toRefs(e),p=i.getCurrentInstance().proxy,m=n.iv,y=n.update,g=n.search,v=n.setPointer,_=n.selectPointer,B=n.backwardPointer,b=n.forwardPointer,w=n.multiselect,C=n.wrapper,k=n.tags,S=n.isOpen,T=n.open,U=n.blur,F=n.fo,Q=i.computed(()=>d.value||f.value||!1),Y=i.computed(()=>a.value!==void 0?a.value:u.value!==void 0?u.value:["enter"]),X=()=>{r.value==="tags"&&!o.value&&Q.value&&s.value&&!c.value&&v(F.value[F.value.map($=>$[l.value]).indexOf(g.value)])},j=$=>{let ae=$.length-1;for(;ae>=0&&($[ae].remove===!1||$[ae].disabled);)ae--;return ae<0||$.splice(ae,1),$};return{handleKeydown:$=>{t.emit("keydown",$,p);let ae,ce;switch(["ArrowLeft","ArrowRight","Enter"].indexOf($.key)!==-1&&r.value==="tags"&&(ae=[...w.value.querySelectorAll("[data-tags] > *")].filter(me=>me!==k.value),ce=ae.findIndex(me=>me===document.activeElement)),$.key){case"Backspace":if(r.value==="single"||s.value&&[null,""].indexOf(g.value)===-1||m.value.length===0)return;y(j([...m.value]));break;case"Enter":if($.preventDefault(),$.keyCode===229)return;if(ce!==-1&&ce!==void 0){y([...m.value].filter((me,Ee)=>Ee!==ce)),ce===ae.length-1&&(ae.length-1?ae[ae.length-2].focus():s.value?k.value.querySelector("input").focus():C.value.focus());return}if(Y.value.indexOf("enter")===-1&&Q.value)return;X(),_();break;case" ":if(!Q.value&&!s.value){$.preventDefault(),X(),_();return}if(!Q.value)return!1;if(Y.value.indexOf("space")===-1&&Q.value)return;$.preventDefault(),X(),_();break;case"Tab":case";":case",":if(Y.value.indexOf($.key.toLowerCase())===-1||!Q.value)return;X(),_(),$.preventDefault();break;case"Escape":U();break;case"ArrowUp":if($.preventDefault(),!o.value)return;S.value||T(),B();break;case"ArrowDown":if($.preventDefault(),!o.value)return;S.value||T(),b();break;case"ArrowLeft":if(s.value&&k.value&&k.value.querySelector("input").selectionStart||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),ce===-1?ae[ae.length-1].focus():ce>0&&ae[ce-1].focus();break;case"ArrowRight":if(ce===-1||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),ae.length>ce+1?ae[ce+1].focus():s.value?k.value.querySelector("input").focus():s.value||C.value.focus();break}},handleKeyup:$=>{t.emit("keyup",$,p)},preparePointer:X}}function xU(e,t,n){const{classes:r,disabled:a,openDirection:A,showOptions:s}=i.toRefs(e),o=n.isOpen,l=n.isPointed,c=n.isSelected,u=n.isDisabled,d=n.isActive,f=n.canPointGroups,h=n.resolving,p=n.fo,m=i.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value})),y=i.computed(()=>!!(o.value&&s.value&&(!h.value||h.value&&p.value.length)));return{classList:i.computed(()=>{const v=m.value;return{container:[v.container].concat(a.value?v.containerDisabled:[]).concat(y.value&&A.value==="top"?v.containerOpenTop:[]).concat(y.value&&A.value!=="top"?v.containerOpen:[]).concat(d.value?v.containerActive:[]),wrapper:v.wrapper,spacer:v.spacer,singleLabel:v.singleLabel,singleLabelText:v.singleLabelText,multipleLabel:v.multipleLabel,search:v.search,tags:v.tags,tag:[v.tag].concat(a.value?v.tagDisabled:[]),tagDisabled:v.tagDisabled,tagRemove:v.tagRemove,tagRemoveIcon:v.tagRemoveIcon,tagsSearchWrapper:v.tagsSearchWrapper,tagsSearch:v.tagsSearch,tagsSearchCopy:v.tagsSearchCopy,placeholder:v.placeholder,caret:[v.caret].concat(o.value?v.caretOpen:[]),clear:v.clear,clearIcon:v.clearIcon,spinner:v.spinner,inifinite:v.inifinite,inifiniteSpinner:v.inifiniteSpinner,dropdown:[v.dropdown].concat(A.value==="top"?v.dropdownTop:[]).concat(!o.value||!s.value||!y.value?v.dropdownHidden:[]),options:[v.options].concat(A.value==="top"?v.optionsTop:[]),group:v.group,groupLabel:_=>{let B=[v.groupLabel];return l(_)?B.push(c(_)?v.groupLabelSelectedPointed:v.groupLabelPointed):c(_)&&f.value?B.push(u(_)?v.groupLabelSelectedDisabled:v.groupLabelSelected):u(_)&&B.push(v.groupLabelDisabled),f.value&&B.push(v.groupLabelPointable),B},groupOptions:v.groupOptions,option:(_,B)=>{let b=[v.option];return l(_)?b.push(c(_)?v.optionSelectedPointed:v.optionPointed):c(_)?b.push(u(_)?v.optionSelectedDisabled:v.optionSelected):(u(_)||B&&u(B))&&b.push(v.optionDisabled),b},noOptions:v.noOptions,noResults:v.noResults,assist:v.assist,fakeInput:v.fakeInput}}),showDropdown:y}}function FU(e,t,n){const{limit:r,infinite:a}=i.toRefs(e),A=n.isOpen,s=n.offset,o=n.search,l=n.pfo,c=n.eo,u=i.ref(null),d=i.ref(null),f=i.computed(()=>s.value<l.value.length),h=m=>{const{isIntersecting:y,target:g}=m[0];if(y){const v=g.offsetParent,_=v.scrollTop;s.value+=r.value==-1?10:r.value,i.nextTick(()=>{v.scrollTop=_})}},p=()=>{A.value&&s.value<l.value.length?u.value.observe(d.value):!A.value&&u.value&&u.value.disconnect()};return i.watch(A,()=>{a.value&&p()}),i.watch(o,()=>{a.value&&(s.value=r.value,p())},{flush:"post"}),i.watch(c,()=>{a.value&&p()},{immediate:!1,flush:"post"}),i.onMounted(()=>{window&&window.IntersectionObserver&&(u.value=new IntersectionObserver(h))}),{hasMore:f,infiniteLoader:d}}function IU(e,t,n){const{placeholder:r,id:a,valueProp:A,label:s,mode:o,groupLabel:l,aria:c,searchable:u}=i.toRefs(e),d=n.pointer,f=n.iv,h=n.hasSelected,p=n.multipleLabelText,m=i.ref(null),y=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("assist"),F.join("-")}),g=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("multiselect-options"),F.join("-")}),v=i.computed(()=>{let F=[];if(a&&a.value&&F.push(a.value),d.value)return F.push(d.value.group?"multiselect-group":"multiselect-option"),F.push(d.value.group?d.value.index:d.value[A.value]),F.join("-")}),_=i.computed(()=>r.value),B=i.computed(()=>o.value!=="single"),b=i.computed(()=>{let F="";return o.value==="single"&&h.value&&(F+=f.value[s.value]),o.value==="multiple"&&h.value&&(F+=p.value),o.value==="tags"&&h.value&&(F+=f.value.map(Q=>Q[s.value]).join(", ")),F}),w=i.computed(()=>{let F={...c.value};return u.value&&(F["aria-labelledby"]=F["aria-labelledby"]?`${y.value} ${F["aria-labelledby"]}`:y.value,b.value&&F["aria-label"]&&(F["aria-label"]=`${b.value}, ${F["aria-label"]}`)),F}),C=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-option"),Q.push(F[A.value]),Q.join("-")},k=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-group"),Q.push(F.index),Q.join("-")},S=F=>{let Q=[];return Q.push(F),Q.join(" ")},T=F=>{let Q=[];return Q.push(F),Q.join(" ")},U=F=>`${F} ❎`;return i.onMounted(()=>{if(a&&a.value&&document&&document.querySelector){let F=document.querySelector(`[for="${a.value}"]`);m.value=F?F.innerText:null}}),{arias:w,ariaLabel:b,ariaAssist:y,ariaControls:g,ariaPlaceholder:_,ariaMultiselectable:B,ariaActiveDescendant:v,ariaOptionId:C,ariaOptionLabel:S,ariaGroupId:k,ariaGroupLabel:T,ariaTagLabel:U}}function UU(e,t,n){const{locale:r,fallbackLocale:a}=i.toRefs(e);return{localize:s=>!s||typeof s!="object"?s:s&&s[r.value]?s[r.value]:s&&r.value&&s[r.value.toUpperCase()]?s[r.value.toUpperCase()]:s&&s[a.value]?s[a.value]:s&&a.value&&s[a.value.toUpperCase()]?s[a.value.toUpperCase()]:s&&Object.keys(s)[0]?s[Object.keys(s)[0]]:""}}function QU(e,t,n,r={}){return n.forEach(a=>{a&&(r={...r,...a(e,t,r)})}),r}var Vt={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1}},setup(e,t){return QU(e,t,[UU,vU,yU,EU,BU,mU,kU,_U,FU,CU,SU,xU,IU])}};const TU=["id","dir"],DU=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],LU=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],OU=["onKeyup","aria-label"],MU=["onClick"],NU=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],PU=["innerHTML"],HU=["id"],RU=["id","aria-label","aria-selected"],VU=["data-pointed","onMouseenter","onClick"],KU=["innerHTML"],$U=["aria-label"],WU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],GU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],zU=["innerHTML"],jU=["innerHTML"],YU=["value"],qU=["name","value"],XU=["name","value"],JU=["id"];function ZU(e,t,n,r,a,A){return i.openBlock(),i.createElementBlock("div",{ref:"multiselect",class:i.normalizeClass(e.classList.container),id:n.searchable?void 0:n.id,dir:n.rtl?"rtl":void 0,onFocusin:t[10]||(t[10]=(...s)=>e.handleFocusIn&&e.handleFocusIn(...s)),onFocusout:t[11]||(t[11]=(...s)=>e.handleFocusOut&&e.handleFocusOut(...s)),onKeyup:t[12]||(t[12]=(...s)=>e.handleKeyup&&e.handleKeyup(...s)),onKeydown:t[13]||(t[13]=(...s)=>e.handleKeydown&&e.handleKeydown(...s))},[i.createElementVNode("div",i.mergeProps({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...s)=>e.handleMousedown&&e.handleMousedown(...s)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":n.searchable?void 0:e.ariaControls,"aria-placeholder":n.searchable?void 0:e.ariaPlaceholder,"aria-expanded":n.searchable?void 0:e.isOpen,"aria-activedescendant":n.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":n.searchable?void 0:e.ariaMultiselectable,role:n.searchable?void 0:"combobox"},n.searchable?{}:e.arias),[i.createCommentVNode(" Search "),n.mode!=="tags"&&n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:n.autocomplete,id:n.searchable?n.id:void 0,onInput:t[0]||(t[0]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[1]||(t[1]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[2]||(t[2]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,LU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Tags (with search) "),n.mode=="tags"?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(e.classList.tags),"data-tags":""},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.iv,(s,o,l)=>i.renderSlot(e.$slots,"tag",{option:s,handleTagRemove:e.handleTagRemove,disabled:n.disabled},()=>[(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass([e.classList.tag,s.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:i.withKeys(c=>e.handleTagRemove(s,c),["enter"]),key:l,"aria-label":e.ariaTagLabel(e.localize(s[n.label]))},[i.createTextVNode(i.toDisplayString(e.localize(s[n.label]))+" ",1),!n.disabled&&!s.disabled?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(e.classList.tagRemove),onClick:i.withModifiers(c=>e.handleTagRemove(s,c),["stop"])},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagRemoveIcon)},null,2)],10,MU)):i.createCommentVNode("v-if",!0)],42,OU))])),256)),i.createElementVNode("div",{class:i.normalizeClass(e.classList.tagsSearchWrapper),ref:"tags"},[i.createCommentVNode(" Used for measuring search width "),i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagsSearchCopy)},i.toDisplayString(e.search),3),i.createCommentVNode(" Actual search input "),n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:n.searchable?n.id:void 0,autocomplete:n.autocomplete,onInput:t[3]||(t[3]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[4]||(t[4]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[5]||(t[5]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,NU)):i.createCommentVNode("v-if",!0)],2)],2)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Single label "),n.mode=="single"&&e.hasSelected&&!e.search&&e.iv?i.renderSlot(e.$slots,"singlelabel",{key:2,value:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.singleLabel)},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.singleLabelText)},i.toDisplayString(e.localize(e.iv[n.label])),3)],2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Multiple label "),n.mode=="multiple"&&e.hasSelected&&!e.search?i.renderSlot(e.$slots,"multiplelabel",{key:3,values:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,PU)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Placeholder "),n.placeholder&&!e.hasSelected&&!e.search?i.renderSlot(e.$slots,"placeholder",{key:4},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.placeholder),"aria-hidden":"true"},i.toDisplayString(n.placeholder),3)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Spinner "),n.loading||e.resolving?i.renderSlot(e.$slots,"spinner",{key:5},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.spinner),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Clear "),e.hasSelected&&!n.disabled&&n.canClear&&!e.busy?i.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},()=>[i.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:i.normalizeClass(e.classList.clear),onClick:t[6]||(t[6]=(...s)=>e.clear&&e.clear(...s)),onKeyup:t[7]||(t[7]=i.withKeys((...s)=>e.clear&&e.clear(...s),["enter"]))},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.clearIcon)},null,2)],34)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Caret "),n.caret&&n.showOptions?i.renderSlot(e.$slots,"caret",{key:7},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.caret),onClick:t[8]||(t[8]=(...s)=>e.handleCaretClick&&e.handleCaretClick(...s)),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0)],16,DU),i.createCommentVNode(" Options "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.dropdown),tabindex:"-1"},[i.renderSlot(e.$slots,"beforelist",{options:e.fo}),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.options),id:e.ariaControls,role:"listbox"},[n.groups?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(e.fg,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.group),key:l,id:e.ariaGroupId(s),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),"aria-selected":e.isSelected(s),role:"option"},[s.__CREATE__?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(e.classList.groupLabel(s)),"data-pointed":e.isPointed(s),onMouseenter:c=>e.setPointer(s,o),onClick:c=>e.handleGroupClick(s)},[i.renderSlot(e.$slots,"grouplabel",{group:s,isSelected:e.isSelected,isPointed:e.isPointed},()=>[i.createElementVNode("span",{innerHTML:e.localize(s[n.groupLabel])},null,8,KU)])],42,VU)),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),role:"group"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.__VISIBLE__,(c,u,d)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(c,s)),"data-pointed":e.isPointed(c),"data-selected":e.isSelected(c)||void 0,key:d,onMouseenter:f=>e.setPointer(c),onClick:f=>e.handleOptionClick(c),id:e.ariaOptionId(c),"aria-selected":e.isSelected(c),"aria-label":e.ariaOptionLabel(e.localize(c[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:c,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(c[n.label])),1)])],42,WU))),128))],10,$U)],10,RU))),128)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.fo,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(s)),"data-pointed":e.isPointed(s),"data-selected":e.isSelected(s)||void 0,key:l,onMouseenter:c=>e.setPointer(s),onClick:c=>e.handleOptionClick(s),id:e.ariaOptionId(s),"aria-selected":e.isSelected(s),"aria-label":e.ariaOptionLabel(e.localize(s[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:s,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(s[n.label])),1)])],42,GU))),128))],10,HU),e.noOptions?i.renderSlot(e.$slots,"nooptions",{key:0},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noOptions),innerHTML:e.localize(n.noOptionsText)},null,10,zU)]):i.createCommentVNode("v-if",!0),e.noResults?i.renderSlot(e.$slots,"noresults",{key:1},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noResults),innerHTML:e.localize(n.noResultsText)},null,10,jU)]):i.createCommentVNode("v-if",!0),n.infinite&&e.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.inifinite),ref:"infiniteLoader"},[i.renderSlot(e.$slots,"infinite",{},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.inifiniteSpinner)},null,2)])],2)):i.createCommentVNode("v-if",!0),i.renderSlot(e.$slots,"afterlist",{options:e.fo})],2),i.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(i.openBlock(),i.createElementBlock("input",{key:0,class:i.normalizeClass(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,YU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Native input support "),n.nativeSupport?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.mode=="single"?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:e.plainValue!==void 0?e.plainValue:""},null,8,qU)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.plainValue,(s,o)=>(i.openBlock(),i.createElementBlock("input",{type:"hidden",name:`${n.name}[]`,value:s,key:o},null,8,XU))),128))],64)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Screen reader assistive text "),n.searchable&&e.hasSelected?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},i.toDisplayString(e.ariaLabel),11,JU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Create height for empty input "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.spacer)},null,2)],42,TU)}Vt.render=ZU;Vt.__file="src/Multiselect.vue";const eQ={class:"search-bar"},tQ=i.defineComponent({__name:"SearchBar",props:hb,setup(e){const t=e,n=i.ref(""),r=us.useRouter();function a(s,o,l){l.clear(),l.search=n.value,r.push(o.link)}function A(s){n.value=s}return(s,o)=>(i.openBlock(),i.createElementBlock("div",eQ,[i.createVNode(i.unref(Vt),{placeholder:"Search Cards or Players","value-prop":"link","clear-on-blur":!1,"clear-on-search":!1,"clear-on-select":!1,"close-on-select":!0,delay:0,"filter-results":!1,groups:!0,"min-chars":0,"resolve-on-load":!1,searchable:!0,options:t.fetchSeachResult,onOpen:o[0]||(o[0]=l=>{l.noOptions&&l.resolveOptions()}),onSearchChange:A,onSelect:a},{option:i.withCtx(({option:l})=>[l.type==="card"?(i.openBlock(),i.createBlock(fn,{key:`card-${l.card.cardCode}`,class:"card-slice-item","maintain-aspect-ratio":!0,"card-prop":l.card,"router-link":l.link},null,8,["card-prop","router-link"])):(i.openBlock(),i.createBlock(fn,{key:`player-${l.link}`,class:"card-slice-item","maintain-aspect-ratio":!0,"ignore-card-item":!0,"card-code-prop":l.cardCode,color:l.color,name:l.name,"mana-number":l.rank,"router-link":l.link},null,8,["card-code-prop","color","name","mana-number","router-link"]))]),_:1},8,["options"])]))}});const Yu=M(tQ,[["__scopeId","data-v-ca4e3b0d"]]),nQ={class:"social-links"},rQ=i.defineComponent({__name:"SocialLinks",setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",nQ,[i.createVNode(i.unref(Ue),{class:"icon",icon:"fa-brands fa-discord"}),i.createVNode(i.unref(Ue),{class:"icon",icon:"fa-brands fa-twitter"})]))}});const vg=M(rQ,[["__scopeId","data-v-5517438c"]]),aQ={showModal:{type:Boolean,required:!0,default:!1}},AQ=["onClick"],sQ=i.defineComponent({__name:"ModalItem",props:aQ,emits:["update:showModal"],setup(e,{emit:t}){const n=e,r=i.ref(null);function a(){t("update:showModal",!1)}return i.onBeforeUnmount(()=>{var A;(A=r.value)==null||A.remove()}),i.watch(()=>n.showModal,()=>{n.showModal&&i.nextTick(()=>{r.value&&document.body.appendChild(r.value)})}),(A,s)=>n.showModal?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"modalItem",ref:r,class:"modal-item",onClick:i.withModifiers(a,["self"])},[i.renderSlot(A.$slots,"default",{},void 0,!0)],8,AQ)):i.createCommentVNode("",!0)}});const VA=M(sQ,[["__scopeId","data-v-5e715d99"]]),iQ={filterArray:{type:Array,required:!1,default:void 0},title:{type:String,required:!1,default:void 0}},oQ={class:"filter"},lQ={key:0,class:"top"},cQ={key:0,class:"title"},uQ=i.defineComponent({__name:"SidePanelSectionPane",props:iQ,emits:["clear:filterArray"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterArray&&n.filterArray.length>0?"clickable":null);function a(){t("clear:filterArray")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",oQ,[n.title||A.filterArray?(i.openBlock(),i.createElementBlock("div",lQ,[n.title?(i.openBlock(),i.createElementBlock("h2",cQ,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),A.filterArray?i.withDirectives((i.openBlock(),i.createElementBlock("p",{key:1,class:i.normalizeClass(["clear",r.value]),onClick:a},null,2)),[[o,"general.clear"]]):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const mt=M(uQ,[["__scopeId","data-v-741cceed"]]),dQ={filterArray:{type:Array,required:!0,default:[]}},fQ=["placeholder"],hQ=i.defineComponent({__name:"FilterSampleSize",props:dQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray),A=i.ref("");let s=setTimeout(()=>{},0);a.value.length>0&&(A.value=a.value[0]),i.watch(a,()=>{t("update:filterArray",a.value)}),i.watch(A,()=>{s&&clearTimeout(s),s=setTimeout(()=>{a.value.splice(0),A.value&&a.value.push(A.value)},1e3)});function o(){a.value.splice(0),A.value=""}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("general.sampleSize"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),placeholder:i.unref(r)("general.minimumMatches"),type:"number",min:"10",step:"10"},null,8,fQ),[[i.vModelText,A.value]])]),_:1},8,["filter-array","title"]))}});const Xs=M(hQ,[["__scopeId","data-v-d66d5f9d"]]),pQ={filterArray:{type:Array,required:!0,default:[]}},gQ={isSelected:{type:Boolean,required:!0,default:!1},icon:{type:String,required:!1,default:void 0},prompt:{type:String,required:!0,default:""}},mQ=["selected"],vQ={class:"checkbox-name"},BQ=i.defineComponent({__name:"CheckboxItem",props:gQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e,r=i.computed(()=>(console.log(n.icon),{content:n.icon}));function a(){t("update:isSelected",!n.isSelected)}return(A,s)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:a},[n.icon?(i.openBlock(),i.createElementBlock("div",{key:0,class:"checkbox-icon",style:i.normalizeStyle(r.value)},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",vQ,i.toDisplayString(n.prompt),1)],8,mQ))}});const tn=M(BQ,[["__scopeId","data-v-a4c6109c"]]),yQ={selectedOption:{type:Number,required:!0,default:-1},options:{type:Array,required:!0,default:[]}},wQ=e=>(i.pushScopeId("data-v-d5d9745a"),e=e(),i.popScopeId(),e),bQ={class:"toggle-switch"},_Q=wQ(()=>i.createElementVNode("div",{class:"selection"},null,-1)),CQ=[_Q],EQ=["onClick"],kQ={class:"option flex-center"},SQ={class:"option-text"},xQ=i.defineComponent({__name:"ToggleSwitch",props:yQ,emits:["update:selectedOption"],setup(e,{emit:t}){const n=e,r=i.computed(()=>({left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${n.selectedOption})`,width:`calc((100% - calc(var(--spacing-1) * 2)) / ${n.options.length})`}));function a(s){return{cursor:n.selectedOption!=s?"pointer":"default",left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${s})`,width:`${1/n.options.length*100}%`}}function A(s){t("update:selectedOption",s)}return(s,o)=>(i.openBlock(),i.createElementBlock("div",bQ,[i.withDirectives(i.createElementVNode("div",{class:"selection-container",style:i.normalizeStyle(r.value)},CQ,4),[[i.vShow,s.selectedOption>-1]]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,(l,c)=>(i.openBlock(),i.createElementBlock("div",{key:c,ref_for:!0,ref:"option-container",style:i.normalizeStyle(a(c)),class:"option-container",onClick:u=>A(c)},[i.createElementVNode("div",kQ,[i.createElementVNode("h1",SQ,i.toDisplayString(l),1)])],12,EQ))),128))]))}});const qu=M(xQ,[["__scopeId","data-v-d5d9745a"]]),FQ={class:"checkboxes-container"},IQ=i.defineComponent({__name:"FilterRanks",props:pQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>we().dataJson.ranks.sort((c,u)=>u.order-c.order)),A=i.reactive(n.filterArray),s=i.ref(0);i.watch(A,()=>{t("update:filterArray",A)}),i.watch(s,()=>{s.value===0?A.splice(0):s.value===1&&(A.splice(0),A.push("Platinum","Diamond","Masters"))});function o(){A.splice(0),s.value=0}function l(c){const u=A.indexOf(c);if(u===-1){A.push(c);return}A.splice(u,1)}return(c,u)=>(i.openBlock(),i.createBlock(mt,{"filter-array":A,title:i.unref(r)("general.ranks"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",FQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,d=>(i.openBlock(),i.createBlock(tn,{key:d.nameRef,icon:`url(${d.icon})`,prompt:d.name,"is-selected":A.includes(d.nameRef),"onUpdate:isSelected":f=>l(d.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(qu,{"selected-option":s.value,"onUpdate:selectedOption":u[0]||(u[0]=d=>s.value=d),options:[i.unref(r)("general.allRanks"),i.unref(r)("general.platPlus")]},null,8,["selected-option","options"])])]),_:1},8,["filter-array","title"]))}});const mb=M(IQ,[["__scopeId","data-v-af7bc2a0"]]),UQ={filterArray:{type:Array,required:!0,default:[]}},QQ={isSelected:{type:Boolean,required:!0,default:!1},prompt:{type:Number,required:!0,default:""}},TQ=["selected"],DQ={class:"prompt"},LQ=i.defineComponent({__name:"CheckboxItemManaCost",props:QQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e;function r(){t("update:isSelected",!n.isSelected)}return(a,A)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:r},[i.createVNode(jo),i.createElementVNode("div",DQ,i.toDisplayString(n.prompt===10?"+":n.prompt),1)],8,TQ))}});const Au=M(LQ,[["__scopeId","data-v-2c74c2ed"]]),OQ={class:"checkbox-rows-container"},MQ={class:"top-row checkbox-items-container"},NQ={class:"bottom-row checkbox-items-container"},PQ=i.defineComponent({__name:"FilterManaCost",props:UQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=Array(6).fill(1).map((l,c)=>c),A=Array(5).fill(1).map((l,c)=>c+6);function s(l){let c;n.filterArray.includes(l)?c=n.filterArray.filter(u=>u!==l):c=[...n.filterArray,l],t("update:filterArray",c)}function o(){t("update:filterArray",[])}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":n.filterArray,title:i.unref(r)("general.manaCost"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",OQ,[i.createElementVNode("div",MQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(a),u=>(i.openBlock(),i.createBlock(Au,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))]),i.createElementVNode("div",NQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(A),u=>(i.openBlock(),i.createBlock(Au,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])])]),_:1},8,["filter-array","title"]))}});const Bg=M(PQ,[["__scopeId","data-v-a94d786a"]]),HQ={filterArray:{type:Array,required:!0,default:[]}},RQ={class:"checkboxes-container"},yg=i.defineComponent({__name:"FilterRarities",props:HQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>we().dataJson.rarities.filter(l=>l.nameRef!=="None")),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":A,title:i.unref(r)("general.rarities"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",RQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(tn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),VQ={filterArray:{type:Array,required:!0,default:[]}},KQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},$Q=["src"],WQ={class:"multiselect-tag-remove"},GQ=["onMousedown"],zQ=["src"],wg=i.defineComponent({__name:"FilterSets",props:VQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray);i.watch(a,()=>{t("update:filterArray",a.value)});function A(){a.value.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("general.sets"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),placeholder:i.unref(r)("general.sets"),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.sets,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:l,handleTagRemove:c})=>[i.createElementVNode("span",KQ,[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,$Q),i.createElementVNode("span",WQ,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(u=>c(l,u),["prevent"])},null,40,GQ)])])]),option:i.withCtx(({option:l})=>[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,zQ),i.createTextVNode(" "+i.toDisplayString(l.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),jQ={filterArray:{type:Array,required:!0,default:[]}},YQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},qQ=["src"],XQ={class:"multiselect-tag-remove"},JQ=["onMousedown"],ZQ=["src"],bg=i.defineComponent({__name:"FilterKeywords",props:jQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray),A=i.computed(()=>we().dataJson.keywords.filter(o=>o.showInFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("general.keywords"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createVNode(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:i.unref(r)("general.keywords"),class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:c,handleTagRemove:u})=>[i.createElementVNode("span",YQ,[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,qQ),i.createElementVNode("span",XQ,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(d=>u(c,d),["prevent"])},null,40,JQ)])])]),option:i.withCtx(({option:c})=>[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,ZQ),i.createTextVNode(" "+i.toDisplayString(c.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),eT={filterArray:{type:Array,required:!0,default:[]}},tT={class:"checkboxes-container"},Js=i.defineComponent({__name:"FilterServers",props:eT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterArray);i.watch(a,()=>{t("update:filterArray",a)});function A(){a.splice(0)}function s(o){const l=a.indexOf(o);if(l===-1){a.push(o);return}a.splice(l,1)}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a,title:i.unref(r)("general.servers"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createElementVNode("div",tT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.servers,c=>(i.openBlock(),i.createBlock(tn,{key:c.nameRef,prompt:c.name,"is-selected":a.includes(c.nameRef),"onUpdate:isSelected":u=>s(c.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),nT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},rT={class:"checkboxes-container"},aT=i.defineComponent({__name:"FilterTime",props:nT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterArray),A=i.ref(null),s=i.ref(null),o=a.find(h=>h.startsWith("patch_"));o&&(A.value=o);const l=a.find(h=>h.startsWith("season_"));l&&(s.value=l);const c=i.computed(()=>n.allowZero&&a.filter(h=>h.startsWith("patch")).length>0||!n.allowZero&&a.filter(h=>!h.startsWith("patch")).length===0);i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(h,p)=>{u(h,p)}),i.watch(s,(h,p)=>{u(h,p)});function u(h,p){console.log(p,h),p&&a.splice(a.indexOf(p),1),h&&a.push(h),console.log(a)}function d(){a.splice(0),A.value=null,s.value=null}function f(h){a.splice(0),(n.allowZero||h!=="patch")&&a.push(h),h==="patch"&&A.value&&a.push(A.value),h==="season"&&s.value&&a.push(s.value)}return(h,p)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a,title:i.unref(r)("general.time"),"onClear:filterArray":d},{default:i.withCtx(()=>[i.createElementVNode("div",rT,[i.createVNode(tn,{prompt:i.unref(r)("general.patch"),"is-selected":c.value,"onUpdate:isSelected":p[0]||(p[0]=m=>f("patch"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.season"),"is-selected":a.includes("season"),"onUpdate:isSelected":p[1]||(p[1]=m=>f("season"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastDays",7),"is-selected":a.includes("past7days"),"onUpdate:isSelected":p[2]||(p[2]=m=>f("past7days"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastDays",3),"is-selected":a.includes("past3days"),"onUpdate:isSelected":p[3]||(p[3]=m=>f("past3days"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastHours",24),"is-selected":a.includes("past24hours"),"onUpdate:isSelected":p[4]||(p[4]=m=>f("past24hours"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastHour"),"is-selected":a.includes("pastHour"),"onUpdate:isSelected":p[5]||(p[5]=m=>f("pastHour"))},null,8,["prompt","is-selected"]),c.value?(i.openBlock(),i.createBlock(i.unref(Vt),{key:0,modelValue:A.value,"onUpdate:modelValue":p[6]||(p[6]=m=>A.value=m),options:i.unref(we)().dataJson.patches,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0),a.includes("season")?(i.openBlock(),i.createBlock(i.unref(Vt),{key:1,modelValue:s.value,"onUpdate:modelValue":p[7]||(p[7]=m=>s.value=m),options:i.unref(we)().dataJson.seasons,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const KA=M(aT,[["__scopeId","data-v-78ab671a"]]),AT={filterArray:{type:Array,required:!0,default:[]}},sT={cardCodes:{type:Array,required:!0,default:[]},filterCallback:{type:Function,required:!1,default:()=>!0},mode:{type:String,required:!1,default:"tags"}},iT=i.defineComponent({__name:"CardMultiselect",props:sT,emits:["update:cardCodes"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.cardCodes),A=i.computed(()=>{let s=Qw().cardJson.sort((o,l)=>o.name.localeCompare(l.name));return n.filterCallback&&(s=s.filter(n.filterCallback)),s});return i.watch(a,()=>{t("update:cardCodes",a.value)}),(s,o)=>(i.openBlock(),i.createBlock(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),class:"multiselect",placeholder:i.unref(r)("cards.cards"),mode:n.mode,options:A.value,infinite:!0,limit:10,searchable:!0,label:"name","value-prop":"cardCode"},null,8,["modelValue","placeholder","mode","options"]))}});const _g=M(iT,[["__scopeId","data-v-968634df"]]),Xu=i.defineComponent({__name:"FilterCardCodes",props:AT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray);i.watch(a,()=>{console.log("watch(filterArray)",a.value),t("update:filterArray",a.value)});function A(){a.value.splice(0)}function s(o){return o.collectible}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("cards.cards"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(_g,{cardCodes:a.value,"onUpdate:cardCodes":l[0]||(l[0]=c=>a.value=c),mode:"tags","filter-callback":s},null,8,["cardCodes"])]),_:1},8,["filter-array","title"]))}}),oT={filterArray:{type:Array,required:!0,default:[]}},lT={class:"checkboxes-container"},cT=i.defineComponent({__name:"FilterRegions",props:oT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterArray),A=i.ref([]);A.value.push(...a.filter(l=>uo(l))),i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(l,c)=>{let u=l.find(d=>!c.includes(d));if(u||(u=c.find(d=>!l.includes(d)),u))return o(u)});function s(){a.splice(0),A.value.slice(0)}function o(l){const c=a.indexOf(l);if(c===-1){a.push(l),l==="Runeterra"&&a.push(...A.value);return}if(a.splice(c,1),l==="Runeterra")for(let u=0;u<a.length;u++)uo(a[u])&&a.splice(u--,1)}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a,title:i.unref(r)("general.regions"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",lT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.regions,u=>(i.openBlock(),i.createBlock(tn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":a.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(tn,{class:"runeterra",prompt:"Runeterra","is-selected":a.includes("Runeterra"),"onUpdate:isSelected":c[0]||(c[0]=u=>o("Runeterra"))},null,8,["is-selected"]),a.includes("Runeterra")?(i.openBlock(),i.createBlock(i.unref(Vt),{key:0,modelValue:A.value,"onUpdate:modelValue":c[1]||(c[1]=u=>A.value=u),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.runeterraChampions,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Yo=M(cT,[["__scopeId","data-v-c93a9e90"]]),uT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},dT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},fT={class:"checkboxes-container"},hT=i.defineComponent({__name:"FilterFormat",props:dT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>{const d=we().dataJson.queues;return Object.values(we().dataJson.formats).filter(f=>f.availableQueues.some(h=>!d[h].excludeInMassFilter))}),A=i.computed(()=>a.value.filter(d=>!d.inDropdown)),s=i.computed(()=>a.value.filter(d=>d.inDropdown)),o=i.reactive(n.filterArray),l=i.ref(null);i.onMounted(()=>{o.length>0&&s.value.map(d=>d.nameRef).includes(o[0])&&(l.value=o[0])}),i.watch(o,()=>{t("update:filterArray",o),o.length===0&&(l.value=null)}),i.watch(l,()=>{l.value&&(o.splice(0),o.push(l.value))});function c(d){l.value=null,o.splice(0),d!==Vr.Standard&&o.push(d)}function u(){o.splice(0)}return(d,f)=>(i.openBlock(),i.createBlock(mt,{"filter-array":o,title:i.unref(r)("general.format"),"onClear:filterArray":u},{default:i.withCtx(()=>[i.createElementVNode("div",fT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,h=>(i.openBlock(),i.createBlock(tn,{prompt:h.name,"is-selected":o.includes(h.nameRef)||!n.allowZero&&h.nameRef==="Standard"&&o.length===0,"onUpdate:isSelected":p=>c(h.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),256)),s.value.length>0?(i.openBlock(),i.createBlock(i.unref(Vt),{key:0,modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=h=>l.value=h),options:s.value,searchable:!1,placeholder:i.unref(r)("general.otherFormats"),label:"name","value-prop":"nameRef",onClear:u},null,8,["modelValue","options","placeholder"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Cg=M(hT,[["__scopeId","data-v-22de9b40"]]),pT={filterArray:{type:Array,required:!0,default:[]},availableQueues:{type:Array,required:!0,default:[]}},Eg=i.defineComponent({__name:"FilterQueues",props:pT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray),A=i.computed(()=>Object.values(we().dataJson.queues).filter(o=>n.availableQueues.includes(o.nameRef)&&!o.excludeInMassFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>n.availableQueues.length>1?(i.openBlock(),i.createBlock(mt,{key:0,"filter-array":a.value,title:i.unref(r)("general.queues"),"onClear:filterArray":s},{default:i.withCtx(()=>{var c,u;return[i.createVNode(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=d=>a.value=d),placeholder:(u=(c=A.value)==null?void 0:c.find(d=>d.nameRef===i.unref(S2).Ranked))==null?void 0:u.name,class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","placeholder","options"])]}),_:1},8,["filter-array","title"])):i.createCommentVNode("",!0)}}),gT={filterObject:{type:Object,required:!1,default:void 0},showClearAll:{type:Boolean,required:!1,default:!0}},mT={class:"filter"},vT={key:0,class:"top"},BT=i.defineComponent({__name:"SidePanel",props:gT,emits:["clear:filterObject"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterObject&&Object.values(n.filterObject).some(A=>A.length>0)?"clickable":null);function a(){t("clear:filterObject")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",mT,[n.showClearAll&&n.filterObject?(i.openBlock(),i.createElementBlock("div",vT,[i.withDirectives(i.createElementVNode("p",{class:i.normalizeClass(["clear",r.value]),onClick:a},null,2),[[o,"general.clearAll"]])])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const Zs=M(BT,[["__scopeId","data-v-6a93fcc1"]]),vb=i.defineComponent({__name:"FilterDecks",props:uT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(Zs,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Yo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(Xu,{"filter-array":r.cardFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.cardFilters=l)},null,8,["filter-array"]),i.createVNode(Cg,{"filter-array":r.formatFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.formatFilters=l)},null,8,["filter-array"]),n.includeDataFilters?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(Eg,{"filter-array":r.queueFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"]),i.createVNode(Xs,{"filter-array":r.sampleSizeFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.sampleSizeFilters=l)},null,8,["filter-array"]),i.createVNode(KA,{"filter-array":r.timeFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.timeFilters=l)},null,8,["filter-array"]),i.createVNode(Js,{"filter-array":r.serverFilters,"onUpdate:filterArray":o[6]||(o[6]=l=>r.serverFilters=l)},null,8,["filter-array"])],64)):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),yT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},wT={filterArray:{type:Array,required:!0,default:[]},placeholder:{type:String,required:!1},title:{type:String,required:!1,default:"Text"}},bT=["placeholder"],_T=i.defineComponent({__name:"FilterText",props:wT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,r=i.ref(n.filterArray),a=i.ref("");let A=setTimeout(()=>{},0);r.value.length>0&&(a.value=r.value[0]),i.watch(r,()=>{t("update:filterArray",r.value)}),i.watch(a,()=>{A&&clearTimeout(A),A=setTimeout(()=>{r.value.splice(0),a.value&&r.value.push(a.value)},1e3)});function s(){r.value.splice(0),a.value=""}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":r.value,title:n.title,"onClear:filterArray":s},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:n.placeholder,type:"text"},null,8,bT),[[i.vModelText,a.value]])]),_:1},8,["filter-array","title"]))}});const su=M(_T,[["__scopeId","data-v-e9c34cae"]]),Bb=i.defineComponent({__name:"FilterProfile",props:yT,emits:["update:filters"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filters);i.watch(a,()=>{t("update:filters",a)});const A=i.computed(()=>{var o;return a.formatFilters.length===0?[]:(o=we().dataJson.formats[a.formatFilters[0]??"Standard"])==null?void 0:o.availableQueues});function s(){for(const[,o]of Object.entries(a))o.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(Zs,{"filter-object":n.filters,"onClear:filterObject":s},{default:i.withCtx(()=>[i.createVNode(Yo,{"filter-array":a.regionFilters,"onUpdate:filterArray":l[0]||(l[0]=c=>a.regionFilters=c)},null,8,["filter-array"]),i.createVNode(Xu,{"filter-array":a.cardFilters,"onUpdate:filterArray":l[1]||(l[1]=c=>a.cardFilters=c)},null,8,["filter-array"]),i.createVNode(su,{"filter-array":a.deckCodeFilters,"onUpdate:filterArray":l[2]||(l[2]=c=>a.deckCodeFilters=c),placeholder:i.unref(r)("general.deckCode"),title:i.unref(r)("general.deckCode")},null,8,["filter-array","placeholder","title"]),i.createVNode(su,{"filter-array":a.playerFilters,"onUpdate:filterArray":l[3]||(l[3]=c=>a.playerFilters=c),placeholder:i.unref(r)("general.players"),title:i.unref(r)("general.players")},null,8,["filter-array","placeholder","title"]),i.createVNode(Xs,{"filter-array":a.sampleSizeFilters,"onUpdate:filterArray":l[4]||(l[4]=c=>a.sampleSizeFilters=c)},null,8,["filter-array"]),i.createVNode(Cg,{"allow-zero":!0,"filter-array":a.formatFilters,"onUpdate:filterArray":l[5]||(l[5]=c=>a.formatFilters=c)},null,8,["filter-array"]),i.createVNode(Eg,{"filter-array":a.queueFilters,"onUpdate:filterArray":l[6]||(l[6]=c=>a.queueFilters=c),"available-queues":A.value},null,8,["filter-array","available-queues"]),i.createVNode(KA,{"allow-zero":!0,"filter-array":a.timeFilters,"onUpdate:filterArray":l[7]||(l[7]=c=>a.timeFilters=c)},null,8,["filter-array"])]),_:1},8,["filter-object"]))}}),CT={filterValue:{type:Object,required:!0,default:{attribute:"attack",equality:">",number:0}}},ET={class:"advanced-filter-item"},kT=["value"],ST=i.defineComponent({__name:"AdvancedFilterItem",props:CT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=[{value:"attack",label:r("cards.attack")},{value:"health",label:r("cards.health")},{value:"cost",label:r("cards.cost")},{value:"quantityOwned",label:r("cards.quantityOwned")}],A=i.ref(n.filterValue.attribute);i.watch(A,()=>{t("update:filterValue",{attribute:A.value,equality:n.filterValue.equality,number:n.filterValue.number})});function s(){let l=">";n.filterValue.equality===">"?l="<":n.filterValue.equality==="<"&&(l="="),t("update:filterValue",{attribute:n.filterValue.attribute,equality:l,number:n.filterValue.number})}function o(l){t("update:filterValue",{attribute:n.filterValue.attribute,equality:n.filterValue.equality,number:Number(l.target.value)})}return(l,c)=>(i.openBlock(),i.createElementBlock("div",ET,[i.createVNode(i.unref(Vt),{modelValue:A.value,"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),class:"advanced-attribute",options:a,"can-clear":!1,label:"label","value-prop":"value"},null,8,["modelValue"]),i.createElementVNode("div",{class:"equality-button",onClick:s},i.toDisplayString(n.filterValue.equality),1),i.createElementVNode("input",{type:"number",class:"equality-number",value:n.filterValue.number,onInput:o},null,40,kT)]))}});const kg=M(ST,[["__scopeId","data-v-eb2d535d"]]),xT={filterValue:{type:Array,required:!0,default:[]}},FT=i.defineComponent({__name:"FilterAdvanced",props:xT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterValue);i.watch(a,()=>{t("update:filterValue",a)});function A(){a.splice(0)}function s(){a.push({attribute:"attack",equality:">",number:0})}return(o,l)=>(i.openBlock(),i.createBlock(mt,{class:"advanced-filters","filter-array":a,title:i.unref(r)("general.advanced"),"onClear:filterArray":A},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a,(c,u)=>(i.openBlock(),i.createBlock(kg,{key:u,"filter-value":a[u],"onUpdate:filterValue":d=>a[u]=d,class:"advanced-filter-item"},null,8,["filter-value","onUpdate:filterValue"]))),128)),i.createElementVNode("div",{class:"new-advanced-filter",onClick:s},i.toDisplayString(i.unref(r)("general.newAdvancedFilter")),1)]),_:1},8,["filter-array","title"]))}});const Sg=M(FT,[["__scopeId","data-v-6c23ee29"]]),IT={filterArray:{type:Array,required:!0,default:[]}},UT={class:"checkboxes-container"},xg=i.defineComponent({__name:"FilterTypes",props:IT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>we().dataJson.types.filter(l=>["Unit","Spell","Landmark","Equipment"].includes(l.nameRef))),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":n.filterArray,title:i.unref(r)("general.types"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",UT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(tn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),QT={filters:{type:Object,required:!0,default:{advancedFilters:[],regionFilters:[],manaCostFilters:[],typeFilters:[],rarityFilters:[],setFilters:[],keywordFilters:[]}}},yb=i.defineComponent({__name:"FilterCards",props:QT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return"formatFilters"in r?(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues:[]});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(Zs,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Bg,{"filter-array":r.manaCostFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.manaCostFilters=l)},null,8,["filter-array"]),i.createVNode(Yo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(xg,{"filter-array":r.typeFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.typeFilters=l)},null,8,["filter-array"]),i.createVNode(yg,{"filter-array":r.rarityFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.rarityFilters=l)},null,8,["filter-array"]),i.createVNode(wg,{"filter-array":r.setFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.setFilters=l)},null,8,["filter-array"]),i.createVNode(bg,{"filter-array":r.keywordFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.keywordFilters=l)},null,8,["filter-array"]),i.createVNode(Sg,{"filter-value":r.advancedFilters,"onUpdate:filterValue":o[6]||(o[6]=l=>r.advancedFilters=l)},null,8,["filter-value"]),"serverFilters"in r?(i.openBlock(),i.createBlock(i.unref(Js),{key:0,"filter-array":r.serverFilters,"onUpdate:filterArray":o[7]||(o[7]=l=>r.serverFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"timeFilters"in r?(i.openBlock(),i.createBlock(KA,{key:1,"filter-array":r.timeFilters,"onUpdate:filterArray":o[8]||(o[8]=l=>r.timeFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"formatFilters"in r?(i.openBlock(),i.createBlock(Cg,{key:2,"filter-array":r.formatFilters,"onUpdate:filterArray":o[9]||(o[9]=l=>r.formatFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"queueFilters"in r?(i.openBlock(),i.createBlock(Eg,{key:3,"filter-array":r.queueFilters,"onUpdate:filterArray":o[10]||(o[10]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"])):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),TT={regionRef:{type:String,required:!0,default:"Ionia"}},DT={text:{type:String,required:!0,default:""}},LT=["innerHTML"],OT=i.defineComponent({__name:"TippyText",props:DT,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:"tippy-text",innerHTML:t.text},null,8,LT))}});const Ju=M(OT,[["__scopeId","data-v-715107fe"]]),MT={class:"region-item"},NT=["alt","src"],PT=i.defineComponent({__name:"RegionItem",props:TT,setup(e){const t=e,n=i.ref(null),r=i.ref(null),a=i.computed(()=>we().dataJson.regions.find(A=>A.nameRef==t.regionRef)??we().dataJson.runeterraChampions.find(A=>A.nameRef===t.regionRef));return i.onMounted(()=>{At(n.value,{content:r.value,arrow:!0})}),(A,s)=>{var o,l,c;return i.openBlock(),i.createElementBlock("div",MT,[i.createElementVNode("img",{ref_key:"regionImg",ref:n,alt:(o=a.value)==null?void 0:o.name,src:(l=a.value)==null?void 0:l.icon,class:"region-img"},null,8,NT),i.createElementVNode("div",{ref_key:"regionTippy",ref:r},[i.createVNode(Ju,{text:(c=a.value)==null?void 0:c.name},null,8,["text"])],512)])}}});const qo=M(PT,[["__scopeId","data-v-3d756f50"]]),HT={deckCode:{type:String,required:!0,default:""},deck:{type:Object,required:!1},cards:{type:Array,required:!1},describeRegions:{type:Boolean,required:!1,default:!1}},RT={class:"regions-line"},VT={key:0,class:"describe-regions"},KT={class:"lines"},$T=i.defineComponent({__name:"RegionsLine",props:HT,setup(e){const t=e,{t:n}=se(),r=i.computed(()=>t.deck?t.deck:St(t.deckCode)),a=i.computed(()=>t.cards?t.cards:rn(r.value)),A=i.computed(()=>{const o={};for(const l of Ou(r.value))o[l]=0;for(const l of a.value)for(const c of l.regionRefs)c in o&&(o[c]+=r.value[l.cardCode]);return o});function s(o,l){return{flexGrow:o,backgroundColor:`var(--color-${l}, var(--color-Runeterra))`}}return(o,l)=>(i.openBlock(),i.createElementBlock("div",RT,[t.describeRegions?(i.openBlock(),i.createElementBlock("div",VT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,class:"region-description"},[i.createVNode(qo,{"region-ref":u,class:"icon"},null,8,["region-ref"]),i.createElementVNode("span",null,i.toDisplayString(`${c} ${i.unref(n)("general.cards")}`),1)]))),128))])):i.createCommentVNode("",!0),i.createElementVNode("div",KT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,style:i.normalizeStyle(s(c,u)),class:"region-line"},null,4))),128))])]))}});const Fg=M($T,[["__scopeId","data-v-f1f94f8b"]]),WT={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardCode:{type:String,required:!0,default:"01IO001"},toggledStats:{type:Object,required:!0,default:{matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!1,kept:!1,drawnWinrate:!1,turnsHeld:!1,turnPlayed:!1}},index:{type:Number,required:!0,default:1},matches:{type:Number,required:!0,default:1},region:{type:String,required:!0,default:""},wins:{type:Number,required:!0,default:1},inclusion:{type:Number,required:!0,default:.5},avgCopies:{type:Number,required:!0,default:1},mulliganWinrate:{type:Number,required:!1,default:void 0},keptInMulligan:{type:Number,required:!1,default:void 0},drawnWinrate:{type:Number,required:!1,default:void 0},turnsHeld:{type:Number,required:!1,default:void 0},turnPlayed:{type:Number,required:!1,default:void 0}},GT={class:"cards-row-background-wrapper"},zT={class:"cards-row-background"},jT={class:"cards-row wrapper"},YT={key:0,class:"column-content"},qT={key:2,class:"column-content"},XT={key:3,class:"column-content"},JT={key:5,class:"column-content"},ZT={key:7,class:"column-content"},eD={key:8,class:"column-content"},tD=i.defineComponent({__name:"CardsRow",props:WT,setup(e){const t=e,n=i.computed(()=>["",`https://lor.gg/storage/cards/banner/${t.cardCode}.png`]);return(r,a)=>{const A=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(A,{to:t.routerLink,class:"wrapper"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"cards-row-wrapper wrapper",style:i.normalizeStyle({"--index":t.index})},[i.createElementVNode("div",GT,[i.createElementVNode("div",zT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,s=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"background-card",style:i.normalizeStyle({"--background-image":`url(${s})`})},null,4))),128))])]),i.createElementVNode("div",jT,[i.createElementVNode("div",{class:"column-content deck-highlight-wrapper",onClick:a[0]||(a[0]=i.withModifiers(()=>{},["stop","prevent"]))},[i.createVNode(fn,{class:"card-slice-item","card-code-prop":t.cardCode,"maintain-aspect-ratio":!0,color:`var(--color-${t.region}-rgb, var(--color-primary-2-rgb))`,"router-link":t.routerLink},null,8,["card-code-prop","color","router-link"])]),t.toggledStats.matches?(i.openBlock(),i.createElementBlock("div",YT,i.toDisplayString(i.unref(Te)(t.matches)),1)):i.createCommentVNode("",!0),t.toggledStats.winrate?(i.openBlock(),i.createElementBlock("div",{key:1,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(Zn)(t.wins/t.matches)})`})},i.toDisplayString(i.unref(Te)(t.wins/t.matches*100,2,3)+"%"),5)):i.createCommentVNode("",!0),t.toggledStats.inclusion?(i.openBlock(),i.createElementBlock("div",qT,i.toDisplayString(i.unref(Te)(t.inclusion*100,2,3)+"%"),1)):i.createCommentVNode("",!0),t.toggledStats.avgCopies?(i.openBlock(),i.createElementBlock("div",XT,i.toDisplayString(i.unref(Te)(t.avgCopies,2,3)),1)):i.createCommentVNode("",!0),t.toggledStats.mulliganWinrate?(i.openBlock(),i.createElementBlock("div",{key:4,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(Zn)(t.mulliganWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.mulliganWinrate?i.unref(Te)(t.mulliganWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.keptInMulligan?(i.openBlock(),i.createElementBlock("div",JT,i.toDisplayString(t.keptInMulligan?i.unref(Te)(t.keptInMulligan*100,2,3)+"%":"-"),1)):i.createCommentVNode("",!0),t.toggledStats.drawnWinrate?(i.openBlock(),i.createElementBlock("div",{key:6,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(Zn)(t.drawnWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.drawnWinrate?i.unref(Te)(t.drawnWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.turnPlayed?(i.openBlock(),i.createElementBlock("div",ZT,i.toDisplayString(t.turnPlayed?i.unref(Te)(t.turnPlayed,2,3):"-"),1)):i.createCommentVNode("",!0),t.toggledStats.turnsHeld?(i.openBlock(),i.createElementBlock("div",eD,i.toDisplayString(t.turnsHeld?i.unref(Te)(t.turnsHeld,2,3):"-"),1)):i.createCommentVNode("",!0)])],4)]),_:1},8,["to"])}}});const Ig=M(tD,[["__scopeId","data-v-69ecee4e"]]),nD={cardRows:{type:Array,required:!0,default:[]},cardsRowToggle:{type:Object,requied:!0,default:{card:!0,matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!0,keptInMulligan:!0,drawnWinrate:!0,turnsHeld:!0,turnPlayed:!0}},loading:{type:Boolean,required:!1,default:!1}};var be=(e=>(e.UP="sort-up",e.DOWN="sort-down",e.NEITHER="sort-neither",e.NOT_SORTABLE="not-sortable",e))(be||{});const rD={headingItems:{type:Array,required:!0,default:[]},loading:{type:Boolean,required:!1,default:!1}};const aD={},AD={class:"loader"};function sD(e,t){return i.openBlock(),i.createElementBlock("div",AD)}const iD=M(aD,[["render",sD],["__scopeId","data-v-91218ab0"]]),Ug=e=>(i.pushScopeId("data-v-f0d8b380"),e=e(),i.popScopeId(),e),oD={class:"table-wrapper"},lD={class:"table no-scrollbar"},cD=Ug(()=>i.createElementVNode("div",{class:"heading-background-outer"},[i.createElementVNode("div",{class:"heading-background-absolute"}),i.createElementVNode("div",{class:"heading-background-inner"})],-1)),uD={class:"heading wrapper"},dD=["onClick"],fD={class:"sort-icons"},hD={key:0,class:"no-content loading"},pD={key:1,class:"no-content no-results"},gD=Ug(()=>i.createElementVNode("h2",null," No Results ",-1)),mD=Ug(()=>i.createElementVNode("h4",null," Adjust filters and try again. ",-1)),vD=[gD,mD],BD=i.defineComponent({__name:"LargeTable",props:rD,emits:["toggleSort"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.headingItems.filter(A=>A.isShown)),a=i.computed(()=>!!i.useSlots().default);return(A,s)=>(i.openBlock(),i.createElementBlock("div",oD,[i.createElementVNode("div",lD,[cD,i.createElementVNode("div",uD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,o=>(i.openBlock(),i.createElementBlock("div",{key:o.title,class:i.normalizeClass(["heading-cell column-content",o.sortDirection]),onClick:l=>t("toggleSort",o.id)},[i.createElementVNode("div",null,i.toDisplayString(o.title),1),i.createElementVNode("div",fD,[i.createVNode(i.unref(Ue),{icon:"sort-up",class:"sort-icon"}),i.createVNode(i.unref(Ue),{icon:"sort-down",class:"sort-icon"})])],10,dD))),128))]),i.renderSlot(A.$slots,"default",{},void 0,!0)]),n.loading&&!a.value?(i.openBlock(),i.createElementBlock("div",hD,[i.createVNode(iD)])):!n.loading&&!a.value?(i.openBlock(),i.createElementBlock("div",pD,vD)):i.createCommentVNode("",!0)]))}});const tA=M(BD,[["__scopeId","data-v-f0d8b380"]]);function ei(e,t){const n=t.value.find(a=>a.id===e);if(!n||n.sortDirection===be.NOT_SORTABLE)return null;const r=n.sortDirection;return yD(t),r===be.NEITHER?n.sortDirection=be.DOWN:r===be.DOWN?n.sortDirection=be.UP:n.sortDirection=be.DOWN,n}function yD(e){e.value.forEach(t=>{t.sortDirection!==be.NOT_SORTABLE&&(t.sortDirection=be.NEITHER)})}const wD=i.defineComponent({__name:"CardsTable",props:nD,emits:["sort-updated"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=[{id:"card",isAlwaysShown:!0,isSortable:!1,title:r("general.card")},{id:"matches",isAlwaysShown:!1,isSortable:!0,title:r("general.matches")},{id:"winrate",isAlwaysShown:!1,isSortable:!0,title:r("general.winrate")},{id:"inclusion",isAlwaysShown:!1,isSortable:!0,title:r("general.inclusion")},{id:"avgCopies",isAlwaysShown:!1,isSortable:!0,title:r("general.avgCopies")},{id:"mulliganWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.mulliganWinrate")},{id:"keptInMulligan",isAlwaysShown:!1,isSortable:!0,title:r("general.keptInMulligan")},{id:"drawnWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.drawnWinrate")},{id:"turnsHeld",isAlwaysShown:!1,isSortable:!0,title:r("general.turnsHeld")},{id:"turnPlayed",isAlwaysShown:!1,isSortable:!0,title:r("general.turnPlayed")}];let A=!1;const s=i.ref(a.map(c=>{let u=be.NEITHER;return c.isSortable||(u=be.NOT_SORTABLE),!A&&c.isSortable&&(u=be.DOWN,A=!0),{id:c.id,isShown:n.cardsRowToggle[c.id],sortDirection:u,title:c.title}})),o=i.computed(()=>({"--table-grid-template-columns":`repeat(${Object.values(n.cardsRowToggle).reduce((u,d)=>d?u+1:u,0)}, 1fr)`}));function l(c){const u=ei(c,s);u&&t("sort-updated",u)}return(c,u)=>(i.openBlock(),i.createBlock(tA,{class:"large-table",loading:n.loading,"heading-items":s.value,style:i.normalizeStyle(o.value),onToggleSort:l},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.cardRows,(d,f)=>(i.openBlock(),i.createBlock(Ig,{key:d.cardCode+d.region,"card-code":d.cardCode,matches:d.matches,wins:d.wins,index:f+2,"avg-copies":d.avgCopies,"drawn-winrate":d.drawnWinrate,"kept-in-mulligan":d.keptInMulligan,"mulligan-winrate":d.mulliganWinrate,inclusion:d.inclusion,"turns-held":d.turnsHeld,"turn-played":d.turnPlayed,"toggled-stats":n.cardsRowToggle,region:d.region,"router-link":i.unref(nn)().callbacks.cardCodeRouterLinkCallback(d.cardCode)},null,8,["card-code","matches","wins","index","avg-copies","drawn-winrate","kept-in-mulligan","mulligan-winrate","inclusion","turns-held","turn-played","toggled-stats","region","router-link"]))),128))]),_:1},8,["loading","heading-items","style"]))}});const wb=M(wD,[["__scopeId","data-v-1894b267"]]),bD={regions:{type:Array,required:!0,default:[]}},_D={class:"deck-highlight-regions"},CD=i.defineComponent({__name:"DeckHighlightRegions",props:bD,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",_D,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.regions,a=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"region-item-wrapper"},[i.createVNode(qo,{class:"region-item","region-ref":a},null,8,["region-ref"])]))),128))]))}});const Xo=M(CD,[["__scopeId","data-v-d28f95f4"]]),ED={},kD={xmlns:"http://www.w3.org/2000/svg",viewBox:"215.7 48.9 276.9 496"},SD=i.createStaticVNode('<path fill="#146743" d="m271 136-54 90 150 316 14-50 29-312-51-130-88 86Z"></path><path fill="#419a4a" d="m356 121-75 105 86 316 14-50 29-312-54-59Z"></path><path fill="#baffb6" d="M410 180 359 50l-3 71 54 59Z"></path><path fill="#437f41" d="m359 50-88 86 10 90 75-105 3-71ZM281 360l86 182-86-316v134Z"></path><path fill="#419a4a" d="m454 332 28 33-33 85-4-13-8-85 17-20Z"></path>',5),xD=[SD];function FD(e,t){return i.openBlock(),i.createElementBlock("svg",kD,xD)}const Qg=M(ED,[["render",FD]]),ID={deck:{type:Object,required:!0,default:{}}},UD=e=>(i.pushScopeId("data-v-25f680e9"),e=e(),i.popScopeId(),e),QD={class:"gems-text"},TD={class:"gems-cost-title"},DD={class:"gems-cost-value"},LD=UD(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),OD={class:"gems-cost-title"},MD={class:"gems-cost-value"},ND=i.defineComponent({__name:"GemsCost",props:ID,setup(e){const t=e,{t:n}=se(),r=i.ref(null),a=i.ref(null),A=i.computed(()=>Yc(t.deck,!1)),s=i.computed(()=>Yc(t.deck,!0));return i.onMounted(()=>{At(r.value,{content:a.value,arrow:!0,duration:0})}),(o,l)=>{var c,u,d;return i.openBlock(),i.createElementBlock("div",{ref_key:"gemsCostDiv",ref:r,class:"gems-cost"},[i.createVNode(Qg,{class:"shards-icon"}),i.createElementVNode("div",QD,i.toDisplayString((c=s.value!==null?s.value:A.value)==null?void 0:c.toLocaleString()),1),i.createElementVNode("div",{ref_key:"gemsCostTippyDiv",ref:a,class:"gems-cost-tippy"},[s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",TD,i.toDisplayString(i.unref(n)("deck.personalCost")),1),i.createElementVNode("div",DD,i.toDisplayString((u=s.value)==null?void 0:u.toLocaleString()),1),LD],64)):i.createCommentVNode("",!0),i.createElementVNode("div",OD,i.toDisplayString(i.unref(n)("deck.originalCost")),1),i.createElementVNode("div",MD,i.toDisplayString((d=A.value)==null?void 0:d.toLocaleString()),1)],512)],512)}}});const Tg=M(ND,[["__scopeId","data-v-25f680e9"]]),PD={class:"language-selection"},HD=["value"],RD=i.defineComponent({__name:"LanguageSelection",setup(e){const t=i.ref(!1);function n(){t.value=!0}return(r,a)=>(i.openBlock(),i.createElementBlock("div",PD,[i.createVNode(i.unref(Ue),{ref:"languageIcon",icon:"language",class:"icon",onClick:n},null,512),i.createVNode(VA,{"show-modal":t.value,"onUpdate:showModal":a[1]||(a[1]=A=>t.value=A)},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=A=>r.$i18n.locale=A)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.$i18n.availableLocales,A=>(i.openBlock(),i.createElementBlock("option",{key:`locale-${A}`,value:A},i.toDisplayString(A),9,HD))),128))],512),[[i.vModelSelect,r.$i18n.locale]])]),_:1},8,["show-modal"])]))}});const Dg=M(RD,[["__scopeId","data-v-741580c8"]]),VD={cardCodes:{type:Array,required:!0,default:[]},regions:{type:Array,required:!0,default:[]}},bb={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},ignoreCardItem:{type:Boolean,required:!1},regions:{type:Array,required:!1,default:void 0},colorOverride:{type:String,required:!1,default:void 0}},KD={class:"circle-card-item"},$D=["alt","src"],WD=i.defineComponent({__name:"CircleCardItem",props:bb,setup(e){const t=e,n=Ro(t.cardProp,t.cardCodeProp,!0),r=i.ref(null),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.computed(()=>{var c;return"https://lor.gg/storage/cards/icon/"+((c=n.value)==null?void 0:c.cardCode)+"-icon.webp"}),l=i.computed(()=>n.value===void 0?"--color-primary-2":pA(n.value,t.regions));return i.onMounted(()=>{t.ignoreCardItem||At(r.value,{content:a.value,placement:"right",arrow:!0,touch:"hold",duration:0,role:"card-image",onShown:c=>{const u=c.popper.innerHTML.includes("right")?"right-start":"left-start";s.value=u},onHidden:()=>{s.value=null}})}),(c,u)=>{const d=i.resolveComponent("RouterLink");return i.openBlock(),i.createElementBlock("div",KD,[i.createVNode(d,{to:t.routerLink,class:"circle-card-link",onClick:u[0]||(u[0]=i.withModifiers(()=>{},["stop","prevent"]))},{default:i.withCtx(()=>{var f;return[i.createElementVNode("img",{ref_key:"circleCardImg",ref:r,alt:(f=i.unref(n))==null?void 0:f.name,src:o.value,class:"circle-card-img",style:i.normalizeStyle({borderColor:t.colorOverride??l.value})},null,12,$D)]}),_:1},8,["to"]),i.createElementVNode("div",{ref_key:"circleCardTippy",ref:a,class:"circle-card-tippy"},[!c.ignoreCardItem&&i.unref(n)?(i.openBlock(),i.createBlock(Wa,{key:0,ref_key:"cardItem",ref:A,"card-code-prop":i.unref(n).cardCode,"is-deck-builder":!1,"is-root":!0,"show-tippy-location":s.value},null,8,["card-code-prop","show-tippy-location"])):i.createCommentVNode("",!0)],512)])}}});const nA=M(WD,[["__scopeId","data-v-b1598a69"]]),GD={cards:{type:Array,required:!1,default:void 0},cardCodes:{type:Array,required:!1,default:void 0},regions:{type:Array,required:!1,default:[]}},zD={class:"deck-highlight-cards"},jD=i.defineComponent({__name:"DeckHighlightCards",props:GD,setup(e){const t=e,n=i.computed(()=>{if(t.cards)return t.cards;if(t.cardCodes)return t.cardCodes.map(r=>jt().cardJsonObject[r]).filter(r=>r!==void 0);throw new Error("Cards or CardCodes must be defined.")});return(r,a)=>(i.openBlock(),i.createElementBlock("div",zD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(A,s)=>(i.openBlock(),i.createElementBlock("div",{key:A.cardCode??s,class:"circle-card-item-wrapper"},[i.createVNode(nA,{class:"circle-card-item","card-prop":A,regions:t.regions,"router-link":i.unref(nn)().callbacks.cardCodeRouterLinkCallback(A.cardCode)},null,8,["card-prop","regions","router-link"])]))),128))]))}});const Jo=M(jD,[["__scopeId","data-v-021c3530"]]),YD=i.defineComponent({__name:"ArchetypeSidePanelHighlight",props:VD,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createBlock(mt,{class:"archetype-side-panel-highlight"},{default:i.withCtx(()=>[i.createVNode(Xo,{class:"deck-highlight-regions",regions:t.regions},null,8,["regions"]),i.createVNode(Jo,{class:i.normalizeClass(["deck-highlight-cards",t.cardCodes.length===1?"single":""]),"card-codes":t.cardCodes},null,8,["class","card-codes"])]),_:1}))}});const Zu=M(YD,[["__scopeId","data-v-ff538f6f"]]),qD={deckcode:{type:String,required:!0,default:""},filters:{type:Object,required:!0,default:{sampleSizeFilters:[],serverFilters:[],timeFilters:[]}}},XD={deckCode:{type:String,required:!0,default:""},info:{type:String,required:!0,default:"typeRef"}};/*!
810
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var eU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pb={exports:{}};(function(e){(function(t){var n=function(g,v,_){if(!c(v)||d(v)||f(v)||h(v)||l(v))return v;var B,b=0,w=0;if(u(v))for(B=[],w=v.length;b<w;b++)B.push(n(g,v[b],_));else{B={};for(var C in v)Object.prototype.hasOwnProperty.call(v,C)&&(B[g(C,_)]=n(g,v[C],_))}return B},r=function(g,v){v=v||{};var _=v.separator||"_",B=v.split||/(?=[A-Z])/;return g.split(B).join(_)},a=function(g){return p(g)?g:(g=g.replace(/[\-_\s]+(.)?/g,function(v,_){return _?_.toUpperCase():""}),g.substr(0,1).toLowerCase()+g.substr(1))},A=function(g){var v=a(g);return v.substr(0,1).toUpperCase()+v.substr(1)},s=function(g,v){return r(g,v).toLowerCase()},o=Object.prototype.toString,l=function(g){return typeof g=="function"},c=function(g){return g===Object(g)},u=function(g){return o.call(g)=="[object Array]"},d=function(g){return o.call(g)=="[object Date]"},f=function(g){return o.call(g)=="[object RegExp]"},h=function(g){return o.call(g)=="[object Boolean]"},p=function(g){return g=g-0,g===g},m=function(g,v){var _=v&&"process"in v?v.process:v;return typeof _!="function"?g:function(B,b){return _(B,g,b)}},y={camelize:a,decamelize:s,pascalize:A,depascalize:s,camelizeKeys:function(g,v){return n(m(a,v),g)},decamelizeKeys:function(g,v){return n(m(s,v),g,v)},pascalizeKeys:function(g,v){return n(m(A,v),g)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=y:t.humps=y})(eU)})(pb);var tU=pb.exports,nU=["class","style"];function rU(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),a=tU.camelize(n.slice(0,r)),A=n.slice(r+1).trim();return t[a]=A,t},{})}function aU(e){return e.split(/\s+/).reduce(function(t,n){return t[n]=!0,t},{})}function mg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(l){return mg(l)}),a=Object.keys(e.attributes||{}).reduce(function(l,c){var u=e.attributes[c];switch(c){case"class":l.class=aU(u);break;case"style":l.style=rU(u);break;default:l.attrs[c]=u}return l},{attrs:{},class:{},style:{}});n.class;var A=n.style,s=A===void 0?{}:A,o=YI(n,nU);return i.h(e.tag,qn(qn(qn({},t),{},{class:a.class,style:qn(qn({},a.style),s)},a.attrs),o),r)}var gb=!1;try{gb=process.env.NODE_ENV==="production"}catch{}function AU(){if(!gb&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function zi(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?on({},e,t):{}}function sU(e){var t,n=(t={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-inverse":e.inverse,"fa-flip":e.flip===!0,"fa-flip-horizontal":e.flip==="horizontal"||e.flip==="both","fa-flip-vertical":e.flip==="vertical"||e.flip==="both"},on(t,"fa-".concat(e.size),e.size!==null),on(t,"fa-rotate-".concat(e.rotation),e.rotation!==null),on(t,"fa-pull-".concat(e.pull),e.pull!==null),on(t,"fa-swap-opacity",e.swapOpacity),on(t,"fa-bounce",e.bounce),on(t,"fa-shake",e.shake),on(t,"fa-beat",e.beat),on(t,"fa-fade",e.fade),on(t,"fa-beat-fade",e.beatFade),on(t,"fa-flash",e.flash),on(t,"fa-spin-pulse",e.spinPulse),on(t,"fa-spin-reverse",e.spinReverse),t);return Object.keys(n).map(function(r){return n[r]?r:null}).filter(function(r){return r})}function sv(e){if(e&&au(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(eu.icon)return eu.icon(e);if(e===null)return null;if(au(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}var Ue=i.defineComponent({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(t){return[!0,!1,"horizontal","vertical","both"].indexOf(t)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(t){return["right","left"].indexOf(t)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(t){return[90,180,270].indexOf(Number.parseInt(t,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(t){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(t)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(t,n){var r=n.attrs,a=i.computed(function(){return sv(t.icon)}),A=i.computed(function(){return zi("classes",sU(t))}),s=i.computed(function(){return zi("transform",typeof t.transform=="string"?eu.transform(t.transform):t.transform)}),o=i.computed(function(){return zi("mask",sv(t.mask))}),l=i.computed(function(){return h8(a.value,qn(qn(qn(qn({},A.value),s.value),o.value),{},{symbol:t.symbol,title:t.title}))});i.watch(l,function(u){if(!u)return AU("Could not find one or more icon(s)",a.value,o.value)},{immediate:!0});var c=i.computed(function(){return l.value?mg(l.value.abstract[0],{},r):null});return function(){return c.value}}});i.defineComponent({name:"FontAwesomeLayers",props:{fixedWidth:{type:Boolean,default:!1}},setup:function(t,n){var r=n.slots,a=Uw.familyPrefix,A=i.computed(function(){return["".concat(a,"-layers")].concat(Uh(t.fixedWidth?["".concat(a,"-fw")]:[]))});return function(){return i.h("div",{class:A.value},r.default?r.default():[])}}});i.defineComponent({name:"FontAwesomeLayersText",props:{value:{type:[String,Number],default:""},transform:{type:[String,Object],default:null},counter:{type:Boolean,default:!1},position:{type:String,default:null,validator:function(t){return["bottom-left","bottom-right","top-left","top-right"].indexOf(t)>-1}}},setup:function(t,n){var r=n.attrs,a=Uw.familyPrefix,A=i.computed(function(){return zi("classes",[].concat(Uh(t.counter?["".concat(a,"-layers-counter")]:[]),Uh(t.position?["".concat(a,"-layers-").concat(t.position)]:[])))}),s=i.computed(function(){return zi("transform",typeof t.transform=="string"?eu.transform(t.transform):t.transform)}),o=i.computed(function(){var c=p8(t.value.toString(),qn(qn({},s.value),A.value)),u=c.abstract;return t.counter&&(u[0].attributes.class=u[0].attributes.class.replace("fa-layers-text","")),u[0]}),l=i.computed(function(){return mg(o.value,{},r)});return function(){return l.value}}});const iU={class:"card-slice"},oU={key:0,class:"mana-hexagon"},lU={class:"mana-number"},cU={class:"card-name"},uU={key:1,class:"quantity"},dU={class:"quantity-background"},fU={class:"num-quantity"},hU={class:"plus-minus-content"},pU={class:"plus-minus-quantity"},gU=i.defineComponent({__name:"CardSliceItem",props:WI,emits:["update:card-quantity"],setup(e,{emit:t}){const n=e,r=Ro(n.cardProp,n.cardCodeProp,!1),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.ref(null),l=i.computed(()=>{let d=n.color;return!d&&r.value&&(d=pA(r.value,null,!0)),d||(d="var(--color-background-2-rgb)"),{"--color":d}}),c=i.computed(()=>r.value?"https://lor.gg/storage/cards/slice/"+r.value.cardCode+"-slice.webp":""),u=i.computed(()=>{const d=["card-slice-wrapper"];return n.maintainAspectRatio&&d.push("maintain-aspect-ratio"),d});return i.onMounted(()=>{n.ignoreCardItem||At(a.value,{content:s.value,placement:"right",arrow:!0,touch:!1,duration:0,role:"card-image",onShown:d=>{const f=d.popper.innerHTML.includes("right")?"right-start":"left-start";o.value=f},onHidden:()=>{o.value=null}})}),(d,f)=>{const h=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(h,{to:n.routerLink},{default:i.withCtx(()=>{var p,m;return[i.createElementVNode("div",{ref_key:"cardSlice",ref:a,class:i.normalizeClass(u.value)},[i.createElementVNode("div",iU,[i.createElementVNode("div",{class:"card-image",style:i.normalizeStyle({backgroundImage:`url(${c.value})`})},null,4),i.createElementVNode("div",{class:"region-gradient",style:i.normalizeStyle(l.value)},null,4),i.unref(r)||n.manaNumber!==void 0&&n.manaNumber!==null?(i.openBlock(),i.createElementBlock("div",oU,[i.createVNode(jo,{class:"hexagon-icon"}),i.createElementVNode("div",lU,i.toDisplayString(n.manaNumber??((p=i.unref(r))==null?void 0:p.cost)),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",cU,i.toDisplayString(n.name??((m=i.unref(r))==null?void 0:m.name)),1),n.quantityNumber!==void 0&&n.quantityNumber!==null?(i.openBlock(),i.createElementBlock("div",uU,[i.createElementVNode("div",dU,[i.createElementVNode("p",fU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0),n.showPlusMinus?(i.openBlock(),i.createElementBlock("div",{key:2,class:"plus-minus",onClick:f[2]||(f[2]=i.withModifiers(()=>{},["prevent"]))},[i.createElementVNode("div",hU,[i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[0]||(f[0]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:-1})},["prevent"]))},[i.createVNode(i.unref(Ue),{icon:"minus",class:"icon"})]),i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[1]||(f[1]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:1})},["prevent"]))},[i.createVNode(i.unref(Ue),{icon:"plus",class:"icon"})]),i.createElementVNode("div",pU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0)])],2),i.createElementVNode("div",{ref_key:"cardItemWrapper",ref:s,class:"card-item-container"},[i.unref(r)&&!d.ignoreCardItem?(i.openBlock(),i.createBlock(Wa,{key:0,ref_key:"cardItem",ref:A,"is-root":!0,"card-prop":i.unref(r),"quantity-needed":n.quantityNumber,"show-tippy-location":o.value,class:"card-image-hover"},null,8,["card-prop","quantity-needed","show-tippy-location"])):i.createCommentVNode("",!0)],512)]}),_:1},8,["to"])}}});const fn=M(gU,[["__scopeId","data-v-a1e91ff3"]]);function cr(e){return[null,void 0].indexOf(e)!==-1}function mU(e,t,n){const{object:r,valueProp:a,mode:A}=i.toRefs(e),s=i.getCurrentInstance().proxy,o=n.iv,l=(d,f=!0)=>{o.value=u(d);const h=c(d);t.emit("change",h,s),f&&(t.emit("input",h),t.emit("update:modelValue",h))},c=d=>r.value||cr(d)?d:Array.isArray(d)?d.map(f=>f[a.value]):d[a.value],u=d=>cr(d)?A.value==="single"?{}:[]:d;return{update:l}}function vU(e,t){const{value:n,modelValue:r,mode:a,valueProp:A}=i.toRefs(e),s=i.ref(a.value!=="single"?[]:{}),o=r&&r.value!==void 0?r:n,l=i.computed(()=>a.value==="single"?s.value[A.value]:s.value.map(u=>u[A.value])),c=i.computed(()=>a.value!=="single"?s.value.map(u=>u[A.value]).join(","):s.value[A.value]);return{iv:s,internalValue:s,ev:o,externalValue:o,textValue:c,plainValue:l}}function BU(e,t,n){const{regex:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=n.isOpen,s=n.open,o=i.ref(null),l=i.ref(null),c=()=>{o.value=""},u=h=>{o.value=h.target.value},d=h=>{if(r&&r.value){let p=r.value;typeof p=="string"&&(p=new RegExp(p)),h.key.match(p)||h.preventDefault()}},f=h=>{if(r&&r.value){let m=(h.clipboardData||window.clipboardData).getData("Text"),y=r.value;typeof y=="string"&&(y=new RegExp(y)),m.split("").every(g=>!!g.match(y))||h.preventDefault()}t.emit("paste",h,a)};return i.watch(o,h=>{!A.value&&h&&s(),t.emit("search-change",h,a)}),{search:o,input:l,clearSearch:c,handleSearchInput:u,handleKeypress:d,handlePaste:f}}function yU(e,t,n){const{groupSelect:r,mode:a,groups:A,disabledProp:s}=i.toRefs(e),o=i.ref(null),l=u=>{u===void 0||u!==null&&u[s.value]||A.value&&u&&u.group&&(a.value==="single"||!r.value)||(o.value=u)};return{pointer:o,setPointer:l,clearPointer:()=>{l(null)}}}function uf(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(new RegExp(/æ/g),"ae").replace(new RegExp(/œ/g),"oe").replace(new RegExp(/ø/g),"o").replace(/\p{Diacritic}/gu,"")}function wU(e){return Object.prototype.toString.call(e)==="[object Object]"}function bU(e,t){const n=t.slice().sort();return e.length===t.length&&e.slice().sort().every(function(r,a){return r===n[a]})}function _U(e,t,n){const{options:r,mode:a,trackBy:A,limit:s,hideSelected:o,createTag:l,createOption:c,label:u,appendNewTag:d,appendNewOption:f,multipleLabel:h,object:p,loading:m,delay:y,resolveOnLoad:g,minChars:v,filterResults:_,clearOnSearch:B,clearOnSelect:b,valueProp:w,allowAbsent:C,groupLabel:k,canDeselect:S,max:T,strict:U,closeOnSelect:F,closeOnDeselect:Q,groups:Y,reverse:X,infinite:j,groupOptions:K,groupHideEmpty:oe,groupSelect:$,onCreate:ae,disabledProp:ce,searchStart:me,searchFilter:Ee}=i.toRefs(e),fe=i.getCurrentInstance().proxy,ne=n.iv,N=n.ev,te=n.search,Pe=n.clearSearch,ot=n.update,xt=n.pointer,vt=n.clearPointer,Qn=n.focus,x=n.deactivate,E=n.close,D=n.localize,W=i.ref([]),ie=i.ref([]),he=i.ref(!1),Ft=i.ref(null),ht=i.ref(j.value&&s.value===-1?10:s.value),Bn=i.computed(()=>l.value||c.value||!1),$e=i.computed(()=>d.value!==void 0?d.value:f.value!==void 0?f.value:!0),O=i.computed(()=>{if(Y.value){let I=et.value||[],G=[];return I.forEach(xe=>{Wd(xe[K.value]).forEach(Bt=>{G.push(Object.assign({},Bt,xe[ce.value]?{[ce.value]:!0}:{}))})}),G}else{let I=Wd(ie.value||[]);return W.value.length&&(I=I.concat(W.value)),I}}),P=i.computed(()=>{let I=O.value;return X.value&&(I=I.reverse()),la.value.length&&(I=la.value.concat(I)),$d(I)}),Ze=i.computed(()=>{let I=P.value;return ht.value>0&&(I=I.slice(0,ht.value)),I}),et=i.computed(()=>{if(!Y.value)return[];let I=[],G=ie.value||[];return W.value.length&&I.push({[k.value]:" ",[K.value]:[...W.value],__CREATE__:!0}),I.concat(G)}),Ar=i.computed(()=>{let I=[...et.value].map(G=>({...G}));return la.value.length&&(I[0]&&I[0].__CREATE__?I[0][K.value]=[...la.value,...I[0][K.value]]:I=[{[k.value]:" ",[K.value]:[...la.value],__CREATE__:!0}].concat(I)),I}),Tn=i.computed(()=>{if(!Y.value)return[];let I=Ar.value;return aE((I||[]).map((G,xe)=>{const Bt=Wd(G[K.value]);return{...G,index:xe,group:!0,[K.value]:$d(Bt,!1).map(ci=>Object.assign({},ci,G[ce.value]?{[ce.value]:!0}:{})),__VISIBLE__:$d(Bt).map(ci=>Object.assign({},ci,G[ce.value]?{[ce.value]:!0}:{}))}}))}),Dn=i.computed(()=>{switch(a.value){case"single":return!cr(ne.value[w.value]);case"multiple":case"tags":return!cr(ne.value)&&ne.value.length>0}}),zn=i.computed(()=>h!==void 0&&h.value!==void 0?h.value(ne.value,fe):ne.value&&ne.value.length>1?`${ne.value.length} options selected`:"1 option selected"),ii=i.computed(()=>!O.value.length&&!he.value&&!la.value.length),JA=i.computed(()=>O.value.length>0&&Ze.value.length==0&&(te.value&&Y.value||!Y.value)),la=i.computed(()=>Bn.value===!1||!te.value?[]:tE(te.value)!==-1?[]:[{[w.value]:te.value,[L.value]:te.value,[u.value]:te.value,__CREATE__:!0}]),L=i.computed(()=>A.value||u.value),re=i.computed(()=>{switch(a.value){case"single":return null;case"multiple":case"tags":return[]}}),ue=i.computed(()=>m.value||he.value),Se=I=>{switch(typeof I!="object"&&(I=Ir(I)),a.value){case"single":ot(I);break;case"multiple":case"tags":ot(ne.value.concat(I));break}t.emit("select",Dt(I),I,fe)},ye=I=>{switch(typeof I!="object"&&(I=Ir(I)),a.value){case"single":oi();break;case"tags":case"multiple":ot(Array.isArray(I)?ne.value.filter(G=>I.map(xe=>xe[w.value]).indexOf(G[w.value])===-1):ne.value.filter(G=>G[w.value]!=I[w.value]));break}t.emit("deselect",Dt(I),I,fe)},Dt=I=>p.value?I:I[w.value],Xt=I=>{ye(I)},ca=(I,G)=>{if(G.button!==0){G.preventDefault();return}Xt(I)},oi=()=>{t.emit("clear",fe),ot(re.value)},Pt=I=>{if(I.group!==void 0)return a.value==="single"?!1:eE(I[K.value])&&I[K.value].length;switch(a.value){case"single":return!cr(ne.value)&&ne.value[w.value]==I[w.value];case"tags":case"multiple":return!cr(ne.value)&&ne.value.map(G=>G[w.value]).indexOf(I[w.value])!==-1}},AA=I=>I[ce.value]===!0,ua=()=>T===void 0||T.value===-1||!Dn.value&&T.value>0?!1:ne.value.length>=T.value,da=I=>{if(!AA(I)){if(ae&&ae.value&&!Pt(I)&&I.__CREATE__&&(I={...I},delete I.__CREATE__,I=ae.value(I,fe),I instanceof Promise)){he.value=!0,I.then(G=>{he.value=!1,yl(G)});return}yl(I)}},yl=I=>{switch(I.__CREATE__&&(I={...I},delete I.__CREATE__),a.value){case"single":if(I&&Pt(I)){S.value&&ye(I),Q.value&&(vt(),E());return}I&&fa(I),b.value&&Pe(),F.value&&(vt(),E()),I&&Se(I);break;case"multiple":if(I&&Pt(I)){ye(I),Q.value&&(vt(),E());return}if(ua()){t.emit("max",fe);return}I&&(fa(I),Se(I)),b.value&&Pe(),o.value&&vt(),F.value&&E();break;case"tags":if(I&&Pt(I)){ye(I),Q.value&&(vt(),E());return}if(ua()){t.emit("max",fe);return}I&&fa(I),b.value&&Pe(),I&&Se(I),o.value&&vt(),F.value&&E();break}F.value||Qn()},li=I=>{if(!(AA(I)||a.value==="single"||!$.value)){switch(a.value){case"multiple":case"tags":Z3(I[K.value])?ye(I[K.value]):Se(I[K.value].filter(G=>ne.value.map(xe=>xe[w.value]).indexOf(G[w.value])===-1).filter(G=>!G[ce.value]).filter((G,xe)=>ne.value.length+1+xe<=T.value||T.value===-1));break}F.value&&x()}},fa=I=>{Ir(I[w.value])===void 0&&Bn.value&&(t.emit("tag",I[w.value],fe),t.emit("option",I[w.value],fe),t.emit("create",I[w.value],fe),$e.value&&rE(I),Pe())},J3=()=>{a.value!=="single"&&Se(Ze.value.filter(I=>!I.disabled&&!Pt(I)))},Z3=I=>I.find(G=>!Pt(G)&&!G[ce.value])===void 0,eE=I=>I.find(G=>!Pt(G))===void 0,Ir=I=>O.value[O.value.map(G=>String(G[w.value])).indexOf(String(I))],tE=(I,G=!0)=>O.value.map(xe=>parseInt(xe[L.value])==xe[L.value]?parseInt(xe[L.value]):xe[L.value]).indexOf(parseInt(I)==I?parseInt(I):I),nE=I=>["tags","multiple"].indexOf(a.value)!==-1&&o.value&&Pt(I),rE=I=>{W.value.push(I)},aE=I=>oe.value?I.filter(G=>te.value?G.__VISIBLE__.length:G[K.value].length):I.filter(G=>te.value?G.__VISIBLE__.length:!0),$d=(I,G=!0)=>{let xe=I;if(te.value&&_.value){let Bt=Ee.value;Bt||(Bt=(ci,Toe)=>{let k1=uf(D(ci[L.value]),U.value);return me.value?k1.startsWith(uf(te.value,U.value)):k1.indexOf(uf(te.value,U.value))!==-1}),xe=xe.filter(Bt)}return o.value&&G&&(xe=xe.filter(Bt=>!nE(Bt))),xe},Wd=I=>{let G=I;return wU(G)&&(G=Object.keys(G).map(xe=>{let Bt=G[xe];return{[w.value]:xe,[L.value]:Bt,[u.value]:Bt}})),G=G.map(xe=>typeof xe=="object"?xe:{[w.value]:xe,[L.value]:xe,[u.value]:xe}),G},wl=()=>{cr(N.value)||(ne.value=_l(N.value))},bl=I=>(he.value=!0,new Promise((G,xe)=>{r.value(te.value,fe).then(Bt=>{ie.value=Bt||[],typeof I=="function"&&I(Bt),he.value=!1}).catch(Bt=>{console.error(Bt),ie.value=[],he.value=!1}).finally(()=>{G()})})),Gd=()=>{if(Dn.value)if(a.value==="single"){let I=Ir(ne.value[w.value]);if(I!==void 0){let G=I[u.value];ne.value[u.value]=G,p.value&&(N.value[u.value]=G)}}else ne.value.forEach((I,G)=>{let xe=Ir(ne.value[G][w.value]);if(xe!==void 0){let Bt=xe[u.value];ne.value[G][u.value]=Bt,p.value&&(N.value[G][u.value]=Bt)}})},AE=I=>{bl(I)},_l=I=>cr(I)?a.value==="single"?{}:[]:p.value?I:a.value==="single"?Ir(I)||(C.value?{[u.value]:I,[w.value]:I,[L.value]:I}:{}):I.filter(G=>!!Ir(G)||C.value).map(G=>Ir(G)||{[u.value]:G,[w.value]:G,[L.value]:G}),E1=()=>{Ft.value=i.watch(te,I=>{I.length<v.value||!I&&v.value!==0||(he.value=!0,B.value&&(ie.value=[]),setTimeout(()=>{I==te.value&&r.value(te.value,fe).then(G=>{(I==te.value||!te.value)&&(ie.value=G,xt.value=Ze.value.filter(xe=>xe[ce.value]!==!0)[0]||null,he.value=!1)}).catch(G=>{console.error(G)})},y.value))},{flush:"sync"})};if(a.value!=="single"&&!cr(N.value)&&!Array.isArray(N.value))throw new Error(`v-model must be an array when using "${a.value}" mode`);return r&&typeof r.value=="function"?g.value?bl(wl):p.value==!0&&wl():(ie.value=r.value,wl()),y.value>-1&&E1(),i.watch(y,(I,G)=>{Ft.value&&Ft.value(),I>=0&&E1()}),i.watch(N,I=>{if(cr(I)){ot(_l(I),!1);return}switch(a.value){case"single":(p.value?I[w.value]!=ne.value[w.value]:I!=ne.value[w.value])&&ot(_l(I),!1);break;case"multiple":case"tags":bU(p.value?I.map(G=>G[w.value]):I,ne.value.map(G=>G[w.value]))||ot(_l(I),!1);break}},{deep:!0}),i.watch(r,(I,G)=>{typeof e.options=="function"?g.value&&(!G||I&&I.toString()!==G.toString())&&bl():(ie.value=e.options,Object.keys(ne.value).length||wl(),Gd())}),i.watch(u,Gd),{pfo:P,fo:Ze,filteredOptions:Ze,hasSelected:Dn,multipleLabelText:zn,eo:O,extendedOptions:O,eg:et,extendedGroups:et,fg:Tn,filteredGroups:Tn,noOptions:ii,noResults:JA,resolving:he,busy:ue,offset:ht,select:Se,deselect:ye,remove:Xt,selectAll:J3,clear:oi,isSelected:Pt,isDisabled:AA,isMax:ua,getOption:Ir,handleOptionClick:da,handleGroupClick:li,handleTagRemove:ca,refreshOptions:AE,resolveOptions:bl,refreshLabels:Gd}}function CU(e,t,n){const{valueProp:r,showOptions:a,searchable:A,groupLabel:s,groups:o,mode:l,groupSelect:c,disabledProp:u,groupOptions:d}=i.toRefs(e),f=n.fo,h=n.fg,p=n.handleOptionClick,m=n.handleGroupClick,y=n.search,g=n.pointer,v=n.setPointer,_=n.clearPointer,B=n.multiselect,b=n.isOpen,w=i.computed(()=>f.value.filter(N=>!N[u.value])),C=i.computed(()=>h.value.filter(N=>!N[u.value])),k=i.computed(()=>l.value!=="single"&&c.value),S=i.computed(()=>g.value&&g.value.group),T=i.computed(()=>fe(g.value)),U=i.computed(()=>{const N=S.value?g.value:fe(g.value),te=C.value.map(ot=>ot[s.value]).indexOf(N[s.value]);let Pe=C.value[te-1];return Pe===void 0&&(Pe=Q.value),Pe}),F=i.computed(()=>{let N=C.value.map(te=>te.label).indexOf(S.value?g.value[s.value]:fe(g.value)[s.value])+1;return C.value.length<=N&&(N=0),C.value[N]}),Q=i.computed(()=>[...C.value].slice(-1)[0]),Y=i.computed(()=>g.value.__VISIBLE__.filter(N=>!N[u.value])[0]),X=i.computed(()=>{const N=T.value.__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])-1]}),j=i.computed(()=>{const N=fe(g.value).__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])+1]}),K=i.computed(()=>[...U.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),oe=i.computed(()=>[...Q.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),$=N=>g.value&&(!N.group&&g.value[r.value]===N[r.value]||N.group!==void 0&&g.value[s.value]===N[s.value])?!0:void 0,ae=()=>{v(w.value[0]||null)},ce=()=>{!g.value||g.value[u.value]===!0||(S.value?m(g.value):p(g.value))},me=()=>{if(g.value===null)v((o.value&&k.value?C.value[0].__CREATE__?w.value[0]:C.value[0]:w.value[0])||null);else if(o.value&&k.value){let N=S.value?Y.value:j.value;N===void 0&&(N=F.value,N.__CREATE__&&(N=N[d.value][0])),v(N||null)}else{let N=w.value.map(te=>te[r.value]).indexOf(g.value[r.value])+1;w.value.length<=N&&(N=0),v(w.value[N]||null)}i.nextTick(()=>{ne()})},Ee=()=>{if(g.value===null){let N=w.value[w.value.length-1];o.value&&k.value&&(N=oe.value,N===void 0&&(N=Q.value)),v(N||null)}else if(o.value&&k.value){let N=S.value?K.value:X.value;N===void 0&&(N=S.value?U.value:T.value,N.__CREATE__&&(N=K.value,N===void 0&&(N=U.value))),v(N||null)}else{let N=w.value.map(te=>te[r.value]).indexOf(g.value[r.value])-1;N<0&&(N=w.value.length-1),v(w.value[N]||null)}i.nextTick(()=>{ne()})},fe=N=>C.value.find(te=>te.__VISIBLE__.map(Pe=>Pe[r.value]).indexOf(N[r.value])!==-1),ne=()=>{let N=B.value.querySelector("[data-pointed]");if(!N)return;let te=N.parentElement.parentElement;o.value&&(te=S.value?N.parentElement.parentElement.parentElement:N.parentElement.parentElement.parentElement.parentElement),N.offsetTop+N.offsetHeight>te.clientHeight+te.scrollTop&&(te.scrollTop=N.offsetTop+N.offsetHeight-te.clientHeight),N.offsetTop<te.scrollTop&&(te.scrollTop=N.offsetTop)};return i.watch(y,N=>{A.value&&(N.length&&a.value?ae():_())}),i.watch(b,N=>{if(N){let te=B.value.querySelectorAll("[data-selected]")[0];if(!te)return;let Pe=te.parentElement.parentElement;i.nextTick(()=>{Pe.scrollTop>0||(Pe.scrollTop=te.offsetTop)})}}),{pointer:g,canPointGroups:k,isPointed:$,setPointerFirst:ae,selectPointer:ce,forwardPointer:me,backwardPointer:Ee}}function EU(e,t,n){const{disabled:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=i.ref(!1);return{isOpen:A,open:()=>{A.value||r.value||(A.value=!0,t.emit("open",a))},close:()=>{A.value&&(A.value=!1,t.emit("close",a))}}}function kU(e,t,n){const{searchable:r,disabled:a,clearOnBlur:A}=i.toRefs(e),s=n.input,o=n.open,l=n.close,c=n.clearSearch,u=n.isOpen,d=i.ref(null),f=i.ref(null),h=i.ref(null),p=i.ref(!1),m=i.ref(!1),y=i.computed(()=>r.value||a.value?-1:0),g=()=>{r.value&&s.value.blur(),f.value.blur()},v=()=>{r.value&&!a.value&&s.value.focus()},_=(S=!0)=>{a.value||(p.value=!0,S&&o())},B=()=>{p.value=!1,setTimeout(()=>{p.value||(l(),A.value&&c())},1)};return{multiselect:d,wrapper:f,tags:h,tabindex:y,isActive:p,mouseClicked:m,blur:g,focus:v,activate:_,deactivate:B,handleFocusIn:S=>{S.target.closest("[data-tags]")&&S.target.nodeName!=="INPUT"||S.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{B()},handleCaretClick:()=>{B(),g()},handleMousedown:S=>{m.value=!0,u.value&&(S.target.isEqualNode(f.value)||S.target.isEqualNode(h.value))?setTimeout(()=>{B()},0):document.activeElement.isEqualNode(f.value)&&!u.value&&_(),setTimeout(()=>{m.value=!1},0)}}}function SU(e,t,n){const{mode:r,addTagOn:a,openDirection:A,searchable:s,showOptions:o,valueProp:l,groups:c,addOptionOn:u,createTag:d,createOption:f,reverse:h}=i.toRefs(e),p=i.getCurrentInstance().proxy,m=n.iv,y=n.update,g=n.search,v=n.setPointer,_=n.selectPointer,B=n.backwardPointer,b=n.forwardPointer,w=n.multiselect,C=n.wrapper,k=n.tags,S=n.isOpen,T=n.open,U=n.blur,F=n.fo,Q=i.computed(()=>d.value||f.value||!1),Y=i.computed(()=>a.value!==void 0?a.value:u.value!==void 0?u.value:["enter"]),X=()=>{r.value==="tags"&&!o.value&&Q.value&&s.value&&!c.value&&v(F.value[F.value.map($=>$[l.value]).indexOf(g.value)])},j=$=>{let ae=$.length-1;for(;ae>=0&&($[ae].remove===!1||$[ae].disabled);)ae--;return ae<0||$.splice(ae,1),$};return{handleKeydown:$=>{t.emit("keydown",$,p);let ae,ce;switch(["ArrowLeft","ArrowRight","Enter"].indexOf($.key)!==-1&&r.value==="tags"&&(ae=[...w.value.querySelectorAll("[data-tags] > *")].filter(me=>me!==k.value),ce=ae.findIndex(me=>me===document.activeElement)),$.key){case"Backspace":if(r.value==="single"||s.value&&[null,""].indexOf(g.value)===-1||m.value.length===0)return;y(j([...m.value]));break;case"Enter":if($.preventDefault(),$.keyCode===229)return;if(ce!==-1&&ce!==void 0){y([...m.value].filter((me,Ee)=>Ee!==ce)),ce===ae.length-1&&(ae.length-1?ae[ae.length-2].focus():s.value?k.value.querySelector("input").focus():C.value.focus());return}if(Y.value.indexOf("enter")===-1&&Q.value)return;X(),_();break;case" ":if(!Q.value&&!s.value){$.preventDefault(),X(),_();return}if(!Q.value)return!1;if(Y.value.indexOf("space")===-1&&Q.value)return;$.preventDefault(),X(),_();break;case"Tab":case";":case",":if(Y.value.indexOf($.key.toLowerCase())===-1||!Q.value)return;X(),_(),$.preventDefault();break;case"Escape":U();break;case"ArrowUp":if($.preventDefault(),!o.value)return;S.value||T(),B();break;case"ArrowDown":if($.preventDefault(),!o.value)return;S.value||T(),b();break;case"ArrowLeft":if(s.value&&k.value&&k.value.querySelector("input").selectionStart||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),ce===-1?ae[ae.length-1].focus():ce>0&&ae[ce-1].focus();break;case"ArrowRight":if(ce===-1||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),ae.length>ce+1?ae[ce+1].focus():s.value?k.value.querySelector("input").focus():s.value||C.value.focus();break}},handleKeyup:$=>{t.emit("keyup",$,p)},preparePointer:X}}function xU(e,t,n){const{classes:r,disabled:a,openDirection:A,showOptions:s}=i.toRefs(e),o=n.isOpen,l=n.isPointed,c=n.isSelected,u=n.isDisabled,d=n.isActive,f=n.canPointGroups,h=n.resolving,p=n.fo,m=i.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value})),y=i.computed(()=>!!(o.value&&s.value&&(!h.value||h.value&&p.value.length)));return{classList:i.computed(()=>{const v=m.value;return{container:[v.container].concat(a.value?v.containerDisabled:[]).concat(y.value&&A.value==="top"?v.containerOpenTop:[]).concat(y.value&&A.value!=="top"?v.containerOpen:[]).concat(d.value?v.containerActive:[]),wrapper:v.wrapper,spacer:v.spacer,singleLabel:v.singleLabel,singleLabelText:v.singleLabelText,multipleLabel:v.multipleLabel,search:v.search,tags:v.tags,tag:[v.tag].concat(a.value?v.tagDisabled:[]),tagDisabled:v.tagDisabled,tagRemove:v.tagRemove,tagRemoveIcon:v.tagRemoveIcon,tagsSearchWrapper:v.tagsSearchWrapper,tagsSearch:v.tagsSearch,tagsSearchCopy:v.tagsSearchCopy,placeholder:v.placeholder,caret:[v.caret].concat(o.value?v.caretOpen:[]),clear:v.clear,clearIcon:v.clearIcon,spinner:v.spinner,inifinite:v.inifinite,inifiniteSpinner:v.inifiniteSpinner,dropdown:[v.dropdown].concat(A.value==="top"?v.dropdownTop:[]).concat(!o.value||!s.value||!y.value?v.dropdownHidden:[]),options:[v.options].concat(A.value==="top"?v.optionsTop:[]),group:v.group,groupLabel:_=>{let B=[v.groupLabel];return l(_)?B.push(c(_)?v.groupLabelSelectedPointed:v.groupLabelPointed):c(_)&&f.value?B.push(u(_)?v.groupLabelSelectedDisabled:v.groupLabelSelected):u(_)&&B.push(v.groupLabelDisabled),f.value&&B.push(v.groupLabelPointable),B},groupOptions:v.groupOptions,option:(_,B)=>{let b=[v.option];return l(_)?b.push(c(_)?v.optionSelectedPointed:v.optionPointed):c(_)?b.push(u(_)?v.optionSelectedDisabled:v.optionSelected):(u(_)||B&&u(B))&&b.push(v.optionDisabled),b},noOptions:v.noOptions,noResults:v.noResults,assist:v.assist,fakeInput:v.fakeInput}}),showDropdown:y}}function FU(e,t,n){const{limit:r,infinite:a}=i.toRefs(e),A=n.isOpen,s=n.offset,o=n.search,l=n.pfo,c=n.eo,u=i.ref(null),d=i.ref(null),f=i.computed(()=>s.value<l.value.length),h=m=>{const{isIntersecting:y,target:g}=m[0];if(y){const v=g.offsetParent,_=v.scrollTop;s.value+=r.value==-1?10:r.value,i.nextTick(()=>{v.scrollTop=_})}},p=()=>{A.value&&s.value<l.value.length?u.value.observe(d.value):!A.value&&u.value&&u.value.disconnect()};return i.watch(A,()=>{a.value&&p()}),i.watch(o,()=>{a.value&&(s.value=r.value,p())},{flush:"post"}),i.watch(c,()=>{a.value&&p()},{immediate:!1,flush:"post"}),i.onMounted(()=>{window&&window.IntersectionObserver&&(u.value=new IntersectionObserver(h))}),{hasMore:f,infiniteLoader:d}}function IU(e,t,n){const{placeholder:r,id:a,valueProp:A,label:s,mode:o,groupLabel:l,aria:c,searchable:u}=i.toRefs(e),d=n.pointer,f=n.iv,h=n.hasSelected,p=n.multipleLabelText,m=i.ref(null),y=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("assist"),F.join("-")}),g=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("multiselect-options"),F.join("-")}),v=i.computed(()=>{let F=[];if(a&&a.value&&F.push(a.value),d.value)return F.push(d.value.group?"multiselect-group":"multiselect-option"),F.push(d.value.group?d.value.index:d.value[A.value]),F.join("-")}),_=i.computed(()=>r.value),B=i.computed(()=>o.value!=="single"),b=i.computed(()=>{let F="";return o.value==="single"&&h.value&&(F+=f.value[s.value]),o.value==="multiple"&&h.value&&(F+=p.value),o.value==="tags"&&h.value&&(F+=f.value.map(Q=>Q[s.value]).join(", ")),F}),w=i.computed(()=>{let F={...c.value};return u.value&&(F["aria-labelledby"]=F["aria-labelledby"]?`${y.value} ${F["aria-labelledby"]}`:y.value,b.value&&F["aria-label"]&&(F["aria-label"]=`${b.value}, ${F["aria-label"]}`)),F}),C=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-option"),Q.push(F[A.value]),Q.join("-")},k=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-group"),Q.push(F.index),Q.join("-")},S=F=>{let Q=[];return Q.push(F),Q.join(" ")},T=F=>{let Q=[];return Q.push(F),Q.join(" ")},U=F=>`${F} ❎`;return i.onMounted(()=>{if(a&&a.value&&document&&document.querySelector){let F=document.querySelector(`[for="${a.value}"]`);m.value=F?F.innerText:null}}),{arias:w,ariaLabel:b,ariaAssist:y,ariaControls:g,ariaPlaceholder:_,ariaMultiselectable:B,ariaActiveDescendant:v,ariaOptionId:C,ariaOptionLabel:S,ariaGroupId:k,ariaGroupLabel:T,ariaTagLabel:U}}function UU(e,t,n){const{locale:r,fallbackLocale:a}=i.toRefs(e);return{localize:s=>!s||typeof s!="object"?s:s&&s[r.value]?s[r.value]:s&&r.value&&s[r.value.toUpperCase()]?s[r.value.toUpperCase()]:s&&s[a.value]?s[a.value]:s&&a.value&&s[a.value.toUpperCase()]?s[a.value.toUpperCase()]:s&&Object.keys(s)[0]?s[Object.keys(s)[0]]:""}}function QU(e,t,n,r={}){return n.forEach(a=>{a&&(r={...r,...a(e,t,r)})}),r}var Vt={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1}},setup(e,t){return QU(e,t,[UU,vU,yU,EU,BU,mU,kU,_U,FU,CU,SU,xU,IU])}};const TU=["id","dir"],DU=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],LU=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],OU=["onKeyup","aria-label"],MU=["onClick"],NU=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],PU=["innerHTML"],HU=["id"],RU=["id","aria-label","aria-selected"],VU=["data-pointed","onMouseenter","onClick"],KU=["innerHTML"],$U=["aria-label"],WU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],GU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],zU=["innerHTML"],jU=["innerHTML"],YU=["value"],qU=["name","value"],XU=["name","value"],JU=["id"];function ZU(e,t,n,r,a,A){return i.openBlock(),i.createElementBlock("div",{ref:"multiselect",class:i.normalizeClass(e.classList.container),id:n.searchable?void 0:n.id,dir:n.rtl?"rtl":void 0,onFocusin:t[10]||(t[10]=(...s)=>e.handleFocusIn&&e.handleFocusIn(...s)),onFocusout:t[11]||(t[11]=(...s)=>e.handleFocusOut&&e.handleFocusOut(...s)),onKeyup:t[12]||(t[12]=(...s)=>e.handleKeyup&&e.handleKeyup(...s)),onKeydown:t[13]||(t[13]=(...s)=>e.handleKeydown&&e.handleKeydown(...s))},[i.createElementVNode("div",i.mergeProps({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...s)=>e.handleMousedown&&e.handleMousedown(...s)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":n.searchable?void 0:e.ariaControls,"aria-placeholder":n.searchable?void 0:e.ariaPlaceholder,"aria-expanded":n.searchable?void 0:e.isOpen,"aria-activedescendant":n.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":n.searchable?void 0:e.ariaMultiselectable,role:n.searchable?void 0:"combobox"},n.searchable?{}:e.arias),[i.createCommentVNode(" Search "),n.mode!=="tags"&&n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:n.autocomplete,id:n.searchable?n.id:void 0,onInput:t[0]||(t[0]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[1]||(t[1]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[2]||(t[2]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,LU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Tags (with search) "),n.mode=="tags"?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(e.classList.tags),"data-tags":""},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.iv,(s,o,l)=>i.renderSlot(e.$slots,"tag",{option:s,handleTagRemove:e.handleTagRemove,disabled:n.disabled},()=>[(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass([e.classList.tag,s.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:i.withKeys(c=>e.handleTagRemove(s,c),["enter"]),key:l,"aria-label":e.ariaTagLabel(e.localize(s[n.label]))},[i.createTextVNode(i.toDisplayString(e.localize(s[n.label]))+" ",1),!n.disabled&&!s.disabled?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(e.classList.tagRemove),onClick:i.withModifiers(c=>e.handleTagRemove(s,c),["stop"])},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagRemoveIcon)},null,2)],10,MU)):i.createCommentVNode("v-if",!0)],42,OU))])),256)),i.createElementVNode("div",{class:i.normalizeClass(e.classList.tagsSearchWrapper),ref:"tags"},[i.createCommentVNode(" Used for measuring search width "),i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagsSearchCopy)},i.toDisplayString(e.search),3),i.createCommentVNode(" Actual search input "),n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:n.searchable?n.id:void 0,autocomplete:n.autocomplete,onInput:t[3]||(t[3]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[4]||(t[4]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[5]||(t[5]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,NU)):i.createCommentVNode("v-if",!0)],2)],2)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Single label "),n.mode=="single"&&e.hasSelected&&!e.search&&e.iv?i.renderSlot(e.$slots,"singlelabel",{key:2,value:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.singleLabel)},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.singleLabelText)},i.toDisplayString(e.localize(e.iv[n.label])),3)],2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Multiple label "),n.mode=="multiple"&&e.hasSelected&&!e.search?i.renderSlot(e.$slots,"multiplelabel",{key:3,values:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,PU)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Placeholder "),n.placeholder&&!e.hasSelected&&!e.search?i.renderSlot(e.$slots,"placeholder",{key:4},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.placeholder),"aria-hidden":"true"},i.toDisplayString(n.placeholder),3)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Spinner "),n.loading||e.resolving?i.renderSlot(e.$slots,"spinner",{key:5},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.spinner),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Clear "),e.hasSelected&&!n.disabled&&n.canClear&&!e.busy?i.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},()=>[i.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:i.normalizeClass(e.classList.clear),onClick:t[6]||(t[6]=(...s)=>e.clear&&e.clear(...s)),onKeyup:t[7]||(t[7]=i.withKeys((...s)=>e.clear&&e.clear(...s),["enter"]))},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.clearIcon)},null,2)],34)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Caret "),n.caret&&n.showOptions?i.renderSlot(e.$slots,"caret",{key:7},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.caret),onClick:t[8]||(t[8]=(...s)=>e.handleCaretClick&&e.handleCaretClick(...s)),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0)],16,DU),i.createCommentVNode(" Options "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.dropdown),tabindex:"-1"},[i.renderSlot(e.$slots,"beforelist",{options:e.fo}),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.options),id:e.ariaControls,role:"listbox"},[n.groups?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(e.fg,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.group),key:l,id:e.ariaGroupId(s),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),"aria-selected":e.isSelected(s),role:"option"},[s.__CREATE__?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(e.classList.groupLabel(s)),"data-pointed":e.isPointed(s),onMouseenter:c=>e.setPointer(s,o),onClick:c=>e.handleGroupClick(s)},[i.renderSlot(e.$slots,"grouplabel",{group:s,isSelected:e.isSelected,isPointed:e.isPointed},()=>[i.createElementVNode("span",{innerHTML:e.localize(s[n.groupLabel])},null,8,KU)])],42,VU)),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),role:"group"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.__VISIBLE__,(c,u,d)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(c,s)),"data-pointed":e.isPointed(c),"data-selected":e.isSelected(c)||void 0,key:d,onMouseenter:f=>e.setPointer(c),onClick:f=>e.handleOptionClick(c),id:e.ariaOptionId(c),"aria-selected":e.isSelected(c),"aria-label":e.ariaOptionLabel(e.localize(c[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:c,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(c[n.label])),1)])],42,WU))),128))],10,$U)],10,RU))),128)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.fo,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(s)),"data-pointed":e.isPointed(s),"data-selected":e.isSelected(s)||void 0,key:l,onMouseenter:c=>e.setPointer(s),onClick:c=>e.handleOptionClick(s),id:e.ariaOptionId(s),"aria-selected":e.isSelected(s),"aria-label":e.ariaOptionLabel(e.localize(s[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:s,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(s[n.label])),1)])],42,GU))),128))],10,HU),e.noOptions?i.renderSlot(e.$slots,"nooptions",{key:0},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noOptions),innerHTML:e.localize(n.noOptionsText)},null,10,zU)]):i.createCommentVNode("v-if",!0),e.noResults?i.renderSlot(e.$slots,"noresults",{key:1},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noResults),innerHTML:e.localize(n.noResultsText)},null,10,jU)]):i.createCommentVNode("v-if",!0),n.infinite&&e.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.inifinite),ref:"infiniteLoader"},[i.renderSlot(e.$slots,"infinite",{},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.inifiniteSpinner)},null,2)])],2)):i.createCommentVNode("v-if",!0),i.renderSlot(e.$slots,"afterlist",{options:e.fo})],2),i.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(i.openBlock(),i.createElementBlock("input",{key:0,class:i.normalizeClass(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,YU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Native input support "),n.nativeSupport?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.mode=="single"?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:e.plainValue!==void 0?e.plainValue:""},null,8,qU)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.plainValue,(s,o)=>(i.openBlock(),i.createElementBlock("input",{type:"hidden",name:`${n.name}[]`,value:s,key:o},null,8,XU))),128))],64)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Screen reader assistive text "),n.searchable&&e.hasSelected?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},i.toDisplayString(e.ariaLabel),11,JU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Create height for empty input "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.spacer)},null,2)],42,TU)}Vt.render=ZU;Vt.__file="src/Multiselect.vue";const eQ={class:"search-bar"},tQ=i.defineComponent({__name:"SearchBar",props:hb,setup(e){const t=e,n=i.ref(""),r=us.useRouter();function a(s,o,l){l.clear(),l.search=n.value,r.push(o.link)}function A(s){n.value=s}return(s,o)=>(i.openBlock(),i.createElementBlock("div",eQ,[i.createVNode(i.unref(Vt),{placeholder:"Search Cards or Players","value-prop":"link","clear-on-blur":!1,"clear-on-search":!1,"clear-on-select":!1,"close-on-select":!0,delay:0,"filter-results":!1,groups:!0,"min-chars":0,"resolve-on-load":!1,searchable:!0,options:t.fetchSeachResult,onOpen:o[0]||(o[0]=l=>{l.noOptions&&l.resolveOptions()}),onSearchChange:A,onSelect:a},{option:i.withCtx(({option:l})=>[l.type==="card"?(i.openBlock(),i.createBlock(fn,{key:`card-${l.card.cardCode}`,class:"card-slice-item","maintain-aspect-ratio":!0,"card-prop":l.card,"router-link":l.link},null,8,["card-prop","router-link"])):(i.openBlock(),i.createBlock(fn,{key:`player-${l.link}`,class:"card-slice-item","maintain-aspect-ratio":!0,"ignore-card-item":!0,"card-code-prop":l.cardCode,color:l.color,name:l.name,"mana-number":l.rank,"router-link":l.link},null,8,["card-code-prop","color","name","mana-number","router-link"]))]),_:1},8,["options"])]))}});const Yu=M(tQ,[["__scopeId","data-v-ca4e3b0d"]]),nQ={class:"social-links"},rQ=i.defineComponent({__name:"SocialLinks",setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",nQ,[i.createVNode(i.unref(Ue),{class:"icon",icon:"fa-brands fa-discord"}),i.createVNode(i.unref(Ue),{class:"icon",icon:"fa-brands fa-twitter"})]))}});const vg=M(rQ,[["__scopeId","data-v-5517438c"]]),aQ={showModal:{type:Boolean,required:!0,default:!1}},AQ=["onClick"],sQ=i.defineComponent({__name:"ModalItem",props:aQ,emits:["update:showModal"],setup(e,{emit:t}){const n=e,r=i.ref(null);function a(){t("update:showModal",!1)}return i.onBeforeUnmount(()=>{var A;(A=r.value)==null||A.remove()}),i.watch(()=>n.showModal,()=>{n.showModal&&i.nextTick(()=>{r.value&&document.body.appendChild(r.value)})}),(A,s)=>n.showModal?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"modalItem",ref:r,class:"modal-item",onClick:i.withModifiers(a,["self"])},[i.renderSlot(A.$slots,"default",{},void 0,!0)],8,AQ)):i.createCommentVNode("",!0)}});const VA=M(sQ,[["__scopeId","data-v-5e715d99"]]),iQ={filterArray:{type:Array,required:!1,default:void 0},title:{type:String,required:!1,default:void 0}},oQ={class:"filter"},lQ={key:0,class:"top"},cQ={key:0,class:"title"},uQ=i.defineComponent({__name:"SidePanelSectionPane",props:iQ,emits:["clear:filterArray"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterArray&&n.filterArray.length>0?"clickable":null);function a(){t("clear:filterArray")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",oQ,[n.title||A.filterArray?(i.openBlock(),i.createElementBlock("div",lQ,[n.title?(i.openBlock(),i.createElementBlock("h2",cQ,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),A.filterArray?i.withDirectives((i.openBlock(),i.createElementBlock("p",{key:1,class:i.normalizeClass(["clear",r.value]),onClick:a},null,2)),[[o,"general.clear"]]):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const mt=M(uQ,[["__scopeId","data-v-741cceed"]]),dQ={filterArray:{type:Array,required:!0,default:[]}},fQ=["placeholder"],hQ=i.defineComponent({__name:"FilterSampleSize",props:dQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray),A=i.ref("");let s=setTimeout(()=>{},0);a.value.length>0&&(A.value=a.value[0]),i.watch(a,()=>{t("update:filterArray",a.value)}),i.watch(A,()=>{s&&clearTimeout(s),s=setTimeout(()=>{a.value.splice(0),A.value&&a.value.push(A.value)},1e3)});function o(){a.value.splice(0),A.value=""}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("general.sampleSize"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),placeholder:i.unref(r)("general.minimumMatches"),type:"number",min:"10",step:"10"},null,8,fQ),[[i.vModelText,A.value]])]),_:1},8,["filter-array","title"]))}});const Xs=M(hQ,[["__scopeId","data-v-d66d5f9d"]]),pQ={filterArray:{type:Array,required:!0,default:[]}},gQ={isSelected:{type:Boolean,required:!0,default:!1},icon:{type:String,required:!1,default:void 0},prompt:{type:String,required:!0,default:""}},mQ=["selected"],vQ={class:"checkbox-name"},BQ=i.defineComponent({__name:"CheckboxItem",props:gQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e,r=i.computed(()=>(console.log(n.icon),{content:n.icon}));function a(){t("update:isSelected",!n.isSelected)}return(A,s)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:a},[n.icon?(i.openBlock(),i.createElementBlock("div",{key:0,class:"checkbox-icon",style:i.normalizeStyle(r.value)},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",vQ,i.toDisplayString(n.prompt),1)],8,mQ))}});const tn=M(BQ,[["__scopeId","data-v-a4c6109c"]]),yQ={selectedOption:{type:Number,required:!0,default:-1},options:{type:Array,required:!0,default:[]}},wQ=e=>(i.pushScopeId("data-v-d5d9745a"),e=e(),i.popScopeId(),e),bQ={class:"toggle-switch"},_Q=wQ(()=>i.createElementVNode("div",{class:"selection"},null,-1)),CQ=[_Q],EQ=["onClick"],kQ={class:"option flex-center"},SQ={class:"option-text"},xQ=i.defineComponent({__name:"ToggleSwitch",props:yQ,emits:["update:selectedOption"],setup(e,{emit:t}){const n=e,r=i.computed(()=>({left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${n.selectedOption})`,width:`calc((100% - calc(var(--spacing-1) * 2)) / ${n.options.length})`}));function a(s){return{cursor:n.selectedOption!=s?"pointer":"default",left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${s})`,width:`${1/n.options.length*100}%`}}function A(s){t("update:selectedOption",s)}return(s,o)=>(i.openBlock(),i.createElementBlock("div",bQ,[i.withDirectives(i.createElementVNode("div",{class:"selection-container",style:i.normalizeStyle(r.value)},CQ,4),[[i.vShow,s.selectedOption>-1]]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,(l,c)=>(i.openBlock(),i.createElementBlock("div",{key:c,ref_for:!0,ref:"option-container",style:i.normalizeStyle(a(c)),class:"option-container",onClick:u=>A(c)},[i.createElementVNode("div",kQ,[i.createElementVNode("h1",SQ,i.toDisplayString(l),1)])],12,EQ))),128))]))}});const qu=M(xQ,[["__scopeId","data-v-d5d9745a"]]),FQ={class:"checkboxes-container"},IQ=i.defineComponent({__name:"FilterRanks",props:pQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>we().dataJson.ranks.sort((c,u)=>u.order-c.order)),A=i.reactive(n.filterArray),s=i.ref(0);i.watch(A,()=>{t("update:filterArray",A)}),i.watch(s,()=>{s.value===0?A.splice(0):s.value===1&&(A.splice(0),A.push("Platinum","Diamond","Masters"))});function o(){A.splice(0),s.value=0}function l(c){const u=A.indexOf(c);if(u===-1){A.push(c);return}A.splice(u,1)}return(c,u)=>(i.openBlock(),i.createBlock(mt,{"filter-array":A,title:i.unref(r)("general.ranks"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",FQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,d=>(i.openBlock(),i.createBlock(tn,{key:d.nameRef,icon:`url(${d.icon})`,prompt:d.name,"is-selected":A.includes(d.nameRef),"onUpdate:isSelected":f=>l(d.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(qu,{"selected-option":s.value,"onUpdate:selectedOption":u[0]||(u[0]=d=>s.value=d),options:[i.unref(r)("general.allRanks"),i.unref(r)("general.platPlus")]},null,8,["selected-option","options"])])]),_:1},8,["filter-array","title"]))}});const mb=M(IQ,[["__scopeId","data-v-af7bc2a0"]]),UQ={filterArray:{type:Array,required:!0,default:[]}},QQ={isSelected:{type:Boolean,required:!0,default:!1},prompt:{type:Number,required:!0,default:""}},TQ=["selected"],DQ={class:"prompt"},LQ=i.defineComponent({__name:"CheckboxItemManaCost",props:QQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e;function r(){t("update:isSelected",!n.isSelected)}return(a,A)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:r},[i.createVNode(jo),i.createElementVNode("div",DQ,i.toDisplayString(n.prompt===10?"+":n.prompt),1)],8,TQ))}});const Au=M(LQ,[["__scopeId","data-v-2c74c2ed"]]),OQ={class:"checkbox-rows-container"},MQ={class:"top-row checkbox-items-container"},NQ={class:"bottom-row checkbox-items-container"},PQ=i.defineComponent({__name:"FilterManaCost",props:UQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=Array(6).fill(1).map((l,c)=>c),A=Array(5).fill(1).map((l,c)=>c+6);function s(l){let c;n.filterArray.includes(l)?c=n.filterArray.filter(u=>u!==l):c=[...n.filterArray,l],t("update:filterArray",c)}function o(){t("update:filterArray",[])}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":n.filterArray,title:i.unref(r)("general.manaCost"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",OQ,[i.createElementVNode("div",MQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(a),u=>(i.openBlock(),i.createBlock(Au,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))]),i.createElementVNode("div",NQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(A),u=>(i.openBlock(),i.createBlock(Au,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])])]),_:1},8,["filter-array","title"]))}});const Bg=M(PQ,[["__scopeId","data-v-a94d786a"]]),HQ={filterArray:{type:Array,required:!0,default:[]}},RQ={class:"checkboxes-container"},yg=i.defineComponent({__name:"FilterRarities",props:HQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>we().dataJson.rarities.filter(l=>l.nameRef!=="None")),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":A,title:i.unref(r)("general.rarities"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",RQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(tn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),VQ={filterArray:{type:Array,required:!0,default:[]}},KQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},$Q=["src"],WQ={class:"multiselect-tag-remove"},GQ=["onMousedown"],zQ=["src"],wg=i.defineComponent({__name:"FilterSets",props:VQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray);i.watch(a,()=>{t("update:filterArray",a.value)});function A(){a.value.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("general.sets"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),placeholder:i.unref(r)("general.sets"),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.sets,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:l,handleTagRemove:c})=>[i.createElementVNode("span",KQ,[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,$Q),i.createElementVNode("span",WQ,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(u=>c(l,u),["prevent"])},null,40,GQ)])])]),option:i.withCtx(({option:l})=>[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,zQ),i.createTextVNode(" "+i.toDisplayString(l.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),jQ={filterArray:{type:Array,required:!0,default:[]}},YQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},qQ=["src"],XQ={class:"multiselect-tag-remove"},JQ=["onMousedown"],ZQ=["src"],bg=i.defineComponent({__name:"FilterKeywords",props:jQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray),A=i.computed(()=>we().dataJson.keywords.filter(o=>o.showInFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("general.keywords"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createVNode(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:i.unref(r)("general.keywords"),class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:c,handleTagRemove:u})=>[i.createElementVNode("span",YQ,[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,qQ),i.createElementVNode("span",XQ,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(d=>u(c,d),["prevent"])},null,40,JQ)])])]),option:i.withCtx(({option:c})=>[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,ZQ),i.createTextVNode(" "+i.toDisplayString(c.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),eT={filterArray:{type:Array,required:!0,default:[]}},tT={class:"checkboxes-container"},Js=i.defineComponent({__name:"FilterServers",props:eT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterArray);i.watch(a,()=>{t("update:filterArray",a)});function A(){a.splice(0)}function s(o){const l=a.indexOf(o);if(l===-1){a.push(o);return}a.splice(l,1)}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a,title:i.unref(r)("general.servers"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createElementVNode("div",tT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.servers,c=>(i.openBlock(),i.createBlock(tn,{key:c.nameRef,prompt:c.name,"is-selected":a.includes(c.nameRef),"onUpdate:isSelected":u=>s(c.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),nT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},rT={class:"checkboxes-container"},aT=i.defineComponent({__name:"FilterTime",props:nT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterArray),A=i.ref(null),s=i.ref(null),o=a.find(h=>h.startsWith("patch_"));o&&(A.value=o);const l=a.find(h=>h.startsWith("season_"));l&&(s.value=l);const c=i.computed(()=>n.allowZero&&a.filter(h=>h.startsWith("patch")).length>0||!n.allowZero&&a.filter(h=>!h.startsWith("patch")).length===0);i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(h,p)=>{u(h,p)}),i.watch(s,(h,p)=>{u(h,p)});function u(h,p){console.log(p,h),p&&a.splice(a.indexOf(p),1),h&&a.push(h),console.log(a)}function d(){a.splice(0),A.value=null,s.value=null}function f(h){a.splice(0),(n.allowZero||h!=="patch")&&a.push(h),h==="patch"&&A.value&&a.push(A.value),h==="season"&&s.value&&a.push(s.value)}return(h,p)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a,title:i.unref(r)("general.time"),"onClear:filterArray":d},{default:i.withCtx(()=>[i.createElementVNode("div",rT,[i.createVNode(tn,{prompt:i.unref(r)("general.patch"),"is-selected":c.value,"onUpdate:isSelected":p[0]||(p[0]=m=>f("patch"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.season"),"is-selected":a.includes("season"),"onUpdate:isSelected":p[1]||(p[1]=m=>f("season"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastDays",7),"is-selected":a.includes("past7days"),"onUpdate:isSelected":p[2]||(p[2]=m=>f("past7days"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastDays",3),"is-selected":a.includes("past3days"),"onUpdate:isSelected":p[3]||(p[3]=m=>f("past3days"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastHours",24),"is-selected":a.includes("past24hours"),"onUpdate:isSelected":p[4]||(p[4]=m=>f("past24hours"))},null,8,["prompt","is-selected"]),i.createVNode(tn,{prompt:i.unref(r)("general.pastHour"),"is-selected":a.includes("pastHour"),"onUpdate:isSelected":p[5]||(p[5]=m=>f("pastHour"))},null,8,["prompt","is-selected"]),c.value?(i.openBlock(),i.createBlock(i.unref(Vt),{key:0,modelValue:A.value,"onUpdate:modelValue":p[6]||(p[6]=m=>A.value=m),options:i.unref(we)().dataJson.patches,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0),a.includes("season")?(i.openBlock(),i.createBlock(i.unref(Vt),{key:1,modelValue:s.value,"onUpdate:modelValue":p[7]||(p[7]=m=>s.value=m),options:i.unref(we)().dataJson.seasons,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const KA=M(aT,[["__scopeId","data-v-78ab671a"]]),AT={filterArray:{type:Array,required:!0,default:[]}},sT={cardCodes:{type:Array,required:!0,default:[]},filterCallback:{type:Function,required:!1,default:()=>!0},mode:{type:String,required:!1,default:"tags"}},iT=i.defineComponent({__name:"CardMultiselect",props:sT,emits:["update:cardCodes"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.cardCodes),A=i.computed(()=>{let s=Qw().cardJson.sort((o,l)=>o.name.localeCompare(l.name));return n.filterCallback&&(s=s.filter(n.filterCallback)),s});return i.watch(a,()=>{t("update:cardCodes",a.value)}),(s,o)=>(i.openBlock(),i.createBlock(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),class:"multiselect",placeholder:i.unref(r)("cards.cards"),mode:n.mode,options:A.value,infinite:!0,limit:10,searchable:!0,label:"name","value-prop":"cardCode"},null,8,["modelValue","placeholder","mode","options"]))}});const _g=M(iT,[["__scopeId","data-v-968634df"]]),Xu=i.defineComponent({__name:"FilterCardCodes",props:AT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray);i.watch(a,()=>{console.log("watch(filterArray)",a.value),t("update:filterArray",a.value)});function A(){a.value.splice(0)}function s(o){return o.collectible}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a.value,title:i.unref(r)("cards.cards"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(_g,{cardCodes:a.value,"onUpdate:cardCodes":l[0]||(l[0]=c=>a.value=c),mode:"tags","filter-callback":s},null,8,["cardCodes"])]),_:1},8,["filter-array","title"]))}}),oT={filterArray:{type:Array,required:!0,default:[]}},lT={class:"checkboxes-container"},cT=i.defineComponent({__name:"FilterRegions",props:oT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterArray),A=i.ref([]);A.value.push(...a.filter(l=>uo(l))),i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(l,c)=>{let u=l.find(d=>!c.includes(d));if(u||(u=c.find(d=>!l.includes(d)),u))return o(u)});function s(){a.splice(0),A.value.slice(0)}function o(l){const c=a.indexOf(l);if(c===-1){a.push(l),l==="Runeterra"&&a.push(...A.value);return}if(a.splice(c,1),l==="Runeterra")for(let u=0;u<a.length;u++)uo(a[u])&&a.splice(u--,1)}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":a,title:i.unref(r)("general.regions"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",lT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.regions,u=>(i.openBlock(),i.createBlock(tn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":a.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(tn,{class:"runeterra",prompt:"Runeterra","is-selected":a.includes("Runeterra"),"onUpdate:isSelected":c[0]||(c[0]=u=>o("Runeterra"))},null,8,["is-selected"]),a.includes("Runeterra")?(i.openBlock(),i.createBlock(i.unref(Vt),{key:0,modelValue:A.value,"onUpdate:modelValue":c[1]||(c[1]=u=>A.value=u),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.runeterraChampions,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Yo=M(cT,[["__scopeId","data-v-c93a9e90"]]),uT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},dT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},fT={class:"checkboxes-container"},hT=i.defineComponent({__name:"FilterFormat",props:dT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>{const d=we().dataJson.queues;return Object.values(we().dataJson.formats).filter(f=>f.availableQueues.some(h=>!d[h].excludeInMassFilter))}),A=i.computed(()=>a.value.filter(d=>!d.inDropdown)),s=i.computed(()=>a.value.filter(d=>d.inDropdown)),o=i.reactive(n.filterArray),l=i.ref(null);i.onMounted(()=>{o.length>0&&s.value.map(d=>d.nameRef).includes(o[0])&&(l.value=o[0])}),i.watch(o,()=>{t("update:filterArray",o),o.length===0&&(l.value=null)}),i.watch(l,()=>{l.value&&(o.splice(0),o.push(l.value))});function c(d){l.value=null,o.splice(0),d!==Vr.Standard&&o.push(d)}function u(){o.splice(0)}return(d,f)=>(i.openBlock(),i.createBlock(mt,{"filter-array":o,title:i.unref(r)("general.format"),"onClear:filterArray":u},{default:i.withCtx(()=>[i.createElementVNode("div",fT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,h=>(i.openBlock(),i.createBlock(tn,{prompt:h.name,"is-selected":o.includes(h.nameRef)||!n.allowZero&&h.nameRef==="Standard"&&o.length===0,"onUpdate:isSelected":p=>c(h.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),256)),s.value.length>0?(i.openBlock(),i.createBlock(i.unref(Vt),{key:0,modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=h=>l.value=h),options:s.value,searchable:!1,placeholder:i.unref(r)("general.otherFormats"),label:"name","value-prop":"nameRef",onClear:u},null,8,["modelValue","options","placeholder"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Cg=M(hT,[["__scopeId","data-v-22de9b40"]]),pT={filterArray:{type:Array,required:!0,default:[]},availableQueues:{type:Array,required:!0,default:[]}},Eg=i.defineComponent({__name:"FilterQueues",props:pT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.ref(n.filterArray),A=i.computed(()=>Object.values(we().dataJson.queues).filter(o=>n.availableQueues.includes(o.nameRef)&&!o.excludeInMassFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>n.availableQueues.length>1?(i.openBlock(),i.createBlock(mt,{key:0,"filter-array":a.value,title:i.unref(r)("general.queues"),"onClear:filterArray":s},{default:i.withCtx(()=>{var c,u;return[i.createVNode(i.unref(Vt),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=d=>a.value=d),placeholder:(u=(c=A.value)==null?void 0:c.find(d=>d.nameRef===i.unref(S2).Ranked))==null?void 0:u.name,class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","placeholder","options"])]}),_:1},8,["filter-array","title"])):i.createCommentVNode("",!0)}}),gT={filterObject:{type:Object,required:!1,default:void 0},showClearAll:{type:Boolean,required:!1,default:!0}},mT={class:"filter"},vT={key:0,class:"top"},BT=i.defineComponent({__name:"SidePanel",props:gT,emits:["clear:filterObject"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterObject&&Object.values(n.filterObject).some(A=>A.length>0)?"clickable":null);function a(){t("clear:filterObject")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",mT,[n.showClearAll&&n.filterObject?(i.openBlock(),i.createElementBlock("div",vT,[i.withDirectives(i.createElementVNode("p",{class:i.normalizeClass(["clear",r.value]),onClick:a},null,2),[[o,"general.clearAll"]])])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const Zs=M(BT,[["__scopeId","data-v-6a93fcc1"]]),vb=i.defineComponent({__name:"FilterDecks",props:uT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(Zs,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Yo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(Xu,{"filter-array":r.cardFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.cardFilters=l)},null,8,["filter-array"]),i.createVNode(Cg,{"filter-array":r.formatFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.formatFilters=l)},null,8,["filter-array"]),n.includeDataFilters?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(Eg,{"filter-array":r.queueFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"]),i.createVNode(Xs,{"filter-array":r.sampleSizeFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.sampleSizeFilters=l)},null,8,["filter-array"]),i.createVNode(KA,{"filter-array":r.timeFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.timeFilters=l)},null,8,["filter-array"]),i.createVNode(Js,{"filter-array":r.serverFilters,"onUpdate:filterArray":o[6]||(o[6]=l=>r.serverFilters=l)},null,8,["filter-array"])],64)):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),yT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},wT={filterArray:{type:Array,required:!0,default:[]},placeholder:{type:String,required:!1},title:{type:String,required:!1,default:"Text"}},bT=["placeholder"],_T=i.defineComponent({__name:"FilterText",props:wT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,r=i.ref(n.filterArray),a=i.ref("");let A=setTimeout(()=>{},0);r.value.length>0&&(a.value=r.value[0]),i.watch(r,()=>{t("update:filterArray",r.value)}),i.watch(a,()=>{A&&clearTimeout(A),A=setTimeout(()=>{r.value.splice(0),a.value&&r.value.push(a.value)},1e3)});function s(){r.value.splice(0),a.value=""}return(o,l)=>(i.openBlock(),i.createBlock(mt,{"filter-array":r.value,title:n.title,"onClear:filterArray":s},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:n.placeholder,type:"text"},null,8,bT),[[i.vModelText,a.value]])]),_:1},8,["filter-array","title"]))}});const su=M(_T,[["__scopeId","data-v-e9c34cae"]]),Bb=i.defineComponent({__name:"FilterProfile",props:yT,emits:["update:filters"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filters);i.watch(a,()=>{t("update:filters",a)});const A=i.computed(()=>{var o;return a.formatFilters.length===0?[]:(o=we().dataJson.formats[a.formatFilters[0]??"Standard"])==null?void 0:o.availableQueues});function s(){for(const[,o]of Object.entries(a))o.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(Zs,{"filter-object":n.filters,"onClear:filterObject":s},{default:i.withCtx(()=>[i.createVNode(Yo,{"filter-array":a.regionFilters,"onUpdate:filterArray":l[0]||(l[0]=c=>a.regionFilters=c)},null,8,["filter-array"]),i.createVNode(Xu,{"filter-array":a.cardFilters,"onUpdate:filterArray":l[1]||(l[1]=c=>a.cardFilters=c)},null,8,["filter-array"]),i.createVNode(su,{"filter-array":a.deckCodeFilters,"onUpdate:filterArray":l[2]||(l[2]=c=>a.deckCodeFilters=c),placeholder:i.unref(r)("general.deckCode"),title:i.unref(r)("general.deckCode")},null,8,["filter-array","placeholder","title"]),i.createVNode(su,{"filter-array":a.playerFilters,"onUpdate:filterArray":l[3]||(l[3]=c=>a.playerFilters=c),placeholder:i.unref(r)("general.players"),title:i.unref(r)("general.players")},null,8,["filter-array","placeholder","title"]),i.createVNode(Xs,{"filter-array":a.sampleSizeFilters,"onUpdate:filterArray":l[4]||(l[4]=c=>a.sampleSizeFilters=c)},null,8,["filter-array"]),i.createVNode(Cg,{"allow-zero":!0,"filter-array":a.formatFilters,"onUpdate:filterArray":l[5]||(l[5]=c=>a.formatFilters=c)},null,8,["filter-array"]),i.createVNode(Eg,{"filter-array":a.queueFilters,"onUpdate:filterArray":l[6]||(l[6]=c=>a.queueFilters=c),"available-queues":A.value},null,8,["filter-array","available-queues"]),i.createVNode(KA,{"allow-zero":!0,"filter-array":a.timeFilters,"onUpdate:filterArray":l[7]||(l[7]=c=>a.timeFilters=c)},null,8,["filter-array"])]),_:1},8,["filter-object"]))}}),CT={filterValue:{type:Object,required:!0,default:{attribute:"attack",equality:">",number:0}}},ET={class:"advanced-filter-item"},kT=["value"],ST=i.defineComponent({__name:"AdvancedFilterItem",props:CT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=[{value:"attack",label:r("cards.attack")},{value:"health",label:r("cards.health")},{value:"cost",label:r("cards.cost")},{value:"quantityOwned",label:r("cards.quantityOwned")}],A=i.ref(n.filterValue.attribute);i.watch(A,()=>{t("update:filterValue",{attribute:A.value,equality:n.filterValue.equality,number:n.filterValue.number})});function s(){let l=">";n.filterValue.equality===">"?l="<":n.filterValue.equality==="<"&&(l="="),t("update:filterValue",{attribute:n.filterValue.attribute,equality:l,number:n.filterValue.number})}function o(l){t("update:filterValue",{attribute:n.filterValue.attribute,equality:n.filterValue.equality,number:Number(l.target.value)})}return(l,c)=>(i.openBlock(),i.createElementBlock("div",ET,[i.createVNode(i.unref(Vt),{modelValue:A.value,"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),class:"advanced-attribute",options:a,"can-clear":!1,label:"label","value-prop":"value"},null,8,["modelValue"]),i.createElementVNode("div",{class:"equality-button",onClick:s},i.toDisplayString(n.filterValue.equality),1),i.createElementVNode("input",{type:"number",class:"equality-number",value:n.filterValue.number,onInput:o},null,40,kT)]))}});const kg=M(ST,[["__scopeId","data-v-eb2d535d"]]),xT={filterValue:{type:Array,required:!0,default:[]}},FT=i.defineComponent({__name:"FilterAdvanced",props:xT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.reactive(n.filterValue);i.watch(a,()=>{t("update:filterValue",a)});function A(){a.splice(0)}function s(){a.push({attribute:"attack",equality:">",number:0})}return(o,l)=>(i.openBlock(),i.createBlock(mt,{class:"advanced-filters","filter-array":a,title:i.unref(r)("general.advanced"),"onClear:filterArray":A},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a,(c,u)=>(i.openBlock(),i.createBlock(kg,{key:u,"filter-value":a[u],"onUpdate:filterValue":d=>a[u]=d,class:"advanced-filter-item"},null,8,["filter-value","onUpdate:filterValue"]))),128)),i.createElementVNode("div",{class:"new-advanced-filter",onClick:s},i.toDisplayString(i.unref(r)("general.newAdvancedFilter")),1)]),_:1},8,["filter-array","title"]))}});const Sg=M(FT,[["__scopeId","data-v-6c23ee29"]]),IT={filterArray:{type:Array,required:!0,default:[]}},UT={class:"checkboxes-container"},xg=i.defineComponent({__name:"FilterTypes",props:IT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=i.computed(()=>we().dataJson.types.filter(l=>["Unit","Spell","Landmark","Equipment"].includes(l.nameRef))),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(mt,{"filter-array":n.filterArray,title:i.unref(r)("general.types"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",UT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(tn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),QT={filters:{type:Object,required:!0,default:{advancedFilters:[],regionFilters:[],manaCostFilters:[],typeFilters:[],rarityFilters:[],setFilters:[],keywordFilters:[]}}},yb=i.defineComponent({__name:"FilterCards",props:QT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return"formatFilters"in r?(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues:[]});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(Zs,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Bg,{"filter-array":r.manaCostFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.manaCostFilters=l)},null,8,["filter-array"]),i.createVNode(Yo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(xg,{"filter-array":r.typeFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.typeFilters=l)},null,8,["filter-array"]),i.createVNode(yg,{"filter-array":r.rarityFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.rarityFilters=l)},null,8,["filter-array"]),i.createVNode(wg,{"filter-array":r.setFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.setFilters=l)},null,8,["filter-array"]),i.createVNode(bg,{"filter-array":r.keywordFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.keywordFilters=l)},null,8,["filter-array"]),i.createVNode(Sg,{"filter-value":r.advancedFilters,"onUpdate:filterValue":o[6]||(o[6]=l=>r.advancedFilters=l)},null,8,["filter-value"]),"serverFilters"in r?(i.openBlock(),i.createBlock(i.unref(Js),{key:0,"filter-array":r.serverFilters,"onUpdate:filterArray":o[7]||(o[7]=l=>r.serverFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"timeFilters"in r?(i.openBlock(),i.createBlock(KA,{key:1,"filter-array":r.timeFilters,"onUpdate:filterArray":o[8]||(o[8]=l=>r.timeFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"formatFilters"in r?(i.openBlock(),i.createBlock(Cg,{key:2,"filter-array":r.formatFilters,"onUpdate:filterArray":o[9]||(o[9]=l=>r.formatFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"queueFilters"in r?(i.openBlock(),i.createBlock(Eg,{key:3,"filter-array":r.queueFilters,"onUpdate:filterArray":o[10]||(o[10]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"])):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),TT={regionRef:{type:String,required:!0,default:"Ionia"}},DT={text:{type:String,required:!0,default:""}},LT=["innerHTML"],OT=i.defineComponent({__name:"TippyText",props:DT,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:"tippy-text",innerHTML:t.text},null,8,LT))}});const Ju=M(OT,[["__scopeId","data-v-715107fe"]]),MT={class:"region-item"},NT=["alt","src"],PT=i.defineComponent({__name:"RegionItem",props:TT,setup(e){const t=e,n=i.ref(null),r=i.ref(null),a=i.computed(()=>we().dataJson.regions.find(A=>A.nameRef==t.regionRef)??we().dataJson.runeterraChampions.find(A=>A.nameRef===t.regionRef));return i.onMounted(()=>{At(n.value,{content:r.value,arrow:!0})}),(A,s)=>{var o,l,c;return i.openBlock(),i.createElementBlock("div",MT,[i.createElementVNode("img",{ref_key:"regionImg",ref:n,alt:(o=a.value)==null?void 0:o.name,src:(l=a.value)==null?void 0:l.icon,class:"region-img"},null,8,NT),i.createElementVNode("div",{ref_key:"regionTippy",ref:r},[i.createVNode(Ju,{text:(c=a.value)==null?void 0:c.name},null,8,["text"])],512)])}}});const qo=M(PT,[["__scopeId","data-v-3d756f50"]]),HT={deckCode:{type:String,required:!0,default:""},deck:{type:Object,required:!1},cards:{type:Array,required:!1},describeRegions:{type:Boolean,required:!1,default:!1}},RT={class:"regions-line"},VT={key:0,class:"describe-regions"},KT={class:"lines"},$T=i.defineComponent({__name:"RegionsLine",props:HT,setup(e){const t=e,{t:n}=se(),r=i.computed(()=>t.deck?t.deck:St(t.deckCode)),a=i.computed(()=>t.cards?t.cards:rn(r.value)),A=i.computed(()=>{const o={};for(const l of Ou(r.value))o[l]=0;for(const l of a.value)for(const c of l.regionRefs)c in o&&(o[c]+=r.value[l.cardCode]);return o});function s(o,l){return{flexGrow:o,backgroundColor:`var(--color-${l}, var(--color-Runeterra))`}}return(o,l)=>(i.openBlock(),i.createElementBlock("div",RT,[t.describeRegions?(i.openBlock(),i.createElementBlock("div",VT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,class:"region-description"},[i.createVNode(qo,{"region-ref":u,class:"icon"},null,8,["region-ref"]),i.createElementVNode("span",null,i.toDisplayString(`${c} ${i.unref(n)("general.cards")}`),1)]))),128))])):i.createCommentVNode("",!0),i.createElementVNode("div",KT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,style:i.normalizeStyle(s(c,u)),class:"region-line"},null,4))),128))])]))}});const Fg=M($T,[["__scopeId","data-v-f1f94f8b"]]),WT={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardCode:{type:String,required:!0,default:"01IO001"},toggledStats:{type:Object,required:!0,default:{matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!1,kept:!1,drawnWinrate:!1,turnsHeld:!1,turnPlayed:!1}},index:{type:Number,required:!0,default:1},matches:{type:Number,required:!0,default:1},region:{type:String,required:!0,default:""},wins:{type:Number,required:!0,default:1},inclusion:{type:Number,required:!0,default:.5},avgCopies:{type:Number,required:!0,default:1},mulliganWinrate:{type:Number,required:!1,default:void 0},keptInMulligan:{type:Number,required:!1,default:void 0},drawnWinrate:{type:Number,required:!1,default:void 0},turnsHeld:{type:Number,required:!1,default:void 0},turnPlayed:{type:Number,required:!1,default:void 0}},GT={class:"cards-row-background-wrapper"},zT={class:"cards-row-background"},jT={class:"cards-row wrapper"},YT={key:0,class:"column-content"},qT={key:2,class:"column-content"},XT={key:3,class:"column-content"},JT={key:5,class:"column-content"},ZT={key:7,class:"column-content"},eD={key:8,class:"column-content"},tD=i.defineComponent({__name:"CardsRow",props:WT,setup(e){const t=e,n=i.computed(()=>["",`https://lor.gg/storage/cards/banner/${t.cardCode}.png`]);return(r,a)=>{const A=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(A,{to:t.routerLink,class:"wrapper"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"cards-row-wrapper wrapper",style:i.normalizeStyle({"--index":t.index})},[i.createElementVNode("div",GT,[i.createElementVNode("div",zT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,s=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"background-card",style:i.normalizeStyle({"--background-image":`url(${s})`})},null,4))),128))])]),i.createElementVNode("div",jT,[i.createElementVNode("div",{class:"column-content deck-highlight-wrapper",onClick:a[0]||(a[0]=i.withModifiers(()=>{},["stop","prevent"]))},[i.createVNode(fn,{class:"card-slice-item","card-code-prop":t.cardCode,"maintain-aspect-ratio":!0,color:`var(--color-${t.region}-rgb, var(--color-primary-2-rgb))`,"router-link":t.routerLink},null,8,["card-code-prop","color","router-link"])]),t.toggledStats.matches?(i.openBlock(),i.createElementBlock("div",YT,i.toDisplayString(i.unref(Te)(t.matches)),1)):i.createCommentVNode("",!0),t.toggledStats.winrate?(i.openBlock(),i.createElementBlock("div",{key:1,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(Zn)(t.wins/t.matches)})`})},i.toDisplayString(i.unref(Te)(t.wins/t.matches*100,2,3)+"%"),5)):i.createCommentVNode("",!0),t.toggledStats.inclusion?(i.openBlock(),i.createElementBlock("div",qT,i.toDisplayString(i.unref(Te)(t.inclusion*100,2,3)+"%"),1)):i.createCommentVNode("",!0),t.toggledStats.avgCopies?(i.openBlock(),i.createElementBlock("div",XT,i.toDisplayString(i.unref(Te)(t.avgCopies,2,3)),1)):i.createCommentVNode("",!0),t.toggledStats.mulliganWinrate?(i.openBlock(),i.createElementBlock("div",{key:4,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(Zn)(t.mulliganWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.mulliganWinrate?i.unref(Te)(t.mulliganWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.keptInMulligan?(i.openBlock(),i.createElementBlock("div",JT,i.toDisplayString(t.keptInMulligan?i.unref(Te)(t.keptInMulligan*100,2,3)+"%":"-"),1)):i.createCommentVNode("",!0),t.toggledStats.drawnWinrate?(i.openBlock(),i.createElementBlock("div",{key:6,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(Zn)(t.drawnWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.drawnWinrate?i.unref(Te)(t.drawnWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.turnPlayed?(i.openBlock(),i.createElementBlock("div",ZT,i.toDisplayString(t.turnPlayed?i.unref(Te)(t.turnPlayed,2,3):"-"),1)):i.createCommentVNode("",!0),t.toggledStats.turnsHeld?(i.openBlock(),i.createElementBlock("div",eD,i.toDisplayString(t.turnsHeld?i.unref(Te)(t.turnsHeld,2,3):"-"),1)):i.createCommentVNode("",!0)])],4)]),_:1},8,["to"])}}});const Ig=M(tD,[["__scopeId","data-v-69ecee4e"]]),nD={cardRows:{type:Array,required:!0,default:[]},cardsRowToggle:{type:Object,requied:!0,default:{card:!0,matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!0,keptInMulligan:!0,drawnWinrate:!0,turnsHeld:!0,turnPlayed:!0}},loading:{type:Boolean,required:!1,default:!1}};var be=(e=>(e.UP="sort-up",e.DOWN="sort-down",e.NEITHER="sort-neither",e.NOT_SORTABLE="not-sortable",e))(be||{});const rD={headingItems:{type:Array,required:!0,default:[]},loading:{type:Boolean,required:!1,default:!1}};const aD={},AD={class:"loader"};function sD(e,t){return i.openBlock(),i.createElementBlock("div",AD)}const iD=M(aD,[["render",sD],["__scopeId","data-v-91218ab0"]]),Ug=e=>(i.pushScopeId("data-v-778b82f1"),e=e(),i.popScopeId(),e),oD={class:"table-wrapper"},lD={class:"table no-scrollbar"},cD=Ug(()=>i.createElementVNode("div",{class:"heading-background-outer"},[i.createElementVNode("div",{class:"heading-background-absolute"}),i.createElementVNode("div",{class:"heading-background-inner"})],-1)),uD={class:"heading wrapper"},dD=["onClick"],fD={class:"sort-icons"},hD={key:0,class:"no-content loading"},pD={key:1,class:"no-content no-results"},gD=Ug(()=>i.createElementVNode("h2",null," No Results ",-1)),mD=Ug(()=>i.createElementVNode("h4",null," Adjust filters and try again. ",-1)),vD=[gD,mD],BD=i.defineComponent({__name:"LargeTable",props:rD,emits:["toggleSort"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.headingItems.filter(a=>a.isShown));return(a,A)=>(i.openBlock(),i.createElementBlock("div",oD,[i.createElementVNode("div",lD,[cD,i.createElementVNode("div",uD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,s=>(i.openBlock(),i.createElementBlock("div",{key:s.title,class:i.normalizeClass(["heading-cell column-content",s.sortDirection]),onClick:o=>t("toggleSort",s.id)},[i.createElementVNode("div",null,i.toDisplayString(s.title),1),i.createElementVNode("div",fD,[i.createVNode(i.unref(Ue),{icon:"sort-up",class:"sort-icon"}),i.createVNode(i.unref(Ue),{icon:"sort-down",class:"sort-icon"})])],10,dD))),128))]),i.renderSlot(a.$slots,"default",{},()=>[n.loading?(i.openBlock(),i.createElementBlock("div",hD,[i.createVNode(iD)])):(i.openBlock(),i.createElementBlock("div",pD,vD))],!0)])]))}});const tA=M(BD,[["__scopeId","data-v-778b82f1"]]);function ei(e,t){const n=t.value.find(a=>a.id===e);if(!n||n.sortDirection===be.NOT_SORTABLE)return null;const r=n.sortDirection;return yD(t),r===be.NEITHER?n.sortDirection=be.DOWN:r===be.DOWN?n.sortDirection=be.UP:n.sortDirection=be.DOWN,n}function yD(e){e.value.forEach(t=>{t.sortDirection!==be.NOT_SORTABLE&&(t.sortDirection=be.NEITHER)})}const wD=i.defineComponent({__name:"CardsTable",props:nD,emits:["sort-updated"],setup(e,{emit:t}){const n=e,{t:r}=se(),a=[{id:"card",isAlwaysShown:!0,isSortable:!1,title:r("general.card")},{id:"matches",isAlwaysShown:!1,isSortable:!0,title:r("general.matches")},{id:"winrate",isAlwaysShown:!1,isSortable:!0,title:r("general.winrate")},{id:"inclusion",isAlwaysShown:!1,isSortable:!0,title:r("general.inclusion")},{id:"avgCopies",isAlwaysShown:!1,isSortable:!0,title:r("general.avgCopies")},{id:"mulliganWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.mulliganWinrate")},{id:"keptInMulligan",isAlwaysShown:!1,isSortable:!0,title:r("general.keptInMulligan")},{id:"drawnWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.drawnWinrate")},{id:"turnsHeld",isAlwaysShown:!1,isSortable:!0,title:r("general.turnsHeld")},{id:"turnPlayed",isAlwaysShown:!1,isSortable:!0,title:r("general.turnPlayed")}];let A=!1;const s=i.ref(a.map(c=>{let u=be.NEITHER;return c.isSortable||(u=be.NOT_SORTABLE),!A&&c.isSortable&&(u=be.DOWN,A=!0),{id:c.id,isShown:n.cardsRowToggle[c.id],sortDirection:u,title:c.title}})),o=i.computed(()=>({"--table-grid-template-columns":`repeat(${Object.values(n.cardsRowToggle).reduce((u,d)=>d?u+1:u,0)}, 1fr)`}));function l(c){const u=ei(c,s);u&&t("sort-updated",u)}return(c,u)=>(i.openBlock(),i.createBlock(tA,{class:"large-table",loading:n.loading,"heading-items":s.value,style:i.normalizeStyle(o.value),onToggleSort:l},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.cardRows,(d,f)=>(i.openBlock(),i.createBlock(Ig,{key:d.cardCode+d.region,"card-code":d.cardCode,matches:d.matches,wins:d.wins,index:f+2,"avg-copies":d.avgCopies,"drawn-winrate":d.drawnWinrate,"kept-in-mulligan":d.keptInMulligan,"mulligan-winrate":d.mulliganWinrate,inclusion:d.inclusion,"turns-held":d.turnsHeld,"turn-played":d.turnPlayed,"toggled-stats":n.cardsRowToggle,region:d.region,"router-link":i.unref(nn)().callbacks.cardCodeRouterLinkCallback(d.cardCode)},null,8,["card-code","matches","wins","index","avg-copies","drawn-winrate","kept-in-mulligan","mulligan-winrate","inclusion","turns-held","turn-played","toggled-stats","region","router-link"]))),128))]),_:1},8,["loading","heading-items","style"]))}});const wb=M(wD,[["__scopeId","data-v-1894b267"]]),bD={regions:{type:Array,required:!0,default:[]}},_D={class:"deck-highlight-regions"},CD=i.defineComponent({__name:"DeckHighlightRegions",props:bD,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",_D,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.regions,a=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"region-item-wrapper"},[i.createVNode(qo,{class:"region-item","region-ref":a},null,8,["region-ref"])]))),128))]))}});const Xo=M(CD,[["__scopeId","data-v-d28f95f4"]]),ED={},kD={xmlns:"http://www.w3.org/2000/svg",viewBox:"215.7 48.9 276.9 496"},SD=i.createStaticVNode('<path fill="#146743" d="m271 136-54 90 150 316 14-50 29-312-51-130-88 86Z"></path><path fill="#419a4a" d="m356 121-75 105 86 316 14-50 29-312-54-59Z"></path><path fill="#baffb6" d="M410 180 359 50l-3 71 54 59Z"></path><path fill="#437f41" d="m359 50-88 86 10 90 75-105 3-71ZM281 360l86 182-86-316v134Z"></path><path fill="#419a4a" d="m454 332 28 33-33 85-4-13-8-85 17-20Z"></path>',5),xD=[SD];function FD(e,t){return i.openBlock(),i.createElementBlock("svg",kD,xD)}const Qg=M(ED,[["render",FD]]),ID={deck:{type:Object,required:!0,default:{}}},UD=e=>(i.pushScopeId("data-v-25f680e9"),e=e(),i.popScopeId(),e),QD={class:"gems-text"},TD={class:"gems-cost-title"},DD={class:"gems-cost-value"},LD=UD(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),OD={class:"gems-cost-title"},MD={class:"gems-cost-value"},ND=i.defineComponent({__name:"GemsCost",props:ID,setup(e){const t=e,{t:n}=se(),r=i.ref(null),a=i.ref(null),A=i.computed(()=>Yc(t.deck,!1)),s=i.computed(()=>Yc(t.deck,!0));return i.onMounted(()=>{At(r.value,{content:a.value,arrow:!0,duration:0})}),(o,l)=>{var c,u,d;return i.openBlock(),i.createElementBlock("div",{ref_key:"gemsCostDiv",ref:r,class:"gems-cost"},[i.createVNode(Qg,{class:"shards-icon"}),i.createElementVNode("div",QD,i.toDisplayString((c=s.value!==null?s.value:A.value)==null?void 0:c.toLocaleString()),1),i.createElementVNode("div",{ref_key:"gemsCostTippyDiv",ref:a,class:"gems-cost-tippy"},[s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",TD,i.toDisplayString(i.unref(n)("deck.personalCost")),1),i.createElementVNode("div",DD,i.toDisplayString((u=s.value)==null?void 0:u.toLocaleString()),1),LD],64)):i.createCommentVNode("",!0),i.createElementVNode("div",OD,i.toDisplayString(i.unref(n)("deck.originalCost")),1),i.createElementVNode("div",MD,i.toDisplayString((d=A.value)==null?void 0:d.toLocaleString()),1)],512)],512)}}});const Tg=M(ND,[["__scopeId","data-v-25f680e9"]]),PD={class:"language-selection"},HD=["value"],RD=i.defineComponent({__name:"LanguageSelection",setup(e){const t=i.ref(!1);function n(){t.value=!0}return(r,a)=>(i.openBlock(),i.createElementBlock("div",PD,[i.createVNode(i.unref(Ue),{ref:"languageIcon",icon:"language",class:"icon",onClick:n},null,512),i.createVNode(VA,{"show-modal":t.value,"onUpdate:showModal":a[1]||(a[1]=A=>t.value=A)},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=A=>r.$i18n.locale=A)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.$i18n.availableLocales,A=>(i.openBlock(),i.createElementBlock("option",{key:`locale-${A}`,value:A},i.toDisplayString(A),9,HD))),128))],512),[[i.vModelSelect,r.$i18n.locale]])]),_:1},8,["show-modal"])]))}});const Dg=M(RD,[["__scopeId","data-v-741580c8"]]),VD={cardCodes:{type:Array,required:!0,default:[]},regions:{type:Array,required:!0,default:[]}},bb={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},ignoreCardItem:{type:Boolean,required:!1},regions:{type:Array,required:!1,default:void 0},colorOverride:{type:String,required:!1,default:void 0}},KD={class:"circle-card-item"},$D=["alt","src"],WD=i.defineComponent({__name:"CircleCardItem",props:bb,setup(e){const t=e,n=Ro(t.cardProp,t.cardCodeProp,!0),r=i.ref(null),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.computed(()=>{var c;return"https://lor.gg/storage/cards/icon/"+((c=n.value)==null?void 0:c.cardCode)+"-icon.webp"}),l=i.computed(()=>n.value===void 0?"--color-primary-2":pA(n.value,t.regions));return i.onMounted(()=>{t.ignoreCardItem||At(r.value,{content:a.value,placement:"right",arrow:!0,touch:"hold",duration:0,role:"card-image",onShown:c=>{const u=c.popper.innerHTML.includes("right")?"right-start":"left-start";s.value=u},onHidden:()=>{s.value=null}})}),(c,u)=>{const d=i.resolveComponent("RouterLink");return i.openBlock(),i.createElementBlock("div",KD,[i.createVNode(d,{to:t.routerLink,class:"circle-card-link",onClick:u[0]||(u[0]=i.withModifiers(()=>{},["stop","prevent"]))},{default:i.withCtx(()=>{var f;return[i.createElementVNode("img",{ref_key:"circleCardImg",ref:r,alt:(f=i.unref(n))==null?void 0:f.name,src:o.value,class:"circle-card-img",style:i.normalizeStyle({borderColor:t.colorOverride??l.value})},null,12,$D)]}),_:1},8,["to"]),i.createElementVNode("div",{ref_key:"circleCardTippy",ref:a,class:"circle-card-tippy"},[!c.ignoreCardItem&&i.unref(n)?(i.openBlock(),i.createBlock(Wa,{key:0,ref_key:"cardItem",ref:A,"card-code-prop":i.unref(n).cardCode,"is-deck-builder":!1,"is-root":!0,"show-tippy-location":s.value},null,8,["card-code-prop","show-tippy-location"])):i.createCommentVNode("",!0)],512)])}}});const nA=M(WD,[["__scopeId","data-v-b1598a69"]]),GD={cards:{type:Array,required:!1,default:void 0},cardCodes:{type:Array,required:!1,default:void 0},regions:{type:Array,required:!1,default:[]}},zD={class:"deck-highlight-cards"},jD=i.defineComponent({__name:"DeckHighlightCards",props:GD,setup(e){const t=e,n=i.computed(()=>{if(t.cards)return t.cards;if(t.cardCodes)return t.cardCodes.map(r=>jt().cardJsonObject[r]).filter(r=>r!==void 0);throw new Error("Cards or CardCodes must be defined.")});return(r,a)=>(i.openBlock(),i.createElementBlock("div",zD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(A,s)=>(i.openBlock(),i.createElementBlock("div",{key:A.cardCode??s,class:"circle-card-item-wrapper"},[i.createVNode(nA,{class:"circle-card-item","card-prop":A,regions:t.regions,"router-link":i.unref(nn)().callbacks.cardCodeRouterLinkCallback(A.cardCode)},null,8,["card-prop","regions","router-link"])]))),128))]))}});const Jo=M(jD,[["__scopeId","data-v-021c3530"]]),YD=i.defineComponent({__name:"ArchetypeSidePanelHighlight",props:VD,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createBlock(mt,{class:"archetype-side-panel-highlight"},{default:i.withCtx(()=>[i.createVNode(Xo,{class:"deck-highlight-regions",regions:t.regions},null,8,["regions"]),i.createVNode(Jo,{class:i.normalizeClass(["deck-highlight-cards",t.cardCodes.length===1?"single":""]),"card-codes":t.cardCodes},null,8,["class","card-codes"])]),_:1}))}});const Zu=M(YD,[["__scopeId","data-v-ff538f6f"]]),qD={deckcode:{type:String,required:!0,default:""},filters:{type:Object,required:!0,default:{sampleSizeFilters:[],serverFilters:[],timeFilters:[]}}},XD={deckCode:{type:String,required:!0,default:""},info:{type:String,required:!0,default:"typeRef"}};/*!
811
811
  * @kurkle/color v0.3.2
812
812
  * https://github.com/kurkle/color#readme
813
813
  * (c) 2023 Jukka Kurkela
@@ -822,9 +822,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
822
822
  * https://www.chartjs.org
823
823
  * (c) 2023 Chart.js Contributors
824
824
  * Released under the MIT License
825
- */class OO{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,a){const A=n.listeners[a],s=n.duration;A.forEach(o=>o({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Qb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const A=r.items;let s=A.length-1,o=!1,l;for(;s>=0;--s)l=A[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),o=!0):(A[s]=A[A.length-1],A.pop());o&&(a.draw(),this._notify(a,r,t,"progress")),A.length||(r.running=!1,this._notify(a,r,t,"complete"),r.initial=!1),n+=A.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Mr=new OO;const xv="transparent",MO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=vv(e||xv),a=r.valid&&vv(t||xv);return a&&a.valid?a.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class NO{constructor(t,n,r,a){const A=n[r];a=tt([t.to,a,A,t.from]);const s=tt([t.from,A,a]);this._active=!0,this._fn=t.fn||MO[t.type||typeof s],this._easing=qi[t.easing]||qi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=a,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const a=this._target[this._prop],A=r-this._start,s=this._duration-A;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=A,this._loop=!!t.loop,this._to=tt([t.to,n,a,t.from]),this._from=tt([t.from,a,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,a=this._prop,A=this._from,s=this._loop,o=this._to;let l;if(this._active=A!==o&&(s||n<r),!this._active){this._target[a]=o,this._notify(!0);return}if(n<0){this._target[a]=A;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[a]=this._fn(A,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][n]()}}class jg{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ve(t))return;const n=Object.keys(dt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(a=>{const A=t[a];if(!ve(A))return;const s={};for(const o of n)s[o]=A[o];(Oe(A.properties)&&A.properties||[a]).forEach(o=>{(o===a||!r.has(o))&&r.set(o,s)})})}_animateOptions(t,n){const r=n.options,a=HO(t,r);if(!a)return[];const A=this._createAnimations(a,r);return r.$shared&&PO(t.options.$animations,r).then(()=>{t.options=r},()=>{}),A}_createAnimations(t,n){const r=this._properties,a=[],A=t.$animations||(t.$animations={}),s=Object.keys(n),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){a.push(...this._animateOptions(t,n));continue}const u=n[c];let d=A[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}A[c]=d=new NO(f,t,c,u),a.push(d)}return a}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Mr.add(this._chart,r),!0}}function PO(e,t){const n=[],r=Object.keys(t);for(let a=0;a<r.length;a++){const A=e[r[a]];A&&A.active()&&n.push(A.wait())}return Promise.all(n)}function HO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Fv(e,t){const n=e&&e.options||{},r=n.reverse,a=n.min===void 0?t:0,A=n.max===void 0?t:0;return{start:r?A:a,end:r?a:A}}function RO(e,t,n){if(n===!1)return!1;const r=Fv(e,n),a=Fv(t,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function VO(e){let t,n,r,a;return ve(e)?(t=e.top,n=e.right,r=e.bottom,a=e.left):t=n=r=a=e,{top:t,right:n,bottom:r,left:a,disabled:e===!1}}function Xb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let a,A;for(a=0,A=r.length;a<A;++a)n.push(r[a].index);return n}function Iv(e,t,n,r={}){const a=e.keys,A=r.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=a.length;s<o;++s){if(l=+a[s],l===n){if(r.all)continue;break}c=e.values[l],ut(c)&&(A||t===0||vr(t)===vr(c))&&(t+=c)}return t}}function KO(e){const t=Object.keys(e),n=new Array(t.length);let r,a,A;for(r=0,a=t.length;r<a;++r)A=t[r],n[r]={x:A,y:e[A]};return n}function Uv(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function $O(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function WO(e){const{min:t,max:n,minDefined:r,maxDefined:a}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}function GO(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Qv(e,t,n,r){for(const a of t.getMatchingVisibleMetas(r).reverse()){const A=e[a.index];if(n&&A>0||!n&&A<0)return a.index}return null}function Tv(e,t){const{chart:n,_cachedMeta:r}=e,a=n._stacks||(n._stacks={}),{iScale:A,vScale:s,index:o}=r,l=A.axis,c=s.axis,u=$O(A,s,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[l]:m,[c]:y}=p,g=p._stacks||(p._stacks={});f=g[c]=GO(a,u,m),f[o]=y,f._top=Qv(f,s,!0,r.type),f._bottom=Qv(f,s,!1,r.type);const v=f._visualValues||(f._visualValues={});v[o]=y}}function pf(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function zO(e,t){return rA(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function jO(e,t,n){return rA(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function fi(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const a of t){const A=a._stacks;if(!A||A[r]===void 0||A[r][n]===void 0)return;delete A[r][n],A[r]._visualValues!==void 0&&A[r]._visualValues[n]!==void 0&&delete A[r]._visualValues[n]}}}const gf=e=>e==="reset"||e==="none",Dv=(e,t)=>t?e:Object.assign({},e),YO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Xb(n,!0),values:null};class er{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Uv(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&fi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),a=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,A=n.xAxisID=de(r.xAxisID,pf(t,"x")),s=n.yAxisID=de(r.yAxisID,pf(t,"y")),o=n.rAxisID=de(r.rAxisID,pf(t,"r")),l=n.indexAxis,c=n.iAxisID=a(l,A,s,o),u=n.vAxisID=a(l,s,A,o);n.xScale=this.getScaleForId(A),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(o),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&pv(this._data,this),t._stacked&&fi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ve(n))this._data=KO(n);else if(r!==n){if(r){pv(r,this);const a=this._cachedMeta;fi(a),a._parsed=[]}n&&Object.isExtensible(n)&&DL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const A=n._stacked;n._stacked=Uv(n.vScale,n),n.stack!==r.stack&&(a=!0,fi(n),n.stack=r.stack),this._resyncElements(t),(a||A!==n._stacked)&&Tv(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:a}=this,{iScale:A,_stacked:s}=r,o=A.axis;let l=t===0&&n===a.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=a,r._sorted=!0,f=a;else{Oe(a[t])?f=this.parseArrayData(r,a,t,n):ve(a[t])?f=this.parseObjectData(r,a,t,n):f=this.parsePrimitiveData(r,a,t,n);const h=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&Tv(this,f)}parsePrimitiveData(t,n,r,a){const{iScale:A,vScale:s}=t,o=A.axis,l=s.axis,c=A.getLabels(),u=A===s,d=new Array(a);let f,h,p;for(f=0,h=a;f<h;++f)p=f+r,d[f]={[o]:u||A.parse(c[p],p),[l]:s.parse(n[p],p)};return d}parseArrayData(t,n,r,a){const{xScale:A,yScale:s}=t,o=new Array(a);let l,c,u,d;for(l=0,c=a;l<c;++l)u=l+r,d=n[u],o[l]={x:A.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,n,r,a){const{xScale:A,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(a);let u,d,f,h;for(u=0,d=a;u<d;++u)f=u+r,h=n[f],c[u]={x:A.parse(Ga(h,o),f),y:s.parse(Ga(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const a=this.chart,A=this._cachedMeta,s=n[t.axis],o={keys:Xb(a,!0),values:n._stacks[t.axis]._visualValues};return Iv(o,s,A.index,{mode:r})}updateRangeFromParsed(t,n,r,a){const A=r[n.axis];let s=A===null?NaN:A;const o=a&&r._stacks[n.axis];a&&o&&(a.values=o,s=Iv(a,A,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,a=r._parsed,A=r._sorted&&t===r.iScale,s=a.length,o=this._getOtherScale(t),l=YO(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=WO(o);let f,h;function p(){h=a[f];const m=h[o.axis];return!ut(h[t.axis])||u>m||d<m}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,h,l),A));++f);if(A){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let a,A,s;for(a=0,A=n.length;a<A;++a)s=n[a][t.axis],ut(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,a=n.vScale,A=this.getParsed(t);return{label:r?""+r.getLabelForValue(A[r.axis]):"",value:a?""+a.getLabelForValue(A[a.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=VO(de(this.options.clip,RO(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,a=r.data||[],A=n.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||a.length-o,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,A,o,l),u=o;u<o+l;++u){const d=a[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,A))}for(u=0;u<s.length;++u)s[u].draw(t,A)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const a=this.getDataset();let A;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];A=s.$context||(s.$context=jO(this.getContext(),t,s)),A.parsed=this.getParsed(t),A.raw=a.data[t],A.index=A.dataIndex=t}else A=this.$context||(this.$context=zO(this.chart.getContext(),this.index)),A.dataset=a,A.index=A.datasetIndex=this.index;return A.active=!!n,A.mode=r,A}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const a=n==="active",A=this._cachedDataOpts,s=t+"-"+n,o=A[s],l=this.enableOptionSharing&&vn(r);if(o)return Dv(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=a?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(dt.elements[t]),p=()=>this.getContext(r,a,n),m=c.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=l,A[s]=Object.freeze(Dv(m,l))),m}_resolveAnimations(t,n,r){const a=this.chart,A=this._cachedDataOpts,s=`animation-${n}`,o=A[s];if(o)return o;let l;if(a.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new jg(a,l&&l.animations);return l&&l._cacheable&&(A[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||gf(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),a=this._sharedOptions,A=this.getSharedOptions(r),s=this.includeOptions(n,A)||A!==a;return this.updateSharedOptions(A,n,r),{sharedOptions:A,includeOptions:s}}updateElement(t,n,r,a){gf(a)?Object.assign(t,r):this._resolveAnimations(n,a).update(t,r)}updateSharedOptions(t,n,r){t&&!gf(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,a){t.active=a;const A=this.getStyle(n,a);this._resolveAnimations(n,r,a).update(t,{options:!a&&this.getSharedOptions(A)||A})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const a=r.length,A=n.length,s=Math.min(A,a);s&&this.parse(0,s),A>a?this._insertElements(a,A-a,t):A<a&&this._removeElements(A,a-A)}_insertElements(t,n,r=!0){const a=this._cachedMeta,A=a.data,s=t+n;let o;const l=c=>{for(c.length+=n,o=c.length-1;o>=s;o--)c[o]=c[o-n]};for(l(A),o=t;o<s;++o)A[o]=new this.dataElementType;this._parsing&&l(a._parsed),this.parse(t,n),r&&this.updateElements(A,t,n,"reset")}updateElements(t,n,r,a){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(t,n);r._stacked&&fi(r,a)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,a]=t;this[n](r,a)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(er,"defaults",{}),R(er,"datasetElementType",null),R(er,"dataElementType",null);function qO(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let a=0,A=n.length;a<A;a++)r=r.concat(n[a].controller.getAllParsedValues(e));e._cache.$bar=Ub(r.sort((a,A)=>a-A))}return e._cache.$bar}function XO(e){const t=e.iScale,n=qO(t,e.type);let r=t._length,a,A,s,o;const l=()=>{s===32767||s===-32768||(vn(o)&&(r=Math.min(r,Math.abs(s-o)||r)),o=s)};for(a=0,A=n.length;a<A;++a)s=t.getPixelForValue(n[a]),l();for(o=void 0,a=0,A=t.ticks.length;a<A;++a)s=t.getPixelForTick(a),l();return r}function JO(e,t,n,r){const a=n.barThickness;let A,s;return _e(a)?(A=t.min*n.categoryPercentage,s=n.barPercentage):(A=a*r,s=1),{chunk:A/r,ratio:s,start:t.pixels[e]-A/2}}function ZO(e,t,n,r){const a=t.pixels,A=a[e];let s=e>0?a[e-1]:null,o=e<a.length-1?a[e+1]:null;const l=n.categoryPercentage;s===null&&(s=A-(o===null?t.end-t.start:o-A)),o===null&&(o=A+A-s);const c=A-(A-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/r,ratio:n.barPercentage,start:c}}function eM(e,t,n,r){const a=n.parse(e[0],r),A=n.parse(e[1],r),s=Math.min(a,A),o=Math.max(a,A);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:a,end:A,min:s,max:o}}function Jb(e,t,n,r){return Oe(e)?eM(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Lv(e,t,n,r){const a=e.iScale,A=e.vScale,s=a.getLabels(),o=a===A,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[a.axis]=o||a.parse(s[c],c),l.push(Jb(f,d,A,c));return l}function mf(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function tM(e,t,n){return e!==0?vr(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function nM(e){let t,n,r,a,A;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(a="end",A="start"):(a="start",A="end"),{start:n,end:r,reverse:t,top:a,bottom:A}}function rM(e,t,n,r){let a=t.borderSkipped;const A={};if(!a){e.borderSkipped=A;return}if(a===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=nM(e);a==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?a=c:(n._bottom||0)===r?a=u:(A[Ov(u,s,o,l)]=!0,a=c)),A[Ov(a,s,o,l)]=!0,e.borderSkipped=A}function Ov(e,t,n,r){return r?(e=aM(e,t,n),e=Mv(e,n,t)):e=Mv(e,t,n),e}function aM(e,t,n){return e===t?n:e===n?t:e}function Mv(e,t,n){return e==="start"?t:e==="end"?n:e}function AM(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Tc extends er{parsePrimitiveData(t,n,r,a){return Lv(t,n,r,a)}parseArrayData(t,n,r,a){return Lv(t,n,r,a)}parseObjectData(t,n,r,a){const{iScale:A,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=A.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,h,p,m;for(f=r,h=r+a;f<h;++f)m=n[f],p={},p[A.axis]=A.parse(Ga(m,c),f),d.push(Jb(Ga(m,u),p,s,f));return d}updateRangeFromParsed(t,n,r,a){super.updateRangeFromParsed(t,n,r,a);const A=r._custom;A&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,A.min),t.max=Math.max(t.max,A.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:a}=n,A=this.getParsed(t),s=A._custom,o=mf(s)?"["+s.start+", "+s.end+"]":""+a.getLabelForValue(A[a.axis]);return{label:""+r.getLabelForValue(A[r.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,a){const A=a==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,a);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=A||_e(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),g=(p._stacks||{})[o.axis],v={horizontal:c,base:m.base,enableBorderRadius:!g||mf(p._custom)||s===g._top||s===g._bottom,x:c?m.head:y.center,y:c?y.center:m.head,height:c?y.size:Math.abs(m.size),width:c?Math.abs(m.size):y.size};f&&(v.options=d||this.resolveDataElementOptions(h,t[h].active?"active":a));const _=v.options||t[h].options;rM(v,_,g,s),AM(v,_,u.ratio),this.updateElement(t[h],h,v,a)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),A=r.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(_e(u)||isNaN(u))return!0};for(const l of a)if(!(n!==void 0&&o(l))&&((A===!1||s.indexOf(l.stack)===-1||A===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const a=this._getStacks(t,r),A=n!==void 0?a.indexOf(n):-1;return A===-1?a.length-1:A}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,a=[];let A,s;for(A=0,s=n.data.length;A<s;++A)a.push(r.getPixelForValue(this.getParsed(A)[r.axis],A));const o=t.barThickness;return{min:o||XO(n),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:a},options:{base:A,minBarLength:s}}=this,o=A||0,l=this.getParsed(t),c=l._custom,u=mf(c);let d=l[n.axis],f=0,h=r?this.applyStack(n,l,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&vr(d)!==vr(c.barEnd)&&(f=0),f+=d);const y=!_e(A)&&!u?A:f;let g=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=g,m=p-g,Math.abs(m)<s){m=tM(m,n,o)*s,d===o&&(g-=m/2);const v=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),B=Math.min(v,_),b=Math.max(v,_);g=Math.max(Math.min(g,b),B),p=g+m,r&&!u&&(l._stacks[n.axis]._visualValues[a]=n.getValueForPixel(p)-n.getValueForPixel(g))}if(g===n.getPixelForValue(o)){const v=vr(m)*n.getLineWidthForValue(o)/2;g+=v,m-=v}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,a=this.options,A=a.skipNull,s=de(a.maxBarThickness,1/0);let o,l;if(n.grouped){const c=A?this._getStackCount(t):n.stackCount,u=a.barThickness==="flex"?ZO(t,n,a,c):JO(t,n,a,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,A?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,a=r.length;let A=0;for(;A<a;++A)this.getParsed(A)[n.axis]!==null&&r[A].draw(this._ctx)}}R(Tc,"id","bar"),R(Tc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(Tc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Dc extends er{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,a){const A=super.parsePrimitiveData(t,n,r,a);for(let s=0;s<A.length;s++)A[s]._custom=this.resolveDataElementOptions(s+r).radius;return A}parseArrayData(t,n,r,a){const A=super.parseArrayData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o[2],this.resolveDataElementOptions(s+r).radius)}return A}parseObjectData(t,n,r,a){const A=super.parseObjectData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o&&o.r&&+o.r,this.resolveDataElementOptions(s+r).radius)}return A}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,a),u=s.axis,d=o.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!A&&this.getParsed(f),m={},y=m[u]=A?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),g=m[d]=A?o.getBasePixel():o.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(g),c&&(m.options=l||this.resolveDataElementOptions(f,h.active?"active":a),A&&(m.options.radius=0)),this.updateElement(h,f,m,a)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let a=super.resolveDataElementOptions(t,n);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const A=a.radius;return n!=="active"&&(a.radius=0),a.radius+=de(r&&r._custom,A),a}}R(Dc,"id","bubble"),R(Dc,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(Dc,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function sM(e,t,n){let r=1,a=1,A=0,s=0;if(t<Xe){const o=e,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),h=(_,B,b)=>So(_,o,l,!0)?1:Math.max(B,B*n,b,b*n),p=(_,B,b)=>So(_,o,l,!0)?-1:Math.min(B,B*n,b,b*n),m=h(0,c,d),y=h(Je,u,f),g=p(Qe,c,d),v=p(Qe+Je,u,f);r=(m-g)/2,a=(y-v)/2,A=-(m+g)/2,s=-(y+v)/2}return{ratioX:r,ratioY:a,offsetX:A,offsetY:s}}class BA extends er{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let A=l=>+r[l];if(ve(r[t])){const{key:l="value"}=this._parsing;A=c=>+Ga(r[c],l)}let s,o;for(s=t,o=t+n;s<o;++s)a._parsed[s]=A(s)}}_getRotation(){return Et(this.options.rotation-90)}_getCircumference(){return Et(this.options.circumference)}_getRotationExtents(){let t=Xe,n=-Xe;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,A=a._getRotation(),s=a._getCircumference();t=Math.min(t,A),n=Math.max(n,A+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,a=this._cachedMeta,A=a.data,s=this.getMaxBorderWidth()+this.getMaxOffset(A)+this.options.spacing,o=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(wL(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=sM(d,u,l),y=(r.width-s)/f,g=(r.height-s)/h,v=Math.max(Math.min(y,g)/2,0),_=kb(this.options.radius,v),B=Math.max(_*l,0),b=(_-B)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,a.total=this.calculateTotal(),this.outerRadius=_-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*c,0),this.updateElements(A,0,A.length,t)}_circumference(t,n){const r=this.options,a=this._cachedMeta,A=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||a._parsed[t]===null||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*A/Xe)}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=A&&c.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,a);let g=this._getRotation(),v;for(v=0;v<n;++v)g+=this._circumference(v,A);for(v=n;v<n+r;++v){const _=this._circumference(v,A),B=t[v],b={x:u+this.offsetX,y:d+this.offsetY,startAngle:g,endAngle:g+_,circumference:_,outerRadius:p,innerRadius:h};y&&(b.options=m||this.resolveDataElementOptions(v,B.active?"active":a)),g+=_,this.updateElement(B,v,b,a)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,a;for(a=0;a<n.length;a++){const A=t._parsed[a];A!==null&&!isNaN(A)&&this.chart.getDataVisibility(a)&&!n[a].hidden&&(r+=Math.abs(A))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Xe*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=el(n._parsed[t],r.options.locale);return{label:a[t]||"",value:A}}getMaxBorderWidth(t){let n=0;const r=this.chart;let a,A,s,o,l;if(!t){for(a=0,A=r.data.datasets.length;a<A;++a)if(r.isDatasetVisible(a)){s=r.getDatasetMeta(a),t=s.data,o=s.controller;break}}if(!t)return 0;for(a=0,A=t.length;a<A;++a)l=o.resolveDataElementOptions(a),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,a=t.length;r<a;++r){const A=this.resolveDataElementOptions(r);n=Math.max(n,A.offset||0,A.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(BA,"id","doughnut"),R(BA,"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(BA,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(BA,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Lc extends er{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:a=[],_dataset:A}=n,s=this.chart._animationsDisabled;let{start:o,count:l}=Db(n,a,s);this._drawStart=o,this._drawCount=l,Lb(n)&&(o=0,l=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!A._decimated,r.points=a;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(a,o,l,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,a),f=s.axis,h=o.axis,{spanGaps:p,segment:m}=this.options,y=za(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||A||a==="none",v=n+r,_=t.length;let B=n>0&&this.getParsed(n-1);for(let b=0;b<_;++b){const w=t[b],C=g?w:{};if(b<n||b>=v){C.skip=!0;continue}const k=this.getParsed(b),S=_e(k[h]),T=C[f]=s.getPixelForValue(k[f],b),U=C[h]=A||S?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,k,l):k[h],b);C.skip=isNaN(T)||isNaN(U)||S,C.stop=b>0&&Math.abs(k[f]-B[f])>y,m&&(C.parsed=k,C.raw=c.data[b]),d&&(C.options=u||this.resolveDataElementOptions(b,w.active?"active":a)),g||this.updateElement(w,b,C,a),B=k}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,a=t.data||[];if(!a.length)return r;const A=a[0].size(this.resolveDataElementOptions(0)),s=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,A,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(Lc,"id","line"),R(Lc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(Lc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ji extends er{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=el(n._parsed[t].r,r.options.locale);return{label:a[t]||"",value:A}}parseObjectData(t,n,r,a){return Kb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,a)=>{const A=this.getParsed(a).r;!isNaN(A)&&this.chart.getDataVisibility(a)&&(A<n.min&&(n.min=A),A>n.max&&(n.max=A))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,a=Math.min(n.right-n.left,n.bottom-n.top),A=Math.max(a/2,0),s=Math.max(r.cutoutPercentage?A/100*r.cutoutPercentage:1,0),o=(A-s)/t.getVisibleDatasetCount();this.outerRadius=A-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*Qe;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,a,m);for(p=n;p<n+r;p++){const y=t[p];let g=h,v=h+this._computeAngle(p,a,m),_=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=v,A&&(l.animateScale&&(_=0),l.animateRotate&&(g=v=f));const B={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:g,endAngle:v,options:this.resolveDataElementOptions(p,y.active?"active":a)};this.updateElement(y,p,B,a)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,a)=>{!isNaN(this.getParsed(a).r)&&this.chart.getDataVisibility(a)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Et(this.resolveDataElementOptions(t,n).angle||r):0}}R(Ji,"id","polarArea"),R(Ji,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(Ji,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Oh extends BA{}R(Oh,"id","pie"),R(Oh,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Oc extends er{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,a){return Kb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta,r=n.dataset,a=n.data||[],A=n.iScale.getLabels();if(r.points=a,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:A.length===a.length,options:s};this.updateElement(r,void 0,o,t)}this.updateElements(a,0,a.length,t)}updateElements(t,n,r,a){const A=this._cachedMeta.rScale,s=a==="reset";for(let o=n;o<n+r;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":a),u=A.getPointPositionForValue(o,this.getParsed(o).r),d=s?A.xCenter:u.x,f=s?A.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,h,a)}}}R(Oc,"id","radar"),R(Oc,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Oc,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Mc extends er{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y);return{label:r[t]||"",value:"("+o+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,a=this.chart._animationsDisabled;let{start:A,count:s}=Db(n,r,a);if(this._drawStart=A,this._drawCount=s,Lb(n)&&(A=0,s=r.length),this.options.showLine){const{dataset:o,_dataset:l}=n;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!a,options:c},t)}this.updateElements(r,A,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,a),d=this.getSharedOptions(u),f=this.includeOptions(a,d),h=s.axis,p=o.axis,{spanGaps:m,segment:y}=this.options,g=za(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||A||a==="none";let _=n>0&&this.getParsed(n-1);for(let B=n;B<n+r;++B){const b=t[B],w=this.getParsed(B),C=v?b:{},k=_e(w[p]),S=C[h]=s.getPixelForValue(w[h],B),T=C[p]=A||k?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,w,l):w[p],B);C.skip=isNaN(S)||isNaN(T)||k,C.stop=B>0&&Math.abs(w[h]-_[h])>g,y&&(C.parsed=w,C.raw=c.data[B]),f&&(C.options=d||this.resolveDataElementOptions(B,b.active?"active":a)),v||this.updateElement(b,B,C,a),_=w}this.updateSharedOptions(d,a,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let o=0;for(let l=n.length-1;l>=0;--l)o=Math.max(o,n[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const r=t.dataset,a=r.options&&r.options.borderWidth||0;if(!n.length)return a;const A=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(a,A,s)/2}}R(Mc,"id","scatter"),R(Mc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(Mc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var iM=Object.freeze({__proto__:null,BarController:Tc,BubbleController:Dc,DoughnutController:BA,LineController:Lc,PieController:Oh,PolarAreaController:Ji,RadarController:Oc,ScatterController:Mc});function iA(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Yg{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(Yg.prototype,t)}init(){}formats(){return iA()}parse(){return iA()}format(){return iA()}add(){return iA()}diff(){return iA()}startOf(){return iA()}endOf(){return iA()}}var Zb={_date:Yg};function oM(e,t,n,r){const{controller:a,data:A,_sorted:s}=e,o=a._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&A.length){const l=o._reversePixels?QL:Wr;if(r){if(a._sharedOptions){const c=A[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(A,t,n-u),f=l(A,t,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(A,t,n)}return{lo:0,hi:A.length-1}}function rl(e,t,n,r,a){const A=e.getSortedVisibleDatasetMetas(),s=n[t];for(let o=0,l=A.length;o<l;++o){const{index:c,data:u}=A[o],{lo:d,hi:f}=oM(A[o],t,s,a);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,c,h)}}}function lM(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,a){const A=t?Math.abs(r.x-a.x):0,s=n?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(A,2)+Math.pow(s,2))}}function vf(e,t,n,r,a){const A=[];return!a&&!e.isPointInArea(t)||rl(e,n,t,function(o,l,c){!a&&!Gr(o,e.chartArea,0)||o.inRange(t.x,t.y,r)&&A.push({element:o,datasetIndex:l,index:c})},!0),A}function cM(e,t,n,r){let a=[];function A(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=Fb(s,{x:t.x,y:t.y});So(d,c,u)&&a.push({element:s,datasetIndex:o,index:l})}return rl(e,n,t,A),a}function uM(e,t,n,r,a,A){let s=[];const o=lM(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,a);if(r&&!h)return;const p=u.getCenterPoint(a);if(!(!!A||e.isPointInArea(p))&&!h)return;const y=o(t,p);y<l?(s=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:f})}return rl(e,n,t,c),s}function Bf(e,t,n,r,a,A){return!A&&!e.isPointInArea(t)?[]:n==="r"&&!r?cM(e,t,n,a):uM(e,t,n,r,a,A)}function Nv(e,t,n,r,a){const A=[],s=n==="x"?"inXRange":"inYRange";let o=!1;return rl(e,n,t,(l,c,u)=>{l[s](t[n],a)&&(A.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,a))}),r&&!o?[]:A}var dM={evaluateInteractionItems:rl,modes:{index(e,t,n,r){const a=dA(t,e),A=n.axis||"x",s=n.includeInvisible||!1,o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s),l=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const a=dA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;let o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s);if(o.length>0){const l=o[0].datasetIndex,c=e.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(e,t,n,r){const a=dA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return vf(e,a,A,r,s)},nearest(e,t,n,r){const a=dA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return Bf(e,a,A,n.intersect,r,s)},x(e,t,n,r){const a=dA(t,e);return Nv(e,a,"x",n.intersect,r)},y(e,t,n,r){const a=dA(t,e);return Nv(e,a,"y",n.intersect,r)}}};const e_=["left","top","right","bottom"];function hi(e,t){return e.filter(n=>n.pos===t)}function Pv(e,t){return e.filter(n=>e_.indexOf(n.pos)===-1&&n.box.axis===t)}function pi(e,t){return e.sort((n,r)=>{const a=t?r:n,A=t?n:r;return a.weight===A.weight?a.index-A.index:a.weight-A.weight})}function fM(e){const t=[];let n,r,a,A,s,o;for(n=0,r=(e||[]).length;n<r;++n)a=e[n],{position:A,options:{stack:s,stackWeight:o=1}}=a,t.push({index:n,box:a,pos:A,horizontal:a.isHorizontal(),weight:a.weight,stack:s&&A+s,stackWeight:o});return t}function hM(e){const t={};for(const n of e){const{stack:r,pos:a,stackWeight:A}=n;if(!r||!e_.includes(a))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=A}return t}function pM(e,t){const n=hM(e),{vBoxMaxWidth:r,hBoxMaxHeight:a}=t;let A,s,o;for(A=0,s=e.length;A<s;++A){o=e[A];const{fullSize:l}=o.box,c=n[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*r:l&&t.availableWidth,o.height=a):(o.width=r,o.height=u?u*a:l&&t.availableHeight)}return n}function gM(e){const t=fM(e),n=pi(t.filter(c=>c.box.fullSize),!0),r=pi(hi(t,"left"),!0),a=pi(hi(t,"right")),A=pi(hi(t,"top"),!0),s=pi(hi(t,"bottom")),o=Pv(t,"x"),l=Pv(t,"y");return{fullSize:n,leftAndTop:r.concat(A),rightAndBottom:a.concat(l).concat(s).concat(o),chartArea:hi(t,"chartArea"),vertical:r.concat(a).concat(l),horizontal:A.concat(s).concat(o)}}function Hv(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function t_(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function mM(e,t,n,r){const{pos:a,box:A}=n,s=e.maxPadding;if(!ve(a)){n.size&&(e[a]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?A.height:A.width),n.size=d.size/d.count,e[a]+=n.size}A.getPadding&&t_(s,A.getPadding());const o=Math.max(0,t.outerWidth-Hv(s,e,"left","right")),l=Math.max(0,t.outerHeight-Hv(s,e,"top","bottom")),c=o!==e.w,u=l!==e.h;return e.w=o,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function vM(e){const t=e.maxPadding;function n(r){const a=Math.max(t[r]-e[r],0);return e[r]+=a,a}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function BM(e,t){const n=t.maxPadding;function r(a){const A={left:0,top:0,right:0,bottom:0};return a.forEach(s=>{A[s]=Math.max(t[s],n[s])}),A}return r(e?["left","right"]:["top","bottom"])}function Fi(e,t,n,r){const a=[];let A,s,o,l,c,u;for(A=0,s=e.length,c=0;A<s;++A){o=e[A],l=o.box,l.update(o.width||t.w,o.height||t.h,BM(o.horizontal,t));const{same:d,other:f}=mM(t,n,o,r);c|=d&&a.length,u=u||f,l.fullSize||a.push(o)}return c&&Fi(a,t,n,r)||u}function $l(e,t,n,r,a){e.top=n,e.left=t,e.right=t+r,e.bottom=n+a,e.width=r,e.height=a}function Rv(e,t,n,r){const a=n.padding;let{x:A,y:s}=t;for(const o of e){const l=o.box,c=r[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;vn(c.start)&&(s=c.start),l.fullSize?$l(l,a.left,s,n.outerWidth-a.right-a.left,f):$l(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;vn(c.start)&&(A=c.start),l.fullSize?$l(l,A,a.top,f,n.outerHeight-a.bottom-a.top):$l(l,A,t.top+c.placed,f,d),c.start=A,c.placed+=d,A=l.right}}t.x=A,t.y=s}var Gt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const a=_t(e.options.layout.padding),A=Math.max(t-a.width,0),s=Math.max(n-a.height,0),o=gM(e.boxes),l=o.vertical,c=o.horizontal;Ve(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:A,availableHeight:s,vBoxMaxWidth:A/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},a);t_(f,_t(r));const h=Object.assign({maxPadding:f,w:A,h:s,x:a.left,y:a.top},a),p=pM(l.concat(c),d);Fi(o.fullSize,h,d,p),Fi(l,h,d,p),Fi(c,h,d,p)&&Fi(l,h,d,p),vM(h),Rv(o.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,Rv(o.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ve(o.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class n_{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,a){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,a?Math.floor(n/a):r)}}isAttached(t){return!0}updateConfig(t){}}class yM extends n_{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Nc="$chartjs",wM={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vv=e=>e===null||e==="";function bM(e,t){const n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e[Nc]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Vv(a)){const A=Cv(e,"width");A!==void 0&&(e.width=A)}if(Vv(r))if(e.style.height==="")e.height=e.width/(t||2);else{const A=Cv(e,"height");A!==void 0&&(e.height=A)}return e}const r_=EO?{passive:!0}:!1;function _M(e,t,n){e.addEventListener(t,n,r_)}function CM(e,t,n){e.canvas.removeEventListener(t,n,r_)}function EM(e,t){const n=wM[e.type]||e.type,{x:r,y:a}=dA(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:a!==void 0?a:null}}function fu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function kM(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||fu(o.addedNodes,r),s=s&&!fu(o.removedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function SM(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||fu(o.removedNodes,r),s=s&&!fu(o.addedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const xo=new Map;let Kv=0;function a_(){const e=window.devicePixelRatio;e!==Kv&&(Kv=e,xo.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function xM(e,t){xo.size||window.addEventListener("resize",a_),xo.set(e,t)}function FM(e){xo.delete(e),xo.size||window.removeEventListener("resize",a_)}function IM(e,t,n){const r=e.canvas,a=r&&zg(r);if(!a)return;const A=Tb((o,l)=>{const c=a.clientWidth;n(o,l),c<a.clientWidth&&n()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||A(c,u)});return s.observe(a),xM(e,A),s}function yf(e,t,n){n&&n.disconnect(),t==="resize"&&FM(e)}function UM(e,t,n){const r=e.canvas,a=Tb(A=>{e.ctx!==null&&n(EM(A,e))},e);return _M(r,t,a),a}class QM extends n_{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(bM(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Nc])return!1;const r=n[Nc].initial;["height","width"].forEach(A=>{const s=r[A];_e(s)?n.removeAttribute(A):n.setAttribute(A,s)});const a=r.style||{};return Object.keys(a).forEach(A=>{n.style[A]=a[A]}),n.width=n.width,delete n[Nc],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const a=t.$proxies||(t.$proxies={}),s={attach:kM,detach:SM,resize:IM}[n]||UM;a[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),a=r[n];if(!a)return;({attach:yf,detach:yf,resize:yf}[n]||CM)(t,n,a),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,a){return CO(t,n,r,a)}isAttached(t){const n=zg(t);return!!(n&&n.isConnected)}}function TM(e){return!Wb()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?yM:QM}var xc;let an=(xc=class{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return za(this.x)&&za(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const a={};return t.forEach(A=>{a[A]=r[A]&&r[A].active()?r[A]._to:this[A]}),a}},R(xc,"defaults",{}),R(xc,"defaultRoutes"),xc);function DM(e,t){const n=e.options.ticks,r=LM(e),a=Math.min(n.maxTicksLimit||r,r),A=n.major.enabled?MM(t):[],s=A.length,o=A[0],l=A[s-1],c=[];if(s>a)return NM(t,c,A,s/a),c;const u=OM(A,t,a);if(s>0){let d,f;const h=s>1?Math.round((l-o)/(s-1)):null;for(Wl(t,c,u,_e(h)?0:o-h,o),d=0,f=s-1;d<f;d++)Wl(t,c,u,A[d],A[d+1]);return Wl(t,c,u,l,_e(h)?t.length:l+h),c}return Wl(t,c,u),c}function LM(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),a=e._maxLength/n;return Math.floor(Math.min(r,a))}function OM(e,t,n){const r=PM(e),a=t.length/n;if(!r)return Math.max(a,1);const A=xL(r);for(let s=0,o=A.length-1;s<o;s++){const l=A[s];if(l>a)return l}return Math.max(a,1)}function MM(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function NM(e,t,n,r){let a=0,A=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===A&&(t.push(e[s]),a++,A=n[a*r])}function Wl(e,t,n,r,a){const A=de(r,0),s=Math.min(de(a,e.length),e.length);let o=0,l,c,u;for(n=Math.ceil(n),a&&(l=a-r,n=l/Math.floor(l/n)),u=A;u<0;)o++,u=Math.round(A+o*n);for(c=Math.max(A,0);c<s;c++)c===u&&(t.push(e[c]),o++,u=Math.round(A+o*n))}function PM(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const HM=e=>e==="left"?"right":e==="right"?"left":e,$v=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Wv=(e,t)=>Math.min(t||e,e);function Gv(e,t){const n=[],r=e.length/t,a=e.length;let A=0;for(;A<a;A+=r)n.push(e[Math.floor(A)]);return n}function RM(e,t,n){const r=e.ticks.length,a=Math.min(t,r-1),A=e._startPixel,s=e._endPixel,o=1e-6;let l=e.getPixelForTick(a),c;if(!(n&&(r===1?c=Math.max(l-A,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(a-1))/2,l+=a<t?c:-c,l<A-o||l>s+o)))return l}function VM(e,t){Ve(e,n=>{const r=n.gc,a=r.length/2;let A;if(a>t){for(A=0;A<a;++A)delete n.data[r[A]];r.splice(0,a)}})}function gi(e){return e.drawTicks?e.tickLength:0}function zv(e,t){if(!e.display)return 0;const n=ft(e.font,t),r=_t(e.padding);return(Oe(e.text)?e.text.length:1)*n.lineHeight+r.height}function KM(e,t){return rA(e,{scale:t,type:"scale"})}function $M(e,t,n){return rA(e,{tick:n,index:t,type:"tick"})}function WM(e,t,n){let r=Rg(e);return(n&&t!=="right"||!n&&t==="right")&&(r=HM(r)),r}function GM(e,t,n,r){const{top:a,left:A,bottom:s,right:o,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,p;const m=s-a,y=o-A;if(e.isHorizontal()){if(h=$t(r,A,o),ve(n)){const g=Object.keys(n)[0],v=n[g];p=u[g].getPixelForValue(v)+m-t}else n==="center"?p=(c.bottom+c.top)/2+m-t:p=$v(e,n,t);f=o-A}else{if(ve(n)){const g=Object.keys(n)[0],v=n[g];h=u[g].getPixelForValue(v)-y+t}else n==="center"?h=(c.left+c.right)/2-y+t:h=$v(e,n,t);p=$t(r,s,a),d=n==="left"?-Je:Je}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class $A extends an{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:a}=this;return t=wn(t,Number.POSITIVE_INFINITY),n=wn(n,Number.NEGATIVE_INFINITY),r=wn(r,Number.POSITIVE_INFINITY),a=wn(a,Number.NEGATIVE_INFINITY),{min:wn(t,r),max:wn(n,a),minDefined:ut(t),maxDefined:ut(n)}}getMinMax(t){let{min:n,max:r,minDefined:a,maxDefined:A}=this.getUserBounds(),s;if(a&&A)return{min:n,max:r};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),a||(n=Math.min(n,s.min)),A||(r=Math.max(r,s.max));return n=A&&n>r?r:n,r=a&&n>r?n:r,{min:wn(n,wn(r,n)),max:wn(r,wn(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){He(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:a,grace:A,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=nO(this,A,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Gv(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=DM(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){He(this.options.afterUpdate,[this])}beforeSetDimensions(){He(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(){He(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),He(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){He(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,a,A;for(r=0,a=t.length;r<a;r++)A=t[r],A.label=He(n.callback,[A.value,r,t],this)}afterTickToLabelConversion(){He(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){He(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Wv(this.ticks.length,t.ticks.maxTicksLimit),a=n.minRotation||0,A=n.maxRotation;let s=a,o,l,c;if(!this._isVisible()||!n.display||a>=A||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=Mt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/r:h/(r-1),d+6>o&&(o=h/(r-(t.offset?.5:1)),l=this.maxHeight-gi(t.grid)-n.padding-zv(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=ed(Math.min(Math.asin(Mt((u.highest.height+6)/o,-1,1)),Math.asin(Mt(l/c,-1,1))-Math.asin(Mt(f/c,-1,1)))),s=Math.max(a,Math.min(A,s))),this.labelRotation=s}afterCalculateLabelRotation(){He(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){He(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:a,grid:A}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=zv(a,n.options.font);if(o?(t.width=this.maxWidth,t.height=gi(A)+l):(t.height=this.maxHeight,t.width=gi(A)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=Et(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(o){const g=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+g+h)}else{const g=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+g+h)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),o?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,a){const{ticks:{align:A,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=a*t.width,h=r*n.height):(f=r*t.height,h=a*n.width):A==="start"?h=n.width:A==="end"?f=t.width:A!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;A==="start"?(u=0,d=t.height):A==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){He(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)_e(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Gv(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:a,_longestTextCache:A}=this,s=[],o=[],l=Math.floor(n/Wv(n,r));let c=0,u=0,d,f,h,p,m,y,g,v,_,B,b;for(d=0;d<n;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),a.font=y=m.string,g=A[y]=A[y]||{data:{},gc:[]},v=m.lineHeight,_=B=0,!_e(p)&&!Oe(p))_=uu(a,g.data,g.gc,_,p),B=v;else if(Oe(p))for(f=0,h=p.length;f<h;++f)b=p[f],!_e(b)&&!Oe(b)&&(_=uu(a,g.data,g.gc,_,b),B+=v);s.push(_),o.push(B),c=Math.max(_,c),u=Math.max(B,u)}VM(A,n);const w=s.indexOf(c),C=o.indexOf(u),k=S=>({width:s[S]||0,height:o[S]||0});return{first:k(0),last:k(n-1),widest:k(w),highest:k(C),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return UL(this._alignToPixels?sA(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=$M(this.getContext(),t,r))}return this.$context||(this.$context=KM(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Et(this.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),A=this._getLabelSizes(),s=t.autoSkipPadding||0,o=A?A.widest.width+s:0,l=A?A.highest.height+s:0;return this.isHorizontal()?l*r>o*a?o/r:l/a:l*a<o*r?l/r:o/a}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,a=this.options,{grid:A,position:s,border:o}=a,l=A.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=gi(A),h=[],p=o.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,g=function(j){return sA(r,j,m)};let v,_,B,b,w,C,k,S,T,U,F,Q;if(s==="top")v=g(this.bottom),C=this.bottom-f,S=v-y,U=g(t.top)+y,Q=t.bottom;else if(s==="bottom")v=g(this.top),U=t.top,Q=g(t.bottom)-y,C=v+y,S=this.top+f;else if(s==="left")v=g(this.right),w=this.right-f,k=v-y,T=g(t.left)+y,F=t.right;else if(s==="right")v=g(this.left),T=t.left,F=g(t.right)-y,w=v+y,k=this.left+f;else if(n==="x"){if(s==="center")v=g((t.top+t.bottom)/2+.5);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}U=t.top,Q=t.bottom,C=v+y,S=C+f}else if(n==="y"){if(s==="center")v=g((t.left+t.right)/2);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}w=v-y,k=w-f,T=t.left,F=t.right}const Y=de(a.ticks.maxTicksLimit,d),X=Math.max(1,Math.ceil(d/Y));for(_=0;_<d;_+=X){const j=this.getContext(_),K=A.setContext(j),oe=o.setContext(j),$=K.lineWidth,ae=K.color,ce=oe.dash||[],me=oe.dashOffset,Ee=K.tickWidth,fe=K.tickColor,ne=K.tickBorderDash||[],N=K.tickBorderDashOffset;B=RM(this,_,l),B!==void 0&&(b=sA(r,B,$),c?w=k=T=F=b:C=S=U=Q=b,h.push({tx1:w,ty1:C,tx2:k,ty2:S,x1:T,y1:U,x2:F,y2:Q,width:$,color:ae,borderDash:ce,borderDashOffset:me,tickWidth:Ee,tickColor:fe,tickBorderDash:ne,tickBorderDashOffset:N}))}return this._ticksLength=d,this._borderValue=v,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:a,ticks:A}=r,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=A,f=gi(r.grid),h=f+u,p=d?-u:h,m=-Et(this.labelRotation),y=[];let g,v,_,B,b,w,C,k,S,T,U,F,Q="middle";if(a==="top")w=this.bottom-p,C=this._getXAxisLabelAlignment();else if(a==="bottom")w=this.top+p,C=this._getXAxisLabelAlignment();else if(a==="left"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,b=X.x}else if(a==="right"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,b=X.x}else if(n==="x"){if(a==="center")w=(t.top+t.bottom)/2+h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];w=this.chart.scales[X].getPixelForValue(j)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(a==="center")b=(t.left+t.right)/2-h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];b=this.chart.scales[X].getPixelForValue(j)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const Y=this._getLabelSizes();for(g=0,v=o.length;g<v;++g){_=o[g],B=_.label;const X=A.setContext(this.getContext(g));k=this.getPixelForTick(g)+A.labelOffset,S=this._resolveTickFontOptions(g),T=S.lineHeight,U=Oe(B)?B.length:1;const j=U/2,K=X.color,oe=X.textStrokeColor,$=X.textStrokeWidth;let ae=C;s?(b=k,C==="inner"&&(g===v-1?ae=this.options.reverse?"left":"right":g===0?ae=this.options.reverse?"right":"left":ae="center"),a==="top"?c==="near"||m!==0?F=-U*T+T/2:c==="center"?F=-Y.highest.height/2-j*T+T:F=-Y.highest.height+T/2:c==="near"||m!==0?F=T/2:c==="center"?F=Y.highest.height/2-j*T:F=Y.highest.height-U*T,d&&(F*=-1),m!==0&&!X.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(w=k,F=(1-U)*T/2);let ce;if(X.showLabelBackdrop){const me=_t(X.backdropPadding),Ee=Y.heights[g],fe=Y.widths[g];let ne=F-me.top,N=0-me.left;switch(Q){case"middle":ne-=Ee/2;break;case"bottom":ne-=Ee;break}switch(C){case"center":N-=fe/2;break;case"right":N-=fe;break}ce={left:N,top:ne,width:fe+me.width,height:Ee+me.height,color:X.backdropColor}}y.push({label:B,font:S,textOffset:F,options:{rotation:m,color:K,strokeColor:oe,strokeWidth:$,textAlign:ae,textBaseline:Q,translation:[b,w],backdrop:ce}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Et(this.labelRotation))return t==="top"?"left":"right";let a="center";return n.align==="start"?a="left":n.align==="end"?a="right":n.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:a,padding:A}}=this.options,s=this._getLabelSizes(),o=t+A,l=s.widest.width;let c,u;return n==="left"?a?(u=this.right+A,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?a?(u=this.left+A,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:a,width:A,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,a,A,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const a=this.ticks.findIndex(A=>A.value===t);return a>=0?n.setContext(this.getContext(a)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let A,s;const o=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(A=0,s=a.length;A<s;++A){const l=a[A];n.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:a}}=this,A=r.setContext(this.getContext()),s=r.display?A.width:0;if(!s)return;const o=a.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=sA(t,this.left,s)-s/2,u=sA(t,this.right,o)+o/2,d=f=l):(d=sA(t,this.top,s)-s/2,f=sA(t,this.bottom,o)+o/2,c=u=l),n.save(),n.lineWidth=A.width,n.strokeStyle=A.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&tl(r,a);const A=this.getLabelItems(t);for(const s of A){const o=s.options,l=s.font,c=s.label,u=s.textOffset;OA(r,c,0,u,l,o)}a&&nl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:a}}=this;if(!r.display)return;const A=ft(r.font),s=_t(r.padding),o=r.align;let l=A.lineHeight/2;n==="bottom"||n==="center"||ve(n)?(l+=s.bottom,Oe(r.text)&&(l+=A.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=GM(this,l,n,o);OA(t,r.text,0,0,A,{color:r.color,maxWidth:d,rotation:f,textAlign:WM(o,n,a),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=de(t.grid&&t.grid.z,-1),a=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$A.prototype.draw?[{z:n,draw:A=>{this.draw(A)}}]:[{z:r,draw:A=>{this.drawBackground(),this.drawGrid(A),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:n,draw:A=>{this.drawLabels(A)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let A,s;for(A=0,s=n.length;A<s;++A){const o=n[A];o[r]===this.id&&(!t||o.type===t)&&a.push(o)}return a}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ft(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Gl{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;YM(n)&&(r=this.register(n));const a=this.items,A=t.id,s=this.scope+"."+A;if(!A)throw new Error("class does not have id: "+t);return A in a||(a[A]=t,zM(t,s,r),this.override&&dt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,a=this.scope;r in n&&delete n[r],a&&r in dt[a]&&(delete dt[a][r],this.override&&delete LA[r])}}function zM(e,t,n){const r=wr(Object.create(null),[n?dt.get(n):{},dt.get(t),e.defaults]);dt.set(t,r),e.defaultRoutes&&jM(t,e.defaultRoutes),e.descriptors&&dt.describe(t,e.descriptors)}function jM(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),a=r.pop(),A=[e].concat(r).join("."),s=t[n].split("."),o=s.pop(),l=s.join(".");dt.route(A,a,l,o)})}function YM(e){return"id"in e&&"defaults"in e}class qM{constructor(){this.controllers=new Gl(er,"datasets",!0),this.elements=new Gl(an,"elements"),this.plugins=new Gl(Object,"plugins"),this.scales=new Gl($A,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(a=>{const A=r||this._getRegistryForType(a);r||A.isForType(a)||A===this.plugins&&a.id?this._exec(t,A,a):Ve(a,s=>{const o=r||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,n,r){const a=Ng(t);He(r["before"+a],[],r),n[t](r),He(r["after"+a],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const a=n.get(t);if(a===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return a}}var ur=new qM;class XM{constructor(){this._init=[]}notify(t,n,r,a){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const A=a?this._descriptors(t).filter(a):this._descriptors(t),s=this._notify(A,t,n,r);return n==="afterDestroy"&&(this._notify(A,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,a){a=a||{};for(const A of t){const s=A.plugin,o=s[r],l=[n,a,A.options];if(He(o,l,s)===!1&&a.cancelable)return!1}return!0}invalidate(){_e(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,a=de(r.options&&r.options.plugins,{}),A=JM(r);return a===!1&&!n?[]:e7(t,A,a,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,a=(A,s)=>A.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(a(n,r),t,"stop"),this._notify(a(r,n),t,"start")}}function JM(e){const t={},n=[],r=Object.keys(ur.plugins.items);for(let A=0;A<r.length;A++)n.push(ur.getPlugin(r[A]));const a=e.plugins||[];for(let A=0;A<a.length;A++){const s=a[A];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function ZM(e,t){return!t&&e===!1?null:e===!0?{}:e}function e7(e,{plugins:t,localIds:n},r,a){const A=[],s=e.getContext();for(const o of t){const l=o.id,c=ZM(r[l],a);c!==null&&A.push({plugin:o,options:t7(e.config,{plugin:o,local:n[l]},c,s)})}return A}function t7(e,{plugin:t,local:n},r,a){const A=e.pluginScopeKeys(t),s=e.getOptionScopes(r,A);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mh(e,t){const n=dt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function n7(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function r7(e,t){return e===t?"_index_":"_value_"}function jv(e){if(e==="x"||e==="y"||e==="r")return e}function a7(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Nh(e,...t){if(jv(e))return e;for(const n of t){const r=n.axis||a7(n.position)||e.length>1&&jv(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Yv(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function A7(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Yv(e,"x",n[0])||Yv(e,"y",n[0])}return{}}function s7(e,t){const n=LA[e.type]||{scales:{}},r=t.scales||{},a=Mh(e.type,t),A=Object.create(null);return Object.keys(r).forEach(s=>{const o=r[s];if(!ve(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Nh(s,o,A7(s,e),dt.scales[o.type]),c=r7(l,a),u=n.scales||{};A[s]=ji(Object.create(null),[{axis:l},o,u[l],u[c]])}),e.data.datasets.forEach(s=>{const o=s.type||e.type,l=s.indexAxis||Mh(o,t),u=(LA[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=n7(d,l),h=s[f+"AxisID"]||f;A[h]=A[h]||Object.create(null),ji(A[h],[{axis:f},r[h],u[d]])})}),Object.keys(A).forEach(s=>{const o=A[s];ji(o,[dt.scales[o.type],dt.scale])}),A}function A_(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=s7(e,t)}function s_(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function i7(e){return e=e||{},e.data=s_(e.data),A_(e),e}const qv=new Map,i_=new Set;function zl(e,t){let n=qv.get(e);return n||(n=t(),qv.set(e,n),i_.add(n)),n}const mi=(e,t,n)=>{const r=Ga(t,n);r!==void 0&&e.add(r)};class o7{constructor(t){this._config=i7(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=s_(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),A_(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return zl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return zl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return zl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return zl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let a=r.get(t);return(!a||n)&&(a=new Map,r.set(t,a)),a}getOptionScopes(t,n,r){const{options:a,type:A}=this,s=this._cachedScopes(t,r),o=s.get(n);if(o)return o;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>mi(l,t,d))),u.forEach(d=>mi(l,a,d)),u.forEach(d=>mi(l,LA[A]||{},d)),u.forEach(d=>mi(l,dt,d)),u.forEach(d=>mi(l,Dh,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),i_.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,LA[n]||{},dt.datasets[n]||{},{type:n},dt,Dh]}resolveNamedOptions(t,n,r,a=[""]){const A={$shared:!0},{resolver:s,subPrefixes:o}=Xv(this._resolverCache,t,a);let l=s;if(c7(s,n)){A.$shared=!1,r=mn(r)?r():r;const c=this.createResolver(t,r,o);l=Vs(s,r,c)}for(const c of n)A[c]=l[c];return A}createResolver(t,n,r=[""],a){const{resolver:A}=Xv(this._resolverCache,t,r);return ve(n)?Vs(A,n,void 0,a):A}}function Xv(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const a=n.join();let A=r.get(a);return A||(A={resolver:$g(t,n),subPrefixes:n.filter(o=>!o.toLowerCase().includes("hover"))},r.set(a,A)),A}const l7=e=>ve(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||mn(e[n]),!1);function c7(e,t){const{isScriptable:n,isIndexable:r}=Pb(e);for(const a of t){const A=n(a),s=r(a),o=(s||A)&&e[a];if(A&&(mn(o)||l7(o))||s&&Oe(o))return!0}return!1}var u7="4.3.0";const d7=["top","bottom","left","right","chartArea"];function Jv(e,t){return e==="top"||e==="bottom"||d7.indexOf(e)===-1&&t==="x"}function Zv(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function eB(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),He(n&&n.onComplete,[e],t)}function f7(e){const t=e.chart,n=t.options.animation;He(n&&n.onProgress,[e],t)}function o_(e){return Wb()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Pc={},tB=e=>{const t=o_(e);return Object.values(Pc).filter(n=>n.canvas===t).pop()};function h7(e,t,n){const r=Object.keys(e);for(const a of r){const A=+a;if(A>=t){const s=e[a];delete e[a],(n>0||A>t)&&(e[A+n]=s)}}}function p7(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function g7(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}class Le{static register(...t){ur.add(...t),nB()}static unregister(...t){ur.remove(...t),nB()}constructor(t,n){const r=this.config=new o7(n),a=o_(t),A=tB(a);if(A)throw new Error("Canvas is already in use. Chart with ID '"+A.id+"' must be destroyed before the canvas with ID '"+A.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||TM(a)),this.platform.updateConfig(r);const o=this.platform.acquireContext(a,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=yL(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,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 XM,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=LL(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Pc[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Mr.listen(this,"complete",eB),Mr.listen(this,"progress",f7),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:a,_aspectRatio:A}=this;return _e(t)?n&&A?A:a?r/a:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ur}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_v(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return yv(this.canvas,this.ctx),this}stop(){return Mr.stop(this),this}resize(t,n){Mr.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,a=this.canvas,A=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(a,t,n,A),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,_v(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),He(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ve(n,(r,a)=>{r.id=a})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,a=Object.keys(r).reduce((s,o)=>(s[o]=!1,s),{});let A=[];n&&(A=A.concat(Object.keys(n).map(s=>{const o=n[s],l=Nh(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ve(A,s=>{const o=s.options,l=o.id,c=Nh(l,o),u=de(o.type,s.dtype);(o.position===void 0||Jv(o.position,c)!==Jv(s.dposition))&&(o.position=s.dposition),a[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=ur.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(o,t)}),Ve(a,(s,o)=>{s||delete r[o]}),Ve(r,s=>{Gt.configure(this,s,s.options),Gt.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((a,A)=>a.index-A.index),r>n){for(let a=n;a<r;++a)this._destroyDatasetMeta(a);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Zv("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,a)=>{n.filter(A=>A===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=n.length;r<a;r++){const A=n[r];let s=this.getDatasetMeta(r);const o=A.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=o,s.indexAxis=A.indexAxis||Mh(o,this.options),s.order=A.order||0,s.index=r,s.label=""+A.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=ur.getController(o),{datasetElementType:c,dataElementType:u}=dt.datasets[o];Object.assign(l,{dataElementType:ur.getElement(u),datasetElementType:c&&ur.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Ve(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const A=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!a&&A.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),a||Ve(A,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Zv("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Ve(this.scales,t=>{Gt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!dv(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:A}of n){const s=r==="_removeElements"?-A:A;h7(t,a,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=A=>new Set(t.filter(s=>s[0]===A).map((s,o)=>o+","+s.splice(1).join(","))),a=r(0);for(let A=1;A<n;A++)if(!dv(a,r(A)))return;return Array.from(a).map(A=>A.split(",")).map(A=>({method:A[1],start:+A[2],count:+A[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Gt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ve(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,A)=>{a._idx=A}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,mn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),a={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(n),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Mr.has(this)?this.attached&&!Mr.running(this)&&Mr.start(this):(this.draw(),eB({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resize(r,a),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let a,A;for(a=0,A=n.length;a<A;++a){const s=n[a];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,a=!r.disabled,A=g7(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(a&&tl(n,{left:r.left===!1?0:A.left-r.left,right:r.right===!1?this.width:A.right+r.right,top:r.top===!1?0:A.top-r.top,bottom:r.bottom===!1?this.height:A.bottom+r.bottom}),t.controller.draw(),a&&nl(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Gr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,a){const A=dM.modes[n];return typeof A=="function"?A(this,t,r,a):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let a=r.filter(A=>A&&A._dataset===n).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=rA(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const a=r?"show":"hide",A=this.getDatasetMeta(t),s=A.controller._resolveAnimations(void 0,a);vn(n)?(A.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(A,{visible:r}),this.update(o=>o.datasetIndex===t?a:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Mr.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),yv(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Pc[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(A,s)=>{n.addEventListener(this,A,s),t[A]=s},a=(A,s,o)=>{A.offsetX=s,A.offsetY=o,this._eventHandler(A)};Ve(this.options.events,A=>r(A,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},a=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},A=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{a("attach",o),this.attached=!0,this.resize(),r("resize",A),r("detach",s)};s=()=>{this.attached=!1,a("resize",A),this._stop(),this._resize(0,0),r("attach",o)},n.isAttached(this.canvas)?o():s()}unbindEvents(){Ve(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ve(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const a=r?"set":"remove";let A,s,o,l;for(n==="dataset"&&(A=this.getDatasetMeta(t[0].datasetIndex),A.controller["_"+a+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[a+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:A,index:s})=>{const o=this.getDatasetMeta(A);if(!o)throw new Error("No dataset found at index "+A);return{datasetIndex:A,element:o.data[s],index:s}});!iu(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const a=this.options.hover,A=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=A(n,t),o=r?t:A(t,n);s.length&&this.updateHoverStyle(s,a.mode,!1),o.length&&a.mode&&this.updateHoverStyle(o,a.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},a=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const A=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(A||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:a=[],options:A}=this,s=n,o=this._getActiveElements(t,a,r,s),l=kL(t),c=p7(t,this._lastEvent,r,l);r&&(this._lastEvent=null,He(A.onHover,[t,o,this],this),l&&He(A.onClick,[t,o,this],this));const u=!iu(o,a);return(u||n)&&(this._active=o,this._updateHoverStyles(o,a,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,a){if(t.type==="mouseout")return[];if(!r)return n;const A=this.options.hover;return this.getElementsAtEventForMode(t,A.mode,A,a)}}R(Le,"defaults",dt),R(Le,"instances",Pc),R(Le,"overrides",LA),R(Le,"registry",ur),R(Le,"version",u7),R(Le,"getChart",tB);function nB(){return Ve(Le.instances,e=>e._plugins.invalidate())}function m7(e,t,n){const{startAngle:r,pixelMargin:a,x:A,y:s,outerRadius:o,innerRadius:l}=t;let c=a/o;e.beginPath(),e.arc(A,s,o,r-c,n+c),l>a?(c=a/l,e.arc(A,s,l,n+c,r-c,!0)):e.arc(A,s,a,n+Je,r-Je),e.closePath(),e.clip()}function v7(e){return Kg(e,["outerStart","outerEnd","innerStart","innerEnd"])}function B7(e,t,n,r){const a=v7(e.options.borderRadius),A=(n-t)/2,s=Math.min(A,r*t/2),o=l=>{const c=(n-Math.min(A,l))*r/2;return Mt(l,0,Math.min(A,c))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:Mt(a.innerStart,0,s),innerEnd:Mt(a.innerEnd,0,s)}}function rs(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function hu(e,t,n,r,a,A){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let h=0;const p=a-l;if(r){const X=u>0?u-r:0,j=d>0?d-r:0,K=(X+j)/2,oe=K!==0?p*K/(K+r):p;h=(p-oe)/2}const m=Math.max(.001,p*d-n/Qe)/d,y=(p-m)/2,g=l+y+h,v=a-y-h,{outerStart:_,outerEnd:B,innerStart:b,innerEnd:w}=B7(t,f,d,v-g),C=d-_,k=d-B,S=g+_/C,T=v-B/k,U=f+b,F=f+w,Q=g+b/U,Y=v-w/F;if(e.beginPath(),A){const X=(S+T)/2;if(e.arc(s,o,d,S,X),e.arc(s,o,d,X,T),B>0){const $=rs(k,T,s,o);e.arc($.x,$.y,B,T,v+Je)}const j=rs(F,v,s,o);if(e.lineTo(j.x,j.y),w>0){const $=rs(F,Y,s,o);e.arc($.x,$.y,w,v+Je,Y+Math.PI)}const K=(v-w/f+(g+b/f))/2;if(e.arc(s,o,f,v-w/f,K,!0),e.arc(s,o,f,K,g+b/f,!0),b>0){const $=rs(U,Q,s,o);e.arc($.x,$.y,b,Q+Math.PI,g-Je)}const oe=rs(C,g,s,o);if(e.lineTo(oe.x,oe.y),_>0){const $=rs(C,S,s,o);e.arc($.x,$.y,_,g-Je,S)}}else{e.moveTo(s,o);const X=Math.cos(S)*d+s,j=Math.sin(S)*d+o;e.lineTo(X,j);const K=Math.cos(T)*d+s,oe=Math.sin(T)*d+o;e.lineTo(K,oe)}e.closePath()}function y7(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o}=t;let l=t.endAngle;if(A){hu(e,t,n,r,l,a);for(let c=0;c<A;++c)e.fill();isNaN(o)||(l=s+(o%Xe||Xe))}return hu(e,t,n,r,l,a),e.fill(),l}function w7(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(A){hu(e,t,n,r,p,a);for(let m=0;m<A;++m)e.stroke();isNaN(o)||(p=s+(o%Xe||Xe))}h&&m7(e,t,p),A||(hu(e,t,n,r,p,a),e.stroke())}class ys extends an{constructor(n){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,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.getProps(["x","y"],a),{angle:s,distance:o}=Fb(A,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,m=de(f,c-l)>=Xe||So(s,l,c),y=$r(o,u+h,d+h);return m&&y}getCenterPoint(n){const{x:r,y:a,startAngle:A,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(A+s)/2,f=(o+l+u+c)/2;return{x:r+Math.cos(d)*f,y:a+Math.sin(d)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:a}=this,A=(r.offset||0)/4,s=(r.spacing||0)/2,o=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>Xe?Math.floor(a/Xe):0,a===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*A,Math.sin(l)*A);const c=1-Math.sin(Math.min(Qe,a||0)),u=A*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,y7(n,this,u,s,o),w7(n,this,u,s,o),n.restore()}}R(ys,"id","arc"),R(ys,"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(ys,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(ys,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function l_(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function b7(e,t,n){e.lineTo(n.x,n.y)}function _7(e){return e.stepped?zL:e.tension||e.cubicInterpolationMode==="monotone"?jL:b7}function c_(e,t,n={}){const r=e.length,{start:a=0,end:A=r-1}=n,{start:s,end:o}=t,l=Math.max(a,s),c=Math.min(A,o),u=a<s&&A<s||a>o&&A>o;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function C7(e,t,n,r){const{points:a,options:A}=t,{count:s,start:o,loop:l,ilen:c}=c_(a,n,r),u=_7(A);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=c;++h)p=a[(o+(f?c-h:h))%s],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,A.stepped),m=p);return l&&(p=a[(o+(f?c:0))%s],u(e,m,p,f,A.stepped)),!!l}function E7(e,t,n,r){const a=t.points,{count:A,start:s,ilen:o}=c_(a,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,p,m,y,g;const v=B=>(s+(c?o-B:B))%A,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,g))};for(l&&(h=a[v(0)],e.moveTo(h.x,h.y)),f=0;f<=o;++f){if(h=a[v(f)],h.skip)continue;const B=h.x,b=h.y,w=B|0;w===p?(b<m?m=b:b>y&&(y=b),u=(d*u+B)/++d):(_(),e.lineTo(B,b),p=w,d=0,m=y=b),g=b}_()}function Ph(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?E7:C7}function k7(e){return e.stepped?kO:e.tension||e.cubicInterpolationMode==="monotone"?SO:fA}function S7(e,t,n,r){let a=t._path;a||(a=t._path=new Path2D,t.path(a,n,r)&&a.closePath()),l_(e,t.options),e.stroke(a)}function x7(e,t,n,r){const{segments:a,options:A}=t,s=Ph(t);for(const o of a)l_(e,A,o.style),e.beginPath(),s(e,t,o,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const F7=typeof Path2D=="function";function I7(e,t,n,r){F7&&!t.options.segment?S7(e,t,n,r):x7(e,t,n,r)}class ka extends an{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;vO(this._points,r,t,a,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=TO(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,a=t[n],A=this.points,s=qb(this,{property:n,start:a,end:a});if(!s.length)return;const o=[],l=k7(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],h=A[d],p=A[f];if(h===p){o.push(h);continue}const m=Math.abs((a-h[n])/(p[n]-h[n])),y=l(h,p,m,r.stepped);y[n]=t[n],o.push(y)}return o.length===1?o[0]:o}pathSegment(t,n,r){return Ph(this)(t,this,n,r)}path(t,n,r){const a=this.segments,A=Ph(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const o of a)s&=A(t,this,o,{start:n,end:n+r-1});return!!s}draw(t,n,r,a){const A=this.options||{};(this.points||[]).length&&A.borderWidth&&(t.save(),I7(t,this,r,a),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(ka,"id","line"),R(ka,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(ka,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(ka,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function rB(e,t,n,r){const a=e.options,{[n]:A}=e.getProps([n],r);return Math.abs(t-A)<a.radius+a.hitRadius}class Zi extends an{constructor(n){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,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.options,{x:s,y:o}=this.getProps(["x","y"],a);return Math.pow(n-s,2)+Math.pow(r-o,2)<Math.pow(A.hitRadius+A.radius,2)}inXRange(n,r){return rB(this,n,"x",r)}inYRange(n,r){return rB(this,n,"y",r)}getCenterPoint(n){const{x:r,y:a}=this.getProps(["x","y"],n);return{x:r,y:a}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const a=r&&n.borderWidth||0;return(r+a)*2}draw(n,r){const a=this.options;this.skip||a.radius<.1||!Gr(this,r,this.size(a)/2)||(n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.fillStyle=a.backgroundColor,Lh(n,a,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(Zi,"id","point"),R(Zi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(Zi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function u_(e,t){const{x:n,y:r,base:a,width:A,height:s}=e.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return e.horizontal?(d=s/2,o=Math.min(n,a),l=Math.max(n,a),c=r-d,u=r+d):(d=A/2,o=n-d,l=n+d,c=Math.min(r,a),u=Math.max(r,a)),{left:o,top:c,right:l,bottom:u}}function Sa(e,t,n,r){return e?0:Mt(t,n,r)}function U7(e,t,n){const r=e.options.borderWidth,a=e.borderSkipped,A=Nb(r);return{t:Sa(a.top,A.top,0,n),r:Sa(a.right,A.right,0,t),b:Sa(a.bottom,A.bottom,0,n),l:Sa(a.left,A.left,0,t)}}function Q7(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),a=e.options.borderRadius,A=Da(a),s=Math.min(t,n),o=e.borderSkipped,l=r||ve(a);return{topLeft:Sa(!l||o.top||o.left,A.topLeft,0,s),topRight:Sa(!l||o.top||o.right,A.topRight,0,s),bottomLeft:Sa(!l||o.bottom||o.left,A.bottomLeft,0,s),bottomRight:Sa(!l||o.bottom||o.right,A.bottomRight,0,s)}}function T7(e){const t=u_(e),n=t.right-t.left,r=t.bottom-t.top,a=U7(e,n/2,r/2),A=Q7(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:A},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,A.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,A.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,A.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,A.bottomRight-Math.max(a.b,a.r))}}}}function wf(e,t,n,r){const a=t===null,A=n===null,o=e&&!(a&&A)&&u_(e,r);return o&&(a||$r(t,o.left,o.right))&&(A||$r(n,o.top,o.bottom))}function D7(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function L7(e,t){e.rect(t.x,t.y,t.w,t.h)}function bf(e,t,n={}){const r=e.x!==n.x?-t:0,a=e.y!==n.y?-t:0,A=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-a;return{x:e.x+r,y:e.y+a,w:e.w+A,h:e.h+s,radius:e.radius}}class eo extends an{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:a}}=this,{inner:A,outer:s}=T7(this),o=D7(s.radius)?Rs:L7;t.save(),(s.w!==A.w||s.h!==A.h)&&(t.beginPath(),o(t,bf(s,n,A)),t.clip(),o(t,bf(A,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),o(t,bf(A,n)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,n,r){return wf(this,t,n,r)}inXRange(t,n){return wf(this,t,null,n)}inYRange(t,n){return wf(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:a,horizontal:A}=this.getProps(["x","y","base","horizontal"],t);return{x:A?(n+a)/2:n,y:A?r:(r+a)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(eo,"id","bar"),R(eo,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(eo,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var O7=Object.freeze({__proto__:null,ArcElement:ys,BarElement:eo,LineElement:ka,PointElement:Zi});const Hh=["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)"],aB=Hh.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function d_(e){return Hh[e%Hh.length]}function f_(e){return aB[e%aB.length]}function M7(e,t){return e.borderColor=d_(t),e.backgroundColor=f_(t),++t}function N7(e,t){return e.backgroundColor=e.data.map(()=>d_(t++)),t}function P7(e,t){return e.backgroundColor=e.data.map(()=>f_(t++)),t}function H7(e){let t=0;return(n,r)=>{const a=e.getDatasetMeta(r).controller;a instanceof BA?t=N7(n,t):a instanceof Ji?t=P7(n,t):a&&(t=M7(n,t))}}function AB(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function R7(e){return e&&(e.borderColor||e.backgroundColor)}var V7={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:a}=e.config,{elements:A}=a;if(!n.forceOverride&&(AB(r)||R7(a)||A&&AB(A)))return;const s=H7(e);r.forEach(s)}};function K7(e,t,n,r,a){const A=a.samples||r;if(A>=n)return e.slice(t,t+n);const s=[],o=(n-2)/(A-2);let l=0;const c=t+n-1;let u=t,d,f,h,p,m;for(s[l++]=e[u],d=0;d<A-2;d++){let y=0,g=0,v;const _=Math.floor((d+1)*o)+1+t,B=Math.min(Math.floor((d+2)*o)+1,n)+t,b=B-_;for(v=_;v<B;v++)y+=e[v].x,g+=e[v].y;y/=b,g/=b;const w=Math.floor(d*o)+1+t,C=Math.min(Math.floor((d+1)*o)+1,n)+t,{x:k,y:S}=e[u];for(h=p=-1,v=w;v<C;v++)p=.5*Math.abs((k-y)*(e[v].y-S)-(k-e[v].x)*(g-S)),p>h&&(h=p,f=e[v],m=v);s[l++]=f,u=m}return s[l++]=e[c],s}function $7(e,t,n,r){let a=0,A=0,s,o,l,c,u,d,f,h,p,m;const y=[],g=t+n-1,v=e[t].x,B=e[g].x-v;for(s=t;s<t+n;++s){o=e[s],l=(o.x-v)/B*r,c=o.y;const b=l|0;if(b===u)c<p?(p=c,d=s):c>m&&(m=c,f=s),a=(A*a+o.x)/++A;else{const w=s-1;if(!_e(d)&&!_e(f)){const C=Math.min(d,f),k=Math.max(d,f);C!==h&&C!==w&&y.push({...e[C],x:a}),k!==h&&k!==w&&y.push({...e[k],x:a})}s>0&&w!==h&&y.push(e[w]),y.push(o),u=b,A=0,p=m=c,d=f=h=s}}return y}function h_(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function sB(e){e.data.datasets.forEach(t=>{h_(t)})}function W7(e,t){const n=t.length;let r=0,a;const{iScale:A}=e,{min:s,max:o,minDefined:l,maxDefined:c}=A.getUserBounds();return l&&(r=Mt(Wr(t,A.axis,s).lo,0,n-1)),c?a=Mt(Wr(t,A.axis,o).hi+1,r,n)-r:a=n-r,{start:r,count:a}}var G7={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){sB(e);return}const r=e.width;e.data.datasets.forEach((a,A)=>{const{_data:s,indexAxis:o}=a,l=e.getDatasetMeta(A),c=s||a.data;if(tt([o,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=W7(l,c);const h=n.threshold||4*r;if(f<=h){h_(a);return}_e(s)&&(a._data=c,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=K7(c,d,f,r,n);break;case"min-max":p=$7(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}a._decimated=p})},destroy(e){sB(e)}};function z7(e,t,n){const r=e.segments,a=e.points,A=t.points,s=[];for(const o of r){let{start:l,end:c}=o;c=qg(l,c,a);const u=Rh(n,a[l],a[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:a[l],end:a[c]});continue}const d=qb(t,u);for(const f of d){const h=Rh(n,A[f.start],A[f.end],f.loop),p=Yb(o,a,h);for(const m of p)s.push({source:m,target:f,start:{[n]:iB(u,h,"start",Math.max)},end:{[n]:iB(u,h,"end",Math.min)}})}}return s}function Rh(e,t,n,r){if(r)return;let a=t[e],A=n[e];return e==="angle"&&(a=_n(a),A=_n(A)),{property:e,start:a,end:A}}function j7(e,t){const{x:n=null,y:r=null}=e||{},a=t.points,A=[];return t.segments.forEach(({start:s,end:o})=>{o=qg(s,o,a);const l=a[s],c=a[o];r!==null?(A.push({x:l.x,y:r}),A.push({x:c.x,y:r})):n!==null&&(A.push({x:n,y:l.y}),A.push({x:n,y:c.y}))}),A}function qg(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function iB(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function p_(e,t){let n=[],r=!1;return Oe(e)?(r=!0,n=e):n=j7(e,t),n.length?new ka({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function oB(e){return e&&e.fill!==!1}function Y7(e,t,n){let a=e[t].fill;const A=[t];let s;if(!n)return a;for(;a!==!1&&A.indexOf(a)===-1;){if(!ut(a))return a;if(s=e[a],!s)return!1;if(s.visible)return a;A.push(a),a=s.fill}return!1}function q7(e,t,n){const r=e9(e);if(ve(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return ut(a)&&Math.floor(a)===a?X7(r[0],t,a,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function X7(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function J7(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ve(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Z7(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ve(e)?r=e.value:r=t.getBaseValue(),r}function e9(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function t9(e){const{scale:t,index:n,line:r}=e,a=[],A=r.segments,s=r.points,o=n9(t,n);o.push(p_({x:null,y:t.bottom},r));for(let l=0;l<A.length;l++){const c=A[l];for(let u=c.start;u<=c.end;u++)r9(a,s[u],o)}return new ka({points:a,options:{}})}function n9(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const A=r[a];if(A.index===t)break;A.hidden||n.unshift(A.dataset)}return n}function r9(e,t,n){const r=[];for(let a=0;a<n.length;a++){const A=n[a],{first:s,last:o,point:l}=a9(A,t,"x");if(!(!l||s&&o)){if(s)r.unshift(l);else if(e.push(l),!o)break}}e.push(...r)}function a9(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const a=r[n],A=e.segments,s=e.points;let o=!1,l=!1;for(let c=0;c<A.length;c++){const u=A[c],d=s[u.start][n],f=s[u.end][n];if($r(a,d,f)){o=a===d,l=a===f;break}}return{first:o,last:l,point:r}}class g_{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:a,y:A,radius:s}=this;return n=n||{start:0,end:Xe},t.arc(a,A,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:a}=this,A=t.angle;return{x:n+Math.cos(A)*a,y:r+Math.sin(A)*a,angle:A}}}function A9(e){const{chart:t,fill:n,line:r}=e;if(ut(n))return s9(t,n);if(n==="stack")return t9(e);if(n==="shape")return!0;const a=i9(e);return a instanceof g_?a:p_(a,r)}function s9(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function i9(e){return(e.scale||{}).getPointPositionForValue?l9(e):o9(e)}function o9(e){const{scale:t={},fill:n}=e,r=J7(n,t);if(ut(r)){const a=t.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function l9(e){const{scale:t,fill:n}=e,r=t.options,a=t.getLabels().length,A=r.reverse?t.max:t.min,s=Z7(n,t,A),o=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,A);return new g_({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<a;++l)o.push(t.getPointPositionForValue(l,s));return o}function _f(e,t,n){const r=A9(t),{line:a,scale:A,axis:s}=t,o=a.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};r&&a.points.length&&(tl(e,n),c9(e,{line:a,target:r,above:u,below:d,area:n,scale:A,axis:s}),nl(e))}function c9(e,t){const{line:n,target:r,above:a,below:A,area:s,scale:o}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&A!==a&&(lB(e,r,s.top),cB(e,{line:n,target:r,color:a,scale:o,property:l}),e.restore(),e.save(),lB(e,r,s.bottom)),cB(e,{line:n,target:r,color:A,scale:o,property:l}),e.restore()}function lB(e,t,n){const{segments:r,points:a}=t;let A=!0,s=!1;e.beginPath();for(const o of r){const{start:l,end:c}=o,u=a[l],d=a[qg(l,c,a)];A?(e.moveTo(u.x,u.y),A=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,o,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function cB(e,t){const{line:n,target:r,property:a,color:A,scale:s}=t,o=z7(n,r,a);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=A}={}}=l,h=r!==!0;e.save(),e.fillStyle=f,u9(e,s,h&&Rh(a,u,d)),e.beginPath();const p=!!n.pathSegment(e,l);let m;if(h){p?e.closePath():uB(e,r,d,a);const y=!!r.pathSegment(e,c,{move:p,reverse:!0});m=p&&y,m||uB(e,r,u,a)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function u9(e,t,n){const{top:r,bottom:a}=t.chart.chartArea,{property:A,start:s,end:o}=n||{};A==="x"&&(e.beginPath(),e.rect(s,r,o-s,a-r),e.clip())}function uB(e,t,n,r){const a=t.interpolate(n,r);a&&e.lineTo(a.x,a.y)}var d9={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,a=[];let A,s,o,l;for(s=0;s<r;++s)A=e.getDatasetMeta(s),o=A.dataset,l=null,o&&o.options&&o instanceof ka&&(l={visible:e.isDatasetVisible(s),index:s,fill:q7(o,s,r),chart:e,axis:A.controller.options.indexAxis,scale:A.vScale,line:o}),A.$filler=l,a.push(l);for(s=0;s<r;++s)l=a[s],!(!l||l.fill===!1)&&(l.fill=Y7(a,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",a=e.getSortedVisibleDatasetMetas(),A=e.chartArea;for(let s=a.length-1;s>=0;--s){const o=a[s].$filler;o&&(o.line.updateControlPoints(A,o.axis),r&&o.fill&&_f(e.ctx,o,A))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const A=r[a].$filler;oB(A)&&_f(e.ctx,A,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!oB(r)||n.drawTime!=="beforeDatasetDraw"||_f(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const dB=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},f9=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class fB extends an{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=He(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,a)=>t.sort(r,a,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,a=ft(r.font),A=a.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=dB(r,A);let c,u;n.font=a.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,A,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,a,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,a){const{ctx:A,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=a+o;let d=t;A.textAlign="left",A.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+A.measureText(p.text).width;(m===0||c[c.length-1]+y+2*o>s)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:y,height:a},c[c.length-1]+=y+o}),d}_fitCols(t,n,r,a){const{ctx:A,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,g)=>{const{itemWidth:v,itemHeight:_}=h9(r,n,A,y,a);g>0&&h+_+2*o>u&&(d+=f+o,c.push({width:f,height:h}),p+=f+o,m++,f=h=0),l[g]={left:p,top:h,col:m,width:v,height:_},f=Math.max(f,v),h+=_+o}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:a},rtl:A}}=this,s=Cs(A,this.left,this.width);if(this.isHorizontal()){let o=0,l=$t(r,this.left+a,this.right-this.lineWidths[o]);for(const c of n)o!==c.row&&(o=c.row,l=$t(r,this.left+a,this.right-this.lineWidths[o])),c.top+=this.top+t+a,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+a}else{let o=0,l=$t(r,this.top+t+a,this.bottom-this.columnSizes[o].height);for(const c of n)c.col!==o&&(o=c.col,l=$t(r,this.top+t+a,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+a,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;tl(t,this),this._draw(),nl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:a}=this,{align:A,labels:s}=t,o=dt.color,l=Cs(t.rtl,this.left,this.width),c=ft(s.font),{padding:u}=s,d=c.size,f=d/2;let h;this.drawTitle(),a.textAlign=l.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=dB(s,d),g=function(w,C,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;a.save();const S=de(k.lineWidth,1);if(a.fillStyle=de(k.fillStyle,o),a.lineCap=de(k.lineCap,"butt"),a.lineDashOffset=de(k.lineDashOffset,0),a.lineJoin=de(k.lineJoin,"miter"),a.lineWidth=S,a.strokeStyle=de(k.strokeStyle,o),a.setLineDash(de(k.lineDash,[])),s.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:S},U=l.xPlus(w,p/2),F=C+f;Mb(a,T,U,F,s.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),U=l.leftForLtr(w,p),F=Da(k.borderRadius);a.beginPath(),Object.values(F).some(Q=>Q!==0)?Rs(a,{x:U,y:T,w:p,h:m,radius:F}):a.rect(U,T,p,m),a.fill(),S!==0&&a.stroke()}a.restore()},v=function(w,C,k){OA(a,k.text,w,C+y/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},_=this.isHorizontal(),B=this._computeTitleHeight();_?h={x:$t(A,this.left+u,this.right-r[0]),y:this.top+u+B,line:0}:h={x:this.left+u,y:$t(A,this.top+B+u,this.bottom-n[0].height),line:0},Gb(this.ctx,t.textDirection);const b=y+u;this.legendItems.forEach((w,C)=>{a.strokeStyle=w.fontColor,a.fillStyle=w.fontColor;const k=a.measureText(w.text).width,S=l.textAlign(w.textAlign||(w.textAlign=s.textAlign)),T=p+f+k;let U=h.x,F=h.y;l.setWidth(this.width),_?C>0&&U+T+u>this.right&&(F=h.y+=b,h.line++,U=h.x=$t(A,this.left+u,this.right-r[h.line])):C>0&&F+b>this.bottom&&(U=h.x=U+n[h.line].width+u,h.line++,F=h.y=$t(A,this.top+B+u,this.bottom-n[h.line].height));const Q=l.x(U);if(g(Q,F,w),U=OL(S,U+p+f,_?U+T:this.right,t.rtl),v(l.x(U),F,w),_)h.x+=T+u;else if(typeof w.text!="string"){const Y=c.lineHeight;h.y+=m_(w,Y)}else h.y+=b}),zb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ft(n.font),a=_t(n.padding);if(!n.display)return;const A=Cs(t.rtl,this.left,this.width),s=this.ctx,o=n.position,l=r.size/2,c=a.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=$t(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+$t(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=$t(o,d,d+f);s.textAlign=A.textAlign(Rg(o)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,OA(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=ft(t.font),r=_t(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,a,A;if($r(t,this.left,this.right)&&$r(n,this.top,this.bottom)){for(A=this.legendHitBoxes,r=0;r<A.length;++r)if(a=A[r],$r(t,a.left,a.left+a.width)&&$r(n,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!m9(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const a=this._hoveredItem,A=f9(a,r);a&&!A&&He(n.onLeave,[t,a,this],this),this._hoveredItem=r,r&&!A&&He(n.onHover,[t,r,this],this)}else r&&He(n.onClick,[t,r,this],this)}}function h9(e,t,n,r,a){const A=p9(r,e,t,n),s=g9(a,r,t.lineHeight);return{itemWidth:A,itemHeight:s}}function p9(e,t,n,r){let a=e.text;return a&&typeof a!="string"&&(a=a.reduce((A,s)=>A.length>s.length?A:s)),t+n.size/2+r.measureText(a).width}function g9(e,t,n){let r=e;return typeof t.text!="string"&&(r=m_(t,n)),r}function m_(e,t){const n=e.text?e.text.length+.5:0;return t*n}function m9(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var v9={id:"legend",_element:fB,start(e,t,n){const r=e.legend=new fB({ctx:e.ctx,options:n,chart:e});Gt.configure(e,r,n),Gt.addBox(e,r)},stop(e){Gt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Gt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),t.hidden=!0):(a.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:a,color:A,useBorderRadius:s,borderRadius:o}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=_t(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:A,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:a||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Xg extends an{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const a=Oe(r.text)?r.text.length:1;this._padding=_t(r.padding);const A=a*ft(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=A:this.width=A}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:a,right:A,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=$t(o,r,A),d=n+t,c=A-r):(s.position==="left"?(u=r+t,d=$t(o,a,n),l=Qe*-.5):(u=A-t,d=$t(o,n,a),l=Qe*.5),c=a-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ft(n.font),A=r.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(A);OA(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Rg(n.align),textBaseline:"middle",translation:[s,o]})}}function B9(e,t){const n=new Xg({ctx:e.ctx,options:t,chart:e});Gt.configure(e,n,t),Gt.addBox(e,n),e.titleBlock=n}var y9={id:"title",_element:Xg,start(e,t,n){B9(e,n)},stop(e){const t=e.titleBlock;Gt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Gt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const jl=new WeakMap;var w9={id:"subtitle",start(e,t,n){const r=new Xg({ctx:e.ctx,options:n,chart:e});Gt.configure(e,r,n),Gt.addBox(e,r),jl.set(e,r)},stop(e){Gt.removeBox(e,jl.get(e)),jl.delete(e)},beforeUpdate(e,t,n){const r=jl.get(e);Gt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ii={average(e){if(!e.length)return!1;let t,n,r=0,a=0,A=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();r+=o.x,a+=o.y,++A}}return{x:r/A,y:a/A}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,a=Number.POSITIVE_INFINITY,A,s,o;for(A=0,s=e.length;A<s;++A){const l=e[A].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Hs(t,c);u<a&&(a=u,o=l)}}if(o){const l=o.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function lr(e,t){return t&&(Oe(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Nr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
825
+ */class OO{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,a){const A=n.listeners[a],s=n.duration;A.forEach(o=>o({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Qb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const A=r.items;let s=A.length-1,o=!1,l;for(;s>=0;--s)l=A[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),o=!0):(A[s]=A[A.length-1],A.pop());o&&(a.draw(),this._notify(a,r,t,"progress")),A.length||(r.running=!1,this._notify(a,r,t,"complete"),r.initial=!1),n+=A.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Mr=new OO;const xv="transparent",MO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=vv(e||xv),a=r.valid&&vv(t||xv);return a&&a.valid?a.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class NO{constructor(t,n,r,a){const A=n[r];a=tt([t.to,a,A,t.from]);const s=tt([t.from,A,a]);this._active=!0,this._fn=t.fn||MO[t.type||typeof s],this._easing=qi[t.easing]||qi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=a,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const a=this._target[this._prop],A=r-this._start,s=this._duration-A;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=A,this._loop=!!t.loop,this._to=tt([t.to,n,a,t.from]),this._from=tt([t.from,a,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,a=this._prop,A=this._from,s=this._loop,o=this._to;let l;if(this._active=A!==o&&(s||n<r),!this._active){this._target[a]=o,this._notify(!0);return}if(n<0){this._target[a]=A;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[a]=this._fn(A,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][n]()}}class jg{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ve(t))return;const n=Object.keys(dt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(a=>{const A=t[a];if(!ve(A))return;const s={};for(const o of n)s[o]=A[o];(Oe(A.properties)&&A.properties||[a]).forEach(o=>{(o===a||!r.has(o))&&r.set(o,s)})})}_animateOptions(t,n){const r=n.options,a=HO(t,r);if(!a)return[];const A=this._createAnimations(a,r);return r.$shared&&PO(t.options.$animations,r).then(()=>{t.options=r},()=>{}),A}_createAnimations(t,n){const r=this._properties,a=[],A=t.$animations||(t.$animations={}),s=Object.keys(n),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){a.push(...this._animateOptions(t,n));continue}const u=n[c];let d=A[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}A[c]=d=new NO(f,t,c,u),a.push(d)}return a}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Mr.add(this._chart,r),!0}}function PO(e,t){const n=[],r=Object.keys(t);for(let a=0;a<r.length;a++){const A=e[r[a]];A&&A.active()&&n.push(A.wait())}return Promise.all(n)}function HO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Fv(e,t){const n=e&&e.options||{},r=n.reverse,a=n.min===void 0?t:0,A=n.max===void 0?t:0;return{start:r?A:a,end:r?a:A}}function RO(e,t,n){if(n===!1)return!1;const r=Fv(e,n),a=Fv(t,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function VO(e){let t,n,r,a;return ve(e)?(t=e.top,n=e.right,r=e.bottom,a=e.left):t=n=r=a=e,{top:t,right:n,bottom:r,left:a,disabled:e===!1}}function Xb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let a,A;for(a=0,A=r.length;a<A;++a)n.push(r[a].index);return n}function Iv(e,t,n,r={}){const a=e.keys,A=r.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=a.length;s<o;++s){if(l=+a[s],l===n){if(r.all)continue;break}c=e.values[l],ut(c)&&(A||t===0||vr(t)===vr(c))&&(t+=c)}return t}}function KO(e){const t=Object.keys(e),n=new Array(t.length);let r,a,A;for(r=0,a=t.length;r<a;++r)A=t[r],n[r]={x:A,y:e[A]};return n}function Uv(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function $O(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function WO(e){const{min:t,max:n,minDefined:r,maxDefined:a}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}function GO(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Qv(e,t,n,r){for(const a of t.getMatchingVisibleMetas(r).reverse()){const A=e[a.index];if(n&&A>0||!n&&A<0)return a.index}return null}function Tv(e,t){const{chart:n,_cachedMeta:r}=e,a=n._stacks||(n._stacks={}),{iScale:A,vScale:s,index:o}=r,l=A.axis,c=s.axis,u=$O(A,s,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[l]:m,[c]:y}=p,g=p._stacks||(p._stacks={});f=g[c]=GO(a,u,m),f[o]=y,f._top=Qv(f,s,!0,r.type),f._bottom=Qv(f,s,!1,r.type);const v=f._visualValues||(f._visualValues={});v[o]=y}}function pf(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function zO(e,t){return rA(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function jO(e,t,n){return rA(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function fi(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const a of t){const A=a._stacks;if(!A||A[r]===void 0||A[r][n]===void 0)return;delete A[r][n],A[r]._visualValues!==void 0&&A[r]._visualValues[n]!==void 0&&delete A[r]._visualValues[n]}}}const gf=e=>e==="reset"||e==="none",Dv=(e,t)=>t?e:Object.assign({},e),YO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Xb(n,!0),values:null};class er{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Uv(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&fi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),a=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,A=n.xAxisID=de(r.xAxisID,pf(t,"x")),s=n.yAxisID=de(r.yAxisID,pf(t,"y")),o=n.rAxisID=de(r.rAxisID,pf(t,"r")),l=n.indexAxis,c=n.iAxisID=a(l,A,s,o),u=n.vAxisID=a(l,s,A,o);n.xScale=this.getScaleForId(A),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(o),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&pv(this._data,this),t._stacked&&fi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ve(n))this._data=KO(n);else if(r!==n){if(r){pv(r,this);const a=this._cachedMeta;fi(a),a._parsed=[]}n&&Object.isExtensible(n)&&DL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const A=n._stacked;n._stacked=Uv(n.vScale,n),n.stack!==r.stack&&(a=!0,fi(n),n.stack=r.stack),this._resyncElements(t),(a||A!==n._stacked)&&Tv(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:a}=this,{iScale:A,_stacked:s}=r,o=A.axis;let l=t===0&&n===a.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=a,r._sorted=!0,f=a;else{Oe(a[t])?f=this.parseArrayData(r,a,t,n):ve(a[t])?f=this.parseObjectData(r,a,t,n):f=this.parsePrimitiveData(r,a,t,n);const h=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&Tv(this,f)}parsePrimitiveData(t,n,r,a){const{iScale:A,vScale:s}=t,o=A.axis,l=s.axis,c=A.getLabels(),u=A===s,d=new Array(a);let f,h,p;for(f=0,h=a;f<h;++f)p=f+r,d[f]={[o]:u||A.parse(c[p],p),[l]:s.parse(n[p],p)};return d}parseArrayData(t,n,r,a){const{xScale:A,yScale:s}=t,o=new Array(a);let l,c,u,d;for(l=0,c=a;l<c;++l)u=l+r,d=n[u],o[l]={x:A.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,n,r,a){const{xScale:A,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(a);let u,d,f,h;for(u=0,d=a;u<d;++u)f=u+r,h=n[f],c[u]={x:A.parse(Ga(h,o),f),y:s.parse(Ga(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const a=this.chart,A=this._cachedMeta,s=n[t.axis],o={keys:Xb(a,!0),values:n._stacks[t.axis]._visualValues};return Iv(o,s,A.index,{mode:r})}updateRangeFromParsed(t,n,r,a){const A=r[n.axis];let s=A===null?NaN:A;const o=a&&r._stacks[n.axis];a&&o&&(a.values=o,s=Iv(a,A,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,a=r._parsed,A=r._sorted&&t===r.iScale,s=a.length,o=this._getOtherScale(t),l=YO(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=WO(o);let f,h;function p(){h=a[f];const m=h[o.axis];return!ut(h[t.axis])||u>m||d<m}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,h,l),A));++f);if(A){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let a,A,s;for(a=0,A=n.length;a<A;++a)s=n[a][t.axis],ut(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,a=n.vScale,A=this.getParsed(t);return{label:r?""+r.getLabelForValue(A[r.axis]):"",value:a?""+a.getLabelForValue(A[a.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=VO(de(this.options.clip,RO(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,a=r.data||[],A=n.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||a.length-o,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,A,o,l),u=o;u<o+l;++u){const d=a[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,A))}for(u=0;u<s.length;++u)s[u].draw(t,A)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const a=this.getDataset();let A;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];A=s.$context||(s.$context=jO(this.getContext(),t,s)),A.parsed=this.getParsed(t),A.raw=a.data[t],A.index=A.dataIndex=t}else A=this.$context||(this.$context=zO(this.chart.getContext(),this.index)),A.dataset=a,A.index=A.datasetIndex=this.index;return A.active=!!n,A.mode=r,A}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const a=n==="active",A=this._cachedDataOpts,s=t+"-"+n,o=A[s],l=this.enableOptionSharing&&vn(r);if(o)return Dv(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=a?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(dt.elements[t]),p=()=>this.getContext(r,a,n),m=c.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=l,A[s]=Object.freeze(Dv(m,l))),m}_resolveAnimations(t,n,r){const a=this.chart,A=this._cachedDataOpts,s=`animation-${n}`,o=A[s];if(o)return o;let l;if(a.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new jg(a,l&&l.animations);return l&&l._cacheable&&(A[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||gf(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),a=this._sharedOptions,A=this.getSharedOptions(r),s=this.includeOptions(n,A)||A!==a;return this.updateSharedOptions(A,n,r),{sharedOptions:A,includeOptions:s}}updateElement(t,n,r,a){gf(a)?Object.assign(t,r):this._resolveAnimations(n,a).update(t,r)}updateSharedOptions(t,n,r){t&&!gf(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,a){t.active=a;const A=this.getStyle(n,a);this._resolveAnimations(n,r,a).update(t,{options:!a&&this.getSharedOptions(A)||A})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const a=r.length,A=n.length,s=Math.min(A,a);s&&this.parse(0,s),A>a?this._insertElements(a,A-a,t):A<a&&this._removeElements(A,a-A)}_insertElements(t,n,r=!0){const a=this._cachedMeta,A=a.data,s=t+n;let o;const l=c=>{for(c.length+=n,o=c.length-1;o>=s;o--)c[o]=c[o-n]};for(l(A),o=t;o<s;++o)A[o]=new this.dataElementType;this._parsing&&l(a._parsed),this.parse(t,n),r&&this.updateElements(A,t,n,"reset")}updateElements(t,n,r,a){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(t,n);r._stacked&&fi(r,a)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,a]=t;this[n](r,a)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(er,"defaults",{}),R(er,"datasetElementType",null),R(er,"dataElementType",null);function qO(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let a=0,A=n.length;a<A;a++)r=r.concat(n[a].controller.getAllParsedValues(e));e._cache.$bar=Ub(r.sort((a,A)=>a-A))}return e._cache.$bar}function XO(e){const t=e.iScale,n=qO(t,e.type);let r=t._length,a,A,s,o;const l=()=>{s===32767||s===-32768||(vn(o)&&(r=Math.min(r,Math.abs(s-o)||r)),o=s)};for(a=0,A=n.length;a<A;++a)s=t.getPixelForValue(n[a]),l();for(o=void 0,a=0,A=t.ticks.length;a<A;++a)s=t.getPixelForTick(a),l();return r}function JO(e,t,n,r){const a=n.barThickness;let A,s;return _e(a)?(A=t.min*n.categoryPercentage,s=n.barPercentage):(A=a*r,s=1),{chunk:A/r,ratio:s,start:t.pixels[e]-A/2}}function ZO(e,t,n,r){const a=t.pixels,A=a[e];let s=e>0?a[e-1]:null,o=e<a.length-1?a[e+1]:null;const l=n.categoryPercentage;s===null&&(s=A-(o===null?t.end-t.start:o-A)),o===null&&(o=A+A-s);const c=A-(A-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/r,ratio:n.barPercentage,start:c}}function e7(e,t,n,r){const a=n.parse(e[0],r),A=n.parse(e[1],r),s=Math.min(a,A),o=Math.max(a,A);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:a,end:A,min:s,max:o}}function Jb(e,t,n,r){return Oe(e)?e7(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Lv(e,t,n,r){const a=e.iScale,A=e.vScale,s=a.getLabels(),o=a===A,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[a.axis]=o||a.parse(s[c],c),l.push(Jb(f,d,A,c));return l}function mf(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function t7(e,t,n){return e!==0?vr(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function n7(e){let t,n,r,a,A;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(a="end",A="start"):(a="start",A="end"),{start:n,end:r,reverse:t,top:a,bottom:A}}function r7(e,t,n,r){let a=t.borderSkipped;const A={};if(!a){e.borderSkipped=A;return}if(a===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=n7(e);a==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?a=c:(n._bottom||0)===r?a=u:(A[Ov(u,s,o,l)]=!0,a=c)),A[Ov(a,s,o,l)]=!0,e.borderSkipped=A}function Ov(e,t,n,r){return r?(e=a7(e,t,n),e=Mv(e,n,t)):e=Mv(e,t,n),e}function a7(e,t,n){return e===t?n:e===n?t:e}function Mv(e,t,n){return e==="start"?t:e==="end"?n:e}function A7(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Tc extends er{parsePrimitiveData(t,n,r,a){return Lv(t,n,r,a)}parseArrayData(t,n,r,a){return Lv(t,n,r,a)}parseObjectData(t,n,r,a){const{iScale:A,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=A.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,h,p,m;for(f=r,h=r+a;f<h;++f)m=n[f],p={},p[A.axis]=A.parse(Ga(m,c),f),d.push(Jb(Ga(m,u),p,s,f));return d}updateRangeFromParsed(t,n,r,a){super.updateRangeFromParsed(t,n,r,a);const A=r._custom;A&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,A.min),t.max=Math.max(t.max,A.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:a}=n,A=this.getParsed(t),s=A._custom,o=mf(s)?"["+s.start+", "+s.end+"]":""+a.getLabelForValue(A[a.axis]);return{label:""+r.getLabelForValue(A[r.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,a){const A=a==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,a);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=A||_e(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),g=(p._stacks||{})[o.axis],v={horizontal:c,base:m.base,enableBorderRadius:!g||mf(p._custom)||s===g._top||s===g._bottom,x:c?m.head:y.center,y:c?y.center:m.head,height:c?y.size:Math.abs(m.size),width:c?Math.abs(m.size):y.size};f&&(v.options=d||this.resolveDataElementOptions(h,t[h].active?"active":a));const _=v.options||t[h].options;r7(v,_,g,s),A7(v,_,u.ratio),this.updateElement(t[h],h,v,a)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),A=r.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(_e(u)||isNaN(u))return!0};for(const l of a)if(!(n!==void 0&&o(l))&&((A===!1||s.indexOf(l.stack)===-1||A===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const a=this._getStacks(t,r),A=n!==void 0?a.indexOf(n):-1;return A===-1?a.length-1:A}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,a=[];let A,s;for(A=0,s=n.data.length;A<s;++A)a.push(r.getPixelForValue(this.getParsed(A)[r.axis],A));const o=t.barThickness;return{min:o||XO(n),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:a},options:{base:A,minBarLength:s}}=this,o=A||0,l=this.getParsed(t),c=l._custom,u=mf(c);let d=l[n.axis],f=0,h=r?this.applyStack(n,l,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&vr(d)!==vr(c.barEnd)&&(f=0),f+=d);const y=!_e(A)&&!u?A:f;let g=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=g,m=p-g,Math.abs(m)<s){m=t7(m,n,o)*s,d===o&&(g-=m/2);const v=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),B=Math.min(v,_),b=Math.max(v,_);g=Math.max(Math.min(g,b),B),p=g+m,r&&!u&&(l._stacks[n.axis]._visualValues[a]=n.getValueForPixel(p)-n.getValueForPixel(g))}if(g===n.getPixelForValue(o)){const v=vr(m)*n.getLineWidthForValue(o)/2;g+=v,m-=v}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,a=this.options,A=a.skipNull,s=de(a.maxBarThickness,1/0);let o,l;if(n.grouped){const c=A?this._getStackCount(t):n.stackCount,u=a.barThickness==="flex"?ZO(t,n,a,c):JO(t,n,a,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,A?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,a=r.length;let A=0;for(;A<a;++A)this.getParsed(A)[n.axis]!==null&&r[A].draw(this._ctx)}}R(Tc,"id","bar"),R(Tc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(Tc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Dc extends er{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,a){const A=super.parsePrimitiveData(t,n,r,a);for(let s=0;s<A.length;s++)A[s]._custom=this.resolveDataElementOptions(s+r).radius;return A}parseArrayData(t,n,r,a){const A=super.parseArrayData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o[2],this.resolveDataElementOptions(s+r).radius)}return A}parseObjectData(t,n,r,a){const A=super.parseObjectData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o&&o.r&&+o.r,this.resolveDataElementOptions(s+r).radius)}return A}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,a),u=s.axis,d=o.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!A&&this.getParsed(f),m={},y=m[u]=A?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),g=m[d]=A?o.getBasePixel():o.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(g),c&&(m.options=l||this.resolveDataElementOptions(f,h.active?"active":a),A&&(m.options.radius=0)),this.updateElement(h,f,m,a)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let a=super.resolveDataElementOptions(t,n);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const A=a.radius;return n!=="active"&&(a.radius=0),a.radius+=de(r&&r._custom,A),a}}R(Dc,"id","bubble"),R(Dc,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(Dc,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function s7(e,t,n){let r=1,a=1,A=0,s=0;if(t<Xe){const o=e,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),h=(_,B,b)=>So(_,o,l,!0)?1:Math.max(B,B*n,b,b*n),p=(_,B,b)=>So(_,o,l,!0)?-1:Math.min(B,B*n,b,b*n),m=h(0,c,d),y=h(Je,u,f),g=p(Qe,c,d),v=p(Qe+Je,u,f);r=(m-g)/2,a=(y-v)/2,A=-(m+g)/2,s=-(y+v)/2}return{ratioX:r,ratioY:a,offsetX:A,offsetY:s}}class BA extends er{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let A=l=>+r[l];if(ve(r[t])){const{key:l="value"}=this._parsing;A=c=>+Ga(r[c],l)}let s,o;for(s=t,o=t+n;s<o;++s)a._parsed[s]=A(s)}}_getRotation(){return Et(this.options.rotation-90)}_getCircumference(){return Et(this.options.circumference)}_getRotationExtents(){let t=Xe,n=-Xe;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,A=a._getRotation(),s=a._getCircumference();t=Math.min(t,A),n=Math.max(n,A+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,a=this._cachedMeta,A=a.data,s=this.getMaxBorderWidth()+this.getMaxOffset(A)+this.options.spacing,o=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(wL(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=s7(d,u,l),y=(r.width-s)/f,g=(r.height-s)/h,v=Math.max(Math.min(y,g)/2,0),_=kb(this.options.radius,v),B=Math.max(_*l,0),b=(_-B)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,a.total=this.calculateTotal(),this.outerRadius=_-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*c,0),this.updateElements(A,0,A.length,t)}_circumference(t,n){const r=this.options,a=this._cachedMeta,A=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||a._parsed[t]===null||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*A/Xe)}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=A&&c.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,a);let g=this._getRotation(),v;for(v=0;v<n;++v)g+=this._circumference(v,A);for(v=n;v<n+r;++v){const _=this._circumference(v,A),B=t[v],b={x:u+this.offsetX,y:d+this.offsetY,startAngle:g,endAngle:g+_,circumference:_,outerRadius:p,innerRadius:h};y&&(b.options=m||this.resolveDataElementOptions(v,B.active?"active":a)),g+=_,this.updateElement(B,v,b,a)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,a;for(a=0;a<n.length;a++){const A=t._parsed[a];A!==null&&!isNaN(A)&&this.chart.getDataVisibility(a)&&!n[a].hidden&&(r+=Math.abs(A))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Xe*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=el(n._parsed[t],r.options.locale);return{label:a[t]||"",value:A}}getMaxBorderWidth(t){let n=0;const r=this.chart;let a,A,s,o,l;if(!t){for(a=0,A=r.data.datasets.length;a<A;++a)if(r.isDatasetVisible(a)){s=r.getDatasetMeta(a),t=s.data,o=s.controller;break}}if(!t)return 0;for(a=0,A=t.length;a<A;++a)l=o.resolveDataElementOptions(a),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,a=t.length;r<a;++r){const A=this.resolveDataElementOptions(r);n=Math.max(n,A.offset||0,A.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(BA,"id","doughnut"),R(BA,"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(BA,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(BA,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Lc extends er{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:a=[],_dataset:A}=n,s=this.chart._animationsDisabled;let{start:o,count:l}=Db(n,a,s);this._drawStart=o,this._drawCount=l,Lb(n)&&(o=0,l=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!A._decimated,r.points=a;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(a,o,l,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,a),f=s.axis,h=o.axis,{spanGaps:p,segment:m}=this.options,y=za(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||A||a==="none",v=n+r,_=t.length;let B=n>0&&this.getParsed(n-1);for(let b=0;b<_;++b){const w=t[b],C=g?w:{};if(b<n||b>=v){C.skip=!0;continue}const k=this.getParsed(b),S=_e(k[h]),T=C[f]=s.getPixelForValue(k[f],b),U=C[h]=A||S?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,k,l):k[h],b);C.skip=isNaN(T)||isNaN(U)||S,C.stop=b>0&&Math.abs(k[f]-B[f])>y,m&&(C.parsed=k,C.raw=c.data[b]),d&&(C.options=u||this.resolveDataElementOptions(b,w.active?"active":a)),g||this.updateElement(w,b,C,a),B=k}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,a=t.data||[];if(!a.length)return r;const A=a[0].size(this.resolveDataElementOptions(0)),s=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,A,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(Lc,"id","line"),R(Lc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(Lc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ji extends er{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=el(n._parsed[t].r,r.options.locale);return{label:a[t]||"",value:A}}parseObjectData(t,n,r,a){return Kb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,a)=>{const A=this.getParsed(a).r;!isNaN(A)&&this.chart.getDataVisibility(a)&&(A<n.min&&(n.min=A),A>n.max&&(n.max=A))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,a=Math.min(n.right-n.left,n.bottom-n.top),A=Math.max(a/2,0),s=Math.max(r.cutoutPercentage?A/100*r.cutoutPercentage:1,0),o=(A-s)/t.getVisibleDatasetCount();this.outerRadius=A-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*Qe;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,a,m);for(p=n;p<n+r;p++){const y=t[p];let g=h,v=h+this._computeAngle(p,a,m),_=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=v,A&&(l.animateScale&&(_=0),l.animateRotate&&(g=v=f));const B={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:g,endAngle:v,options:this.resolveDataElementOptions(p,y.active?"active":a)};this.updateElement(y,p,B,a)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,a)=>{!isNaN(this.getParsed(a).r)&&this.chart.getDataVisibility(a)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Et(this.resolveDataElementOptions(t,n).angle||r):0}}R(Ji,"id","polarArea"),R(Ji,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(Ji,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Oh extends BA{}R(Oh,"id","pie"),R(Oh,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Oc extends er{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,a){return Kb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta,r=n.dataset,a=n.data||[],A=n.iScale.getLabels();if(r.points=a,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:A.length===a.length,options:s};this.updateElement(r,void 0,o,t)}this.updateElements(a,0,a.length,t)}updateElements(t,n,r,a){const A=this._cachedMeta.rScale,s=a==="reset";for(let o=n;o<n+r;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":a),u=A.getPointPositionForValue(o,this.getParsed(o).r),d=s?A.xCenter:u.x,f=s?A.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,h,a)}}}R(Oc,"id","radar"),R(Oc,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Oc,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Mc extends er{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y);return{label:r[t]||"",value:"("+o+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,a=this.chart._animationsDisabled;let{start:A,count:s}=Db(n,r,a);if(this._drawStart=A,this._drawCount=s,Lb(n)&&(A=0,s=r.length),this.options.showLine){const{dataset:o,_dataset:l}=n;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!a,options:c},t)}this.updateElements(r,A,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,a),d=this.getSharedOptions(u),f=this.includeOptions(a,d),h=s.axis,p=o.axis,{spanGaps:m,segment:y}=this.options,g=za(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||A||a==="none";let _=n>0&&this.getParsed(n-1);for(let B=n;B<n+r;++B){const b=t[B],w=this.getParsed(B),C=v?b:{},k=_e(w[p]),S=C[h]=s.getPixelForValue(w[h],B),T=C[p]=A||k?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,w,l):w[p],B);C.skip=isNaN(S)||isNaN(T)||k,C.stop=B>0&&Math.abs(w[h]-_[h])>g,y&&(C.parsed=w,C.raw=c.data[B]),f&&(C.options=d||this.resolveDataElementOptions(B,b.active?"active":a)),v||this.updateElement(b,B,C,a),_=w}this.updateSharedOptions(d,a,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let o=0;for(let l=n.length-1;l>=0;--l)o=Math.max(o,n[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const r=t.dataset,a=r.options&&r.options.borderWidth||0;if(!n.length)return a;const A=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(a,A,s)/2}}R(Mc,"id","scatter"),R(Mc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(Mc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var i7=Object.freeze({__proto__:null,BarController:Tc,BubbleController:Dc,DoughnutController:BA,LineController:Lc,PieController:Oh,PolarAreaController:Ji,RadarController:Oc,ScatterController:Mc});function iA(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Yg{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(Yg.prototype,t)}init(){}formats(){return iA()}parse(){return iA()}format(){return iA()}add(){return iA()}diff(){return iA()}startOf(){return iA()}endOf(){return iA()}}var Zb={_date:Yg};function o7(e,t,n,r){const{controller:a,data:A,_sorted:s}=e,o=a._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&A.length){const l=o._reversePixels?QL:Wr;if(r){if(a._sharedOptions){const c=A[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(A,t,n-u),f=l(A,t,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(A,t,n)}return{lo:0,hi:A.length-1}}function rl(e,t,n,r,a){const A=e.getSortedVisibleDatasetMetas(),s=n[t];for(let o=0,l=A.length;o<l;++o){const{index:c,data:u}=A[o],{lo:d,hi:f}=o7(A[o],t,s,a);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,c,h)}}}function l7(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,a){const A=t?Math.abs(r.x-a.x):0,s=n?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(A,2)+Math.pow(s,2))}}function vf(e,t,n,r,a){const A=[];return!a&&!e.isPointInArea(t)||rl(e,n,t,function(o,l,c){!a&&!Gr(o,e.chartArea,0)||o.inRange(t.x,t.y,r)&&A.push({element:o,datasetIndex:l,index:c})},!0),A}function c7(e,t,n,r){let a=[];function A(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=Fb(s,{x:t.x,y:t.y});So(d,c,u)&&a.push({element:s,datasetIndex:o,index:l})}return rl(e,n,t,A),a}function u7(e,t,n,r,a,A){let s=[];const o=l7(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,a);if(r&&!h)return;const p=u.getCenterPoint(a);if(!(!!A||e.isPointInArea(p))&&!h)return;const y=o(t,p);y<l?(s=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:f})}return rl(e,n,t,c),s}function Bf(e,t,n,r,a,A){return!A&&!e.isPointInArea(t)?[]:n==="r"&&!r?c7(e,t,n,a):u7(e,t,n,r,a,A)}function Nv(e,t,n,r,a){const A=[],s=n==="x"?"inXRange":"inYRange";let o=!1;return rl(e,n,t,(l,c,u)=>{l[s](t[n],a)&&(A.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,a))}),r&&!o?[]:A}var d7={evaluateInteractionItems:rl,modes:{index(e,t,n,r){const a=dA(t,e),A=n.axis||"x",s=n.includeInvisible||!1,o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s),l=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const a=dA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;let o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s);if(o.length>0){const l=o[0].datasetIndex,c=e.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(e,t,n,r){const a=dA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return vf(e,a,A,r,s)},nearest(e,t,n,r){const a=dA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return Bf(e,a,A,n.intersect,r,s)},x(e,t,n,r){const a=dA(t,e);return Nv(e,a,"x",n.intersect,r)},y(e,t,n,r){const a=dA(t,e);return Nv(e,a,"y",n.intersect,r)}}};const e_=["left","top","right","bottom"];function hi(e,t){return e.filter(n=>n.pos===t)}function Pv(e,t){return e.filter(n=>e_.indexOf(n.pos)===-1&&n.box.axis===t)}function pi(e,t){return e.sort((n,r)=>{const a=t?r:n,A=t?n:r;return a.weight===A.weight?a.index-A.index:a.weight-A.weight})}function f7(e){const t=[];let n,r,a,A,s,o;for(n=0,r=(e||[]).length;n<r;++n)a=e[n],{position:A,options:{stack:s,stackWeight:o=1}}=a,t.push({index:n,box:a,pos:A,horizontal:a.isHorizontal(),weight:a.weight,stack:s&&A+s,stackWeight:o});return t}function h7(e){const t={};for(const n of e){const{stack:r,pos:a,stackWeight:A}=n;if(!r||!e_.includes(a))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=A}return t}function p7(e,t){const n=h7(e),{vBoxMaxWidth:r,hBoxMaxHeight:a}=t;let A,s,o;for(A=0,s=e.length;A<s;++A){o=e[A];const{fullSize:l}=o.box,c=n[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*r:l&&t.availableWidth,o.height=a):(o.width=r,o.height=u?u*a:l&&t.availableHeight)}return n}function g7(e){const t=f7(e),n=pi(t.filter(c=>c.box.fullSize),!0),r=pi(hi(t,"left"),!0),a=pi(hi(t,"right")),A=pi(hi(t,"top"),!0),s=pi(hi(t,"bottom")),o=Pv(t,"x"),l=Pv(t,"y");return{fullSize:n,leftAndTop:r.concat(A),rightAndBottom:a.concat(l).concat(s).concat(o),chartArea:hi(t,"chartArea"),vertical:r.concat(a).concat(l),horizontal:A.concat(s).concat(o)}}function Hv(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function t_(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function m7(e,t,n,r){const{pos:a,box:A}=n,s=e.maxPadding;if(!ve(a)){n.size&&(e[a]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?A.height:A.width),n.size=d.size/d.count,e[a]+=n.size}A.getPadding&&t_(s,A.getPadding());const o=Math.max(0,t.outerWidth-Hv(s,e,"left","right")),l=Math.max(0,t.outerHeight-Hv(s,e,"top","bottom")),c=o!==e.w,u=l!==e.h;return e.w=o,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function v7(e){const t=e.maxPadding;function n(r){const a=Math.max(t[r]-e[r],0);return e[r]+=a,a}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function B7(e,t){const n=t.maxPadding;function r(a){const A={left:0,top:0,right:0,bottom:0};return a.forEach(s=>{A[s]=Math.max(t[s],n[s])}),A}return r(e?["left","right"]:["top","bottom"])}function Fi(e,t,n,r){const a=[];let A,s,o,l,c,u;for(A=0,s=e.length,c=0;A<s;++A){o=e[A],l=o.box,l.update(o.width||t.w,o.height||t.h,B7(o.horizontal,t));const{same:d,other:f}=m7(t,n,o,r);c|=d&&a.length,u=u||f,l.fullSize||a.push(o)}return c&&Fi(a,t,n,r)||u}function $l(e,t,n,r,a){e.top=n,e.left=t,e.right=t+r,e.bottom=n+a,e.width=r,e.height=a}function Rv(e,t,n,r){const a=n.padding;let{x:A,y:s}=t;for(const o of e){const l=o.box,c=r[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;vn(c.start)&&(s=c.start),l.fullSize?$l(l,a.left,s,n.outerWidth-a.right-a.left,f):$l(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;vn(c.start)&&(A=c.start),l.fullSize?$l(l,A,a.top,f,n.outerHeight-a.bottom-a.top):$l(l,A,t.top+c.placed,f,d),c.start=A,c.placed+=d,A=l.right}}t.x=A,t.y=s}var Gt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const a=_t(e.options.layout.padding),A=Math.max(t-a.width,0),s=Math.max(n-a.height,0),o=g7(e.boxes),l=o.vertical,c=o.horizontal;Ve(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:A,availableHeight:s,vBoxMaxWidth:A/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},a);t_(f,_t(r));const h=Object.assign({maxPadding:f,w:A,h:s,x:a.left,y:a.top},a),p=p7(l.concat(c),d);Fi(o.fullSize,h,d,p),Fi(l,h,d,p),Fi(c,h,d,p)&&Fi(l,h,d,p),v7(h),Rv(o.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,Rv(o.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ve(o.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class n_{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,a){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,a?Math.floor(n/a):r)}}isAttached(t){return!0}updateConfig(t){}}class y7 extends n_{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Nc="$chartjs",w7={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vv=e=>e===null||e==="";function b7(e,t){const n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e[Nc]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Vv(a)){const A=Cv(e,"width");A!==void 0&&(e.width=A)}if(Vv(r))if(e.style.height==="")e.height=e.width/(t||2);else{const A=Cv(e,"height");A!==void 0&&(e.height=A)}return e}const r_=EO?{passive:!0}:!1;function _7(e,t,n){e.addEventListener(t,n,r_)}function C7(e,t,n){e.canvas.removeEventListener(t,n,r_)}function E7(e,t){const n=w7[e.type]||e.type,{x:r,y:a}=dA(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:a!==void 0?a:null}}function fu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function k7(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||fu(o.addedNodes,r),s=s&&!fu(o.removedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function S7(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||fu(o.removedNodes,r),s=s&&!fu(o.addedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const xo=new Map;let Kv=0;function a_(){const e=window.devicePixelRatio;e!==Kv&&(Kv=e,xo.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function x7(e,t){xo.size||window.addEventListener("resize",a_),xo.set(e,t)}function F7(e){xo.delete(e),xo.size||window.removeEventListener("resize",a_)}function I7(e,t,n){const r=e.canvas,a=r&&zg(r);if(!a)return;const A=Tb((o,l)=>{const c=a.clientWidth;n(o,l),c<a.clientWidth&&n()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||A(c,u)});return s.observe(a),x7(e,A),s}function yf(e,t,n){n&&n.disconnect(),t==="resize"&&F7(e)}function U7(e,t,n){const r=e.canvas,a=Tb(A=>{e.ctx!==null&&n(E7(A,e))},e);return _7(r,t,a),a}class Q7 extends n_{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(b7(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Nc])return!1;const r=n[Nc].initial;["height","width"].forEach(A=>{const s=r[A];_e(s)?n.removeAttribute(A):n.setAttribute(A,s)});const a=r.style||{};return Object.keys(a).forEach(A=>{n.style[A]=a[A]}),n.width=n.width,delete n[Nc],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const a=t.$proxies||(t.$proxies={}),s={attach:k7,detach:S7,resize:I7}[n]||U7;a[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),a=r[n];if(!a)return;({attach:yf,detach:yf,resize:yf}[n]||C7)(t,n,a),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,a){return CO(t,n,r,a)}isAttached(t){const n=zg(t);return!!(n&&n.isConnected)}}function T7(e){return!Wb()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?y7:Q7}var xc;let an=(xc=class{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return za(this.x)&&za(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const a={};return t.forEach(A=>{a[A]=r[A]&&r[A].active()?r[A]._to:this[A]}),a}},R(xc,"defaults",{}),R(xc,"defaultRoutes"),xc);function D7(e,t){const n=e.options.ticks,r=L7(e),a=Math.min(n.maxTicksLimit||r,r),A=n.major.enabled?M7(t):[],s=A.length,o=A[0],l=A[s-1],c=[];if(s>a)return N7(t,c,A,s/a),c;const u=O7(A,t,a);if(s>0){let d,f;const h=s>1?Math.round((l-o)/(s-1)):null;for(Wl(t,c,u,_e(h)?0:o-h,o),d=0,f=s-1;d<f;d++)Wl(t,c,u,A[d],A[d+1]);return Wl(t,c,u,l,_e(h)?t.length:l+h),c}return Wl(t,c,u),c}function L7(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),a=e._maxLength/n;return Math.floor(Math.min(r,a))}function O7(e,t,n){const r=P7(e),a=t.length/n;if(!r)return Math.max(a,1);const A=xL(r);for(let s=0,o=A.length-1;s<o;s++){const l=A[s];if(l>a)return l}return Math.max(a,1)}function M7(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function N7(e,t,n,r){let a=0,A=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===A&&(t.push(e[s]),a++,A=n[a*r])}function Wl(e,t,n,r,a){const A=de(r,0),s=Math.min(de(a,e.length),e.length);let o=0,l,c,u;for(n=Math.ceil(n),a&&(l=a-r,n=l/Math.floor(l/n)),u=A;u<0;)o++,u=Math.round(A+o*n);for(c=Math.max(A,0);c<s;c++)c===u&&(t.push(e[c]),o++,u=Math.round(A+o*n))}function P7(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const H7=e=>e==="left"?"right":e==="right"?"left":e,$v=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Wv=(e,t)=>Math.min(t||e,e);function Gv(e,t){const n=[],r=e.length/t,a=e.length;let A=0;for(;A<a;A+=r)n.push(e[Math.floor(A)]);return n}function R7(e,t,n){const r=e.ticks.length,a=Math.min(t,r-1),A=e._startPixel,s=e._endPixel,o=1e-6;let l=e.getPixelForTick(a),c;if(!(n&&(r===1?c=Math.max(l-A,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(a-1))/2,l+=a<t?c:-c,l<A-o||l>s+o)))return l}function V7(e,t){Ve(e,n=>{const r=n.gc,a=r.length/2;let A;if(a>t){for(A=0;A<a;++A)delete n.data[r[A]];r.splice(0,a)}})}function gi(e){return e.drawTicks?e.tickLength:0}function zv(e,t){if(!e.display)return 0;const n=ft(e.font,t),r=_t(e.padding);return(Oe(e.text)?e.text.length:1)*n.lineHeight+r.height}function K7(e,t){return rA(e,{scale:t,type:"scale"})}function $7(e,t,n){return rA(e,{tick:n,index:t,type:"tick"})}function W7(e,t,n){let r=Rg(e);return(n&&t!=="right"||!n&&t==="right")&&(r=H7(r)),r}function G7(e,t,n,r){const{top:a,left:A,bottom:s,right:o,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,p;const m=s-a,y=o-A;if(e.isHorizontal()){if(h=$t(r,A,o),ve(n)){const g=Object.keys(n)[0],v=n[g];p=u[g].getPixelForValue(v)+m-t}else n==="center"?p=(c.bottom+c.top)/2+m-t:p=$v(e,n,t);f=o-A}else{if(ve(n)){const g=Object.keys(n)[0],v=n[g];h=u[g].getPixelForValue(v)-y+t}else n==="center"?h=(c.left+c.right)/2-y+t:h=$v(e,n,t);p=$t(r,s,a),d=n==="left"?-Je:Je}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class $A extends an{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:a}=this;return t=wn(t,Number.POSITIVE_INFINITY),n=wn(n,Number.NEGATIVE_INFINITY),r=wn(r,Number.POSITIVE_INFINITY),a=wn(a,Number.NEGATIVE_INFINITY),{min:wn(t,r),max:wn(n,a),minDefined:ut(t),maxDefined:ut(n)}}getMinMax(t){let{min:n,max:r,minDefined:a,maxDefined:A}=this.getUserBounds(),s;if(a&&A)return{min:n,max:r};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),a||(n=Math.min(n,s.min)),A||(r=Math.max(r,s.max));return n=A&&n>r?r:n,r=a&&n>r?n:r,{min:wn(n,wn(r,n)),max:wn(r,wn(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){He(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:a,grace:A,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=nO(this,A,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Gv(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=D7(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){He(this.options.afterUpdate,[this])}beforeSetDimensions(){He(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(){He(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),He(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){He(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,a,A;for(r=0,a=t.length;r<a;r++)A=t[r],A.label=He(n.callback,[A.value,r,t],this)}afterTickToLabelConversion(){He(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){He(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Wv(this.ticks.length,t.ticks.maxTicksLimit),a=n.minRotation||0,A=n.maxRotation;let s=a,o,l,c;if(!this._isVisible()||!n.display||a>=A||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=Mt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/r:h/(r-1),d+6>o&&(o=h/(r-(t.offset?.5:1)),l=this.maxHeight-gi(t.grid)-n.padding-zv(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=ed(Math.min(Math.asin(Mt((u.highest.height+6)/o,-1,1)),Math.asin(Mt(l/c,-1,1))-Math.asin(Mt(f/c,-1,1)))),s=Math.max(a,Math.min(A,s))),this.labelRotation=s}afterCalculateLabelRotation(){He(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){He(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:a,grid:A}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=zv(a,n.options.font);if(o?(t.width=this.maxWidth,t.height=gi(A)+l):(t.height=this.maxHeight,t.width=gi(A)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=Et(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(o){const g=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+g+h)}else{const g=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+g+h)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),o?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,a){const{ticks:{align:A,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=a*t.width,h=r*n.height):(f=r*t.height,h=a*n.width):A==="start"?h=n.width:A==="end"?f=t.width:A!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;A==="start"?(u=0,d=t.height):A==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){He(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)_e(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Gv(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:a,_longestTextCache:A}=this,s=[],o=[],l=Math.floor(n/Wv(n,r));let c=0,u=0,d,f,h,p,m,y,g,v,_,B,b;for(d=0;d<n;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),a.font=y=m.string,g=A[y]=A[y]||{data:{},gc:[]},v=m.lineHeight,_=B=0,!_e(p)&&!Oe(p))_=uu(a,g.data,g.gc,_,p),B=v;else if(Oe(p))for(f=0,h=p.length;f<h;++f)b=p[f],!_e(b)&&!Oe(b)&&(_=uu(a,g.data,g.gc,_,b),B+=v);s.push(_),o.push(B),c=Math.max(_,c),u=Math.max(B,u)}V7(A,n);const w=s.indexOf(c),C=o.indexOf(u),k=S=>({width:s[S]||0,height:o[S]||0});return{first:k(0),last:k(n-1),widest:k(w),highest:k(C),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return UL(this._alignToPixels?sA(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=$7(this.getContext(),t,r))}return this.$context||(this.$context=K7(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Et(this.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),A=this._getLabelSizes(),s=t.autoSkipPadding||0,o=A?A.widest.width+s:0,l=A?A.highest.height+s:0;return this.isHorizontal()?l*r>o*a?o/r:l/a:l*a<o*r?l/r:o/a}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,a=this.options,{grid:A,position:s,border:o}=a,l=A.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=gi(A),h=[],p=o.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,g=function(j){return sA(r,j,m)};let v,_,B,b,w,C,k,S,T,U,F,Q;if(s==="top")v=g(this.bottom),C=this.bottom-f,S=v-y,U=g(t.top)+y,Q=t.bottom;else if(s==="bottom")v=g(this.top),U=t.top,Q=g(t.bottom)-y,C=v+y,S=this.top+f;else if(s==="left")v=g(this.right),w=this.right-f,k=v-y,T=g(t.left)+y,F=t.right;else if(s==="right")v=g(this.left),T=t.left,F=g(t.right)-y,w=v+y,k=this.left+f;else if(n==="x"){if(s==="center")v=g((t.top+t.bottom)/2+.5);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}U=t.top,Q=t.bottom,C=v+y,S=C+f}else if(n==="y"){if(s==="center")v=g((t.left+t.right)/2);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}w=v-y,k=w-f,T=t.left,F=t.right}const Y=de(a.ticks.maxTicksLimit,d),X=Math.max(1,Math.ceil(d/Y));for(_=0;_<d;_+=X){const j=this.getContext(_),K=A.setContext(j),oe=o.setContext(j),$=K.lineWidth,ae=K.color,ce=oe.dash||[],me=oe.dashOffset,Ee=K.tickWidth,fe=K.tickColor,ne=K.tickBorderDash||[],N=K.tickBorderDashOffset;B=R7(this,_,l),B!==void 0&&(b=sA(r,B,$),c?w=k=T=F=b:C=S=U=Q=b,h.push({tx1:w,ty1:C,tx2:k,ty2:S,x1:T,y1:U,x2:F,y2:Q,width:$,color:ae,borderDash:ce,borderDashOffset:me,tickWidth:Ee,tickColor:fe,tickBorderDash:ne,tickBorderDashOffset:N}))}return this._ticksLength=d,this._borderValue=v,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:a,ticks:A}=r,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=A,f=gi(r.grid),h=f+u,p=d?-u:h,m=-Et(this.labelRotation),y=[];let g,v,_,B,b,w,C,k,S,T,U,F,Q="middle";if(a==="top")w=this.bottom-p,C=this._getXAxisLabelAlignment();else if(a==="bottom")w=this.top+p,C=this._getXAxisLabelAlignment();else if(a==="left"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,b=X.x}else if(a==="right"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,b=X.x}else if(n==="x"){if(a==="center")w=(t.top+t.bottom)/2+h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];w=this.chart.scales[X].getPixelForValue(j)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(a==="center")b=(t.left+t.right)/2-h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];b=this.chart.scales[X].getPixelForValue(j)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const Y=this._getLabelSizes();for(g=0,v=o.length;g<v;++g){_=o[g],B=_.label;const X=A.setContext(this.getContext(g));k=this.getPixelForTick(g)+A.labelOffset,S=this._resolveTickFontOptions(g),T=S.lineHeight,U=Oe(B)?B.length:1;const j=U/2,K=X.color,oe=X.textStrokeColor,$=X.textStrokeWidth;let ae=C;s?(b=k,C==="inner"&&(g===v-1?ae=this.options.reverse?"left":"right":g===0?ae=this.options.reverse?"right":"left":ae="center"),a==="top"?c==="near"||m!==0?F=-U*T+T/2:c==="center"?F=-Y.highest.height/2-j*T+T:F=-Y.highest.height+T/2:c==="near"||m!==0?F=T/2:c==="center"?F=Y.highest.height/2-j*T:F=Y.highest.height-U*T,d&&(F*=-1),m!==0&&!X.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(w=k,F=(1-U)*T/2);let ce;if(X.showLabelBackdrop){const me=_t(X.backdropPadding),Ee=Y.heights[g],fe=Y.widths[g];let ne=F-me.top,N=0-me.left;switch(Q){case"middle":ne-=Ee/2;break;case"bottom":ne-=Ee;break}switch(C){case"center":N-=fe/2;break;case"right":N-=fe;break}ce={left:N,top:ne,width:fe+me.width,height:Ee+me.height,color:X.backdropColor}}y.push({label:B,font:S,textOffset:F,options:{rotation:m,color:K,strokeColor:oe,strokeWidth:$,textAlign:ae,textBaseline:Q,translation:[b,w],backdrop:ce}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Et(this.labelRotation))return t==="top"?"left":"right";let a="center";return n.align==="start"?a="left":n.align==="end"?a="right":n.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:a,padding:A}}=this.options,s=this._getLabelSizes(),o=t+A,l=s.widest.width;let c,u;return n==="left"?a?(u=this.right+A,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?a?(u=this.left+A,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:a,width:A,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,a,A,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const a=this.ticks.findIndex(A=>A.value===t);return a>=0?n.setContext(this.getContext(a)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let A,s;const o=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(A=0,s=a.length;A<s;++A){const l=a[A];n.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:a}}=this,A=r.setContext(this.getContext()),s=r.display?A.width:0;if(!s)return;const o=a.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=sA(t,this.left,s)-s/2,u=sA(t,this.right,o)+o/2,d=f=l):(d=sA(t,this.top,s)-s/2,f=sA(t,this.bottom,o)+o/2,c=u=l),n.save(),n.lineWidth=A.width,n.strokeStyle=A.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&tl(r,a);const A=this.getLabelItems(t);for(const s of A){const o=s.options,l=s.font,c=s.label,u=s.textOffset;OA(r,c,0,u,l,o)}a&&nl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:a}}=this;if(!r.display)return;const A=ft(r.font),s=_t(r.padding),o=r.align;let l=A.lineHeight/2;n==="bottom"||n==="center"||ve(n)?(l+=s.bottom,Oe(r.text)&&(l+=A.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=G7(this,l,n,o);OA(t,r.text,0,0,A,{color:r.color,maxWidth:d,rotation:f,textAlign:W7(o,n,a),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=de(t.grid&&t.grid.z,-1),a=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$A.prototype.draw?[{z:n,draw:A=>{this.draw(A)}}]:[{z:r,draw:A=>{this.drawBackground(),this.drawGrid(A),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:n,draw:A=>{this.drawLabels(A)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let A,s;for(A=0,s=n.length;A<s;++A){const o=n[A];o[r]===this.id&&(!t||o.type===t)&&a.push(o)}return a}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ft(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Gl{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;Y7(n)&&(r=this.register(n));const a=this.items,A=t.id,s=this.scope+"."+A;if(!A)throw new Error("class does not have id: "+t);return A in a||(a[A]=t,z7(t,s,r),this.override&&dt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,a=this.scope;r in n&&delete n[r],a&&r in dt[a]&&(delete dt[a][r],this.override&&delete LA[r])}}function z7(e,t,n){const r=wr(Object.create(null),[n?dt.get(n):{},dt.get(t),e.defaults]);dt.set(t,r),e.defaultRoutes&&j7(t,e.defaultRoutes),e.descriptors&&dt.describe(t,e.descriptors)}function j7(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),a=r.pop(),A=[e].concat(r).join("."),s=t[n].split("."),o=s.pop(),l=s.join(".");dt.route(A,a,l,o)})}function Y7(e){return"id"in e&&"defaults"in e}class q7{constructor(){this.controllers=new Gl(er,"datasets",!0),this.elements=new Gl(an,"elements"),this.plugins=new Gl(Object,"plugins"),this.scales=new Gl($A,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(a=>{const A=r||this._getRegistryForType(a);r||A.isForType(a)||A===this.plugins&&a.id?this._exec(t,A,a):Ve(a,s=>{const o=r||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,n,r){const a=Ng(t);He(r["before"+a],[],r),n[t](r),He(r["after"+a],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const a=n.get(t);if(a===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return a}}var ur=new q7;class X7{constructor(){this._init=[]}notify(t,n,r,a){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const A=a?this._descriptors(t).filter(a):this._descriptors(t),s=this._notify(A,t,n,r);return n==="afterDestroy"&&(this._notify(A,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,a){a=a||{};for(const A of t){const s=A.plugin,o=s[r],l=[n,a,A.options];if(He(o,l,s)===!1&&a.cancelable)return!1}return!0}invalidate(){_e(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,a=de(r.options&&r.options.plugins,{}),A=J7(r);return a===!1&&!n?[]:eM(t,A,a,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,a=(A,s)=>A.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(a(n,r),t,"stop"),this._notify(a(r,n),t,"start")}}function J7(e){const t={},n=[],r=Object.keys(ur.plugins.items);for(let A=0;A<r.length;A++)n.push(ur.getPlugin(r[A]));const a=e.plugins||[];for(let A=0;A<a.length;A++){const s=a[A];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function Z7(e,t){return!t&&e===!1?null:e===!0?{}:e}function eM(e,{plugins:t,localIds:n},r,a){const A=[],s=e.getContext();for(const o of t){const l=o.id,c=Z7(r[l],a);c!==null&&A.push({plugin:o,options:tM(e.config,{plugin:o,local:n[l]},c,s)})}return A}function tM(e,{plugin:t,local:n},r,a){const A=e.pluginScopeKeys(t),s=e.getOptionScopes(r,A);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mh(e,t){const n=dt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function nM(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function rM(e,t){return e===t?"_index_":"_value_"}function jv(e){if(e==="x"||e==="y"||e==="r")return e}function aM(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Nh(e,...t){if(jv(e))return e;for(const n of t){const r=n.axis||aM(n.position)||e.length>1&&jv(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Yv(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function AM(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Yv(e,"x",n[0])||Yv(e,"y",n[0])}return{}}function sM(e,t){const n=LA[e.type]||{scales:{}},r=t.scales||{},a=Mh(e.type,t),A=Object.create(null);return Object.keys(r).forEach(s=>{const o=r[s];if(!ve(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Nh(s,o,AM(s,e),dt.scales[o.type]),c=rM(l,a),u=n.scales||{};A[s]=ji(Object.create(null),[{axis:l},o,u[l],u[c]])}),e.data.datasets.forEach(s=>{const o=s.type||e.type,l=s.indexAxis||Mh(o,t),u=(LA[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=nM(d,l),h=s[f+"AxisID"]||f;A[h]=A[h]||Object.create(null),ji(A[h],[{axis:f},r[h],u[d]])})}),Object.keys(A).forEach(s=>{const o=A[s];ji(o,[dt.scales[o.type],dt.scale])}),A}function A_(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=sM(e,t)}function s_(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function iM(e){return e=e||{},e.data=s_(e.data),A_(e),e}const qv=new Map,i_=new Set;function zl(e,t){let n=qv.get(e);return n||(n=t(),qv.set(e,n),i_.add(n)),n}const mi=(e,t,n)=>{const r=Ga(t,n);r!==void 0&&e.add(r)};class oM{constructor(t){this._config=iM(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=s_(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),A_(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return zl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return zl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return zl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return zl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let a=r.get(t);return(!a||n)&&(a=new Map,r.set(t,a)),a}getOptionScopes(t,n,r){const{options:a,type:A}=this,s=this._cachedScopes(t,r),o=s.get(n);if(o)return o;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>mi(l,t,d))),u.forEach(d=>mi(l,a,d)),u.forEach(d=>mi(l,LA[A]||{},d)),u.forEach(d=>mi(l,dt,d)),u.forEach(d=>mi(l,Dh,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),i_.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,LA[n]||{},dt.datasets[n]||{},{type:n},dt,Dh]}resolveNamedOptions(t,n,r,a=[""]){const A={$shared:!0},{resolver:s,subPrefixes:o}=Xv(this._resolverCache,t,a);let l=s;if(cM(s,n)){A.$shared=!1,r=mn(r)?r():r;const c=this.createResolver(t,r,o);l=Vs(s,r,c)}for(const c of n)A[c]=l[c];return A}createResolver(t,n,r=[""],a){const{resolver:A}=Xv(this._resolverCache,t,r);return ve(n)?Vs(A,n,void 0,a):A}}function Xv(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const a=n.join();let A=r.get(a);return A||(A={resolver:$g(t,n),subPrefixes:n.filter(o=>!o.toLowerCase().includes("hover"))},r.set(a,A)),A}const lM=e=>ve(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||mn(e[n]),!1);function cM(e,t){const{isScriptable:n,isIndexable:r}=Pb(e);for(const a of t){const A=n(a),s=r(a),o=(s||A)&&e[a];if(A&&(mn(o)||lM(o))||s&&Oe(o))return!0}return!1}var uM="4.3.0";const dM=["top","bottom","left","right","chartArea"];function Jv(e,t){return e==="top"||e==="bottom"||dM.indexOf(e)===-1&&t==="x"}function Zv(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function eB(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),He(n&&n.onComplete,[e],t)}function fM(e){const t=e.chart,n=t.options.animation;He(n&&n.onProgress,[e],t)}function o_(e){return Wb()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Pc={},tB=e=>{const t=o_(e);return Object.values(Pc).filter(n=>n.canvas===t).pop()};function hM(e,t,n){const r=Object.keys(e);for(const a of r){const A=+a;if(A>=t){const s=e[a];delete e[a],(n>0||A>t)&&(e[A+n]=s)}}}function pM(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function gM(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}class Le{static register(...t){ur.add(...t),nB()}static unregister(...t){ur.remove(...t),nB()}constructor(t,n){const r=this.config=new oM(n),a=o_(t),A=tB(a);if(A)throw new Error("Canvas is already in use. Chart with ID '"+A.id+"' must be destroyed before the canvas with ID '"+A.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||T7(a)),this.platform.updateConfig(r);const o=this.platform.acquireContext(a,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=yL(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,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 X7,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=LL(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Pc[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Mr.listen(this,"complete",eB),Mr.listen(this,"progress",fM),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:a,_aspectRatio:A}=this;return _e(t)?n&&A?A:a?r/a:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ur}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_v(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return yv(this.canvas,this.ctx),this}stop(){return Mr.stop(this),this}resize(t,n){Mr.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,a=this.canvas,A=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(a,t,n,A),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,_v(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),He(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ve(n,(r,a)=>{r.id=a})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,a=Object.keys(r).reduce((s,o)=>(s[o]=!1,s),{});let A=[];n&&(A=A.concat(Object.keys(n).map(s=>{const o=n[s],l=Nh(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ve(A,s=>{const o=s.options,l=o.id,c=Nh(l,o),u=de(o.type,s.dtype);(o.position===void 0||Jv(o.position,c)!==Jv(s.dposition))&&(o.position=s.dposition),a[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=ur.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(o,t)}),Ve(a,(s,o)=>{s||delete r[o]}),Ve(r,s=>{Gt.configure(this,s,s.options),Gt.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((a,A)=>a.index-A.index),r>n){for(let a=n;a<r;++a)this._destroyDatasetMeta(a);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Zv("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,a)=>{n.filter(A=>A===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=n.length;r<a;r++){const A=n[r];let s=this.getDatasetMeta(r);const o=A.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=o,s.indexAxis=A.indexAxis||Mh(o,this.options),s.order=A.order||0,s.index=r,s.label=""+A.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=ur.getController(o),{datasetElementType:c,dataElementType:u}=dt.datasets[o];Object.assign(l,{dataElementType:ur.getElement(u),datasetElementType:c&&ur.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Ve(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const A=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!a&&A.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),a||Ve(A,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Zv("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Ve(this.scales,t=>{Gt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!dv(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:A}of n){const s=r==="_removeElements"?-A:A;hM(t,a,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=A=>new Set(t.filter(s=>s[0]===A).map((s,o)=>o+","+s.splice(1).join(","))),a=r(0);for(let A=1;A<n;A++)if(!dv(a,r(A)))return;return Array.from(a).map(A=>A.split(",")).map(A=>({method:A[1],start:+A[2],count:+A[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Gt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ve(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,A)=>{a._idx=A}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,mn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),a={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(n),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Mr.has(this)?this.attached&&!Mr.running(this)&&Mr.start(this):(this.draw(),eB({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resize(r,a),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let a,A;for(a=0,A=n.length;a<A;++a){const s=n[a];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,a=!r.disabled,A=gM(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(a&&tl(n,{left:r.left===!1?0:A.left-r.left,right:r.right===!1?this.width:A.right+r.right,top:r.top===!1?0:A.top-r.top,bottom:r.bottom===!1?this.height:A.bottom+r.bottom}),t.controller.draw(),a&&nl(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Gr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,a){const A=d7.modes[n];return typeof A=="function"?A(this,t,r,a):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let a=r.filter(A=>A&&A._dataset===n).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=rA(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const a=r?"show":"hide",A=this.getDatasetMeta(t),s=A.controller._resolveAnimations(void 0,a);vn(n)?(A.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(A,{visible:r}),this.update(o=>o.datasetIndex===t?a:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Mr.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),yv(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Pc[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(A,s)=>{n.addEventListener(this,A,s),t[A]=s},a=(A,s,o)=>{A.offsetX=s,A.offsetY=o,this._eventHandler(A)};Ve(this.options.events,A=>r(A,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},a=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},A=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{a("attach",o),this.attached=!0,this.resize(),r("resize",A),r("detach",s)};s=()=>{this.attached=!1,a("resize",A),this._stop(),this._resize(0,0),r("attach",o)},n.isAttached(this.canvas)?o():s()}unbindEvents(){Ve(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ve(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const a=r?"set":"remove";let A,s,o,l;for(n==="dataset"&&(A=this.getDatasetMeta(t[0].datasetIndex),A.controller["_"+a+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[a+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:A,index:s})=>{const o=this.getDatasetMeta(A);if(!o)throw new Error("No dataset found at index "+A);return{datasetIndex:A,element:o.data[s],index:s}});!iu(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const a=this.options.hover,A=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=A(n,t),o=r?t:A(t,n);s.length&&this.updateHoverStyle(s,a.mode,!1),o.length&&a.mode&&this.updateHoverStyle(o,a.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},a=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const A=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(A||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:a=[],options:A}=this,s=n,o=this._getActiveElements(t,a,r,s),l=kL(t),c=pM(t,this._lastEvent,r,l);r&&(this._lastEvent=null,He(A.onHover,[t,o,this],this),l&&He(A.onClick,[t,o,this],this));const u=!iu(o,a);return(u||n)&&(this._active=o,this._updateHoverStyles(o,a,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,a){if(t.type==="mouseout")return[];if(!r)return n;const A=this.options.hover;return this.getElementsAtEventForMode(t,A.mode,A,a)}}R(Le,"defaults",dt),R(Le,"instances",Pc),R(Le,"overrides",LA),R(Le,"registry",ur),R(Le,"version",uM),R(Le,"getChart",tB);function nB(){return Ve(Le.instances,e=>e._plugins.invalidate())}function mM(e,t,n){const{startAngle:r,pixelMargin:a,x:A,y:s,outerRadius:o,innerRadius:l}=t;let c=a/o;e.beginPath(),e.arc(A,s,o,r-c,n+c),l>a?(c=a/l,e.arc(A,s,l,n+c,r-c,!0)):e.arc(A,s,a,n+Je,r-Je),e.closePath(),e.clip()}function vM(e){return Kg(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BM(e,t,n,r){const a=vM(e.options.borderRadius),A=(n-t)/2,s=Math.min(A,r*t/2),o=l=>{const c=(n-Math.min(A,l))*r/2;return Mt(l,0,Math.min(A,c))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:Mt(a.innerStart,0,s),innerEnd:Mt(a.innerEnd,0,s)}}function rs(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function hu(e,t,n,r,a,A){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let h=0;const p=a-l;if(r){const X=u>0?u-r:0,j=d>0?d-r:0,K=(X+j)/2,oe=K!==0?p*K/(K+r):p;h=(p-oe)/2}const m=Math.max(.001,p*d-n/Qe)/d,y=(p-m)/2,g=l+y+h,v=a-y-h,{outerStart:_,outerEnd:B,innerStart:b,innerEnd:w}=BM(t,f,d,v-g),C=d-_,k=d-B,S=g+_/C,T=v-B/k,U=f+b,F=f+w,Q=g+b/U,Y=v-w/F;if(e.beginPath(),A){const X=(S+T)/2;if(e.arc(s,o,d,S,X),e.arc(s,o,d,X,T),B>0){const $=rs(k,T,s,o);e.arc($.x,$.y,B,T,v+Je)}const j=rs(F,v,s,o);if(e.lineTo(j.x,j.y),w>0){const $=rs(F,Y,s,o);e.arc($.x,$.y,w,v+Je,Y+Math.PI)}const K=(v-w/f+(g+b/f))/2;if(e.arc(s,o,f,v-w/f,K,!0),e.arc(s,o,f,K,g+b/f,!0),b>0){const $=rs(U,Q,s,o);e.arc($.x,$.y,b,Q+Math.PI,g-Je)}const oe=rs(C,g,s,o);if(e.lineTo(oe.x,oe.y),_>0){const $=rs(C,S,s,o);e.arc($.x,$.y,_,g-Je,S)}}else{e.moveTo(s,o);const X=Math.cos(S)*d+s,j=Math.sin(S)*d+o;e.lineTo(X,j);const K=Math.cos(T)*d+s,oe=Math.sin(T)*d+o;e.lineTo(K,oe)}e.closePath()}function yM(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o}=t;let l=t.endAngle;if(A){hu(e,t,n,r,l,a);for(let c=0;c<A;++c)e.fill();isNaN(o)||(l=s+(o%Xe||Xe))}return hu(e,t,n,r,l,a),e.fill(),l}function wM(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(A){hu(e,t,n,r,p,a);for(let m=0;m<A;++m)e.stroke();isNaN(o)||(p=s+(o%Xe||Xe))}h&&mM(e,t,p),A||(hu(e,t,n,r,p,a),e.stroke())}class ys extends an{constructor(n){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,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.getProps(["x","y"],a),{angle:s,distance:o}=Fb(A,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,m=de(f,c-l)>=Xe||So(s,l,c),y=$r(o,u+h,d+h);return m&&y}getCenterPoint(n){const{x:r,y:a,startAngle:A,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(A+s)/2,f=(o+l+u+c)/2;return{x:r+Math.cos(d)*f,y:a+Math.sin(d)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:a}=this,A=(r.offset||0)/4,s=(r.spacing||0)/2,o=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>Xe?Math.floor(a/Xe):0,a===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*A,Math.sin(l)*A);const c=1-Math.sin(Math.min(Qe,a||0)),u=A*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,yM(n,this,u,s,o),wM(n,this,u,s,o),n.restore()}}R(ys,"id","arc"),R(ys,"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(ys,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(ys,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function l_(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function bM(e,t,n){e.lineTo(n.x,n.y)}function _M(e){return e.stepped?zL:e.tension||e.cubicInterpolationMode==="monotone"?jL:bM}function c_(e,t,n={}){const r=e.length,{start:a=0,end:A=r-1}=n,{start:s,end:o}=t,l=Math.max(a,s),c=Math.min(A,o),u=a<s&&A<s||a>o&&A>o;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function CM(e,t,n,r){const{points:a,options:A}=t,{count:s,start:o,loop:l,ilen:c}=c_(a,n,r),u=_M(A);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=c;++h)p=a[(o+(f?c-h:h))%s],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,A.stepped),m=p);return l&&(p=a[(o+(f?c:0))%s],u(e,m,p,f,A.stepped)),!!l}function EM(e,t,n,r){const a=t.points,{count:A,start:s,ilen:o}=c_(a,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,p,m,y,g;const v=B=>(s+(c?o-B:B))%A,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,g))};for(l&&(h=a[v(0)],e.moveTo(h.x,h.y)),f=0;f<=o;++f){if(h=a[v(f)],h.skip)continue;const B=h.x,b=h.y,w=B|0;w===p?(b<m?m=b:b>y&&(y=b),u=(d*u+B)/++d):(_(),e.lineTo(B,b),p=w,d=0,m=y=b),g=b}_()}function Ph(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?EM:CM}function kM(e){return e.stepped?kO:e.tension||e.cubicInterpolationMode==="monotone"?SO:fA}function SM(e,t,n,r){let a=t._path;a||(a=t._path=new Path2D,t.path(a,n,r)&&a.closePath()),l_(e,t.options),e.stroke(a)}function xM(e,t,n,r){const{segments:a,options:A}=t,s=Ph(t);for(const o of a)l_(e,A,o.style),e.beginPath(),s(e,t,o,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const FM=typeof Path2D=="function";function IM(e,t,n,r){FM&&!t.options.segment?SM(e,t,n,r):xM(e,t,n,r)}class ka extends an{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;vO(this._points,r,t,a,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=TO(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,a=t[n],A=this.points,s=qb(this,{property:n,start:a,end:a});if(!s.length)return;const o=[],l=kM(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],h=A[d],p=A[f];if(h===p){o.push(h);continue}const m=Math.abs((a-h[n])/(p[n]-h[n])),y=l(h,p,m,r.stepped);y[n]=t[n],o.push(y)}return o.length===1?o[0]:o}pathSegment(t,n,r){return Ph(this)(t,this,n,r)}path(t,n,r){const a=this.segments,A=Ph(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const o of a)s&=A(t,this,o,{start:n,end:n+r-1});return!!s}draw(t,n,r,a){const A=this.options||{};(this.points||[]).length&&A.borderWidth&&(t.save(),IM(t,this,r,a),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(ka,"id","line"),R(ka,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(ka,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(ka,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function rB(e,t,n,r){const a=e.options,{[n]:A}=e.getProps([n],r);return Math.abs(t-A)<a.radius+a.hitRadius}class Zi extends an{constructor(n){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,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.options,{x:s,y:o}=this.getProps(["x","y"],a);return Math.pow(n-s,2)+Math.pow(r-o,2)<Math.pow(A.hitRadius+A.radius,2)}inXRange(n,r){return rB(this,n,"x",r)}inYRange(n,r){return rB(this,n,"y",r)}getCenterPoint(n){const{x:r,y:a}=this.getProps(["x","y"],n);return{x:r,y:a}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const a=r&&n.borderWidth||0;return(r+a)*2}draw(n,r){const a=this.options;this.skip||a.radius<.1||!Gr(this,r,this.size(a)/2)||(n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.fillStyle=a.backgroundColor,Lh(n,a,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(Zi,"id","point"),R(Zi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(Zi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function u_(e,t){const{x:n,y:r,base:a,width:A,height:s}=e.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return e.horizontal?(d=s/2,o=Math.min(n,a),l=Math.max(n,a),c=r-d,u=r+d):(d=A/2,o=n-d,l=n+d,c=Math.min(r,a),u=Math.max(r,a)),{left:o,top:c,right:l,bottom:u}}function Sa(e,t,n,r){return e?0:Mt(t,n,r)}function UM(e,t,n){const r=e.options.borderWidth,a=e.borderSkipped,A=Nb(r);return{t:Sa(a.top,A.top,0,n),r:Sa(a.right,A.right,0,t),b:Sa(a.bottom,A.bottom,0,n),l:Sa(a.left,A.left,0,t)}}function QM(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),a=e.options.borderRadius,A=Da(a),s=Math.min(t,n),o=e.borderSkipped,l=r||ve(a);return{topLeft:Sa(!l||o.top||o.left,A.topLeft,0,s),topRight:Sa(!l||o.top||o.right,A.topRight,0,s),bottomLeft:Sa(!l||o.bottom||o.left,A.bottomLeft,0,s),bottomRight:Sa(!l||o.bottom||o.right,A.bottomRight,0,s)}}function TM(e){const t=u_(e),n=t.right-t.left,r=t.bottom-t.top,a=UM(e,n/2,r/2),A=QM(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:A},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,A.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,A.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,A.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,A.bottomRight-Math.max(a.b,a.r))}}}}function wf(e,t,n,r){const a=t===null,A=n===null,o=e&&!(a&&A)&&u_(e,r);return o&&(a||$r(t,o.left,o.right))&&(A||$r(n,o.top,o.bottom))}function DM(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function LM(e,t){e.rect(t.x,t.y,t.w,t.h)}function bf(e,t,n={}){const r=e.x!==n.x?-t:0,a=e.y!==n.y?-t:0,A=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-a;return{x:e.x+r,y:e.y+a,w:e.w+A,h:e.h+s,radius:e.radius}}class eo extends an{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:a}}=this,{inner:A,outer:s}=TM(this),o=DM(s.radius)?Rs:LM;t.save(),(s.w!==A.w||s.h!==A.h)&&(t.beginPath(),o(t,bf(s,n,A)),t.clip(),o(t,bf(A,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),o(t,bf(A,n)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,n,r){return wf(this,t,n,r)}inXRange(t,n){return wf(this,t,null,n)}inYRange(t,n){return wf(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:a,horizontal:A}=this.getProps(["x","y","base","horizontal"],t);return{x:A?(n+a)/2:n,y:A?r:(r+a)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(eo,"id","bar"),R(eo,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(eo,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var OM=Object.freeze({__proto__:null,ArcElement:ys,BarElement:eo,LineElement:ka,PointElement:Zi});const Hh=["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)"],aB=Hh.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function d_(e){return Hh[e%Hh.length]}function f_(e){return aB[e%aB.length]}function MM(e,t){return e.borderColor=d_(t),e.backgroundColor=f_(t),++t}function NM(e,t){return e.backgroundColor=e.data.map(()=>d_(t++)),t}function PM(e,t){return e.backgroundColor=e.data.map(()=>f_(t++)),t}function HM(e){let t=0;return(n,r)=>{const a=e.getDatasetMeta(r).controller;a instanceof BA?t=NM(n,t):a instanceof Ji?t=PM(n,t):a&&(t=MM(n,t))}}function AB(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function RM(e){return e&&(e.borderColor||e.backgroundColor)}var VM={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:a}=e.config,{elements:A}=a;if(!n.forceOverride&&(AB(r)||RM(a)||A&&AB(A)))return;const s=HM(e);r.forEach(s)}};function KM(e,t,n,r,a){const A=a.samples||r;if(A>=n)return e.slice(t,t+n);const s=[],o=(n-2)/(A-2);let l=0;const c=t+n-1;let u=t,d,f,h,p,m;for(s[l++]=e[u],d=0;d<A-2;d++){let y=0,g=0,v;const _=Math.floor((d+1)*o)+1+t,B=Math.min(Math.floor((d+2)*o)+1,n)+t,b=B-_;for(v=_;v<B;v++)y+=e[v].x,g+=e[v].y;y/=b,g/=b;const w=Math.floor(d*o)+1+t,C=Math.min(Math.floor((d+1)*o)+1,n)+t,{x:k,y:S}=e[u];for(h=p=-1,v=w;v<C;v++)p=.5*Math.abs((k-y)*(e[v].y-S)-(k-e[v].x)*(g-S)),p>h&&(h=p,f=e[v],m=v);s[l++]=f,u=m}return s[l++]=e[c],s}function $M(e,t,n,r){let a=0,A=0,s,o,l,c,u,d,f,h,p,m;const y=[],g=t+n-1,v=e[t].x,B=e[g].x-v;for(s=t;s<t+n;++s){o=e[s],l=(o.x-v)/B*r,c=o.y;const b=l|0;if(b===u)c<p?(p=c,d=s):c>m&&(m=c,f=s),a=(A*a+o.x)/++A;else{const w=s-1;if(!_e(d)&&!_e(f)){const C=Math.min(d,f),k=Math.max(d,f);C!==h&&C!==w&&y.push({...e[C],x:a}),k!==h&&k!==w&&y.push({...e[k],x:a})}s>0&&w!==h&&y.push(e[w]),y.push(o),u=b,A=0,p=m=c,d=f=h=s}}return y}function h_(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function sB(e){e.data.datasets.forEach(t=>{h_(t)})}function WM(e,t){const n=t.length;let r=0,a;const{iScale:A}=e,{min:s,max:o,minDefined:l,maxDefined:c}=A.getUserBounds();return l&&(r=Mt(Wr(t,A.axis,s).lo,0,n-1)),c?a=Mt(Wr(t,A.axis,o).hi+1,r,n)-r:a=n-r,{start:r,count:a}}var GM={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){sB(e);return}const r=e.width;e.data.datasets.forEach((a,A)=>{const{_data:s,indexAxis:o}=a,l=e.getDatasetMeta(A),c=s||a.data;if(tt([o,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=WM(l,c);const h=n.threshold||4*r;if(f<=h){h_(a);return}_e(s)&&(a._data=c,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=KM(c,d,f,r,n);break;case"min-max":p=$M(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}a._decimated=p})},destroy(e){sB(e)}};function zM(e,t,n){const r=e.segments,a=e.points,A=t.points,s=[];for(const o of r){let{start:l,end:c}=o;c=qg(l,c,a);const u=Rh(n,a[l],a[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:a[l],end:a[c]});continue}const d=qb(t,u);for(const f of d){const h=Rh(n,A[f.start],A[f.end],f.loop),p=Yb(o,a,h);for(const m of p)s.push({source:m,target:f,start:{[n]:iB(u,h,"start",Math.max)},end:{[n]:iB(u,h,"end",Math.min)}})}}return s}function Rh(e,t,n,r){if(r)return;let a=t[e],A=n[e];return e==="angle"&&(a=_n(a),A=_n(A)),{property:e,start:a,end:A}}function jM(e,t){const{x:n=null,y:r=null}=e||{},a=t.points,A=[];return t.segments.forEach(({start:s,end:o})=>{o=qg(s,o,a);const l=a[s],c=a[o];r!==null?(A.push({x:l.x,y:r}),A.push({x:c.x,y:r})):n!==null&&(A.push({x:n,y:l.y}),A.push({x:n,y:c.y}))}),A}function qg(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function iB(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function p_(e,t){let n=[],r=!1;return Oe(e)?(r=!0,n=e):n=jM(e,t),n.length?new ka({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function oB(e){return e&&e.fill!==!1}function YM(e,t,n){let a=e[t].fill;const A=[t];let s;if(!n)return a;for(;a!==!1&&A.indexOf(a)===-1;){if(!ut(a))return a;if(s=e[a],!s)return!1;if(s.visible)return a;A.push(a),a=s.fill}return!1}function qM(e,t,n){const r=e9(e);if(ve(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return ut(a)&&Math.floor(a)===a?XM(r[0],t,a,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function XM(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function JM(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ve(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function ZM(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ve(e)?r=e.value:r=t.getBaseValue(),r}function e9(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function t9(e){const{scale:t,index:n,line:r}=e,a=[],A=r.segments,s=r.points,o=n9(t,n);o.push(p_({x:null,y:t.bottom},r));for(let l=0;l<A.length;l++){const c=A[l];for(let u=c.start;u<=c.end;u++)r9(a,s[u],o)}return new ka({points:a,options:{}})}function n9(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const A=r[a];if(A.index===t)break;A.hidden||n.unshift(A.dataset)}return n}function r9(e,t,n){const r=[];for(let a=0;a<n.length;a++){const A=n[a],{first:s,last:o,point:l}=a9(A,t,"x");if(!(!l||s&&o)){if(s)r.unshift(l);else if(e.push(l),!o)break}}e.push(...r)}function a9(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const a=r[n],A=e.segments,s=e.points;let o=!1,l=!1;for(let c=0;c<A.length;c++){const u=A[c],d=s[u.start][n],f=s[u.end][n];if($r(a,d,f)){o=a===d,l=a===f;break}}return{first:o,last:l,point:r}}class g_{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:a,y:A,radius:s}=this;return n=n||{start:0,end:Xe},t.arc(a,A,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:a}=this,A=t.angle;return{x:n+Math.cos(A)*a,y:r+Math.sin(A)*a,angle:A}}}function A9(e){const{chart:t,fill:n,line:r}=e;if(ut(n))return s9(t,n);if(n==="stack")return t9(e);if(n==="shape")return!0;const a=i9(e);return a instanceof g_?a:p_(a,r)}function s9(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function i9(e){return(e.scale||{}).getPointPositionForValue?l9(e):o9(e)}function o9(e){const{scale:t={},fill:n}=e,r=JM(n,t);if(ut(r)){const a=t.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function l9(e){const{scale:t,fill:n}=e,r=t.options,a=t.getLabels().length,A=r.reverse?t.max:t.min,s=ZM(n,t,A),o=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,A);return new g_({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<a;++l)o.push(t.getPointPositionForValue(l,s));return o}function _f(e,t,n){const r=A9(t),{line:a,scale:A,axis:s}=t,o=a.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};r&&a.points.length&&(tl(e,n),c9(e,{line:a,target:r,above:u,below:d,area:n,scale:A,axis:s}),nl(e))}function c9(e,t){const{line:n,target:r,above:a,below:A,area:s,scale:o}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&A!==a&&(lB(e,r,s.top),cB(e,{line:n,target:r,color:a,scale:o,property:l}),e.restore(),e.save(),lB(e,r,s.bottom)),cB(e,{line:n,target:r,color:A,scale:o,property:l}),e.restore()}function lB(e,t,n){const{segments:r,points:a}=t;let A=!0,s=!1;e.beginPath();for(const o of r){const{start:l,end:c}=o,u=a[l],d=a[qg(l,c,a)];A?(e.moveTo(u.x,u.y),A=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,o,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function cB(e,t){const{line:n,target:r,property:a,color:A,scale:s}=t,o=zM(n,r,a);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=A}={}}=l,h=r!==!0;e.save(),e.fillStyle=f,u9(e,s,h&&Rh(a,u,d)),e.beginPath();const p=!!n.pathSegment(e,l);let m;if(h){p?e.closePath():uB(e,r,d,a);const y=!!r.pathSegment(e,c,{move:p,reverse:!0});m=p&&y,m||uB(e,r,u,a)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function u9(e,t,n){const{top:r,bottom:a}=t.chart.chartArea,{property:A,start:s,end:o}=n||{};A==="x"&&(e.beginPath(),e.rect(s,r,o-s,a-r),e.clip())}function uB(e,t,n,r){const a=t.interpolate(n,r);a&&e.lineTo(a.x,a.y)}var d9={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,a=[];let A,s,o,l;for(s=0;s<r;++s)A=e.getDatasetMeta(s),o=A.dataset,l=null,o&&o.options&&o instanceof ka&&(l={visible:e.isDatasetVisible(s),index:s,fill:qM(o,s,r),chart:e,axis:A.controller.options.indexAxis,scale:A.vScale,line:o}),A.$filler=l,a.push(l);for(s=0;s<r;++s)l=a[s],!(!l||l.fill===!1)&&(l.fill=YM(a,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",a=e.getSortedVisibleDatasetMetas(),A=e.chartArea;for(let s=a.length-1;s>=0;--s){const o=a[s].$filler;o&&(o.line.updateControlPoints(A,o.axis),r&&o.fill&&_f(e.ctx,o,A))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const A=r[a].$filler;oB(A)&&_f(e.ctx,A,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!oB(r)||n.drawTime!=="beforeDatasetDraw"||_f(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const dB=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},f9=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class fB extends an{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=He(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,a)=>t.sort(r,a,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,a=ft(r.font),A=a.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=dB(r,A);let c,u;n.font=a.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,A,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,a,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,a){const{ctx:A,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=a+o;let d=t;A.textAlign="left",A.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+A.measureText(p.text).width;(m===0||c[c.length-1]+y+2*o>s)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:y,height:a},c[c.length-1]+=y+o}),d}_fitCols(t,n,r,a){const{ctx:A,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,g)=>{const{itemWidth:v,itemHeight:_}=h9(r,n,A,y,a);g>0&&h+_+2*o>u&&(d+=f+o,c.push({width:f,height:h}),p+=f+o,m++,f=h=0),l[g]={left:p,top:h,col:m,width:v,height:_},f=Math.max(f,v),h+=_+o}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:a},rtl:A}}=this,s=Cs(A,this.left,this.width);if(this.isHorizontal()){let o=0,l=$t(r,this.left+a,this.right-this.lineWidths[o]);for(const c of n)o!==c.row&&(o=c.row,l=$t(r,this.left+a,this.right-this.lineWidths[o])),c.top+=this.top+t+a,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+a}else{let o=0,l=$t(r,this.top+t+a,this.bottom-this.columnSizes[o].height);for(const c of n)c.col!==o&&(o=c.col,l=$t(r,this.top+t+a,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+a,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;tl(t,this),this._draw(),nl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:a}=this,{align:A,labels:s}=t,o=dt.color,l=Cs(t.rtl,this.left,this.width),c=ft(s.font),{padding:u}=s,d=c.size,f=d/2;let h;this.drawTitle(),a.textAlign=l.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=dB(s,d),g=function(w,C,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;a.save();const S=de(k.lineWidth,1);if(a.fillStyle=de(k.fillStyle,o),a.lineCap=de(k.lineCap,"butt"),a.lineDashOffset=de(k.lineDashOffset,0),a.lineJoin=de(k.lineJoin,"miter"),a.lineWidth=S,a.strokeStyle=de(k.strokeStyle,o),a.setLineDash(de(k.lineDash,[])),s.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:S},U=l.xPlus(w,p/2),F=C+f;Mb(a,T,U,F,s.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),U=l.leftForLtr(w,p),F=Da(k.borderRadius);a.beginPath(),Object.values(F).some(Q=>Q!==0)?Rs(a,{x:U,y:T,w:p,h:m,radius:F}):a.rect(U,T,p,m),a.fill(),S!==0&&a.stroke()}a.restore()},v=function(w,C,k){OA(a,k.text,w,C+y/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},_=this.isHorizontal(),B=this._computeTitleHeight();_?h={x:$t(A,this.left+u,this.right-r[0]),y:this.top+u+B,line:0}:h={x:this.left+u,y:$t(A,this.top+B+u,this.bottom-n[0].height),line:0},Gb(this.ctx,t.textDirection);const b=y+u;this.legendItems.forEach((w,C)=>{a.strokeStyle=w.fontColor,a.fillStyle=w.fontColor;const k=a.measureText(w.text).width,S=l.textAlign(w.textAlign||(w.textAlign=s.textAlign)),T=p+f+k;let U=h.x,F=h.y;l.setWidth(this.width),_?C>0&&U+T+u>this.right&&(F=h.y+=b,h.line++,U=h.x=$t(A,this.left+u,this.right-r[h.line])):C>0&&F+b>this.bottom&&(U=h.x=U+n[h.line].width+u,h.line++,F=h.y=$t(A,this.top+B+u,this.bottom-n[h.line].height));const Q=l.x(U);if(g(Q,F,w),U=OL(S,U+p+f,_?U+T:this.right,t.rtl),v(l.x(U),F,w),_)h.x+=T+u;else if(typeof w.text!="string"){const Y=c.lineHeight;h.y+=m_(w,Y)}else h.y+=b}),zb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ft(n.font),a=_t(n.padding);if(!n.display)return;const A=Cs(t.rtl,this.left,this.width),s=this.ctx,o=n.position,l=r.size/2,c=a.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=$t(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+$t(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=$t(o,d,d+f);s.textAlign=A.textAlign(Rg(o)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,OA(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=ft(t.font),r=_t(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,a,A;if($r(t,this.left,this.right)&&$r(n,this.top,this.bottom)){for(A=this.legendHitBoxes,r=0;r<A.length;++r)if(a=A[r],$r(t,a.left,a.left+a.width)&&$r(n,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!m9(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const a=this._hoveredItem,A=f9(a,r);a&&!A&&He(n.onLeave,[t,a,this],this),this._hoveredItem=r,r&&!A&&He(n.onHover,[t,r,this],this)}else r&&He(n.onClick,[t,r,this],this)}}function h9(e,t,n,r,a){const A=p9(r,e,t,n),s=g9(a,r,t.lineHeight);return{itemWidth:A,itemHeight:s}}function p9(e,t,n,r){let a=e.text;return a&&typeof a!="string"&&(a=a.reduce((A,s)=>A.length>s.length?A:s)),t+n.size/2+r.measureText(a).width}function g9(e,t,n){let r=e;return typeof t.text!="string"&&(r=m_(t,n)),r}function m_(e,t){const n=e.text?e.text.length+.5:0;return t*n}function m9(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var v9={id:"legend",_element:fB,start(e,t,n){const r=e.legend=new fB({ctx:e.ctx,options:n,chart:e});Gt.configure(e,r,n),Gt.addBox(e,r)},stop(e){Gt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Gt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),t.hidden=!0):(a.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:a,color:A,useBorderRadius:s,borderRadius:o}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=_t(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:A,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:a||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Xg extends an{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const a=Oe(r.text)?r.text.length:1;this._padding=_t(r.padding);const A=a*ft(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=A:this.width=A}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:a,right:A,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=$t(o,r,A),d=n+t,c=A-r):(s.position==="left"?(u=r+t,d=$t(o,a,n),l=Qe*-.5):(u=A-t,d=$t(o,n,a),l=Qe*.5),c=a-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ft(n.font),A=r.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(A);OA(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Rg(n.align),textBaseline:"middle",translation:[s,o]})}}function B9(e,t){const n=new Xg({ctx:e.ctx,options:t,chart:e});Gt.configure(e,n,t),Gt.addBox(e,n),e.titleBlock=n}var y9={id:"title",_element:Xg,start(e,t,n){B9(e,n)},stop(e){const t=e.titleBlock;Gt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Gt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const jl=new WeakMap;var w9={id:"subtitle",start(e,t,n){const r=new Xg({ctx:e.ctx,options:n,chart:e});Gt.configure(e,r,n),Gt.addBox(e,r),jl.set(e,r)},stop(e){Gt.removeBox(e,jl.get(e)),jl.delete(e)},beforeUpdate(e,t,n){const r=jl.get(e);Gt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ii={average(e){if(!e.length)return!1;let t,n,r=0,a=0,A=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();r+=o.x,a+=o.y,++A}}return{x:r/A,y:a/A}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,a=Number.POSITIVE_INFINITY,A,s,o;for(A=0,s=e.length;A<s;++A){const l=e[A].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Hs(t,c);u<a&&(a=u,o=l)}}if(o){const l=o.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function lr(e,t){return t&&(Oe(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Nr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
826
826
  `)>-1?e.split(`
827
- `):e}function b9(e,t){const{element:n,datasetIndex:r,index:a}=t,A=e.getDatasetMeta(r).controller,{label:s,value:o}=A.getLabelAndValue(a);return{chart:e,label:s,parsed:A.getParsed(a),raw:e.data.datasets[r].data[a],formattedValue:o,dataset:A.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function hB(e,t){const n=e.chart.ctx,{body:r,footer:a,title:A}=e,{boxWidth:s,boxHeight:o}=t,l=ft(t.bodyFont),c=ft(t.titleFont),u=ft(t.footerFont),d=A.length,f=a.length,h=r.length,p=_t(t.padding);let m=p.height,y=0,g=r.reduce((B,b)=>B+b.before.length+b.lines.length+b.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),g){const B=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;m+=h*B+(g-h)*l.lineHeight+(g-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const _=function(B){y=Math.max(y,n.measureText(B).width+v)};return n.save(),n.font=c.string,Ve(e.title,_),n.font=l.string,Ve(e.beforeBody.concat(e.afterBody),_),v=t.displayColors?s+2+t.boxPadding:0,Ve(r,B=>{Ve(B.before,_),Ve(B.lines,_),Ve(B.after,_)}),v=0,n.font=u.string,Ve(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function _9(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function C9(e,t,n,r){const{x:a,width:A}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&a+A+s>t.width||e==="right"&&a-A-s<0)return!0}function E9(e,t,n,r){const{x:a,width:A}=n,{width:s,chartArea:{left:o,right:l}}=e;let c="center";return r==="center"?c=a<=(o+l)/2?"left":"right":a<=A/2?c="left":a>=s-A/2&&(c="right"),C9(c,e,t,n)&&(c="center"),c}function pB(e,t,n){const r=n.yAlign||t.yAlign||_9(e,n);return{xAlign:n.xAlign||t.xAlign||E9(e,t,n,r),yAlign:r}}function k9(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function S9(e,t,n){let{y:r,height:a}=e;return t==="top"?r+=n:t==="bottom"?r-=a+n:r-=a/2,r}function gB(e,t,n,r){const{caretSize:a,caretPadding:A,cornerRadius:s}=e,{xAlign:o,yAlign:l}=n,c=a+A,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Da(s);let p=k9(t,o);const m=S9(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+a:o==="right"&&(p+=Math.max(d,h)+a),{x:Mt(p,0,r.width-t.width),y:Mt(m,0,r.height-t.height)}}function Yl(e,t,n){const r=_t(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function mB(e){return lr([],Nr(e))}function x9(e,t,n){return rA(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function vB(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const v_={beforeTitle:Qr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Qr,beforeBody:Qr,beforeLabel:Qr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return _e(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Qr,afterBody:Qr,beforeFooter:Qr,footer:Qr,afterFooter:Qr};function sn(e,t,n,r){const a=e[t].call(n,r);return typeof a>"u"?v_[t].call(n,r):a}class Vh extends an{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&n.options.animation&&r.animations,A=new jg(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(A)),A}getContext(){return this.$context||(this.$context=x9(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,a=sn(r,"beforeTitle",this,t),A=sn(r,"title",this,t),s=sn(r,"afterTitle",this,t);let o=[];return o=lr(o,Nr(a)),o=lr(o,Nr(A)),o=lr(o,Nr(s)),o}getBeforeBody(t,n){return mB(sn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,a=[];return Ve(t,A=>{const s={before:[],lines:[],after:[]},o=vB(r,A);lr(s.before,Nr(sn(o,"beforeLabel",this,A))),lr(s.lines,sn(o,"label",this,A)),lr(s.after,Nr(sn(o,"afterLabel",this,A))),a.push(s)}),a}getAfterBody(t,n){return mB(sn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,a=sn(r,"beforeFooter",this,t),A=sn(r,"footer",this,t),s=sn(r,"afterFooter",this,t);let o=[];return o=lr(o,Nr(a)),o=lr(o,Nr(A)),o=lr(o,Nr(s)),o}_createItems(t){const n=this._active,r=this.chart.data,a=[],A=[],s=[];let o=[],l,c;for(l=0,c=n.length;l<c;++l)o.push(b9(this.chart,n[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,r))),Ve(o,u=>{const d=vB(t.callbacks,u);a.push(sn(d,"labelColor",this,u)),A.push(sn(d,"labelPointStyle",this,u)),s.push(sn(d,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=A,this.labelTextColors=s,this.dataPoints=o,o}update(t,n){const r=this.options.setContext(this.getContext()),a=this._active;let A,s=[];if(!a.length)this.opacity!==0&&(A={opacity:0});else{const o=Ii[r.position].call(this,a,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=hB(this,r),c=Object.assign({},o,l),u=pB(this.chart,r,c),d=gB(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,A={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,A&&this._resolveAnimations().update(this,A),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,a){const A=this.getCaretPosition(t,r,a);n.lineTo(A.x1,A.y1),n.lineTo(A.x2,A.y2),n.lineTo(A.x3,A.y3)}getCaretPosition(t,n,r){const{xAlign:a,yAlign:A}=this,{caretSize:s,cornerRadius:o}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Da(o),{x:f,y:h}=t,{width:p,height:m}=n;let y,g,v,_,B,b;return A==="center"?(B=h+m/2,a==="left"?(y=f,g=y-s,_=B+s,b=B-s):(y=f+p,g=y+s,_=B-s,b=B+s),v=y):(a==="left"?g=f+Math.max(l,u)+s:a==="right"?g=f+p-Math.max(c,d)-s:g=this.caretX,A==="top"?(_=h,B=_-s,y=g-s,v=g+s):(_=h+m,B=_+s,y=g+s,v=g-s),b=_),{x1:y,x2:g,x3:v,y1:_,y2:B,y3:b}}drawTitle(t,n,r){const a=this.title,A=a.length;let s,o,l;if(A){const c=Cs(r.rtl,this.x,this.width);for(t.x=Yl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=ft(r.titleFont),o=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<A;++l)n.fillText(a[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===A&&(t.y+=r.titleMarginBottom-o)}}_drawColorBox(t,n,r,a,A){const s=this.labelColors[r],o=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=A,u=ft(A.bodyFont),d=Yl(this,"left",A),f=a.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+h;if(A.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},y=a.leftForLtr(f,c)+c/2,g=p+l/2;t.strokeStyle=A.multiKeyBackground,t.fillStyle=A.multiKeyBackground,Lh(t,m,y,g),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Lh(t,m,y,g)}else{t.lineWidth=ve(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const m=a.leftForLtr(f,c),y=a.leftForLtr(a.xPlus(f,1),c-2),g=Da(s.borderRadius);Object.values(g).some(v=>v!==0)?(t.beginPath(),t.fillStyle=A.multiKeyBackground,Rs(t,{x:m,y:p,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Rs(t,{x:y,y:p+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=A.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:a}=this,{bodySpacing:A,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=ft(r.bodyFont);let f=d.lineHeight,h=0;const p=Cs(r.rtl,this.x,this.width),m=function(k){n.fillText(k,p.x(t.x+h),t.y+f/2),t.y+=f+A},y=p.textAlign(s);let g,v,_,B,b,w,C;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=Yl(this,y,r),n.fillStyle=r.bodyColor,Ve(this.beforeBody,m),h=o&&y!=="right"?s==="center"?c/2+u:c+2+u:0,B=0,w=a.length;B<w;++B){for(g=a[B],v=this.labelTextColors[B],n.fillStyle=v,Ve(g.before,m),_=g.lines,o&&_.length&&(this._drawColorBox(n,t,B,p,r),f=Math.max(d.lineHeight,l)),b=0,C=_.length;b<C;++b)m(_[b]),f=d.lineHeight;Ve(g.after,m)}h=0,f=d.lineHeight,Ve(this.afterBody,m),t.y-=A}drawFooter(t,n,r){const a=this.footer,A=a.length;let s,o;if(A){const l=Cs(r.rtl,this.x,this.width);for(t.x=Yl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=ft(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,o=0;o<A;++o)n.fillText(a[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,a){const{xAlign:A,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Da(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(o+d,l),s==="top"&&this.drawCaret(t,n,r,a),n.lineTo(o+c-f,l),n.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&A==="right"&&this.drawCaret(t,n,r,a),n.lineTo(o+c,l+u-p),n.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,n,r,a),n.lineTo(o+h,l+u),n.quadraticCurveTo(o,l+u,o,l+u-h),s==="center"&&A==="left"&&this.drawCaret(t,n,r,a),n.lineTo(o,l+d),n.quadraticCurveTo(o,l,o+d,l),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,a=r&&r.x,A=r&&r.y;if(a||A){const s=Ii[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=hB(this,t),l=Object.assign({},s,this._size),c=pB(n,t,l),u=gB(t,l,c,n);(a._to!==u.x||A._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},A={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=_t(n.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&o&&(t.save(),t.globalAlpha=r,this.drawBackground(A,t,a,n),Gb(t,n.textDirection),A.y+=s.top,this.drawTitle(A,t,n),this.drawBody(A,t,n),this.drawFooter(A,t,n),zb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,a=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),A=!iu(r,a),s=this._positionChanged(a,n);(A||s)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,A=this._active||[],s=this._getActiveElements(t,A,n,r),o=this._positionChanged(s,t),l=n||!iu(s,A)||o;return l&&(this._active=s,(a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,a){const A=this.options;if(t.type==="mouseout")return[];if(!a)return n;const s=this.chart.getElementsAtEventForMode(t,A.mode,A,r);return A.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:a,options:A}=this,s=Ii[A.position].call(this,t,n);return s!==!1&&(r!==s.x||a!==s.y)}}R(Vh,"positioners",Ii);var F9={id:"tooltip",_element:Vh,positioners:Ii,afterInit(e,t,n){n&&(e.tooltip=new Vh({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:v_},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},I9=Object.freeze({__proto__:null,Colors:V7,Decimation:G7,Filler:d9,Legend:v9,SubTitle:w9,Title:y9,Tooltip:F9});const U9=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Q9(e,t,n,r){const a=e.indexOf(t);if(a===-1)return U9(e,t,n,r);const A=e.lastIndexOf(t);return a!==A?n:a}const T9=(e,t)=>e===null?null:Mt(Math.round(e),0,t);function BB(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Kh extends $A{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:a,label:A}of n)r[a]===A&&r.splice(a,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(_e(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Q9(r,t,de(n,t),this._addedLabels),T9(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,a=[];let A=this.getLabels();A=t===0&&n===A.length-1?A:A.slice(t,n+1),this._valueRange=Math.max(A.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)a.push({value:s});return a}getLabelForValue(t){return BB.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(Kh,"id","category"),R(Kh,"defaults",{ticks:{callback:BB}});function D9(e,t){const n=[],{bounds:a,step:A,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=A||1,p=u-1,{min:m,max:y}=t,g=!_e(s),v=!_e(o),_=!_e(c),B=(y-m)/(d+1);let b=fv((y-m)/p/h)*h,w,C,k,S;if(b<1e-14&&!g&&!v)return[{value:m},{value:y}];S=Math.ceil(y/b)-Math.floor(m/b),S>p&&(b=fv(S*b/p/h)*h),_e(l)||(w=Math.pow(10,l),b=Math.ceil(b*w)/w),a==="ticks"?(C=Math.floor(m/b)*b,k=Math.ceil(y/b)*b):(C=m,k=y),g&&v&&A&&FL((o-s)/A,b/1e3)?(S=Math.round(Math.min((o-s)/b,u)),b=(o-s)/S,C=s,k=o):_?(C=g?s:C,k=v?o:k,S=c-1,b=(k-C)/S):(S=(k-C)/b,Yi(S,Math.round(S),b/1e3)?S=Math.round(S):S=Math.ceil(S));const T=Math.max(hv(b),hv(C));w=Math.pow(10,_e(l)?T:l),C=Math.round(C*w)/w,k=Math.round(k*w)/w;let U=0;for(g&&(f&&C!==s?(n.push({value:s}),C<s&&U++,Yi(Math.round((C+U*b)*w)/w,s,yB(s,B,e))&&U++):C<s&&U++);U<S;++U){const F=Math.round((C+U*b)*w)/w;if(v&&F>o)break;n.push({value:F})}return v&&f&&k!==o?n.length&&Yi(n[n.length-1].value,o,yB(o,B,e))?n[n.length-1].value=o:n.push({value:o}):(!v||k===o)&&n.push({value:k}),n}function yB(e,t,{horizontal:n,minRotation:r}){const a=Et(r),A=(n?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/A,s)}class pu extends $A{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return _e(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:a,max:A}=this;const s=l=>a=n?a:l,o=l=>A=r?A:l;if(t){const l=vr(a),c=vr(A);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(a===A){let l=A===0?1:Math.abs(A*.05);o(A+l),t||s(a-l)}this.min=a,this.max=A}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},A=this._range||this,s=D9(a,A);return t.bounds==="ticks"&&xb(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const a=(r-n)/Math.max(t.length-1,1)/2;n-=a,r+=a}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return el(t,this.chart.options.locale,this.options.ticks.format)}}class $h extends pu{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ut(t)?t:0,this.max=ut(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Et(this.options.ticks.minRotation),a=(t?Math.sin(r):Math.cos(r))||.001,A=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,A.lineHeight/a))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R($h,"id","linear"),R($h,"defaults",{ticks:{callback:td.formatters.numeric}});const Fo=e=>Math.floor(Ea(e)),oA=(e,t)=>Math.pow(10,Fo(e)+t);function wB(e){return e/Math.pow(10,Fo(e))===1}function bB(e,t,n){const r=Math.pow(10,n),a=Math.floor(e/r);return Math.ceil(t/r)-a}function L9(e,t){const n=t-e;let r=Fo(n);for(;bB(e,t,r)>10;)r++;for(;bB(e,t,r)<10;)r--;return Math.min(r,Fo(e))}function O9(e,{min:t,max:n}){t=wn(e.min,t);const r=[],a=Fo(t);let A=L9(t,n),s=A<0?Math.pow(10,Math.abs(A)):1;const o=Math.pow(10,A),l=a>A?Math.pow(10,a):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,A)),f=wn(e.min,Math.round((l+u+d*Math.pow(10,A))*s)/s);for(;f<n;)r.push({value:f,major:wB(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(A++,d=2,s=A>=0?1:s),f=Math.round((l+u+d*Math.pow(10,A))*s)/s;const h=wn(e.max,f);return r.push({value:h,major:wB(h),significand:d}),r}class Wh extends $A{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=pu.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return ut(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ut(t)?Math.max(0,t):null,this.max=ut(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ut(this._userMin)&&(this.min=t===oA(this.min,0)?oA(this.min,-1):oA(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,a=this.max;const A=o=>r=t?r:o,s=o=>a=n?a:o;r===a&&(r<=0?(A(1),s(10)):(A(oA(r,-1)),s(oA(a,1)))),r<=0&&A(oA(a,-1)),a<=0&&s(oA(r,1)),this.min=r,this.max=a}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=O9(n,this);return t.bounds==="ticks"&&xb(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":el(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ea(t),this._valueRange=Ea(this.max)-Ea(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ea(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Wh,"id","logarithmic"),R(Wh,"defaults",{ticks:{callback:td.formatters.logarithmic,major:{enabled:!0}}});function Gh(e){const t=e.ticks;if(t.display&&e.display){const n=_t(t.backdropPadding);return de(t.font&&t.font.size,dt.font.size)+n.height}return 0}function M9(e,t,n){return n=Oe(n)?n:[n],{w:GL(e,t.string,n),h:n.length*t.lineHeight}}function _B(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function N9(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],a=[],A=e._pointLabels.length,s=e.options.pointLabels,o=s.centerPointLabels?Qe/A:0;for(let l=0;l<A;l++){const c=s.setContext(e.getPointLabelContext(l));a[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+a[l],o),d=ft(c.font),f=M9(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=_n(e.getIndexAngle(l)+o),p=Math.round(ed(h)),m=_B(p,u.x,f.w,0,180),y=_B(p,u.y,f.h,90,270);P9(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=V9(e,r,a)}function P9(e,t,n,r,a){const A=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let o=0,l=0;r.start<t.l?(o=(t.l-r.start)/A,e.l=Math.min(e.l,t.l-o)):r.end>t.r&&(o=(r.end-t.r)/A,e.r=Math.max(e.r,t.r+o)),a.start<t.t?(l=(t.t-a.start)/s,e.t=Math.min(e.t,t.t-l)):a.end>t.b&&(l=(a.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function H9(e,t,n){const r=e.drawingArea,{extra:a,additionalAngle:A,padding:s,size:o}=n,l=e.getPointPosition(t,r+a+s,A),c=Math.round(ed(_n(l.angle+Je))),u=W9(l.y,o.h,c),d=K9(c),f=$9(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function R9(e,t){if(!t)return!0;const{left:n,top:r,right:a,bottom:A}=e;return!(Gr({x:n,y:r},t)||Gr({x:n,y:A},t)||Gr({x:a,y:r},t)||Gr({x:a,y:A},t))}function V9(e,t,n){const r=[],a=e._pointLabels.length,A=e.options,{centerPointLabels:s,display:o}=A.pointLabels,l={extra:Gh(A)/2,additionalAngle:s?Qe/a:0};let c;for(let u=0;u<a;u++){l.padding=n[u],l.size=t[u];const d=H9(e,u,l);r.push(d),o==="auto"&&(d.visible=R9(d,c),d.visible&&(c=d))}return r}function K9(e){return e===0||e===180?"center":e<180?"left":"right"}function $9(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function W9(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function G9(e,t,n){const{left:r,top:a,right:A,bottom:s}=n,{backdropColor:o}=t;if(!_e(o)){const l=Da(t.borderRadius),c=_t(t.backdropPadding);e.fillStyle=o;const u=r-c.left,d=a-c.top,f=A-r+c.width,h=s-a+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Rs(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function z9(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let a=t-1;a>=0;a--){const A=e._pointLabelItems[a];if(!A.visible)continue;const s=r.setContext(e.getPointLabelContext(a));G9(n,s,A);const o=ft(s.font),{x:l,y:c,textAlign:u}=A;OA(n,e._pointLabels[a],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function B_(e,t,n,r){const{ctx:a}=e;if(n)a.arc(e.xCenter,e.yCenter,t,0,Xe);else{let A=e.getPointPosition(0,t);a.moveTo(A.x,A.y);for(let s=1;s<r;s++)A=e.getPointPosition(s,t),a.lineTo(A.x,A.y)}}function j9(e,t,n,r,a){const A=e.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!r||!o||!l||n<0||(A.save(),A.strokeStyle=o,A.lineWidth=l,A.setLineDash(a.dash),A.lineDashOffset=a.dashOffset,A.beginPath(),B_(e,n,s,r),A.closePath(),A.stroke(),A.restore())}function Y9(e,t,n){return rA(e,{label:n,index:t,type:"pointLabel"})}class Ui extends pu{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=_t(Gh(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=ut(t)&&!isNaN(t)?t:0,this.max=ut(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gh(this.options))}generateTickLabels(t){pu.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const a=He(this.options.pointLabels.callback,[n,r],this);return a||a===0?a:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?N9(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,a){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,a))}getIndexAngle(t){const n=Xe/(this._pointLabels.length||1),r=this.options.startAngle||0;return _n(t*n+Et(r))}getDistanceFromCenterForValue(t){if(_e(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(_e(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return Y9(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const a=this.getIndexAngle(t)-Je+r;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:a,bottom:A}=this._pointLabelItems[t];return{left:n,top:r,right:a,bottom:A}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),B_(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:a,border:A}=n,s=this._pointLabels.length;let o,l,c;if(n.pointLabels.display&&z9(this,s),a.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=a.setContext(f),p=A.setContext(f);j9(this,h,l,s,p)}}),r.display){for(t.save(),o=s-1;o>=0;o--){const u=r.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const a=this.getIndexAngle(0);let A,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(a),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=ft(c.font);if(A=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=_t(c.backdropPadding);t.fillRect(-s/2-d.left,-A-u.size/2-d.top,s+d.width,u.size+d.height)}OA(t,o.label,0,-A,u,{color:c.color})}),t.restore()}drawTitle(){}}R(Ui,"id","radialLinear"),R(Ui,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:td.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(Ui,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(Ui,"descriptors",{angleLines:{_fallback:"grid"}});const rd={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}},hn=Object.keys(rd);function q9(e,t){return e-t}function CB(e,t){if(_e(t))return null;const n=e._adapter,{parser:r,round:a,isoWeekday:A}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),ut(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(a&&(s=a==="week"&&(za(A)||A===!0)?n.startOf(s,"isoWeek",A):n.startOf(s,a)),+s)}function EB(e,t,n,r){const a=hn.length;for(let A=hn.indexOf(e);A<a-1;++A){const s=rd[hn[A]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(o*s.size))<=r)return hn[A]}return hn[a-1]}function X9(e,t,n,r,a){for(let A=hn.length-1;A>=hn.indexOf(n);A--){const s=hn[A];if(rd[s].common&&e._adapter.diff(a,r,s)>=t-1)return s}return hn[n?hn.indexOf(n):0]}function J9(e){for(let t=hn.indexOf(e)+1,n=hn.length;t<n;++t)if(rd[hn[t]].common)return hn[t]}function kB(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:a}=Hg(n,t),A=n[r]>=t?n[r]:n[a];e[A]=!0}}function Z9(e,t,n,r){const a=e._adapter,A=+a.startOf(t[0].value,r),s=t[t.length-1].value;let o,l;for(o=A;o<=s;o=+a.add(o,1,r))l=n[o],l>=0&&(t[l].major=!0);return t}function SB(e,t,n){const r=[],a={},A=t.length;let s,o;for(s=0;s<A;++s)o=t[s],a[o]=s,r.push({value:o,major:!1});return A===0||!n?r:Z9(e,r,a,n)}class Io extends $A{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),a=this._adapter=new Zb._date(t.adapters.date);a.init(n),ji(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:CB(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:a,max:A,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(a=Math.min(a,c.min)),!o&&!isNaN(c.max)&&(A=Math.max(A,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),a=ut(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),A=ut(A)&&!isNaN(A)?A:+n.endOf(Date.now(),r)+1,this.min=Math.min(a,A-1),this.max=Math.max(a+1,A)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const A=this.min,s=this.max,o=TL(a,A,s);return this._unit=n.unit||(r.autoSkip?EB(n.minUnit,this.min,this.max,this._getLabelCapacity(A)):X9(this,o.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:J9(this._unit),this.initOffsets(a),t.reverse&&o.reverse(),SB(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,a,A;this.options.offset&&t.length&&(a=this.getDecimalForValue(t[0]),t.length===1?n=1-a:n=(this.getDecimalForValue(t[1])-a)/2,A=this.getDecimalForValue(t[t.length-1]),t.length===1?r=A:r=(A-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Mt(n,0,s),r=Mt(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,a=this.options,A=a.time,s=A.unit||EB(A.minUnit,n,r,this._getLabelCapacity(n)),o=de(a.ticks.stepSize,1),l=s==="week"?A.isoWeekday:!1,c=za(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*o)throw new Error(n+" and "+r+" are too far apart with stepSize of "+o+" "+s);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,o,s),h++)kB(u,f,p);return(f===r||a.bounds==="ticks"||h===1)&&kB(u,f,p),Object.keys(u).sort((m,y)=>m-y).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const a=this.options.time.displayFormats,A=this._unit,s=n||a[A];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,a){const A=this.options,s=A.ticks.callback;if(s)return He(s,[t,n,r],this);const o=A.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,a||(h?d:u))}generateTickLabels(t){let n,r,a;for(n=0,r=t.length;n<r;++n)a=t[n],a.label=this._tickFormatFunction(a.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,a=Et(this.isHorizontal()?n.maxRotation:n.minRotation),A=Math.cos(a),s=Math.sin(a),o=this._resolveTickFontOptions(0).size;return{w:r*A+o*s,h:r*s+o*A}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,A=this._tickFormatFunction(t,0,SB(this,[t],this._majorUnit),a),s=this._getLabelSize(A),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,r=a.length;n<r;++n)t=t.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const a=this.getLabels();for(n=0,r=a.length;n<r;++n)t.push(CB(this,a[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ub(t.sort(q9))}}R(Io,"id","time"),R(Io,"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 ql(e,t,n){let r=0,a=e.length-1,A,s,o,l;n?(t>=e[r].pos&&t<=e[a].pos&&({lo:r,hi:a}=Wr(e,"pos",t)),{pos:A,time:o}=e[r],{pos:s,time:l}=e[a]):(t>=e[r].time&&t<=e[a].time&&({lo:r,hi:a}=Wr(e,"time",t)),{time:A,pos:o}=e[r],{time:s,pos:l}=e[a]);const c=s-A;return c?o+(l-o)*(t-A)/c:o}class zh extends Io{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ql(n,this.min),this._tableRange=ql(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,a=[],A=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=n&&c<=r&&a.push(c);if(a.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,o=a.length;s<o;++s)u=a[s+1],l=a[s-1],c=a[s],Math.round((u+l)/2)!==c&&A.push({time:c,pos:s/(o-1)});return A}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(ql(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ql(this._table,r*this._tableRange+this._minPos,!0)}}R(zh,"id","timeseries"),R(zh,"defaults",Io.defaults);var eN=Object.freeze({__proto__:null,CategoryScale:Kh,LinearScale:$h,LogarithmicScale:Wh,RadialLinearScale:Ui,TimeScale:Io,TimeSeriesScale:zh});const Cr=[iM,O7,I9,eN];var tN=typeof global=="object"&&global&&global.Object===Object&&global;const y_=tN;var nN=typeof self=="object"&&self&&self.Object===Object&&self,rN=y_||nN||Function("return this")();const Er=rN;var aN=Er.Symbol;const ja=aN;var w_=Object.prototype,AN=w_.hasOwnProperty,sN=w_.toString,vi=ja?ja.toStringTag:void 0;function iN(e){var t=AN.call(e,vi),n=e[vi];try{e[vi]=void 0;var r=!0}catch{}var a=sN.call(e);return r&&(t?e[vi]=n:delete e[vi]),a}var oN=Object.prototype,lN=oN.toString;function cN(e){return lN.call(e)}var uN="[object Null]",dN="[object Undefined]",xB=ja?ja.toStringTag:void 0;function al(e){return e==null?e===void 0?dN:uN:xB&&xB in Object(e)?iN(e):cN(e)}function MA(e){return e!=null&&typeof e=="object"}var fN=Array.isArray;const $s=fN;function Al(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var hN="[object AsyncFunction]",pN="[object Function]",gN="[object GeneratorFunction]",mN="[object Proxy]";function b_(e){if(!Al(e))return!1;var t=al(e);return t==pN||t==gN||t==hN||t==mN}var vN=Er["__core-js_shared__"];const Cf=vN;var FB=function(){var e=/[^.]+$/.exec(Cf&&Cf.keys&&Cf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function BN(e){return!!FB&&FB in e}var yN=Function.prototype,wN=yN.toString;function WA(e){if(e!=null){try{return wN.call(e)}catch{}try{return e+""}catch{}}return""}var bN=/[\\^$.*+?()[\]{}|]/g,_N=/^\[object .+?Constructor\]$/,CN=Function.prototype,EN=Object.prototype,kN=CN.toString,SN=EN.hasOwnProperty,xN=RegExp("^"+kN.call(SN).replace(bN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function FN(e){if(!Al(e)||BN(e))return!1;var t=b_(e)?xN:_N;return t.test(WA(e))}function IN(e,t){return e==null?void 0:e[t]}function GA(e,t){var n=IN(e,t);return FN(n)?n:void 0}var UN=GA(Er,"WeakMap");const jh=UN;var IB=Object.create,QN=function(){function e(){}return function(t){if(!Al(t))return{};if(IB)return IB(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const TN=QN;function DN(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var LN=function(){try{var e=GA(Object,"defineProperty");return e({},"",{}),e}catch{}}();const UB=LN;function ON(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var MN=9007199254740991,NN=/^(?:0|[1-9]\d*)$/;function PN(e,t){var n=typeof e;return t=t??MN,!!t&&(n=="number"||n!="symbol"&&NN.test(e))&&e>-1&&e%1==0&&e<t}function __(e,t,n){t=="__proto__"&&UB?UB(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Jg(e,t){return e===t||e!==e&&t!==t}var HN=Object.prototype,RN=HN.hasOwnProperty;function C_(e,t,n){var r=e[t];(!(RN.call(e,t)&&Jg(r,n))||n===void 0&&!(t in e))&&__(e,t,n)}function ad(e,t,n,r){var a=!n;n||(n={});for(var A=-1,s=t.length;++A<s;){var o=t[A],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),a?__(n,o,l):C_(n,o,l)}return n}var VN=9007199254740991;function E_(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=VN}function Zg(e){return e!=null&&E_(e.length)&&!b_(e)}var KN=Object.prototype;function Ad(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||KN;return e===n}function $N(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var WN="[object Arguments]";function QB(e){return MA(e)&&al(e)==WN}var k_=Object.prototype,GN=k_.hasOwnProperty,zN=k_.propertyIsEnumerable,jN=QB(function(){return arguments}())?QB:function(e){return MA(e)&&GN.call(e,"callee")&&!zN.call(e,"callee")};const S_=jN;function YN(){return!1}var x_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,TB=x_&&typeof module=="object"&&module&&!module.nodeType&&module,qN=TB&&TB.exports===x_,DB=qN?Er.Buffer:void 0,XN=DB?DB.isBuffer:void 0,JN=XN||YN;const Uo=JN;var ZN="[object Arguments]",eP="[object Array]",tP="[object Boolean]",nP="[object Date]",rP="[object Error]",aP="[object Function]",AP="[object Map]",sP="[object Number]",iP="[object Object]",oP="[object RegExp]",lP="[object Set]",cP="[object String]",uP="[object WeakMap]",dP="[object ArrayBuffer]",fP="[object DataView]",hP="[object Float32Array]",pP="[object Float64Array]",gP="[object Int8Array]",mP="[object Int16Array]",vP="[object Int32Array]",BP="[object Uint8Array]",yP="[object Uint8ClampedArray]",wP="[object Uint16Array]",bP="[object Uint32Array]",nt={};nt[hP]=nt[pP]=nt[gP]=nt[mP]=nt[vP]=nt[BP]=nt[yP]=nt[wP]=nt[bP]=!0;nt[ZN]=nt[eP]=nt[dP]=nt[tP]=nt[fP]=nt[nP]=nt[rP]=nt[aP]=nt[AP]=nt[sP]=nt[iP]=nt[oP]=nt[lP]=nt[cP]=nt[uP]=!1;function _P(e){return MA(e)&&E_(e.length)&&!!nt[al(e)]}function em(e){return function(t){return e(t)}}var F_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,to=F_&&typeof module=="object"&&module&&!module.nodeType&&module,CP=to&&to.exports===F_,Ef=CP&&y_.process,EP=function(){try{var e=to&&to.require&&to.require("util").types;return e||Ef&&Ef.binding&&Ef.binding("util")}catch{}}();const Ws=EP;var LB=Ws&&Ws.isTypedArray,kP=LB?em(LB):_P;const tm=kP;var SP=Object.prototype,xP=SP.hasOwnProperty;function I_(e,t){var n=$s(e),r=!n&&S_(e),a=!n&&!r&&Uo(e),A=!n&&!r&&!a&&tm(e),s=n||r||a||A,o=s?$N(e.length,String):[],l=o.length;for(var c in e)(t||xP.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||A&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||PN(c,l)))&&o.push(c);return o}function U_(e,t){return function(n){return e(t(n))}}var FP=U_(Object.keys,Object);const IP=FP;var UP=Object.prototype,QP=UP.hasOwnProperty;function Q_(e){if(!Ad(e))return IP(e);var t=[];for(var n in Object(e))QP.call(e,n)&&n!="constructor"&&t.push(n);return t}function nm(e){return Zg(e)?I_(e):Q_(e)}function TP(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var DP=Object.prototype,LP=DP.hasOwnProperty;function OP(e){if(!Al(e))return TP(e);var t=Ad(e),n=[];for(var r in e)r=="constructor"&&(t||!LP.call(e,r))||n.push(r);return n}function rm(e){return Zg(e)?I_(e,!0):OP(e)}var MP=GA(Object,"create");const Qo=MP;function NP(){this.__data__=Qo?Qo(null):{},this.size=0}function PP(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HP="__lodash_hash_undefined__",RP=Object.prototype,VP=RP.hasOwnProperty;function KP(e){var t=this.__data__;if(Qo){var n=t[e];return n===HP?void 0:n}return VP.call(t,e)?t[e]:void 0}var $P=Object.prototype,WP=$P.hasOwnProperty;function GP(e){var t=this.__data__;return Qo?t[e]!==void 0:WP.call(t,e)}var zP="__lodash_hash_undefined__";function jP(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Qo&&t===void 0?zP:t,this}function NA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}NA.prototype.clear=NP;NA.prototype.delete=PP;NA.prototype.get=KP;NA.prototype.has=GP;NA.prototype.set=jP;function YP(){this.__data__=[],this.size=0}function sd(e,t){for(var n=e.length;n--;)if(Jg(e[n][0],t))return n;return-1}var qP=Array.prototype,XP=qP.splice;function JP(e){var t=this.__data__,n=sd(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():XP.call(t,n,1),--this.size,!0}function ZP(e){var t=this.__data__,n=sd(t,e);return n<0?void 0:t[n][1]}function eH(e){return sd(this.__data__,e)>-1}function tH(e,t){var n=this.__data__,r=sd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function sa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sa.prototype.clear=YP;sa.prototype.delete=JP;sa.prototype.get=ZP;sa.prototype.has=eH;sa.prototype.set=tH;var nH=GA(Er,"Map");const To=nH;function rH(){this.size=0,this.__data__={hash:new NA,map:new(To||sa),string:new NA}}function aH(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function id(e,t){var n=e.__data__;return aH(t)?n[typeof t=="string"?"string":"hash"]:n.map}function AH(e){var t=id(this,e).delete(e);return this.size-=t?1:0,t}function sH(e){return id(this,e).get(e)}function iH(e){return id(this,e).has(e)}function oH(e,t){var n=id(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function zA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zA.prototype.clear=rH;zA.prototype.delete=AH;zA.prototype.get=sH;zA.prototype.has=iH;zA.prototype.set=oH;function T_(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var lH=U_(Object.getPrototypeOf,Object);const D_=lH;function cH(){this.__data__=new sa,this.size=0}function uH(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function dH(e){return this.__data__.get(e)}function fH(e){return this.__data__.has(e)}var hH=200;function pH(e,t){var n=this.__data__;if(n instanceof sa){var r=n.__data__;if(!To||r.length<hH-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new zA(r)}return n.set(e,t),this.size=n.size,this}function qr(e){var t=this.__data__=new sa(e);this.size=t.size}qr.prototype.clear=cH;qr.prototype.delete=uH;qr.prototype.get=dH;qr.prototype.has=fH;qr.prototype.set=pH;function gH(e,t){return e&&ad(t,nm(t),e)}function mH(e,t){return e&&ad(t,rm(t),e)}var L_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,OB=L_&&typeof module=="object"&&module&&!module.nodeType&&module,vH=OB&&OB.exports===L_,MB=vH?Er.Buffer:void 0,NB=MB?MB.allocUnsafe:void 0;function BH(e,t){if(t)return e.slice();var n=e.length,r=NB?NB(n):new e.constructor(n);return e.copy(r),r}function yH(e,t){for(var n=-1,r=e==null?0:e.length,a=0,A=[];++n<r;){var s=e[n];t(s,n,e)&&(A[a++]=s)}return A}function O_(){return[]}var wH=Object.prototype,bH=wH.propertyIsEnumerable,PB=Object.getOwnPropertySymbols,_H=PB?function(e){return e==null?[]:(e=Object(e),yH(PB(e),function(t){return bH.call(e,t)}))}:O_;const am=_H;function CH(e,t){return ad(e,am(e),t)}var EH=Object.getOwnPropertySymbols,kH=EH?function(e){for(var t=[];e;)T_(t,am(e)),e=D_(e);return t}:O_;const M_=kH;function SH(e,t){return ad(e,M_(e),t)}function N_(e,t,n){var r=t(e);return $s(e)?r:T_(r,n(e))}function Yh(e){return N_(e,nm,am)}function xH(e){return N_(e,rm,M_)}var FH=GA(Er,"DataView");const qh=FH;var IH=GA(Er,"Promise");const Xh=IH;var UH=GA(Er,"Set");const Jh=UH;var HB="[object Map]",QH="[object Object]",RB="[object Promise]",VB="[object Set]",KB="[object WeakMap]",$B="[object DataView]",TH=WA(qh),DH=WA(To),LH=WA(Xh),OH=WA(Jh),MH=WA(jh),hA=al;(qh&&hA(new qh(new ArrayBuffer(1)))!=$B||To&&hA(new To)!=HB||Xh&&hA(Xh.resolve())!=RB||Jh&&hA(new Jh)!=VB||jh&&hA(new jh)!=KB)&&(hA=function(e){var t=al(e),n=t==QH?e.constructor:void 0,r=n?WA(n):"";if(r)switch(r){case TH:return $B;case DH:return HB;case LH:return RB;case OH:return VB;case MH:return KB}return t});const Gs=hA;var NH=Object.prototype,PH=NH.hasOwnProperty;function HH(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&PH.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var RH=Er.Uint8Array;const gu=RH;function Am(e){var t=new e.constructor(e.byteLength);return new gu(t).set(new gu(e)),t}function VH(e,t){var n=t?Am(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var KH=/\w*$/;function $H(e){var t=new e.constructor(e.source,KH.exec(e));return t.lastIndex=e.lastIndex,t}var WB=ja?ja.prototype:void 0,GB=WB?WB.valueOf:void 0;function WH(e){return GB?Object(GB.call(e)):{}}function GH(e,t){var n=t?Am(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var zH="[object Boolean]",jH="[object Date]",YH="[object Map]",qH="[object Number]",XH="[object RegExp]",JH="[object Set]",ZH="[object String]",eR="[object Symbol]",tR="[object ArrayBuffer]",nR="[object DataView]",rR="[object Float32Array]",aR="[object Float64Array]",AR="[object Int8Array]",sR="[object Int16Array]",iR="[object Int32Array]",oR="[object Uint8Array]",lR="[object Uint8ClampedArray]",cR="[object Uint16Array]",uR="[object Uint32Array]";function dR(e,t,n){var r=e.constructor;switch(t){case tR:return Am(e);case zH:case jH:return new r(+e);case nR:return VH(e,n);case rR:case aR:case AR:case sR:case iR:case oR:case lR:case cR:case uR:return GH(e,n);case YH:return new r;case qH:case ZH:return new r(e);case XH:return $H(e);case JH:return new r;case eR:return WH(e)}}function fR(e){return typeof e.constructor=="function"&&!Ad(e)?TN(D_(e)):{}}var hR="[object Map]";function pR(e){return MA(e)&&Gs(e)==hR}var zB=Ws&&Ws.isMap,gR=zB?em(zB):pR;const mR=gR;var vR="[object Set]";function BR(e){return MA(e)&&Gs(e)==vR}var jB=Ws&&Ws.isSet,yR=jB?em(jB):BR;const wR=yR;var bR=1,_R=2,CR=4,P_="[object Arguments]",ER="[object Array]",kR="[object Boolean]",SR="[object Date]",xR="[object Error]",H_="[object Function]",FR="[object GeneratorFunction]",IR="[object Map]",UR="[object Number]",R_="[object Object]",QR="[object RegExp]",TR="[object Set]",DR="[object String]",LR="[object Symbol]",OR="[object WeakMap]",MR="[object ArrayBuffer]",NR="[object DataView]",PR="[object Float32Array]",HR="[object Float64Array]",RR="[object Int8Array]",VR="[object Int16Array]",KR="[object Int32Array]",$R="[object Uint8Array]",WR="[object Uint8ClampedArray]",GR="[object Uint16Array]",zR="[object Uint32Array]",Ye={};Ye[P_]=Ye[ER]=Ye[MR]=Ye[NR]=Ye[kR]=Ye[SR]=Ye[PR]=Ye[HR]=Ye[RR]=Ye[VR]=Ye[KR]=Ye[IR]=Ye[UR]=Ye[R_]=Ye[QR]=Ye[TR]=Ye[DR]=Ye[LR]=Ye[$R]=Ye[WR]=Ye[GR]=Ye[zR]=!0;Ye[xR]=Ye[H_]=Ye[OR]=!1;function Hc(e,t,n,r,a,A){var s,o=t&bR,l=t&_R,c=t&CR;if(n&&(s=a?n(e,r,a,A):n(e)),s!==void 0)return s;if(!Al(e))return e;var u=$s(e);if(u){if(s=HH(e),!o)return DN(e,s)}else{var d=Gs(e),f=d==H_||d==FR;if(Uo(e))return BH(e,o);if(d==R_||d==P_||f&&!a){if(s=l||f?{}:fR(e),!o)return l?SH(e,mH(s,e)):CH(e,gH(s,e))}else{if(!Ye[d])return a?e:{};s=dR(e,d,o)}}A||(A=new qr);var h=A.get(e);if(h)return h;A.set(e,s),wR(e)?e.forEach(function(y){s.add(Hc(y,t,n,y,e,A))}):mR(e)&&e.forEach(function(y,g){s.set(g,Hc(y,t,n,g,e,A))});var p=c?l?xH:Yh:l?rm:nm,m=u?void 0:p(e);return ON(m||e,function(y,g){m&&(g=y,y=e[g]),C_(s,g,Hc(y,t,n,g,e,A))}),s}var jR=1,YR=4;function Bi(e){return Hc(e,jR|YR)}var qR="__lodash_hash_undefined__";function XR(e){return this.__data__.set(e,qR),this}function JR(e){return this.__data__.has(e)}function mu(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new zA;++t<n;)this.add(e[t])}mu.prototype.add=mu.prototype.push=XR;mu.prototype.has=JR;function ZR(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function eV(e,t){return e.has(t)}var tV=1,nV=2;function V_(e,t,n,r,a,A){var s=n&tV,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=A.get(e),u=A.get(t);if(c&&u)return c==t&&u==e;var d=-1,f=!0,h=n&nV?new mu:void 0;for(A.set(e,t),A.set(t,e);++d<o;){var p=e[d],m=t[d];if(r)var y=s?r(m,p,d,t,e,A):r(p,m,d,e,t,A);if(y!==void 0){if(y)continue;f=!1;break}if(h){if(!ZR(t,function(g,v){if(!eV(h,v)&&(p===g||a(p,g,n,r,A)))return h.push(v)})){f=!1;break}}else if(!(p===m||a(p,m,n,r,A))){f=!1;break}}return A.delete(e),A.delete(t),f}function rV(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function aV(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var AV=1,sV=2,iV="[object Boolean]",oV="[object Date]",lV="[object Error]",cV="[object Map]",uV="[object Number]",dV="[object RegExp]",fV="[object Set]",hV="[object String]",pV="[object Symbol]",gV="[object ArrayBuffer]",mV="[object DataView]",YB=ja?ja.prototype:void 0,kf=YB?YB.valueOf:void 0;function vV(e,t,n,r,a,A,s){switch(n){case mV:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gV:return!(e.byteLength!=t.byteLength||!A(new gu(e),new gu(t)));case iV:case oV:case uV:return Jg(+e,+t);case lV:return e.name==t.name&&e.message==t.message;case dV:case hV:return e==t+"";case cV:var o=rV;case fV:var l=r&AV;if(o||(o=aV),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=sV,s.set(e,t);var u=V_(o(e),o(t),r,a,A,s);return s.delete(e),u;case pV:if(kf)return kf.call(e)==kf.call(t)}return!1}var BV=1,yV=Object.prototype,wV=yV.hasOwnProperty;function bV(e,t,n,r,a,A){var s=n&BV,o=Yh(e),l=o.length,c=Yh(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in t:wV.call(t,f)))return!1}var h=A.get(e),p=A.get(t);if(h&&p)return h==t&&p==e;var m=!0;A.set(e,t),A.set(t,e);for(var y=s;++d<l;){f=o[d];var g=e[f],v=t[f];if(r)var _=s?r(v,g,f,t,e,A):r(g,v,f,e,t,A);if(!(_===void 0?g===v||a(g,v,n,r,A):_)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var B=e.constructor,b=t.constructor;B!=b&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof b=="function"&&b instanceof b)&&(m=!1)}return A.delete(e),A.delete(t),m}var _V=1,qB="[object Arguments]",XB="[object Array]",Xl="[object Object]",CV=Object.prototype,JB=CV.hasOwnProperty;function EV(e,t,n,r,a,A){var s=$s(e),o=$s(t),l=s?XB:Gs(e),c=o?XB:Gs(t);l=l==qB?Xl:l,c=c==qB?Xl:c;var u=l==Xl,d=c==Xl,f=l==c;if(f&&Uo(e)){if(!Uo(t))return!1;s=!0,u=!1}if(f&&!u)return A||(A=new qr),s||tm(e)?V_(e,t,n,r,a,A):vV(e,t,l,n,r,a,A);if(!(n&_V)){var h=u&&JB.call(e,"__wrapped__"),p=d&&JB.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,y=p?t.value():t;return A||(A=new qr),a(m,y,n,r,A)}}return f?(A||(A=new qr),bV(e,t,n,r,a,A)):!1}function K_(e,t,n,r,a){return e===t?!0:e==null||t==null||!MA(e)&&!MA(t)?e!==e&&t!==t:EV(e,t,n,r,K_,a)}var kV="[object Map]",SV="[object Set]",xV=Object.prototype,FV=xV.hasOwnProperty;function IV(e){if(e==null)return!0;if(Zg(e)&&($s(e)||typeof e=="string"||typeof e.splice=="function"||Uo(e)||tm(e)||S_(e)))return!e.length;var t=Gs(e);if(t==kV||t==SV)return!e.size;if(Ad(e))return!Q_(e).length;for(var n in e)if(FV.call(e,n))return!1;return!0}function ZB(e,t){return K_(e,t)}var UV=Object.defineProperty,QV=Object.defineProperties,TV=Object.getOwnPropertyDescriptors,ey=Object.getOwnPropertySymbols,DV=Object.prototype.hasOwnProperty,LV=Object.prototype.propertyIsEnumerable,ty=(e,t,n)=>t in e?UV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OV=(e,t)=>{for(var n in t||(t={}))DV.call(t,n)&&ty(e,n,t[n]);if(ey)for(var n of ey(t))LV.call(t,n)&&ty(e,n,t[n]);return e},MV=(e,t)=>QV(e,TV(t));function NV(e){return(e.match(/[a-zA-Z0-9]+/g)||[]).map(t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`).join("")}var aA=(e,t)=>{const n={chartData:{type:Object,required:!0},options:{type:Object,required:!1},chartId:{default:e,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:()=>[]},onLabelsUpdate:{type:Function},onChartUpdate:{type:Function},onChartDestroy:{type:Function},onChartRender:{type:Function}},r=NV(e);return i.defineComponent({name:r,props:n,emits:{"labels:update":()=>!0,"chart:update":a=>!0,"chart:destroy":()=>!0,"chart:render":a=>!0},setup(a,{emit:A,expose:s}){const o=i.ref(null),l=`${a.chartId}`;let c=i.shallowRef(null);i.watch(()=>a.chartData,u,{deep:!0}),i.watch(()=>a.options,y=>{c.value&&y&&(c.value.options=Bi(y),p())},{deep:!0});function u(y){if(c.value){let g=c.value;ZB(y.labels,c.value.data.labels)||(g.data.labels=y.labels,f()),ZB(y.datasets,c.value.data.datasets)||y.datasets.forEach((v,_)=>{var B,b;if(IV(v))g.data.datasets=[];else{const w=Bi(g.data),C=Object.keys((b=(B=w.datasets)==null?void 0:B[_])!=null?b:{}),k=Object.keys(v);C.filter(T=>T!=="_meta"&&k.indexOf(T)===-1).forEach(T=>{g.data.datasets[_]&&delete g.data.datasets[_][T]});for(const T in v){const U=Bi(v[T]);g.data.datasets[_]||(g.data.datasets[_]={}),v.hasOwnProperty(T)&&U!=null&&g&&(g.data.datasets[_][T]=U)}}}),p()}else c.value&&m(),d()}function d(){o.value?(c.value=new Le(o.value,{data:Bi(a.chartData),type:t,options:Bi(a.options),plugins:a.plugins}),h()):console.error(`Error on component ${r}, canvas cannot be rendered. Check if the render appends server-side`)}function f(){A("labels:update"),a.onLabelsUpdate&&a.onLabelsUpdate()}function h(){c.value&&(A("chart:render",c.value),a.onChartRender&&a.onChartRender(c.value))}function p(){c.value&&(c.value.update(),A("chart:update",c.value),a.onChartUpdate&&a.onChartUpdate(c.value))}function m(){c.value&&c.value.destroy(),A("chart:destroy"),a.onChartDestroy&&a.onChartDestroy()}return i.onMounted(d),i.onBeforeUnmount(()=>{c.value&&c.value.destroy()}),s({canvasRef:o,renderChart:d,chartInstance:c,canvasId:l,update:p}),()=>i.h("div",{style:MV(OV({maxWidth:"100%"},a.styles),{position:"relative"}),class:a.cssClasses},[i.h("canvas",{style:{maxWidth:"100%",maxHeight:"100%"},id:l,width:a.width,height:a.height,ref:o})])}})},od=aA("bar-chart","bar"),ld=aA("doughnut-chart","doughnut"),$_=aA("line-chart","line");aA("pie-chart","pie");aA("polar-chart","polarArea");aA("radar-chart","radar");aA("bubble-chart","bubble");aA("scatter-chart","scatter");const vu=i.defineComponent({__name:"InfoDoughnutChart",props:XD,setup(e){const t=e,n=i.ref(null);Le.register(...Cr);const r=i.computed(()=>{const A=t.info==="typeRef"?"types":"rarities",s={},o=St(t.deckCode);for(const c in o){const u=jt().cardJsonObject[c];if(u===void 0)continue;let d=u[t.info];d==="Unit"&&(d=u.supertype==="Champion"?"Champion":"Follower"),s[d]===void 0&&(s[d]=0),s[d]+=o[c]}const l=[];for(const c in s){const u=we().dataJson[A].find(f=>f.nameRef===c),d={key:c,value:s[c],color:u==null?void 0:u.color,name:u==null?void 0:u.name,order:u==null?void 0:u.order};l.push(d)}return console.log(l),l.sort((c,u)=>c.order-u.order),{labels:l.map(c=>c.name),datasets:[{data:l.map(c=>c.value),backgroundColor:l.map(c=>c.color)}]}}),a={cutout:55,layout:{padding:{top:10,bottom:10}},elements:{arc:{borderWidth:0}},plugins:{legend:{display:!0,position:"right",labels:{usePointStyle:!0,generateLabels(A){const s=[],o=A.data.labels;for(let l=0;l<A.data.labels.length;l++)s.push({text:`${o[l]} (${A.data.datasets[0].data[l]})`,borderRadius:999,datasetIndex:0,index:l,fontColor:Ha("--color-0"),fillStyle:A.data.datasets[0].backgroundColor[l]});return s}}},datalabels:{display:!1}}};return(A,s)=>(i.openBlock(),i.createBlock(i.unref(ld),{ref_key:"chart",ref:n,"chart-data":r.value,options:a},null,8,["chart-data"]))}}),PV={deck:{type:Object,required:!1,default:void 0},deckCode:{type:String,required:!1,default:void 0},paddingTop:{type:Number,required:!1,default:10},showDataLabels:{type:Boolean,required:!1,default:!0},dataLabelsOffset:{type:Number,required:!1,default:-10},tooltipsEnabled:{type:Boolean,required:!1,default:!0},displayXScale:{type:Boolean,required:!1,default:!0},animation:{type:Boolean,required:!1}};//! moment.js
827
+ `):e}function b9(e,t){const{element:n,datasetIndex:r,index:a}=t,A=e.getDatasetMeta(r).controller,{label:s,value:o}=A.getLabelAndValue(a);return{chart:e,label:s,parsed:A.getParsed(a),raw:e.data.datasets[r].data[a],formattedValue:o,dataset:A.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function hB(e,t){const n=e.chart.ctx,{body:r,footer:a,title:A}=e,{boxWidth:s,boxHeight:o}=t,l=ft(t.bodyFont),c=ft(t.titleFont),u=ft(t.footerFont),d=A.length,f=a.length,h=r.length,p=_t(t.padding);let m=p.height,y=0,g=r.reduce((B,b)=>B+b.before.length+b.lines.length+b.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),g){const B=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;m+=h*B+(g-h)*l.lineHeight+(g-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const _=function(B){y=Math.max(y,n.measureText(B).width+v)};return n.save(),n.font=c.string,Ve(e.title,_),n.font=l.string,Ve(e.beforeBody.concat(e.afterBody),_),v=t.displayColors?s+2+t.boxPadding:0,Ve(r,B=>{Ve(B.before,_),Ve(B.lines,_),Ve(B.after,_)}),v=0,n.font=u.string,Ve(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function _9(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function C9(e,t,n,r){const{x:a,width:A}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&a+A+s>t.width||e==="right"&&a-A-s<0)return!0}function E9(e,t,n,r){const{x:a,width:A}=n,{width:s,chartArea:{left:o,right:l}}=e;let c="center";return r==="center"?c=a<=(o+l)/2?"left":"right":a<=A/2?c="left":a>=s-A/2&&(c="right"),C9(c,e,t,n)&&(c="center"),c}function pB(e,t,n){const r=n.yAlign||t.yAlign||_9(e,n);return{xAlign:n.xAlign||t.xAlign||E9(e,t,n,r),yAlign:r}}function k9(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function S9(e,t,n){let{y:r,height:a}=e;return t==="top"?r+=n:t==="bottom"?r-=a+n:r-=a/2,r}function gB(e,t,n,r){const{caretSize:a,caretPadding:A,cornerRadius:s}=e,{xAlign:o,yAlign:l}=n,c=a+A,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Da(s);let p=k9(t,o);const m=S9(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+a:o==="right"&&(p+=Math.max(d,h)+a),{x:Mt(p,0,r.width-t.width),y:Mt(m,0,r.height-t.height)}}function Yl(e,t,n){const r=_t(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function mB(e){return lr([],Nr(e))}function x9(e,t,n){return rA(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function vB(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const v_={beforeTitle:Qr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Qr,beforeBody:Qr,beforeLabel:Qr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return _e(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Qr,afterBody:Qr,beforeFooter:Qr,footer:Qr,afterFooter:Qr};function sn(e,t,n,r){const a=e[t].call(n,r);return typeof a>"u"?v_[t].call(n,r):a}class Vh extends an{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&n.options.animation&&r.animations,A=new jg(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(A)),A}getContext(){return this.$context||(this.$context=x9(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,a=sn(r,"beforeTitle",this,t),A=sn(r,"title",this,t),s=sn(r,"afterTitle",this,t);let o=[];return o=lr(o,Nr(a)),o=lr(o,Nr(A)),o=lr(o,Nr(s)),o}getBeforeBody(t,n){return mB(sn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,a=[];return Ve(t,A=>{const s={before:[],lines:[],after:[]},o=vB(r,A);lr(s.before,Nr(sn(o,"beforeLabel",this,A))),lr(s.lines,sn(o,"label",this,A)),lr(s.after,Nr(sn(o,"afterLabel",this,A))),a.push(s)}),a}getAfterBody(t,n){return mB(sn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,a=sn(r,"beforeFooter",this,t),A=sn(r,"footer",this,t),s=sn(r,"afterFooter",this,t);let o=[];return o=lr(o,Nr(a)),o=lr(o,Nr(A)),o=lr(o,Nr(s)),o}_createItems(t){const n=this._active,r=this.chart.data,a=[],A=[],s=[];let o=[],l,c;for(l=0,c=n.length;l<c;++l)o.push(b9(this.chart,n[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,r))),Ve(o,u=>{const d=vB(t.callbacks,u);a.push(sn(d,"labelColor",this,u)),A.push(sn(d,"labelPointStyle",this,u)),s.push(sn(d,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=A,this.labelTextColors=s,this.dataPoints=o,o}update(t,n){const r=this.options.setContext(this.getContext()),a=this._active;let A,s=[];if(!a.length)this.opacity!==0&&(A={opacity:0});else{const o=Ii[r.position].call(this,a,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=hB(this,r),c=Object.assign({},o,l),u=pB(this.chart,r,c),d=gB(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,A={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,A&&this._resolveAnimations().update(this,A),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,a){const A=this.getCaretPosition(t,r,a);n.lineTo(A.x1,A.y1),n.lineTo(A.x2,A.y2),n.lineTo(A.x3,A.y3)}getCaretPosition(t,n,r){const{xAlign:a,yAlign:A}=this,{caretSize:s,cornerRadius:o}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Da(o),{x:f,y:h}=t,{width:p,height:m}=n;let y,g,v,_,B,b;return A==="center"?(B=h+m/2,a==="left"?(y=f,g=y-s,_=B+s,b=B-s):(y=f+p,g=y+s,_=B-s,b=B+s),v=y):(a==="left"?g=f+Math.max(l,u)+s:a==="right"?g=f+p-Math.max(c,d)-s:g=this.caretX,A==="top"?(_=h,B=_-s,y=g-s,v=g+s):(_=h+m,B=_+s,y=g+s,v=g-s),b=_),{x1:y,x2:g,x3:v,y1:_,y2:B,y3:b}}drawTitle(t,n,r){const a=this.title,A=a.length;let s,o,l;if(A){const c=Cs(r.rtl,this.x,this.width);for(t.x=Yl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=ft(r.titleFont),o=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<A;++l)n.fillText(a[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===A&&(t.y+=r.titleMarginBottom-o)}}_drawColorBox(t,n,r,a,A){const s=this.labelColors[r],o=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=A,u=ft(A.bodyFont),d=Yl(this,"left",A),f=a.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+h;if(A.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},y=a.leftForLtr(f,c)+c/2,g=p+l/2;t.strokeStyle=A.multiKeyBackground,t.fillStyle=A.multiKeyBackground,Lh(t,m,y,g),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Lh(t,m,y,g)}else{t.lineWidth=ve(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const m=a.leftForLtr(f,c),y=a.leftForLtr(a.xPlus(f,1),c-2),g=Da(s.borderRadius);Object.values(g).some(v=>v!==0)?(t.beginPath(),t.fillStyle=A.multiKeyBackground,Rs(t,{x:m,y:p,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Rs(t,{x:y,y:p+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=A.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:a}=this,{bodySpacing:A,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=ft(r.bodyFont);let f=d.lineHeight,h=0;const p=Cs(r.rtl,this.x,this.width),m=function(k){n.fillText(k,p.x(t.x+h),t.y+f/2),t.y+=f+A},y=p.textAlign(s);let g,v,_,B,b,w,C;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=Yl(this,y,r),n.fillStyle=r.bodyColor,Ve(this.beforeBody,m),h=o&&y!=="right"?s==="center"?c/2+u:c+2+u:0,B=0,w=a.length;B<w;++B){for(g=a[B],v=this.labelTextColors[B],n.fillStyle=v,Ve(g.before,m),_=g.lines,o&&_.length&&(this._drawColorBox(n,t,B,p,r),f=Math.max(d.lineHeight,l)),b=0,C=_.length;b<C;++b)m(_[b]),f=d.lineHeight;Ve(g.after,m)}h=0,f=d.lineHeight,Ve(this.afterBody,m),t.y-=A}drawFooter(t,n,r){const a=this.footer,A=a.length;let s,o;if(A){const l=Cs(r.rtl,this.x,this.width);for(t.x=Yl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=ft(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,o=0;o<A;++o)n.fillText(a[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,a){const{xAlign:A,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Da(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(o+d,l),s==="top"&&this.drawCaret(t,n,r,a),n.lineTo(o+c-f,l),n.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&A==="right"&&this.drawCaret(t,n,r,a),n.lineTo(o+c,l+u-p),n.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,n,r,a),n.lineTo(o+h,l+u),n.quadraticCurveTo(o,l+u,o,l+u-h),s==="center"&&A==="left"&&this.drawCaret(t,n,r,a),n.lineTo(o,l+d),n.quadraticCurveTo(o,l,o+d,l),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,a=r&&r.x,A=r&&r.y;if(a||A){const s=Ii[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=hB(this,t),l=Object.assign({},s,this._size),c=pB(n,t,l),u=gB(t,l,c,n);(a._to!==u.x||A._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},A={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=_t(n.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&o&&(t.save(),t.globalAlpha=r,this.drawBackground(A,t,a,n),Gb(t,n.textDirection),A.y+=s.top,this.drawTitle(A,t,n),this.drawBody(A,t,n),this.drawFooter(A,t,n),zb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,a=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),A=!iu(r,a),s=this._positionChanged(a,n);(A||s)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,A=this._active||[],s=this._getActiveElements(t,A,n,r),o=this._positionChanged(s,t),l=n||!iu(s,A)||o;return l&&(this._active=s,(a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,a){const A=this.options;if(t.type==="mouseout")return[];if(!a)return n;const s=this.chart.getElementsAtEventForMode(t,A.mode,A,r);return A.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:a,options:A}=this,s=Ii[A.position].call(this,t,n);return s!==!1&&(r!==s.x||a!==s.y)}}R(Vh,"positioners",Ii);var F9={id:"tooltip",_element:Vh,positioners:Ii,afterInit(e,t,n){n&&(e.tooltip=new Vh({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:v_},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},I9=Object.freeze({__proto__:null,Colors:VM,Decimation:GM,Filler:d9,Legend:v9,SubTitle:w9,Title:y9,Tooltip:F9});const U9=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Q9(e,t,n,r){const a=e.indexOf(t);if(a===-1)return U9(e,t,n,r);const A=e.lastIndexOf(t);return a!==A?n:a}const T9=(e,t)=>e===null?null:Mt(Math.round(e),0,t);function BB(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Kh extends $A{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:a,label:A}of n)r[a]===A&&r.splice(a,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(_e(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Q9(r,t,de(n,t),this._addedLabels),T9(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,a=[];let A=this.getLabels();A=t===0&&n===A.length-1?A:A.slice(t,n+1),this._valueRange=Math.max(A.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)a.push({value:s});return a}getLabelForValue(t){return BB.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(Kh,"id","category"),R(Kh,"defaults",{ticks:{callback:BB}});function D9(e,t){const n=[],{bounds:a,step:A,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=A||1,p=u-1,{min:m,max:y}=t,g=!_e(s),v=!_e(o),_=!_e(c),B=(y-m)/(d+1);let b=fv((y-m)/p/h)*h,w,C,k,S;if(b<1e-14&&!g&&!v)return[{value:m},{value:y}];S=Math.ceil(y/b)-Math.floor(m/b),S>p&&(b=fv(S*b/p/h)*h),_e(l)||(w=Math.pow(10,l),b=Math.ceil(b*w)/w),a==="ticks"?(C=Math.floor(m/b)*b,k=Math.ceil(y/b)*b):(C=m,k=y),g&&v&&A&&FL((o-s)/A,b/1e3)?(S=Math.round(Math.min((o-s)/b,u)),b=(o-s)/S,C=s,k=o):_?(C=g?s:C,k=v?o:k,S=c-1,b=(k-C)/S):(S=(k-C)/b,Yi(S,Math.round(S),b/1e3)?S=Math.round(S):S=Math.ceil(S));const T=Math.max(hv(b),hv(C));w=Math.pow(10,_e(l)?T:l),C=Math.round(C*w)/w,k=Math.round(k*w)/w;let U=0;for(g&&(f&&C!==s?(n.push({value:s}),C<s&&U++,Yi(Math.round((C+U*b)*w)/w,s,yB(s,B,e))&&U++):C<s&&U++);U<S;++U){const F=Math.round((C+U*b)*w)/w;if(v&&F>o)break;n.push({value:F})}return v&&f&&k!==o?n.length&&Yi(n[n.length-1].value,o,yB(o,B,e))?n[n.length-1].value=o:n.push({value:o}):(!v||k===o)&&n.push({value:k}),n}function yB(e,t,{horizontal:n,minRotation:r}){const a=Et(r),A=(n?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/A,s)}class pu extends $A{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return _e(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:a,max:A}=this;const s=l=>a=n?a:l,o=l=>A=r?A:l;if(t){const l=vr(a),c=vr(A);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(a===A){let l=A===0?1:Math.abs(A*.05);o(A+l),t||s(a-l)}this.min=a,this.max=A}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},A=this._range||this,s=D9(a,A);return t.bounds==="ticks"&&xb(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const a=(r-n)/Math.max(t.length-1,1)/2;n-=a,r+=a}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return el(t,this.chart.options.locale,this.options.ticks.format)}}class $h extends pu{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ut(t)?t:0,this.max=ut(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Et(this.options.ticks.minRotation),a=(t?Math.sin(r):Math.cos(r))||.001,A=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,A.lineHeight/a))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R($h,"id","linear"),R($h,"defaults",{ticks:{callback:td.formatters.numeric}});const Fo=e=>Math.floor(Ea(e)),oA=(e,t)=>Math.pow(10,Fo(e)+t);function wB(e){return e/Math.pow(10,Fo(e))===1}function bB(e,t,n){const r=Math.pow(10,n),a=Math.floor(e/r);return Math.ceil(t/r)-a}function L9(e,t){const n=t-e;let r=Fo(n);for(;bB(e,t,r)>10;)r++;for(;bB(e,t,r)<10;)r--;return Math.min(r,Fo(e))}function O9(e,{min:t,max:n}){t=wn(e.min,t);const r=[],a=Fo(t);let A=L9(t,n),s=A<0?Math.pow(10,Math.abs(A)):1;const o=Math.pow(10,A),l=a>A?Math.pow(10,a):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,A)),f=wn(e.min,Math.round((l+u+d*Math.pow(10,A))*s)/s);for(;f<n;)r.push({value:f,major:wB(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(A++,d=2,s=A>=0?1:s),f=Math.round((l+u+d*Math.pow(10,A))*s)/s;const h=wn(e.max,f);return r.push({value:h,major:wB(h),significand:d}),r}class Wh extends $A{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=pu.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return ut(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ut(t)?Math.max(0,t):null,this.max=ut(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ut(this._userMin)&&(this.min=t===oA(this.min,0)?oA(this.min,-1):oA(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,a=this.max;const A=o=>r=t?r:o,s=o=>a=n?a:o;r===a&&(r<=0?(A(1),s(10)):(A(oA(r,-1)),s(oA(a,1)))),r<=0&&A(oA(a,-1)),a<=0&&s(oA(r,1)),this.min=r,this.max=a}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=O9(n,this);return t.bounds==="ticks"&&xb(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":el(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ea(t),this._valueRange=Ea(this.max)-Ea(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ea(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Wh,"id","logarithmic"),R(Wh,"defaults",{ticks:{callback:td.formatters.logarithmic,major:{enabled:!0}}});function Gh(e){const t=e.ticks;if(t.display&&e.display){const n=_t(t.backdropPadding);return de(t.font&&t.font.size,dt.font.size)+n.height}return 0}function M9(e,t,n){return n=Oe(n)?n:[n],{w:GL(e,t.string,n),h:n.length*t.lineHeight}}function _B(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function N9(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],a=[],A=e._pointLabels.length,s=e.options.pointLabels,o=s.centerPointLabels?Qe/A:0;for(let l=0;l<A;l++){const c=s.setContext(e.getPointLabelContext(l));a[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+a[l],o),d=ft(c.font),f=M9(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=_n(e.getIndexAngle(l)+o),p=Math.round(ed(h)),m=_B(p,u.x,f.w,0,180),y=_B(p,u.y,f.h,90,270);P9(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=V9(e,r,a)}function P9(e,t,n,r,a){const A=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let o=0,l=0;r.start<t.l?(o=(t.l-r.start)/A,e.l=Math.min(e.l,t.l-o)):r.end>t.r&&(o=(r.end-t.r)/A,e.r=Math.max(e.r,t.r+o)),a.start<t.t?(l=(t.t-a.start)/s,e.t=Math.min(e.t,t.t-l)):a.end>t.b&&(l=(a.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function H9(e,t,n){const r=e.drawingArea,{extra:a,additionalAngle:A,padding:s,size:o}=n,l=e.getPointPosition(t,r+a+s,A),c=Math.round(ed(_n(l.angle+Je))),u=W9(l.y,o.h,c),d=K9(c),f=$9(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function R9(e,t){if(!t)return!0;const{left:n,top:r,right:a,bottom:A}=e;return!(Gr({x:n,y:r},t)||Gr({x:n,y:A},t)||Gr({x:a,y:r},t)||Gr({x:a,y:A},t))}function V9(e,t,n){const r=[],a=e._pointLabels.length,A=e.options,{centerPointLabels:s,display:o}=A.pointLabels,l={extra:Gh(A)/2,additionalAngle:s?Qe/a:0};let c;for(let u=0;u<a;u++){l.padding=n[u],l.size=t[u];const d=H9(e,u,l);r.push(d),o==="auto"&&(d.visible=R9(d,c),d.visible&&(c=d))}return r}function K9(e){return e===0||e===180?"center":e<180?"left":"right"}function $9(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function W9(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function G9(e,t,n){const{left:r,top:a,right:A,bottom:s}=n,{backdropColor:o}=t;if(!_e(o)){const l=Da(t.borderRadius),c=_t(t.backdropPadding);e.fillStyle=o;const u=r-c.left,d=a-c.top,f=A-r+c.width,h=s-a+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Rs(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function z9(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let a=t-1;a>=0;a--){const A=e._pointLabelItems[a];if(!A.visible)continue;const s=r.setContext(e.getPointLabelContext(a));G9(n,s,A);const o=ft(s.font),{x:l,y:c,textAlign:u}=A;OA(n,e._pointLabels[a],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function B_(e,t,n,r){const{ctx:a}=e;if(n)a.arc(e.xCenter,e.yCenter,t,0,Xe);else{let A=e.getPointPosition(0,t);a.moveTo(A.x,A.y);for(let s=1;s<r;s++)A=e.getPointPosition(s,t),a.lineTo(A.x,A.y)}}function j9(e,t,n,r,a){const A=e.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!r||!o||!l||n<0||(A.save(),A.strokeStyle=o,A.lineWidth=l,A.setLineDash(a.dash),A.lineDashOffset=a.dashOffset,A.beginPath(),B_(e,n,s,r),A.closePath(),A.stroke(),A.restore())}function Y9(e,t,n){return rA(e,{label:n,index:t,type:"pointLabel"})}class Ui extends pu{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=_t(Gh(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=ut(t)&&!isNaN(t)?t:0,this.max=ut(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gh(this.options))}generateTickLabels(t){pu.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const a=He(this.options.pointLabels.callback,[n,r],this);return a||a===0?a:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?N9(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,a){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,a))}getIndexAngle(t){const n=Xe/(this._pointLabels.length||1),r=this.options.startAngle||0;return _n(t*n+Et(r))}getDistanceFromCenterForValue(t){if(_e(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(_e(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return Y9(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const a=this.getIndexAngle(t)-Je+r;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:a,bottom:A}=this._pointLabelItems[t];return{left:n,top:r,right:a,bottom:A}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),B_(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:a,border:A}=n,s=this._pointLabels.length;let o,l,c;if(n.pointLabels.display&&z9(this,s),a.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=a.setContext(f),p=A.setContext(f);j9(this,h,l,s,p)}}),r.display){for(t.save(),o=s-1;o>=0;o--){const u=r.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const a=this.getIndexAngle(0);let A,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(a),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=ft(c.font);if(A=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=_t(c.backdropPadding);t.fillRect(-s/2-d.left,-A-u.size/2-d.top,s+d.width,u.size+d.height)}OA(t,o.label,0,-A,u,{color:c.color})}),t.restore()}drawTitle(){}}R(Ui,"id","radialLinear"),R(Ui,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:td.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(Ui,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(Ui,"descriptors",{angleLines:{_fallback:"grid"}});const rd={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}},hn=Object.keys(rd);function q9(e,t){return e-t}function CB(e,t){if(_e(t))return null;const n=e._adapter,{parser:r,round:a,isoWeekday:A}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),ut(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(a&&(s=a==="week"&&(za(A)||A===!0)?n.startOf(s,"isoWeek",A):n.startOf(s,a)),+s)}function EB(e,t,n,r){const a=hn.length;for(let A=hn.indexOf(e);A<a-1;++A){const s=rd[hn[A]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(o*s.size))<=r)return hn[A]}return hn[a-1]}function X9(e,t,n,r,a){for(let A=hn.length-1;A>=hn.indexOf(n);A--){const s=hn[A];if(rd[s].common&&e._adapter.diff(a,r,s)>=t-1)return s}return hn[n?hn.indexOf(n):0]}function J9(e){for(let t=hn.indexOf(e)+1,n=hn.length;t<n;++t)if(rd[hn[t]].common)return hn[t]}function kB(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:a}=Hg(n,t),A=n[r]>=t?n[r]:n[a];e[A]=!0}}function Z9(e,t,n,r){const a=e._adapter,A=+a.startOf(t[0].value,r),s=t[t.length-1].value;let o,l;for(o=A;o<=s;o=+a.add(o,1,r))l=n[o],l>=0&&(t[l].major=!0);return t}function SB(e,t,n){const r=[],a={},A=t.length;let s,o;for(s=0;s<A;++s)o=t[s],a[o]=s,r.push({value:o,major:!1});return A===0||!n?r:Z9(e,r,a,n)}class Io extends $A{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),a=this._adapter=new Zb._date(t.adapters.date);a.init(n),ji(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:CB(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:a,max:A,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(a=Math.min(a,c.min)),!o&&!isNaN(c.max)&&(A=Math.max(A,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),a=ut(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),A=ut(A)&&!isNaN(A)?A:+n.endOf(Date.now(),r)+1,this.min=Math.min(a,A-1),this.max=Math.max(a+1,A)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const A=this.min,s=this.max,o=TL(a,A,s);return this._unit=n.unit||(r.autoSkip?EB(n.minUnit,this.min,this.max,this._getLabelCapacity(A)):X9(this,o.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:J9(this._unit),this.initOffsets(a),t.reverse&&o.reverse(),SB(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,a,A;this.options.offset&&t.length&&(a=this.getDecimalForValue(t[0]),t.length===1?n=1-a:n=(this.getDecimalForValue(t[1])-a)/2,A=this.getDecimalForValue(t[t.length-1]),t.length===1?r=A:r=(A-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Mt(n,0,s),r=Mt(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,a=this.options,A=a.time,s=A.unit||EB(A.minUnit,n,r,this._getLabelCapacity(n)),o=de(a.ticks.stepSize,1),l=s==="week"?A.isoWeekday:!1,c=za(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*o)throw new Error(n+" and "+r+" are too far apart with stepSize of "+o+" "+s);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,o,s),h++)kB(u,f,p);return(f===r||a.bounds==="ticks"||h===1)&&kB(u,f,p),Object.keys(u).sort((m,y)=>m-y).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const a=this.options.time.displayFormats,A=this._unit,s=n||a[A];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,a){const A=this.options,s=A.ticks.callback;if(s)return He(s,[t,n,r],this);const o=A.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,a||(h?d:u))}generateTickLabels(t){let n,r,a;for(n=0,r=t.length;n<r;++n)a=t[n],a.label=this._tickFormatFunction(a.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,a=Et(this.isHorizontal()?n.maxRotation:n.minRotation),A=Math.cos(a),s=Math.sin(a),o=this._resolveTickFontOptions(0).size;return{w:r*A+o*s,h:r*s+o*A}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,A=this._tickFormatFunction(t,0,SB(this,[t],this._majorUnit),a),s=this._getLabelSize(A),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,r=a.length;n<r;++n)t=t.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const a=this.getLabels();for(n=0,r=a.length;n<r;++n)t.push(CB(this,a[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ub(t.sort(q9))}}R(Io,"id","time"),R(Io,"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 ql(e,t,n){let r=0,a=e.length-1,A,s,o,l;n?(t>=e[r].pos&&t<=e[a].pos&&({lo:r,hi:a}=Wr(e,"pos",t)),{pos:A,time:o}=e[r],{pos:s,time:l}=e[a]):(t>=e[r].time&&t<=e[a].time&&({lo:r,hi:a}=Wr(e,"time",t)),{time:A,pos:o}=e[r],{time:s,pos:l}=e[a]);const c=s-A;return c?o+(l-o)*(t-A)/c:o}class zh extends Io{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ql(n,this.min),this._tableRange=ql(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,a=[],A=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=n&&c<=r&&a.push(c);if(a.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,o=a.length;s<o;++s)u=a[s+1],l=a[s-1],c=a[s],Math.round((u+l)/2)!==c&&A.push({time:c,pos:s/(o-1)});return A}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(ql(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ql(this._table,r*this._tableRange+this._minPos,!0)}}R(zh,"id","timeseries"),R(zh,"defaults",Io.defaults);var eN=Object.freeze({__proto__:null,CategoryScale:Kh,LinearScale:$h,LogarithmicScale:Wh,RadialLinearScale:Ui,TimeScale:Io,TimeSeriesScale:zh});const Cr=[i7,OM,I9,eN];var tN=typeof global=="object"&&global&&global.Object===Object&&global;const y_=tN;var nN=typeof self=="object"&&self&&self.Object===Object&&self,rN=y_||nN||Function("return this")();const Er=rN;var aN=Er.Symbol;const ja=aN;var w_=Object.prototype,AN=w_.hasOwnProperty,sN=w_.toString,vi=ja?ja.toStringTag:void 0;function iN(e){var t=AN.call(e,vi),n=e[vi];try{e[vi]=void 0;var r=!0}catch{}var a=sN.call(e);return r&&(t?e[vi]=n:delete e[vi]),a}var oN=Object.prototype,lN=oN.toString;function cN(e){return lN.call(e)}var uN="[object Null]",dN="[object Undefined]",xB=ja?ja.toStringTag:void 0;function al(e){return e==null?e===void 0?dN:uN:xB&&xB in Object(e)?iN(e):cN(e)}function MA(e){return e!=null&&typeof e=="object"}var fN=Array.isArray;const $s=fN;function Al(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var hN="[object AsyncFunction]",pN="[object Function]",gN="[object GeneratorFunction]",mN="[object Proxy]";function b_(e){if(!Al(e))return!1;var t=al(e);return t==pN||t==gN||t==hN||t==mN}var vN=Er["__core-js_shared__"];const Cf=vN;var FB=function(){var e=/[^.]+$/.exec(Cf&&Cf.keys&&Cf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function BN(e){return!!FB&&FB in e}var yN=Function.prototype,wN=yN.toString;function WA(e){if(e!=null){try{return wN.call(e)}catch{}try{return e+""}catch{}}return""}var bN=/[\\^$.*+?()[\]{}|]/g,_N=/^\[object .+?Constructor\]$/,CN=Function.prototype,EN=Object.prototype,kN=CN.toString,SN=EN.hasOwnProperty,xN=RegExp("^"+kN.call(SN).replace(bN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function FN(e){if(!Al(e)||BN(e))return!1;var t=b_(e)?xN:_N;return t.test(WA(e))}function IN(e,t){return e==null?void 0:e[t]}function GA(e,t){var n=IN(e,t);return FN(n)?n:void 0}var UN=GA(Er,"WeakMap");const jh=UN;var IB=Object.create,QN=function(){function e(){}return function(t){if(!Al(t))return{};if(IB)return IB(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const TN=QN;function DN(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var LN=function(){try{var e=GA(Object,"defineProperty");return e({},"",{}),e}catch{}}();const UB=LN;function ON(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var MN=9007199254740991,NN=/^(?:0|[1-9]\d*)$/;function PN(e,t){var n=typeof e;return t=t??MN,!!t&&(n=="number"||n!="symbol"&&NN.test(e))&&e>-1&&e%1==0&&e<t}function __(e,t,n){t=="__proto__"&&UB?UB(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Jg(e,t){return e===t||e!==e&&t!==t}var HN=Object.prototype,RN=HN.hasOwnProperty;function C_(e,t,n){var r=e[t];(!(RN.call(e,t)&&Jg(r,n))||n===void 0&&!(t in e))&&__(e,t,n)}function ad(e,t,n,r){var a=!n;n||(n={});for(var A=-1,s=t.length;++A<s;){var o=t[A],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),a?__(n,o,l):C_(n,o,l)}return n}var VN=9007199254740991;function E_(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=VN}function Zg(e){return e!=null&&E_(e.length)&&!b_(e)}var KN=Object.prototype;function Ad(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||KN;return e===n}function $N(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var WN="[object Arguments]";function QB(e){return MA(e)&&al(e)==WN}var k_=Object.prototype,GN=k_.hasOwnProperty,zN=k_.propertyIsEnumerable,jN=QB(function(){return arguments}())?QB:function(e){return MA(e)&&GN.call(e,"callee")&&!zN.call(e,"callee")};const S_=jN;function YN(){return!1}var x_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,TB=x_&&typeof module=="object"&&module&&!module.nodeType&&module,qN=TB&&TB.exports===x_,DB=qN?Er.Buffer:void 0,XN=DB?DB.isBuffer:void 0,JN=XN||YN;const Uo=JN;var ZN="[object Arguments]",eP="[object Array]",tP="[object Boolean]",nP="[object Date]",rP="[object Error]",aP="[object Function]",AP="[object Map]",sP="[object Number]",iP="[object Object]",oP="[object RegExp]",lP="[object Set]",cP="[object String]",uP="[object WeakMap]",dP="[object ArrayBuffer]",fP="[object DataView]",hP="[object Float32Array]",pP="[object Float64Array]",gP="[object Int8Array]",mP="[object Int16Array]",vP="[object Int32Array]",BP="[object Uint8Array]",yP="[object Uint8ClampedArray]",wP="[object Uint16Array]",bP="[object Uint32Array]",nt={};nt[hP]=nt[pP]=nt[gP]=nt[mP]=nt[vP]=nt[BP]=nt[yP]=nt[wP]=nt[bP]=!0;nt[ZN]=nt[eP]=nt[dP]=nt[tP]=nt[fP]=nt[nP]=nt[rP]=nt[aP]=nt[AP]=nt[sP]=nt[iP]=nt[oP]=nt[lP]=nt[cP]=nt[uP]=!1;function _P(e){return MA(e)&&E_(e.length)&&!!nt[al(e)]}function em(e){return function(t){return e(t)}}var F_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,to=F_&&typeof module=="object"&&module&&!module.nodeType&&module,CP=to&&to.exports===F_,Ef=CP&&y_.process,EP=function(){try{var e=to&&to.require&&to.require("util").types;return e||Ef&&Ef.binding&&Ef.binding("util")}catch{}}();const Ws=EP;var LB=Ws&&Ws.isTypedArray,kP=LB?em(LB):_P;const tm=kP;var SP=Object.prototype,xP=SP.hasOwnProperty;function I_(e,t){var n=$s(e),r=!n&&S_(e),a=!n&&!r&&Uo(e),A=!n&&!r&&!a&&tm(e),s=n||r||a||A,o=s?$N(e.length,String):[],l=o.length;for(var c in e)(t||xP.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||A&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||PN(c,l)))&&o.push(c);return o}function U_(e,t){return function(n){return e(t(n))}}var FP=U_(Object.keys,Object);const IP=FP;var UP=Object.prototype,QP=UP.hasOwnProperty;function Q_(e){if(!Ad(e))return IP(e);var t=[];for(var n in Object(e))QP.call(e,n)&&n!="constructor"&&t.push(n);return t}function nm(e){return Zg(e)?I_(e):Q_(e)}function TP(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var DP=Object.prototype,LP=DP.hasOwnProperty;function OP(e){if(!Al(e))return TP(e);var t=Ad(e),n=[];for(var r in e)r=="constructor"&&(t||!LP.call(e,r))||n.push(r);return n}function rm(e){return Zg(e)?I_(e,!0):OP(e)}var MP=GA(Object,"create");const Qo=MP;function NP(){this.__data__=Qo?Qo(null):{},this.size=0}function PP(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HP="__lodash_hash_undefined__",RP=Object.prototype,VP=RP.hasOwnProperty;function KP(e){var t=this.__data__;if(Qo){var n=t[e];return n===HP?void 0:n}return VP.call(t,e)?t[e]:void 0}var $P=Object.prototype,WP=$P.hasOwnProperty;function GP(e){var t=this.__data__;return Qo?t[e]!==void 0:WP.call(t,e)}var zP="__lodash_hash_undefined__";function jP(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Qo&&t===void 0?zP:t,this}function NA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}NA.prototype.clear=NP;NA.prototype.delete=PP;NA.prototype.get=KP;NA.prototype.has=GP;NA.prototype.set=jP;function YP(){this.__data__=[],this.size=0}function sd(e,t){for(var n=e.length;n--;)if(Jg(e[n][0],t))return n;return-1}var qP=Array.prototype,XP=qP.splice;function JP(e){var t=this.__data__,n=sd(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():XP.call(t,n,1),--this.size,!0}function ZP(e){var t=this.__data__,n=sd(t,e);return n<0?void 0:t[n][1]}function eH(e){return sd(this.__data__,e)>-1}function tH(e,t){var n=this.__data__,r=sd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function sa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sa.prototype.clear=YP;sa.prototype.delete=JP;sa.prototype.get=ZP;sa.prototype.has=eH;sa.prototype.set=tH;var nH=GA(Er,"Map");const To=nH;function rH(){this.size=0,this.__data__={hash:new NA,map:new(To||sa),string:new NA}}function aH(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function id(e,t){var n=e.__data__;return aH(t)?n[typeof t=="string"?"string":"hash"]:n.map}function AH(e){var t=id(this,e).delete(e);return this.size-=t?1:0,t}function sH(e){return id(this,e).get(e)}function iH(e){return id(this,e).has(e)}function oH(e,t){var n=id(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function zA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zA.prototype.clear=rH;zA.prototype.delete=AH;zA.prototype.get=sH;zA.prototype.has=iH;zA.prototype.set=oH;function T_(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var lH=U_(Object.getPrototypeOf,Object);const D_=lH;function cH(){this.__data__=new sa,this.size=0}function uH(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function dH(e){return this.__data__.get(e)}function fH(e){return this.__data__.has(e)}var hH=200;function pH(e,t){var n=this.__data__;if(n instanceof sa){var r=n.__data__;if(!To||r.length<hH-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new zA(r)}return n.set(e,t),this.size=n.size,this}function qr(e){var t=this.__data__=new sa(e);this.size=t.size}qr.prototype.clear=cH;qr.prototype.delete=uH;qr.prototype.get=dH;qr.prototype.has=fH;qr.prototype.set=pH;function gH(e,t){return e&&ad(t,nm(t),e)}function mH(e,t){return e&&ad(t,rm(t),e)}var L_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,OB=L_&&typeof module=="object"&&module&&!module.nodeType&&module,vH=OB&&OB.exports===L_,MB=vH?Er.Buffer:void 0,NB=MB?MB.allocUnsafe:void 0;function BH(e,t){if(t)return e.slice();var n=e.length,r=NB?NB(n):new e.constructor(n);return e.copy(r),r}function yH(e,t){for(var n=-1,r=e==null?0:e.length,a=0,A=[];++n<r;){var s=e[n];t(s,n,e)&&(A[a++]=s)}return A}function O_(){return[]}var wH=Object.prototype,bH=wH.propertyIsEnumerable,PB=Object.getOwnPropertySymbols,_H=PB?function(e){return e==null?[]:(e=Object(e),yH(PB(e),function(t){return bH.call(e,t)}))}:O_;const am=_H;function CH(e,t){return ad(e,am(e),t)}var EH=Object.getOwnPropertySymbols,kH=EH?function(e){for(var t=[];e;)T_(t,am(e)),e=D_(e);return t}:O_;const M_=kH;function SH(e,t){return ad(e,M_(e),t)}function N_(e,t,n){var r=t(e);return $s(e)?r:T_(r,n(e))}function Yh(e){return N_(e,nm,am)}function xH(e){return N_(e,rm,M_)}var FH=GA(Er,"DataView");const qh=FH;var IH=GA(Er,"Promise");const Xh=IH;var UH=GA(Er,"Set");const Jh=UH;var HB="[object Map]",QH="[object Object]",RB="[object Promise]",VB="[object Set]",KB="[object WeakMap]",$B="[object DataView]",TH=WA(qh),DH=WA(To),LH=WA(Xh),OH=WA(Jh),MH=WA(jh),hA=al;(qh&&hA(new qh(new ArrayBuffer(1)))!=$B||To&&hA(new To)!=HB||Xh&&hA(Xh.resolve())!=RB||Jh&&hA(new Jh)!=VB||jh&&hA(new jh)!=KB)&&(hA=function(e){var t=al(e),n=t==QH?e.constructor:void 0,r=n?WA(n):"";if(r)switch(r){case TH:return $B;case DH:return HB;case LH:return RB;case OH:return VB;case MH:return KB}return t});const Gs=hA;var NH=Object.prototype,PH=NH.hasOwnProperty;function HH(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&PH.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var RH=Er.Uint8Array;const gu=RH;function Am(e){var t=new e.constructor(e.byteLength);return new gu(t).set(new gu(e)),t}function VH(e,t){var n=t?Am(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var KH=/\w*$/;function $H(e){var t=new e.constructor(e.source,KH.exec(e));return t.lastIndex=e.lastIndex,t}var WB=ja?ja.prototype:void 0,GB=WB?WB.valueOf:void 0;function WH(e){return GB?Object(GB.call(e)):{}}function GH(e,t){var n=t?Am(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var zH="[object Boolean]",jH="[object Date]",YH="[object Map]",qH="[object Number]",XH="[object RegExp]",JH="[object Set]",ZH="[object String]",eR="[object Symbol]",tR="[object ArrayBuffer]",nR="[object DataView]",rR="[object Float32Array]",aR="[object Float64Array]",AR="[object Int8Array]",sR="[object Int16Array]",iR="[object Int32Array]",oR="[object Uint8Array]",lR="[object Uint8ClampedArray]",cR="[object Uint16Array]",uR="[object Uint32Array]";function dR(e,t,n){var r=e.constructor;switch(t){case tR:return Am(e);case zH:case jH:return new r(+e);case nR:return VH(e,n);case rR:case aR:case AR:case sR:case iR:case oR:case lR:case cR:case uR:return GH(e,n);case YH:return new r;case qH:case ZH:return new r(e);case XH:return $H(e);case JH:return new r;case eR:return WH(e)}}function fR(e){return typeof e.constructor=="function"&&!Ad(e)?TN(D_(e)):{}}var hR="[object Map]";function pR(e){return MA(e)&&Gs(e)==hR}var zB=Ws&&Ws.isMap,gR=zB?em(zB):pR;const mR=gR;var vR="[object Set]";function BR(e){return MA(e)&&Gs(e)==vR}var jB=Ws&&Ws.isSet,yR=jB?em(jB):BR;const wR=yR;var bR=1,_R=2,CR=4,P_="[object Arguments]",ER="[object Array]",kR="[object Boolean]",SR="[object Date]",xR="[object Error]",H_="[object Function]",FR="[object GeneratorFunction]",IR="[object Map]",UR="[object Number]",R_="[object Object]",QR="[object RegExp]",TR="[object Set]",DR="[object String]",LR="[object Symbol]",OR="[object WeakMap]",MR="[object ArrayBuffer]",NR="[object DataView]",PR="[object Float32Array]",HR="[object Float64Array]",RR="[object Int8Array]",VR="[object Int16Array]",KR="[object Int32Array]",$R="[object Uint8Array]",WR="[object Uint8ClampedArray]",GR="[object Uint16Array]",zR="[object Uint32Array]",Ye={};Ye[P_]=Ye[ER]=Ye[MR]=Ye[NR]=Ye[kR]=Ye[SR]=Ye[PR]=Ye[HR]=Ye[RR]=Ye[VR]=Ye[KR]=Ye[IR]=Ye[UR]=Ye[R_]=Ye[QR]=Ye[TR]=Ye[DR]=Ye[LR]=Ye[$R]=Ye[WR]=Ye[GR]=Ye[zR]=!0;Ye[xR]=Ye[H_]=Ye[OR]=!1;function Hc(e,t,n,r,a,A){var s,o=t&bR,l=t&_R,c=t&CR;if(n&&(s=a?n(e,r,a,A):n(e)),s!==void 0)return s;if(!Al(e))return e;var u=$s(e);if(u){if(s=HH(e),!o)return DN(e,s)}else{var d=Gs(e),f=d==H_||d==FR;if(Uo(e))return BH(e,o);if(d==R_||d==P_||f&&!a){if(s=l||f?{}:fR(e),!o)return l?SH(e,mH(s,e)):CH(e,gH(s,e))}else{if(!Ye[d])return a?e:{};s=dR(e,d,o)}}A||(A=new qr);var h=A.get(e);if(h)return h;A.set(e,s),wR(e)?e.forEach(function(y){s.add(Hc(y,t,n,y,e,A))}):mR(e)&&e.forEach(function(y,g){s.set(g,Hc(y,t,n,g,e,A))});var p=c?l?xH:Yh:l?rm:nm,m=u?void 0:p(e);return ON(m||e,function(y,g){m&&(g=y,y=e[g]),C_(s,g,Hc(y,t,n,g,e,A))}),s}var jR=1,YR=4;function Bi(e){return Hc(e,jR|YR)}var qR="__lodash_hash_undefined__";function XR(e){return this.__data__.set(e,qR),this}function JR(e){return this.__data__.has(e)}function mu(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new zA;++t<n;)this.add(e[t])}mu.prototype.add=mu.prototype.push=XR;mu.prototype.has=JR;function ZR(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function eV(e,t){return e.has(t)}var tV=1,nV=2;function V_(e,t,n,r,a,A){var s=n&tV,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=A.get(e),u=A.get(t);if(c&&u)return c==t&&u==e;var d=-1,f=!0,h=n&nV?new mu:void 0;for(A.set(e,t),A.set(t,e);++d<o;){var p=e[d],m=t[d];if(r)var y=s?r(m,p,d,t,e,A):r(p,m,d,e,t,A);if(y!==void 0){if(y)continue;f=!1;break}if(h){if(!ZR(t,function(g,v){if(!eV(h,v)&&(p===g||a(p,g,n,r,A)))return h.push(v)})){f=!1;break}}else if(!(p===m||a(p,m,n,r,A))){f=!1;break}}return A.delete(e),A.delete(t),f}function rV(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function aV(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var AV=1,sV=2,iV="[object Boolean]",oV="[object Date]",lV="[object Error]",cV="[object Map]",uV="[object Number]",dV="[object RegExp]",fV="[object Set]",hV="[object String]",pV="[object Symbol]",gV="[object ArrayBuffer]",mV="[object DataView]",YB=ja?ja.prototype:void 0,kf=YB?YB.valueOf:void 0;function vV(e,t,n,r,a,A,s){switch(n){case mV:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gV:return!(e.byteLength!=t.byteLength||!A(new gu(e),new gu(t)));case iV:case oV:case uV:return Jg(+e,+t);case lV:return e.name==t.name&&e.message==t.message;case dV:case hV:return e==t+"";case cV:var o=rV;case fV:var l=r&AV;if(o||(o=aV),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=sV,s.set(e,t);var u=V_(o(e),o(t),r,a,A,s);return s.delete(e),u;case pV:if(kf)return kf.call(e)==kf.call(t)}return!1}var BV=1,yV=Object.prototype,wV=yV.hasOwnProperty;function bV(e,t,n,r,a,A){var s=n&BV,o=Yh(e),l=o.length,c=Yh(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in t:wV.call(t,f)))return!1}var h=A.get(e),p=A.get(t);if(h&&p)return h==t&&p==e;var m=!0;A.set(e,t),A.set(t,e);for(var y=s;++d<l;){f=o[d];var g=e[f],v=t[f];if(r)var _=s?r(v,g,f,t,e,A):r(g,v,f,e,t,A);if(!(_===void 0?g===v||a(g,v,n,r,A):_)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var B=e.constructor,b=t.constructor;B!=b&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof b=="function"&&b instanceof b)&&(m=!1)}return A.delete(e),A.delete(t),m}var _V=1,qB="[object Arguments]",XB="[object Array]",Xl="[object Object]",CV=Object.prototype,JB=CV.hasOwnProperty;function EV(e,t,n,r,a,A){var s=$s(e),o=$s(t),l=s?XB:Gs(e),c=o?XB:Gs(t);l=l==qB?Xl:l,c=c==qB?Xl:c;var u=l==Xl,d=c==Xl,f=l==c;if(f&&Uo(e)){if(!Uo(t))return!1;s=!0,u=!1}if(f&&!u)return A||(A=new qr),s||tm(e)?V_(e,t,n,r,a,A):vV(e,t,l,n,r,a,A);if(!(n&_V)){var h=u&&JB.call(e,"__wrapped__"),p=d&&JB.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,y=p?t.value():t;return A||(A=new qr),a(m,y,n,r,A)}}return f?(A||(A=new qr),bV(e,t,n,r,a,A)):!1}function K_(e,t,n,r,a){return e===t?!0:e==null||t==null||!MA(e)&&!MA(t)?e!==e&&t!==t:EV(e,t,n,r,K_,a)}var kV="[object Map]",SV="[object Set]",xV=Object.prototype,FV=xV.hasOwnProperty;function IV(e){if(e==null)return!0;if(Zg(e)&&($s(e)||typeof e=="string"||typeof e.splice=="function"||Uo(e)||tm(e)||S_(e)))return!e.length;var t=Gs(e);if(t==kV||t==SV)return!e.size;if(Ad(e))return!Q_(e).length;for(var n in e)if(FV.call(e,n))return!1;return!0}function ZB(e,t){return K_(e,t)}var UV=Object.defineProperty,QV=Object.defineProperties,TV=Object.getOwnPropertyDescriptors,ey=Object.getOwnPropertySymbols,DV=Object.prototype.hasOwnProperty,LV=Object.prototype.propertyIsEnumerable,ty=(e,t,n)=>t in e?UV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OV=(e,t)=>{for(var n in t||(t={}))DV.call(t,n)&&ty(e,n,t[n]);if(ey)for(var n of ey(t))LV.call(t,n)&&ty(e,n,t[n]);return e},MV=(e,t)=>QV(e,TV(t));function NV(e){return(e.match(/[a-zA-Z0-9]+/g)||[]).map(t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`).join("")}var aA=(e,t)=>{const n={chartData:{type:Object,required:!0},options:{type:Object,required:!1},chartId:{default:e,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:()=>[]},onLabelsUpdate:{type:Function},onChartUpdate:{type:Function},onChartDestroy:{type:Function},onChartRender:{type:Function}},r=NV(e);return i.defineComponent({name:r,props:n,emits:{"labels:update":()=>!0,"chart:update":a=>!0,"chart:destroy":()=>!0,"chart:render":a=>!0},setup(a,{emit:A,expose:s}){const o=i.ref(null),l=`${a.chartId}`;let c=i.shallowRef(null);i.watch(()=>a.chartData,u,{deep:!0}),i.watch(()=>a.options,y=>{c.value&&y&&(c.value.options=Bi(y),p())},{deep:!0});function u(y){if(c.value){let g=c.value;ZB(y.labels,c.value.data.labels)||(g.data.labels=y.labels,f()),ZB(y.datasets,c.value.data.datasets)||y.datasets.forEach((v,_)=>{var B,b;if(IV(v))g.data.datasets=[];else{const w=Bi(g.data),C=Object.keys((b=(B=w.datasets)==null?void 0:B[_])!=null?b:{}),k=Object.keys(v);C.filter(T=>T!=="_meta"&&k.indexOf(T)===-1).forEach(T=>{g.data.datasets[_]&&delete g.data.datasets[_][T]});for(const T in v){const U=Bi(v[T]);g.data.datasets[_]||(g.data.datasets[_]={}),v.hasOwnProperty(T)&&U!=null&&g&&(g.data.datasets[_][T]=U)}}}),p()}else c.value&&m(),d()}function d(){o.value?(c.value=new Le(o.value,{data:Bi(a.chartData),type:t,options:Bi(a.options),plugins:a.plugins}),h()):console.error(`Error on component ${r}, canvas cannot be rendered. Check if the render appends server-side`)}function f(){A("labels:update"),a.onLabelsUpdate&&a.onLabelsUpdate()}function h(){c.value&&(A("chart:render",c.value),a.onChartRender&&a.onChartRender(c.value))}function p(){c.value&&(c.value.update(),A("chart:update",c.value),a.onChartUpdate&&a.onChartUpdate(c.value))}function m(){c.value&&c.value.destroy(),A("chart:destroy"),a.onChartDestroy&&a.onChartDestroy()}return i.onMounted(d),i.onBeforeUnmount(()=>{c.value&&c.value.destroy()}),s({canvasRef:o,renderChart:d,chartInstance:c,canvasId:l,update:p}),()=>i.h("div",{style:MV(OV({maxWidth:"100%"},a.styles),{position:"relative"}),class:a.cssClasses},[i.h("canvas",{style:{maxWidth:"100%",maxHeight:"100%"},id:l,width:a.width,height:a.height,ref:o})])}})},od=aA("bar-chart","bar"),ld=aA("doughnut-chart","doughnut"),$_=aA("line-chart","line");aA("pie-chart","pie");aA("polar-chart","polarArea");aA("radar-chart","radar");aA("bubble-chart","bubble");aA("scatter-chart","scatter");const vu=i.defineComponent({__name:"InfoDoughnutChart",props:XD,setup(e){const t=e,n=i.ref(null);Le.register(...Cr);const r=i.computed(()=>{const A=t.info==="typeRef"?"types":"rarities",s={},o=St(t.deckCode);for(const c in o){const u=jt().cardJsonObject[c];if(u===void 0)continue;let d=u[t.info];d==="Unit"&&(d=u.supertype==="Champion"?"Champion":"Follower"),s[d]===void 0&&(s[d]=0),s[d]+=o[c]}const l=[];for(const c in s){const u=we().dataJson[A].find(f=>f.nameRef===c),d={key:c,value:s[c],color:u==null?void 0:u.color,name:u==null?void 0:u.name,order:u==null?void 0:u.order};l.push(d)}return console.log(l),l.sort((c,u)=>c.order-u.order),{labels:l.map(c=>c.name),datasets:[{data:l.map(c=>c.value),backgroundColor:l.map(c=>c.color)}]}}),a={cutout:55,layout:{padding:{top:10,bottom:10}},elements:{arc:{borderWidth:0}},plugins:{legend:{display:!0,position:"right",labels:{usePointStyle:!0,generateLabels(A){const s=[],o=A.data.labels;for(let l=0;l<A.data.labels.length;l++)s.push({text:`${o[l]} (${A.data.datasets[0].data[l]})`,borderRadius:999,datasetIndex:0,index:l,fontColor:Ha("--color-0"),fillStyle:A.data.datasets[0].backgroundColor[l]});return s}}},datalabels:{display:!1}}};return(A,s)=>(i.openBlock(),i.createBlock(i.unref(ld),{ref_key:"chart",ref:n,"chart-data":r.value,options:a},null,8,["chart-data"]))}}),PV={deck:{type:Object,required:!1,default:void 0},deckCode:{type:String,required:!1,default:void 0},paddingTop:{type:Number,required:!1,default:10},showDataLabels:{type:Boolean,required:!1,default:!0},dataLabelsOffset:{type:Number,required:!1,default:-10},tooltipsEnabled:{type:Boolean,required:!1,default:!0},displayXScale:{type:Boolean,required:!1,default:!0},animation:{type:Boolean,required:!1}};//! moment.js
828
828
  //! version : 2.29.4
829
829
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
830
830
  //! license : MIT