­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ !function(t,e,r,n,i){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},o="function"==typeof a[n]&&a[n],s=o.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(e,r){if(!s[e]){if(!t[e]){var i="function"==typeof a[n]&&a[n];if(!r&&i)return i(e,!0);if(o)return o(e,!0);if(l&&"string"==typeof e)return l(e);var c=Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}f.resolve=function(r){var n=t[e][1][r];return null!=n?n:r},f.cache={};var h=s[e]=new u.Module(e);t[e][0].call(h.exports,f,h,h.exports,this)}return s[e].exports;function f(t){var e=f.resolve(t);return!1===e?{}:u(e)}}u.isParcelRequire=!0,u.Module=function(t){this.id=t,this.bundle=u,this.exports={}},u.modules=t,u.cache=s,u.parent=o,u.register=function(e,r){t[e]=[function(t,e){e.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return a[n]}}),a[n]=u;for(var c=0;c0}},{key:"bindings",get:function(){return Array.from(this.unorderedBindings).sort(function(t,e){var r=t.index,n=e.index;return rn?1:0})}}]),t}(),y=function(){function t(e){(0,a._)(this,t),this.application=e,this.eventListenerMaps=new Map,this.started=!1}return(0,o._)(t,[{key:"start",value:function(){this.started||(this.started=!0,this.eventListeners.forEach(function(t){return t.connect()}))}},{key:"stop",value:function(){this.started&&(this.started=!1,this.eventListeners.forEach(function(t){return t.disconnect()}))}},{key:"eventListeners",get:function(){return Array.from(this.eventListenerMaps.values()).reduce(function(t,e){return t.concat(Array.from(e.values()))},[])}},{key:"bindingConnected",value:function(t){this.fetchEventListenerForBinding(t).bindingConnected(t)}},{key:"bindingDisconnected",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.fetchEventListenerForBinding(t).bindingDisconnected(t),e&&this.clearEventListenersForBinding(t)}},{key:"handleError",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.application.handleError(t,"Error ".concat(e),r)}},{key:"clearEventListenersForBinding",value:function(t){var e=this.fetchEventListenerForBinding(t);e.hasBindings()||(e.disconnect(),this.removeMappedEventListenerFor(t))}},{key:"removeMappedEventListenerFor",value:function(t){var e=t.eventTarget,r=t.eventName,n=t.eventOptions,i=this.fetchEventListenerMapForEventTarget(e),a=this.cacheKey(r,n);i.delete(a),0==i.size&&this.eventListenerMaps.delete(e)}},{key:"fetchEventListenerForBinding",value:function(t){var e=t.eventTarget,r=t.eventName,n=t.eventOptions;return this.fetchEventListener(e,r,n)}},{key:"fetchEventListener",value:function(t,e,r){var n=this.fetchEventListenerMapForEventTarget(t),i=this.cacheKey(e,r),a=n.get(i);return a||(a=this.createEventListener(t,e,r),n.set(i,a)),a}},{key:"createEventListener",value:function(t,e,r){var n=new g(t,e,r);return this.started&&n.connect(),n}},{key:"fetchEventListenerMapForEventTarget",value:function(t){var e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e}},{key:"cacheKey",value:function(t,e){var r=[t];return Object.keys(e).sort().forEach(function(t){r.push("".concat(e[t]?"":"!").concat(t))}),r.join(":")}}]),t}(),m={stop:function(t){var e=t.event;return t.value&&e.stopPropagation(),!0},prevent:function(t){var e=t.event;return t.value&&e.preventDefault(),!0},self:function(t){var e=t.event,r=t.value,n=t.element;return!r||n===e.target}},b=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function _(t){return t.replace(/(?:[_-])([a-z0-9])/g,function(t,e){return e.toUpperCase()})}function x(t){return _(t.replace(/--/g,"-").replace(/__/g,"_"))}function k(t){return t.charAt(0).toUpperCase()+t.slice(1)}function w(t){return t.replace(/([A-Z])/g,function(t,e){return"-".concat(e.toLowerCase())})}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var S=["meta","ctrl","alt","shift"],O=function(){function t(e,r,n,i){(0,a._)(this,t),this.element=e,this.index=r,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(t){var e=t.tagName.toLowerCase();if(e in A)return A[e](t)}(e)||E("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||E("missing identifier"),this.methodName=n.methodName||E("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=i}return(0,o._)(t,[{key:"toString",value:function(){var t=this.keyFilter?".".concat(this.keyFilter):"",e=this.eventTargetName?"@".concat(this.eventTargetName):"";return"".concat(this.eventName).concat(t).concat(e,"->").concat(this.identifier,"#").concat(this.methodName)}},{key:"shouldIgnoreKeyboardEvent",value:function(t){if(!this.keyFilter)return!1;var e=this.keyFilter.split("+");if(this.keyFilterDissatisfied(t,e))return!0;var r=e.filter(function(t){return!S.includes(t)})[0];return!!r&&(M(this.keyMappings,r)||E("contains unknown key filter: ".concat(this.keyFilter)),this.keyMappings[r].toLowerCase()!==t.key.toLowerCase())}},{key:"shouldIgnoreMouseEvent",value:function(t){if(!this.keyFilter)return!1;var e=[this.keyFilter];return!!this.keyFilterDissatisfied(t,e)}},{key:"params",get:function(){var t={},e=RegExp("^data-".concat(this.identifier,"-(.+)-param$"),"i"),r=!0,n=!1,i=void 0;try{for(var a,o=Array.from(this.element.attributes)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value,l=s.name,u=s.value,c=l.match(e),h=c&&c[1];h&&(t[_(h)]=function(t){try{return JSON.parse(t)}catch(e){return t}}(u))}}catch(t){n=!0,i=t}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return t}},{key:"eventTargetName",get:function(){var t;return(t=this.eventTarget)==window?"window":t==document?"document":void 0}},{key:"keyMappings",get:function(){return this.schema.keyMappings}},{key:"keyFilterDissatisfied",value:function(t,e){var r=(0,h._)(S.map(function(t){return e.includes(t)}),4),n=r[0],i=r[1],a=r[2],o=r[3];return t.metaKey!==n||t.ctrlKey!==i||t.altKey!==a||t.shiftKey!==o}}],[{key:"forToken",value:function(t,e){var r,n,i,a;return new this(t.element,t.index,(n=(r=t.content.trim().match(b)||[])[2],(i=r[3])&&!["keydown","keyup","keypress"].includes(n)&&(n+=".".concat(i),i=""),{eventTarget:"window"==(a=r[4])?window:"document"==a?document:void 0,eventName:n,eventOptions:r[7]?r[7].split(":").reduce(function(t,e){return Object.assign(t,(0,s._)({},e.replace(/^!/,""),!/^!/.test(e)))},{}):{},identifier:r[5],methodName:r[6],keyFilter:r[1]||i}),e)}}]),t}(),A={a:function(){return"click"},button:function(){return"click"},form:function(){return"submit"},details:function(){return"toggle"},input:function(t){return"submit"==t.getAttribute("type")?"click":"input"},select:function(){return"change"},textarea:function(){return"input"}};function E(t){throw Error(t)}var C=function(){function t(e,r){(0,a._)(this,t),this.context=e,this.action=r}return(0,o._)(t,[{key:"index",get:function(){return this.action.index}},{key:"eventTarget",get:function(){return this.action.eventTarget}},{key:"eventOptions",get:function(){return this.action.eventOptions}},{key:"identifier",get:function(){return this.context.identifier}},{key:"handleEvent",value:function(t){var e=this.prepareActionEvent(t);this.willBeInvokedByEvent(t)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}},{key:"eventName",get:function(){return this.action.eventName}},{key:"method",get:function(){var t=this.controller[this.methodName];if("function"==typeof t)return t;throw Error('Action "'.concat(this.action,'" references undefined method "').concat(this.methodName,'"'))}},{key:"applyEventModifiers",value:function(t){var e=this.action.element,r=this.context.application.actionDescriptorFilters,n=this.context.controller,i=!0,a=!0,o=!1,s=void 0;try{for(var l,u=Object.entries(this.eventOptions)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=(0,h._)(l.value,2),f=c[0],d=c[1];if(f in r){var p=r[f];i=i&&p({name:f,value:d,event:t,element:e,controller:n})}}}catch(t){o=!0,s=t}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return i}},{key:"prepareActionEvent",value:function(t){return Object.assign(t,{params:this.action.params})}},{key:"invokeWithEvent",value:function(t){var e=t.target,r=t.currentTarget;try{this.method.call(this.controller,t),this.context.logDebugActivity(this.methodName,{event:t,target:e,currentTarget:r,action:this.methodName})}catch(e){var n=this.identifier,i=this.controller,a=this.element,o=this.index;this.context.handleError(e,'invoking action "'.concat(this.action,'"'),{identifier:n,controller:i,element:a,index:o,event:t})}}},{key:"willBeInvokedByEvent",value:function(t){var e=t.target;return!(t instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(t)||t instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(t))&&(this.element===e||(e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):this.scope.containsElement(this.action.element)))}},{key:"controller",get:function(){return this.context.controller}},{key:"methodName",get:function(){return this.action.methodName}},{key:"element",get:function(){return this.scope.element}},{key:"scope",get:function(){return this.context.scope}}]),t}(),P=function(){function t(e,r){var n=this;(0,a._)(this,t),this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=r,this.elements=new Set,this.mutationObserver=new MutationObserver(function(t){return n.processMutations(t)})}return(0,o._)(t,[{key:"start",value:function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}},{key:"pause",value:function(t){this.started&&(this.mutationObserver.disconnect(),this.started=!1),t(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}},{key:"stop",value:function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}},{key:"refresh",value:function(){if(this.started){var t=new Set(this.matchElementsInTree()),e=!0,r=!1,n=void 0;try{for(var i,a=Array.from(this.elements)[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;t.has(o)||this.removeElement(o)}}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}var s=!0,l=!1,u=void 0;try{for(var c,h=Array.from(t)[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var f=c.value;this.addElement(f)}}catch(t){l=!0,u=t}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}}},{key:"processMutations",value:function(t){var e=!0,r=!1,n=void 0;if(this.started)try{for(var i,a=t[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;this.processMutation(o)}}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"processMutation",value:function(t){"attributes"==t.type?this.processAttributeChange(t.target,t.attributeName):"childList"==t.type&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))}},{key:"processAttributeChange",value:function(t,e){this.elements.has(t)?this.delegate.elementAttributeChanged&&this.matchElement(t)?this.delegate.elementAttributeChanged(t,e):this.removeElement(t):this.matchElement(t)&&this.addElement(t)}},{key:"processRemovedNodes",value:function(t){var e=!0,r=!1,n=void 0;try{for(var i,a=Array.from(t)[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value,s=this.elementFromNode(o);s&&this.processTree(s,this.removeElement)}}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"processAddedNodes",value:function(t){var e=!0,r=!1,n=void 0;try{for(var i,a=Array.from(t)[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value,s=this.elementFromNode(o);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"matchElement",value:function(t){return this.delegate.matchElement(t)}},{key:"matchElementsInTree",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element;return this.delegate.matchElementsInTree(t)}},{key:"processTree",value:function(t,e){var r=!0,n=!1,i=void 0;try{for(var a,o=this.matchElementsInTree(t)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;e.call(this,s)}}catch(t){n=!0,i=t}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"elementFromNode",value:function(t){if(t.nodeType==Node.ELEMENT_NODE)return t}},{key:"elementIsActive",value:function(t){return t.isConnected==this.element.isConnected&&this.element.contains(t)}},{key:"addElement",value:function(t){!this.elements.has(t)&&this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))}},{key:"removeElement",value:function(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))}}]),t}(),D=function(){function t(e,r,n){(0,a._)(this,t),this.attributeName=r,this.delegate=n,this.elementObserver=new P(e,this)}return(0,o._)(t,[{key:"element",get:function(){return this.elementObserver.element}},{key:"selector",get:function(){return"[".concat(this.attributeName,"]")}},{key:"start",value:function(){this.elementObserver.start()}},{key:"pause",value:function(t){this.elementObserver.pause(t)}},{key:"stop",value:function(){this.elementObserver.stop()}},{key:"refresh",value:function(){this.elementObserver.refresh()}},{key:"started",get:function(){return this.elementObserver.started}},{key:"matchElement",value:function(t){return t.hasAttribute(this.attributeName)}},{key:"matchElementsInTree",value:function(t){var e=this.matchElement(t)?[t]:[],r=Array.from(t.querySelectorAll(this.selector));return e.concat(r)}},{key:"elementMatched",value:function(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)}},{key:"elementUnmatched",value:function(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)}},{key:"elementAttributeChanged",value:function(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)}}]),t}();function j(t,e,r){F(t,e).add(r)}function T(t,e,r){F(t,e).delete(r),I(t,e)}function F(t,e){var r=t.get(e);return r||(r=new Set,t.set(e,r)),r}function I(t,e){var r=t.get(e);null!=r&&0==r.size&&t.delete(e)}var L=function(){function t(){(0,a._)(this,t),this.valuesByKey=new Map}return(0,o._)(t,[{key:"keys",get:function(){return Array.from(this.valuesByKey.keys())}},{key:"values",get:function(){return Array.from(this.valuesByKey.values()).reduce(function(t,e){return t.concat(Array.from(e))},[])}},{key:"size",get:function(){return Array.from(this.valuesByKey.values()).reduce(function(t,e){return t+e.size},0)}},{key:"add",value:function(t,e){j(this.valuesByKey,t,e)}},{key:"delete",value:function(t,e){T(this.valuesByKey,t,e)}},{key:"has",value:function(t,e){var r=this.valuesByKey.get(t);return null!=r&&r.has(e)}},{key:"hasKey",value:function(t){return this.valuesByKey.has(t)}},{key:"hasValue",value:function(t){return Array.from(this.valuesByKey.values()).some(function(e){return e.has(t)})}},{key:"getValuesForKey",value:function(t){var e=this.valuesByKey.get(t);return e?Array.from(e):[]}},{key:"getKeysForValue",value:function(t){return Array.from(this.valuesByKey).filter(function(e){var r=(0,h._)(e,2);return(r[0],r[1]).has(t)}).map(function(t){var e=(0,h._)(t,2),r=e[0];return e[1],r})}}]),t}(),R=function(t){(0,c._)(r,t);var e=(0,p._)(r);function r(){var t;return(0,a._)(this,r),(t=e.call(this)).keysByValue=new Map,t}return(0,o._)(r,[{key:"values",get:function(){return Array.from(this.keysByValue.keys())}},{key:"add",value:function(t,e){(0,l._)((0,u._)(r.prototype),"add",this).call(this,t,e),j(this.keysByValue,e,t)}},{key:"delete",value:function(t,e){(0,l._)((0,u._)(r.prototype),"delete",this).call(this,t,e),T(this.keysByValue,e,t)}},{key:"hasValue",value:function(t){return this.keysByValue.has(t)}},{key:"getKeysForValue",value:function(t){var e=this.keysByValue.get(t);return e?Array.from(e):[]}}]),r}(L),B=function(){function t(e,r,n,i){(0,a._)(this,t),this._selector=r,this.details=i,this.elementObserver=new P(e,this),this.delegate=n,this.matchesByElement=new L}return(0,o._)(t,[{key:"started",get:function(){return this.elementObserver.started}},{key:"selector",get:function(){return this._selector},set:function(t){this._selector=t,this.refresh()}},{key:"start",value:function(){this.elementObserver.start()}},{key:"pause",value:function(t){this.elementObserver.pause(t)}},{key:"stop",value:function(){this.elementObserver.stop()}},{key:"refresh",value:function(){this.elementObserver.refresh()}},{key:"element",get:function(){return this.elementObserver.element}},{key:"matchElement",value:function(t){var e=this.selector;if(!e)return!1;var r=t.matches(e);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(t,this.details):r}},{key:"matchElementsInTree",value:function(t){var e=this,r=this.selector;if(!r)return[];var n=this.matchElement(t)?[t]:[],i=Array.from(t.querySelectorAll(r)).filter(function(t){return e.matchElement(t)});return n.concat(i)}},{key:"elementMatched",value:function(t){var e=this.selector;e&&this.selectorMatched(t,e)}},{key:"elementUnmatched",value:function(t){var e=this.matchesByElement.getKeysForValue(t),r=!0,n=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.selectorUnmatched(t,s)}}catch(t){n=!0,i=t}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"elementAttributeChanged",value:function(t,e){var r=this.selector;if(r){var n=this.matchElement(t),i=this.matchesByElement.has(r,t);n&&!i?this.selectorMatched(t,r):!n&&i&&this.selectorUnmatched(t,r)}}},{key:"selectorMatched",value:function(t,e){this.delegate.selectorMatched(t,e,this.details),this.matchesByElement.add(e,t)}},{key:"selectorUnmatched",value:function(t,e){this.delegate.selectorUnmatched(t,e,this.details),this.matchesByElement.delete(e,t)}}]),t}(),N=function(){function t(e,r){var n=this;(0,a._)(this,t),this.element=e,this.delegate=r,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(function(t){return n.processMutations(t)})}return(0,o._)(t,[{key:"start",value:function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}},{key:"stop",value:function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}},{key:"refresh",value:function(){var t=!0,e=!1,r=void 0;if(this.started)try{for(var n,i=this.knownAttributeNames[Symbol.iterator]();!(t=(n=i.next()).done);t=!0){var a=n.value;this.refreshAttribute(a,null)}}catch(t){e=!0,r=t}finally{try{t||null==i.return||i.return()}finally{if(e)throw r}}}},{key:"processMutations",value:function(t){var e=!0,r=!1,n=void 0;if(this.started)try{for(var i,a=t[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var o=i.value;this.processMutation(o)}}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"processMutation",value:function(t){var e=t.attributeName;e&&this.refreshAttribute(e,t.oldValue)}},{key:"refreshAttribute",value:function(t,e){var r=this.delegate.getStringMapKeyForAttribute(t);if(null!=r){this.stringMap.has(t)||this.stringMapKeyAdded(r,t);var n=this.element.getAttribute(t);if(this.stringMap.get(t)!=n&&this.stringMapValueChanged(n,r,e),null==n){var i=this.stringMap.get(t);this.stringMap.delete(t),i&&this.stringMapKeyRemoved(r,t,i)}else this.stringMap.set(t,n)}}},{key:"stringMapKeyAdded",value:function(t,e){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(t,e)}},{key:"stringMapValueChanged",value:function(t,e,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(t,e,r)}},{key:"stringMapKeyRemoved",value:function(t,e,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(t,e,r)}},{key:"knownAttributeNames",get:function(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}},{key:"currentAttributeNames",get:function(){return Array.from(this.element.attributes).map(function(t){return t.name})}},{key:"recordedAttributeNames",get:function(){return Array.from(this.stringMap.keys())}}]),t}(),V=function(){function t(e,r,n){(0,a._)(this,t),this.attributeObserver=new D(e,r,this),this.delegate=n,this.tokensByElement=new L}return(0,o._)(t,[{key:"started",get:function(){return this.attributeObserver.started}},{key:"start",value:function(){this.attributeObserver.start()}},{key:"pause",value:function(t){this.attributeObserver.pause(t)}},{key:"stop",value:function(){this.attributeObserver.stop()}},{key:"refresh",value:function(){this.attributeObserver.refresh()}},{key:"element",get:function(){return this.attributeObserver.element}},{key:"attributeName",get:function(){return this.attributeObserver.attributeName}},{key:"elementMatchedAttribute",value:function(t){this.tokensMatched(this.readTokensForElement(t))}},{key:"elementAttributeValueChanged",value:function(t){var e=(0,h._)(this.refreshTokensForElement(t),2),r=e[0],n=e[1];this.tokensUnmatched(r),this.tokensMatched(n)}},{key:"elementUnmatchedAttribute",value:function(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))}},{key:"tokensMatched",value:function(t){var e=this;t.forEach(function(t){return e.tokenMatched(t)})}},{key:"tokensUnmatched",value:function(t){var e=this;t.forEach(function(t){return e.tokenUnmatched(t)})}},{key:"tokenMatched",value:function(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)}},{key:"tokenUnmatched",value:function(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)}},{key:"refreshTokensForElement",value:function(t){var e=this.tokensByElement.getValuesForKey(t),r=this.readTokensForElement(t),n=Array.from({length:Math.max(e.length,r.length)},function(t,n){return[e[n],r[n]]}).findIndex(function(t){var e,r,n=(0,h._)(t,2);return e=n[0],r=n[1],!e||!r||e.index!=r.index||e.content!=r.content});return -1==n?[[],[]]:[e.slice(n),r.slice(n)]}},{key:"readTokensForElement",value:function(t){var e=this.attributeName;return(t.getAttribute(e)||"").trim().split(/\s+/).filter(function(t){return t.length}).map(function(r,n){return{element:t,attributeName:e,content:r,index:n}})}}]),t}(),z=function(){function t(e,r,n){(0,a._)(this,t),this.tokenListObserver=new V(e,r,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}return(0,o._)(t,[{key:"started",get:function(){return this.tokenListObserver.started}},{key:"start",value:function(){this.tokenListObserver.start()}},{key:"stop",value:function(){this.tokenListObserver.stop()}},{key:"refresh",value:function(){this.tokenListObserver.refresh()}},{key:"element",get:function(){return this.tokenListObserver.element}},{key:"attributeName",get:function(){return this.tokenListObserver.attributeName}},{key:"tokenMatched",value:function(t){var e=t.element,r=this.fetchParseResultForToken(t).value;r&&(this.fetchValuesByTokenForElement(e).set(t,r),this.delegate.elementMatchedValue(e,r))}},{key:"tokenUnmatched",value:function(t){var e=t.element,r=this.fetchParseResultForToken(t).value;r&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,r))}},{key:"fetchParseResultForToken",value:function(t){var e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e}},{key:"fetchValuesByTokenForElement",value:function(t){var e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e}},{key:"parseToken",value:function(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(t){return{error:t}}}}]),t}(),W=function(){function t(e,r){(0,a._)(this,t),this.context=e,this.delegate=r,this.bindingsByAction=new Map}return(0,o._)(t,[{key:"start",value:function(){this.valueListObserver||(this.valueListObserver=new z(this.element,this.actionAttribute,this),this.valueListObserver.start())}},{key:"stop",value:function(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}},{key:"element",get:function(){return this.context.element}},{key:"identifier",get:function(){return this.context.identifier}},{key:"actionAttribute",get:function(){return this.schema.actionAttribute}},{key:"schema",get:function(){return this.context.schema}},{key:"bindings",get:function(){return Array.from(this.bindingsByAction.values())}},{key:"connectAction",value:function(t){var e=new C(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)}},{key:"disconnectAction",value:function(t){var e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))}},{key:"disconnectAllActions",value:function(){var t=this;this.bindings.forEach(function(e){return t.delegate.bindingDisconnected(e,!0)}),this.bindingsByAction.clear()}},{key:"parseValueForToken",value:function(t){var e=O.forToken(t,this.schema);if(e.identifier==this.identifier)return e}},{key:"elementMatchedValue",value:function(t,e){this.connectAction(e)}},{key:"elementUnmatchedValue",value:function(t,e){this.disconnectAction(e)}}]),t}(),H=function(){function t(e,r){(0,a._)(this,t),this.context=e,this.receiver=r,this.stringMapObserver=new N(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}return(0,o._)(t,[{key:"start",value:function(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}},{key:"stop",value:function(){this.stringMapObserver.stop()}},{key:"element",get:function(){return this.context.element}},{key:"controller",get:function(){return this.context.controller}},{key:"getStringMapKeyForAttribute",value:function(t){if(t in this.valueDescriptorMap)return this.valueDescriptorMap[t].name}},{key:"stringMapKeyAdded",value:function(t,e){var r=this.valueDescriptorMap[e];this.hasValue(t)||this.invokeChangedCallback(t,r.writer(this.receiver[t]),r.writer(r.defaultValue))}},{key:"stringMapValueChanged",value:function(t,e,r){var n=this.valueDescriptorNameMap[e];null!==t&&(null===r&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(e,t,r))}},{key:"stringMapKeyRemoved",value:function(t,e,r){var n=this.valueDescriptorNameMap[t];this.hasValue(t)?this.invokeChangedCallback(t,n.writer(this.receiver[t]),r):this.invokeChangedCallback(t,n.writer(n.defaultValue),r)}},{key:"invokeChangedCallbacksForDefaultValues",value:function(){var t=!0,e=!1,r=void 0;try{for(var n,i=this.valueDescriptors[Symbol.iterator]();!(t=(n=i.next()).done);t=!0){var a=n.value,o=a.key,s=a.name,l=a.defaultValue,u=a.writer;void 0==l||this.controller.data.has(o)||this.invokeChangedCallback(s,u(l),void 0)}}catch(t){e=!0,r=t}finally{try{t||null==i.return||i.return()}finally{if(e)throw r}}}},{key:"invokeChangedCallback",value:function(t,e,r){var n=this.receiver["".concat(t,"Changed")];if("function"==typeof n){var i=this.valueDescriptorNameMap[t];try{var a=i.reader(e),o=r;r&&(o=i.reader(r)),n.call(this.receiver,a,o)}catch(t){throw t instanceof TypeError&&(t.message='Stimulus Value "'.concat(this.context.identifier,".").concat(i.name,'" - ').concat(t.message)),t}}}},{key:"valueDescriptors",get:function(){var t=this.valueDescriptorMap;return Object.keys(t).map(function(e){return t[e]})}},{key:"valueDescriptorNameMap",get:function(){var t=this,e={};return Object.keys(this.valueDescriptorMap).forEach(function(r){var n=t.valueDescriptorMap[r];e[n.name]=n}),e}},{key:"hasValue",value:function(t){var e=this.valueDescriptorNameMap[t],r="has".concat(k(e.name));return this.receiver[r]}}]),t}(),U=function(){function t(e,r){(0,a._)(this,t),this.context=e,this.delegate=r,this.targetsByName=new L}return(0,o._)(t,[{key:"start",value:function(){this.tokenListObserver||(this.tokenListObserver=new V(this.element,this.attributeName,this),this.tokenListObserver.start())}},{key:"stop",value:function(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}},{key:"tokenMatched",value:function(t){var e=t.element,r=t.content;this.scope.containsElement(e)&&this.connectTarget(e,r)}},{key:"tokenUnmatched",value:function(t){var e=t.element,r=t.content;this.disconnectTarget(e,r)}},{key:"connectTarget",value:function(t,e){var r,n=this;this.targetsByName.has(e,t)||(this.targetsByName.add(e,t),null===(r=this.tokenListObserver)||void 0===r||r.pause(function(){return n.delegate.targetConnected(t,e)}))}},{key:"disconnectTarget",value:function(t,e){var r,n=this;this.targetsByName.has(e,t)&&(this.targetsByName.delete(e,t),null===(r=this.tokenListObserver)||void 0===r||r.pause(function(){return n.delegate.targetDisconnected(t,e)}))}},{key:"disconnectAllTargets",value:function(){var t=!0,e=!1,r=void 0,n=!0,i=!1,a=void 0;try{for(var o,s=this.targetsByName.keys[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;try{for(var u,c=this.targetsByName.getValuesForKey(l)[Symbol.iterator]();!(t=(u=c.next()).done);t=!0){var h=u.value;this.disconnectTarget(h,l)}}catch(t){e=!0,r=t}finally{try{t||null==c.return||c.return()}finally{if(e)throw r}}}}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"attributeName",get:function(){return"data-".concat(this.context.identifier,"-target")}},{key:"element",get:function(){return this.context.element}},{key:"scope",get:function(){return this.context.scope}}]),t}();function K(t,e){return Array.from(Y(t).reduce(function(t,r){var n;return(Array.isArray(n=r[e])?n:[]).forEach(function(e){return t.add(e)}),t},new Set))}function Y(t){for(var e=[];t;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}var X=function(){function t(e,r){(0,a._)(this,t),this.started=!1,this.context=e,this.delegate=r,this.outletsByName=new L,this.outletElementsByName=new L,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}return(0,o._)(t,[{key:"start",value:function(){var t=this;this.started||(this.outletDefinitions.forEach(function(e){t.setupSelectorObserverForOutlet(e),t.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(function(t){return t.refresh()}))}},{key:"refresh",value:function(){this.selectorObserverMap.forEach(function(t){return t.refresh()}),this.attributeObserverMap.forEach(function(t){return t.refresh()})}},{key:"stop",value:function(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}},{key:"stopSelectorObservers",value:function(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(function(t){return t.stop()}),this.selectorObserverMap.clear())}},{key:"stopAttributeObservers",value:function(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(function(t){return t.stop()}),this.attributeObserverMap.clear())}},{key:"selectorMatched",value:function(t,e,r){var n=r.outletName,i=this.getOutlet(t,n);i&&this.connectOutlet(i,t,n)}},{key:"selectorUnmatched",value:function(t,e,r){var n=r.outletName,i=this.getOutletFromMap(t,n);i&&this.disconnectOutlet(i,t,n)}},{key:"selectorMatchElement",value:function(t,e){var r=e.outletName,n=this.selector(r),i=this.hasOutlet(t,r),a=t.matches("[".concat(this.schema.controllerAttribute,"~=").concat(r,"]"));return!!n&&i&&a&&t.matches(n)}},{key:"elementMatchedAttribute",value:function(t,e){var r=this.getOutletNameFromOutletAttributeName(e);r&&this.updateSelectorObserverForOutlet(r)}},{key:"elementAttributeValueChanged",value:function(t,e){var r=this.getOutletNameFromOutletAttributeName(e);r&&this.updateSelectorObserverForOutlet(r)}},{key:"elementUnmatchedAttribute",value:function(t,e){var r=this.getOutletNameFromOutletAttributeName(e);r&&this.updateSelectorObserverForOutlet(r)}},{key:"connectOutlet",value:function(t,e,r){var n,i=this;this.outletElementsByName.has(r,e)||(this.outletsByName.add(r,t),this.outletElementsByName.add(r,e),null===(n=this.selectorObserverMap.get(r))||void 0===n||n.pause(function(){return i.delegate.outletConnected(t,e,r)}))}},{key:"disconnectOutlet",value:function(t,e,r){var n,i=this;this.outletElementsByName.has(r,e)&&(this.outletsByName.delete(r,t),this.outletElementsByName.delete(r,e),null===(n=this.selectorObserverMap.get(r))||void 0===n||n.pause(function(){return i.delegate.outletDisconnected(t,e,r)}))}},{key:"disconnectAllOutlets",value:function(){var t=!0,e=!1,r=void 0;try{for(var n,i=this.outletElementsByName.keys[Symbol.iterator]();!(t=(n=i.next()).done);t=!0){var a=n.value,o=!0,s=!1,l=void 0,u=!0,c=!1,h=void 0;try{for(var f,d=this.outletElementsByName.getValuesForKey(a)[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var p=f.value;try{for(var v,g=this.outletsByName.getValuesForKey(a)[Symbol.iterator]();!(o=(v=g.next()).done);o=!0){var y=v.value;this.disconnectOutlet(y,p,a)}}catch(t){s=!0,l=t}finally{try{o||null==g.return||g.return()}finally{if(s)throw l}}}}catch(t){c=!0,h=t}finally{try{u||null==d.return||d.return()}finally{if(c)throw h}}}}catch(t){e=!0,r=t}finally{try{t||null==i.return||i.return()}finally{if(e)throw r}}}},{key:"updateSelectorObserverForOutlet",value:function(t){var e=this.selectorObserverMap.get(t);e&&(e.selector=this.selector(t))}},{key:"setupSelectorObserverForOutlet",value:function(t){var e=this.selector(t),r=new B(document.body,e,this,{outletName:t});this.selectorObserverMap.set(t,r),r.start()}},{key:"setupAttributeObserverForOutlet",value:function(t){var e=this.attributeNameForOutletName(t),r=new D(this.scope.element,e,this);this.attributeObserverMap.set(t,r),r.start()}},{key:"selector",value:function(t){return this.scope.outlets.getSelectorForOutletName(t)}},{key:"attributeNameForOutletName",value:function(t){return this.scope.schema.outletAttributeForScope(this.identifier,t)}},{key:"getOutletNameFromOutletAttributeName",value:function(t){var e=this;return this.outletDefinitions.find(function(r){return e.attributeNameForOutletName(r)===t})}},{key:"outletDependencies",get:function(){var t=new L;return this.router.modules.forEach(function(e){K(e.definition.controllerConstructor,"outlets").forEach(function(r){return t.add(r,e.identifier)})}),t}},{key:"outletDefinitions",get:function(){return this.outletDependencies.getKeysForValue(this.identifier)}},{key:"dependentControllerIdentifiers",get:function(){return this.outletDependencies.getValuesForKey(this.identifier)}},{key:"dependentContexts",get:function(){var t=this.dependentControllerIdentifiers;return this.router.contexts.filter(function(e){return t.includes(e.identifier)})}},{key:"hasOutlet",value:function(t,e){return!!this.getOutlet(t,e)||!!this.getOutletFromMap(t,e)}},{key:"getOutlet",value:function(t,e){return this.application.getControllerForElementAndIdentifier(t,e)}},{key:"getOutletFromMap",value:function(t,e){return this.outletsByName.getValuesForKey(e).find(function(e){return e.element===t})}},{key:"scope",get:function(){return this.context.scope}},{key:"schema",get:function(){return this.context.schema}},{key:"identifier",get:function(){return this.context.identifier}},{key:"application",get:function(){return this.context.application}},{key:"router",get:function(){return this.application.router}}]),t}(),q=function(){function t(e,r){var n=this;(0,a._)(this,t),this.logDebugActivity=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object.assign({identifier:n.identifier,controller:n.controller,element:n.element},e),n.application.logDebugActivity(n.identifier,t,e)},this.module=e,this.scope=r,this.controller=new e.controllerConstructor(this),this.bindingObserver=new W(this,this.dispatcher),this.valueObserver=new H(this,this.controller),this.targetObserver=new U(this,this),this.outletObserver=new X(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(t){this.handleError(t,"initializing controller")}}return(0,o._)(t,[{key:"connect",value:function(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(t){this.handleError(t,"connecting controller")}}},{key:"refresh",value:function(){this.outletObserver.refresh()}},{key:"disconnect",value:function(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(t){this.handleError(t,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}},{key:"application",get:function(){return this.module.application}},{key:"identifier",get:function(){return this.module.identifier}},{key:"schema",get:function(){return this.application.schema}},{key:"dispatcher",get:function(){return this.application.dispatcher}},{key:"element",get:function(){return this.scope.element}},{key:"parentElement",get:function(){return this.element.parentElement}},{key:"handleError",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r=Object.assign({identifier:this.identifier,controller:this.controller,element:this.element},r),this.application.handleError(t,"Error ".concat(e),r)}},{key:"targetConnected",value:function(t,e){this.invokeControllerMethod("".concat(e,"TargetConnected"),t)}},{key:"targetDisconnected",value:function(t,e){this.invokeControllerMethod("".concat(e,"TargetDisconnected"),t)}},{key:"outletConnected",value:function(t,e,r){this.invokeControllerMethod("".concat(x(r),"OutletConnected"),t,e)}},{key:"outletDisconnected",value:function(t,e,r){this.invokeControllerMethod("".concat(x(r),"OutletDisconnected"),t,e)}},{key:"invokeControllerMethod",value:function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:document.documentElement,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ts,n=this;(0,a._)(this,t),this.logger=console,this.debug=!1,this.logDebugActivity=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.debug&&n.logFormattedMessage(t,e,r)},this.element=e,this.schema=r,this.dispatcher=new y(this),this.router=new to(this),this.actionDescriptorFilters=Object.assign({},m)}return(0,o._)(t,[{key:"start",value:function(){var t=this;return(0,i._)(function(){return(0,v._)(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",function(){return t()}):t()})];case 1:return e.sent(),t.logDebugActivity("application","starting"),t.dispatcher.start(),t.router.start(),t.logDebugActivity("application","start"),[2]}})})()}},{key:"stop",value:function(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}},{key:"register",value:function(t,e){this.load({identifier:t,controllerConstructor:e})}},{key:"registerActionOption",value:function(t,e){this.actionDescriptorFilters[t]=e}},{key:"load",value:function(t){for(var e=this,r=arguments.length,n=Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{};r=Object.assign({application:this},r),this.logger.groupCollapsed("".concat(t," #").concat(e)),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}}],[{key:"start",value:function(t,e){var r=new this(t,e);return r.start(),r}}]),t}();function tc(t,e,r){return t.application.getControllerForElementAndIdentifier(e,r)}function th(t,e,r){var n=tc(t,e,r);return n||((t.application.router.proposeToConnectScopeForElementAndIdentifier(e,r),n=tc(t,e,r))?n:void 0)}function tf(t,e){var r,n,i,a,o,s=(0,h._)(t,2);return n=(r={controller:e,token:s[0],typeDefinition:s[1]}).token,i=r.typeDefinition,a="".concat(w(n),"-value"),{type:o=function(t){var e=t.controller,r=t.token,n=t.typeDefinition,i=function(t){var e=t.controller,r=t.token,n=t.typeObject,i=null!=n.type,a=null!=n.default,o=td(n.type),s=tp(t.typeObject.default);if(i&&!a)return o;if(!i&&a)return s;if(o!==s){var l=e?"".concat(e,".").concat(r):r;throw Error('The specified default value for the Stimulus Value "'.concat(l,'" must match the defined type "').concat(o,'". The provided default value of "').concat(n.default,'" is of type "').concat(s,'".'))}if(i&&a)return o}({controller:e,token:r,typeObject:n}),a=tp(n),o=td(n),s=i||a||o;if(s)return s;var l=e?"".concat(e,".").concat(n):r;throw Error('Unknown value type "'.concat(l,'" for "').concat(r,'" value'))}(r),key:a,name:_(a),get defaultValue(){return function(t){var e=td(t);if(e)return tv[e];var r=M(t,"default"),n=M(t,"type");if(r)return t.default;if(n){var i=td(t.type);if(i)return tv[i]}return t}(i)},get hasCustomDefaultValue(){return void 0!==tp(i)},reader:tg[o],writer:ty[o]||ty.default}}function td(t){switch(t){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function tp(t){switch(void 0===t?"undefined":(0,d._)(t)){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(t)?"array":"[object Object]"===Object.prototype.toString.call(t)?"object":void 0}var tv={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},tg={array:function(t){var e=JSON.parse(t);if(!Array.isArray(e))throw TypeError('expected value of type "array" but instead got value "'.concat(t,'" of type "').concat(tp(e),'"'));return e},boolean:function(t){return!("0"==t||"false"==String(t).toLowerCase())},number:function(t){return Number(t.replace(/_/g,""))},object:function(t){var e=JSON.parse(t);if(null===e||"object"!=typeof e||Array.isArray(e))throw TypeError('expected value of type "object" but instead got value "'.concat(t,'" of type "').concat(tp(e),'"'));return e},string:function(t){return t}},ty={default:function(t){return"".concat(t)},array:tm,object:tm};function tm(t){return JSON.stringify(t)}var tb=function(){function t(e){(0,a._)(this,t),this.context=e}return(0,o._)(t,[{key:"application",get:function(){return this.context.application}},{key:"scope",get:function(){return this.context.scope}},{key:"element",get:function(){return this.scope.element}},{key:"identifier",get:function(){return this.scope.identifier}},{key:"targets",get:function(){return this.scope.targets}},{key:"outlets",get:function(){return this.scope.outlets}},{key:"classes",get:function(){return this.scope.classes}},{key:"data",get:function(){return this.scope.data}},{key:"initialize",value:function(){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.target,n=void 0===r?this.element:r,i=e.detail,a=e.prefix,o=void 0===a?this.identifier:a,s=e.bubbles,l=e.cancelable,u=new CustomEvent(o?"".concat(o,":").concat(t):t,{detail:void 0===i?{}:i,bubbles:void 0===s||s,cancelable:void 0===l||l});return n.dispatchEvent(u),u}}],[{key:"shouldLoad",get:function(){return!0}},{key:"afterLoad",value:function(t,e){}}]),t}();tb.blessings=[function(t){return K(t,"classes").reduce(function(t,e){var r;return Object.assign(t,(r={},(0,s._)(r,"".concat(e,"Class"),{get:function(){var t=this.classes;if(t.has(e))return t.get(e);var r=t.getAttributeName(e);throw Error('Missing attribute "'.concat(r,'"'))}}),(0,s._)(r,"".concat(e,"Classes"),{get:function(){return this.classes.getAll(e)}}),(0,s._)(r,"has".concat(k(e),"Class"),{get:function(){return this.classes.has(e)}}),r))},{})},function(t){return K(t,"targets").reduce(function(t,e){var r;return Object.assign(t,(r={},(0,s._)(r,"".concat(e,"Target"),{get:function(){var t=this.targets.find(e);if(t)return t;throw Error('Missing target element "'.concat(e,'" for "').concat(this.identifier,'" controller'))}}),(0,s._)(r,"".concat(e,"Targets"),{get:function(){return this.targets.findAll(e)}}),(0,s._)(r,"has".concat(k(e),"Target"),{get:function(){return this.targets.has(e)}}),r))},{})},function(t){var e,r=(e="values",Y(t).reduce(function(t,r){var n;return t.push.apply(t,(0,f._)((n=r[e])?Object.keys(n).map(function(t){return[t,n[t]]}):[])),t},[]));return r.reduce(function(t,e){var r,n,i,a,o,l;return Object.assign(t,(i=(n=tf(e,void 0)).key,a=n.name,o=n.reader,l=n.writer,r={},(0,s._)(r,a,{get:function(){var t=this.data.get(i);return null!==t?o(t):n.defaultValue},set:function(t){void 0===t?this.data.delete(i):this.data.set(i,l(t))}}),(0,s._)(r,"has".concat(k(a)),{get:function(){return this.data.has(i)||n.hasCustomDefaultValue}}),r))},{valueDescriptorMap:{get:function(){var t=this;return r.reduce(function(e,r){var n=tf(r,t.identifier),i=t.data.getAttributeNameForKey(n.key);return Object.assign(e,(0,s._)({},i,n))},{})}}})},function(t){return K(t,"outlets").reduce(function(t,e){var r,n;return Object.assign(t,(n=x(e),r={},(0,s._)(r,"".concat(n,"Outlet"),{get:function(){var t=this.outlets.find(e),r=this.outlets.getSelectorForOutletName(e);if(t){var n=th(this,t,e);if(n)return n;throw Error('The provided outlet element is missing an outlet controller "'.concat(e,'" instance for host controller "').concat(this.identifier,'"'))}throw Error('Missing outlet element "'.concat(e,'" for host controller "').concat(this.identifier,'". Stimulus couldn\'t find a matching outlet element using selector "').concat(r,'".'))}}),(0,s._)(r,"".concat(n,"Outlets"),{get:function(){var t=this,r=this.outlets.findAll(e);return r.length>0?r.map(function(r){var n=th(t,r,e);if(n)return n;console.warn('The provided outlet element is missing an outlet controller "'.concat(e,'" instance for host controller "').concat(t.identifier,'"'),r)}).filter(function(t){return t}):[]}}),(0,s._)(r,"".concat(n,"OutletElement"),{get:function(){var t=this.outlets.find(e),r=this.outlets.getSelectorForOutletName(e);if(t)return t;throw Error('Missing outlet element "'.concat(e,'" for host controller "').concat(this.identifier,'". Stimulus couldn\'t find a matching outlet element using selector "').concat(r,'".'))}}),(0,s._)(r,"".concat(n,"OutletElements"),{get:function(){return this.outlets.findAll(e)}}),(0,s._)(r,"has".concat(k(n),"Outlet"),{get:function(){return this.outlets.has(e)}}),r))},{})}],tb.targets=[],tb.outlets=[],tb.values={}},{"@swc/helpers/_/_async_to_generator":"6Tpxj","@swc/helpers/_/_class_call_check":"2HOGN","@swc/helpers/_/_create_class":"8oe8p","@swc/helpers/_/_define_property":"27c3O","@swc/helpers/_/_get":"6FgjI","@swc/helpers/_/_get_prototype_of":"4Pl3E","@swc/helpers/_/_inherits":"7gHjg","@swc/helpers/_/_sliced_to_array":"hefcy","@swc/helpers/_/_to_consumable_array":"4oNkS","@swc/helpers/_/_type_of":"2bRX5","@swc/helpers/_/_create_super":"a37Ru","@swc/helpers/_/_ts_generator":"lwj56","@parcel/transformer-js/src/esmodule-helpers.js":"kPSB8"}],"6Tpxj":[function(t,e,r){var n=t("@parcel/transformer-js/src/esmodule-helpers.js");function i(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){r(t);return}s.done?e(l):Promise.resolve(l).then(n,i)}function a(t){return function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function s(t){i(o,n,a,s,l,"next",t)}function l(t){i(o,n,a,s,l,"throw",t)}s(void 0)})}}n.defineInteropFlag(r),n.export(r,"_async_to_generator",function(){return a}),n.export(r,"_",function(){return a})},{"@parcel/transformer-js/src/esmodule-helpers.js":"kPSB8"}],kPSB8:[function(t,e,r){r.interopDefault=function(t){return t&&t.__esModule?t:{default:t}},r.defineInteropFlag=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.exportAll=function(t,e){return Object.keys(t).forEach(function(r){"default"===r||"__esModule"===r||Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})}),e},r.export=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,get:r})}},{}],"2HOGN":[function(t,e,r){var n=t("@parcel/transformer-js/src/esmodule-helpers.js");function i(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}n.defineInteropFlag(r),n.export(r,"_class_call_check",function(){return i}),n.export(r,"_",function(){return i})},{"@parcel/transformer-js/src/esmodule-helpers.js":"kPSB8"}],"8oe8p":[function(t,e,r){var n=t("@parcel/transformer-js/src/esmodule-helpers.js");function i(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);re.indexOf(n)&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);ie.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function u(t,e,r,n){var i,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,r,o):i(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o}function c(t,e){return function(r,n){e(r,n,t)}}function h(t,e,r,n,i,a){function o(t){if(void 0!==t&&"function"!=typeof t)throw TypeError("Function expected");return t}for(var s,l=n.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!e&&t?n.static?t:t.prototype:null,h=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]="access"===v?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(t){if(f)throw TypeError("Cannot add initializers after decoration has completed");a.push(o(t||null))};var g=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[u],p);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw TypeError("Object expected");(s=o(g.get))&&(h.get=s),(s=o(g.set))&&(h.set=s),(s=o(g.init))&&i.unshift(s)}else(s=o(g))&&("field"===l?i.unshift(s):h[u]=s)}c&&Object.defineProperty(c,n.name,h),f=!0}function f(t,e,r){for(var n=arguments.length>2,i=0;i0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function k(){for(var t=[],e=0;e1||s(t,e)})})}function s(t,e){try{var r;(r=i[t](e)).value instanceof S?Promise.resolve(r.value.v).then(l,u):c(a[0][2],r)}catch(t){c(a[0][3],t)}}function l(t){s("next",t)}function u(t){s("throw",t)}function c(t,e){t(e),a.shift(),a.length&&s(a[0][0],a[0][1])}}function A(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,i){e[n]=t[n]?function(e){return(r=!r)?{value:S(t[n](e)),done:!1}:i?i(e):e}:i}}function E(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=_(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,i){!function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)}(n,i,(e=t[r](e)).done,e.value)})}}}function C(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var P=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function D(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&m(e,t,r);return P(e,t),e}function j(t){return t&&t.__esModule?t:{default:t}}function T(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function F(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r}function I(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function L(t,e,r){if(null!=e){var n;if("object"!=typeof e&&"function"!=typeof e)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if("function"!=typeof n)throw TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var R="function"==typeof SuppressedError?SuppressedError:function(t,e,r){var n=Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function B(t){function e(e){t.error=t.hasError?new R(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}return function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(t){return e(t),r()})}catch(t){e(t)}}if(t.hasError)throw t.error}()}r.default={__extends:o,__assign:s,__rest:l,__decorate:u,__param:c,__metadata:v,__awaiter:g,__generator:y,__createBinding:m,__exportStar:b,__values:_,__read:x,__spread:k,__spreadArrays:w,__spreadArray:M,__await:S,__asyncGenerator:O,__asyncDelegator:A,__asyncValues:E,__makeTemplateObject:C,__importStar:D,__importDefault:j,__classPrivateFieldGet:T,__classPrivateFieldSet:F,__classPrivateFieldIn:I,__addDisposableResource:L,__disposeResources:B}},{"@swc/helpers/_/_type_of":"2bRX5","@parcel/transformer-js/src/esmodule-helpers.js":"kPSB8"}],"78XDv":[function(t,e,r){var n,i=t("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(r),i.export(r,"default",function(){return b});var a=t("@swc/helpers/_/_assert_this_initialized"),o=t("@swc/helpers/_/_class_call_check"),s=t("@swc/helpers/_/_create_class"),l=t("@swc/helpers/_/_define_property"),u=t("@swc/helpers/_/_inherits"),c=t("@swc/helpers/_/_to_consumable_array"),h=t("@swc/helpers/_/_create_super"),f=t("@hotwired/stimulus"),d=t("../chart_plugins/corsair_plugin"),p=i.interopDefault(d),v=t("chart.js"),g=t("color"),y=i.interopDefault(g),m=t("../utils/appearance");(n=v.Chart).register.apply(n,(0,c._)(v.registerables));var b=function(t){(0,u._)(r,t);var e=(0,h._)(r);function r(){var t;return(0,o._)(this,r),t=e.apply(this,arguments),(0,l._)((0,a._)(t),"metricGroups",[{metrics:["views","visitors","sessions"],format:"int"},{metrics:["clicks"],format:"int"},{metrics:["average_session_duration"],format:"time"},{metrics:["bounce_rate"],format:"percent"},{metrics:["views_per_session"],format:"float"},{metrics:["wc_orders","wc_refunds"],format:"int"},{metrics:["wc_gross_sales","wc_refunded_amount","wc_net_sales"],format:"whole_currency"},{metrics:["wc_conversion_rate"],format:"percent"},{metrics:["wc_earnings_per_visitor"],format:"currency"},{metrics:["wc_average_order_volume"],format:"whole_currency"},{metrics:["form_submissions"],prefix_to_include:"form_submissions_for_",format:"int"},{metrics:["form_conversion_rate"],prefix_to_include:"form_conversion_rate_for_",format:"percent"}]),(0,l._)((0,a._)(t),"tooltipLabel",function(e){return"function"==typeof e.dataset.tooltipLabel?e.dataset.tooltipLabel(e):e.dataset.label+": "+t.formatValueForMetric(e.dataset.id,e.raw)}),t}return(0,s._)(r,[{key:"connect",value:function(){this.isPreviewValue||(this.updateMetricSelectWidth(this.primaryMetricSelectTarget),1===this.hasMultipleDatasetsValue&&this.updateMetricSelectWidth(this.secondaryMetricSelectTarget)),this.createChart(),this.updateChart()}},{key:"disconnect",value:function(){this.chart&&(this.chart.destroy(),this.chart=null)}},{key:"getLocale",value:function(){try{return new Intl.NumberFormat(this.localeValue),this.localeValue}catch(t){return"en-US"}}},{key:"hasSecondaryMetric",value:function(){return this.hasSecondaryChartMetricIdValue&&this.secondaryChartMetricIdValue&&"no_comparison"!==this.secondaryChartMetricIdValue}},{key:"tooltipTitle",value:function(t){return JSON.parse(t[0].label).tooltipLabel}},{key:"getGroupByMetricId",value:function(t){return this.metricGroups.find(function(e){return e.metrics.includes(t)||e.prefix_to_include&&t.startsWith(e.prefix_to_include)})}},{key:"formatValueForMetric",value:function(t,e){switch(this.getGroupByMetricId(t).format){case"whole_currency":return new Intl.NumberFormat(this.localeValue,{style:"currency",currency:this.currencyValue,currencyDisplay:"narrowSymbol",minimumFractionDigits:0,maximumFractionDigits:0}).format(e/100);case"currency":return new Intl.NumberFormat(this.localeValue,{style:"currency",currency:this.currencyValue,currencyDisplay:"narrowSymbol",minimumFractionDigits:2,maximumFractionDigits:2}).format(e/100);case"percent":return new Intl.NumberFormat(this.localeValue,{style:"percent",maximumFractionDigits:2}).format(e/100);case"time":var r=Math.floor(e/60),n=e%60;return r.toString().padStart(2,"0")+":"+n.toString().padStart(2,"0");case"int":return new Intl.NumberFormat(this.localeValue,{maximumFractionDigits:0}).format(e);case"float":return new Intl.NumberFormat(this.localeValue,{maximumFractionDigits:2}).format(e);default:return e}}},{key:"tickText",value:function(t){return JSON.parse(this.getLabelForValue(t)).tick}},{key:"updateMetricSelectWidth",value:function(t){var e=this,r=t.options[t.selectedIndex];new IntersectionObserver(function(n,i){n.forEach(function(n){n.isIntersecting&&(e.adaptiveWidthSelectTarget[0].innerHTML=r.innerText,t.style.width=e.adaptiveWidthSelectTarget.getBoundingClientRect().width+"px",i.disconnect())})}).observe(this.adaptiveWidthSelectTarget),t.parentElement.classList.add("visible")}},{key:"hasSharedAxis",value:function(t,e){var r=this.getGroupByMetricId(t),n=this.getGroupByMetricId(e);return JSON.stringify(r)===JSON.stringify(n)}},{key:"changePrimaryMetric",value:function(t){var e=t.target;this.primaryChartMetricIdValue=e.value,this.primaryChartMetricNameValue=e.options[e.selectedIndex].innerText,this.updateMetricSelectWidth(e),this.updateChart(),Array.from(this.secondaryMetricSelectTarget.querySelectorAll("option")).forEach(function(t){t.toggleAttribute("disabled",t.value===e.value)}),document.dispatchEvent(new CustomEvent("iawp:changePrimaryChartMetric",{detail:{primaryChartMetricId:e.value}}))}},{key:"changeSecondaryMetric",value:function(t){var e=t.target,r=""!==e.value;r?(this.secondaryChartMetricIdValue=e.value,this.secondaryChartMetricNameValue=e.options[e.selectedIndex].innerText):(this.secondaryChartMetricIdValue="",this.secondaryChartMetricNameValue=""),this.updateMetricSelectWidth(e),this.updateChart(),Array.from(this.primaryMetricSelectTarget.querySelectorAll("option")).forEach(function(t){t.toggleAttribute("disabled",t.value===e.value)}),document.dispatchEvent(new CustomEvent("iawp:changeSecondaryChartMetric",{detail:{secondaryChartMetricId:r?e.value:null}}))}},{key:"updateChart",value:function(){var t=this.chart.data.datasets[0];t.id=this.primaryChartMetricIdValue,t.data=this.dataValue[this.primaryChartMetricIdValue],t.label=this.primaryChartMetricNameValue;var e=t.data.every(function(t){return 0===t});if(this.chart.options.scales.y.suggestedMax=e?10:null,this.chart.options.scales.y.beginAtZero="bounce_rate"!==t.id,this.chart.data.datasets.length>1&&this.chart.data.datasets.pop(),this.hasSecondaryMetric()){var r=this.secondaryChartMetricIdValue,n=this.secondaryChartMetricNameValue,i=this.dataValue[r],a=this.hasSharedAxis(this.primaryChartMetricIdValue,r)?"y":"defaultRight";this.chart.data.datasets.push(this.makeDataset(r,n,i,a,"rgba(246,157,10)"));var o=i.every(function(t){return 0===t});this.chart.options.scales.defaultRight.suggestedMax=o?10:null,this.chart.options.scales.defaultRight.beginAtZero="bounce_rate"!==r}this.chart.update()}},{key:"makeDataset",value:function(t,e,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=(0,y.default)(i);return{id:t,label:e,data:r,borderColor:o.string(),backgroundColor:o.alpha(.1).string(),pointBackgroundColor:o.string(),tension:.4,yAxisID:n,fill:!0,order:a?1:0}}},{key:"shouldUseDarkMode",value:function(){return(0,m.isDarkMode)()&&!this.disableDarkModeValue}},{key:"createChart",value:function(){var t=this;v.Chart.defaults.font.family='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';var e={type:"line",data:{labels:this.labelsValue,datasets:[this.makeDataset(this.primaryChartMetricIdValue,this.primaryChartMetricNameValue,this.dataValue[this.primaryChartMetricIdValue],"y","rgba(108,70,174)",!0)].filter(function(t){return null!==t})},options:{locale:this.getLocale(),maintainAspectRatio:!this.isPreviewValue,aspectRatio:3,onResize:function(t,e){e.width,document.documentElement.clientWidth<=782&&3===t.options.aspectRatio?(t.options.aspectRatio=1.5,t.update()):document.documentElement.clientWidth>782&&1.5===t.options.aspectRatio&&(t.options.aspectRatio=3,t.update())},interaction:{intersect:!1,mode:"index"},scales:{y:{grid:{color:this.shouldUseDarkMode()?"#676173":"#DEDAE6",borderColor:"#DEDAE6",tickColor:"#DEDAE6",display:!0,drawOnChartArea:!0,borderDash:[2,4]},beginAtZero:!0,suggestedMax:null,ticks:{color:this.shouldUseDarkMode()?"#ffffff":"#6D6A73",font:{size:14,weight:400},precision:0,callback:function(e,r,n){return t.formatValueForMetric(t.primaryChartMetricIdValue,e)}}},defaultRight:{position:"right",display:"auto",grid:{color:this.shouldUseDarkMode()?"#9a95a6":"#DEDAE6",borderColor:"#DEDAE6",tickColor:"#DEDAE6",display:!0,drawOnChartArea:!1,borderDash:[2,4]},beginAtZero:!0,suggestedMax:null,ticks:{color:this.shouldUseDarkMode()?"#ffffff":"#6D6A73",font:{size:14,weight:400},precision:0,callback:function(e,r,n){return t.hasSecondaryMetric()?t.formatValueForMetric(t.secondaryChartMetricIdValue,e):e}}},x:{grid:{borderColor:"#DEDAE6",tickColor:"#DEDAE6",display:!0,drawOnChartArea:!1},ticks:{color:this.shouldUseDarkMode()?"#ffffff":"#6D6A73",autoSkip:!0,autoSkipPadding:16,maxRotation:0,font:{size:14,weight:400},callback:this.tickText}}},plugins:{mode:String,legend:{display:!1},corsair:{dash:[2,4],color:"#777",width:1},tooltip:{itemSort:function(t,e){return t.datasetIndexs||ca){t.corsair={x:u,y:c,draw:!1},t.draw();return}t.corsair={x:u,y:c,draw:!0},t.draw()}},afterDatasetsDraw:function(t,e,r){if(!r.disabled){var n=t.ctx,i=t.chartArea,a=i.top,o=i.bottom;i.left,i.right;var s=t.corsair,l=s.x;s.y,s.draw&&(l=t.tooltip.caretX,n.lineWidth=r.width||0,n.setLineDash(r.dash||[]),n.strokeStyle=r.color||"black",n.save(),n.beginPath(),n.moveTo(l,o),n.lineTo(l,a),n.stroke(),n.restore(),n.setLineDash([]))}}}},{}],"1stGI":[function(t,e,r){/*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License */var n=t("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"defaults",function(){return m.d}),n.export(r,"Animation",function(){return k}),n.export(r,"Animations",function(){return M}),n.export(r,"ArcElement",function(){return en}),n.export(r,"BarController",function(){return z}),n.export(r,"BarElement",function(){return eb}),n.export(r,"BasePlatform",function(){return tS}),n.export(r,"BasicPlatform",function(){return tO}),n.export(r,"BubbleController",function(){return W}),n.export(r,"CategoryScale",function(){return eZ}),n.export(r,"Chart",function(){return t7}),n.export(r,"DatasetController",function(){return I}),n.export(r,"Decimation",function(){return ew}),n.export(r,"DomPlatform",function(){return tV}),n.export(r,"DoughnutController",function(){return H}),n.export(r,"Element",function(){return q}),n.export(r,"Filler",function(){return eF}),n.export(r,"Interaction",function(){return tp}),n.export(r,"Legend",function(){return eR}),n.export(r,"LineController",function(){return U}),n.export(r,"LineElement",function(){return eh}),n.export(r,"LinearScale",function(){return e2}),n.export(r,"LogarithmicScale",function(){return e3}),n.export(r,"PieController",function(){return Y}),n.export(r,"PointElement",function(){return ed}),n.export(r,"PolarAreaController",function(){return K}),n.export(r,"RadarController",function(){return X}),n.export(r,"RadialLinearScale",function(){return e7}),n.export(r,"Scale",function(){return tr}),n.export(r,"ScatterController",function(){return ta}),n.export(r,"SubTitle",function(){return ez}),n.export(r,"Ticks",function(){return Q}),n.export(r,"TimeScale",function(){return ro}),n.export(r,"TimeSeriesScale",function(){return rl}),n.export(r,"Title",function(){return eN}),n.export(r,"Tooltip",function(){return eG}),n.export(r,"_adapters",function(){return tu}),n.export(r,"_detectPlatform",function(){return tz}),n.export(r,"animator",function(){return b}),n.export(r,"controllers",function(){return to}),n.export(r,"elements",function(){return e_}),n.export(r,"layouts",function(){return tM}),n.export(r,"plugins",function(){return eJ}),n.export(r,"registerables",function(){return rc}),n.export(r,"registry",function(){return ti}),n.export(r,"scales",function(){return ru});var i=t("@swc/helpers/_/_assert_this_initialized"),a=t("@swc/helpers/_/_class_call_check"),o=t("@swc/helpers/_/_create_class"),s=t("@swc/helpers/_/_define_property"),l=t("@swc/helpers/_/_get"),u=t("@swc/helpers/_/_get_prototype_of"),c=t("@swc/helpers/_/_inherits"),h=t("@swc/helpers/_/_object_spread"),f=t("@swc/helpers/_/_object_spread_props"),d=t("@swc/helpers/_/_sliced_to_array"),p=t("@swc/helpers/_/_to_consumable_array"),v=t("@swc/helpers/_/_type_of"),g=t("@swc/helpers/_/_wrap_native_super"),y=t("@swc/helpers/_/_create_super"),m=t("./chunks/helpers.segment.mjs"),b=new(function(){function t(){(0,a._)(this,t),this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}return(0,o._)(t,[{key:"_notify",value:function(t,e,r,n){var i=e.listeners[n],a=e.duration;i.forEach(function(n){return n({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(r-e.start,a)})})}},{key:"_refresh",value:function(){var t=this;this._request||(this._running=!0,this._request=(0,m.r).call(window,function(){t._update(),t._request=null,t._running&&t._refresh()}))}},{key:"_update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),r=0;this._charts.forEach(function(n,i){if(n.running&&n.items.length){for(var a,o=n.items,s=o.length-1,l=!1;s>=0;--s)(a=o[s])._active?(a._total>n.duration&&(n.duration=a._total),a.tick(e),l=!0):(o[s]=o[o.length-1],o.pop());l&&(i.draw(),t._notify(i,n,e,"progress")),o.length||(n.running=!1,t._notify(i,n,e,"complete"),n.initial=!1),r+=o.length}}),this._lastDate=e,0===r&&(this._running=!1)}},{key:"_getAnims",value:function(t){var e=this._charts,r=e.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,r)),r}},{key:"listen",value:function(t,e,r){this._getAnims(t).listeners[e].push(r)}},{key:"add",value:function(t,e){var r;e&&e.length&&(r=this._getAnims(t).items).push.apply(r,(0,p._)(e))}},{key:"has",value:function(t){return this._getAnims(t).items.length>0}},{key:"start",value:function(t){var e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(function(t,e){return Math.max(t,e._duration)},0),this._refresh())}},{key:"running",value:function(t){if(!this._running)return!1;var e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}},{key:"stop",value:function(t){var e=this._charts.get(t);if(e&&e.items.length){for(var r=e.items,n=r.length-1;n>=0;--n)r[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}}},{key:"remove",value:function(t){return this._charts.delete(t)}}]),t}()),_="transparent",x={boolean:function(t,e,r){return r>.5?e:t},color:function(t,e,r){var n=(0,m.c)(t||_),i=n.valid&&(0,m.c)(e||_);return i&&i.valid?i.mix(n,r).hexString():e},number:function(t,e,r){return t+(e-t)*r}},k=function(){function t(e,r,n,i){(0,a._)(this,t);var o=r[n];i=(0,m.a)([e.to,i,o,e.from]);var s=(0,m.a)([e.from,o,i]);this._active=!0,this._fn=e.fn||x[e.type||(void 0===s?"undefined":(0,v._)(s))],this._easing=m.e[e.easing]||m.e.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=r,this._prop=n,this._from=s,this._to=i,this._promises=void 0}return(0,o._)(t,[{key:"active",value:function(){return this._active}},{key:"update",value:function(t,e,r){if(this._active){this._notify(!1);var n=this._target[this._prop],i=r-this._start,a=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=(0,m.a)([t.to,e,n,t.from]),this._from=(0,m.a)([t.from,n,e])}}},{key:"cancel",value:function(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}},{key:"tick",value:function(t){var e,r=t-this._start,n=this._duration,i=this._prop,a=this._from,o=this._loop,s=this._to;if(this._active=a!==s&&(o||r1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[i]=this._fn(a,s,e)}},{key:"wait",value:function(){var t=this._promises||(this._promises=[]);return new Promise(function(e,r){t.push({res:e,rej:r})})}},{key:"_notify",value:function(t){for(var e=t?"res":"rej",r=this._promises||[],n=0;n=0;--s){var s,l=a[s];if("$"!==l.charAt(0)){if("options"===l){n.push.apply(n,(0,p._)(this._animateOptions(t,e)));continue}var u=e[l],c=i[l],h=r.get(l);if(c){if(h&&c.active()){c.update(h,u,o);continue}c.cancel()}if(!h||!h.duration){t[l]=u;continue}i[l]=c=new k(h,t,l,u),n.push(c)}}return n}},{key:"update",value:function(t,e){if(0===this._properties.size){Object.assign(t,e);return}var r=this._createAnimations(t,e);if(r.length)return b.add(this._chart,r),!0}}]),t}();function S(t,e){var r=t&&t.options||{},n=r.reverse,i=void 0===r.min?e:0,a=void 0===r.max?e:0;return{start:n?a:i,end:n?i:a}}function O(t,e){var r,n,i=[],a=t._getSortedDatasetMetas(e);for(r=0,n=a.length;r3&&void 0!==arguments[3]?arguments[3]:{},l=t.keys,u="single"===s.mode;if(null!==e){for(n=0,i=l.length;n0||!r&&c<0)return u.index}}catch(t){a=!0,o=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return null}function P(t,e){for(var r,n=t.chart,i=t._cachedMeta,a=n._stacks||(n._stacks={}),o=i.iScale,s=i.vScale,l=i.index,u=o.axis,c=s.axis,h="".concat(o.id,".").concat(s.id,".").concat(i.stack||i.type),f=e.length,d=0;d0&&a._parsed[t-1];if(!1===this._parsing)a._parsed=o,a._sorted=!0,i=o;else{for(r=0,i=(0,m.b)(o[t])?this.parseArrayData(a,o,t,e):(0,m.i)(o[t])?this.parseObjectData(a,o,t,e):this.parsePrimitiveData(a,o,t,e);re||y=0;--o)if(!b()){this.updateRangeFromParsed(p,t,s,d);break}}return p}},{key:"getAllParsedValues",value:function(t){var e,r,n,i=this._cachedMeta._parsed,a=[];for(e=0,r=i.length;e=0&&t1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0,i="active"===r,a=this._cachedDataOpts,o=t+"-"+r,s=a[o],l=this.enableOptionSharing&&(0,m.j)(n);if(s)return F(s,l);var u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),h=u.getOptionScopes(this.getDataset(),c),f=Object.keys(m.d.elements[t]),d=u.resolveNamedOptions(h,f,function(){return e.getContext(n,i)},i?["".concat(t,"Hover"),"hover",t,""]:[t,""]);return d.$shared&&(d.$shared=l,a[o]=Object.freeze(F(d,l))),d}},{key:"_resolveAnimations",value:function(t,e,r){var n,i=this.chart,a=this._cachedDataOpts,o="animation-".concat(e),s=a[o];if(s)return s;if(!1!==i.options.animation){var l=this.chart.config,u=l.datasetAnimationScopeKeys(this._type,e),c=l.getOptionScopes(this.getDataset(),u);n=l.createResolver(c,this.getContext(t,r,e))}var h=new M(i,n&&n.animations);return n&&n._cacheable&&(a[o]=Object.freeze(h)),h}},{key:"getSharedOptions",value:function(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}},{key:"includeOptions",value:function(t,e){return!e||T(t)||this.chart._animationsDisabled}},{key:"_getSharedOptions",value:function(t,e){var r=this.resolveDataElementOptions(t,e),n=this._sharedOptions,i=this.getSharedOptions(r),a=this.includeOptions(e,i)||i!==n;return this.updateSharedOptions(i,e,r),{sharedOptions:i,includeOptions:a}}},{key:"updateElement",value:function(t,e,r,n){T(n)?Object.assign(t,r):this._resolveAnimations(e,n).update(t,r)}},{key:"updateSharedOptions",value:function(t,e,r){t&&!T(e)&&this._resolveAnimations(void 0,e).update(t,r)}},{key:"_setStyle",value:function(t,e,r,n){t.active=n;var i=this.getStyle(e,n);this._resolveAnimations(e,r,n).update(t,{options:!n&&this.getSharedOptions(i)||i})}},{key:"removeHoverStyle",value:function(t,e,r){this._setStyle(t,r,"active",!1)}},{key:"setHoverStyle",value:function(t,e,r){this._setStyle(t,r,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}},{key:"_resyncElements",value:function(t){var e=this._data,r=this._cachedMeta.data,n=!0,i=!1,a=void 0;try{for(var o,s=this._syncList[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=(0,d._)(o.value,3),u=l[0],c=l[1],h=l[2];this[u](c,h)}}catch(t){i=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}this._syncList=[];var f=r.length,p=e.length,v=Math.min(p,f);v&&this.parse(0,v),p>f?this._insertElements(f,p-f,t):p2)||void 0===arguments[2]||arguments[2],i=this._cachedMeta,a=i.data,o=t+e,s=function(t){for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(s(a),r=t;rMath.abs(s)&&(l=s,u=o),e[r.axis]=u,e._custom={barStart:l,barEnd:u,start:i,end:a,min:o,max:s}}else e[r.axis]=r.parse(t,n);return e}function R(t,e,r,n){var i,a,o,s,l=t.iScale,u=t.vScale,c=l.getLabels(),h=l===u,f=[];for(i=r,a=r+n;it.x,a="left",o="right"):(i=t.base=u?1:-1))*l,d===u&&(y-=r/2);var b,_=i.getPixelForDecimal(0),x=i.getPixelForDecimal(1);e=(y=Math.max(Math.min(y,Math.max(_,x)),Math.min(_,x)))+r}if(y===i.getPixelForValue(u)){var k=(0,m.s)(r)*i.getLineWidthForValue(u)/2;y+=k,r-=k}return{size:r,base:y,head:e,center:e+r/2}}},{key:"_calculateBarIndexPixels",value:function(t,e){var r,n,i=e.scale,a=this.options,o=a.skipNull,s=(0,m.v)(a.maxBarThickness,1/0);if(e.grouped){var l,u,c,h,f,d,p,v,g,y=o?this._getStackCount(t):e.stackCount,b="flex"===a.barThickness?(u=(l=e.pixels)[t],c=t>0?l[t-1]:null,h=t=0;--r)e=Math.max(e,t[r].size(this.resolveDataElementOptions(r))/2);return e>0&&e}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,r=e.xScale,n=e.yScale,i=this.getParsed(t),a=r.getLabelForValue(i.x),o=n.getLabelForValue(i.y),s=i._custom;return{label:e.label,value:"("+a+", "+o+(s?", "+s:"")+")"}}},{key:"update",value:function(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}},{key:"updateElements",value:function(t,e,r,n){for(var i="reset"===n,a=this._cachedMeta,o=a.iScale,s=a.vScale,l=this._getSharedOptions(e,n),u=l.sharedOptions,c=l.includeOptions,h=o.axis,f=s.axis,d=e;d0&&!isNaN(t)?m.T*(Math.abs(t)/e):0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,r=this.chart,n=r.data.labels||[],i=(0,m.o)(e._parsed[t],r.options.locale);return{label:n[t]||"",value:i}}},{key:"getMaxBorderWidth",value:function(t){var e,r,n,i,a,o=0,s=this.chart;if(!t){for(e=0,r=s.data.datasets.length;e0&&this.getParsed(e-1),k=e;k0&&Math.abs(M[d]-x[d])>b,y&&(S.parsed=M,S.raw=u.data[k]),f&&(S.options=h||this.resolveDataElementOptions(k,w.active?"active":n)),_||this.updateElement(w,k,S,n),x=M}}},{key:"getMaxOverflow",value:function(){var t=this._cachedMeta,e=t.dataset,r=e.options&&e.options.borderWidth||0,n=t.data||[];return n.length?Math.max(r,n[0].size(this.resolveDataElementOptions(0)),n[n.length-1].size(this.resolveDataElementOptions(n.length-1)))/2:r}},{key:"draw",value:function(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),(0,l._)((0,u._)(r.prototype),"draw",this).call(this)}}]),r}(I);U.id="line",U.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},U.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var K=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t,n){var i;return(0,a._)(this,r),(i=e.call(this,t,n)).innerRadius=void 0,i.outerRadius=void 0,i}return(0,o._)(r,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,r=this.chart,n=r.data.labels||[],i=(0,m.o)(e._parsed[t].r,r.options.locale);return{label:n[t]||"",value:i}}},{key:"parseObjectData",value:function(t,e,r,n){return(0,m.y).bind(this)(t,e,r,n)}},{key:"update",value:function(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}},{key:"getMinMax",value:function(){var t=this,e=this._cachedMeta,r={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(function(e,n){var i=t.getParsed(n).r;!isNaN(i)&&t.chart.getDataVisibility(n)&&(ir.max&&(r.max=i))}),r}},{key:"_updateRadius",value:function(){var t=this.chart,e=t.chartArea,r=t.options,n=Math.max(Math.min(e.right-e.left,e.bottom-e.top)/2,0),i=Math.max(r.cutoutPercentage?n/100*r.cutoutPercentage:1,0),a=(n-i)/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a}},{key:"updateElements",value:function(t,e,r,n){var i,a="reset"===n,o=this.chart,s=o.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,c=l.yCenter,h=l.getIndexAngle(0)-.5*m.P,f=h,d=360/this.countVisibleElements();for(i=0;i1){var o,s=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(s<1e-4||s>1e15)&&(n="scientific"),Math.abs(o=r.length>3?r[2].value-r[1].value:r[1].value-r[0].value)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),a=o}var l=Math.max(Math.min(-1*Math.floor((0,m.z)(Math.abs(a))),20),0),u={notation:n,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),(0,m.o)(t,i,u)},logarithmic:function(t,e,r){if(0===t)return"0";var n=t/Math.pow(10,Math.floor((0,m.z)(t)));return 1===n||2===n||5===n?$.numeric.call(this,t,e,r):""}},Q={formatters:$};function G(t,e,r,n,i){var a,o,s,l=(0,m.v)(n,0),u=Math.min((0,m.v)(i,t.length),t.length),c=0;for(r=Math.ceil(r),i&&(r=(a=i-n)/Math.floor(a/r)),s=l;s<0;)s=Math.round(l+ ++c*r);for(o=Math.max(l,0);oi?i:n,i=a&&n>i?n:i,{min:(0,m.B)(n,(0,m.B)(i,n)),max:(0,m.B)(i,(0,m.B)(n,i))}}},{key:"getPadding",value:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}},{key:"getTicks",value:function(){return this.ticks}},{key:"getLabels",value:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}},{key:"beforeLayout",value:function(){this._cache={},this._dataLimitsCached=!1}},{key:"beforeUpdate",value:function(){(0,m.C)(this.options.beforeUpdate,[this])}},{key:"update",value:function(t,e,r){var n=this.options,i=n.beginAtZero,a=n.grace,o=n.ticks,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,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=(0,m.D)(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();var l=sn)return function(t,e,r,n){var i,a=0,o=r[0];for(i=0,n=Math.ceil(n);ii)return l}return Math.max(i,1)}(i,e,n);if(a>0){var c,h,f,d,p=a>1?Math.round((s-o)/(a-1)):null;for(G(e,l,u,(0,m.k)(p)?0:o-p,o),f=0,d=a-1;f=s||a<=1||!this.isHorizontal()){this.labelRotation=o;return}var u=this._getLabelSizes(),c=u.widest.width,h=u.highest.height,f=(0,m.E)(this.chart.width-c,0,this.maxWidth);c+6>(t=n.offset?this.maxWidth/a:f/(a-1))&&(t=f/(a-(n.offset?.5:1)),e=this.maxHeight-tt(n.grid)-i.padding-te(n.title,this.chart.options.font),r=Math.sqrt(c*c+h*h),l=Math.max(o,Math.min(s,l=(0,m.F)(Math.min(Math.asin((0,m.E)((u.highest.height+6)/t,-1,1)),Math.asin((0,m.E)(e/r,-1,1))-Math.asin((0,m.E)(h/r,-1,1))))))),this.labelRotation=l}},{key:"afterCalculateLabelRotation",value:function(){(0,m.C)(this.options.afterCalculateLabelRotation,[this])}},{key:"afterAutoSkip",value:function(){}},{key:"beforeFit",value:function(){(0,m.C)(this.options.beforeFit,[this])}},{key:"fit",value:function(){var t={width:0,height:0},e=this.chart,r=this.options,n=r.ticks,i=r.title,a=r.grid,o=this._isVisible(),s=this.isHorizontal();if(o){var l=te(i,e.options.font);if(s?(t.width=this.maxWidth,t.height=tt(a)+l):(t.height=this.maxHeight,t.width=tt(a)+l),n.display&&this.ticks.length){var u=this._getLabelSizes(),c=u.first,h=u.last,f=u.widest,d=u.highest,p=2*n.padding,v=(0,m.t)(this.labelRotation),g=Math.cos(v),y=Math.sin(v);if(s){var b=n.mirror?0:y*f.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+b+p)}else{var _=n.mirror?0:g*f.width+y*d.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(c,h,y,g)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}},{key:"_calculatePadding",value:function(t,e,r,n){var i=this.options,a=i.ticks,o=a.align,s=a.padding,l=i.position,u=0!==this.labelRotation,c="top"!==l&&"x"===this.axis;if(this.isHorizontal()){var h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,p=0;u?c?(d=n*t.width,p=r*e.height):(d=r*t.height,p=n*e.width):"start"===o?p=e.width:"end"===o?d=t.width:"inner"!==o&&(d=t.width/2,p=e.width/2),this.paddingLeft=Math.max((d-h+s)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{var v=e.height/2,g=t.height/2;"start"===o?(v=0,g=t.height):"end"===o&&(v=e.height,g=0),this.paddingTop=v+s,this.paddingBottom=g+s}}},{key:"_handleMargins",value:function(){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))}},{key:"afterFit",value:function(){(0,m.C)(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var t=this.options,e=t.axis,r=t.position;return"top"===r||"bottom"===r||"x"===e}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(t){var e,r;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,r=t.length;ee){for(r=0;re.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getPixelForDecimal",value:function(t){this._reversePixels&&(t=1-t);var e=this._startPixel+t*this._length;return(0,m.I)(this._alignToPixels?(0,m.J)(this.chart,e,0):e)}},{key:"getDecimalForPixel",value:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var t=this.min,e=this.max;return t<0&&e<0?e:t>0&&e>0?t:0}},{key:"getContext",value:function(t){var e,r=this.ticks||[];if(t>=0&&to*n?o/r:s/n:s*n0}},{key:"_computeGridLineItems",value:function(t){var e,r,n,i,a,o,s,l,u,c,h,f,d=this.axis,p=this.chart,v=this.options,g=v.grid,y=v.position,b=g.offset,_=this.isHorizontal(),x=this.ticks.length+(b?1:0),k=tt(g),w=[],M=g.setContext(this.getContext()),S=M.drawBorder?M.borderWidth:0,O=S/2,A=function(t){return(0,m.J)(p,t,S)};if("top"===y)e=A(this.bottom),o=this.bottom-k,l=e-O,c=A(t.top)+O,f=t.bottom;else if("bottom"===y)e=A(this.top),c=t.top,f=A(t.bottom)-O,o=e+O,l=this.top+k;else if("left"===y)e=A(this.right),a=this.right-k,s=e-O,u=A(t.left)+O,h=t.right;else if("right"===y)e=A(this.left),u=t.left,h=A(t.right)-O,a=e+O,s=this.left+k;else if("x"===d){if("center"===y)e=A((t.top+t.bottom)/2+.5);else if((0,m.i)(y)){var E=Object.keys(y)[0],C=y[E];e=A(this.chart.scales[E].getPixelForValue(C))}c=t.top,f=t.bottom,l=(o=e+O)+k}else if("y"===d){if("center"===y)e=A((t.left+t.right)/2);else if((0,m.i)(y)){var P=Object.keys(y)[0],D=y[P];e=A(this.chart.scales[P].getPixelForValue(D))}s=(a=e-O)-k,u=t.left,h=t.right}var j=(0,m.v)(v.ticks.maxTicksLimit,x),T=Math.max(1,Math.ceil(x/j));for(r=0;rs+1e-6)))return l}(this,r,b))&&(i=(0,m.J)(p,n,I),_?a=s=u=h=i:o=l=c=f=i,w.push({tx1:a,ty1:o,tx2:s,ty2:l,x1:u,y1:c,x2:h,y2:f,width:I,color:L,borderDash:R,borderDashOffset:B,tickWidth:N,tickColor:V,tickBorderDash:z,tickBorderDashOffset:W}))}return this._ticksLength=x,this._borderValue=e,w}},{key:"_computeLabelItems",value:function(t){var e,r,n,i,a,o,s,l,u,c,h,f=this.axis,d=this.options,p=d.position,v=d.ticks,g=this.isHorizontal(),y=this.ticks,b=v.align,_=v.crossAlign,x=v.padding,k=v.mirror,w=tt(d.grid),M=w+x,S=k?-x:M,O=-(0,m.t)(this.labelRotation),A=[],E="middle";if("top"===p)a=this.bottom-S,o=this._getXAxisLabelAlignment();else if("bottom"===p)a=this.top+S,o=this._getXAxisLabelAlignment();else if("left"===p){var C=this._getYAxisLabelAlignment(w);o=C.textAlign,i=C.x}else if("right"===p){var P=this._getYAxisLabelAlignment(w);o=P.textAlign,i=P.x}else if("x"===f){if("center"===p)a=(t.top+t.bottom)/2+M;else if((0,m.i)(p)){var D=Object.keys(p)[0],j=p[D];a=this.chart.scales[D].getPixelForValue(j)+M}o=this._getXAxisLabelAlignment()}else if("y"===f){if("center"===p)i=(t.left+t.right)/2-M;else if((0,m.i)(p)){var T=Object.keys(p)[0],F=p[T];i=this.chart.scales[T].getPixelForValue(F)}o=this._getYAxisLabelAlignment(w).textAlign}"y"===f&&("start"===b?E="top":"end"===b&&(E="bottom"));var I=this._getLabelSizes();for(e=0,r=y.length;e=0?e.setContext(this.getContext(r)).lineWidth:0}},{key:"drawGrid",value:function(t){var e,r,n=this.options.grid,i=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o=function(t,e,r){r.width&&r.color&&(i.save(),i.lineWidth=r.width,i.strokeStyle=r.color,i.setLineDash(r.borderDash||[]),i.lineDashOffset=r.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(n.display)for(e=0,r=a.length;e0&&this.getParsed(e-1),k=e;k0&&Math.abs(M[d]-x[d])>b,y&&(S.parsed=M,S.raw=u.data[k]),f&&(S.options=h||this.resolveDataElementOptions(k,w.active?"active":n)),_||this.updateElement(w,k,S,n),x=M}this.updateSharedOptions(h,n,c)}},{key:"getMaxOverflow",value:function(){var t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){for(var r=0,n=e.length-1;n>=0;--n)r=Math.max(r,e[n].size(this.resolveDataElementOptions(n))/2);return r>0&&r}var i=t.dataset,a=i.options&&i.options.borderWidth||0;return e.length?Math.max(a,e[0].size(this.resolveDataElementOptions(0)),e[e.length-1].size(this.resolveDataElementOptions(e.length-1)))/2:a}}]),r}(I);ta.id="scatter",ta.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},ta.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:function(){return""},label:function(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var to=Object.freeze({__proto__:null,BarController:z,BubbleController:W,DoughnutController:H,LineController:U,PolarAreaController:K,PieController:Y,RadarController:X,ScatterController:ta});function ts(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}var tl=function(){function t(e){(0,a._)(this,t),this.options=e||{}}return(0,o._)(t,[{key:"init",value:function(t){}},{key:"formats",value:function(){return ts()}},{key:"parse",value:function(t,e){return ts()}},{key:"format",value:function(t,e){return ts()}},{key:"add",value:function(t,e,r){return ts()}},{key:"diff",value:function(t,e,r){return ts()}},{key:"startOf",value:function(t,e,r){return ts()}},{key:"endOf",value:function(t,e){return ts()}}]),t}();tl.override=function(t){Object.assign(tl.prototype,t)};var tu={_date:tl};function tc(t,e,r,n,i){for(var a=t.getSortedVisibleDatasetMetas(),o=r[e],s=0,l=a.length;s0){var l=s[0].datasetIndex,u=t.getDatasetMeta(l).data;s=[];for(var c=0;c3&&void 0!==arguments[3]?arguments[3]:[""],i={$shared:!0},a=tJ(this._resolverCache,t,n),o=a.resolver,s=a.subPrefixes,l=o;if(function(t,e){var r=(0,m.ab)(t),n=r.isScriptable,i=r.isIndexable,a=!0,o=!1,s=void 0;try{for(var l,u=e[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,h=n(c),f=i(c),d=(f||h)&&t[c];if(h&&((0,m.a8)(d)||tZ(d))||f&&(0,m.b)(d))return!0}}catch(t){o=!0,s=t}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return!1}(o,e)){i.$shared=!1,r=(0,m.a8)(r)?r():r;var u=this.createResolver(t,r,s);l=(0,m.a9)(o,r,u)}var c=!0,h=!1,f=void 0;try{for(var d,p=e[Symbol.iterator]();!(c=(d=p.next()).done);c=!0){var v=d.value;i[v]=l[v]}}catch(t){h=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(h)throw f}}return i}},{key:"createResolver",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],n=arguments.length>3?arguments[3]:void 0,i=tJ(this._resolverCache,t,r).resolver;return(0,m.i)(e)?(0,m.a9)(i,e,void 0,n):i}}]),t}();function tJ(t,e,r){var n=t.get(e);n||(n=new Map,t.set(e,n));var i=r.join(),a=n.get(i);return a||(a={resolver:(0,m.aa)(e,r),subPrefixes:r.filter(function(t){return!t.toLowerCase().includes("hover")})},n.set(i,a)),a}var tZ=function(t){return(0,m.i)(t)&&Object.getOwnPropertyNames(t).reduce(function(e,r){return e||(0,m.a8)(t[r])},!1)},t0=["top","bottom","left","right","chartArea"];function t1(t,e){return"top"===t||"bottom"===t||-1===t0.indexOf(t)&&"x"===e}function t2(t,e){return function(r,n){return r[t]===n[t]?r[e]-n[e]:r[t]-n[t]}}function t5(t){var e=t.chart,r=e.options.animation;e.notifyPlugins("afterRender"),(0,m.C)(r&&r.onComplete,[t],e)}function t3(t){var e=t.chart,r=e.options.animation;(0,m.C)(r&&r.onProgress,[t],e)}function t6(t){return(0,m.a6)()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var t8={},t4=function(t){var e=t6(t);return Object.values(t8).filter(function(t){return t.canvas===e}).pop()},t7=function(){function t(e,r){var n=this;(0,a._)(this,t);var i=this.config=new tG(r),o=t6(e),s=t4(o);if(s)throw Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");var l=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tz(o)),this.platform.updateConfig(i);var u=this.platform.acquireContext(o,l.aspectRatio),c=u&&u.canvas,h=c&&c.height,f=c&&c.width;if(this.id=(0,m.ad)(),this.ctx=u,this.canvas=c,this.width=f,this.height=h,this._options=l,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 tW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,m.ae)(function(t){return n.update(t)},l.resizeDelay||0),this._dataChanges=[],t8[this.id]=this,!u||!c){console.error("Failed to create chart: can't acquire context from the given item");return}b.listen(this,"complete",t5),b.listen(this,"progress",t3),this._initialize(),this.attached&&this.update()}return(0,o._)(t,[{key:"aspectRatio",get:function(){var t=this.options,e=t.aspectRatio,r=t.maintainAspectRatio,n=this.width,i=this.height,a=this._aspectRatio;return(0,m.k)(e)?r&&a?a:i?n/i:null:e}},{key:"data",get:function(){return this.config.data},set:function(t){this.config.data=t}},{key:"options",get:function(){return this._options},set:function(t){this.config.options=t}},{key:"_initialize",value:function(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,m.af)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}},{key:"clear",value:function(){return(0,m.ag)(this.canvas,this.ctx),this}},{key:"stop",value:function(){return b.stop(this),this}},{key:"resize",value:function(t,e){b.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}},{key:"_resize",value:function(t,e){var r=this.options,n=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,i),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,m.af)(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),(0,m.C)(r.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}},{key:"ensureScalesHaveIDs",value:function(){var t=this.options.scales||{};(0,m.Q)(t,function(t,e){t.id=e})}},{key:"buildOrUpdateScales",value:function(){var t=this,e=this.options,r=e.scales,n=this.scales,i=Object.keys(n).reduce(function(t,e){return t[e]=!1,t},{}),a=[];r&&(a=a.concat(Object.keys(r).map(function(t){var e=r[t],n=tU(t,e),i="r"===n,a="x"===n;return{options:e,dposition:i?"chartArea":a?"bottom":"left",dtype:i?"radialLinear":a?"category":"linear"}}))),(0,m.Q)(a,function(r){var a=r.options,o=a.id,s=tU(o,a),l=(0,m.v)(a.type,r.dtype);(void 0===a.position||t1(a.position,s)!==t1(r.dposition))&&(a.position=r.dposition),i[o]=!0;var u=null;o in n&&n[o].type===l?u=n[o]:n[(u=new(ti.getScale(l))({id:o,type:l,ctx:t.ctx,chart:t})).id]=u,u.init(a,e)}),(0,m.Q)(i,function(t,e){t||delete n[e]}),(0,m.Q)(n,function(e){tM.configure(t,e,e.options),tM.addBox(t,e)})}},{key:"_updateMetasets",value:function(){var t=this._metasets,e=this.data.datasets.length,r=t.length;if(t.sort(function(t,e){return t.index-e.index}),r>e){for(var n=e;nr.length&&delete this._stacks,e.forEach(function(e,n){0===r.filter(function(t){return t===e._dataset}).length&&t._destroyDatasetMeta(n)})}},{key:"buildOrUpdateControllers",value:function(){var t,e,r=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t=e){var h=t[u];delete t[u],(r>0||c>e)&&(t[c+r]=h)}}}catch(t){a=!0,o=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}}(t,u,h)}}catch(t){n=!0,i=t}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"_getUniformDataChanges",value:function(){var t=this._dataChanges;if(t&&t.length){this._dataChanges=[];for(var e=this.data.datasets.length,r=function(e){return new Set(t.filter(function(t){return t[0]===e}).map(function(t,e){return e+","+t.splice(1).join(",")}))},n=r(0),i=1;i=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(t){var e=this.ctx,r=t._clip,n=!r.disabled,i=this.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(n&&(0,m.L)(e,{left:!1===r.left?0:i.left-r.left,right:!1===r.right?this.width:i.right+r.right,top:!1===r.top?0:i.top-r.top,bottom:!1===r.bottom?this.height:i.bottom+r.bottom}),t.controller.draw(),n&&(0,m.N)(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}},{key:"isPointInArea",value:function(t){return(0,m.$)(t,this.chartArea,this._minPadding)}},{key:"getElementsAtEventForMode",value:function(t,e,r,n){var i=tp.modes[e];return"function"==typeof i?i(this,t,r,n):[]}},{key:"getDatasetMeta",value:function(t){var e=this.data.datasets[t],r=this._metasets,n=r.filter(function(t){return t&&t._dataset===e}).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},r.push(n)),n}},{key:"getContext",value:function(){return this.$context||(this.$context=(0,m.h)(null,{chart:this,type:"chart"}))}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(t){var e=this.data.datasets[t];if(!e)return!1;var r=this.getDatasetMeta(t);return"boolean"==typeof r.hidden?!r.hidden:!e.hidden}},{key:"setDatasetVisibility",value:function(t,e){this.getDatasetMeta(t).hidden=!e}},{key:"toggleDataVisibility",value:function(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}},{key:"getDataVisibility",value:function(t){return!this._hiddenIndices[t]}},{key:"_updateVisibility",value:function(t,e,r){var n=r?"show":"hide",i=this.getDatasetMeta(t),a=i.controller._resolveAnimations(void 0,n);(0,m.j)(e)?(i.data[e].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(i,{visible:r}),this.update(function(e){return e.datasetIndex===t?n:void 0}))}},{key:"hide",value:function(t,e){this._updateVisibility(t,e,!1)}},{key:"show",value:function(t,e){this._updateVisibility(t,e,!0)}},{key:"_destroyDatasetMeta",value:function(t){var e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}},{key:"_stop",value:function(){var t,e;for(this.stop(),b.remove(this),t=0,e=this.data.datasets.length;ti?(u=i/l,t.arc(a,o,l,r+u,n-u,!0)):t.arc(a,o,i,r+m.H,n-m.H),t.closePath(),t.clip()}function ee(t,e,r,n){return{x:r+t*Math.cos(e),y:n+t*Math.sin(e)}}function er(t,e,r,n,i,a){var o,s,l,u,c,h,f=e.x,d=e.y,p=e.startAngle,v=e.pixelMargin,g=e.innerRadius,y=Math.max(e.outerRadius+n+r-v,0),b=g>0?g+n+r+v:0,_=0,x=i-p;if(n){var k=y>0?y-n:0,w=((g>0?g-n:0)+k)/2;_=(x-(0!==w?x*w/(w+n):x))/2}var M=Math.max(.001,x*y-r/m.P)/y,S=(x-M)/2,O=p+S+_,A=i-S-_,E=(o=A-O,s=e.options.borderRadius,l=(0,m.al)(s,["outerStart","outerEnd","innerStart","innerEnd"]),c=Math.min(u=(y-b)/2,o*b/2),{outerStart:(h=function(t){var e=(y-Math.min(u,t))*o/2;return(0,m.E)(t,0,Math.min(u,e))})(l.outerStart),outerEnd:h(l.outerEnd),innerStart:(0,m.E)(l.innerStart,0,c),innerEnd:(0,m.E)(l.innerEnd,0,c)}),C=E.outerStart,P=E.outerEnd,D=E.innerStart,j=E.innerEnd,T=y-C,F=y-P,I=O+C/T,L=A-P/F,R=b+D,B=b+j,N=O+D/R,V=A-j/B;if(t.beginPath(),a){if(t.arc(f,d,y,I,L),P>0){var z=ee(F,L,f,d);t.arc(z.x,z.y,P,L,A+m.H)}var W=ee(B,A,f,d);if(t.lineTo(W.x,W.y),j>0){var H=ee(B,V,f,d);t.arc(H.x,H.y,j,A+m.H,V+Math.PI)}if(t.arc(f,d,b,A-j/b,O+D/b,!0),D>0){var U=ee(R,N,f,d);t.arc(U.x,U.y,D,N+Math.PI,O-m.H)}var K=ee(T,O,f,d);if(t.lineTo(K.x,K.y),C>0){var Y=ee(T,I,f,d);t.arc(Y.x,Y.y,C,O-m.H,I)}}else{t.moveTo(f,d);var X=Math.cos(I)*y+f,q=Math.sin(I)*y+d;t.lineTo(X,q);var $=Math.cos(L)*y+f,Q=Math.sin(L)*y+d;t.lineTo($,Q)}t.closePath()}Object.defineProperties(t7,{defaults:{enumerable:!0,value:m.d},instances:{enumerable:!0,value:t8},overrides:{enumerable:!0,value:m.U},registry:{enumerable:!0,value:ti},version:{enumerable:!0,value:"3.9.1"},getChart:{enumerable:!0,value:t4},register:{enumerable:!0,value:function(){for(var t=arguments.length,e=Array(t),r=0;r=m.T||(0,m.p)(a,l,u),v=(0,m.ak)(o,c+d,h+d);return p&&v}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),r=e.x,n=e.y,i=e.startAngle,a=e.endAngle,o=e.innerRadius,s=e.outerRadius,l=this.options,u=l.offset,c=l.spacing,h=(i+a)/2,f=(o+s+c+u)/2;return{x:r+Math.cos(h)*f,y:n+Math.sin(h)*f}}},{key:"tooltipPosition",value:function(t){return this.getCenterPoint(t)}},{key:"draw",value:function(t){var e=this.options,r=this.circumference,n=(e.offset||0)/2,i=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=r>m.T?Math.floor(r/m.T):0,0!==r&&!(this.innerRadius<0)&&!(this.outerRadius<0)){t.save();var o,s,l,u,c,h=0;if(n){h=n/2;var f=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(f)*h,Math.sin(f)*h),this.circumference>=m.P&&(h=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;var d=function(t,e,r,n,i){var a=e.fullCircles,o=e.startAngle,s=e.circumference,l=e.endAngle;if(a){er(t,e,r,n,o+m.T,i);for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:e;t.lineCap=(0,m.v)(r.borderCapStyle,e.borderCapStyle),t.setLineDash((0,m.v)(r.borderDash,e.borderDash)),t.lineDashOffset=(0,m.v)(r.borderDashOffset,e.borderDashOffset),t.lineJoin=(0,m.v)(r.borderJoinStyle,e.borderJoinStyle),t.lineWidth=(0,m.v)(r.borderWidth,e.borderWidth),t.strokeStyle=(0,m.v)(r.borderColor,e.borderColor)}function ea(t,e,r){t.lineTo(r.x,r.y)}function eo(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.length,i=r.start,a=void 0===i?0:i,o=r.end,s=void 0===o?n-1:o,l=e.start,u=e.end,c=Math.max(a,l),h=Math.min(s,u);return{count:n,start:c,loop:e.loop,ilen:hu&&s>u)?n+h-c:h-c}}function es(t,e,r,n){var i,a,o,s=e.points,l=e.options,u=eo(s,r,n),c=u.count,h=u.start,f=u.loop,d=u.ilen,p=l.stepped?m.as:l.tension||"monotone"===l.cubicInterpolationMode?m.at:ea,v=n||{},g=v.move,y=void 0===g||g,b=v.reverse;for(i=0;i<=d;++i)(a=s[(h+(b?d-i:i))%c]).skip||(y?(t.moveTo(a.x,a.y),y=!1):p(t,o,a,b,l.stepped),o=a);return f&&p(t,o,a=s[(h+(b?d:0))%c],b,l.stepped),!!f}function el(t,e,r,n){var i,a,o,s,l,u,c=e.points,h=eo(c,r,n),f=h.count,d=h.start,p=h.ilen,v=n||{},g=v.move,y=v.reverse,m=0,b=0,_=function(t){return(d+(y?p-t:t))%f},x=function(){s!==l&&(t.lineTo(m,l),t.lineTo(m,s),t.lineTo(m,u))};for((void 0===g||g)&&(a=c[_(0)],t.moveTo(a.x,a.y)),i=0;i<=p;++i)if(!(a=c[_(i)]).skip){var k=a.x,w=a.y,M=0|k;M===o?(wl&&(l=w),m=(b*m+k)/++b):(x(),t.lineTo(k,w),o=M,b=0,s=l=w),u=w}x()}function eu(t){var e=t.options,r=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||r?es:el}en.id="arc",en.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},en.defaultRoutes={backgroundColor:"backgroundColor"};var ec="function"==typeof Path2D,eh=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t){var n;return(0,a._)(this,r),(n=e.call(this)).animated=!0,n.options=void 0,n._chart=void 0,n._loop=void 0,n._fullLoop=void 0,n._path=void 0,n._points=void 0,n._segments=void 0,n._decimated=!1,n._pointsUpdated=!1,n._datasetIndex=void 0,t&&Object.assign((0,i._)(n),t),n}return(0,o._)(r,[{key:"updateControlPoints",value:function(t,e){var r=this.options;if((r.tension||"monotone"===r.cubicInterpolationMode)&&!r.stepped&&!this._pointsUpdated){var n=r.spanGaps?this._loop:this._fullLoop;(0,m.am)(this._points,r,t,n,e),this._pointsUpdated=!0}}},{key:"points",get:function(){return this._points},set:function(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}},{key:"segments",get:function(){return this._segments||(this._segments=(0,m.an)(this,this.options.segment))}},{key:"first",value:function(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}},{key:"last",value:function(){var t=this.segments,e=this.points,r=t.length;return r&&e[t[r-1].end]}},{key:"interpolate",value:function(t,e){var r,n,i=this.options,a=t[e],o=this.points,s=(0,m.ao)(this,{property:e,start:a,end:a});if(s.length){var l=[],u=i.stepped?m.ap:i.tension||"monotone"===i.cubicInterpolationMode?m.aq:m.ar;for(r=0,n=s.length;r2&&void 0!==arguments[2]?arguments[2]:{},n=t.x!==r.x?-e:0,i=t.y!==r.y?-e:0,a=(t.x+t.w!==r.x+r.w?e:0)-n,o=(t.y+t.h!==r.y+r.h?e:0)-i;return{x:t.x+n,y:t.y+i,w:t.w+a,h:t.h+o,radius:t.radius}}ed.id="point",ed.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},ed.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var eb=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t){var n;return(0,a._)(this,r),(n=e.call(this)).options=void 0,n.horizontal=void 0,n.base=void 0,n.width=void 0,n.height=void 0,n.inflateAmount=void 0,t&&Object.assign((0,i._)(n),t),n}return(0,o._)(r,[{key:"draw",value:function(t){var e,r,n,i,a,o,s,l,u,c,h,f,d,p,v,g,y,b,_,x=this.inflateAmount,k=this.options,w=k.borderColor,M=k.backgroundColor,S=(r=(e=ep(this)).right-e.left,n=e.bottom-e.top,i=r/2,a=n/2,o=this.options.borderWidth,s=this.borderSkipped,l=(0,m.aw)(o),u={t:ev(s.top,l.top,0,a),r:ev(s.right,l.right,0,i),b:ev(s.bottom,l.bottom,0,a),l:ev(s.left,l.left,0,i)},c=r/2,h=n/2,f=this.getProps(["enableBorderRadius"]).enableBorderRadius,d=this.options.borderRadius,p=(0,m.ax)(d),v=Math.min(c,h),g=this.borderSkipped,b={topLeft:ev(!(y=f||(0,m.i)(d))||g.top||g.left,p.topLeft,0,v),topRight:ev(!y||g.top||g.right,p.topRight,0,v),bottomLeft:ev(!y||g.bottom||g.left,p.bottomLeft,0,v),bottomRight:ev(!y||g.bottom||g.right,p.bottomRight,0,v)},{outer:{x:e.left,y:e.top,w:r,h:n,radius:b},inner:{x:e.left+u.l,y:e.top+u.t,w:r-u.l-u.r,h:n-u.t-u.b,radius:{topLeft:Math.max(0,b.topLeft-Math.max(u.t,u.l)),topRight:Math.max(0,b.topRight-Math.max(u.t,u.r)),bottomLeft:Math.max(0,b.bottomLeft-Math.max(u.b,u.l)),bottomRight:Math.max(0,b.bottomRight-Math.max(u.b,u.r))}}}),O=S.inner,A=S.outer,E=(_=A.radius).topLeft||_.topRight||_.bottomLeft||_.bottomRight?m.av:ey;t.save(),(A.w!==O.w||A.h!==O.h)&&(t.beginPath(),E(t,em(A,x,O)),t.clip(),E(t,em(O,-x,A)),t.fillStyle=w,t.fill("evenodd")),t.beginPath(),E(t,em(O,x)),t.fillStyle=M,t.fill(),t.restore()}},{key:"inRange",value:function(t,e,r){return eg(this,t,e,r)}},{key:"inXRange",value:function(t,e){return eg(this,t,null,e)}},{key:"inYRange",value:function(t,e){return eg(this,null,t,e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","base","horizontal"],t),r=e.x,n=e.y,i=e.base,a=e.horizontal;return{x:a?(r+i)/2:r,y:a?n:(n+i)/2}}},{key:"getRange",value:function(t){return"x"===t?this.width/2:this.height/2}}]),r}((0,g._)(q));eb.id="bar",eb.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},eb.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var e_=Object.freeze({__proto__:null,ArcElement:en,LineElement:eh,PointElement:ed,BarElement:eb});function ex(t){if(t._decimated){var e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function ek(t){t.data.datasets.forEach(function(t){ex(t)})}var ew={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:function(t,e,r){if(!r.enabled){ek(t);return}var n=t.width;t.data.datasets.forEach(function(e,i){var a,o=e._data,s=e.indexAxis,l=t.getDatasetMeta(i),u=o||e.data;if("y"!==(0,m.a)([s,t.options.indexAxis])&&l.controller.supportsDecimation){var c=t.scales[l.xAxisID];if(("linear"===c.type||"time"===c.type)&&!t.options.parsing){var d,p,v,g,y,b,_,x,k,w=(p=u.length,v=0,b=(y=(g=l.iScale).getUserBounds()).min,_=y.max,x=y.minDefined,k=y.maxDefined,x&&(v=(0,m.E)((0,m.Z)(u,g.axis,b).lo,0,p-1)),d=k?(0,m.E)((0,m.Z)(u,g.axis,_).hi+1,v,p)-v:p-v,{start:v,count:d}),M=w.start,S=w.count;if(S<=(r.threshold||4*n)){ex(e);return}switch((0,m.k)(o)&&(e._data=u,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),r.algorithm){case"lttb":a=function(t,e,r,n,i){var a,o,s,l,u,c=i.samples||n;if(c>=r)return t.slice(e,e+r);var h=[],f=(r-2)/(c-2),d=0,p=e+r-1,v=e;for(a=0,h[d++]=t[v];as&&(s=l,o=t[m],u=m);h[d++]=o,v=u}return h[d++]=t[p],h}(u,M,S,n,r);break;case"min-max":a=function(t,e,r,n){var i,a,o,s,l,u,c,d,p,v,g=0,y=0,b=[],_=t[e].x,x=t[e+r-1].x-_;for(i=e;iv&&(v=s,c=i),g=(y*g+a.x)/++y;else{var w=i-1;if(!(0,m.k)(u)&&!(0,m.k)(c)){var M=Math.min(u,c),S=Math.max(u,c);M!==d&&M!==w&&b.push((0,f._)((0,h._)({},t[M]),{x:g})),S!==d&&S!==w&&b.push((0,f._)((0,h._)({},t[S]),{x:g}))}i>0&&w!==d&&b.push(t[w]),b.push(a),l=k,y=0,p=v=s,u=c=d=i}}return b}(u,M,S,n);break;default:throw Error("Unsupported decimation algorithm '".concat(r.algorithm,"'"))}e._decimated=a}}})},destroy:function(t){ek(t)}};function eM(t,e,r,n){if(!n){var i=e[t],a=r[t];return"angle"===t&&(i=(0,m.az)(i),a=(0,m.az)(a)),{property:t,start:i,end:a}}}function eS(t,e,r){for(;e>t;e--){var n=r[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function eO(t,e,r,n){return t&&e?n(t[r],e[r]):t?t[r]:e?e[r]:0}function eA(t,e){var r,n,i,a,o,s,l,u=[],c=!1;return(0,m.b)(t)?(c=!0,u=t):(i=void 0===(n=(r=t||{}).x)?null:n,o=void 0===(a=r.y)?null:a,s=e.points,l=[],e.segments.forEach(function(t){var e=t.start,r=t.end;r=eS(e,r,s);var n=s[e],a=s[r];null!==o?(l.push({x:n.x,y:o}),l.push({x:a.x,y:o})):null!==i&&(l.push({x:i,y:n.y}),l.push({x:i,y:a.y}))}),u=l),u.length?new eh({points:u,options:{tension:0},_loop:c,_fullLoop:c}):null}function eE(t){return t&&!1!==t.fill}var eC=function(){function t(e){(0,a._)(this,t),this.x=e.x,this.y=e.y,this.radius=e.radius}return(0,o._)(t,[{key:"pathSegment",value:function(t,e,r){var n=this.x,i=this.y,a=this.radius;return e=e||{start:0,end:m.T},t.arc(n,i,a,e.end,e.start,!0),!r.bounds}},{key:"interpolate",value:function(t){var e=this.x,r=this.y,n=this.radius,i=t.angle;return{x:e+Math.cos(i)*n,y:r+Math.sin(i)*n,angle:i}}}]),t}();function eP(t,e,r){var n,i,a,o,s,l,u,c,h=function(t){var e,r=t.chart,n=t.fill,i=t.line;if((0,m.g)(n))return(e=r.getDatasetMeta(n))&&r.isDatasetVisible(n)?e.dataset:null;if("stack"===n)return function(t){var e=t.scale,r=t.index,n=t.line,i=[],a=n.segments,o=n.points,s=function(t,e){for(var r=[],n=t.getMatchingVisibleMetas("line"),i=0;i=r)&&i):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}(a,i,s),chart:t,axis:n.controller.options.indexAxis,scale:n.vScale,line:a}),n.$filler=o,l.push(o);for(i=0;i=0;--o){var s=i[o].$filler;s&&(s.line.updateControlPoints(a,s.axis),n&&s.fill&&eP(t.ctx,s,a))}},beforeDatasetsDraw:function(t,e,r){if("beforeDatasetsDraw"===r.drawTime)for(var n=t.getSortedVisibleDatasetMetas(),i=n.length-1;i>=0;--i){var a=n[i].$filler;eE(a)&&eP(t.ctx,a,t.chartArea)}},beforeDatasetDraw:function(t,e,r){var n=e.meta.$filler;eE(n)&&"beforeDatasetDraw"===r.drawTime&&eP(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},eI=function(t,e){var r=t.boxHeight,n=void 0===r?e:r,i=t.boxWidth,a=void 0===i?e:i;return t.usePointStyle&&(n=Math.min(n,e),a=t.pointStyleWidth||Math.min(a,e)),{boxWidth:a,boxHeight:n,itemHeight:Math.max(e,n)}},eL=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t){var n;return(0,a._)(this,r),(n=e.call(this))._added=!1,n.legendHitBoxes=[],n._hoveredItem=null,n.doughnutMode=!1,n.chart=t.chart,n.options=t.options,n.ctx=t.ctx,n.legendItems=void 0,n.columnSizes=void 0,n.lineWidths=void 0,n.maxHeight=void 0,n.maxWidth=void 0,n.top=void 0,n.bottom=void 0,n.left=void 0,n.right=void 0,n.height=void 0,n.width=void 0,n._margins=void 0,n.position=void 0,n.weight=void 0,n.fullSize=void 0,n}return(0,o._)(r,[{key:"update",value:function(t,e,r){this.maxWidth=t,this.maxHeight=e,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}},{key:"setDimensions",value:function(){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)}},{key:"buildLabels",value:function(){var t=this,e=this.options.labels||{},r=(0,m.C)(e.generateLabels,[this.chart],this)||[];e.filter&&(r=r.filter(function(r){return e.filter(r,t.chart.data)})),e.sort&&(r=r.sort(function(r,n){return e.sort(r,n,t.chart.data)})),this.options.reverse&&r.reverse(),this.legendItems=r}},{key:"fit",value:function(){var t,e,r=this.options,n=this.ctx;if(!r.display){this.width=this.height=0;return}var i=r.labels,a=(0,m.O)(i.font),o=a.size,s=this._computeTitleHeight(),l=eI(i,o),u=l.boxWidth,c=l.itemHeight;n.font=a.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(s,o,u,c)+10):(e=this.maxHeight,t=this._fitCols(s,o,u,c)+10),this.width=Math.min(t,r.maxWidth||this.maxWidth),this.height=Math.min(e,r.maxHeight||this.maxHeight)}},{key:"_fitRows",value:function(t,e,r,n){var i=this.ctx,a=this.maxWidth,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.lineWidths=[0],u=n+o,c=t;i.textAlign="left",i.textBaseline="middle";var h=-1,f=-u;return this.legendItems.forEach(function(t,d){var p=r+e/2+i.measureText(t.text).width;(0===d||l[l.length-1]+p+2*o>a)&&(c+=u,l[l.length-(d>0?0:1)]=0,f+=u,h++),s[d]={left:0,top:f,row:h,width:p,height:n},l[l.length-1]+=p+o}),c}},{key:"_fitCols",value:function(t,e,r,n){var i=this.ctx,a=this.maxHeight,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.columnSizes=[],u=a-t,c=o,h=0,f=0,d=0,p=0;return this.legendItems.forEach(function(t,a){var v=r+e/2+i.measureText(t.text).width;a>0&&f+n+2*o>u&&(c+=h+o,l.push({width:h,height:f}),d+=h+o,p++,h=f=0),s[a]={left:d,top:f,col:p,width:v,height:n},h=Math.max(h,v),f+=n+o}),c+=h,l.push({width:h,height:f}),c}},{key:"adjustHitBoxes",value:function(){if(this.options.display){var t=this._computeTitleHeight(),e=this.legendHitBoxes,r=this.options,n=r.align,i=r.labels.padding,a=r.rtl,o=(0,m.aA)(a,this.left,this.width);if(this.isHorizontal()){var s=0,l=(0,m.S)(n,this.left+i,this.right-this.lineWidths[s]),u=!0,c=!1,h=void 0;try{for(var f,d=e[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var p=f.value;s!==p.row&&(s=p.row,l=(0,m.S)(n,this.left+i,this.right-this.lineWidths[s])),p.top+=this.top+t+i,p.left=o.leftForLtr(o.x(l),p.width),l+=p.width+i}}catch(t){c=!0,h=t}finally{try{u||null==d.return||d.return()}finally{if(c)throw h}}}else{var v=0,g=(0,m.S)(n,this.top+t+i,this.bottom-this.columnSizes[v].height),y=!0,b=!1,_=void 0;try{for(var x,k=e[Symbol.iterator]();!(y=(x=k.next()).done);y=!0){var w=x.value;w.col!==v&&(v=w.col,g=(0,m.S)(n,this.top+t+i,this.bottom-this.columnSizes[v].height)),w.top=g,w.left+=this.left+i,w.left=o.leftForLtr(o.x(w.left),w.width),g+=w.height+i}}catch(t){b=!0,_=t}finally{try{y||null==k.return||k.return()}finally{if(b)throw _}}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){if(this.options.display){var t=this.ctx;(0,m.L)(t,this),this._draw(),(0,m.N)(t)}}},{key:"_draw",value:function(){var t,e=this,r=this.options,n=this.columnSizes,i=this.lineWidths,a=this.ctx,o=r.align,s=r.labels,l=m.d.color,u=(0,m.aA)(r.rtl,this.left,this.width),c=(0,m.O)(s.font),h=s.color,f=s.padding,d=c.size,p=d/2;this.drawTitle(),a.textAlign=u.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=c.string;var v=eI(s,d),g=v.boxWidth,y=v.boxHeight,b=v.itemHeight,_=function(t,e,r){if(!(isNaN(g)||g<=0||isNaN(y))&&!(y<0)){a.save();var n=(0,m.v)(r.lineWidth,1);if(a.fillStyle=(0,m.v)(r.fillStyle,l),a.lineCap=(0,m.v)(r.lineCap,"butt"),a.lineDashOffset=(0,m.v)(r.lineDashOffset,0),a.lineJoin=(0,m.v)(r.lineJoin,"miter"),a.lineWidth=n,a.strokeStyle=(0,m.v)(r.strokeStyle,l),a.setLineDash((0,m.v)(r.lineDash,[])),s.usePointStyle){var i={radius:y*Math.SQRT2/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:n},o=u.xPlus(t,g/2);(0,m.aE)(a,i,o,e+p,s.pointStyleWidth&&g)}else{var c=e+Math.max((d-y)/2,0),h=u.leftForLtr(t,g),f=(0,m.ax)(r.borderRadius);a.beginPath(),Object.values(f).some(function(t){return 0!==t})?(0,m.av)(a,{x:h,y:c,w:g,h:y,radius:f}):a.rect(h,c,g,y),a.fill(),0!==n&&a.stroke()}a.restore()}},x=function(t,e,r){(0,m.M)(a,r.text,t,e+b/2,c,{strikethrough:r.hidden,textAlign:u.textAlign(r.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();t=k?{x:(0,m.S)(o,this.left+f,this.right-i[0]),y:this.top+f+w,line:0}:{x:this.left+f,y:(0,m.S)(o,this.top+w+f,this.bottom-n[0].height),line:0},(0,m.aB)(this.ctx,r.textDirection);var M=b+f;this.legendItems.forEach(function(l,c){a.strokeStyle=l.fontColor||h,a.fillStyle=l.fontColor||h;var d=a.measureText(l.text).width,v=u.textAlign(l.textAlign||(l.textAlign=s.textAlign)),y=g+p+d,b=t.x,S=t.y;u.setWidth(e.width),k?c>0&&b+y+f>e.right&&(S=t.y+=M,t.line++,b=t.x=(0,m.S)(o,e.left+f,e.right-i[t.line])):c>0&&S+M>e.bottom&&(b=t.x=b+n[t.line].width+f,t.line++,S=t.y=(0,m.S)(o,e.top+w+f,e.bottom-n[t.line].height)),_(u.x(b),S,l),b=(0,m.aC)(v,b+g+p,k?b+y:e.right,r.rtl),x(u.x(b),S,l),k?t.x+=y+f:t.y+=M}),(0,m.aD)(this.ctx,r.textDirection)}},{key:"drawTitle",value:function(){var t,e,r=this.options,n=r.title,i=(0,m.O)(n.font),a=(0,m.K)(n.padding);if(n.display){var o=(0,m.aA)(r.rtl,this.left,this.width),s=this.ctx,l=n.position,u=i.size/2,c=a.top+u,h=this.left,f=this.width;if(this.isHorizontal())f=(e=Math).max.apply(e,(0,p._)(this.lineWidths)),t=this.top+c,h=(0,m.S)(r.align,h,this.right-f);else{var d=this.columnSizes.reduce(function(t,e){return Math.max(t,e.height)},0);t=c+(0,m.S)(r.align,this.top,this.bottom-d-r.labels.padding-this._computeTitleHeight())}var v=(0,m.S)(l,h,h+f);s.textAlign=o.textAlign((0,m.R)(l)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=i.string,(0,m.M)(s,n.text,v,t,i)}}},{key:"_computeTitleHeight",value:function(){var t=this.options.title,e=(0,m.O)(t.font),r=(0,m.K)(t.padding);return t.display?e.lineHeight+r.height:0}},{key:"_getLegendItemAt",value:function(t,e){var r,n,i;if((0,m.ak)(t,this.left,this.right)&&(0,m.ak)(e,this.top,this.bottom)){for(r=0,i=this.legendHitBoxes;r-1?t.split("\n"):t}function eK(t,e){var r=t.chart.ctx,n=t.body,i=t.footer,a=t.title,o=e.boxWidth,s=e.boxHeight,l=(0,m.O)(e.bodyFont),u=(0,m.O)(e.titleFont),c=(0,m.O)(e.footerFont),h=a.length,f=i.length,d=n.length,p=(0,m.K)(e.padding),v=p.height,g=0,y=n.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);y+=t.beforeBody.length+t.afterBody.length,h&&(v+=h*u.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),y&&(v+=d*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(y-d)*l.lineHeight+(y-1)*e.bodySpacing),f&&(v+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);var b=0,_=function(t){g=Math.max(g,r.measureText(t).width+b)};return r.save(),r.font=u.string,(0,m.Q)(t.title,_),r.font=l.string,(0,m.Q)(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?o+2+e.boxPadding:0,(0,m.Q)(n,function(t){(0,m.Q)(t.before,_),(0,m.Q)(t.lines,_),(0,m.Q)(t.after,_)}),b=0,r.font=c.string,(0,m.Q)(t.footer,_),r.restore(),{width:g+=p.width,height:v}}function eY(t,e,r){var n,i,a,o,s,l,u,c,h,f=r.yAlign||e.yAlign||((n=r.y)<(i=r.height)/2?"top":n>t.height-i/2?"bottom":"center");return{xAlign:r.xAlign||e.xAlign||(a=r.x,o=r.width,s=t.width,u=(l=t.chartArea).left,c=l.right,h="center","center"===f?h=a<=(u+c)/2?"left":"right":a<=o/2?h="left":a>=s-o/2&&(h="right"),function(t,e,r,n){var i=n.x,a=n.width,o=r.caretSize+r.caretPadding;if("left"===t&&i+a+o>e.width||"right"===t&&i-a-o<0)return!0}(h,t,e,r)&&(h="center"),h),yAlign:f}}function eX(t,e,r,n){var i,a,o,s,l=t.caretSize,u=t.caretPadding,c=t.cornerRadius,h=r.xAlign,f=r.yAlign,d=l+u,p=(0,m.ax)(c),v=p.topLeft,g=p.topRight,y=p.bottomLeft,b=p.bottomRight,_=(i=e.x,a=e.width,"right"===h?i-=a:"center"===h&&(i-=a/2),i),x=(o=e.y,s=e.height,"top"===f?o+=d:"bottom"===f?o-=s+d:o-=s/2,o);return"center"===f?"left"===h?_+=d:"right"===h&&(_-=d):"left"===h?_-=Math.max(v,y)+l:"right"===h&&(_+=Math.max(g,b)+l),{x:(0,m.E)(_,0,n.width-e.width),y:(0,m.E)(x,0,n.height-e.height)}}function eq(t,e,r){var n=(0,m.K)(r.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function e$(t,e){var r=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return r?t.override(r):t}var eQ=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t){var n;return(0,a._)(this,r),(n=e.call(this)).opacity=0,n._active=[],n._eventPosition=void 0,n._size=void 0,n._cachedAnimations=void 0,n._tooltipItems=[],n.$animations=void 0,n.$context=void 0,n.chart=t.chart||t._chart,n._chart=n.chart,n.options=t.options,n.dataPoints=void 0,n.title=void 0,n.beforeBody=void 0,n.body=void 0,n.afterBody=void 0,n.footer=void 0,n.xAlign=void 0,n.yAlign=void 0,n.x=void 0,n.y=void 0,n.height=void 0,n.width=void 0,n.caretX=void 0,n.caretY=void 0,n.labelColors=void 0,n.labelPointStyles=void 0,n.labelTextColors=void 0,n}return(0,o._)(r,[{key:"initialize",value:function(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var t=this._cachedAnimations;if(t)return t;var e=this.chart,r=this.options.setContext(this.getContext()),n=r.enabled&&e.options.animation&&r.animations,i=new M(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}},{key:"getContext",value:function(){var t,e;return this.$context||(this.$context=(t=this.chart.getContext(),e=this._tooltipItems,(0,m.h)(t,{tooltip:this,tooltipItems:e,type:"tooltip"})))}},{key:"getTitle",value:function(t,e){var r=e.callbacks,n=r.beforeTitle.apply(this,[t]),i=r.title.apply(this,[t]),a=r.afterTitle.apply(this,[t]),o=[];return o=eH(o,eU(n)),o=eH(o,eU(i)),o=eH(o,eU(a))}},{key:"getBeforeBody",value:function(t,e){return eH([],eU(e.callbacks.beforeBody.apply(this,[t])))}},{key:"getBody",value:function(t,e){var r=this,n=e.callbacks,i=[];return(0,m.Q)(t,function(t){var e={before:[],lines:[],after:[]},a=e$(n,t);eH(e.before,eU(a.beforeLabel.call(r,t))),eH(e.lines,a.label.call(r,t)),eH(e.after,eU(a.afterLabel.call(r,t))),i.push(e)}),i}},{key:"getAfterBody",value:function(t,e){return eH([],eU(e.callbacks.afterBody.apply(this,[t])))}},{key:"getFooter",value:function(t,e){var r=e.callbacks,n=r.beforeFooter.apply(this,[t]),i=r.footer.apply(this,[t]),a=r.afterFooter.apply(this,[t]),o=[];return o=eH(o,eU(n)),o=eH(o,eU(i)),o=eH(o,eU(a))}},{key:"_createItems",value:function(t){var e,r,n=this,i=this._active,a=this.chart.data,o=[],s=[],l=[],u=[];for(e=0,r=i.length;e0&&e.stroke()}},{key:"_updateAnimationTarget",value:function(t){var e=this.chart,r=this.$animations,n=r&&r.x,i=r&&r.y;if(n||i){var a=eW[t.position].call(this,this._active,this._eventPosition);if(!a)return;var o=this._size=eK(this,t),s=Object.assign({},a,this._size),l=eY(e,t,s),u=eX(t,s,l,e);(n._to!==u.x||i._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}},{key:"_willRender",value:function(){return!!this.opacity}},{key:"draw",value:function(t){var e=this.options.setContext(this.getContext()),r=this.opacity;if(r){this._updateAnimationTarget(e);var n={width:this.width,height:this.height},i={x:this.x,y:this.y};r=.001>Math.abs(r)?0:r;var a=(0,m.K)(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,n,e),(0,m.aB)(t,e.textDirection),i.y+=a.top,this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),(0,m.aD)(t,e.textDirection),t.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t,e){var r=this,n=this._active,i=t.map(function(t){var e=t.datasetIndex,n=t.index,i=r.chart.getDatasetMeta(e);if(!i)throw Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:i.data[n],index:n}}),a=!(0,m.ai)(n,i),o=this._positionChanged(i,e);(a||o)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}},{key:"handleEvent",value:function(t,e){var r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var n=this.options,i=this._active||[],a=this._getActiveElements(t,i,e,r),o=this._positionChanged(a,t),s=e||!(0,m.ai)(a,i)||o;return s&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}},{key:"_getActiveElements",value:function(t,e,r,n){var i=this.options;if("mouseout"===t.type)return[];if(!n)return e;var a=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&a.reverse(),a}},{key:"_positionChanged",value:function(t,e){var r=this.caretX,n=this.caretY,i=eW[this.options.position].call(this,t,e);return!1!==i&&(r!==i.x||n!==i.y)}}]),r}((0,g._)(q));eQ.positioners=eW;var eG={id:"tooltip",_element:eQ,positioners:eW,afterInit:function(t,e,r){r&&(t.tooltip=new eQ({chart:t,options:r}))},beforeUpdate:function(t,e,r){t.tooltip&&t.tooltip.initialize(r)},reset:function(t,e,r){t.tooltip&&t.tooltip.initialize(r)},afterDraw:function(t){var e=t.tooltip;if(e&&e._willRender()){var r={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",r))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",r)}},afterEvent:function(t,e){if(t.tooltip){var r=e.replay;t.tooltip.handleEvent(e.event,r,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(t,e){return e.bodyFont.size},boxWidth:function(t,e){return e.bodyFont.size},multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:m.aF,title:function(t){if(t.length>0){var e=t[0],r=e.chart.data.labels,n=r?r.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex=0&&te.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getValueForPixel",value:function(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),r}(tr);function e0(t,e,r){var n=r.horizontal,i=r.minRotation,a=(0,m.t)(i),o=.75*e*(""+t).length;return Math.min(e/((n?Math.sin(a):Math.cos(a))||.001),o)}eZ.id="category",eZ.defaults={ticks:{callback:eZ.prototype.getLabelForValue}};var e1=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t){var n;return(0,a._)(this,r),(n=e.call(this,t)).start=void 0,n.end=void 0,n._startValue=void 0,n._endValue=void 0,n._valueRange=0,n}return(0,o._)(r,[{key:"parse",value:function(t,e){return(0,m.k)(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}},{key:"handleTickRangeOptions",value:function(){var t=this.options.beginAtZero,e=this.getUserBounds(),r=e.minDefined,n=e.maxDefined,i=this.min,a=this.max,o=function(t){return i=r?i:t},s=function(t){return a=n?a:t};if(t){var l=(0,m.s)(i),u=(0,m.s)(a);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(i===a){var c=1;(a>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(c=Math.abs(.05*a)),s(a+c),t||o(i-c)}this.min=i,this.max=a}},{key:"getTickLimit",value:function(){var t,e=this.options.ticks,r=e.maxTicksLimit,n=e.stepSize;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1)>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(n," would result generating up to ").concat(t," ticks. Limiting to 1000.")),t=1e3):(t=this.computeTickLimit(),r=r||11),r&&(t=Math.min(r,t)),t}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var t=this.options,e=t.ticks,r=this.getTickLimit(),n=function(t,e){var r,n,i,a,o=[],s=t.bounds,l=t.step,u=t.min,c=t.max,h=t.precision,f=t.count,d=t.maxTicks,p=t.maxDigits,v=t.includeBounds,g=l||1,y=d-1,b=e.min,_=e.max,x=!(0,m.k)(u),k=!(0,m.k)(c),w=!(0,m.k)(f),M=(_-b)/(p+1),S=(0,m.aI)((_-b)/y/g)*g;if(S<1e-14&&!x&&!k)return[{value:b},{value:_}];(a=Math.ceil(_/S)-Math.floor(b/S))>y&&(S=(0,m.aI)(a*S/y/g)*g),(0,m.k)(h)||(S=Math.ceil(S*(r=Math.pow(10,h)))/r),"ticks"===s?(n=Math.floor(b/S)*S,i=Math.ceil(_/S)*S):(n=b,i=_),x&&k&&l&&(0,m.aJ)((c-u)/l,S/1e3)?(a=Math.round(Math.min((c-u)/S,d)),S=(c-u)/a,n=u,i=c):w?(n=x?u:n,S=((i=k?c:i)-n)/(a=f-1)):(a=(i-n)/S,a=(0,m.aK)(a,Math.round(a),S/1e3)?Math.round(a):Math.ceil(a));var O=Math.max((0,m.aL)(S),(0,m.aL)(n));n=Math.round(n*(r=Math.pow(10,(0,m.k)(h)?O:h)))/r,i=Math.round(i*r)/r;var A=0;for(x&&(v&&n!==u?(o.push({value:u}),n0?r:null}},{key:"determineDataLimits",value:function(){var t=this.getMinMax(!0),e=t.min,r=t.max;this.min=(0,m.g)(e)?Math.max(0,e):null,this.max=(0,m.g)(r)?Math.max(0,r):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var t=this.getUserBounds(),e=t.minDefined,r=t.maxDefined,n=this.min,i=this.max,a=function(t){return n=e?n:t},o=function(t){return i=r?i:t},s=function(t,e){return Math.pow(10,Math.floor((0,m.z)(t))+e)};n===i&&(n<=0?(a(1),o(10)):(a(s(n,-1)),o(s(i,1)))),n<=0&&a(s(i,-1)),i<=0&&o(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&a(s(n,-1)),this.min=n,this.max=i}},{key:"buildTicks",value:function(){var t=this.options,e=function(t,e){var r=Math.floor((0,m.z)(e.max)),n=Math.ceil(e.max/Math.pow(10,r)),i=[],a=(0,m.B)(t.min,Math.pow(10,Math.floor((0,m.z)(e.min)))),o=Math.floor((0,m.z)(a)),s=Math.floor(a/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do i.push({value:a,major:e5(a)}),10==++s&&(s=1,l=++o>=0?1:l),a=Math.round(s*Math.pow(10,o)*l)/l;while(oi?{start:e-r,end:e}:{start:e,end:e+r}}function e4(t,e,r,n){var i=t.ctx;if(r)i.arc(t.xCenter,t.yCenter,e,0,m.T);else{var a=t.getPointPosition(0,e);i.moveTo(a.x,a.y);for(var o=1;oe.r&&(s=(n.end-e.r)/a,t.r=Math.max(t.r,e.r+s)),i.starte.b&&(l=(i.end-e.b)/o,t.b=Math.max(t.b,e.b+l))})(r,e,v,e8(g,f.x,p.w,0,180),e8(g,f.y,p.h,90,270))}t.setCenterPoint(e.l-r.l,r.r-e.r,e.t-r.t,r.b-e.b),t._pointLabelItems=function(t,e,r){for(var n=[],i=t._pointLabels.length,a=t.options,o=e6(a)/2,s=t.drawingArea,l=a.pointLabels.centerPointLabels?m.P/i:0,u=0;u270||v<90)&&(c-=h),c),b=0===v||180===v?"center":v<180?"left":"right",_=(f=p.x,d=g.w,"right"===b?f-=d:"center"===b&&(f-=d/2),f);n.push({x:p.x,y:y,textAlign:b,left:_,top:y,right:_+g.w,bottom:y+g.h})}return n}(t,n,i)}(this):this.setCenterPoint(0,0,0,0)}},{key:"setCenterPoint",value:function(t,e,r,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((r-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,r,n))}},{key:"getIndexAngle",value:function(t){var e=m.T/(this._pointLabels.length||1),r=this.options.startAngle||0;return(0,m.az)(t*e+(0,m.t)(r))}},{key:"getDistanceFromCenterForValue",value:function(t){if((0,m.k)(t))return NaN;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}},{key:"getValueForDistanceFromCenter",value:function(t){if((0,m.k)(t))return NaN;var e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}},{key:"getPointLabelContext",value:function(t){var e=this._pointLabels||[];if(t>=0&&t2&&void 0!==arguments[2]?arguments[2]:0,n=this.getIndexAngle(t)-m.H+r;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}},{key:"getPointPositionForValue",value:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}},{key:"getBasePosition",value:function(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}},{key:"getPointLabelPosition",value:function(t){var e=this._pointLabelItems[t];return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}},{key:"drawBackground",value:function(){var t=this.options,e=t.backgroundColor,r=t.grid.circular;if(e){var n=this.ctx;n.save(),n.beginPath(),e4(this,this.getDistanceFromCenterForValue(this._endValue),r,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}},{key:"drawGrid",value:function(){var t,e,r,n=this,i=this.ctx,a=this.options,o=a.angleLines,s=a.grid,l=this._pointLabels.length;if(a.pointLabels.display&&function(t,e){for(var r=t.ctx,n=t.options.pointLabels,i=e-1;i>=0;i--){var a=n.setContext(t.getPointLabelContext(i)),o=(0,m.O)(a.font),s=t._pointLabelItems[i],l=s.x,u=s.y,c=s.textAlign,h=s.left,f=s.top,d=s.right,p=s.bottom,v=a.backdropColor;if(!(0,m.k)(v)){var g=(0,m.ax)(a.borderRadius),y=(0,m.K)(a.backdropPadding);r.fillStyle=v;var b=h-y.left,_=f-y.top,x=d-h+y.width,k=p-f+y.height;Object.values(g).some(function(t){return 0!==t})?(r.beginPath(),(0,m.av)(r,{x:b,y:_,w:x,h:k,radius:g}),r.fill()):r.fillRect(b,_,x,k)}(0,m.M)(r,t._pointLabels[i],l,u+o.lineHeight/2,o,{color:a.color,textAlign:c,textBaseline:"middle"})}}(this,l),s.display&&this.ticks.forEach(function(t,r){if(0!==r){e=n.getDistanceFromCenterForValue(t.value);var i,a,o,u,c,h=s.setContext(n.getContext(r-1));i=e,a=n.ctx,o=h.circular,u=h.color,c=h.lineWidth,(o||l)&&u&&c&&!(i<0)&&(a.save(),a.strokeStyle=u,a.lineWidth=c,a.setLineDash(h.borderDash),a.lineDashOffset=h.borderDashOffset,a.beginPath(),e4(n,i,o,l),a.closePath(),a.stroke(),a.restore())}}),o.display){for(i.save(),t=l-1;t>=0;t--){var u=o.setContext(this.getPointLabelContext(t)),c=u.color,h=u.lineWidth;h&&c&&(i.lineWidth=h,i.strokeStyle=c,i.setLineDash(u.borderDash),i.lineDashOffset=u.borderDashOffset,e=this.getDistanceFromCenterForValue(a.ticks.reverse?this.min:this.max),r=this.getPointPosition(t,e),i.beginPath(),i.moveTo(this.xCenter,this.yCenter),i.lineTo(r.x,r.y),i.stroke())}i.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var t,e,r=this,n=this.ctx,i=this.options,a=i.ticks;if(a.display){var o=this.getIndexAngle(0);n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(o),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach(function(o,s){if(0!==s||i.reverse){var l=a.setContext(r.getContext(s)),u=(0,m.O)(l.font);if(t=r.getDistanceFromCenterForValue(r.ticks[s].value),l.showLabelBackdrop){n.font=u.string,e=n.measureText(o.label).width,n.fillStyle=l.backdropColor;var c=(0,m.K)(l.backdropPadding);n.fillRect(-e/2-c.left,-t-u.size/2-c.top,e+c.width,u.size+c.height)}(0,m.M)(n,o.label,0,-t,u,{color:l.color})}}),n.restore()}}},{key:"drawTitle",value:function(){}}]),r}(e1);e7.id="radialLinear",e7.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Q.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(t){return t},padding:5,centerPointLabels:!1}},e7.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},e7.descriptors={angleLines:{_fallback:"grid"}};var e9={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}},rt=Object.keys(e9);function re(t,e){return t-e}function rr(t,e){if((0,m.k)(e))return null;var r=t._adapter,n=t._parseOpts,i=n.parser,a=n.round,o=n.isoWeekday,s=e;return("function"==typeof i&&(s=i(s)),(0,m.g)(s)||(s="string"==typeof i?r.parse(s,i):r.parse(s)),null===s)?null:(a&&(s="week"===a&&((0,m.x)(o)||!0===o)?r.startOf(s,"isoWeek",o):r.startOf(s,a)),+s)}function rn(t,e,r,n){for(var i=rt.length,a=rt.indexOf(t);a=e?r[i]:r[a]]=!0}}else t[e]=!0}function ra(t,e,r){var n,i,a=[],o={},s=e.length;for(n=0;n=0&&(e[a].major=!0);return e}(t,a,o,r):a}var ro=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t){var n;return(0,a._)(this,r),(n=e.call(this,t))._cache={data:[],labels:[],all:[]},n._unit="day",n._majorUnit=void 0,n._offsets={},n._normalized=!1,n._parseOpts=void 0,n}return(0,o._)(r,[{key:"init",value:function(t,e){var n=t.time||(t.time={}),i=this._adapter=new tu._date(t.adapters.date);i.init(e),(0,m.ac)(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},(0,l._)((0,u._)(r.prototype),"init",this).call(this,t),this._normalized=e.normalized}},{key:"parse",value:function(t,e){return void 0===t?null:rr(this,t)}},{key:"beforeLayout",value:function(){(0,l._)((0,u._)(r.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var t=this.options,e=this._adapter,r=t.time.unit||"day",n=this.getUserBounds(),i=n.min,a=n.max,o=n.minDefined,s=n.maxDefined;function l(t){o||isNaN(t.min)||(i=Math.min(i,t.min)),s||isNaN(t.max)||(a=Math.max(a,t.max))}o&&s||(l(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&l(this.getMinMax(!1))),i=(0,m.g)(i)&&!isNaN(i)?i:+e.startOf(Date.now(),r),a=(0,m.g)(a)&&!isNaN(a)?a:+e.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}},{key:"_getLabelBounds",value:function(){var t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],r=t[t.length-1]),{min:e,max:r}}},{key:"buildTicks",value:function(){var t=this.options,e=t.time,r=t.ticks,n="labels"===r.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);var i=this.min,a=this.max,o=(0,m.aN)(n,i,a);return this._unit=e.unit||(r.autoSkip?rn(e.minUnit,this.min,this.max,this._getLabelCapacity(i)):function(t,e,r,n,i){for(var a=rt.length-1;a>=rt.indexOf(r);a--){var o=rt[a];if(e9[o].common&&t._adapter.diff(i,n,o)>=e-1)return o}return rt[r?rt.indexOf(r):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=r.major.enabled&&"year"!==this._unit?function(t){for(var e=rt.indexOf(t)+1,r=rt.length;e1e5*l)throw Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+s);var d="data"===a.ticks.source&&this.getDataTimestamps();for(t=f,e=0;t0?o:1}},{key:"getDataTimestamps",value:function(){var t,e,r=this._cache.data||[];if(r.length)return r;var n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[d].pos&&e<=t[p].pos&&(d=(s=(0,m.Z)(t,"pos",e)).lo,p=s.hi),n=(l=t[d]).pos,a=l.time,i=(u=t[p]).pos,o=u.time):(e>=t[d].time&&e<=t[p].time&&(d=(c=(0,m.Z)(t,"time",e)).lo,p=c.hi),n=(h=t[d]).time,a=h.pos,i=(f=t[p]).time,o=f.pos);var v=i-n;return v?a+(o-a)*(e-n)/v:a}ro.id="time",ro.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var rl=function(t){(0,c._)(r,t);var e=(0,y._)(r);function r(t){var n;return(0,a._)(this,r),(n=e.call(this,t))._table=[],n._minPos=void 0,n._tableRange=void 0,n}return(0,o._)(r,[{key:"initOffsets",value:function(){var t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=rs(e,this.min),this._tableRange=rs(e,this.max)-this._minPos,(0,l._)((0,u._)(r.prototype),"initOffsets",this).call(this,t)}},{key:"buildLookupTable",value:function(t){var e,r,n,i=this.min,a=this.max,o=[],s=[];for(e=0,r=t.length;e=i&&n<=a&&o.push(n);if(o.length<2)return[{time:i,pos:0},{time:a,pos:1}];for(e=0,r=o.length;e")+"->"+t);return s.add(t),e=e(a,o||n),s.delete(t),eD(t,e)&&(e=eT(i._scopes,i,t,e)),e}(r,l,e,n)),p(l)&&l.length&&(l=function(e,r,n,i){var a=n._proxy,o=n._context,s=n._subProxy,l=n._descriptors;if(I(o.index)&&i(e))r=r[o.index%r.length];else if(v(r[0])){var u=r,c=a._scopes.filter(function(t){return t!==u});r=[];var h=!0,f=!1,d=void 0;try{for(var p,g=u[Symbol.iterator]();!(h=(p=g.next()).done);h=!0){var y=p.value,m=eT(c,a,e,y);r.push(t(m,o,s&&s[e],l))}}catch(t){f=!0,d=t}finally{try{h||null==g.return||g.return()}finally{if(f)throw d}}}return r}(r,l,e,s.isIndexable)),eD(r,l)&&(l=t(l,a,o&&o[r],s)),l})},getOwnPropertyDescriptor:function(t,r){return t._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e)},has:function(t,r){return Reflect.has(e,r)},ownKeys:function(){return Reflect.ownKeys(e)},set:function(t,r,n){return e[r]=n,delete t[r],!0}})}}),a.export(r,"aA",function(){return e9}),a.export(r,"aB",function(){return rt}),a.export(r,"aC",function(){return tO}),a.export(r,"aD",function(){return re}),a.export(r,"aE",function(){return ec}),a.export(r,"aF",function(){return h}),a.export(r,"aG",function(){return ta}),a.export(r,"aH",function(){return tt}),a.export(r,"aI",function(){return $}),a.export(r,"aJ",function(){return Z}),a.export(r,"aK",function(){return J}),a.export(r,"aL",function(){return tn}),a.export(r,"aM",function(){return eo}),a.export(r,"aN",function(){return tv}),a.export(r,"aO",function(){return tf}),a.export(r,"aP",function(){return t8}),a.export(r,"aQ",function(){return t7}),a.export(r,"aR",function(){return M}),a.export(r,"aS",function(){return O}),a.export(r,"aT",function(){return C}),a.export(r,"aU",function(){return P}),a.export(r,"aV",function(){return T}),a.export(r,"aW",function(){return ei}),a.export(r,"aX",function(){return ez}),a.export(r,"aY",function(){return eW}),a.export(r,"aZ",function(){return e$}),a.export(r,"a_",function(){return t_}),a.export(r,"aa",function(){return eC}),a.export(r,"ab",function(){return eP}),a.export(r,"ac",function(){return E}),a.export(r,"ad",function(){return f}),a.export(r,"ae",function(){return tw}),a.export(r,"af",function(){return e1}),a.export(r,"ag",function(){return el}),a.export(r,"ah",function(){return R}),a.export(r,"ai",function(){return w}),a.export(r,"aj",function(){return B}),a.export(r,"ak",function(){return th}),a.export(r,"al",function(){return ex}),a.export(r,"am",function(){return eU}),a.export(r,"an",function(){return ro}),a.export(r,"ao",function(){return ra}),a.export(r,"ap",function(){return e6}),a.export(r,"aq",function(){return e8}),a.export(r,"ar",function(){return e3}),a.export(r,"as",function(){return ep}),a.export(r,"at",function(){return ev}),a.export(r,"au",function(){return eu}),a.export(r,"av",function(){return ey}),a.export(r,"aw",function(){return ek}),a.export(r,"ax",function(){return ew}),a.export(r,"ay",function(){return ri}),a.export(r,"az",function(){return ts}),a.export(r,"b",function(){return p}),a.export(r,"b0",function(){return z}),a.export(r,"b1",function(){return W}),a.export(r,"b2",function(){return H}),a.export(r,"b3",function(){return K}),a.export(r,"b4",function(){return Y}),a.export(r,"b5",function(){return to}),a.export(r,"c",function(){return t4}),a.export(r,"d",function(){return en}),a.export(r,"e",function(){return tj}),a.export(r,"f",function(){return j}),a.export(r,"g",function(){return g}),a.export(r,"h",function(){return eE}),a.export(r,"i",function(){return v}),a.export(r,"j",function(){return I}),a.export(r,"k",function(){return d}),a.export(r,"l",function(){return ty}),a.export(r,"m",function(){return b}),a.export(r,"n",function(){return _}),a.export(r,"o",function(){return e7}),a.export(r,"p",function(){return tl}),a.export(r,"q",function(){return tA}),a.export(r,"r",function(){return tx}),a.export(r,"s",function(){return q}),a.export(r,"t",function(){return te}),a.export(r,"u",function(){return tm}),a.export(r,"v",function(){return m}),a.export(r,"w",function(){return tE}),a.export(r,"x",function(){return G}),a.export(r,"y",function(){return eR}),a.export(r,"z",function(){return X});var o=t("@swc/helpers/_/_class_call_check"),s=t("@swc/helpers/_/_create_class"),l=t("@swc/helpers/_/_define_property"),u=t("@swc/helpers/_/_to_consumable_array"),c=t("@swc/helpers/_/_type_of");function h(){}var f=(n=0,function(){return n++});function d(t){return null==t}function p(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function v(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}var g=function(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)};function y(t,e){return g(t)?t:e}function m(t,e){return void 0===t?e:t}var b=function(t,e){return"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e},_=function(t,e){return"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t};function x(t,e,r){if(t&&"function"==typeof t.call)return t.apply(r,e)}function k(t,e,r,n){var i,a,o;if(p(t)){if(a=t.length,n)for(i=a-1;i>=0;i--)e.call(r,t[i],i);else for(i=0;i=t}function tt(t,e,r){var n,i,a;for(n=0,i=t.length;nl&&u3&&void 0!==arguments[3]?arguments[3]:1e-6;return t>=Math.min(e,r)-n&&t<=Math.max(e,r)+n}function tf(t,e,r){r=r||function(r){return t[r]1;)r(n=a+i>>1)?a=n:i=n;return{lo:a,hi:i}}var td=function(t,e,r,n){return tf(t,r,n?function(n){return t[n][e]<=r}:function(n){return t[n][e]=r})};function tv(t,e,r){for(var n=0,i=t.length;nn&&t[i-1]>r;)i--;return n>0||i0||(tg.forEach(function(e){delete t[e]}),delete t._chartjs)}}function tb(t){var e,r,n=new Set;for(e=0,r=t.length;e=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){return tC(t)?t:tP(t,.075,.3)},easeOutElastic:function(t){return tC(t)?t:tD(t,.075,.3)},easeInOutElastic:function(t){return tC(t)?t:t<.5?.5*tP(2*t,.1125,.45):.5+.5*tD(2*t-1,.1125,.45)},easeInBack:function(t){return t*t*(2.70158*t-1.70158)},easeOutBack:function(t){return(t-=1)*t*(2.70158*t+1.70158)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*(((e*=1.525)+1)*t-e)*.5:.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-tj.easeOutBounce(1-t)},easeOutBounce:function(t){return t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*tj.easeInBounce(2*t):.5*tj.easeOutBounce(2*t-1)+.5}};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License */function tT(t){return t+.5|0}var tF=function(t,e,r){return Math.max(Math.min(t,r),e)};function tI(t){return tF(tT(2.55*t),0,255)}function tL(t){return tF(tT(255*t),0,255)}function tR(t){return tF(tT(t/2.55)/100,0,1)}function tB(t){return tF(tT(100*t),0,100)}var tN={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},tV=Array.from("0123456789ABCDEF"),tz=function(t){return tV[15&t]},tW=function(t){return tV[(240&t)>>4]+tV[15&t]},tH=function(t){return(240&t)>>4==(15&t)},tU=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function tK(t,e,r){var n=e*Math.min(r,1-r),i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+t/30)%12;return r-n*Math.max(Math.min(i-3,9-i,1),-1)};return[i(0),i(8),i(4)]}function tY(t,e,r){var n=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(n+t/60)%6;return r-r*e*Math.max(Math.min(i,4-i,1),0)};return[n(5),n(3),n(1)]}function tX(t,e,r){var n,i=tK(t,1,.5);for(e+r>1&&(n=1/(e+r),e*=n,r*=n),n=0;n<3;n++)i[n]*=1-e-r,i[n]+=e;return i}function tq(t){var e,r,n,i=t.r/255,a=t.g/255,o=t.b/255,s=Math.max(i,a,o),l=Math.min(i,a,o),u=(s+l)/2;return s!==l&&(n=s-l,r=u>.5?n/(2-s-l):n/(s+l),e=60*(e=i===s?(a-o)/n+(a=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=tL(t[3]))):(e=t5(t,{r:0,g:0,b:0,a:1})).a=tL(e.a),e}var t6=function(){function t(e){if((0,o._)(this,t),e instanceof t)return e;var r,n,a,s,l=void 0===e?"undefined":(0,c._)(e);"object"===l?s=t3(e):"string"===l&&(n=e.length,"#"===e[0]&&(4===n||5===n?r={r:255&17*tN[e[1]],g:255&17*tN[e[2]],b:255&17*tN[e[3]],a:5===n?17*tN[e[4]]:255}:(7===n||9===n)&&(r={r:tN[e[1]]<<4|tN[e[2]],g:tN[e[3]]<<4|tN[e[4]],b:tN[e[5]]<<4|tN[e[6]],a:9===n?tN[e[7]]<<4|tN[e[8]]:255})),s=r||(i||((i=function(){var t,e,r,n,i,a={},o=Object.keys(tJ),s=Object.keys(tG);for(t=0;t>16&255,r>>8&255,255&r]}return a}()).transparent=[0,0,0,0]),(a=i[e.toLowerCase()])&&{r:a[0],g:a[1],b:a[2],a:4===a.length?a[3]:255})||("r"===e.charAt(0)?function(t){var e,r,n,i=tZ.exec(t),a=255;if(i){if(i[7]!==e){var o=+i[7];a=i[8]?tI(o):tF(255*o,0,255)}return e=+i[1],r=+i[3],n=+i[5],{r:e=255&(i[2]?tI(e):tF(e,0,255)),g:r=255&(i[4]?tI(r):tF(r,0,255)),b:n=255&(i[6]?tI(n):tF(n,0,255)),a:a}}}(e):function(t){var e,r=tU.exec(t),n=255;if(r){r[5]!==e&&(n=r[6]?tI(+r[5]):tL(+r[5]));var i=tQ(+r[2]),a=+r[3]/100,o=+r[4]/100;return{r:(e="hwb"===r[1]?t$(tX,i,a,o):"hsv"===r[1]?t$(tY,i,a,o):t$(tK,i,a,o))[0],g:e[1],b:e[2],a:n}}}(e))),this._rgb=s,this._valid=!!s}return(0,s._)(t,[{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var t=t5(this._rgb);return t&&(t.a=tR(t.a)),t},set:function(t){this._rgb=t3(t)}},{key:"rgbString",value:function(){var t;return this._valid?(t=this._rgb)&&(t.a<255?"rgba(".concat(t.r,", ").concat(t.g,", ").concat(t.b,", ").concat(tR(t.a),")"):"rgb(".concat(t.r,", ").concat(t.g,", ").concat(t.b,")")):void 0}},{key:"hexString",value:function(){var t,e,r,n;return this._valid?(r=tH((e=t=this._rgb).r)&&tH(e.g)&&tH(e.b)&&tH(e.a)?tz:tW,t?"#"+r(t.r)+r(t.g)+r(t.b)+((n=t.a)<255?r(n):""):void 0):void 0}},{key:"hslString",value:function(){return this._valid?function(t){if(t){var e=tq(t),r=e[0],n=tB(e[1]),i=tB(e[2]);return t.a<255?"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(tR(t.a),")"):"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)")}}(this._rgb):void 0}},{key:"mix",value:function(t,e){if(t){var r,n=this.rgb,i=t.rgb,a=e===r?.5:e,o=2*a-1,s=n.a-i.a,l=((o*s==-1?o:(o+s)/(1+o*s))+1)/2;r=1-l,n.r=255&l*n.r+r*i.r+.5,n.g=255&l*n.g+r*i.g+.5,n.b=255&l*n.b+r*i.b+.5,n.a=a*n.a+(1-a)*i.a,this.rgb=n}return this}},{key:"interpolate",value:function(t,e){if(t){var r,n,i,a,o;this._rgb=(r=this._rgb,n=t._rgb,i=t1(tR(r.r)),a=t1(tR(r.g)),o=t1(tR(r.b)),{r:tL(t0(i+e*(t1(tR(n.r))-i))),g:tL(t0(a+e*(t1(tR(n.g))-a))),b:tL(t0(o+e*(t1(tR(n.b))-o))),a:r.a+e*(n.a-r.a)})}return this}},{key:"clone",value:function(){return new t(this.rgb)}},{key:"alpha",value:function(t){return this._rgb.a=tL(t),this}},{key:"clearer",value:function(t){var e=this._rgb;return e.a*=1-t,this}},{key:"greyscale",value:function(){var t=this._rgb,e=tT(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}},{key:"opaquer",value:function(t){var e=this._rgb;return e.a*=1+t,this}},{key:"negate",value:function(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}},{key:"lighten",value:function(t){return t2(this._rgb,2,t),this}},{key:"darken",value:function(t){return t2(this._rgb,2,-t),this}},{key:"saturate",value:function(t){return t2(this._rgb,1,t),this}},{key:"desaturate",value:function(t){return t2(this._rgb,1,-t),this}},{key:"rotate",value:function(t){var e,r;return(r=tq(e=this._rgb))[0]=tQ(r[0]+t),r=t$(tK,r,void 0,void 0),e.r=r[0],e.g=r[1],e.b=r[2],this}}]),t}();function t8(t){if(t&&"object"==typeof t){var e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function t4(t){return t8(t)?t:new t6(t)}function t7(t){return t8(t)?t:new t6(t).saturate(.5).darken(.1).hexString()}var t9=Object.create(null),et=Object.create(null);function ee(t,e){if(!e)return t;for(var r=e.split("."),n=0,i=r.length;nn&&(n=a),n}function eo(t,e,r,n){var i,a,o,s,l,u=(n=n||{}).data=n.data||{},c=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(u=n.data={},c=n.garbageCollect=[],n.font=e),t.save(),t.font=e;var h=0,f=r.length;for(i=0;ir.length){for(i=0;i0&&t.stroke()}}function eh(t,e,r){return r=r||.5,!e||t&&t.x>e.left-r&&t.xe.top-r&&t.y5&&void 0!==arguments[5]?arguments[5]:{},l=p(e)?e:[e],u=s.strokeWidth>0&&""!==s.strokeColor;for(t.save(),t.font=i.string,s.translation&&t.translate(s.translation[0],s.translation[1]),d(s.rotation)||t.rotate(s.rotation),s.color&&(t.fillStyle=s.color),s.textAlign&&(t.textAlign=s.textAlign),s.textBaseline&&(t.textBaseline=s.textBaseline),a=0;a1&&void 0!==arguments[1]?arguments[1]:[""],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return t[0]};return I(i)||(i=eI("_fallback",t)),new Proxy((e={},(0,l._)(e,Symbol.toStringTag,"Object"),(0,l._)(e,"_cacheable",!0),(0,l._)(e,"_scopes",t),(0,l._)(e,"_rootScopes",n),(0,l._)(e,"_fallback",i),(0,l._)(e,"_getTarget",a),(0,l._)(e,"override",function(e){return eC([e].concat((0,u._)(t)),r,n,i)}),e),{deleteProperty:function(e,r){return delete e[r],delete e._keys,delete t[0][r],!0},get:function(e,n){return ej(e,n,function(){return function(t,e,r,n){var i=!0,a=!1,o=void 0;try{for(var s,l,u=e[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;if(s=eI(c?c+F(t):t,r),I(s))return eD(t,s)?eT(r,n,t,s):s}}catch(t){a=!0,o=t}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}(n,r,t,e)})},getOwnPropertyDescriptor:function(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t[0])},has:function(t,e){return eL(t).includes(e)},ownKeys:function(t){return eL(t)},set:function(t,e,r){var n=t._storage||(t._storage=a());return t[e]=n[e]=r,delete t._keys,!0}})}function eP(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},r=t._scriptable,n=void 0===r?e.scriptable:r,i=t._indexable,a=void 0===i?e.indexable:i,o=t._allKeys;return{allKeys:void 0===o?e.allKeys:o,scriptable:n,indexable:a,isScriptable:L(n)?n:function(){return n},isIndexable:L(a)?a:function(){return a}}}var eD=function(t,e){return v(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object)};function ej(t,e,r){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];var n=r();return t[e]=n,n}function eT(t,e,r,n){var i,a=e._rootScopes,o=L(i=e._fallback)?i(r,n):i,s=(0,u._)(t).concat((0,u._)(a)),l=new Set;l.add(n);var c=eF(l,s,r,o||r,n);return!(null===c||I(o)&&o!==r&&null===(c=eF(l,s,o,c,n)))&&eC(Array.from(l),[""],a,o,function(){var t,i;return r in(t=e._getTarget())||(t[r]={}),p(i=t[r])&&v(n)?n:i})}function eF(t,e,r,n,i){for(;r;)r=function(t,e,r,n,i){var a=!0,o=!1,s=void 0;try{for(var l,u=e[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,h=!0===r?c:"string"==typeof r?j(c,r):void 0;if(h){t.add(h);var f,d=(f=h._fallback,L(f)?f(r,i):f);if(I(d)&&d!==r&&d!==n)return d}else if(!1===h&&I(n)&&r!==n)return null}}catch(t){o=!0,s=t}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return!1}(t,e,r,n,i);return r}function eI(t,e){var r=!0,n=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(s){var l=s[t];if(I(l))return l}}}catch(t){n=!0,i=t}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}function eL(t){var e=t._keys;return e||(e=t._keys=function(t){var e=new Set,r=!0,n=!1,i=void 0,a=!0,o=!1,s=void 0;try{for(var l,u=t[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;try{for(var h,f=Object.keys(c).filter(function(t){return!t.startsWith("_")})[Symbol.iterator]();!(r=(h=f.next()).done);r=!0){var d=h.value;e.add(d)}}catch(t){n=!0,i=t}finally{try{r||null==f.return||f.return()}finally{if(n)throw i}}}}catch(t){o=!0,s=t}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return Array.from(e)}(t._scopes)),e}function eR(t,e,r,n){var i,a,o,s=t.iScale,l=this._parsing.key,u=void 0===l?"r":l,c=Array(n);for(i=0;i1&&void 0!==arguments[1]?arguments[1]:"x",a=eV(i),o=t.length,s=Array(o).fill(0),l=Array(o),u=eN(t,0);for(e=0;e2&&void 0!==arguments[2]?arguments[2]:"x",o=eV(a),s=t.length,l=eN(t,0),u=0;u0||l>0)&&(!r||!r.shadowRoot))n=s,i=l;else{var c=e.getBoundingClientRect();n=o.clientX-c.left,i=o.clientY-c.top,u=!0}return{x:n,y:i,box:u}}(t,r),u=l.x,c=l.y,h=l.box,f=o.left+(h&&s.left),d=o.top+(h&&s.top),p=e.width,v=e.height;return a&&(p-=o.width+s.width,v-=o.height+s.height),{x:Math.round((u-f)/p*r.width/n),y:Math.round((c-d)/v*r.height/n)}}var eZ=function(t){return Math.round(10*t)/10};function e0(t,e,r,n){var i=eq(t),a=eG(i,"margin"),o=eX(i.maxWidth,t,"clientWidth")||W,s=eX(i.maxHeight,t,"clientHeight")||W,l=function(t,e,r){var n,i;if(void 0===e||void 0===r){var a=eY(t);if(a){var o=a.getBoundingClientRect(),s=eq(a),l=eG(s,"border","width"),u=eG(s,"padding");e=o.width-u.width-l.width,r=o.height-u.height-l.height,n=eX(s.maxWidth,a,"clientWidth"),i=eX(s.maxHeight,a,"clientHeight")}else e=t.clientWidth,r=t.clientHeight}return{width:e,height:r,maxWidth:n||W,maxHeight:i||W}}(t,e,r),u=l.width,c=l.height;if("content-box"===i.boxSizing){var h=eG(i,"border","width"),f=eG(i,"padding");u-=f.width+h.width,c-=f.height+h.height}return u=Math.max(0,u-a.width),c=Math.max(0,n?Math.floor(u/n):c-a.height),u=eZ(Math.min(u,o,l.maxWidth)),c=eZ(Math.min(c,s,l.maxHeight)),u&&!c&&(c=eZ(u/2)),{width:u,height:c}}function e1(t,e,r){var n=e||1,i=Math.floor(t.height*n),a=Math.floor(t.width*n);t.height=i/n,t.width=a/n;var o=t.canvas;return o.style&&(r||!o.style.height&&!o.style.width)&&(o.style.height="".concat(t.height,"px"),o.style.width="".concat(t.width,"px")),(t.currentDevicePixelRatio!==n||o.height!==i||o.width!==a)&&(t.currentDevicePixelRatio=n,o.height=i,o.width=a,t.ctx.setTransform(n,0,0,n,0,0),!0)}var e2=function(){var t=!1;try{var e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function e5(t,e){var r=e$(t,e),n=r&&r.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function e3(t,e,r,n){return{x:t.x+r*(e.x-t.x),y:t.y+r*(e.y-t.y)}}function e6(t,e,r,n){return{x:t.x+r*(e.x-t.x),y:"middle"===n?r<.5?t.y:e.y:"after"===n?r<1?t.y:e.y:r>0?e.y:t.y}}function e8(t,e,r,n){var i={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},o=e3(t,i,r),s=e3(i,a,r),l=e3(a,e,r),u=e3(o,s,r),c=e3(s,l,r);return e3(u,c,r)}var e4=new Map;function e7(t,e,r){var n,i,a;return(i=e+JSON.stringify(n=(n=r)||{}),(a=e4.get(i))||(a=new Intl.NumberFormat(e,n),e4.set(i,a)),a).format(t)}function e9(t,e,r){var n;return t?(n=r,{x:function(t){return e+e+n-t},setWidth:function(t){n=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}}function rt(t,e){var r,n;("ltr"===e||"rtl"===e)&&(n=[(r=t.canvas.style).getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",e,"important"),t.prevTextDirection=n)}function re(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function rr(t){return"angle"===t?{between:tl,compare:to,normalize:ts}:{between:th,compare:function(t,e){return t-e},normalize:function(t){return t}}}function rn(t){var e=t.start,r=t.end,n=t.count;return{start:e%n,end:r%n,loop:t.loop&&(r-e+1)%n==0,style:t.style}}function ri(t,e,r){if(!r)return[t];for(var n,i,a,o=r.property,s=r.start,l=r.end,u=e.length,c=rr(o),h=c.compare,f=c.between,d=c.normalize,p=function(t,e,r){var n,i=r.property,a=r.start,o=r.end,s=rr(i),l=s.between,u=s.normalize,c=e.length,h=t.start,f=t.end,d=t.loop;if(d){for(h+=c,f+=c,n=0;ni&&t[a%e].skip;)a--;return{start:i,end:a%=e}}(r,i,a,n),s=o.start,l=o.end;if(!0===n)return rs(t,[{start:s,end:l,loop:a}],r,e);var u=l0){this.model=e||"rgb",n=s[this.model].channels;var c=Array.prototype.slice.call(t,0,n);this.color=S(c,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var h=Object.keys(t);"alpha"in t&&(h.splice(h.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var f=h.sort().join("");if(!(f in u))throw Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[f];var d=s[this.model].labels,p=[];for(r=0;rr?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return y.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+(void 0===t?"undefined":(0,a._)(t)));var r=t.rgb(),n=this.rgb(),i=void 0===e?.5:e,o=2*i-1,s=r.alpha()-n.alpha(),l=((o*s==-1?o:(o+s)/(1+o*s))+1)/2,u=1-l;return y.rgb(l*r.red()+u*n.red(),l*r.green()+u*n.green(),l*r.blue()+u*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};var m=!0,b=!1,_=void 0;try{for(var x,k=Object.keys(s)[Symbol.iterator]();!(m=(x=k.next()).done);m=!0)!function(){var t=x.value;if(!l.includes(t)){var e=s[t].channels;y.prototype[t]=function(){for(var e,r=arguments.length,n=Array(r),a=0;a0?new y(n,t):new y((0,i._)((e=s[this.model][t].raw(this.color),Array.isArray(e)?e:[e])).concat([this.valpha]),t)},y[t]=function(){for(var r=arguments.length,n=Array(r),i=0;i=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},l.to.keyword=function(t){return o[t.slice(0,3)]}},{d7a6eeb7388b4bb:"9CRqC","248ce9e419a8df53":"7SGVb"}],"9CRqC":[function(t,e,r){e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],"7SGVb":[function(t,e,r){var n=t("ce0bf6d0bc000d24"),i=Array.prototype.concat,a=Array.prototype.slice,o=e.exports=function(t){for(var e=[],r=0,o=t.length;r=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},{}],b0bZu:[function(t,e,r){var n=t("739980f7990d3c32"),i=t("30ea0c7ee5f3dd94"),a={};Object.keys(n).forEach(function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:n[t].channels}),Object.defineProperty(a[t],"labels",{value:n[t].labels});var e=i(t);Object.keys(e).forEach(function(r){var n,i,o=e[r];a[t][r]=(n=function(){for(var t=arguments.length,e=Array(t),r=0;r1&&(e=n);var i=o(e);if("object"==typeof i)for(var a=i.length,s=0;s1&&(e=n),o(e))},"conversion"in o&&(i.conversion=o.conversion),i)})}),e.exports=a},{"739980f7990d3c32":"bLCsr","30ea0c7ee5f3dd94":"B0afd"}],bLCsr:[function(t,e,r){var n=t("@swc/helpers/_/_sliced_to_array"),i=t("efc99055946c4df8"),a={},o=!0,s=!1,l=void 0;try{for(var u,c=Object.keys(i)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var h=u.value;a[i[h]]=h}}catch(t){s=!0,l=t}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}var f={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=f;var d=!0,p=!1,v=void 0;try{for(var g,y=Object.keys(f)[Symbol.iterator]();!(d=(g=y.next()).done);d=!0){var m=g.value;if(!("channels"in f[m]))throw Error("missing channels property: "+m);if(!("labels"in f[m]))throw Error("missing channel labels property: "+m);if(f[m].labels.length!==f[m].channels)throw Error("channel and label counts mismatch: "+m);var b=f[m],_=b.channels,x=b.labels;delete f[m].channels,delete f[m].labels,Object.defineProperty(f[m],"channels",{value:_}),Object.defineProperty(f[m],"labels",{value:x})}}catch(t){p=!0,v=t}finally{try{d||null==y.return||y.return()}finally{if(p)throw v}}f.rgb.hsl=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255,a=Math.min(r,n,i),o=Math.max(r,n,i),s=o-a;o===a?e=0:r===o?e=(n-i)/s:n===o?e=2+(i-r)/s:i===o&&(e=4+(r-n)/s),(e=Math.min(60*e,360))<0&&(e+=360);var l=(a+o)/2;return[e,100*(o===a?0:l<=.5?s/(o+a):s/(2-o-a)),100*l]},f.rgb.hsv=function(t){var e,r,n,i,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),h=function(t){return(u-t)/6/c+.5};return 0===c?(i=0,a=0):(a=c/u,e=h(o),r=h(s),n=h(l),o===u?i=n-r:s===u?i=1/3+e-n:l===u&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*a,100*u]},f.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[f.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(r,n))*100,100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},f.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n);return[100*((1-e-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*i]},f.rgb.keyword=function(t){var e=a[t];if(e)return e;var r=1/0,n=!0,o=!1,s=void 0;try{for(var l,u,c=Object.keys(i)[Symbol.iterator]();!(n=(u=c.next()).done);n=!0){var h=u.value,f=i[h],d=Math.pow(t[0]-f[0],2)+Math.pow(t[1]-f[1],2)+Math.pow(t[2]-f[2],2);d.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},f.rgb.lab=function(t){var e=f.rgb.xyz(t),r=e[0],n=e[1],i=e[2];return r/=95.047,n/=100,i/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},f.hsl.rgb=function(t){var e,r,n,i=t[0]/360,a=t[1]/100,o=t[2]/100;if(0===a)return[n=255*o,n,n];e=o<.5?o*(1+a):o+a-o*a;for(var s=2*o-e,l=[0,0,0],u=0;u<3;u++)(r=i+-(1/3*(u-1)))<0&&r++,r>1&&r--,n=6*r<1?s+(e-s)*6*r:2*r<1?e:3*r<2?s+(e-s)*(2/3-r)*6:s,l[u]=255*n;return l},f.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,a=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=a<=1?a:2-a;var o=(n+r)/2;return[e,100*(0===n?2*i/(a+i):2*r/(n+r)),100*o]},f.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=e-Math.floor(e),a=255*n*(1-r),o=255*n*(1-r*i),s=255*n*(1-r*(1-i));switch(n*=255,Math.floor(e)%6){case 0:return[n,s,a];case 1:return[o,n,a];case 2:return[a,n,s];case 3:return[a,o,n];case 4:return[s,a,n];case 5:return[n,a,o]}},f.hsv.hsl=function(t){var e,r,n=t[0],i=t[1]/100,a=t[2]/100,o=Math.max(a,.01);r=(2-i)*a;var s=(2-i)*o;return[n,100*(i*o/(s<=1?s:2-s)||0),100*(r/=2)]},f.hwb.rgb=function(t){var e,r,n,i,a=t[0]/360,o=t[1]/100,s=t[2]/100,l=o+s;l>1&&(o/=l,s/=l);var u=Math.floor(6*a),c=1-s;e=6*a-u,(1&u)!=0&&(e=1-e);var h=o+e*(c-o);switch(u){default:case 6:case 0:r=c,n=h,i=o;break;case 1:r=h,n=c,i=o;break;case 2:r=o,n=c,i=h;break;case 3:r=o,n=h,i=c;break;case 4:r=h,n=o,i=c;break;case 5:r=c,n=o,i=h}return[255*r,255*n,255*i]},f.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},f.xyz.rgb=function(t){var e,r,n,i=t[0]/100,a=t[1]/100,o=t[2]/100;return e=3.2406*i+-1.5372*a+-.4986*o,r=-.9689*i+1.8758*a+.0415*o,n=.0557*i+-.204*a+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},f.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return e/=95.047,r/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},f.lab.xyz=function(t){var e,r,n,i=t[0],a=t[1],o=t[2];e=a/500+(r=(i+16)/116),n=r-o/200;var s=Math.pow(r,3),l=Math.pow(e,3),u=Math.pow(n,3);return r=(s>.008856?s:(r-16/116)/7.787)*100,[e=(l>.008856?l:(e-16/116)/7.787)*95.047,r,n=(u>.008856?u:(n-16/116)/7.787)*108.883]},f.lab.lch=function(t){var e,r=t[0],n=t[1],i=t[2];return(e=360*Math.atan2(i,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+i*i),e]},f.lch.lab=function(t){var e=t[0],r=t[1],n=t[2]/360*2*Math.PI;return[e,r*Math.cos(n),r*Math.sin(n)]},f.rgb.ansi16=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=(0,n._)(t,3),i=r[0],a=r[1],o=r[2],s=null===e?f.rgb.hsv(t)[2]:e;if(0===(s=Math.round(s/50)))return 30;var l=30+(Math.round(o/255)<<2|Math.round(a/255)<<1|Math.round(i/255));return 2===s&&(l+=60),l},f.hsv.ansi16=function(t){return f.rgb.ansi16(f.hsv.rgb(t),t[2])},f.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},f.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=(~~(t>50)+1)*.5;return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},f.ansi256.rgb=function(t){if(t>=232){var e,r=(t-232)*10+8;return[r,r,r]}return[Math.floor((t-=16)/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},f.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},f.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map(function(t){return t+t}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},f.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255,a=Math.max(Math.max(r,n),i),o=Math.min(Math.min(r,n),i),s=a-o;return e=s<1?o/(1-s):0,[(s<=0?0:a===r?(n-i)/s%6:a===n?2+(i-r)/s:4+(r-n)/s)/6%1*360,100*s,100*e]},f.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],100*n,100*i]},f.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},f.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-r)*n,[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]},f.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},f.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},f.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],(r-e)*100,(1-r)*100]},f.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},f.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},f.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},f.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},f.gray.hsl=function(t){return[0,0,t[0]]},f.gray.hsv=f.gray.hsl,f.gray.hwb=function(t){return[0,100,t[0]]},f.gray.cmyk=function(t){return[0,0,0,t[0]]},f.gray.lab=function(t){return[t[0],0,0]},f.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},f.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},{"@swc/helpers/_/_sliced_to_array":"hefcy",efc99055946c4df8:"9CRqC"}],B0afd:[function(t,e,r){var n=t("22442592002c5ac3");e.exports=function(t){for(var e=function(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,i=0;i