| 2 |
(()=>{var e={386:function(e,t,n){var r,a,i;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}i=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",a="minute",i="hour",l="day",s="week",c="month",u="quarter",f="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},g={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),a=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(a,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),a=t.clone().add(r,c),i=n-a<0,o=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-a)/(i?a-o:o-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:f,w:s,d:l,D:d,h:i,m:a,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=m;var _="$isDayjsObject",w=function(e){return e instanceof E||!(!e||!e[_])},k=function e(t,n,r){var a;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(a=i),n&&(x[i]=n,a=i);var o=t.split("-");if(!a&&o.length>1)return e(o[0])}else{var l=t.name;x[l]=t,a=l}return!r&&a&&(b=a),a||!r&&b},S=function(e,t){if(w(e))return e.clone();var n="object"==o(t)?t:{};return n.date=e,n.args=arguments,new E(n)},O=g;O.l=k,O.i=w,O.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function o(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[_]=!0}var m=o.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(O.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var a=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===h)},m.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return S(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<S(e)},m.$g=function(e,t,n){return O.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var n=this,o=!!O.u(t)||t,u=O.p(e),h=function(e,t){var r=O.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return o?r:r.endOf(l)},p=function(e,t){return O.w(n.toDate()[e].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},v=this.$W,m=this.$M,y=this.$D,g="set"+(this.$u?"UTC":"");switch(u){case f:return o?h(1,0):h(31,11);case c:return o?h(1,m):h(0,m+1);case s:var b=this.$locale().weekStart||0,x=(v<b?v+7:v)-b;return h(o?y-x:y+(6-x),m);case l:case d:return p(g+"Hours",0);case i:return p(g+"Minutes",1);case a:return p(g+"Seconds",2);case r:return p(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var o,s=O.p(e),u="set"+(this.$u?"UTC":""),h=(o={},o[l]=u+"Date",o[d]=u+"Date",o[c]=u+"Month",o[f]=u+"FullYear",o[i]=u+"Hours",o[a]=u+"Minutes",o[r]=u+"Seconds",o[n]=u+"Milliseconds",o)[s],p=s===l?this.$D+(t-this.$W):t;if(s===c||s===f){var v=this.clone().set(d,1);v.$d[h](p),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[O.p(e)]()},m.add=function(n,o){var u,d=this;n=Number(n);var h=O.p(o),p=function(e){var t=S(d);return O.w(t.date(t.date()+Math.round(e*n)),d)};if(h===c)return this.set(c,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===l)return p(1);if(h===s)return p(7);var v=(u={},u[a]=e,u[i]=t,u[r]=1e3,u)[h]||1,m=this.$d.getTime()+n*v;return O.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=e||"YYYY-MM-DDTHH:mm:ssZ",a=O.z(this),i=this.$H,o=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,f=function(e,n,a,i){return e&&(e[n]||e(t,r))||a[n].slice(0,i)},d=function(e){return O.s(i%12||12,e,"0")},p=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(v,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return O.s(t.$y,4,"0");case"M":return l+1;case"MM":return O.s(l+1,2,"0");case"MMM":return f(n.monthsShort,l,c,3);case"MMMM":return f(c,l);case"D":return t.$D;case"DD":return O.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(n.weekdaysMin,t.$W,s,2);case"ddd":return f(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return O.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(i,o,!0);case"A":return p(i,o,!1);case"m":return String(o);case"mm":return O.s(o,2,"0");case"s":return String(t.$s);case"ss":return O.s(t.$s,2,"0");case"SSS":return O.s(t.$ms,3,"0");case"Z":return a}return null}(e)||a.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,o,d){var h,p=this,v=O.p(o),m=S(n),y=(m.utcOffset()-this.utcOffset())*e,g=this-m,b=function(){return O.m(p,m)};switch(v){case f:h=b()/12;break;case c:h=b();break;case u:h=b()/3;break;case s:h=(g-y)/6048e5;break;case l:h=(g-y)/864e5;break;case i:h=g/t;break;case a:h=g/e;break;case r:h=g/1e3;break;default:h=g}return d?h:O.a(h)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return x[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=k(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},o}(),A=E.prototype;return S.prototype=A,[["$ms",n],["$s",r],["$m",a],["$H",i],["$W",l],["$M",c],["$y",f],["$D",d]].forEach((function(e){A[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,E,S),e.$i=!0),S},S.locale=k,S.isDayjs=w,S.unix=function(e){return S(1e3*e)},S.en=x[b],S.Ls=x,S.p={},S},"object"==o(t)?e.exports=i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)},828:function(e,t,n){var r,a,i;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}i=function(){"use strict";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}},"object"==o(t)?e.exports=i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)},932:function(e,t,n){var r,a,i;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}i=function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}},"object"==o(t)?e.exports=i():void 0===(a="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=a)},480:(e,t,n)=>{"use strict";var r=n(69),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?o:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var a=h(n);a&&a!==p&&e(t,a,r)}var o=u(n);f&&(o=o.concat(f(n)));for(var l=s(t),v=s(n),m=0;m<o.length;++m){var y=o[m];if(!(i[y]||r&&r[y]||v&&v[y]||l&&l[y])){var g=d(n,y);try{c(t,y,g)}catch(e){}}}}return t}},995:(e,t)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function w(e){if("object"===n(e)&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case f:case d:case o:case s:case l:case p:return e;default:switch(e=e&&e.$$typeof){case u:case h:case y:case m:case c:return e;default:return t}}case i:return t}}}function k(e){return w(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=c,t.Element=a,t.ForwardRef=h,t.Fragment=o,t.Lazy=y,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=l,t.Suspense=p,t.isAsyncMode=function(e){return k(e)||w(e)===f},t.isConcurrentMode=k,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"===n(e)&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===y},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===l},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===l||e===p||e===v||"object"===n(e)&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===c||e.$$typeof===u||e.$$typeof===h||e.$$typeof===b||e.$$typeof===x||e.$$typeof===_||e.$$typeof===g)},t.typeOf=w},69:(e,t,n)=>{"use strict";e.exports=n(995)},769:(e,t,n)=>{"use strict";var r=n(533);t.s=r.createRoot,r.hydrateRoot},533:e=>{"use strict";e.exports=ReactDOM}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=React;var t=n.n(e),r=n(769);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e,t){switch(t.type){case"SET_CAMPAIGN":case"SET_CAMPAIGN_DATA":return i(i({},e),{},{campaign:t.payload});case"SET_DATE_PERIOD":var n=i(i({},e),{},{date_period:t.payload});return"custom"!==t.payload&&(n.custom_date_period=[null,null]),n;case"SET_CUSTOM_DATE_PERIOD":return i(i({},e),{},{custom_date_period:t.payload});case"CLEAR_SELECTED_CAMPAIGN":return i(i({},e),{},{selected_campaign:null,campaign:null});case"SET_SELECTED_CAMPAIGN":return i(i({},e),{},{selected_campaign:t.payload});default:throw Error("Unknown action: "+t.type)}},s=t().createContext(),c=t().createContext(),u=function(){return(0,e.useContext)(s)},f=function(){return(0,e.useContext)(c)};function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",n=(0,e.useState)(null),r=d(n,2),a=r[0],i=r[1],o=(0,e.useState)(!0),l=d(o,2),s=l[0],c=l[1];return(0,e.useEffect)((function(){var e="undefined"!=typeof window&&window.wp&&window.wp.hooks?window.wp.hooks:null,t=function(){try{var t=null==e?void 0:e.applyFilters("firebox.revenue.type","locked"),n=null==e?void 0:e.applyFilters("firebox.revenue.components",null);if(!n)return i(null),void c(!1);i("pro"===t?{Clicks:n.Clicks,Revenue:n.Revenue,SalesFunnel:n.SalesFunnel,ClickThroughRevenue:n.ClickThroughRevenue,ViewThroughRevenue:n.ViewThroughRevenue,CompactRevenueROI:n.CompactRevenueROI,type:"pro"}:{Clicks:n.ClicksLocked,Revenue:n.RevenueLocked,SalesFunnel:n.SalesFunnelLocked,ClickThroughRevenue:n.ClickThroughRevenueLocked,ViewThroughRevenue:n.ViewThroughRevenueLocked,CompactRevenueROI:n.CompactRevenueROILocked,type:"locked"})}finally{c(!1)}};return t(),e&&e.addAction("firebox.revenue.ready","firebox/analytics",t,10),function(){e&&e.removeAction("firebox.revenue.ready","firebox/analytics")}}),[t]),{components:a,loading:s}};function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const m=function(t){var n=t._title,r=void 0===n?fbox_admin_js_object.langs.OVERVIEW:n,a=t.call_to_action,i=void 0===a||a,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(r),2),l=o[0],s=o[1],c=u().campaign,f=p(),d=f.components,h=f.loading;return(0,e.useEffect)((function(){s(null!=c&&c.post_title?c.post_title:r)}),[c]),React.createElement("div",{className:"flex items-center justify-between gap-1 flex-wrap"},React.createElement("h1",{className:"mb-0 text-default text-[32px] dark:text-white truncate md:max-w-[800px] fp-admin-page-title"},l),React.createElement("div",{className:"flex items-center gap-4"},!h&&(null==d?void 0:d.CompactRevenueROI)&&React.createElement(d.CompactRevenueROI,null),c?null:i&&React.createElement("a",{href:"#",className:"fpf-open-library-modal rounded bg-accent text-sm text-white no-underline px-2 py-1 flex items-center justify-center gap-1 hover:bg-accent-hover"},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("mask",{id:"mask0_498_1527",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},React.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),React.createElement("g",{mask:"url(#mask0_498_1527)"},React.createElement("path",{d:"M11.25 16.75H12.75V12.75H16.75V11.25H12.75V7.25H11.25V11.25H7.25V12.75H11.25V16.75ZM12.0016 21.5C10.6877 21.5 9.45268 21.2506 8.29655 20.752C7.1404 20.2533 6.13472 19.5765 5.2795 18.7217C4.42427 17.8669 3.74721 16.8616 3.24833 15.706C2.74944 14.5504 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45268 3.248 8.29655C3.74667 7.1404 4.42342 6.13472 5.27825 5.2795C6.1331 4.42427 7.13834 3.74721 8.29398 3.24833C9.44959 2.74944 10.6844 2.5 11.9983 2.5C13.3122 2.5 14.5473 2.74933 15.7034 3.248C16.8596 3.74667 17.8652 4.42342 18.7205 5.27825C19.5757 6.1331 20.2527 7.13834 20.7516 8.29398C21.2505 9.44959 21.5 10.6844 21.5 11.9983C21.5 13.3122 21.2506 14.5473 20.752 15.7034C20.2533 16.8596 19.5765 17.8652 18.7217 18.7205C17.8669 19.5757 16.8616 20.2527 15.706 20.7516C14.5504 21.2505 13.3156 21.5 12.0016 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76664 19.225 7.87498 17.675 6.32498C16.125 4.77498 14.2333 3.99998 12 3.99998C9.76664 3.99998 7.87498 4.77498 6.32498 6.32498C4.77498 7.87498 3.99998 9.76664 3.99998 12C3.99998 14.2333 4.77498 16.125 6.32498 17.675C7.87498 19.225 9.76664 20 12 20Z",fill:"white"}))),fbox_admin_js_object.langs.NEW_CAMPAIGN)))};var y=n(386),g=n.n(y),b=n(932),x=n.n(b),_=n(828),w=n.n(_),k=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),S=Math.abs,O=String.fromCharCode,E=Object.assign;function A(e){return e.trim()}function C(e,t,n){return e.replace(t,n)}function j(e,t){return e.indexOf(t)}function D(e,t){return 0|e.charCodeAt(t)}function M(e,t,n){return e.slice(t,n)}function P(e){return e.length}function R(e){return e.length}function I(e,t){return t.push(e),e}var L=1,N=1,T=0,F=0,z=0,H="";function V(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:L,column:N,length:o,return:""}}function W(e,t){return E(V("",null,null,"",null,null,0),e,{length:-e.length},t)}function $(){return z=F>0?D(H,--F):0,N--,10===z&&(N=1,L--),z}function B(){return z=F<T?D(H,F++):0,N++,10===z&&(N=1,L++),z}function Y(){return D(H,F)}function U(){return F}function G(e,t){return M(H,e,t)}function q(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Z(e){return L=N=1,T=P(H=e),F=0,[]}function K(e){return H="",e}function X(e){return A(G(F-1,ee(91===e?e+2:40===e?e+1:e)))}function J(e){for(;(z=Y())&&z<33;)B();return q(e)>2||q(z)>3?"":" "}function Q(e,t){for(;--t&&B()&&!(z<48||z>102||z>57&&z<65||z>70&&z<97););return G(e,U()+(t<6&&32==Y()&&32==B()))}function ee(e){for(;B();)switch(z){case e:return F;case 34:case 39:34!==e&&39!==e&&ee(z);break;case 40:41===e&&ee(e);break;case 92:B()}return F}function te(e,t){for(;B()&&e+z!==57&&(e+z!==84||47!==Y()););return"/*"+G(t,F-1)+"*"+O(47===e?e:B())}function ne(e){for(;!q(Y());)B();return G(e,F)}var re="-ms-",ae="-webkit-",ie="comm",oe="rule",le="decl",se="@keyframes";function ce(e,t){for(var n="",r=R(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function ue(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case le:return e.return=e.return||e.value;case ie:return"";case se:return e.return=e.value+"{"+ce(e.children,r)+"}";case oe:e.value=e.props.join(",")}return P(n=ce(e.children,r))?e.return=e.value+"{"+n+"}":""}function fe(e){return function(t){t.root||(t=t.return)&&e(t)}}function de(e){return K(he("",null,null,null,[""],e=Z(e),0,[0],e))}function he(e,t,n,r,a,i,o,l,s){for(var c=0,u=0,f=o,d=0,h=0,p=0,v=1,m=1,y=1,g=0,b="",x=a,_=i,w=r,k=b;m;)switch(p=g,g=B()){case 40:if(108!=p&&58==D(k,f-1)){-1!=j(k+=C(X(g),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:k+=X(g);break;case 9:case 10:case 13:case 32:k+=J(p);break;case 92:k+=Q(U()-1,7);continue;case 47:switch(Y()){case 42:case 47:I(ve(te(B(),U()),t,n),s);break;default:k+="/"}break;case 123*v:l[c++]=P(k)*y;case 125*v:case 59:case 0:switch(g){case 0:case 125:m=0;case 59+u:-1==y&&(k=C(k,/\f/g,"")),h>0&&P(k)-f&&I(h>32?me(k+";",r,n,f-1):me(C(k," ","")+";",r,n,f-2),s);break;case 59:k+=";";default:if(I(w=pe(k,t,n,c,u,a,l,b,x=[],_=[],f),i),123===g)if(0===u)he(k,t,w,w,x,i,f,l,_);else switch(99===d&&110===D(k,3)?100:d){case 100:case 108:case 109:case 115:he(e,w,w,r&&I(pe(e,w,w,0,0,a,l,b,a,x=[],f),_),a,_,f,l,r?x:_);break;default:he(k,w,w,w,[""],_,0,l,_)}}c=u=h=0,v=y=1,b=k="",f=o;break;case 58:f=1+P(k),h=p;default:if(v<1)if(123==g)--v;else if(125==g&&0==v++&&125==$())continue;switch(k+=O(g),g*v){case 38:y=u>0?1:(k+="\f",-1);break;case 44:l[c++]=(P(k)-1)*y,y=1;break;case 64:45===Y()&&(k+=X(B())),d=Y(),u=f=P(b=k+=ne(U())),g++;break;case 45:45===p&&2==P(k)&&(v=0)}}return i}function pe(e,t,n,r,a,i,o,l,s,c,u){for(var f=a-1,d=0===a?i:[""],h=R(d),p=0,v=0,m=0;p<r;++p)for(var y=0,g=M(e,f+1,f=S(v=o[p])),b=e;y<h;++y)(b=A(v>0?d[y]+" "+g:C(g,/&\f/g,d[y])))&&(s[m++]=b);return V(e,t,n,0===a?oe:l,s,c,u)}function ve(e,t,n){return V(e,t,n,ie,O(z),M(e,2,-2),0)}function me(e,t,n,r){return V(e,t,n,le,M(e,0,r),M(e,r+1,-1),r)}var ye=function(e,t,n){for(var r=0,a=0;r=a,a=Y(),38===r&&12===a&&(t[n]=1),!q(a);)B();return G(e,F)},ge=new WeakMap,be=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ge.get(n))&&!r){ge.set(e,!0);for(var a=[],i=function(e,t){return K(function(e,t){var n=-1,r=44;do{switch(q(r)){case 0:38===r&&12===Y()&&(t[n]=1),e[n]+=ye(F-1,t,n);break;case 2:e[n]+=X(r);break;case 4:if(44===r){e[++n]=58===Y()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=O(r)}}while(r=B());return e}(Z(e),t))}(t,a),o=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<o.length;c++,s++)e.props[s]=a[l]?i[l].replace(/&\f/g,o[c]):o[c]+" "+i[l]}}},xe=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function _e(e,t){switch(function(e,t){return 45^D(e,0)?(((t<<2^D(e,0))<<2^D(e,1))<<2^D(e,2))<<2^D(e,3):0}(e,t)){case 5103:return"-webkit-print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ae+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ae+e+"-moz-"+e+re+e+e;case 6828:case 4268:return ae+e+re+e+e;case 6165:return ae+e+re+"flex-"+e+e;case 5187:return ae+e+C(e,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+e;case 5443:return ae+e+re+"flex-item-"+C(e,/flex-|-self/,"")+e;case 4675:return ae+e+re+"flex-line-pack"+C(e,/align-content|flex-|-self/,"")+e;case 5548:return ae+e+re+C(e,"shrink","negative")+e;case 5292:return ae+e+re+C(e,"basis","preferred-size")+e;case 6060:return"-webkit-box-"+C(e,"-grow","")+ae+e+re+C(e,"grow","positive")+e;case 4554:return ae+C(e,/([^-])(transform)/g,"$1-webkit-$2")+e;case 6187:return C(C(C(e,/(zoom-|grab)/,"-webkit-$1"),/(image-set)/,"-webkit-$1"),e,"")+e;case 5495:case 3959:return C(e,/(image-set\([^]*)/,"-webkit-$1$`$1");case 4968:return C(C(e,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+ae+e+e;case 4095:case 3583:case 4068:case 2532:return C(e,/(.+)-inline(.+)/,"-webkit-$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(P(e)-1-t>6)switch(D(e,t+1)){case 109:if(45!==D(e,t+4))break;case 102:return C(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==D(e,t+3)?"$3":"$2-$3"))+e;case 115:return~j(e,"stretch")?_e(C(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==D(e,t+1))break;case 6444:switch(D(e,P(e)-3-(~j(e,"!important")&&10))){case 107:return C(e,":",":-webkit-")+e;case 101:return C(e,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===D(e,14)?"inline-":"")+"box$3$1-webkit-$2$3$1-ms-$2box$3")+e}break;case 5936:switch(D(e,t+11)){case 114:return ae+e+re+C(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ae+e+re+C(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ae+e+re+C(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ae+e+re+e+e}return e}var we=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case le:e.return=_e(e.value,e.length);break;case se:return ce([W(e,{value:C(e.value,"@","@-webkit-")})],r);case oe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return ce([W(e,{props:[C(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ce([W(e,{props:[C(t,/:(plac\w+)/,":-webkit-input-$1")]}),W(e,{props:[C(t,/:(plac\w+)/,":-moz-$1")]}),W(e,{props:[C(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}return""}))}}],ke=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||we,o={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)o[t[n]]=!0;l.push(e)}));var s,c,u,f=[be,xe],d=[ue,fe((function(e){s.insert(e)}))],h=(c=f.concat(i,d),u=R(c),function(e,t,n,r){for(var a="",i=0;i<u;i++)a+=c[i](e,t,n,r)||"";return a});a=function(e,t,n,r){s=n,ce(de(e?e+"{"+t.styles+"}":t.styles),h),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new k({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:a};return p.sheet.hydrate(l),p};function Se(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")})),r}var Oe=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Ee=function(e,t,n){Oe(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}},Ae={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Ce(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}function je(e){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},je(e)}var De=/[A-Z]|^ms/g,Me=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Pe=function(e){return 45===e.charCodeAt(1)},Re=function(e){return null!=e&&"boolean"!=typeof e},Ie=Ce((function(e){return Pe(e)?e:e.replace(De,"-$&").toLowerCase()})),Le=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Me,(function(e,t,n){return Te={name:t,styles:n,next:Te},t}))}return 1===Ae[e]||Pe(e)||"number"!=typeof t||0===t?t:t+"px"};function Ne(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(je(n)){case"boolean":return"";case"object":var a=n;if(1===a.anim)return Te={name:a.name,styles:a.styles,next:Te},a.name;var i=n;if(void 0!==i.styles){var o=i.next;if(void 0!==o)for(;void 0!==o;)Te={name:o.name,styles:o.styles,next:Te},o=o.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=Ne(e,t,n[a])+";";else for(var i in n){var o=n[i];if("object"!==je(o)){var l=o;null!=t&&void 0!==t[l]?r+=i+"{"+t[l]+"}":Re(l)&&(r+=Ie(i)+":"+Le(i,l)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var s=Ne(e,t,o);switch(i){case"animation":case"animationName":r+=Ie(i)+":"+s+";";break;default:r+=i+"{"+s+"}"}}else for(var c=0;c<o.length;c++)Re(o[c])&&(r+=Ie(i)+":"+Le(i,o[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var l=Te,s=n(e);return Te=l,Ne(e,t,s)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Te,Fe=/label:\s*([^\s;{]+)\s*(;|$)/g;function ze(e,t,n){if(1===e.length&&"object"===je(e[0])&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,a="";Te=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,a+=Ne(n,t,i)):a+=i[0];for(var o=1;o<e.length;o++)a+=Ne(n,t,e[o]),r&&(a+=i[o]);Fe.lastIndex=0;for(var l,s="";null!==(l=Fe.exec(a));)s+="-"+l[1];var c=function(e){for(var t,n=0,r=0,a=e.length;a>=4;++r,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(a){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(a)+s;return{name:c,styles:a,next:Te}}var He=!!e.useInsertionEffect&&e.useInsertionEffect,Ve=He||function(e){return e()},We=(He||e.useLayoutEffect,e.createContext("undefined"!=typeof HTMLElement?ke({key:"css"}):null)),$e=(We.Provider,function(t){return(0,e.forwardRef)((function(n,r){var a=(0,e.useContext)(We);return t(n,a,r)}))}),Be=e.createContext({}),Ye={}.hasOwnProperty,Ue="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ge=function(e,t){var n={};for(var r in t)Ye.call(t,r)&&(n[r]=t[r]);return n[Ue]=e,n},qe=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Oe(t,n,r),Ve((function(){return Ee(t,n,r)})),null},Ze=$e((function(t,n,r){var a=t.css;"string"==typeof a&&void 0!==n.registered[a]&&(a=n.registered[a]);var i=t[Ue],o=[a],l="";"string"==typeof t.className?l=Se(n.registered,o,t.className):null!=t.className&&(l=t.className+" ");var s=ze(o,void 0,e.useContext(Be));l+=n.key+"-"+s.name;var c={};for(var u in t)Ye.call(t,u)&&"css"!==u&&u!==Ue&&(c[u]=t[u]);return c.className=l,r&&(c.ref=r),e.createElement(e.Fragment,null,e.createElement(qe,{cache:n,serialized:s,isStringTag:"string"==typeof i}),e.createElement(i,c))}));n(480);var Ke,Xe,Je=function(t,n){var r=arguments;if(null==n||!Ye.call(n,"css"))return e.createElement.apply(void 0,r);var a=r.length,i=new Array(a);i[0]=Ze,i[1]=Ge(t,n);for(var o=2;o<a;o++)i[o]=r[o];return e.createElement.apply(null,i)};Ke=Je||(Je={}),Xe||(Xe=Ke.JSX||(Ke.JSX={}));var Qe={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nt=Object.defineProperty,rt=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable,ot=function(e,t,n){return t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},lt=function(e,t){for(var n in t||(t={}))at.call(t,n)&&ot(e,n,t[n]);if(rt){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(rt(t));try{for(a.s();!(r=a.n()).done;)n=r.value,it.call(t,n)&&ot(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function st(e){return function(t){return"number"==typeof e.primaryShade?e.primaryShade:e.primaryShade[t||e.colorScheme]}}function ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ut(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ft(e){var t=st(e);return function(n,r){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("string"==typeof n&&n.includes(".")){var o=n.split("."),l=ct(o,2),s=l[0],c=l[1],u=parseInt(c,10);if(s in e.colors&&u>=0&&u<10)return e.colors[s]["number"!=typeof r||i?u:r]}var f="number"==typeof r?r:t();return n in e.colors?e.colors[n][f]:a?e.colors[e.primaryColor][f]:n}}function dt(e){for(var t="",n=1;n<e.length-1;n+=1)t+="".concat(e[n]," ").concat(n/(e.length-1)*100,"%, ");return"".concat(e[0]," 0%, ").concat(t).concat(e[e.length-1]," 100%")}function ht(e){var t=ft(e),n=st(e);return function(r){var a={from:(null==r?void 0:r.from)||e.defaultGradient.from,to:(null==r?void 0:r.to)||e.defaultGradient.to,deg:(null==r?void 0:r.deg)||e.defaultGradient.deg};return"linear-gradient(".concat(a.deg,"deg, ").concat(t(a.from,n(),!1)," 0%, ").concat(t(a.to,n(),!1)," 100%)")}}function pt(e){return function(t){if("number"==typeof t)return"".concat(t/16).concat(e);if("string"==typeof t){var n=t.replace("px","");if(!Number.isNaN(Number(n)))return"".concat(Number(n)/16).concat(e)}return t}}var vt=pt("rem"),mt=pt("em");function yt(e){var t=e.size,n=e.sizes,r=e.units;return t in n?n[t]:"number"==typeof t?"em"===r?mt(t):vt(t):t||n.md}function gt(e){return"number"==typeof e?e:"string"==typeof e&&e.includes("rem")?16*Number(e.replace("rem","")):"string"==typeof e&&e.includes("em")?16*Number(e.replace("em","")):Number(e)}function bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xt(e){return function(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}(e)?function(e){var t=e.replace("#","");if(3===t.length){var n=t.split("");t=[n[0],n[0],n[1],n[1],n[2],n[2]].join("")}var r=parseInt(t,16);return{r:r>>16&255,g:r>>8&255,b:255&r,a:1}}(e):e.startsWith("rgb")?function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.replace(/[^0-9,.]/g,"").split(",").map(Number),4);return{r:t[0],g:t[1],b:t[2],a:t[3]||1}}(e):{r:0,g:0,b:0,a:1}}function _t(e,t){if("string"!=typeof e||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;var n=xt(e),r=n.r,a=n.g,i=n.b;return"rgba(".concat(r,", ").concat(a,", ").concat(i,", ").concat(t,")")}function wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kt={fontStyles:function(e){return function(){return{fontFamily:e.fontFamily||"sans-serif"}}},themeColor:ft,focusStyles:function(e){return function(t){var n;return et(n={WebkitTapHighlightColor:"transparent"},t||"&:focus",lt({},"always"===e.focusRing||"auto"===e.focusRing?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e))),et(n,t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)",lt({},"auto"===e.focusRing||"never"===e.focusRing?e.focusRingStyles.resetStyles(e):null)),n}},linearGradient:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"linear-gradient(".concat(e,"deg, ").concat(dt(n),")")},radialGradient:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"radial-gradient(circle, ".concat(dt(t),")")},smallerThan:function(e){return function(t){return"@media (max-width: ".concat(mt(gt(yt({size:t,sizes:e.breakpoints}))-1),")")}},largerThan:function(e){return function(t){return"@media (min-width: ".concat(mt(gt(yt({size:t,sizes:e.breakpoints}))),")")}},rgba:_t,cover:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{position:"absolute",top:vt(e),right:vt(e),left:vt(e),bottom:vt(e)}},darken:function(e,t){if("string"==typeof e&&e.startsWith("var(--"))return e;var n=xt(e),r=n.r,a=n.g,i=n.b,o=n.a,l=1-t,s=function(e){return Math.round(e*l)};return"rgba(".concat(s(r),", ").concat(s(a),", ").concat(s(i),", ").concat(o,")")},lighten:function(e,t){if("string"==typeof e&&e.startsWith("var(--"))return e;var n=xt(e),r=n.r,a=n.g,i=n.b,o=n.a,l=function(e){return Math.round(e+(255-e)*t)};return"rgba(".concat(l(r),", ").concat(l(a),", ").concat(l(i),", ").concat(o,")")},radius:function(e){return function(t){if("number"==typeof t)return vt(t);var n="number"==typeof e.defaultRadius?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}},variant:function(e){var t=ft(e),n=st(e),r=ht(e);return function(a){var i=a.variant,o=a.color,l=a.gradient,s=a.primaryFallback,c=function(e,t){if("string"==typeof e&&e.includes(".")){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split("."),2),r=n[0],a=n[1],i=parseInt(a,10);if(r in t.colors&&i>=0&&i<10)return{isSplittedColor:!0,key:r,shade:i}}return{isSplittedColor:!1}}(o,e);switch(i){case"light":return{border:"transparent",background:_t(t(o,"dark"===e.colorScheme?8:0,s,!1),"dark"===e.colorScheme?.2:1),color:"dark"===o?"dark"===e.colorScheme?e.colors.dark[0]:e.colors.dark[9]:t(o,"dark"===e.colorScheme?2:n("light")),hover:_t(t(o,"dark"===e.colorScheme?7:1,s,!1),"dark"===e.colorScheme?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:"dark"===o?"dark"===e.colorScheme?e.colors.dark[0]:e.colors.dark[9]:t(o,"dark"===e.colorScheme?2:n("light")),hover:_t(t(o,"dark"===e.colorScheme?8:0,s,!1),"dark"===e.colorScheme?.2:1)};case"outline":return{border:t(o,"dark"===e.colorScheme?5:n("light")),background:"transparent",color:t(o,"dark"===e.colorScheme?5:n("light")),hover:"dark"===e.colorScheme?_t(t(o,5,s,!1),.05):_t(t(o,0,s,!1),.35)};case"default":return{border:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[4],background:"dark"===e.colorScheme?e.colors.dark[6]:e.white,color:"dark"===e.colorScheme?e.white:e.black,hover:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(o,n()),hover:null};case"transparent":return{border:"transparent",color:"dark"===o?"dark"===e.colorScheme?e.colors.dark[0]:e.colors.dark[9]:t(o,"dark"===e.colorScheme?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(l),color:e.white,border:"transparent",hover:null};default:var u=n(),f=c.isSplittedColor?c.shade:u,d=c.isSplittedColor?c.key:o;return{border:"transparent",background:t(d,f,s),color:e.white,hover:t(d,9===f?8:f+1)}}}},primaryShade:st,hover:function(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}},gradient:ht,primaryColor:function(e){return function(t){var n=st(e)(t);return e.colors[e.primaryColor][n]}},placeholderStyles:function(e){return function(){return{userSelect:"none",color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[5]}}},dimmed:function(e){return function(){return"dark"===e.colorScheme?e.colors.dark[2]:e.colors.gray[6]}}};function St(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ot=Object.defineProperty,Et=Object.defineProperties,At=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Mt=function(e,t,n){return t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function Pt(e){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(e)}Object.keys(Qe);var Rt,It,Lt,Nt=(It=function(e,t){for(var n in t||(t={}))jt.call(t,n)&&Mt(e,n,t[n]);if(Ct){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return St(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?St(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Ct(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Dt.call(t,n)&&Mt(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},Rt={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:Qe,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:function(e){return{outlineOffset:"0.125rem",outline:"0.125rem solid ".concat(e.colors[e.primaryColor]["dark"===e.colorScheme?7:5])}},resetStyles:function(){return{outline:"none"}},inputStyles:function(e){return{outline:"none",borderColor:e.colors[e.primaryColor]["object"===Pt(e.primaryShade)?e.primaryShade[e.colorScheme]:e.primaryShade]}}}}),Lt={fn:{fontStyles:kt.fontStyles(Rt),themeColor:kt.themeColor(Rt),focusStyles:kt.focusStyles(Rt),largerThan:kt.largerThan(Rt),smallerThan:kt.smallerThan(Rt),radialGradient:kt.radialGradient,linearGradient:kt.linearGradient,gradient:kt.gradient(Rt),rgba:kt.rgba,cover:kt.cover,lighten:kt.lighten,darken:kt.darken,primaryShade:kt.primaryShade(Rt),radius:kt.radius(Rt),variant:kt.variant(Rt),hover:kt.hover,primaryColor:kt.primaryColor(Rt),placeholderStyles:kt.placeholderStyles(Rt),dimmed:kt.dimmed(Rt)}},Et(It,At(Lt)));function Tt(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,"".concat(vt(1)," dotted ButtonText");var zt=Object.defineProperty,Ht=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Wt=Object.prototype.propertyIsEnumerable,$t=function(e,t,n){return t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Bt=function(e,t){for(var n in t||(t={}))Vt.call(t,n)&&$t(e,n,t[n]);if(Ht){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Ht(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Wt.call(t,n)&&$t(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Yt=(0,e.createContext)({theme:Nt});function Ut(){var t;return(null==(t=(0,e.useContext)(Yt))?void 0:t.theme)||Nt}function Gt(){var t;return null==(t=(0,e.useContext)(Yt))?void 0:t.emotionCache}function qt(e,t,n){var r,a=Ut(),i=null==(r=a.components[e])?void 0:r.defaultProps,o="function"==typeof i?i(a):i;return Bt(Bt(Bt({},t),o),Tt(n))}function Zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kt(t){var n=t.value,r=t.defaultValue,a=t.finalValue,i=t.onChange,o=void 0===i?function(){}:i,l=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Zt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(void 0!==r?r:a),2),s=l[0],c=l[1];return void 0!==n?[n,o,!0]:[s,function(e){c(e),null==o||o(e)},!1]}function Xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jt=function(e){return"range"===e?[null,null]:"multiple"===e?[]:null};function Qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function en(e,t){var n=function(e){return function(e){if(Array.isArray(e))return Qt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t).sort((function(e,t){return e.getTime()-t.getTime()}));return g()(n[0]).startOf("day").subtract(1,"ms").isBefore(e)&&g()(n[1]).endOf("day").add(1,"ms").isAfter(e)}function tn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||nn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nn(e,t){if(e){if("string"==typeof e)return rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rn(e,t):void 0}}function rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function an(t){var n=t.type,r=t.level,a=t.value,i=t.defaultValue,o=t.onChange,l=t.allowSingleDateInRange,s=t.allowDeselect,c=t.onMouseLeave,u=function(t){var n=t.type,r=t.value,a=t.defaultValue,i=t.onChange,o=(0,e.useRef)(n),l=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Kt({value:r,defaultValue:a,onChange:i,finalValue:Jt(n)}),2),s=l[0],c=l[1],u=s;return o.current!==n&&(o.current=n,void 0===r&&c(u=void 0!==a?a:Jt(n))),[u,c]}({type:n,value:a,defaultValue:i,onChange:o}),f=tn(u,2),d=f[0],h=f[1],p=tn((0,e.useState)("range"===n&&d[0]&&!d[1]?d[0]:null),2),v=p[0],m=p[1],y=tn((0,e.useState)(null),2),b=y[0],x=y[1],_=function(e){return v instanceof Date&&b instanceof Date?en(e,[b,v]):d[0]instanceof Date&&d[1]instanceof Date&&en(e,d)},w=function(e){return d[0]instanceof Date&&!!g()(e).isSame(d[0],r)&&!(b&&g()(b).isBefore(d[0]))},k=function(e){return d[1]instanceof Date?g()(e).isSame(d[1],r):!!(d[0]instanceof Date&&b)&&g()(b).isBefore(d[0])&&g()(e).isSame(d[0],r)};return{onDateChange:function(e){if("range"===n){if(v instanceof Date&&!d[1]){if(g()(e).isSame(v,r)&&!l)return m(null),x(null),void h([null,null]);var t=[e,v];return t.sort((function(e,t){return e.getTime()-t.getTime()})),h(t),x(null),void m(null)}return d[0]&&!d[1]&&g()(e).isSame(d[0],r)&&!l?(m(null),x(null),void h([null,null])):(h([e,null]),x(null),void m(e))}"multiple"!==n?d&&s&&g()(e).isSame(d,r)?h(null):h(e):d.some((function(t){return g()(t).isSame(e,r)}))?h(d.filter((function(t){return!g()(t).isSame(e,r)}))):h([].concat(function(e){return function(e){if(Array.isArray(e))return rn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(d),[e]))},onRootMouseLeave:"range"===n?function(e){null==c||c(e),x(null)}:c,onHoveredDateChange:"range"===n&&v?x:function(){},getControlProps:function(e){if("range"===n)return{selected:d.some((function(t){return t&&g()(t).isSame(e,r)})),inRange:_(e),firstInRange:w(e),lastInRange:k(e),"data-autofocus":!!d[0]&&g()(d[0]).isSame(e,r)||void 0};if("multiple"===n)return{selected:d.some((function(t){return t&&g()(t).isSame(e,r)})),"data-autofocus":!!d[0]&&g()(d[0]).isSame(e,r)||void 0};var t=g()(d).isSame(e,r);return{selected:t,"data-autofocus":t||void 0}},_value:d,setValue:h}}function on(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ln=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable;function un(e){var t=e,n=t.m,r=t.mx,a=t.my,i=t.mt,o=t.mb,l=t.ml,s=t.mr,c=t.p,u=t.px,f=t.py,d=t.pt,h=t.pb,p=t.pl,v=t.pr,m=t.bg,y=t.c,g=t.opacity,b=t.ff,x=t.fz,_=t.fw,w=t.lts,k=t.ta,S=t.lh,O=t.fs,E=t.tt,A=t.td,C=t.w,j=t.miw,D=t.maw,M=t.h,P=t.mih,R=t.mah,I=t.bgsz,L=t.bgp,N=t.bgr,T=t.bga,F=t.pos,z=t.top,H=t.left,V=t.bottom,W=t.right,$=t.inset,B=t.display,Y=function(e,t){var n={};for(var r in e)sn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ln){var a,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return on(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?on(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ln(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&cn.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:Tt({m:n,mx:r,my:a,mt:i,mb:o,ml:l,mr:s,p:c,px:u,py:f,pt:d,pb:h,pl:p,pr:v,bg:m,c:y,opacity:g,ff:b,fz:x,fw:_,lts:w,ta:k,lh:S,fs:O,tt:E,td:A,w:C,miw:j,maw:D,h:M,mih:P,mah:R,bgsz:I,bgp:L,bgr:N,bga:T,pos:F,top:z,left:H,bottom:V,right:W,inset:$,display:B}),rest:Y}}function fn(e){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fn(e)}function dn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"===fn(e))if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=dn(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function hn(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=dn(e))&&(r&&(r+=" "),r+=t);return r}function pn(e){return function(e){if(Array.isArray(e))return vn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return vn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mn=ke({key:"mantine",prepend:!0});function yn(e,t){if(e){if("string"==typeof e)return gn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gn(e,t):void 0}}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bn=Object.defineProperty,xn=Object.getOwnPropertySymbols,_n=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable,kn=function(e,t,n){return t in e?bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function Sn(e){var t;if(1!==e.length)return{args:e,ref:t};var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||yn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,1)[0];if(!(n instanceof Object))return{args:e,ref:t};if(!("ref"in n))return{args:e,ref:t};t=n.ref;var r=function(e,t){for(var n in t||(t={}))_n.call(t,n)&&kn(e,n,t[n]);if(xn){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=yn(e))){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(xn(t));try{for(a.s();!(r=a.n()).done;)n=r.value,wn.call(t,n)&&kn(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},n);return delete r.ref,{args:[r],ref:t}}var On=function(){function e(e,t,n){var r=[],a=Se(e,r,n);return r.length<2?n:a+t(r)}return{cssFactory:function(t){var n=t.cache,r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=Sn(t),i=a.ref,o=a.args,l=ze(o,n.registered);return Ee(n,l,!1),"".concat(n.key,"-").concat(l.name).concat(void 0===i?"":" ".concat(i))};return{css:r,cx:function(){for(var t=arguments.length,a=new Array(t),i=0;i<t;i++)a[i]=arguments[i];return e(n.registered,r,hn(a))}}}}}().cssFactory;function En(){var t,n,r,a=Gt()||mn;return t=function(){return On({cache:a})},n=[a],(!(r=(0,e.useRef)()).current||n.length!==r.current.prevDeps.length||r.current.prevDeps.map((function(e,t){return e===n[t]})).indexOf(!1)>=0)&&(r.current={v:t(),prevDeps:pn(n)}),r.current.v}function An(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cn(e){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cn(e)}function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Dn(e){var t=e.value,n=e.theme,r=e.getValue,a=e.property;if(null!=t){if("object"===Cn(t)){var i=function(e,t){var n=Object.keys(e).filter((function(e){return"base"!==e})).sort((function(e,n){return gt(yt({size:e,sizes:t.breakpoints}))-gt(yt({size:n,sizes:t.breakpoints}))}));return"base"in e?["base"].concat(function(e){return function(e){if(Array.isArray(e))return jn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n)):n}(t,n).reduce((function(e,i){if("base"===i&&void 0!==t.base){var o=r(t.base,n);return Array.isArray(a)?(a.forEach((function(t){e[t]=o})),e):(e[a]=o,e)}var l=r(t[i],n);return Array.isArray(a)?(e[n.fn.largerThan(i)]={},a.forEach((function(t){e[n.fn.largerThan(i)][t]=l})),e):(e[n.fn.largerThan(i)]=An({},a,l),e)}),{});return i}var o=r(t,n);return Array.isArray(a)?a.reduce((function(e,t){return e[t]=o,e}),{}):An({},a,o)}}var Mn=["-xs","-sm","-md","-lg","-xl"],Pn={identity:function(e){return e},color:function(e,t){return"dimmed"===e?"dark"===t.colorScheme?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background},size:function(e){return vt(e)},fontSize:function(e,t){return yt({size:e,sizes:t.fontSizes})},spacing:function(e,t){return Mn.includes(e)?"calc(".concat(yt({size:e.replace("-",""),sizes:t.spacing})," * -1)"):yt({size:e,sizes:t.spacing})}},Rn={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};function In(e){return In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},In(e)}function Ln(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nn=Object.defineProperty,Tn=Object.getOwnPropertySymbols,Fn=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable,Hn=function(e,t,n){return t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Vn=function(e,t){for(var n in t||(t={}))Fn.call(t,n)&&Hn(e,n,t[n]);if(Tn){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ln(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ln(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Tn(t));try{for(a.s();!(r=a.n()).done;)n=r.value,zn.call(t,n)&&Hn(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function Wn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rn,r=Object.keys(n).reduce((function(r,a){return a in e&&void 0!==e[a]&&r.push(Dn({value:e[a],getValue:Pn[n[a].type],property:n[a].property,theme:t})),r}),[]);return r.reduce((function(e,t){return Object.keys(t).forEach((function(n){"object"===In(t[n])&&null!==t[n]?e[n]=n in e?Vn(Vn({},e[n]),t[n]):t[n]:e[n]=t[n]})),e}),{})}function $n(e,t){return"function"==typeof e?e(t):e}function Bn(e,t,n){var r=Ut(),a=En(),i=a.css,o=a.cx;return Array.isArray(e)?o(n,i(Wn(t,r)),e.map((function(e){return i($n(e,r))}))):o(n,i($n(e,r)),i(Wn(t,r)))}function Yn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Un(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Gn=Object.defineProperty,qn=Object.getOwnPropertySymbols,Zn=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,Xn=function(e,t,n){return t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Jn=(0,e.forwardRef)((function(e,n){var r=e,a=r.className,i=r.component,o=r.style,l=r.sx,s=un(function(e,t){var n={};for(var r in e)Zn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&qn){var a,i=Yn(qn(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Kn.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","component","style","sx"])),c=s.systemStyles,u=s.rest,f=i||"div";return t().createElement(f,function(e,t){for(var n in t||(t={}))Zn.call(t,n)&&Xn(e,n,t[n]);if(qn){var r,a=Yn(qn(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Kn.call(t,n)&&Xn(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({ref:n,className:Bn(l,c,a),style:o},u))}));Jn.displayName="@mantine/core/Box";var Qn=Jn;function er(e,t){return e?"month"===e?0:"year"===e?1:2:t}function tr(e,t,n){return a=er(e,0),i=er(t,0),o=er(n,2),0===(r=Math.min(Math.max(a,i),o))?"month":1===r?"year":"decade";var r,a,i,o}function nr(e){var t=e.cx,n=e.classes,r=e.context,a=e.classNames,i=e.name,o=e.cache,l=r.reduce((function(e,t){return Object.keys(t.classNames).forEach((function(n){"string"!=typeof e[n]?e[n]="".concat(t.classNames[n]):e[n]="".concat(e[n]," ").concat(t.classNames[n])})),e}),{});return Object.keys(n).reduce((function(e,r){return e[r]=t(n[r],l[r],null!=a&&a[r],Array.isArray(i)?i.filter(Boolean).map((function(e){return"".concat((null==o?void 0:o.key)||"mantine","-").concat(e,"-").concat(r)})).join(" "):i?"".concat((null==o?void 0:o.key)||"mantine","-").concat(i,"-").concat(r):null),e}),{})}function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ar=Object.defineProperty,ir=Object.getOwnPropertySymbols,or=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable,sr=function(e,t,n){return t in e?ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},cr=function(e,t){for(var n in t||(t={}))or.call(t,n)&&sr(e,n,t[n]);if(ir){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ir(t));try{for(a.s();!(r=a.n()).done;)n=r.value,lr.call(t,n)&&sr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function ur(e,t){return t&&Object.keys(t).forEach((function(n){e[n]?e[n]=cr(cr({},e[n]),t[n]):e[n]=cr({},t[n])})),e}function fr(e,t,n,r){var a=function(e){return"function"==typeof e?e(t,n||{},r):e||{}};return Array.isArray(e)?e.map((function(e){return a(e.styles)})).reduce((function(e,t){return ur(e,t)}),{}):a(e)}function dr(e){var t="function"==typeof e?e:function(){return e};return function(e,n){var r=Ut(),a=function(e){var t=Ut(),n=function(e){var n,r,a,i;return{styles:(null==(n=t.components[e])?void 0:n.styles)||{},classNames:(null==(r=t.components[e])?void 0:r.classNames)||{},variants:null==(a=t.components[e])?void 0:a.variants,sizes:null==(i=t.components[e])?void 0:i.sizes}};return Array.isArray(e)?e.map(n):[n(e)]}(null==n?void 0:n.name),i=Gt(),o={variant:null==n?void 0:n.variant,size:null==n?void 0:n.size},l=En(),s=l.css,c=l.cx,u=t(r,e,o),f=fr(null==n?void 0:n.styles,r,e,o),d=fr(a,r,e,o),h=function(e){var t=e.theme,n=e.params,r=e.variant,a=e.size;return e.ctx.reduce((function(e,i){return i.variants&&r in i.variants&&ur(e,i.variants[r](t,n,{variant:r,size:a})),i.sizes&&a in i.sizes&&ur(e,i.sizes[a](t,n,{variant:r,size:a})),e}),{})}({ctx:a,theme:r,params:e,variant:null==n?void 0:n.variant,size:null==n?void 0:n.size}),p=Object.fromEntries(Object.keys(u).map((function(e){return[e,c(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},s(u[e]),!(null==n?void 0:n.unstyled)),s(h[e]),s(d[e]),s(f[e]))]})));return{classes:nr({cx:c,classes:p,context:a,classNames:null==n?void 0:n.classNames,name:null==n?void 0:n.name,cache:i}),cx:c,theme:r}}}const hr=dr((function(){return{calendar:{}}}));var pr=dr((function(e,t,n){return{monthLevelGroup:{display:"flex","& [data-month-level]:not(:last-of-type)":{marginRight:yt({size:n.size,sizes:e.spacing})}}}}));const vr=pr,mr=dr((function(e){return{monthLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var yr={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–"},gr=(0,e.createContext)(yr);function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xr=Object.defineProperty,_r=Object.defineProperties,wr=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Sr=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,Er=function(e,t,n){return t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function Ar(){var t,n=(0,e.useContext)(gr),r=(0,e.useCallback)((function(e){return e||n.locale}),[n.locale]),a=(0,e.useCallback)((function(e){return"number"==typeof e?e:n.firstDayOfWeek}),[n.firstDayOfWeek]),i=(0,e.useCallback)((function(e){return Array.isArray(e)?e:n.weekendDays}),[n.weekendDays]),o=(0,e.useCallback)((function(e){return"string"==typeof e?e:n.labelSeparator}),[n.labelSeparator]);return t=function(e,t){for(var n in t||(t={}))Sr.call(t,n)&&Er(e,n,t[n]);if(kr){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?br(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(kr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Or.call(t,n)&&Er(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({},n),_r(t,wr({getLocale:r,getFirstDayOfWeek:a,getWeekendDays:i,getLabelSeparator:o}))}function Cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jr=Object.defineProperty,Dr=Object.defineProperties,Mr=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertySymbols,Rr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Lr=function(e,t,n){return t in e?jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Nr=function(e,t){for(var n in t||(t={}))Rr.call(t,n)&&Lr(e,n,t[n]);if(Pr){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Pr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ir.call(t,n)&&Lr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};const Tr=dr((function(e){return{root:(t=Nr(Nr({},e.fn.focusStyles()),e.fn.fontStyles()),n={cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"},Dr(t,Mr(n)))};var t,n}));function Fr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return zr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hr=Object.defineProperty,Vr=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Br=function(e,t,n){return t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Yr=(0,e.forwardRef)((function(e,n){var r=qt("UnstyledButton",{},e),a=r.className,i=r.component,o=void 0===i?"button":i,l=r.unstyled,s=r.variant,c=function(e,t){var n={};for(var r in e)Wr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Vr){var a,i=Fr(Vr(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&$r.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","component","unstyled","variant"]),u=Tr(null,{name:"UnstyledButton",unstyled:l,variant:s}),f=u.classes,d=u.cx;return t().createElement(Qn,function(e,t){for(var n in t||(t={}))Wr.call(t,n)&&Br(e,n,t[n]);if(Vr){var r,a=Fr(Vr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,$r.call(t,n)&&Br(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:o,ref:n,className:d(f.root,a),type:"button"===o?"button":void 0},c))}));Yr.displayName="@mantine/core/UnstyledButton";var Ur=Yr;function Gr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return qr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function qr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Zr=Object.defineProperty,Kr=Object.getOwnPropertySymbols,Xr=Object.prototype.hasOwnProperty,Jr=Object.prototype.propertyIsEnumerable,Qr=function(e,t,n){return t in e?Zr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ea=function(e,t){for(var n in t||(t={}))Xr.call(t,n)&&Qr(e,n,t[n]);if(Kr){var r,a=Gr(Kr(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Jr.call(t,n)&&Qr(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};function ta(e){var n=e,r=n.style,a=function(e,t){var n={};for(var r in e)Xr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Kr){var a,i=Gr(Kr(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Jr.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(n,["style"]);return t().createElement("svg",ea({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:ea({width:vt(16),height:vt(16)},r)},a),t().createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function na(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ra(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ra(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var aa=Object.defineProperty,ia=Object.defineProperties,oa=Object.getOwnPropertyDescriptors,la=Object.getOwnPropertySymbols,sa=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable,ua=function(e,t,n){return t in e?aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},fa=function(e,t){for(var n in t||(t={}))sa.call(t,n)&&ua(e,n,t[n]);if(la){var r,a=na(la(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ca.call(t,n)&&ua(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},da=function(e,t){return ia(e,oa(t))};function ha(e){var n=e,r=n.direction,a=n.style,i=function(e,t){var n={};for(var r in e)sa.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&la){var a,i=na(la(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&ca.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(n,["direction","style"]),o=Ut();return t().createElement(ta,da(fa({},i),{style:da(fa({},a),{transform:"next"===r&&"ltr"===o.dir||"previous"===r&&"rtl"===o.dir?"rotate(270deg)":"rotate(90deg)"})}))}function pa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ha.displayName="@mantine/dates/Chevron";var va=Object.defineProperty,ma=Object.defineProperties,ya=Object.getOwnPropertyDescriptors,ga=Object.getOwnPropertySymbols,ba=Object.prototype.hasOwnProperty,xa=Object.prototype.propertyIsEnumerable,_a=function(e,t,n){return t in e?va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},wa=function(e,t){for(var n in t||(t={}))ba.call(t,n)&&_a(e,n,t[n]);if(ga){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return pa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ga(t));try{for(a.s();!(r=a.n()).done;)n=r.value,xa.call(t,n)&&_a(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},ka=function(e,t){return ma(e,ya(t))},Sa={xs:vt(30),sm:vt(36),md:vt(42),lg:vt(48),xl:vt(54)},Oa=dr((function(e,t,n){var r=t.radius,a=t.isStatic,i=n.size,o=e.fn.variant({variant:"filled"}),l=e.fn.variant({variant:"light"});return{day:ka(wa({width:yt({size:i,sizes:Sa}),height:yt({size:i,sizes:Sa}),fontSize:yt({size:i,sizes:e.fontSizes}),display:"inline-flex",justifyContent:"center",alignItems:"center",userSelect:a?void 0:"none",cursor:a?"default":"pointer",borderRadius:e.fn.radius(r)},a?null:e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":a?void 0:e.activeStyles,"&[data-disabled]":ka(wa({color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}}),"&[data-weekend]":{color:e.colors.red[e.fn.primaryShade()]},"&[data-outside]":{color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4]},"&[data-in-range]":wa({backgroundColor:l.background,borderRadius:0},a?null:e.fn.hover({backgroundColor:l.hover})),"&[data-first-in-range]":{borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-selected]":wa({color:o.color,backgroundColor:o.background},a?null:e.fn.hover({backgroundColor:o.hover})),"&[data-hidden]":{display:"none"}})}}));const Ea=Oa;function Aa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ca=Object.defineProperty,ja=Object.defineProperties,Da=Object.getOwnPropertyDescriptors,Ma=Object.getOwnPropertySymbols,Pa=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,Ia=function(e,t,n){return t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},La=function(e,t){for(var n in t||(t={}))Pa.call(t,n)&&Ia(e,n,t[n]);if(Ma){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Aa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Aa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(Ma(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ra.call(t,n)&&Ia(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Na=function(e,t){return ja(e,Da(t))},Ta=dr((function(e,t,n){var r=n.size,a=yt({size:r,sizes:Sa});return{calendarHeaderControlIcon:{},calendarHeader:{display:"flex",maxWidth:"calc(".concat(a," * 7 + ").concat(vt(7),")")},calendarHeaderControl:Na(La({width:a,height:a,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none"},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-disabled]":Na(La({opacity:.2,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})}),calendarHeaderLevel:Na(La({height:a,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",flex:1,fontSize:yt({size:r,sizes:e.fontSizes}),fontWeight:500,textTransform:"capitalize"},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-static]":Na(La({cursor:"default",userSelect:"unset"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}));const Fa=Ta;function za(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ha(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ha(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Va=Object.defineProperty,Wa=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ba=Object.prototype.propertyIsEnumerable,Ya=function(e,t,n){return t in e?Va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ua={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0,size:"sm"},Ga=(0,e.forwardRef)((function(e,n){var r=qt("CalendarHeader",Ua,e),a=r.className,i=r.nextIcon,o=r.previousIcon,l=r.nextLabel,s=r.previousLabel,c=r.onNext,u=r.onPrevious,f=r.onLevelClick,d=r.label,h=r.classNames,p=r.styles,v=r.unstyled,m=r.nextDisabled,y=r.previousDisabled,g=r.hasNextLevel,b=r.levelControlAriaLabel,x=r.withNext,_=r.withPrevious,w=r.__staticSelector,k=r.__preventFocus,S=r.__stopPropagation,O=r.size,E=r.variant,A=function(e,t){var n={};for(var r in e)$a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Wa){var a,i=za(Wa(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ba.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","label","classNames","styles","unstyled","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","__staticSelector","__preventFocus","__stopPropagation","size","variant"]),C=Fa(null,{name:["CalendarHeader",w],classNames:h,styles:p,unstyled:v,size:O,variant:E}),j=C.classes,D=C.cx,M=k?function(e){return e.preventDefault()}:void 0;return t().createElement(Qn,function(e,t){for(var n in t||(t={}))$a.call(t,n)&&Ya(e,n,t[n]);if(Wa){var r,a=za(Wa(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ba.call(t,n)&&Ya(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:D(j.calendarHeader,a),ref:n},A),_&&t().createElement(Ur,{className:j.calendarHeaderControl,"data-previous":!0,"aria-label":s,onClick:u,unstyled:v,onMouseDown:M,disabled:y,"data-disabled":y||void 0,tabIndex:k?-1:0,"data-mantine-stop-propagation":S||void 0},o||t().createElement(ha,{className:j.calendarHeaderControlIcon,direction:"previous","data-previous":!0})),t().createElement(Ur,{component:g?"button":"div",className:j.calendarHeaderLevel,onClick:g?f:void 0,unstyled:v,onMouseDown:g?M:void 0,disabled:!g,"data-static":!g||void 0,"aria-label":b,tabIndex:k||!g?-1:0,"data-mantine-stop-propagation":S||void 0},d),x&&t().createElement(Ur,{className:j.calendarHeaderControl,"data-next":!0,"aria-label":l,onClick:c,unstyled:v,onMouseDown:M,disabled:m,"data-disabled":m||void 0,tabIndex:k?-1:0,"data-mantine-stop-propagation":S||void 0},i||t().createElement(ha,{className:j.calendarHeaderControlIcon,direction:"next","data-next":!0})))}));function qa(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=new Date(e);n.getDay()!==t;)n.setDate(n.getDate()-1);return n}function Za(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=new Date(e),r=0===t?6:t-1;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function Ka(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function Xa(e,t){return!(t instanceof Date)||g()(e).isBefore(g()(t).add(1,"day"),"day")}function Ja(e,t){return!(t instanceof Date)||g()(e).isAfter(g()(t).subtract(1,"day"),"day")}function Qa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ga.displayName="@mantine/dates/CalendarHeader";var ei=Object.defineProperty,ti=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,ri=Object.getOwnPropertySymbols,ai=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable,oi=function(e,t,n){return t in e?ei(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},li=function(e,t){for(var n in t||(t={}))ai.call(t,n)&&oi(e,n,t[n]);if(ri){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Qa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(ri(t));try{for(a.s();!(r=a.n()).done;)n=r.value,ii.call(t,n)&&oi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e};const si=dr((function(e){return{monthThead:{},monthRow:{},monthTbody:{},monthCell:{padding:0,"&[data-with-spacing]":{padding:vt(.5)}},month:(t=li({},e.fn.fontStyles()),n={borderCollapse:"collapse",tableLayout:"fixed","& *":{boxSizing:"border-box"}},ti(t,ni(n)))};var t,n}));function ci(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ui(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ui(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function ui(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fi=Object.defineProperty,di=Object.getOwnPropertySymbols,hi=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable,vi=function(e,t,n){return t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},mi={tabIndex:0,size:"sm"},yi=(0,e.forwardRef)((function(e,n){var r=qt("Day",mi,e),a=r.className,i=r.date,o=r.radius,l=r.disabled,s=r.styles,c=r.classNames,u=r.unstyled,f=r.__staticSelector,d=r.weekend,h=r.outside,p=r.selected,v=r.renderDay,m=r.inRange,y=r.firstInRange,b=r.lastInRange,x=r.hidden,_=r.static,w=r.variant,k=r.size,S=function(e,t){var n={};for(var r in e)hi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&di){var a,i=ci(di(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&pi.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","date","radius","disabled","styles","classNames","unstyled","__staticSelector","weekend","outside","selected","renderDay","inRange","firstInRange","lastInRange","hidden","static","variant","size"]),O=Ea({radius:o,isStatic:_},{name:["Day",f],classNames:c,styles:s,unstyled:u,variant:w,size:k}),E=O.classes,A=O.cx;return t().createElement(Ur,function(e,t){for(var n in t||(t={}))hi.call(t,n)&&vi(e,n,t[n]);if(di){var r,a=ci(di(t));try{for(a.s();!(r=a.n()).done;)n=r.value,pi.call(t,n)&&vi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:_?"div":"button",ref:n,className:A(E.day,a),disabled:l,"data-today":g()(i).isSame(new Date,"day")||void 0,"data-hidden":x||void 0,"data-disabled":l||void 0,"data-weekend":!l&&!h&&d||void 0,"data-outside":!l&&h||void 0,"data-selected":!l&&p||void 0,"data-in-range":m&&!l||void 0,"data-first-in-range":y&&!l||void 0,"data-last-in-range":b&&!l||void 0,unstyled:u},S),(null==v?void 0:v(i))||i.getDate())}));yi.displayName="@mantine/dates/Day";var gi=dr((function(e,t,n){var r=n.size;return{weekdaysRow:{},weekday:{color:"dark"===e.colorScheme?e.colors.dark[1]:e.colors.gray[5],fontWeight:400,fontSize:yt({size:r,sizes:e.fontSizes}),textTransform:"capitalize",paddingBottom:"calc(".concat(yt({size:r,sizes:e.spacing})," / 2)")}}}));const bi=gi;function xi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var wi=Object.defineProperty,ki=Object.getOwnPropertySymbols,Si=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,Ei=function(e,t,n){return t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ai={weekdayFormat:"dd",cellComponent:"th",size:"sm"},Ci=(0,e.forwardRef)((function(e,n){var r=qt("WeekdaysRow",Ai,e),a=r.className,i=r.locale,o=r.firstDayOfWeek,l=r.weekdayFormat,s=r.cellComponent,c=r.__staticSelector,u=r.classNames,f=r.styles,d=r.unstyled,h=r.variant,p=r.size,v=function(e,t){var n={};for(var r in e)Si.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ki){var a,i=xi(ki(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Oi.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","locale","firstDayOfWeek","weekdayFormat","cellComponent","__staticSelector","classNames","styles","unstyled","variant","size"]),m=Ar(),y=bi(null,{name:["WeekdaysRow",c],classNames:u,styles:f,unstyled:d,variant:h,size:p}),b=y.classes,x=y.cx,_=function(e){for(var t=e.locale,n=e.format,r=void 0===n?"dd":n,a=e.firstDayOfWeek,i=void 0===a?1:a,o=g()().day(i),l=[],s=0;s<7;s+=1)"string"==typeof r?l.push(g()(o).add(s,"days").locale(t).format(r)):l.push(r(g()(o).add(s,"days").toDate()));return l}({locale:m.getLocale(i),format:l,firstDayOfWeek:m.getFirstDayOfWeek(o)}).map((function(e,n){return t().createElement(s,{key:n,className:b.weekday},e)}));return t().createElement(Qn,function(e,t){for(var n in t||(t={}))Si.call(t,n)&&Ei(e,n,t[n]);if(ki){var r,a=xi(ki(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Oi.call(t,n)&&Ei(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({component:"tr",ref:n,className:x(b.weekdaysRow,a)},v),_)}));function ji(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Di(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Di(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Di(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ci.displayName="@mantine/dates/WeekdaysRow";var Mi=Object.defineProperty,Pi=Object.defineProperties,Ri=Object.getOwnPropertyDescriptors,Ii=Object.getOwnPropertySymbols,Li=Object.prototype.hasOwnProperty,Ni=Object.prototype.propertyIsEnumerable,Ti=function(e,t,n){return t in e?Mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Fi=function(e,t){for(var n in t||(t={}))Li.call(t,n)&&Ti(e,n,t[n]);if(Ii){var r,a=ji(Ii(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ni.call(t,n)&&Ti(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},zi=function(e,t){return Pi(e,Ri(t))},Hi={size:"sm",withCellSpacing:!0},Vi=(0,e.forwardRef)((function(e,n){var r=qt("Month",Hi,e),a=r.className,i=r.classNames,o=r.styles,l=r.unstyled,s=r.__staticSelector,c=r.locale,u=r.firstDayOfWeek,f=r.weekdayFormat,d=r.month,h=r.weekendDays,p=r.getDayProps,v=r.excludeDate,m=r.minDate,y=r.maxDate,b=r.renderDay,x=r.hideOutsideDates,_=r.hideWeekdays,w=r.getDayAriaLabel,k=r.static,S=r.__getDayRef,O=r.__onDayKeyDown,E=r.__onDayClick,A=r.__onDayMouseEnter,C=r.__preventFocus,j=r.__stopPropagation,D=r.withCellSpacing,M=r.size,P=r.variant,R=function(e,t){var n={};for(var r in e)Li.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ii){var a,i=ji(Ii(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ni.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","classNames","styles","unstyled","__staticSelector","locale","firstDayOfWeek","weekdayFormat","month","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","static","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","__preventFocus","__stopPropagation","withCellSpacing","size","variant"]),I=Ar(),L=si(null,{name:["Month",s],classNames:i,styles:o,unstyled:l,variant:P,size:M}),N=L.classes,T=L.cx,F={__staticSelector:s||"Month",classNames:i,styles:o,unstyled:l,variant:P,size:M},z=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getMonth(),r=new Date(e.getFullYear(),n,1),a=Za(new Date(e.getFullYear(),e.getMonth()+1,0),t),i=qa(r,t),o=[];i<=a;){for(var l=[],s=0;s<7;s+=1)l.push(new Date(i)),i.setDate(i.getDate()+1);o.push(l)}return o}(d,I.getFirstDayOfWeek(u)),H=function(e,t,n,r,a,i,o){var l=e.flat().filter((function(e){var l;return Xa(e,n)&&Ja(e,t)&&!(null==a?void 0:a(e))&&!(null==(l=null==r?void 0:r(e))?void 0:l.disabled)&&(!i||Ka(e,o))})),s=l.find((function(e){var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected}));return s||l.find((function(e){return g()().isSame(e,"date")}))||l[0]}(z,m,y,p,v,x,d),V=z.map((function(e,n){var r=e.map((function(e,r){var a=!Ka(e,d),i=(null==w?void 0:w(e))||g()(e).locale(c||I.locale).format("D MMMM YYYY"),o=null==p?void 0:p(e),l=g()(e).isSame(H,"date");return t().createElement("td",{key:e.toString(),className:N.monthCell,"data-with-spacing":D||void 0},t().createElement(yi,zi(Fi(zi(Fi({},F),{"data-mantine-stop-propagation":j||void 0,renderDay:b,date:e,weekend:I.getWeekendDays(h).includes(e.getDay()),outside:a,hidden:!!x&&a,"aria-label":i,static:k,disabled:(null==v?void 0:v(e))||!Xa(e,y)||!Ja(e,m),ref:function(e){return null==S?void 0:S(n,r,e)}}),o),{onKeyDown:function(t){var a;null==(a=null==o?void 0:o.onKeyDown)||a.call(o,t),null==O||O(t,{rowIndex:n,cellIndex:r,date:e})},onMouseEnter:function(t){var n;null==(n=null==o?void 0:o.onMouseEnter)||n.call(o,t),null==A||A(t,e)},onClick:function(t){var n;null==(n=null==o?void 0:o.onClick)||n.call(o,t),null==E||E(t,e)},onMouseDown:function(e){var t;null==(t=null==o?void 0:o.onMouseDown)||t.call(o,e),C&&e.preventDefault()},tabIndex:C||!l?-1:0})))}));return t().createElement("tr",{key:n,className:N.monthRow},r)}));return t().createElement(Qn,Fi({component:"table",className:T(N.month,a),ref:n},R),!_&&t().createElement("thead",{className:N.monthThead},t().createElement(Ci,zi(Fi({},F),{locale:c,firstDayOfWeek:u,weekdayFormat:f}))),t().createElement("tbody",{className:N.monthTbody},V))}));function Wi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return $i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function $i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Vi.displayName="@mantine/dates/Month";var Bi=Object.defineProperty,Yi=Object.getOwnPropertySymbols,Ui=Object.prototype.hasOwnProperty,Gi=Object.prototype.propertyIsEnumerable,qi=function(e,t,n){return t in e?Bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Zi=function(e,t){for(var n in t||(t={}))Ui.call(t,n)&&qi(e,n,t[n]);if(Yi){var r,a=Wi(Yi(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Gi.call(t,n)&&qi(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Ki={monthLabelFormat:"MMMM YYYY"},Xi=(0,e.forwardRef)((function(e,n){var r=qt("MonthLevel",Ki,e),a=r.month,i=r.locale,o=r.firstDayOfWeek,l=r.weekdayFormat,s=r.weekendDays,c=r.getDayProps,u=r.excludeDate,f=r.minDate,d=r.maxDate,h=r.renderDay,p=r.hideOutsideDates,v=r.hideWeekdays,m=r.getDayAriaLabel,y=r.__getDayRef,b=r.__onDayKeyDown,x=r.__onDayClick,_=r.__onDayMouseEnter,w=r.withCellSpacing,k=r.__preventFocus,S=r.__stopPropagation,O=r.nextIcon,E=r.previousIcon,A=r.nextLabel,C=r.previousLabel,j=r.onNext,D=r.onPrevious,M=r.onLevelClick,P=r.nextDisabled,R=r.previousDisabled,I=r.hasNextLevel,L=r.levelControlAriaLabel,N=r.withNext,T=r.withPrevious,F=r.className,z=r.monthLabelFormat,H=r.classNames,V=r.styles,W=r.unstyled,$=r.__staticSelector,B=r.size,Y=r.variant,U=r.static,G=function(e,t){var n={};for(var r in e)Ui.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Yi){var a,i=Wi(Yi(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Gi.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","__stopPropagation","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","monthLabelFormat","classNames","styles","unstyled","__staticSelector","size","variant","static"]),q=mr(null,{name:["MonthLevel",$],classNames:H,styles:V,unstyled:W,variant:Y,size:B}),Z=q.classes,K=q.cx,X=Ar(),J={__staticSelector:$||"MonthLevel",classNames:H,styles:V,unstyled:W,variant:Y,size:B},Q="boolean"==typeof P?P:!!d&&!g()(a).endOf("month").isBefore(d),ee="boolean"==typeof R?R:!!f&&!g()(a).startOf("month").isAfter(f);return t().createElement(Qn,Zi({className:K(Z.monthLevel,F),"data-month-level":!0,ref:n},G),t().createElement(Ga,Zi({label:"function"==typeof z?z(a):g()(a).locale(i||X.locale).format(z),className:Z.calendarHeader,__preventFocus:k,__stopPropagation:S,nextIcon:O,previousIcon:E,nextLabel:A,previousLabel:C,onNext:j,onPrevious:D,onLevelClick:M,nextDisabled:Q,previousDisabled:ee,hasNextLevel:I,levelControlAriaLabel:L,withNext:N,withPrevious:T},J)),t().createElement(Vi,Zi({month:a,locale:i,firstDayOfWeek:o,weekdayFormat:l,weekendDays:s,getDayProps:c,excludeDate:u,minDate:f,maxDate:d,renderDay:h,hideOutsideDates:p,hideWeekdays:v,getDayAriaLabel:m,__getDayRef:y,__onDayKeyDown:b,__onDayClick:x,__onDayMouseEnter:_,__preventFocus:k,__stopPropagation:S,static:U,withCellSpacing:w},J)))}));function Ji(e){var t,n,r=e.controlsRef,a=e.direction,i=e.levelIndex,o=e.rowIndex,l=e.cellIndex,s=e.size,c=function(e){var t=e.levelIndex,n=e.rowIndex,r=e.cellIndex,a=e.size;switch(e.direction){case"up":return 0===t&&0===n?null:0===n?{levelIndex:t-1,rowIndex:r<=a[t-1][a[t-1].length-1]-1?a[t-1].length-1:a[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:n-1,cellIndex:r};case"down":return n===a[t].length-1||n===a[t].length-2&&r>=a[t][a[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:n+1,cellIndex:r};case"left":return 0===t&&0===n&&0===r?null:0===n&&0===r?{levelIndex:t-1,rowIndex:a[t-1].length-1,cellIndex:a[t-1][a[t-1].length-1]-1}:0===r?{levelIndex:t,rowIndex:n-1,cellIndex:a[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:r-1};case"right":return n===a[t].length-1&&r===a[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===a[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:r+1};default:return{levelIndex:t,rowIndex:n,cellIndex:r}}}({direction:a,size:s,rowIndex:o,cellIndex:l,levelIndex:i});if(c){var u=null==(n=null==(t=r.current[c.levelIndex])?void 0:t[c.rowIndex])?void 0:n[c.cellIndex];u&&(u.disabled||u.getAttribute("data-hidden")||u.getAttribute("data-outside")?Ji({controlsRef:r,direction:a,levelIndex:c.levelIndex,cellIndex:c.cellIndex,rowIndex:c.rowIndex,size:s}):u.focus())}}function Qi(e){var t=e.controlsRef,n=e.levelIndex,r=e.rowIndex,a=e.cellIndex,i=e.event,o=function(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}(i.key);if(o){i.preventDefault();var l=function(e){return e.current.map((function(e){return e.map((function(e){return e.length}))}))}(t);Ji({controlsRef:t,direction:o,levelIndex:n,rowIndex:r,cellIndex:a,size:l})}}function eo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return to(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?to(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function to(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Xi.displayName="@mantine/dates/MonthLevel";var no=Object.defineProperty,ro=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,oo=function(e,t,n){return t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},lo={numberOfColumns:1},so=(0,e.forwardRef)((function(n,r){var a=qt("MonthLevelGroup",lo,n),i=a.month,o=a.locale,l=a.firstDayOfWeek,s=a.weekdayFormat,c=a.weekendDays,u=a.getDayProps,f=a.excludeDate,d=a.minDate,h=a.maxDate,p=a.renderDay,v=a.hideOutsideDates,m=a.hideWeekdays,y=a.getDayAriaLabel,b=a.__onDayClick,x=a.__onDayMouseEnter,_=a.withCellSpacing,w=a.__preventFocus,k=a.nextIcon,S=a.previousIcon,O=a.nextLabel,E=a.previousLabel,A=a.onNext,C=a.onPrevious,j=a.onLevelClick,D=a.nextDisabled,M=a.previousDisabled,P=a.hasNextLevel,R=a.className,I=a.classNames,L=a.styles,N=a.unstyled,T=a.numberOfColumns,F=a.levelControlAriaLabel,z=a.monthLabelFormat,H=a.__staticSelector,V=a.__stopPropagation,W=a.size,$=a.variant,B=a.static,Y=function(e,t){var n={};for(var r in e)ao.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ro){var a,i=eo(ro(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&io.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(a,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","numberOfColumns","levelControlAriaLabel","monthLabelFormat","__staticSelector","__stopPropagation","size","variant","static"]),U=vr(null,{name:["MonthLevelGroup",H],classNames:I,styles:L,unstyled:N,variant:$,size:W}),G=U.classes,q=U.cx,Z=(0,e.useRef)([]),K=Array(T).fill(0).map((function(e,n){var r=g()(i).add(n,"months").toDate();return t().createElement(Xi,{key:n,month:r,withNext:n===T-1,withPrevious:0===n,monthLabelFormat:z,__stopPropagation:V,__onDayClick:b,__onDayMouseEnter:x,__onDayKeyDown:function(e,t){return Qi({levelIndex:n,rowIndex:t.rowIndex,cellIndex:t.cellIndex,event:e,controlsRef:Z})},__getDayRef:function(e,t,r){Array.isArray(Z.current[n])||(Z.current[n]=[]),Array.isArray(Z.current[n][e])||(Z.current[n][e]=[]),Z.current[n][e][t]=r},levelControlAriaLabel:"function"==typeof F?F(r):F,locale:o,firstDayOfWeek:l,weekdayFormat:s,weekendDays:c,getDayProps:u,excludeDate:f,minDate:d,maxDate:h,renderDay:p,hideOutsideDates:v,hideWeekdays:m,getDayAriaLabel:y,__preventFocus:w,nextIcon:k,previousIcon:S,nextLabel:O,previousLabel:E,onNext:A,onPrevious:C,onLevelClick:j,nextDisabled:D,previousDisabled:M,hasNextLevel:P,classNames:I,styles:L,unstyled:N,__staticSelector:H||"MonthLevelGroup",size:W,variant:$,static:B,withCellSpacing:_})}));return t().createElement(Qn,function(e,t){for(var n in t||(t={}))ao.call(t,n)&&oo(e,n,t[n]);if(ro){var r,a=eo(ro(t));try{for(a.s();!(r=a.n()).done;)n=r.value,io.call(t,n)&&oo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:q(G.monthLevelGroup,R),ref:r},Y),K)}));so.displayName="@mantine/dates/MonthLevelGroup";var co=dr((function(e,t,n){return{yearLevelGroup:{display:"flex","& [data-year-level]:not(:last-of-type)":{marginRight:yt({size:n.size,sizes:e.spacing})}}}}));const uo=co,fo=dr((function(e){return{yearLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));function ho(e,t,n){return!!((t||n)&&(t&&g()(e).isBefore(t,"month")||n&&g()(e).isAfter(n,"month")))}const po=dr((function(){return{monthsList:{borderCollapse:"collapse",borderWidth:0,cursor:"pointer"},monthsListCell:{padding:0,"&[data-with-spacing]":{padding:vt(.5)}},monthsListRow:{}}}));function vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mo=Object.defineProperty,yo=Object.defineProperties,go=Object.getOwnPropertyDescriptors,bo=Object.getOwnPropertySymbols,xo=Object.prototype.hasOwnProperty,_o=Object.prototype.propertyIsEnumerable,wo=function(e,t,n){return t in e?mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ko=function(e,t){for(var n in t||(t={}))xo.call(t,n)&&wo(e,n,t[n]);if(bo){var r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return vo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(bo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,_o.call(t,n)&&wo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},So=function(e,t){return yo(e,go(t))},Oo=dr((function(e,t,n){var r=n.size,a=e.fn.variant({variant:"filled"}),i=e.fn.variant({variant:"light"});return{pickerControl:So(ko({fontSize:yt({size:r,sizes:e.fontSizes}),height:yt({size:r,sizes:Sa}),width:"calc((".concat(yt({size:r,sizes:Sa})," * 7) / 3 + ").concat(vt(1.5),")"),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",borderRadius:e.fn.radius()},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-in-range]":ko({backgroundColor:i.background,borderRadius:0},e.fn.hover({backgroundColor:i.hover})),"&[data-first-in-range]":{borderRadius:0,borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderRadius:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-last-in-range][data-first-in-range]":{borderRadius:e.radius.sm},"&[data-selected]":ko({color:a.color,backgroundColor:a.background},e.fn.hover({backgroundColor:a.hover})),"&[data-disabled]":So(ko({color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}));const Eo=Oo;function Ao(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Co(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Co(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Co(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jo=Object.defineProperty,Do=Object.getOwnPropertySymbols,Mo=Object.prototype.hasOwnProperty,Po=Object.prototype.propertyIsEnumerable,Ro=function(e,t,n){return t in e?jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Io={size:"sm"},Lo=(0,e.forwardRef)((function(e,n){var r=qt("PickerControl",Io,e),a=r.className,i=r.children,o=r.disabled,l=r.selected,s=r.classNames,c=r.styles,u=r.unstyled,f=r.firstInRange,d=r.lastInRange,h=r.inRange,p=r.__staticSelector,v=r.size,m=r.variant,y=function(e,t){var n={};for(var r in e)Mo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Do){var a,i=Ao(Do(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Po.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["className","children","disabled","selected","classNames","styles","unstyled","firstInRange","lastInRange","inRange","__staticSelector","size","variant"]),g=Eo(null,{name:["PickerControl",p],classNames:s,styles:c,unstyled:u,variant:m,size:v}),b=g.classes,x=g.cx;return t().createElement(Ur,function(e,t){for(var n in t||(t={}))Mo.call(t,n)&&Ro(e,n,t[n]);if(Do){var r,a=Ao(Do(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Po.call(t,n)&&Ro(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:x(b.pickerControl,a),ref:n,unstyled:u,"data-picker-control":!0,"data-selected":l&&!o||void 0,"data-disabled":o||void 0,"data-in-range":h&&!o&&!l||void 0,"data-first-in-range":f&&!o||void 0,"data-last-in-range":d&&!o||void 0,disabled:o},y),i)}));function No(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return To(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?To(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function To(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Lo.displayName="@mantine/dates/PickerControl";var Fo=Object.defineProperty,zo=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,Vo=Object.getOwnPropertySymbols,Wo=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable,Bo=function(e,t,n){return t in e?Fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Yo=function(e,t){for(var n in t||(t={}))Wo.call(t,n)&&Bo(e,n,t[n]);if(Vo){var r,a=No(Vo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,$o.call(t,n)&&Bo(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Uo={monthsListFormat:"MMM",size:"sm",withCellSpacing:!0},Go=(0,e.forwardRef)((function(e,n){var r=qt("MonthsList",Uo,e),a=r.year,i=r.className,o=r.monthsListFormat,l=r.locale,s=r.minDate,c=r.maxDate,u=r.getMonthControlProps,f=r.classNames,d=r.styles,h=r.unstyled,p=r.__staticSelector,v=r.__getControlRef,m=r.__onControlKeyDown,y=r.__onControlClick,b=r.__onControlMouseEnter,x=r.__preventFocus,_=r.size,w=r.variant,k=r.__stopPropagation,S=r.withCellSpacing,O=function(e,t){var n={};for(var r in e)Wo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Vo){var a,i=No(Vo(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&$o.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["year","className","monthsListFormat","locale","minDate","maxDate","getMonthControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","size","variant","__stopPropagation","withCellSpacing"]),E=po(null,{name:["MonthsList",p],classNames:f,styles:d,unstyled:h,variant:w,size:_}),A=E.classes,C=E.cx,j=Ar(),D=function(e){for(var t=g()(e).startOf("year").toDate(),n=[[],[],[],[]],r=0,a=0;a<4;a+=1)for(var i=0;i<3;i+=1)n[a].push(g()(t).add(r,"months").toDate()),r+=1;return n}(a),M=function(e,t,n,r){var a=e.flat().filter((function(e){var a;return!ho(e,t,n)&&!(null==(a=null==r?void 0:r(e))?void 0:a.disabled)})),i=a.find((function(e){var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected}));return i||a.find((function(e){return g()().isSame(e,"month")}))||a[0]}(D,s,c,u),P=D.map((function(e,n){var r=e.map((function(e,r){var a,i=null==u?void 0:u(e),O=g()(e).isSame(M,"month");return t().createElement("td",{key:r,className:A.monthsListCell,"data-with-spacing":S||void 0},t().createElement(Lo,(a=Yo({variant:w,size:_,classNames:f,styles:d,unstyled:h,__staticSelector:p||"MonthsList","data-mantine-stop-propagation":k||void 0,disabled:ho(e,s,c),ref:function(e){return null==v?void 0:v(n,r,e)}},i),zo(a,Ho({onKeyDown:function(t){var a;null==(a=null==i?void 0:i.onKeyDown)||a.call(i,t),null==m||m(t,{rowIndex:n,cellIndex:r,date:e})},onClick:function(t){var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==y||y(t,e)},onMouseEnter:function(t){var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==b||b(t,e)},onMouseDown:function(e){var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),x&&e.preventDefault()},tabIndex:x||!O?-1:0}))),g()(e).locale(j.getLocale(l)).format(o)))}));return t().createElement("tr",{key:n,className:A.monthsListRow},r)}));return t().createElement(Qn,Yo({component:"table",ref:n,className:C(A.monthsList,i)},O),t().createElement("tbody",null,P))}));function qo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Zo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Zo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Go.displayName="@mantine/dates/MonthsList";var Ko=Object.defineProperty,Xo=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,el=function(e,t,n){return t in e?Ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},tl=function(e,t){for(var n in t||(t={}))Jo.call(t,n)&&el(e,n,t[n]);if(Xo){var r,a=qo(Xo(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Qo.call(t,n)&&el(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},nl={yearLabelFormat:"YYYY",size:"sm"},rl=(0,e.forwardRef)((function(e,n){var r=qt("YearLevel",nl,e),a=r.year,i=r.locale,o=r.minDate,l=r.maxDate,s=r.monthsListFormat,c=r.getMonthControlProps,u=r.__getControlRef,f=r.__onControlKeyDown,d=r.__onControlClick,h=r.__onControlMouseEnter,p=r.withCellSpacing,v=r.__preventFocus,m=r.nextIcon,y=r.previousIcon,b=r.nextLabel,x=r.previousLabel,_=r.onNext,w=r.onPrevious,k=r.onLevelClick,S=r.nextDisabled,O=r.previousDisabled,E=r.hasNextLevel,A=r.levelControlAriaLabel,C=r.withNext,j=r.withPrevious,D=r.className,M=r.yearLabelFormat,P=r.classNames,R=r.styles,I=r.unstyled,L=r.__staticSelector,N=r.__stopPropagation,T=r.size,F=r.variant,z=function(e,t){var n={};for(var r in e)Jo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Xo){var a,i=qo(Xo(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Qo.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","yearLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","size","variant"]),H=fo(null,{name:["YearLevel",L],classNames:P,styles:R,unstyled:I,size:T,variant:F}),V=H.classes,W=H.cx,$=Ar(),B={__staticSelector:L||"YearLevel",classNames:P,styles:R,unstyled:I,size:T,variant:F},Y="boolean"==typeof S?S:!!l&&!g()(a).endOf("year").isBefore(l),U="boolean"==typeof O?O:!!o&&!g()(a).startOf("year").isAfter(o);return t().createElement(Qn,tl({className:W(V.yearLevel,D),"data-year-level":!0,ref:n},z),t().createElement(Ga,tl({label:"function"==typeof M?M(a):g()(a).locale(i||$.locale).format(M),className:V.calendarHeader,__preventFocus:v,__stopPropagation:N,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:x,onNext:_,onPrevious:w,onLevelClick:k,nextDisabled:Y,previousDisabled:U,hasNextLevel:E,levelControlAriaLabel:A,withNext:C,withPrevious:j},B)),t().createElement(Go,tl({year:a,locale:i,minDate:o,maxDate:l,monthsListFormat:s,getMonthControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:d,__onControlMouseEnter:h,__preventFocus:v,__stopPropagation:N,withCellSpacing:p},B)))}));function al(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return il(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?il(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function il(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}rl.displayName="@mantine/dates/YearLevel";var ol=Object.defineProperty,ll=Object.getOwnPropertySymbols,sl=Object.prototype.hasOwnProperty,cl=Object.prototype.propertyIsEnumerable,ul=function(e,t,n){return t in e?ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},fl={numberOfColumns:1,size:"sm"},dl=(0,e.forwardRef)((function(n,r){var a=qt("YearLevelGroup",fl,n),i=a.year,o=a.locale,l=a.minDate,s=a.maxDate,c=a.monthsListFormat,u=a.getMonthControlProps,f=a.__onControlClick,d=a.__onControlMouseEnter,h=a.withCellSpacing,p=a.__preventFocus,v=a.nextIcon,m=a.previousIcon,y=a.nextLabel,b=a.previousLabel,x=a.onNext,_=a.onPrevious,w=a.onLevelClick,k=a.nextDisabled,S=a.previousDisabled,O=a.hasNextLevel,E=a.className,A=a.classNames,C=a.styles,j=a.unstyled,D=a.__staticSelector,M=a.__stopPropagation,P=a.numberOfColumns,R=a.levelControlAriaLabel,I=a.yearLabelFormat,L=a.variant,N=a.size,T=function(e,t){var n={};for(var r in e)sl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ll){var a,i=al(ll(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&cl.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(a,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","yearLabelFormat","variant","size"]),F=uo(null,{name:["YearLevelGroup",D],styles:C,classNames:A,unstyled:j,variant:L,size:N}),z=F.classes,H=F.cx,V=(0,e.useRef)([]),W=Array(P).fill(0).map((function(e,n){var r=g()(i).add(n,"years").toDate();return t().createElement(rl,{key:n,variant:L,size:N,monthsListFormat:c,year:r,withNext:n===P-1,withPrevious:0===n,yearLabelFormat:I,__stopPropagation:M,__onControlClick:f,__onControlMouseEnter:d,__onControlKeyDown:function(e,t){return Qi({levelIndex:n,rowIndex:t.rowIndex,cellIndex:t.cellIndex,event:e,controlsRef:V})},__getControlRef:function(e,t,r){Array.isArray(V.current[n])||(V.current[n]=[]),Array.isArray(V.current[n][e])||(V.current[n][e]=[]),V.current[n][e][t]=r},levelControlAriaLabel:"function"==typeof R?R(r):R,locale:o,minDate:l,maxDate:s,__preventFocus:p,nextIcon:v,previousIcon:m,nextLabel:y,previousLabel:b,onNext:x,onPrevious:_,onLevelClick:w,nextDisabled:k,previousDisabled:S,hasNextLevel:O,getMonthControlProps:u,classNames:A,styles:C,unstyled:j,__staticSelector:D||"YearLevelGroup",withCellSpacing:h})}));return t().createElement(Qn,function(e,t){for(var n in t||(t={}))sl.call(t,n)&&ul(e,n,t[n]);if(ll){var r,a=al(ll(t));try{for(a.s();!(r=a.n()).done;)n=r.value,cl.call(t,n)&&ul(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:H(z.yearLevelGroup,E),ref:r},T),W)}));dl.displayName="@mantine/dates/YearLevelGroup";const hl=dr((function(e){return{decadeLevelGroup:{display:"flex",gap:e.spacing.md}}}));function pl(e){for(var t=e.getFullYear(),n=t-t%10,r=0,a=[[],[],[],[]],i=0;i<4;i+=1)for(var o=3===i?1:3,l=0;l<o;l+=1)a[i].push(new Date(n+r,0)),r+=1;return a}const vl=dr((function(e){return{decadeLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}}));function ml(e,t,n){return!!((t||n)&&(t&&g()(e).isBefore(t,"year")||n&&g()(e).isAfter(n,"year")))}const yl=dr((function(){return{yearsList:{borderCollapse:"collapse",borderWidth:0},yearsListCell:{padding:0,"&[data-with-spacing]":{padding:vt(.5)}},yearsListRow:{}}}));function gl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return bl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bl(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function bl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xl=Object.defineProperty,_l=Object.defineProperties,wl=Object.getOwnPropertyDescriptors,kl=Object.getOwnPropertySymbols,Sl=Object.prototype.hasOwnProperty,Ol=Object.prototype.propertyIsEnumerable,El=function(e,t,n){return t in e?xl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Al=function(e,t){for(var n in t||(t={}))Sl.call(t,n)&&El(e,n,t[n]);if(kl){var r,a=gl(kl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ol.call(t,n)&&El(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},Cl={yearsListFormat:"YYYY",size:"sm",withCellSpacing:!0},jl=(0,e.forwardRef)((function(e,n){var r=qt("YearsList",Cl,e),a=r.decade,i=r.className,o=r.yearsListFormat,l=r.locale,s=r.minDate,c=r.maxDate,u=r.getYearControlProps,f=r.classNames,d=r.styles,h=r.unstyled,p=r.__staticSelector,v=r.__getControlRef,m=r.__onControlKeyDown,y=r.__onControlClick,b=r.__onControlMouseEnter,x=r.__preventFocus,_=r.__stopPropagation,w=r.size,k=r.variant,S=r.withCellSpacing,O=function(e,t){var n={};for(var r in e)Sl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&kl){var a,i=gl(kl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ol.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["decade","className","yearsListFormat","locale","minDate","maxDate","getYearControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","__stopPropagation","size","variant","withCellSpacing"]),E=yl(null,{name:["YearsList",p],classNames:f,styles:d,unstyled:h,variant:k,size:w}),A=E.classes,C=E.cx,j=Ar(),D=pl(a),M=function(e,t,n,r){var a=e.flat().filter((function(e){var a;return!ml(e,t,n)&&!(null==(a=null==r?void 0:r(e))?void 0:a.disabled)})),i=a.find((function(e){var t;return null==(t=null==r?void 0:r(e))?void 0:t.selected}));return i||a.find((function(e){return g()().isSame(e,"year")}))||a[0]}(D,s,c,u),P=D.map((function(e,n){var r=e.map((function(e,r){var a,i=null==u?void 0:u(e),O=g()(e).isSame(M,"year");return t().createElement("td",{key:r,className:A.yearsListCell,"data-with-spacing":S||void 0},t().createElement(Lo,(a=Al({size:w,variant:k,classNames:f,styles:d,unstyled:h,__staticSelector:p||"YearsList","data-mantine-stop-propagation":_||void 0,disabled:ml(e,s,c),ref:function(e){return null==v?void 0:v(n,r,e)}},i),_l(a,wl({onKeyDown:function(t){var a;null==(a=null==i?void 0:i.onKeyDown)||a.call(i,t),null==m||m(t,{rowIndex:n,cellIndex:r,date:e})},onClick:function(t){var n;null==(n=null==i?void 0:i.onClick)||n.call(i,t),null==y||y(t,e)},onMouseEnter:function(t){var n;null==(n=null==i?void 0:i.onMouseEnter)||n.call(i,t),null==b||b(t,e)},onMouseDown:function(e){var t;null==(t=null==i?void 0:i.onMouseDown)||t.call(i,e),x&&e.preventDefault()},tabIndex:x||!O?-1:0}))),g()(e).locale(j.getLocale(l)).format(o)))}));return t().createElement("tr",{key:n,className:A.yearsListRow},r)}));return t().createElement(Qn,Al({component:"table",ref:n,className:C(A.yearsList,i)},O),t().createElement("tbody",null,P))}));function Dl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ml(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Ml(e,t){if(e){if("string"==typeof e)return Pl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pl(e,t):void 0}}function Pl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}jl.displayName="@mantine/dates/YearsList";var Rl=Object.defineProperty,Il=Object.getOwnPropertySymbols,Ll=Object.prototype.hasOwnProperty,Nl=Object.prototype.propertyIsEnumerable,Tl=function(e,t,n){return t in e?Rl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Fl=function(e,t){for(var n in t||(t={}))Ll.call(t,n)&&Tl(e,n,t[n]);if(Il){var r,a=Dl(Il(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Nl.call(t,n)&&Tl(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},zl={decadeLabelFormat:"YYYY"},Hl=(0,e.forwardRef)((function(e,n){var r=qt("DecadeLevel",zl,e),a=r.decade,i=r.locale,o=r.minDate,l=r.maxDate,s=r.yearsListFormat,c=r.getYearControlProps,u=r.__getControlRef,f=r.__onControlKeyDown,d=r.__onControlClick,h=r.__onControlMouseEnter,p=r.withCellSpacing,v=r.__preventFocus,m=r.nextIcon,y=r.previousIcon,b=r.nextLabel,x=r.previousLabel,_=r.onNext,w=r.onPrevious,k=r.nextDisabled,S=r.previousDisabled,O=r.levelControlAriaLabel,E=r.withNext,A=r.withPrevious,C=r.className,j=r.decadeLabelFormat,D=r.classNames,M=r.styles,P=r.unstyled,R=r.__staticSelector,I=r.__stopPropagation,L=r.variant,N=r.size,T=function(e,t){var n={};for(var r in e)Ll.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Il){var a,i=Dl(Il(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Nl.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","levelControlAriaLabel","withNext","withPrevious","className","decadeLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","variant","size"]),F=vl(null,{name:["DecadeLevel",R],classNames:D,styles:M,unstyled:P,variant:L,size:N}),z=F.classes,H=F.cx,V=Ar(),W=function(e){var t=pl(e);return[t[0][0],t[3][0]]}(a),$=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Ml(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(W,2),B=$[0],Y=$[1],U={__staticSelector:R||"DecadeLevel",classNames:D,styles:M,unstyled:P,variant:L,size:N},G="boolean"==typeof k?k:!!l&&!g()(Y).endOf("year").isBefore(l),q="boolean"==typeof S?S:!!o&&!g()(B).startOf("year").isAfter(o),Z=function(e,t){return g()(e).locale(i||V.locale).format(t)};return t().createElement(Qn,Fl({className:H(z.decadeLevel,C),"data-decade-level":!0,ref:n},T),t().createElement(Ga,Fl({label:"function"==typeof j?j(B,Y):"".concat(Z(B,j)," – ").concat(Z(Y,j)),className:z.calendarHeader,__preventFocus:v,__stopPropagation:I,nextIcon:m,previousIcon:y,nextLabel:b,previousLabel:x,onNext:_,onPrevious:w,nextDisabled:G,previousDisabled:q,hasNextLevel:!1,levelControlAriaLabel:O,withNext:E,withPrevious:A},U)),t().createElement(jl,Fl({decade:a,locale:i,minDate:o,maxDate:l,yearsListFormat:s,getYearControlProps:c,__getControlRef:u,__onControlKeyDown:f,__onControlClick:d,__onControlMouseEnter:h,__preventFocus:v,__stopPropagation:I,withCellSpacing:p},U)))}));function Vl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Wl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wl(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Wl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Hl.displayName="@mantine/dates/DecadeLevel";var $l=Object.defineProperty,Bl=Object.getOwnPropertySymbols,Yl=Object.prototype.hasOwnProperty,Ul=Object.prototype.propertyIsEnumerable,Gl=function(e,t,n){return t in e?$l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ql={numberOfColumns:1},Zl=(0,e.forwardRef)((function(n,r){var a=qt("DecadeLevelGroup",ql,n),i=a.decade,o=a.locale,l=a.minDate,s=a.maxDate,c=a.yearsListFormat,u=a.getYearControlProps,f=a.__onControlClick,d=a.__onControlMouseEnter,h=a.withCellSpacing,p=a.__preventFocus,v=a.nextIcon,m=a.previousIcon,y=a.nextLabel,b=a.previousLabel,x=a.onNext,_=a.onPrevious,w=a.nextDisabled,k=a.previousDisabled,S=a.className,O=a.classNames,E=a.styles,A=a.unstyled,C=a.__staticSelector,j=a.__stopPropagation,D=a.numberOfColumns,M=a.levelControlAriaLabel,P=a.decadeLabelFormat,R=a.variant,I=a.size,L=function(e,t){var n={};for(var r in e)Yl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Bl){var a,i=Vl(Bl(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&Ul.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(a,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","decadeLabelFormat","variant","size"]),N=hl(null,{name:["DecadeLevelGroup",C],styles:E,classNames:O,unstyled:A,variant:R,size:I}),T=N.classes,F=N.cx,z=(0,e.useRef)([]),H=Array(D).fill(0).map((function(e,n){var r=g()(i).add(10*n,"years").toDate();return t().createElement(Hl,{key:n,variant:R,size:I,yearsListFormat:c,decade:r,withNext:n===D-1,withPrevious:0===n,decadeLabelFormat:P,__onControlClick:f,__onControlMouseEnter:d,__onControlKeyDown:function(e,t){return Qi({levelIndex:n,rowIndex:t.rowIndex,cellIndex:t.cellIndex,event:e,controlsRef:z})},__getControlRef:function(e,t,r){Array.isArray(z.current[n])||(z.current[n]=[]),Array.isArray(z.current[n][e])||(z.current[n][e]=[]),z.current[n][e][t]=r},levelControlAriaLabel:"function"==typeof M?M(r):M,locale:o,minDate:l,maxDate:s,__preventFocus:p,__stopPropagation:j,nextIcon:v,previousIcon:m,nextLabel:y,previousLabel:b,onNext:x,onPrevious:_,nextDisabled:w,previousDisabled:k,getYearControlProps:u,__staticSelector:C||"DecadeLevelGroup",classNames:O,styles:E,unstyled:A,withCellSpacing:h})}));return t().createElement(Qn,function(e,t){for(var n in t||(t={}))Yl.call(t,n)&&Gl(e,n,t[n]);if(Bl){var r,a=Vl(Bl(t));try{for(a.s();!(r=a.n()).done;)n=r.value,Ul.call(t,n)&&Gl(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e}({className:F(T.decadeLevelGroup,S),ref:r},L),H)}));function Kl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Jl(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Jl(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Jl(e,t){if(e){if("string"==typeof e)return Ql(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ql(e,t):void 0}}function Ql(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Zl.displayName="@mantine/dates/DecadeLevelGroup";var es=Object.defineProperty,ts=Object.getOwnPropertySymbols,ns=Object.prototype.hasOwnProperty,rs=Object.prototype.propertyIsEnumerable,as=function(e,t,n){return t in e?es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},is=function(e,t){for(var n in t||(t={}))ns.call(t,n)&&as(e,n,t[n]);if(ts){var r,a=Xl(ts(t));try{for(a.s();!(r=a.n()).done;)n=r.value,rs.call(t,n)&&as(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},os={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},ls=(0,e.forwardRef)((function(e,n){var r=qt("Calendar",os,e),a=r.maxLevel,i=r.minLevel,o=r.defaultLevel,l=r.level,s=r.onLevelChange,c=r.date,u=r.defaultDate,f=r.onDateChange,d=r.numberOfColumns,h=r.columnsToScroll,p=r.ariaLabels,v=r.onYearSelect,m=r.onMonthSelect,y=r.onYearMouseEnter,b=r.onMonthMouseEnter,x=r.__updateDateOnYearSelect,_=r.__updateDateOnMonthSelect,w=r.firstDayOfWeek,k=r.weekdayFormat,S=r.weekendDays,O=r.getDayProps,E=r.excludeDate,A=r.renderDay,C=r.hideOutsideDates,j=r.hideWeekdays,D=r.getDayAriaLabel,M=r.monthLabelFormat,P=r.nextIcon,R=r.previousIcon,I=r.__onDayClick,L=r.__onDayMouseEnter,N=r.withCellSpacing,T=r.monthsListFormat,F=r.getMonthControlProps,z=r.yearLabelFormat,H=r.yearsListFormat,V=r.getYearControlProps,W=r.decadeLabelFormat,$=r.minDate,B=r.maxDate,Y=r.locale,U=r.className,G=r.classNames,q=r.styles,Z=r.__staticSelector,K=r.unstyled,X=r.variant,J=r.size,Q=r.__preventFocus,ee=r.__stopPropagation,te=r.onNextDecade,ne=r.onPreviousDecade,re=r.onNextYear,ae=r.onPreviousYear,ie=r.onNextMonth,oe=r.onPreviousMonth,le=r.static,se=function(e,t){var n={};for(var r in e)ns.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ts){var a,i=Xl(ts(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&rs.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["maxLevel","minLevel","defaultLevel","level","onLevelChange","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","nextIcon","previousIcon","__onDayClick","__onDayMouseEnter","withCellSpacing","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","minDate","maxDate","locale","className","classNames","styles","__staticSelector","unstyled","variant","size","__preventFocus","__stopPropagation","onNextDecade","onPreviousDecade","onNextYear","onPreviousYear","onNextMonth","onPreviousMonth","static"]),ce=hr(null,{name:["Calendar",Z],classNames:G,styles:q,unstyled:K,variant:X,size:J}),ue=ce.classes,fe=ce.cx,de=Kl(Kt({value:l?tr(l,i,a):void 0,defaultValue:o?tr(o,i,a):void 0,finalValue:tr(void 0,i,a),onChange:s}),2),he=de[0],pe=de[1],ve=Kl(Kt({value:c,defaultValue:u,finalValue:null,onChange:f}),2),me=ve[0],ye=ve[1],ge={__staticSelector:Z||"Calendar",styles:q,classNames:G,unstyled:K,variant:X,size:J},be=h||d||1,xe=me||new Date;return t().createElement(Qn,is({className:fe(ue.calendar,U),ref:n},se),"month"===he&&t().createElement(so,is({month:xe,minDate:$,maxDate:B,firstDayOfWeek:w,weekdayFormat:k,weekendDays:S,getDayProps:O,excludeDate:E,renderDay:A,hideOutsideDates:C,hideWeekdays:j,getDayAriaLabel:D,onNext:function(){var e=g()(xe).add(be,"month").toDate();null==ie||ie(e),ye(e)},onPrevious:function(){var e=g()(xe).subtract(be,"month").toDate();null==oe||oe(e),ye(e)},hasNextLevel:"month"!==a,onLevelClick:function(){return pe("year")},numberOfColumns:d,locale:Y,levelControlAriaLabel:null==p?void 0:p.monthLevelControl,nextLabel:null==p?void 0:p.nextMonth,nextIcon:P,previousLabel:null==p?void 0:p.previousMonth,previousIcon:R,monthLabelFormat:M,__onDayClick:I,__onDayMouseEnter:L,__preventFocus:Q,__stopPropagation:ee,static:le,withCellSpacing:N},ge)),"year"===he&&t().createElement(dl,is({year:xe,numberOfColumns:d,minDate:$,maxDate:B,monthsListFormat:T,getMonthControlProps:F,locale:Y,onNext:function(){var e=g()(xe).add(be,"year").toDate();null==re||re(e),ye(e)},onPrevious:function(){var e=g()(xe).subtract(be,"year").toDate();null==ae||ae(e),ye(e)},hasNextLevel:"month"!==a&&"year"!==a,onLevelClick:function(){return pe("decade")},levelControlAriaLabel:null==p?void 0:p.yearLevelControl,nextLabel:null==p?void 0:p.nextYear,nextIcon:P,previousLabel:null==p?void 0:p.previousYear,previousIcon:R,yearLabelFormat:z,__onControlMouseEnter:b,__onControlClick:function(e,t){_&&ye(t),pe(tr("month",i,a)),null==m||m(t)},__preventFocus:Q,__stopPropagation:ee,withCellSpacing:N},ge)),"decade"===he&&t().createElement(Zl,is({decade:xe,minDate:$,maxDate:B,yearsListFormat:H,getYearControlProps:V,locale:Y,onNext:function(){var e=g()(xe).add(10*be,"year").toDate();null==te||te(e),ye(e)},onPrevious:function(){var e=g()(xe).subtract(10*be,"year").toDate();null==ne||ne(e),ye(e)},numberOfColumns:d,nextLabel:null==p?void 0:p.nextDecade,nextIcon:P,previousLabel:null==p?void 0:p.previousDecade,previousIcon:R,decadeLabelFormat:W,__onControlMouseEnter:y,__onControlClick:function(e,t){x&&ye(t),pe(tr("year",i,a)),null==v||v(t)},__preventFocus:Q,__stopPropagation:ee,withCellSpacing:N},ge)))}));function ss(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return cs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cs(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function cs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ls.displayName="@mantine/dates/Calendar";var us=Object.defineProperty,fs=Object.getOwnPropertySymbols,ds=Object.prototype.hasOwnProperty,hs=Object.prototype.propertyIsEnumerable,ps=function(e,t,n){return t in e?us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},vs=function(e,t){for(var n in t||(t={}))ds.call(t,n)&&ps(e,n,t[n]);if(fs){var r,a=ss(fs(t));try{for(a.s();!(r=a.n()).done;)n=r.value,hs.call(t,n)&&ps(e,n,t[n])}catch(e){a.e(e)}finally{a.f()}}return e},ms={type:"default",numberOfColumns:1},ys=(0,e.forwardRef)((function(e,n){var r=qt("DatePicker",ms,e),a=r.type,i=r.defaultValue,o=r.value,l=r.onChange,s=r.__staticSelector,c=r.getDayProps,u=r.allowSingleDateInRange,f=r.allowDeselect,d=r.onMouseLeave,h=r.numberOfColumns,p=function(e,t){var n={};for(var r in e)ds.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&fs){var a,i=ss(fs(e));try{for(i.s();!(a=i.n()).done;)r=a.value,t.indexOf(r)<0&&hs.call(e,r)&&(n[r]=e[r])}catch(e){i.e(e)}finally{i.f()}}return n}(r,["type","defaultValue","value","onChange","__staticSelector","getDayProps","allowSingleDateInRange","allowDeselect","onMouseLeave","numberOfColumns"]),v=an({type:a,level:"day",allowDeselect:f,allowSingleDateInRange:u,value:o,defaultValue:i,onChange:l,onMouseLeave:d}),m=v.onDateChange,y=v.onRootMouseLeave,g=v.onHoveredDateChange,b=v.getControlProps;return t().createElement(ls,vs({ref:n,minLevel:"month",__staticSelector:s||"DatePicker",onMouseLeave:y,hideOutsideDates:1!==h,numberOfColumns:h,__onDayMouseEnter:function(e,t){return g(t)},__onDayClick:function(e,t){return m(t)},getDayProps:function(e){return vs(vs({},b(e)),null==c?void 0:c(e))}},p))}));function gs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bs(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ys.displayName="@mantine/dates/DatePicker";var xs=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];(0,e.useEffect)((function(){var e=new IntersectionObserver((function(n){gs(n,1)[0].isIntersecting&&(t(),e.disconnect())}),{rootMargin:"0px 0px 0px 0px"});return e.observe(n.current),function(){return e.disconnect()}}),r)},_s=function(t,n){(0,e.useEffect)((function(){function e(e){t.current&&t.current instanceof HTMLElement&&!t.current.contains(e.target)&&n()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[t,n])};const ws=function(e){var t=e.className,n=void 0===t?"":t;return React.createElement("svg",{className:"min-w-[24px]".concat(n?" "+n:""),width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("mask",{id:"mask0_406_27403",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},React.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),React.createElement("g",{mask:"url(#mask0_406_27403)"},React.createElement("path",{d:"M12 14.6538L7.59619 10.25H16.4038L12 14.6538Z",fill:"currentColor"})))};var ks=function(e,t){var n=null,r=null;switch(e){case"today":(n=new Date).setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_7_days":(n=new Date).setDate(n.getDate()-6),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_4_weeks":(n=new Date).setDate(n.getDate()-27),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_6_months":(n=new Date).setMonth(n.getMonth()-6),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"last_12_months":(n=new Date).setMonth(n.getMonth()-12),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"month_to_date":(n=new Date).setDate(1),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"quarter_to_date":var a=new Date,i=Math.floor(a.getMonth()/3);(n=new Date(a.getFullYear(),3*i,1)).setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"year_to_date":(n=new Date).setMonth(0,1),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999);break;case"custom":t&&2===t.length&&t[0]&&t[1]&&t[0]instanceof Date&&t[1]instanceof Date?((n=new Date(t[0])).setHours(0,0,0,0),(r=new Date(t[1])).setHours(23,59,59,999)):(console.warn("Invalid custom date period, falling back to last 7 days"),(n=new Date).setDate(n.getDate()-6),n.setHours(0,0,0,0),(r=new Date).setHours(23,59,59,999));break;default:return{startDate:null,endDate:null}}return{startDate:n,endDate:r}};const Ss=function(e,t){var n,r=ks(e,t),a=r.startDate,i=r.endDate;return a&&i?{start_date:(n=a,n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate()+" 00:00:00"),end_date:function(e){return e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate()+" 23:59:59"}(i)}:{start_date:null,end_date:null}};function Os(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Es(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Es(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}g().extend(x()),g().extend(w());var As=[{key:"today",label:fbox_admin_js_object.langs.TODAY},{key:"last_7_days",label:fbox_admin_js_object.langs.LAST_7_DAYS},{key:"last_4_weeks",label:fbox_admin_js_object.langs.LAST_4_WEEKS},{key:"last_6_months",label:fbox_admin_js_object.langs.LAST_6_MONTHS},{key:"last_12_months",label:fbox_admin_js_object.langs.LAST_12_MONTHS},{key:"month_to_date",label:fbox_admin_js_object.langs.MONTH_TO_DATE},{key:"quarter_to_date",label:fbox_admin_js_object.langs.QUARTER_TO_DATE},{key:"year_to_date",label:fbox_admin_js_object.langs.YEAR_TO_DATE}],Cs=(0,e.memo)((function(n){var r=n.theme,a=n.date_period,i=n.custom_date_period,o=n.onSelectDatePeriod,l=n.onSelectCustomDatePeriod,s=Os((0,e.useState)(!1),2),c=s[0],u=s[1],f=Os((0,e.useState)([null,null]),2),d=f[0],h=f[1],p=Os((0,e.useState)(a),2),v=p[0],m=p[1],y=Os((0,e.useState)([null,null]),2),b=y[0],x=y[1],_=Os((0,e.useState)(a),2),w=_[0],k=_[1],S=(0,e.useRef)();_s(S,(function(){u(!1),O()}));var O=function(){k(v),x(d)},E=function(){if(w!==v)return!0;if("custom"===w){if(!(b[0]&&b[1]&&d[0]&&d[1]))return!1;var e=g()(b[0]),t=g()(b[1]),n=g()(d[0]),r=g()(d[1]);return!e.isSame(n,"day")||!t.isSame(r,"day")}return!1};(0,e.useEffect)((function(){if("custom"===a&&i&&2===i.length)if(i[0]&&i[1]){var e=[new Date(i[0]),new Date(i[1])];h(e),x(e)}else{var t=A("last_7_days");h(t),x(t),m("last_7_days"),k("last_7_days")}else{var n=A(a);h(n),x(n)}m(a),k(a)}),[a,i]);var A=function(e){var t=ks(e,null);return[t.startDate,t.endDate]};return t().createElement("div",{ref:S,className:"relative"},t().createElement("button",{onClick:function(){return c?u(!1):(u(!0),void O())},className:"flex items-center cursor-pointer gap-[4px] bg-transparent border-none p-0 text-gray-700 dark:text-gray-300"},t().createElement("span",null,function(){if("custom"===a&&i&&2===i.length&&i[0]&&i[1]){var e=g()(i[0]),t=g()(i[1]);return e.isSame(t,"day")?e.format("MMM D, YYYY"):"".concat(e.format("MMM D, YYYY")," - ").concat(t.format("MMM D, YYYY"))}var n=As.find((function(e){return e.key===a}));return n?n.label:"Last 7 days"}()),t().createElement(ws,{className:c?"rotate-180":""})),c&&t().createElement("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-[#343d43] border border-gray-200 dark:border-[#626f78] rounded-md shadow-lg z-50 p-3 w-[710px]"},t().createElement("div",{className:"flex gap-3"},t().createElement("div",{className:"min-w-[120px] flex flex-col gap-2"},As.map((function(e){return t().createElement("button",{key:e.key,onClick:function(){return function(e){if(k(e),"custom"!==e){var t=A(e);x(t)}}(e.key)},className:"\n w-full text-left cursor-pointer text-sm transition-colors border-none p-0 bg-transparent rounded\n ".concat(w===e.key?"text-accent dark:text-dark-accent font-medium":"text-gray-700 dark:text-gray-100","\n ")},e.label)}))),t().createElement("div",{className:"flex-1"},t().createElement("div",{className:"flex items-center justify-between mb-4"},t().createElement("div",{className:"flex items-center gap-4"},t().createElement("div",{className:"flex items-center gap-2"},t().createElement("span",{className:"text-sm text-gray-600 dark:text-gray-400"},"Start"),t().createElement("div",{className:"px-3 py-1 bg-gray-100 dark:bg-[#626f78] text-gray-900 dark:text-gray-100 rounded text-sm min-w-[100px] text-center"},b[0]?g()(b[0]).format("DD/MM/YYYY"):g()().format("DD/MM/YYYY"))),t().createElement("div",{className:"flex items-center gap-2"},t().createElement("span",{className:"text-sm text-gray-600 dark:text-gray-300"},"End"),t().createElement("div",{className:"px-3 py-1 bg-gray-100 dark:bg-[#626f78] text-gray-900 dark:text-gray-100 rounded text-sm min-w-[100px] text-center"},b[1]?g()(b[1]).format("DD/MM/YYYY"):g()().format("DD/MM/YYYY"))))),t().createElement("div",{className:"mb-4"},t().createElement(ys,{type:"range",value:b,onChange:function(e){x(e),k("custom")},allowSingleDateInRange:!0,numberOfColumns:2,getDayProps:function(e){var t=new Date;if(t.setHours(23,59,59,999),e>t)return{disabled:!0};var n=new Date;n.setHours(0,0,0,0);var a=new Date(e);return a.setHours(0,0,0,0),a.getTime()===n.getTime()?{style:{backgroundColor:"dark"===r?"rgb(75, 85, 99)":"rgb(229, 231, 235)",fontWeight:"500"}}:{}},firstDayOfWeek:1,styles:{calendar:{width:"100%"},calendarBase:{width:"100%"},monthsListControl:{color:"dark"===r?"#d1d5db":"inherit","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"}},yearLevelGroup:{gap:"1rem"},month:{width:"250px"},monthThead:{color:"dark"===r?"#9ca3af":"rgb(107, 114, 128)"},calendarHeaderLevel:{color:"dark"===r?"#d1d5db":"inherit",fontWeight:"500","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"}},calendarHeaderControl:{color:"dark"===r?"#d1d5db":"inherit","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"}},calendarHeaderControlIcon:{color:"dark"===r?"#d1d5db":"inherit"},day:{color:"dark"===r?"#d1d5db":"inherit",borderRadius:"50%","&:hover":{backgroundColor:"dark"===r?"#626f78":"rgb(243, 244, 246)"},"&[data-selected]":{backgroundColor:"rgb(37, 99, 235)",color:"white","&:hover":{backgroundColor:"rgb(29, 78, 216)"},"&[data-weekend]":{color:"#fff"},"&[data-last-in-range]":{backgroundColor:"rgb(37, 99, 235) !important",color:"white"}},"&[data-in-range]":{backgroundColor:"dark"===r?"rgb(30, 64, 175)":"rgb(219, 234, 254)",color:"dark"===r?"#d1d5db":"inherit",borderRadius:"50%"},"&[data-first-in-range]":{backgroundColor:"rgb(37, 99, 235)",color:"white"},"&[data-last-in-range]":{backgroundColor:"rgb(37, 99, 235)",color:"white"},"&[data-disabled]":{color:"dark"===r?"rgba(209, 213, 219, 0.4)":"rgba(107, 114, 128, 0.4)",backgroundColor:"transparent"},"&[data-weekend]":{color:"dark"===r?"rgb(209, 213, 219)":"inherit"}}}})),t().createElement("div",{className:"flex justify-end gap-2"},t().createElement("button",{onClick:function(){if(m(w),h(b),"custom"!==w)o(w),localStorage.setItem("firebox_analytics_date_period",w),localStorage.removeItem("firebox_analytics_custom_date_period");else if(b[0]&&b[1]&&b[0]instanceof Date&&b[1]instanceof Date){var e=[b[0],b[1]];l(e),o("custom"),localStorage.setItem("firebox_analytics_date_period","custom"),localStorage.setItem("firebox_analytics_custom_date_period",JSON.stringify(e))}else o("last_7_days"),localStorage.setItem("firebox_analytics_date_period","last_7_days"),localStorage.removeItem("firebox_analytics_custom_date_period");u(!1)},disabled:!E(),className:"\n px-3 py-1 text-sm rounded transition-colors border-none\n ".concat(E()?"bg-accent text-white hover:bg-dark-accent-hover cursor-pointer":"bg-gray-300 dark:bg-gray-600 text-gray-500 dark:text-gray-400 cursor-not-allowed opacity-50 pointer-events-none","\n ")},"Apply"))))))}));const js=Cs;function Ds(e){return Ds="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ds(e)}var Ms=function(e){return fetch(fpf_js_object.ajax_url,{method:"POST",body:e}).then((function(e){if(!e.ok)throw new Error("FireBox analytics request failed with status "+e.status);return e.json()})).then((function(e){if("object"!==Ds(e)||null===e)throw new Error("FireBox analytics request returned an unexpected response");return e}))};function Ps(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Rs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rs(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Is=(0,e.memo)((function(n){var r=n.selected_campaign,a=n.onSelectCampaign,i=Ps((0,e.useState)(!1),2),o=i[0],l=i[1],s=Ps((0,e.useState)(null),2),c=s[0],u=s[1],f=Ps((0,e.useState)(!1),2),d=f[0],h=f[1],p=Ps((0,e.useState)(""),2),v=p[0],m=p[1],y=Ps((0,e.useState)(fbox_admin_js_object.langs.ALL_CAMPAIGNS),2),g=y[0],b=y[1],x=(0,e.useMemo)((function(){return v?null==c?void 0:c.filter((function(e){return e.label.toLowerCase().includes(v.toLowerCase())})):c}),[c,v]),_=(0,e.useRef)("Filters_CampaignsDropdown");if(_s(_,(function(){l(!1)})),(0,e.useEffect)((function(){if(null===c){var e=new IntersectionObserver((function(t){if(Ps(t,1)[0].isIntersecting){var n=new FormData;n.append("nonce",fpf_js_object.nonce),n.append("action","firebox_analytics_get_dropdown_campaigns"),Ms(n).then((function(e){u(e)})).catch((function(e){console.error("Campaigns dropdown fetch error:",e),h(!0)})),e.disconnect()}}),{rootMargin:"0px 0px 0px 0px"});e.observe(_.current)}}),[]),(0,e.useEffect)((function(){var e,t=fbox_admin_js_object.langs.ALL_CAMPAIGNS;c&&null!=c&&c.length&&(t=null===r?fbox_admin_js_object.langs.ALL_CAMPAIGNS:(null===(e=c.filter((function(e){return parseInt(e.id)===parseInt(r)}))[0])||void 0===e?void 0:e.label)||fbox_admin_js_object.langs.ALL_CAMPAIGNS),b(t)}),[c,r]),null==c||!c.permission_denied)return t().createElement("div",{ref:_,className:"relative"},t().createElement("div",{className:"leading-[24px] max-w-[400px] text-default dark:text-white min-h-[24px] min-w-[120px]"},d?t().createElement("div",{className:"text-sm text-right text-gray-600 dark:text-gray-300"},fbox_admin_js_object.langs.COULDNT_LOAD_DATA):null===c?t().createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}):(null==c?void 0:c.length)>0&&t().createElement("div",{className:"flex items-center gap-1 justify-end"},t().createElement("div",{className:"flex items-center cursor-pointer truncate",onClick:function(){l((function(e){return!e}))}},t().createElement("div",{className:"truncate",title:g},g),t().createElement(ws,{className:o?"rotate-180":""})),null!==r&&t().createElement("button",{type:"button",onClick:function(e){var t;null==e||null===(t=e.stopPropagation)||void 0===t||t.call(e),a(null),l(!1)},className:"inline-flex items-center cursor-pointer shrink-0 p-0 bg-transparent border-0 hover:text-accent dark:hover:text-accent",title:fbox_admin_js_object.langs.CLEAR_SELECTED_CAMPAIGN||fbox_admin_js_object.langs.VIEW_ALL_ANALYTICS,"aria-label":fbox_admin_js_object.langs.CLEAR_SELECTED_CAMPAIGN||fbox_admin_js_object.langs.VIEW_ALL_ANALYTICS},t().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":"true"},t().createElement("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"2"}),t().createElement("path",{d:"M9 9l6 6M15 9l-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))))),c&&(null==c?void 0:c.length)>0&&o&&t().createElement("div",{className:"flex flex-col bg-white dark:bg-[#343d43] text-sm text-default hover:text-black w-[400px] absolute right-0 top-full z-20 rounded shadow-box"},t().createElement("div",{className:"flex flex-col sticky top-0 bg-white dark:bg-[#343d43] rounded-tl rounded-tr border border-solid border-grey-3 dark:border-[#626f78] border-r-0 border-l-0 border-t-0"},t().createElement("input",{autoFocus:!0,onChange:function(e){return m(e.target.value)},value:v,className:"border border-solid dark:bg-[#626f78] dark:placeholder:text-grey-4 dark:text-white border-grey-3 focus:border-grey-1 m-1 px-2 py-[11px] pr-6 rounded-[27px] shadow-none outline-none dark:border-none",placeholder:fbox_admin_js_object.langs.SEARCH_DOTS}),!v&&t().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"absolute dark:text-white right-3 top-1/2 -translate-y-1/2",width:"24",height:"24",viewBox:"0 -960 960 960"},t().createElement("path",{d:"M781.692-136.924 530.461-388.155q-30 24.769-69 38.769t-80.692 14q-102.55 0-173.582-71.014t-71.032-173.537q0-102.524 71.014-173.601 71.014-71.076 173.538-71.076 102.523 0 173.6 71.032T625.384-580q0 42.846-14.385 81.846-14.385 39-38.385 67.846l251.231 251.231-42.153 42.153Zm-400.923-258.46q77.308 0 130.962-53.654Q565.385-502.692 565.385-580q0-77.308-53.654-130.962-53.654-53.654-130.962-53.654-77.308 0-130.962 53.654Q196.154-657.308 196.154-580q0 77.308 53.653 130.962 53.654 53.654 130.962 53.654Z",fill:"currentColor"})),v&&t().createElement("svg",{onClick:function(){return m("")},xmlns:"http://www.w3.org/2000/svg",className:"absolute cursor-pointer dark:text-white right-3 top-1/2 -translate-y-1/2",width:"24",height:"24",viewBox:"0 -960 960 960"},t().createElement("path",{d:"M256-213.847 213.847-256l224-224-224-224L256-746.153l224 224 224-224L746.153-704l-224 224 224 224L704-213.847l-224-224-224 224Z",fill:"currentColor"}))),t().createElement("ul",{className:"m-0 h-[200px] overflow-y-auto overscroll-contain"},x.length>0?t().createElement(t().Fragment,null,Object.keys(x).map((function(e,n){return t().createElement("li",{key:n,onClick:function(){return t=x[e].id,a(t),void l(!1);var t},className:"p-1 m-0 hover:cursor-pointer ".concat(r===x[e].id?" pointer-events-none bg-pale-blue text-black dark:bg-pale-blue":"hover:bg-pale-blue dark:hover:bg-[#6b7a84] text-default hover:text-black dark:text-grey-3 dark:hover:text-white")},x[e].label)}))):t().createElement("li",{className:"pointer-events-none dark:text-grey-3 p-4 text-center m-0 h-full flex items-center justify-center"},fbox_admin_js_object.langs.NO_CAMPAIGNS_FOUND))))}));const Ls=Is;function Ns(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)"__proto__"!==r&&(e[r]=n[r])}return e}var Ts=function e(t,n){function r(e,r,a){if("undefined"!=typeof document){"number"==typeof(a=Ns({},n,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var o in a)a[o]&&(i+="; "+o,!0!==a[o]&&(i+="="+a[o].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},a=0;a<n.length;a++){var i=n[a].split("="),o=i.slice(1).join("=");try{var l=decodeURIComponent(i[0]);if(l in r||(r[l]=t.read(o,l)),e===l)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Ns({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Ns({},this.attributes,t))},withConverter:function(t){return e(Ns({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function Fs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fs(Object(n),!0).forEach((function(t){Hs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ws=function(e,t){var n=new Map;return null!=t&&t.length&&t.forEach((function(e){n.set(e.label,parseFloat(e.total))})),e.map((function(e){return{date:e,total:(null==n?void 0:n.get(e))||"0.00"}}))},$s=function(e,t){var n,r=new Map,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vs(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;r.set(i.label,parseFloat(i.total))}}catch(e){a.e(e)}finally{a.f()}return e.map((function(e){return{date:e,total:r.get(e)||0}}))},Bs={views:{label:fbox_admin_js_object.langs.VIEWS,colorClass:"text-metric-views",color:"#5383EC"},conversions:{label:fbox_admin_js_object.langs.CONVERSIONS,colorClass:"text-metric-conversions",color:"#dfa1b7"},conversionrate:{label:fbox_admin_js_object.langs.CONVERSION_RATE,colorClass:"text-metric-conversion-rate",color:"#8B5CF6",suffix:"%"}},Ys=function(){return"undefined"!=typeof window&&window.wp&&window.wp.hooks?window.wp.hooks:null},Us=zs({},function(){var e=Ys();return e?e.applyFilters("firebox.performance.metrics",Bs):Bs}()),Gs=Ys();Gs&&Gs.addAction("firebox.revenue.ready","firebox/performance-metrics",(function(){var e=Ys(),t=e?e.applyFilters("firebox.performance.metrics",Bs):Bs;Us=zs({},t)}),10);var qs=function(){return"dark"===(Ts.get("fireplugins_theme")||"light")?"dark":"light"},Zs=function(){return React.createElement("div",{className:"flex flex-col gap-2"},React.createElement("div",{className:"flex gap-[4px] flex-wrap justify-between"},React.createElement("div",{className:"animate-pulse h-2 w-[100px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-2 w-[100px] bg-slate-200 dark:bg-slate-700 rounded"})),React.createElement("div",{className:"flex flex-col gap-5 justify-between h-[320px] w-full"},React.createElement("div",{className:"animate-pulse h-1 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 bg-slate-200 dark:bg-slate-700 rounded"})))},Ks={list:fbox_admin_js_object.langs.DAILY,weekly:fbox_admin_js_object.langs.WEEKLY,monthly:fbox_admin_js_object.langs.MONTHLY};function Xs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Js=function(n){var r=n.showCampaignDropdown,a=void 0===r||r,i=f(),o=u(),l=o.date_period,s=o.custom_date_period,c=o.selected_campaign,d=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xs(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(qs()),2),h=d[0],p=d[1];(0,e.useEffect)((function(){var e=function(){p(qs())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var v=(0,e.useCallback)((function(e){i({type:"SET_DATE_PERIOD",payload:e})}),[]),m=(0,e.useCallback)((function(e){i({type:"SET_CAMPAIGN_DATA",payload:null}),i({type:"SET_SELECTED_CAMPAIGN",payload:e})}),[]),y=(0,e.useCallback)((function(e){i({type:"SET_CUSTOM_DATE_PERIOD",payload:e})}),[]);return t().createElement("div",{className:"flex items-center text-base justify-between gap-2 flex-wrap"},t().createElement(js,{theme:h,date_period:l,custom_date_period:s,onSelectDatePeriod:v,onSelectCustomDatePeriod:y}),a&&t().createElement(Ls,{selected_campaign:c,onSelectCampaign:m}))};function Qs(e){return Qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qs(e)}function ec(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nc(e){return e+.5|0}var rc=function(e,t,n){return Math.max(Math.min(e,n),t)};function ac(e){return rc(nc(2.55*e),0,255)}function ic(e){return rc(nc(255*e),0,255)}function oc(e){return rc(nc(e/2.55)/100,0,1)}function lc(e){return rc(nc(100*e),0,100)}var sc,cc,uc={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},fc=function(e){if(Array.isArray(e))return tc(e)}(sc="0123456789ABCDEF")||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(sc)||tc(sc,cc)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),dc=function(e){return fc[15&e]},hc=function(e){return fc[(240&e)>>4]+fc[15&e]},pc=function(e){return(240&e)>>4==(15&e)};var vc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function mc(e,t,n){var r=t*Math.min(n,1-n),a=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+e/30)%12;return n-r*Math.max(Math.min(a-3,9-a,1),-1)};return[a(0),a(8),a(4)]}function yc(e,t,n){var r=function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return[r(5),r(3),r(1)]}function gc(e,t,n){var r,a=mc(e,1,.5);for(t+n>1&&(t*=r=1/(t+n),n*=r),r=0;r<3;r++)a[r]*=1-t-n,a[r]+=t;return a}function bc(e){var t,n,r,a=e.r/255,i=e.g/255,o=e.b/255,l=Math.max(a,i,o),s=Math.min(a,i,o),c=(l+s)/2;return l!==s&&(r=l-s,n=c>.5?r/(2-l-s):r/(l+s),t=function(e,t,n,r,a){return e===a?(t-n)/r+(t<n?6:0):t===a?(n-e)/r+2:(e-t)/r+4}(a,i,o,r,l),t=60*t+.5),[0|t,n||0,c]}function xc(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(ic)}function _c(e,t,n){return xc(mc,e,t,n)}function wc(e){return(e%360+360)%360}var kc,Sc={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Oc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};var Ec=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ac=function(e){return e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055},Cc=function(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)};function jc(e,t,n){if(e){var r=bc(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),r=_c(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Dc(e,t){return e?Object.assign(t||{},e):e}function Mc(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=ic(e[3]))):(t=Dc(e,{r:0,g:0,b:0,a:1})).a=ic(t.a),t}function Pc(e){return"r"===e.charAt(0)?function(e){var t,n,r,a=Ec.exec(e),i=255;if(a){if(a[7]!==t){var o=+a[7];i=a[8]?ac(o):rc(255*o,0,255)}return t=+a[1],n=+a[3],r=+a[5],{r:t=255&(a[2]?ac(t):rc(t,0,255)),g:n=255&(a[4]?ac(n):rc(n,0,255)),b:r=255&(a[6]?ac(r):rc(r,0,255)),a:i}}}(e):function(e){var t,n=vc.exec(e),r=255;if(n){n[5]!==t&&(r=n[6]?ac(+n[5]):ic(+n[5]));var a=wc(+n[2]),i=+n[3]/100,o=+n[4]/100;return{r:(t="hwb"===n[1]?function(e,t,n){return xc(gc,e,t,n)}(a,i,o):"hsv"===n[1]?function(e,t,n){return xc(yc,e,t,n)}(a,i,o):_c(a,i,o))[0],g:t[1],b:t[2],a:r}}}(e)}var Rc=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t instanceof e)return t;var n,r,a,i,o=Qs(t);"object"===o?n=Mc(t):"string"===o&&(i=(r=t).length,"#"===r[0]&&(4===i||5===i?a={r:255&17*uc[r[1]],g:255&17*uc[r[2]],b:255&17*uc[r[3]],a:5===i?17*uc[r[4]]:255}:7!==i&&9!==i||(a={r:uc[r[1]]<<4|uc[r[2]],g:uc[r[3]]<<4|uc[r[4]],b:uc[r[5]]<<4|uc[r[6]],a:9===i?uc[r[7]]<<4|uc[r[8]]:255})),n=a||function(e){kc||((kc=function(){var e,t,n,r,a,i={},o=Object.keys(Oc),l=Object.keys(Sc);for(e=0;e<o.length;e++){for(r=a=o[e],t=0;t<l.length;t++)n=l[t],a=a.replace(n,Sc[n]);n=parseInt(Oc[r],16),i[a]=[n>>16&255,n>>8&255,255&n]}return i}()).transparent=[0,0,0,0]);var t=kc[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}(t)||Pc(t)),this._rgb=n,this._valid=!!n}var t,n;return t=e,(n=[{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var e=Dc(this._rgb);return e&&(e.a=oc(e.a)),e},set:function(e){this._rgb=Mc(e)}},{key:"rgbString",value:function(){return this._valid?(e=this._rgb)&&(e.a<255?"rgba(".concat(e.r,", ").concat(e.g,", ").concat(e.b,", ").concat(oc(e.a),")"):"rgb(".concat(e.r,", ").concat(e.g,", ").concat(e.b,")")):void 0;var e}},{key:"hexString",value:function(){return this._valid?(e=this._rgb,t=function(e){return pc(e.r)&&pc(e.g)&&pc(e.b)&&pc(e.a)}(e)?dc:hc,e?"#"+t(e.r)+t(e.g)+t(e.b)+function(e,t){return e<255?t(e):""}(e.a,t):void 0):void 0;var e,t}},{key:"hslString",value:function(){return this._valid?function(e){if(e){var t=bc(e),n=t[0],r=lc(t[1]),a=lc(t[2]);return e.a<255?"hsla(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(oc(e.a),")"):"hsl(".concat(n,", ").concat(r,"%, ").concat(a,"%)")}}(this._rgb):void 0}},{key:"mix",value:function(e,t){if(e){var n,r=this.rgb,a=e.rgb,i=t===n?.5:t,o=2*i-1,l=r.a-a.a,s=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;n=1-s,r.r=255&s*r.r+n*a.r+.5,r.g=255&s*r.g+n*a.g+.5,r.b=255&s*r.b+n*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}},{key:"interpolate",value:function(e,t){return e&&(this._rgb=function(e,t,n){var r=Cc(oc(e.r)),a=Cc(oc(e.g)),i=Cc(oc(e.b));return{r:ic(Ac(r+n*(Cc(oc(t.r))-r))),g:ic(Ac(a+n*(Cc(oc(t.g))-a))),b:ic(Ac(i+n*(Cc(oc(t.b))-i))),a:e.a+n*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}},{key:"clone",value:function(){return new e(this.rgb)}},{key:"alpha",value:function(e){return this._rgb.a=ic(e),this}},{key:"clearer",value:function(e){return this._rgb.a*=1-e,this}},{key:"greyscale",value:function(){var e=this._rgb,t=nc(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}},{key:"opaquer",value:function(e){return this._rgb.a*=1+e,this}},{key:"negate",value:function(){var e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}},{key:"lighten",value:function(e){return jc(this._rgb,2,e),this}},{key:"darken",value:function(e){return jc(this._rgb,2,-e),this}},{key:"saturate",value:function(e){return jc(this._rgb,1,e),this}},{key:"desaturate",value:function(e){return jc(this._rgb,1,-e),this}},{key:"rotate",value:function(e){return function(e,t){var n=bc(e);n[0]=wc(n[0]+t),n=_c(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}}])&&ec(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ic(e){return function(e){if(Array.isArray(e))return Hc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||zc(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tc(e){return Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tc(e)}function Fc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=zc(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function zc(e,t){if(e){if("string"==typeof e)return Hc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hc(e,t):void 0}}function Hc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vc(){}var Wc,$c=(Wc=0,function(){return Wc++});function Bc(e){return null==e}function Yc(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function Uc(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function Gc(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function qc(e,t){return Gc(e)?e:t}function Zc(e,t){return void 0===e?t:e}var Kc=function(e,t){return"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e};function Xc(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)}function Jc(e,t,n,r){var a,i,o;if(Yc(e))if(i=e.length,r)for(a=i-1;a>=0;a--)t.call(n,e[a],a);else for(a=0;a<i;a++)t.call(n,e[a],a);else if(Uc(e))for(i=(o=Object.keys(e)).length,a=0;a<i;a++)t.call(n,e[o[a]],o[a])}function Qc(e,t){var n,r,a,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(a=e[n],i=t[n],a.datasetIndex!==i.datasetIndex||a.index!==i.index)return!1;return!0}function eu(e){if(Yc(e))return e.map(eu);if(Uc(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,a=0;a<r;++a)t[n[a]]=eu(e[n[a]]);return t}return e}function tu(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function nu(e,t,n,r){if(tu(e)){var a=t[e],i=n[e];Uc(a)&&Uc(i)?ru(a,i,r):t[e]=eu(i)}}function ru(e,t,n){var r=Yc(t)?t:[t],a=r.length;if(!Uc(e))return e;for(var i,o=(n=n||{}).merger||nu,l=0;l<a;++l)if(Uc(i=r[l]))for(var s=Object.keys(i),c=0,u=s.length;c<u;++c)o(s[c],e,i,n);return e}function au(e,t){return ru(e,t,{merger:iu})}function iu(e,t,n){if(tu(e)){var r=t[e],a=n[e];Uc(r)&&Uc(a)?au(r,a):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=eu(a))}}var ou={"":function(e){return e},x:function(e){return e.x},y:function(e){return e.y}};function lu(e,t){return(ou[t]||(ou[t]=function(e){var t=function(e){var t,n=[],r="",a=Fc(e.split("."));try{for(a.s();!(t=a.n()).done;)(r+=t.value).endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="")}catch(e){a.e(e)}finally{a.f()}return n}(e);return function(e){var n,r=Fc(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(""===a)break;e=e&&e[a]}}catch(e){r.e(e)}finally{r.f()}return e}}(t)))(e)}function su(e){return e.charAt(0).toUpperCase()+e.slice(1)}var cu=function(e){return void 0!==e},uu=function(e){return"function"==typeof e},fu=function(e,t){if(e.size!==t.size)return!1;var n,r=Fc(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(!t.has(a))return!1}}catch(e){r.e(e)}finally{r.f()}return!0},du=Math.PI,hu=2*du,pu=hu+du,vu=Number.POSITIVE_INFINITY,mu=du/180,yu=du/2,gu=du/4,bu=2*du/3,xu=Math.log10,_u=Math.sign;function wu(e,t,n){return Math.abs(e-t)<n}function ku(e){var t=Math.round(e);e=wu(e,t,e/1e3)?t:e;var n=Math.pow(10,Math.floor(xu(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Su(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Ou(e,t,n){var r,a,i;for(r=0,a=e.length;r<a;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function Eu(e){return e*(du/180)}function Au(e){return e*(180/du)}function Cu(e){if(Gc(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}}function ju(e,t){var n=t.x-e.x,r=t.y-e.y,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n);return i<-.5*du&&(i+=hu),{angle:i,distance:a}}function Du(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Mu(e,t){return(e-t+pu)%hu-du}function Pu(e){return(e%hu+hu)%hu}function Ru(e,t,n,r){var a=Pu(e),i=Pu(t),o=Pu(n),l=Pu(i-a),s=Pu(o-a),c=Pu(a-i),u=Pu(a-o);return a===i||a===o||r&&i===o||l>s&&c<u}function Iu(e,t,n){return Math.max(t,Math.min(n,e))}function Lu(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-6;return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Nu(e,t,n){n=n||function(n){return e[n]<t};for(var r,a=e.length-1,i=0;a-i>1;)n(r=i+a>>1)?i=r:a=r;return{lo:i,hi:a}}var Tu=function(e,t,n,r){return Nu(e,n,r?function(r){var a=e[r][t];return a<n||a===n&&e[r+1][t]===n}:function(r){return e[r][t]<n})},Fu=function(e,t,n){return Nu(e,n,(function(r){return e[r][t]>=n}))},zu=["push","pop","shift","splice","unshift"];function Hu(e,t){var n=e._chartjs;if(n){var r=n.listeners,a=r.indexOf(t);-1!==a&&r.splice(a,1),r.length>0||(zu.forEach((function(t){delete e[t]})),delete e._chartjs)}}function Vu(e){var t=new Set(e);return t.size===e.length?e:Array.from(t)}var Wu="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function $u(e,t){var n=[],r=!1;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];n=i,r||(r=!0,Wu.call(window,(function(){r=!1,e.apply(t,n)})))}}var Bu=function(e){return"start"===e?"left":"end"===e?"right":"center"},Yu=function(e,t,n){return"start"===e?t:"end"===e?n:(t+n)/2};function Uu(e,t,n){var r=t.length,a=0,i=r;if(e._sorted){var o=e.iScale,l=e._parsed,s=o.axis,c=o.getUserBounds(),u=c.min,f=c.max,d=c.minDefined,h=c.maxDefined;d&&(a=Iu(Math.min(Tu(l,s,u).lo,n?r:Tu(t,s,o.getPixelForValue(u)).lo),0,r-1)),i=h?Iu(Math.max(Tu(l,o.axis,f,!0).hi+1,n?0:Tu(t,s,o.getPixelForValue(f),!0).hi+1),a,r)-a:r-a}return{start:a,count:i}}function Gu(e){var t=e.xScale,n=e.yScale,r=e._scaleRanges,a={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=a,!0;var i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,a),i}var qu=function(e){return 0===e||1===e},Zu=function(e,t,n){return-Math.pow(2,10*(e-=1))*Math.sin((e-t)*hu/n)},Ku=function(e,t,n){return Math.pow(2,-10*e)*Math.sin((e-t)*hu/n)+1},Xu={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return 1-Math.cos(e*yu)},easeOutSine:function(e){return Math.sin(e*yu)},easeInOutSine:function(e){return-.5*(Math.cos(du*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return qu(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1)))},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){return qu(e)?e:Zu(e,.075,.3)},easeOutElastic:function(e){return qu(e)?e:Ku(e,.075,.3)},easeInOutElastic:function(e){var t=.1125;return qu(e)?e:e<.5?.5*Zu(2*e,t,.45):.5+.5*Ku(2*e-1,t,.45)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-Xu.easeOutBounce(1-e)},easeOutBounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*Xu.easeInBounce(2*e):.5*Xu.easeOutBounce(2*e-1)+.5}};function Ju(e){if(e&&"object"===Tc(e)){var t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function Qu(e){return Ju(e)?e:new Rc(e)}function ef(e){return Ju(e)?e:new Rc(e).saturate(.5).darken(.1).hexString()}var tf=["x","y","borderWidth","radius","tension"],nf=["color","borderColor","backgroundColor"],rf=new Map;function af(e,t,n){return function(e,t){t=t||{};var n=e+JSON.stringify(t),r=rf.get(n);return r||(r=new Intl.NumberFormat(e,t),rf.set(n,r)),r}(t,n).format(e)}var of={values:function(e){return Yc(e)?e:""+e},numeric:function(e,t,n){if(0===e)return"0";var r,a=this.chart.options.locale,i=e;if(n.length>1){var o=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(o<1e-4||o>1e15)&&(r="scientific"),i=function(e,t){var n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}(e,n)}var l=xu(Math.abs(i)),s=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),c={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),af(e,a,c)},logarithmic:function(e,t,n){if(0===e)return"0";var r=n[t].significand||e/Math.pow(10,Math.floor(xu(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?of.numeric.call(this,e,t,n):""}},lf={formatters:of},sf=Object.create(null),cf=Object.create(null);function uf(e,t){if(!t)return e;for(var n=t.split("."),r=0,a=n.length;r<a;++r){var i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function ff(e,t,n){return"string"==typeof t?ru(uf(e,t),n):ru(uf(e,""),t)}var df=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=function(e){return e.chart.platform.getDevicePixelRatio()},this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=function(e,t){return ef(t.backgroundColor)},this.hoverBorderColor=function(e,t){return ef(t.borderColor)},this.hoverColor=function(e,t){return ef(t.color)},this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}var t,n;return t=e,(n=[{key:"set",value:function(e,t){return ff(this,e,t)}},{key:"get",value:function(e){return uf(this,e)}},{key:"describe",value:function(e,t){return ff(cf,e,t)}},{key:"override",value:function(e,t){return ff(sf,e,t)}},{key:"route",value:function(e,t,n,r){var a,i=uf(this,e),o=uf(this,n),l="_"+t;Object.defineProperties(i,(Lc(a={},l,{value:i[t],writable:!0}),Lc(a,t,{enumerable:!0,get:function(){var e=this[l],t=o[r];return Uc(e)?Object.assign({},t,e):Zc(e,t)},set:function(e){this[l]=e}}),a))}},{key:"apply",value:function(e){var t=this;e.forEach((function(e){return e(t)}))}}])&&Nc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),hf=new df({_scriptable:function(e){return!e.startsWith("on")},_indexable:function(e){return"events"!==e},hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:function(e){return"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}}),e.set("animations",{colors:{type:"color",properties:nf},numbers:{type:"number",properties:tf}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:function(e){return 0|e}}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:function(e,t){return t.lineWidth},tickColor:function(e,t){return t.color},offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:lf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:function(e){return!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e},_indexable:function(e){return"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:function(e){return"backdropPadding"!==e&&"callback"!==e},_indexable:function(e){return"backdropPadding"!==e}})}]);function pf(e,t,n,r,a){var i=t[a];return i||(i=t[a]=e.measureText(a).width,n.push(a)),i>r&&(r=i),r}function vf(e,t,n,r){var a=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(a=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;var o,l,s,c,u,f=0,d=n.length;for(o=0;o<d;o++)if(null==(c=n[o])||Yc(c)){if(Yc(c))for(l=0,s=c.length;l<s;l++)null==(u=c[l])||Yc(u)||(f=pf(e,a,i,f,u))}else f=pf(e,a,i,f,c);e.restore();var h=i.length/2;if(h>n.length){for(o=0;o<h;o++)delete a[i[o]];i.splice(0,h)}return f}function mf(e,t,n){var r=e.currentDevicePixelRatio,a=0!==n?Math.max(n/2,.5):0;return Math.round((t-a)*r)/r+a}function yf(e,t){(t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function gf(e,t,n,r){bf(e,t,n,r,null)}function bf(e,t,n,r,a){var i,o,l,s,c,u,f,d,h=t.pointStyle,p=t.rotation,v=t.radius,m=(p||0)*mu;if(h&&"object"===Tc(h)&&("[object HTMLImageElement]"===(i=h.toString())||"[object HTMLCanvasElement]"===i))return e.save(),e.translate(n,r),e.rotate(m),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void e.restore();if(!(isNaN(v)||v<=0)){switch(e.beginPath(),h){default:a?e.ellipse(n,r,a/2,v,0,0,hu):e.arc(n,r,v,0,hu),e.closePath();break;case"triangle":u=a?a/2:v,e.moveTo(n+Math.sin(m)*u,r-Math.cos(m)*v),m+=bu,e.lineTo(n+Math.sin(m)*u,r-Math.cos(m)*v),m+=bu,e.lineTo(n+Math.sin(m)*u,r-Math.cos(m)*v),e.closePath();break;case"rectRounded":s=v-(c=.516*v),o=Math.cos(m+gu)*s,f=Math.cos(m+gu)*(a?a/2-c:s),l=Math.sin(m+gu)*s,d=Math.sin(m+gu)*(a?a/2-c:s),e.arc(n-f,r-l,c,m-du,m-yu),e.arc(n+d,r-o,c,m-yu,m),e.arc(n+f,r+l,c,m,m+yu),e.arc(n-d,r+o,c,m+yu,m+du),e.closePath();break;case"rect":if(!p){s=Math.SQRT1_2*v,u=a?a/2:s,e.rect(n-u,r-s,2*u,2*s);break}m+=gu;case"rectRot":f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+d,r-o),e.lineTo(n+f,r+l),e.lineTo(n-d,r+o),e.closePath();break;case"crossRot":m+=gu;case"cross":f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+f,r+l),e.moveTo(n+d,r-o),e.lineTo(n-d,r+o);break;case"star":f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+f,r+l),e.moveTo(n+d,r-o),e.lineTo(n-d,r+o),m+=gu,f=Math.cos(m)*(a?a/2:v),o=Math.cos(m)*v,l=Math.sin(m)*v,d=Math.sin(m)*(a?a/2:v),e.moveTo(n-f,r-l),e.lineTo(n+f,r+l),e.moveTo(n+d,r-o),e.lineTo(n-d,r+o);break;case"line":o=a?a/2:Math.cos(m)*v,l=Math.sin(m)*v,e.moveTo(n-o,r-l),e.lineTo(n+o,r+l);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(m)*(a?a/2:v),r+Math.sin(m)*v);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function xf(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function _f(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function wf(e){e.restore()}function kf(e,t,n,r,a){if(!t)return e.lineTo(n.x,n.y);if("middle"===a){var i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else"after"===a!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Sf(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function Of(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Bc(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Ef(e,t,n,r,a){if(a.strikethrough||a.underline){var i=e.measureText(r),o=t-i.actualBoundingBoxLeft,l=t+i.actualBoundingBoxRight,s=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=a.strikethrough?(s+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=a.decorationWidth||2,e.moveTo(o,u),e.lineTo(l,u),e.stroke()}}function Af(e,t){var n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Cf(e,t,n,r,a){var i,o,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=Yc(t)?t:[t],c=l.strokeWidth>0&&""!==l.strokeColor;for(e.save(),e.font=a.string,Of(e,l),i=0;i<s.length;++i)o=s[i],l.backdrop&&Af(e,l.backdrop),c&&(l.strokeColor&&(e.strokeStyle=l.strokeColor),Bc(l.strokeWidth)||(e.lineWidth=l.strokeWidth),e.strokeText(o,n,r,l.maxWidth)),e.fillText(o,n,r,l.maxWidth),Ef(e,n,r,o,l),r+=Number(a.lineHeight);e.restore()}function jf(e,t){var n=t.x,r=t.y,a=t.w,i=t.h,o=t.radius;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*du,du,!0),e.lineTo(n,r+i-o.bottomLeft),e.arc(n+o.bottomLeft,r+i-o.bottomLeft,o.bottomLeft,du,yu,!0),e.lineTo(n+a-o.bottomRight,r+i),e.arc(n+a-o.bottomRight,r+i-o.bottomRight,o.bottomRight,yu,0,!0),e.lineTo(n+a,r+o.topRight),e.arc(n+a-o.topRight,r+o.topRight,o.topRight,0,-yu,!0),e.lineTo(n+o.topLeft,r)}var Df=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Mf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Pf(e,t){var n=(""+e).match(Df);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e}function Rf(e,t){var n,r={},a=Uc(t),i=a?Object.keys(t):t,o=Uc(e)?a?function(n){return Zc(e[n],e[t[n]])}:function(t){return e[t]}:function(){return e},l=Fc(i);try{for(l.s();!(n=l.n()).done;){var s=n.value;r[s]=+o(s)||0}}catch(e){l.e(e)}finally{l.f()}return r}function If(e){return Rf(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Lf(e){return Rf(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Nf(e){var t=If(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Tf(e,t){e=e||{},t=t||hf.font;var n=Zc(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));var r=Zc(e.style,t.style);r&&!(""+r).match(Mf)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);var a={family:Zc(e.family,t.family),lineHeight:Pf(Zc(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Zc(e.weight,t.weight),string:""};return a.string=function(e){return!e||Bc(e.size)||Bc(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(a),a}function Ff(e,t,n,r){var a,i,o,l=!0;for(a=0,i=e.length;a<i;++a)if(void 0!==(o=e[a])&&(void 0!==t&&"function"==typeof o&&(o=o(t),l=!1),void 0!==n&&Yc(o)&&(o=o[n%o.length],l=!1),void 0!==o))return r&&!l&&(r.cacheable=!1),o}function zf(e,t){return Object.assign(Object.create(e),t)}function Hf(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""],r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return e[0]},o=r||e;void 0===a&&(a=Jf("_fallback",e));var l=(Lc(t={},Symbol.toStringTag,"Object"),Lc(t,"_cacheable",!0),Lc(t,"_scopes",e),Lc(t,"_rootScopes",o),Lc(t,"_fallback",a),Lc(t,"_getTarget",i),Lc(t,"override",(function(t){return Hf([t].concat(Ic(e)),n,o,a)})),t);return new Proxy(l,{deleteProperty:function(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get:function(t,r){return Yf(t,r,(function(){return Xf(r,n,e,t)}))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e[0])},has:function(e,t){return Qf(e).includes(t)},ownKeys:function(e){return Qf(e)},set:function(e,t,n){var r=e._storage||(e._storage=i());return e[t]=r[t]=n,delete e._keys,!0}})}function Vf(e,t,n,r){var a={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Wf(e,r),setContext:function(t){return Vf(e,t,n,r)},override:function(a){return Vf(e.override(a),t,n,r)}};return new Proxy(a,{deleteProperty:function(t,n){return delete t[n],delete e[n],!0},get:function(e,t,n){return Yf(e,t,(function(){return function(e,t,n){var r=e._proxy,a=e._context,i=e._subProxy,o=e._descriptors,l=r[t];return uu(l)&&o.isScriptable(t)&&(l=function(e,t,n,r){var a=n._proxy,i=n._context,o=n._subProxy,l=n._stack;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);var s=t(i,o||r);return l.delete(e),Bf(e,s)&&(s=Zf(a._scopes,a,e,s)),s}(t,l,e,n)),Yc(l)&&l.length&&(l=function(e,t,n,r){var a=n._proxy,i=n._context,o=n._subProxy,l=n._descriptors;if(void 0!==i.index&&r(e))return t[i.index%t.length];if(Uc(t[0])){var s=t,c=a._scopes.filter((function(e){return e!==s}));t=[];var u,f=Fc(s);try{for(f.s();!(u=f.n()).done;){var d=Zf(c,a,e,u.value);t.push(Vf(d,i,o&&o[e],l))}}catch(e){f.e(e)}finally{f.f()}}return t}(t,l,e,o.isIndexable)),Bf(t,l)&&(l=Vf(l,a,i&&i[t],o)),l}(e,t,n)}))},getOwnPropertyDescriptor:function(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e)},has:function(t,n){return Reflect.has(e,n)},ownKeys:function(){return Reflect.ownKeys(e)},set:function(t,n,r){return e[n]=r,delete t[n],!0}})}function Wf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},n=e._scriptable,r=void 0===n?t.scriptable:n,a=e._indexable,i=void 0===a?t.indexable:a,o=e._allKeys,l=void 0===o?t.allKeys:o;return{allKeys:l,scriptable:r,indexable:i,isScriptable:uu(r)?r:function(){return r},isIndexable:uu(i)?i:function(){return i}}}var $f=function(e,t){return e?e+su(t):t},Bf=function(e,t){return Uc(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object)};function Yf(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];var r=n();return e[t]=r,r}function Uf(e,t,n){return uu(e)?e(t,n):e}var Gf=function(e,t){return!0===e?t:"string"==typeof e?lu(t,e):void 0};function qf(e,t,n,r,a){var i,o=Fc(t);try{for(o.s();!(i=o.n()).done;){var l=i.value,s=Gf(n,l);if(s){e.add(s);var c=Uf(s._fallback,n,a);if(void 0!==c&&c!==n&&c!==r)return c}else if(!1===s&&void 0!==r&&n!==r)return null}}catch(e){o.e(e)}finally{o.f()}return!1}function Zf(e,t,n,r){var a=t._rootScopes,i=Uf(t._fallback,n,r),o=[].concat(Ic(e),Ic(a)),l=new Set;l.add(r);var s=Kf(l,o,n,i||n,r);return null!==s&&(void 0===i||i===n||null!==(s=Kf(l,o,i,s,r)))&&Hf(Array.from(l),[""],a,i,(function(){return function(e,t,n){var r=e._getTarget();t in r||(r[t]={});var a=r[t];return Yc(a)&&Uc(n)?n:a||{}}(t,n,r)}))}function Kf(e,t,n,r,a){for(;n;)n=qf(e,t,n,r,a);return n}function Xf(e,t,n,r){var a,i,o=Fc(t);try{for(o.s();!(i=o.n()).done;){var l=i.value;if(void 0!==(a=Jf($f(l,e),n)))return Bf(e,a)?Zf(n,r,e,a):a}}catch(e){o.e(e)}finally{o.f()}}function Jf(e,t){var n,r=Fc(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a){var i=a[e];if(void 0!==i)return i}}}catch(e){r.e(e)}finally{r.f()}}function Qf(e){var t=e._keys;return t||(t=e._keys=function(e){var t,n=new Set,r=Fc(e);try{for(r.s();!(t=r.n()).done;){var a,i=t.value,o=Fc(Object.keys(i).filter((function(e){return!e.startsWith("_")})));try{for(o.s();!(a=o.n()).done;){var l=a.value;n.add(l)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}return Array.from(n)}(e._scopes)),t}function ed(e,t,n,r){var a,i,o,l,s=e.iScale,c=this._parsing.key,u=void 0===c?"r":c,f=new Array(r);for(a=0,i=r;a<i;++a)l=t[o=a+n],f[a]={r:s.parse(lu(l,u),o)};return f}var td=Number.EPSILON||1e-14,nd=function(e,t){return t<e.length&&!e[t].skip&&e[t]},rd=function(e){return"x"===e?"y":"x"};function ad(e,t,n,r){var a=e.skip?t:e,i=t,o=n.skip?t:n,l=Du(i,a),s=Du(o,i),c=l/(l+s),u=s/(l+s),f=r*(c=isNaN(c)?0:c),d=r*(u=isNaN(u)?0:u);return{previous:{x:i.x-f*(o.x-a.x),y:i.y-f*(o.y-a.y)},next:{x:i.x+d*(o.x-a.x),y:i.y+d*(o.y-a.y)}}}function id(e,t,n){for(var r,a,i,o,l,s=e.length,c=nd(e,0),u=0;u<s-1;++u)l=c,c=nd(e,u+1),l&&c&&(wu(t[u],0,td)?n[u]=n[u+1]=0:(r=n[u]/t[u],a=n[u+1]/t[u],(o=Math.pow(r,2)+Math.pow(a,2))<=9||(i=3/Math.sqrt(o),n[u]=r*i*t[u],n[u+1]=a*i*t[u])))}function od(e,t){for(var n,r,a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",o=rd(i),l=e.length,s=nd(e,0),c=0;c<l;++c)if(r=a,a=s,s=nd(e,c+1),a){var u=a[i],f=a[o];r&&(n=(u-r[i])/3,a["cp1".concat(i)]=u-n,a["cp1".concat(o)]=f-n*t[c]),s&&(n=(s[i]-u)/3,a["cp2".concat(i)]=u+n,a["cp2".concat(o)]=f+n*t[c])}}function ld(e,t,n){return Math.max(Math.min(e,n),t)}function sd(){return"undefined"!=typeof window&&"undefined"!=typeof document}function cd(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function ud(e,t,n){var r;return"string"==typeof e?(r=parseInt(e,10),-1!==e.indexOf("%")&&(r=r/100*t.parentNode[n])):r=e,r}var fd=function(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)},dd=["top","right","bottom","left"];function hd(e,t,n){var r={};n=n?"-"+n:"";for(var a=0;a<4;a++){var i=dd[a];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function pd(e,t){if("native"in e)return e;var n=t.canvas,r=t.currentDevicePixelRatio,a=fd(n),i="border-box"===a.boxSizing,o=hd(a,"padding"),l=hd(a,"border","width"),s=function(e,t){var n,r,a=e.touches,i=a&&a.length?a[0]:e,o=i.offsetX,l=i.offsetY,s=!1;if(function(e,t,n){return(e>0||t>0)&&(!n||!n.shadowRoot)}(o,l,e.target))n=o,r=l;else{var c=t.getBoundingClientRect();n=i.clientX-c.left,r=i.clientY-c.top,s=!0}return{x:n,y:r,box:s}}(e,n),c=s.x,u=s.y,f=s.box,d=o.left+(f&&l.left),h=o.top+(f&&l.top),p=t.width,v=t.height;return i&&(p-=o.width+l.width,v-=o.height+l.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((u-h)/v*n.height/r)}}var vd=function(e){return Math.round(10*e)/10};function md(e,t,n){var r=t||1,a=Math.floor(e.height*r),i=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);var o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height="".concat(e.height,"px"),o.style.width="".concat(e.width,"px")),(e.currentDevicePixelRatio!==r||o.height!==a||o.width!==i)&&(e.currentDevicePixelRatio=r,o.height=a,o.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0)}var yd=function(){var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function gd(e,t){var n=function(e,t){return fd(e).getPropertyValue(t)}(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function bd(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function xd(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function _d(e,t,n,r){var a={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},o=bd(e,a,n),l=bd(a,i,n),s=bd(i,t,n),c=bd(o,l,n),u=bd(l,s,n);return bd(c,u,n)}function wd(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}}function kd(e,t){var n,r;"ltr"!==t&&"rtl"!==t||(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function Sd(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Od(e){return"angle"===e?{between:Ru,compare:Mu,normalize:Pu}:{between:Lu,compare:function(e,t){return e-t},normalize:function(e){return e}}}function Ed(e){var t=e.start,n=e.end,r=e.count;return{start:t%r,end:n%r,loop:e.loop&&(n-t+1)%r==0,style:e.style}}function Ad(e,t,n){if(!n)return[e];for(var r,a,i,o=n.property,l=n.start,s=n.end,c=t.length,u=Od(o),f=u.compare,d=u.between,h=u.normalize,p=function(e,t,n){var r,a,i=n.property,o=n.start,l=n.end,s=Od(i),c=s.between,u=s.normalize,f=t.length,d=e.start,h=e.end,p=e.loop;if(p){for(d+=f,h+=f,r=0,a=f;r<a&&c(u(t[d%f][i]),o,l);++r)d--,h--;d%=f,h%=f}return h<d&&(h+=f),{start:d,end:h,loop:p,style:e.style}}(e,t,n),v=p.start,m=p.end,y=p.loop,g=p.style,b=[],x=!1,_=null,w=v,k=v;w<=m;++w)(a=t[w%c]).skip||(r=h(a[o]))!==i&&(x=d(r,l,s),null===_&&(x||d(l,i,r)&&0!==f(l,i))&&(_=0===f(r,l)?w:k),null!==_&&(!x||0===f(s,r)||d(s,i,r))&&(b.push(Ed({start:_,end:w,loop:y,count:c,style:g})),_=null),k=w,i=r);return null!==_&&b.push(Ed({start:_,end:m,loop:y,count:c,style:g})),b}function Cd(e,t){for(var n=[],r=e.segments,a=0;a<r.length;a++){var i=Ad(r[a],e.points,t);i.length&&n.push.apply(n,Ic(i))}return n}function jd(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Dd(e,t){if(!t)return!1;var n=[],r=function(e,t){return Ju(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function Md(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Md(Object(n),!0).forEach((function(t){Wd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Md(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rd(){return Rd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=Id(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},Rd.apply(this,arguments)}function Id(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Hd(e)););return e}function Ld(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nd(e,t)}function Nd(e,t){return Nd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nd(e,t)}function Td(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hd(e);if(t){var a=Hd(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Fd(this,n)}}function Fd(e,t){if(t&&("object"===Bd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zd(e)}function zd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hd(e){return Hd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hd(e)}function Vd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Ud(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ud(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function Bd(e){return Bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bd(e)}function Yd(e){return function(e){if(Array.isArray(e))return Gd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ud(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ud(e,t){if(e){if("string"==typeof e)return Gd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gd(e,t):void 0}}function Gd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kd(e,t,n){return t&&Zd(e.prototype,t),n&&Zd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Xd=new(function(){function e(){qd(this,e),this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}return Kd(e,[{key:"_notify",value:function(e,t,n,r){var a=t.listeners[r],i=t.duration;a.forEach((function(r){return r({chart:e,initial:t.initial,numSteps:i,currentStep:Math.min(n-t.start,i)})}))}},{key:"_refresh",value:function(){var e=this;this._request||(this._running=!0,this._request=Wu.call(window,(function(){e._update(),e._request=null,e._running&&e._refresh()})))}},{key:"_update",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),n=0;this._charts.forEach((function(r,a){if(r.running&&r.items.length){for(var i,o=r.items,l=o.length-1,s=!1;l>=0;--l)(i=o[l])._active?(i._total>r.duration&&(r.duration=i._total),i.tick(t),s=!0):(o[l]=o[o.length-1],o.pop());s&&(a.draw(),e._notify(a,r,t,"progress")),o.length||(r.running=!1,e._notify(a,r,t,"complete"),r.initial=!1),n+=o.length}})),this._lastDate=t,0===n&&(this._running=!1)}},{key:"_getAnims",value:function(e){var t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}},{key:"listen",value:function(e,t,n){this._getAnims(e).listeners[t].push(n)}},{key:"add",value:function(e,t){var n;t&&t.length&&(n=this._getAnims(e).items).push.apply(n,Yd(t))}},{key:"has",value:function(e){return this._getAnims(e).items.length>0}},{key:"start",value:function(e){var t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((function(e,t){return Math.max(e,t._duration)}),0),this._refresh())}},{key:"running",value:function(e){if(!this._running)return!1;var t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}},{key:"stop",value:function(e){var t=this._charts.get(e);if(t&&t.items.length){for(var n=t.items,r=n.length-1;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}}},{key:"remove",value:function(e){return this._charts.delete(e)}}]),e}()),Jd="transparent",Qd={boolean:function(e,t,n){return n>.5?t:e},color:function(e,t,n){var r=Qu(e||Jd),a=r.valid&&Qu(t||Jd);return a&&a.valid?a.mix(r,n).hexString():t},number:function(e,t,n){return e+(t-e)*n}},eh=function(){function e(t,n,r,a){qd(this,e);var i=n[r];a=Ff([t.to,a,i,t.from]);var o=Ff([t.from,i,a]);this._active=!0,this._fn=t.fn||Qd[t.type||Bd(o)],this._easing=Xu[t.easing]||Xu.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=a,this._promises=void 0}return Kd(e,[{key:"active",value:function(){return this._active}},{key:"update",value:function(e,t,n){if(this._active){this._notify(!1);var r=this._target[this._prop],a=n-this._start,i=this._duration-a;this._start=n,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=a,this._loop=!!e.loop,this._to=Ff([e.to,t,r,e.from]),this._from=Ff([e.from,r,t])}}},{key:"cancel",value:function(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}},{key:"tick",value:function(e){var t,n=e-this._start,r=this._duration,a=this._prop,i=this._from,o=this._loop,l=this._to;if(this._active=i!==l&&(o||n<r),!this._active)return this._target[a]=l,void this._notify(!0);n<0?this._target[a]=i:(t=n/r%2,t=o&&t>1?2-t:t,t=this._easing(Math.min(1,Math.max(0,t))),this._target[a]=this._fn(i,l,t))}},{key:"wait",value:function(){var e=this._promises||(this._promises=[]);return new Promise((function(t,n){e.push({res:t,rej:n})}))}},{key:"_notify",value:function(e){for(var t=e?"res":"rej",n=this._promises||[],r=0;r<n.length;r++)n[r][t]()}}]),e}(),th=function(){function e(t,n){qd(this,e),this._chart=t,this._properties=new Map,this.configure(n)}return Kd(e,[{key:"configure",value:function(e){if(Uc(e)){var t=Object.keys(hf.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach((function(r){var a=e[r];if(Uc(a)){var i,o={},l=$d(t);try{for(l.s();!(i=l.n()).done;){var s=i.value;o[s]=a[s]}}catch(e){l.e(e)}finally{l.f()}(Yc(a.properties)&&a.properties||[r]).forEach((function(e){e!==r&&n.has(e)||n.set(e,o)}))}}))}}},{key:"_animateOptions",value:function(e,t){var n=t.options,r=function(e,t){if(t){var n=e.options;if(n)return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;e.options=t}}(e,n);if(!r)return[];var a=this._createAnimations(r,n);return n.$shared&&function(e,t){for(var n=[],r=Object.keys(t),a=0;a<r.length;a++){var i=e[r[a]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}(e.options.$animations,n).then((function(){e.options=n}),(function(){})),a}},{key:"_createAnimations",value:function(e,t){var n,r=this._properties,a=[],i=e.$animations||(e.$animations={}),o=Object.keys(t),l=Date.now();for(n=o.length-1;n>=0;--n){var s=o[n];if("$"!==s.charAt(0))if("options"!==s){var c=t[s],u=i[s],f=r.get(s);if(u){if(f&&u.active()){u.update(f,c,l);continue}u.cancel()}f&&f.duration?(i[s]=u=new eh(f,e,s,c),a.push(u)):e[s]=c}else a.push.apply(a,Yd(this._animateOptions(e,t)))}return a}},{key:"update",value:function(e,t){if(0!==this._properties.size){var n=this._createAnimations(e,t);return n.length?(Xd.add(this._chart,n),!0):void 0}Object.assign(e,t)}}]),e}();function nh(e,t){var n=e&&e.options||{},r=n.reverse,a=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:a,end:r?a:i}}function rh(e,t){var n,r,a=[],i=e._getSortedDatasetMetas(t);for(n=0,r=i.length;n<r;++n)a.push(i[n].index);return a}function ah(e,t,n){var r,a,i,o,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=e.keys,c="single"===l.mode;if(null!==t){for(r=0,a=s.length;r<a;++r){if((i=+s[r])===n){if(l.all)continue;break}Gc(o=e.values[i])&&(c||0===t||_u(t)===_u(o))&&(t+=o)}return t}}function ih(e,t){var n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function oh(e,t,n){var r=e[t]||(e[t]={});return r[n]||(r[n]={})}function lh(e,t,n,r){var a,i=$d(t.getMatchingVisibleMetas(r).reverse());try{for(i.s();!(a=i.n()).done;){var o=a.value,l=e[o.index];if(n&&l>0||!n&&l<0)return o.index}}catch(e){i.e(e)}finally{i.f()}return null}function sh(e,t){for(var n,r=e.chart,a=e._cachedMeta,i=r._stacks||(r._stacks={}),o=a.iScale,l=a.vScale,s=a.index,c=o.axis,u=l.axis,f=function(e,t,n){return"".concat(e.id,".").concat(t.id,".").concat(n.stack||n.type)}(o,l,a),d=t.length,h=0;h<d;++h){var p=t[h],v=p[c],m=p[u];(n=(p._stacks||(p._stacks={}))[u]=oh(i,f,v))[s]=m,n._top=lh(n,l,!0,a.type),n._bottom=lh(n,l,!1,a.type),(n._visualValues||(n._visualValues={}))[s]=m}}function ch(e,t){var n=e.scales;return Object.keys(n).filter((function(e){return n[e].axis===t})).shift()}function uh(e,t){var n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){var a,i=$d(t=t||e._parsed);try{for(i.s();!(a=i.n()).done;){var o=a.value._stacks;if(!o||void 0===o[r]||void 0===o[r][n])return;delete o[r][n],void 0!==o[r]._visualValues&&void 0!==o[r]._visualValues[n]&&delete o[r]._visualValues[n]}}catch(e){i.e(e)}finally{i.f()}}}var fh=function(e){return"reset"===e||"none"===e},dh=function(e,t){return t?e:Object.assign({},e)},hh=function(){function e(t,n){qd(this,e),this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=(this instanceof e?this.constructor:void 0).datasetElementType,this.dataElementType=(this instanceof e?this.constructor:void 0).dataElementType,this.initialize()}return Kd(e,[{key:"initialize",value:function(){var e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=ih(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}},{key:"updateIndex",value:function(e){this.index!==e&&uh(this._cachedMeta),this.index=e}},{key:"linkScales",value:function(){var e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=function(e,t,n,r){return"x"===e?t:"r"===e?r:n},a=t.xAxisID=Zc(n.xAxisID,ch(e,"x")),i=t.yAxisID=Zc(n.yAxisID,ch(e,"y")),o=t.rAxisID=Zc(n.rAxisID,ch(e,"r")),l=t.indexAxis,s=t.iAxisID=r(l,a,i,o),c=t.vAxisID=r(l,i,a,o);t.xScale=this.getScaleForId(a),t.yScale=this.getScaleForId(i),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(s),t.vScale=this.getScaleForId(c)}},{key:"getDataset",value:function(){return this.chart.data.datasets[this.index]}},{key:"getMeta",value:function(){return this.chart.getDatasetMeta(this.index)}},{key:"getScaleForId",value:function(e){return this.chart.scales[e]}},{key:"_getOtherScale",value:function(e){var t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}},{key:"reset",value:function(){this._update("reset")}},{key:"_destroy",value:function(){var e=this._cachedMeta;this._data&&Hu(this._data,this),e._stacked&&uh(e)}},{key:"_dataCheck",value:function(){var e,t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Uc(n))this._data=function(e){var t,n,r,a=Object.keys(e),i=new Array(a.length);for(t=0,n=a.length;t<n;++t)r=a[t],i[t]={x:r,y:e[r]};return i}(n);else if(r!==n){if(r){Hu(r,this);var a=this._cachedMeta;uh(a),a._parsed=[]}n&&Object.isExtensible(n)&&(this,(e=n)._chartjs?e._chartjs.listeners.push(this):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),zu.forEach((function(t){var n="_onData"+su(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){for(var t=arguments.length,a=new Array(t),i=0;i<t;i++)a[i]=arguments[i];var o=r.apply(this,a);return e._chartjs.listeners.forEach((function(e){"function"==typeof e[n]&&e[n].apply(e,a)})),o}})})))),this._syncList=[],this._data=n}}},{key:"addElements",value:function(){var e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}},{key:"buildOrUpdateElements",value:function(e){var t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();var a=t._stacked;t._stacked=ih(t.vScale,t),t.stack!==n.stack&&(r=!0,uh(t),t.stack=n.stack),this._resyncElements(e),(r||a!==t._stacked)&&sh(this,t._parsed)}},{key:"configure",value:function(){var e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}},{key:"parse",value:function(e,t){var n,r,a,i=this._cachedMeta,o=this._data,l=i.iScale,s=i._stacked,c=l.axis,u=0===e&&t===o.length||i._sorted,f=e>0&&i._parsed[e-1];if(!1===this._parsing)i._parsed=o,i._sorted=!0,a=o;else{for(a=Yc(o[e])?this.parseArrayData(i,o,e,t):Uc(o[e])?this.parseObjectData(i,o,e,t):this.parsePrimitiveData(i,o,e,t),n=0;n<t;++n)i._parsed[n+e]=r=a[n],u&&((null===r[c]||f&&r[c]<f[c])&&(u=!1),f=r);i._sorted=u}s&&sh(this,a)}},{key:"parsePrimitiveData",value:function(e,t,n,r){var a,i,o,l=e.iScale,s=e.vScale,c=l.axis,u=s.axis,f=l.getLabels(),d=l===s,h=new Array(r);for(a=0,i=r;a<i;++a){var p;o=a+n,h[a]=(Wd(p={},c,d||l.parse(f[o],o)),Wd(p,u,s.parse(t[o],o)),p)}return h}},{key:"parseArrayData",value:function(e,t,n,r){var a,i,o,l,s=e.xScale,c=e.yScale,u=new Array(r);for(a=0,i=r;a<i;++a)l=t[o=a+n],u[a]={x:s.parse(l[0],o),y:c.parse(l[1],o)};return u}},{key:"parseObjectData",value:function(e,t,n,r){var a,i,o,l,s=e.xScale,c=e.yScale,u=this._parsing,f=u.xAxisKey,d=void 0===f?"x":f,h=u.yAxisKey,p=void 0===h?"y":h,v=new Array(r);for(a=0,i=r;a<i;++a)l=t[o=a+n],v[a]={x:s.parse(lu(l,d),o),y:c.parse(lu(l,p),o)};return v}},{key:"getParsed",value:function(e){return this._cachedMeta._parsed[e]}},{key:"getDataElement",value:function(e){return this._cachedMeta.data[e]}},{key:"applyStack",value:function(e,t,n){var r=this.chart,a=this._cachedMeta,i=t[e.axis];return ah({keys:rh(r,!0),values:t._stacks[e.axis]._visualValues},i,a.index,{mode:n})}},{key:"updateRangeFromParsed",value:function(e,t,n,r){var a=n[t.axis],i=null===a?NaN:a,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,i=ah(r,a,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}},{key:"getMinMax",value:function(e,t){var n,r,a=this._cachedMeta,i=a._parsed,o=a._sorted&&e===a.iScale,l=i.length,s=this._getOtherScale(e),c=function(e,t,n){return e&&!t.hidden&&t._stacked&&{keys:rh(n,!0),values:null}}(t,a,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},f=function(e){var t=e.getUserBounds(),n=t.min,r=t.max,a=t.minDefined,i=t.maxDefined;return{min:a?n:Number.NEGATIVE_INFINITY,max:i?r:Number.POSITIVE_INFINITY}}(s),d=f.min,h=f.max;function p(){var t=(r=i[n])[s.axis];return!Gc(r[e.axis])||d>t||h<t}for(n=0;n<l&&(p()||(this.updateRangeFromParsed(u,e,r,c),!o));++n);if(o)for(n=l-1;n>=0;--n)if(!p()){this.updateRangeFromParsed(u,e,r,c);break}return u}},{key:"getAllParsedValues",value:function(e){var t,n,r,a=this._cachedMeta._parsed,i=[];for(t=0,n=a.length;t<n;++t)Gc(r=a[t][e.axis])&&i.push(r);return i}},{key:"getMaxOverflow",value:function(){return!1}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=t.iScale,r=t.vScale,a=this.getParsed(e);return{label:n?""+n.getLabelForValue(a[n.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}},{key:"_update",value:function(e){var t,n,r,a,i,o=this._cachedMeta;this.update(e||"default"),o._clip=(Uc(t=Zc(this.options.clip,function(e,t,n){if(!1===n)return!1;var r=nh(e,n),a=nh(t,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}(o.xScale,o.yScale,this.getMaxOverflow())))?(n=t.top,r=t.right,a=t.bottom,i=t.left):n=r=a=i=t,{top:n,right:r,bottom:a,left:i,disabled:!1===t})}},{key:"update",value:function(e){}},{key:"draw",value:function(){var e,t=this._ctx,n=this.chart,r=this._cachedMeta,a=r.data||[],i=n.chartArea,o=[],l=this._drawStart||0,s=this._drawCount||a.length-l,c=this.options.drawActiveElementsOnTop;for(r.dataset&&r.dataset.draw(t,i,l,s),e=l;e<l+s;++e){var u=a[e];u.hidden||(u.active&&c?o.push(u):u.draw(t,i))}for(e=0;e<o.length;++e)o[e].draw(t,i)}},{key:"getStyle",value:function(e,t){var n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}},{key:"getContext",value:function(e,t,n){var r,a=this.getDataset();if(e>=0&&e<this._cachedMeta.data.length){var i=this._cachedMeta.data[e];r=i.$context||(i.$context=function(e,t,n){return zf(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,i)),r.parsed=this.getParsed(e),r.raw=a.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=function(e,t){return zf(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=a,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=n,r}},{key:"resolveDatasetElementOptions",value:function(e){return this._resolveElementOptions(this.datasetElementType.id,e)}},{key:"resolveDataElementOptions",value:function(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}},{key:"_resolveElementOptions",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2?arguments[2]:void 0,a="active"===n,i=this._cachedDataOpts,o=e+"-"+n,l=i[o],s=this.enableOptionSharing&&cu(r);if(l)return dh(l,s);var c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),f=a?["".concat(e,"Hover"),"hover",e,""]:[e,""],d=c.getOptionScopes(this.getDataset(),u),h=Object.keys(hf.elements[e]),p=function(){return t.getContext(r,a,n)},v=c.resolveNamedOptions(d,h,p,f);return v.$shared&&(v.$shared=s,i[o]=Object.freeze(dh(v,s))),v}},{key:"_resolveAnimations",value:function(e,t,n){var r,a=this.chart,i=this._cachedDataOpts,o="animation-".concat(t),l=i[o];if(l)return l;if(!1!==a.options.animation){var s=this.chart.config,c=s.datasetAnimationScopeKeys(this._type,t),u=s.getOptionScopes(this.getDataset(),c);r=s.createResolver(u,this.getContext(e,n,t))}var f=new th(a,r&&r.animations);return r&&r._cacheable&&(i[o]=Object.freeze(f)),f}},{key:"getSharedOptions",value:function(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}},{key:"includeOptions",value:function(e,t){return!t||fh(e)||this.chart._animationsDisabled}},{key:"_getSharedOptions",value:function(e,t){var n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,a=this.getSharedOptions(n),i=this.includeOptions(t,a)||a!==r;return this.updateSharedOptions(a,t,n),{sharedOptions:a,includeOptions:i}}},{key:"updateElement",value:function(e,t,n,r){fh(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}},{key:"updateSharedOptions",value:function(e,t,n){e&&!fh(t)&&this._resolveAnimations(void 0,t).update(e,n)}},{key:"_setStyle",value:function(e,t,n,r){e.active=r;var a=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(a)||a})}},{key:"removeHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!1)}},{key:"setHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}},{key:"_resyncElements",value:function(e){var t,n=this._data,r=this._cachedMeta.data,a=$d(this._syncList);try{for(a.s();!(t=a.n()).done;){var i=Vd(t.value,3),o=i[0],l=i[1],s=i[2];this[o](l,s)}}catch(e){a.e(e)}finally{a.f()}this._syncList=[];var c=r.length,u=n.length,f=Math.min(u,c);f&&this.parse(0,f),u>c?this._insertElements(c,u-c,e):u<c&&this._removeElements(u,c-u)}},{key:"_insertElements",value:function(e,t){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this._cachedMeta,i=a.data,o=e+t,l=function(e){for(e.length+=t,n=e.length-1;n>=o;n--)e[n]=e[n-t]};for(l(i),n=e;n<o;++n)i[n]=new this.dataElementType;this._parsing&&l(a._parsed),this.parse(e,t),r&&this.updateElements(i,e,t,"reset")}},{key:"updateElements",value:function(e,t,n,r){}},{key:"_removeElements",value:function(e,t){var n=this._cachedMeta;if(this._parsing){var r=n._parsed.splice(e,t);n._stacked&&uh(n,r)}n.data.splice(e,t)}},{key:"_sync",value:function(e){if(this._parsing)this._syncList.push(e);else{var t=Vd(e,3),n=t[0],r=t[1],a=t[2];this[n](r,a)}this.chart._dataChanges.push([this.index].concat(Yd(e)))}},{key:"_onDataPush",value:function(){var e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}},{key:"_onDataPop",value:function(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}},{key:"_onDataShift",value:function(){this._sync(["_removeElements",0,1])}},{key:"_onDataSplice",value:function(e,t){t&&this._sync(["_removeElements",e,t]);var n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}},{key:"_onDataUnshift",value:function(){this._sync(["_insertElements",0,arguments.length])}}]),e}();function ph(e){var t,n,r,a,i=e.iScale,o=function(e,t){if(!e._cache.$bar){for(var n=e.getMatchingVisibleMetas(t),r=[],a=0,i=n.length;a<i;a++)r=r.concat(n[a].controller.getAllParsedValues(e));e._cache.$bar=Vu(r.sort((function(e,t){return e-t})))}return e._cache.$bar}(i,e.type),l=i._length,s=function(){32767!==r&&-32768!==r&&(cu(a)&&(l=Math.min(l,Math.abs(r-a)||l)),a=r)};for(t=0,n=o.length;t<n;++t)r=i.getPixelForValue(o[t]),s();for(a=void 0,t=0,n=i.ticks.length;t<n;++t)r=i.getPixelForTick(t),s();return l}function vh(e,t,n,r){return Yc(e)?function(e,t,n,r){var a=n.parse(e[0],r),i=n.parse(e[1],r),o=Math.min(a,i),l=Math.max(a,i),s=o,c=l;Math.abs(o)>Math.abs(l)&&(s=l,c=o),t[n.axis]=c,t._custom={barStart:s,barEnd:c,start:a,end:i,min:o,max:l}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function mh(e,t,n,r){var a,i,o,l,s=e.iScale,c=e.vScale,u=s.getLabels(),f=s===c,d=[];for(a=n,i=n+r;a<i;++a)l=t[a],(o={})[s.axis]=f||s.parse(u[a],a),d.push(vh(l,o,c,a));return d}function yh(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function gh(e,t,n,r){var a=t.borderSkipped,i={};if(a)if(!0!==a){var o=function(e){var t,n,r,a,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(a="end",i="start"):(a="start",i="end"),{start:n,end:r,reverse:t,top:a,bottom:i}}(e),l=o.start,s=o.end,c=o.reverse,u=o.top,f=o.bottom;"middle"===a&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?a=u:(n._bottom||0)===r?a=f:(i[bh(f,l,s,c)]=!0,a=u)),i[bh(a,l,s,c)]=!0,e.borderSkipped=i}else e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};else e.borderSkipped=i}function bh(e,t,n,r){var a,i,o;return r?(o=n,e=xh(e=(a=e)===(i=t)?o:a===o?i:a,n,t)):e=xh(e,t,n),e}function xh(e,t,n){return"start"===e?t:"end"===e?n:e}function _h(e,t,n){var r=t.inflateAmount;e.inflateAmount="auto"===r?1===n?.33:0:r}Wd(hh,"defaults",{}),Wd(hh,"datasetElementType",null),Wd(hh,"dataElementType",null);var wh=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"parsePrimitiveData",value:function(e,t,n,r){return mh(e,t,n,r)}},{key:"parseArrayData",value:function(e,t,n,r){return mh(e,t,n,r)}},{key:"parseObjectData",value:function(e,t,n,r){var a,i,o,l,s=e.iScale,c=e.vScale,u=this._parsing,f=u.xAxisKey,d=void 0===f?"x":f,h=u.yAxisKey,p=void 0===h?"y":h,v="x"===s.axis?d:p,m="x"===c.axis?d:p,y=[];for(a=n,i=n+r;a<i;++a)l=t[a],(o={})[s.axis]=s.parse(lu(l,v),a),y.push(vh(lu(l,m),o,c,a));return y}},{key:"updateRangeFromParsed",value:function(e,t,r,a){Rd(Hd(n.prototype),"updateRangeFromParsed",this).call(this,e,t,r,a);var i=r._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}},{key:"getMaxOverflow",value:function(){return 0}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=t.iScale,r=t.vScale,a=this.getParsed(e),i=a._custom,o=yh(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+n.getLabelForValue(a[n.axis]),value:o}}},{key:"initialize",value:function(){this.enableOptionSharing=!0,Rd(Hd(n.prototype),"initialize",this).call(this),this._cachedMeta.stack=this.getDataset().stack}},{key:"update",value:function(e){var t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this.index,o=this._cachedMeta.vScale,l=o.getBasePixel(),s=o.isHorizontal(),c=this._getRuler(),u=this._getSharedOptions(t,r),f=u.sharedOptions,d=u.includeOptions,h=t;h<t+n;h++){var p=this.getParsed(h),v=a||Bc(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),m=this._calculateBarIndexPixels(h,c),y=(p._stacks||{})[o.axis],g={horizontal:s,base:v.base,enableBorderRadius:!y||yh(p._custom)||i===y._top||i===y._bottom,x:s?v.head:m.center,y:s?m.center:v.head,height:s?m.size:Math.abs(v.size),width:s?Math.abs(v.size):m.size};d&&(g.options=f||this.resolveDataElementOptions(h,e[h].active?"active":r));var b=g.options||e[h].options;gh(g,b,y,i),_h(g,b,c.ratio),this.updateElement(e[h],h,g,r)}}},{key:"_getStacks",value:function(e,t){var n,r=this._cachedMeta.iScale,a=r.getMatchingVisibleMetas(this._type).filter((function(e){return e.controller.options.grouped})),i=r.options.stacked,o=[],l=function(e){var n=e.controller.getParsed(t),r=n&&n[e.vScale.axis];if(Bc(r)||isNaN(r))return!0},s=$d(a);try{for(s.s();!(n=s.n()).done;){var c=n.value;if((void 0===t||!l(c))&&((!1===i||-1===o.indexOf(c.stack)||void 0===i&&void 0===c.stack)&&o.push(c.stack),c.index===e))break}}catch(e){s.e(e)}finally{s.f()}return o.length||o.push(void 0),o}},{key:"_getStackCount",value:function(e){return this._getStacks(void 0,e).length}},{key:"_getStackIndex",value:function(e,t,n){var r=this._getStacks(e,n),a=void 0!==t?r.indexOf(t):-1;return-1===a?r.length-1:a}},{key:"_getRuler",value:function(){var e,t,n=this.options,r=this._cachedMeta,a=r.iScale,i=[];for(e=0,t=r.data.length;e<t;++e)i.push(a.getPixelForValue(this.getParsed(e)[a.axis],e));var o=n.barThickness;return{min:o||ph(r),pixels:i,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:n.grouped,ratio:o?1:n.categoryPercentage*n.barPercentage}}},{key:"_calculateBarValuePixels",value:function(e){var t,n,r=this._cachedMeta,a=r.vScale,i=r._stacked,o=r.index,l=this.options,s=l.base,c=l.minBarLength,u=s||0,f=this.getParsed(e),d=f._custom,h=yh(d),p=f[a.axis],v=0,m=i?this.applyStack(a,f,i):p;m!==p&&(v=m-p,m=p),h&&(p=d.barStart,m=d.barEnd-d.barStart,0!==p&&_u(p)!==_u(d.barEnd)&&(v=0),v+=p);var y=Bc(s)||h?v:s,g=a.getPixelForValue(y);if(n=(t=this.chart.getDataVisibility(e)?a.getPixelForValue(v+m):g)-g,Math.abs(n)<c){n=function(e,t,n){return 0!==e?_u(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(n,a,u)*c,p===u&&(g-=n/2);var b=a.getPixelForDecimal(0),x=a.getPixelForDecimal(1),_=Math.min(b,x),w=Math.max(b,x);t=(g=Math.max(Math.min(g,w),_))+n,i&&!h&&(f._stacks[a.axis]._visualValues[o]=a.getValueForPixel(t)-a.getValueForPixel(g))}if(g===a.getPixelForValue(u)){var k=_u(n)*a.getLineWidthForValue(u)/2;g+=k,n-=k}return{size:n,base:g,head:t,center:t+n/2}}},{key:"_calculateBarIndexPixels",value:function(e,t){var n,r,a=t.scale,i=this.options,o=i.skipNull,l=Zc(i.maxBarThickness,1/0);if(t.grouped){var s=o?this._getStackCount(e):t.stackCount,c="flex"===i.barThickness?function(e,t,n,r){var a=t.pixels,i=a[e],o=e>0?a[e-1]:null,l=e<a.length-1?a[e+1]:null,s=n.categoryPercentage;null===o&&(o=i-(null===l?t.end-t.start:l-i)),null===l&&(l=i+i-o);var c=i-(i-Math.min(o,l))/2*s;return{chunk:Math.abs(l-o)/2*s/r,ratio:n.barPercentage,start:c}}(e,t,i,s):function(e,t,n,r){var a,i,o=n.barThickness;return Bc(o)?(a=t.min*n.categoryPercentage,i=n.barPercentage):(a=o*r,i=1),{chunk:a/r,ratio:i,start:t.pixels[e]-a/2}}(e,t,i,s),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);n=c.start+c.chunk*u+c.chunk/2,r=Math.min(l,c.chunk*c.ratio)}else n=a.getPixelForValue(this.getParsed(e)[a.axis],e),r=Math.min(l,t.min*t.ratio);return{base:n-r/2,head:n+r/2,center:n,size:r}}},{key:"draw",value:function(){for(var e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,a=0;a<r;++a)null!==this.getParsed(a)[t.axis]&&n[a].draw(this._ctx)}}]),n}(hh);Wd(wh,"id","bar"),Wd(wh,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Wd(wh,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var kh=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,Rd(Hd(n.prototype),"initialize",this).call(this)}},{key:"parsePrimitiveData",value:function(e,t,r,a){for(var i=Rd(Hd(n.prototype),"parsePrimitiveData",this).call(this,e,t,r,a),o=0;o<i.length;o++)i[o]._custom=this.resolveDataElementOptions(o+r).radius;return i}},{key:"parseArrayData",value:function(e,t,r,a){for(var i=Rd(Hd(n.prototype),"parseArrayData",this).call(this,e,t,r,a),o=0;o<i.length;o++){var l=t[r+o];i[o]._custom=Zc(l[2],this.resolveDataElementOptions(o+r).radius)}return i}},{key:"parseObjectData",value:function(e,t,r,a){for(var i=Rd(Hd(n.prototype),"parseObjectData",this).call(this,e,t,r,a),o=0;o<i.length;o++){var l=t[r+o];i[o]._custom=Zc(l&&l.r&&+l.r,this.resolveDataElementOptions(o+r).radius)}return i}},{key:"getMaxOverflow",value:function(){for(var e=this._cachedMeta.data,t=0,n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart.data.labels||[],r=t.xScale,a=t.yScale,i=this.getParsed(e),o=r.getLabelForValue(i.x),l=a.getLabelForValue(i.y),s=i._custom;return{label:n[e]||"",value:"("+o+", "+l+(s?", "+s:"")+")"}}},{key:"update",value:function(e){var t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this._cachedMeta,o=i.iScale,l=i.vScale,s=this._getSharedOptions(t,r),c=s.sharedOptions,u=s.includeOptions,f=o.axis,d=l.axis,h=t;h<t+n;h++){var p=e[h],v=!a&&this.getParsed(h),m={},y=m[f]=a?o.getPixelForDecimal(.5):o.getPixelForValue(v[f]),g=m[d]=a?l.getBasePixel():l.getPixelForValue(v[d]);m.skip=isNaN(y)||isNaN(g),u&&(m.options=c||this.resolveDataElementOptions(h,p.active?"active":r),a&&(m.options.radius=0)),this.updateElement(p,h,m,r)}}},{key:"resolveDataElementOptions",value:function(e,t){var r=this.getParsed(e),a=Rd(Hd(n.prototype),"resolveDataElementOptions",this).call(this,e,t);a.$shared&&(a=Object.assign({},a,{$shared:!1}));var i=a.radius;return"active"!==t&&(a.radius=0),a.radius+=Zc(r&&r._custom,i),a}}]),n}(hh);Wd(kh,"id","bubble"),Wd(kh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Wd(kh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});var Sh=function(e){Ld(n,e);var t=Td(n);function n(e,r){var a;return qd(this,n),(a=t.call(this,e,r)).enableOptionSharing=!0,a.innerRadius=void 0,a.outerRadius=void 0,a.offsetX=void 0,a.offsetY=void 0,a}return Kd(n,[{key:"linkScales",value:function(){}},{key:"parse",value:function(e,t){var n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{var a,i,o=function(e){return+n[e]};if(Uc(n[e])){var l=this._parsing.key,s=void 0===l?"value":l;o=function(e){return+lu(n[e],s)}}for(a=e,i=e+t;a<i;++a)r._parsed[a]=o(a)}}},{key:"_getRotation",value:function(){return Eu(this.options.rotation-90)}},{key:"_getCircumference",value:function(){return Eu(this.options.circumference)}},{key:"_getRotationExtents",value:function(){for(var e=hu,t=-hu,n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){var r=this.chart.getDatasetMeta(n).controller,a=r._getRotation(),i=r._getCircumference();e=Math.min(e,a),t=Math.max(t,a+i)}return{rotation:e,circumference:t-e}}},{key:"update",value:function(e){var t,n,r=this.chart.chartArea,a=this._cachedMeta,i=a.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-o)/2,0),s=Math.min((n=l,"string"==typeof(t=this.options.cutout)&&t.endsWith("%")?parseFloat(t)/100:+t/n),1),c=this._getRingWeight(this.index),u=this._getRotationExtents(),f=u.circumference,d=function(e,t,n){var r=1,a=1,i=0,o=0;if(t<hu){var l=e,s=l+t,c=Math.cos(l),u=Math.sin(l),f=Math.cos(s),d=Math.sin(s),h=function(e,t,r){return Ru(e,l,s,!0)?1:Math.max(t,t*n,r,r*n)},p=function(e,t,r){return Ru(e,l,s,!0)?-1:Math.min(t,t*n,r,r*n)},v=h(0,c,f),m=h(yu,u,d),y=p(du,c,f),g=p(du+yu,u,d);r=(v-y)/2,a=(m-g)/2,i=-(v+y)/2,o=-(m+g)/2}return{ratioX:r,ratioY:a,offsetX:i,offsetY:o}}(u.rotation,f,s),h=d.ratioX,p=d.ratioY,v=d.offsetX,m=d.offsetY,y=(r.width-o)/h,g=(r.height-o)/p,b=Math.max(Math.min(y,g)/2,0),x=Kc(this.options.radius,b),_=(x-Math.max(x*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=v*x,this.offsetY=m*x,a.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(i,0,i.length,e)}},{key:"_circumference",value:function(e,t){var n=this.options,r=this._cachedMeta,a=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===r._parsed[e]||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*a/hu)}},{key:"updateElements",value:function(e,t,n,r){var a,i="reset"===r,o=this.chart,l=o.chartArea,s=o.options.animation,c=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=i&&s.animateScale,d=f?0:this.innerRadius,h=f?0:this.outerRadius,p=this._getSharedOptions(t,r),v=p.sharedOptions,m=p.includeOptions,y=this._getRotation();for(a=0;a<t;++a)y+=this._circumference(a,i);for(a=t;a<t+n;++a){var g=this._circumference(a,i),b=e[a],x={x:c+this.offsetX,y:u+this.offsetY,startAngle:y,endAngle:y+g,circumference:g,outerRadius:h,innerRadius:d};m&&(x.options=v||this.resolveDataElementOptions(a,b.active?"active":r)),y+=g,this.updateElement(b,a,x,r)}}},{key:"calculateTotal",value:function(){var e,t=this._cachedMeta,n=t.data,r=0;for(e=0;e<n.length;e++){var a=t._parsed[e];null===a||isNaN(a)||!this.chart.getDataVisibility(e)||n[e].hidden||(r+=Math.abs(a))}return r}},{key:"calculateCircumference",value:function(e){var t=this._cachedMeta.total;return t>0&&!isNaN(e)?hu*(Math.abs(e)/t):0}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=af(t._parsed[e],n.options.locale);return{label:r[e]||"",value:a}}},{key:"getMaxBorderWidth",value:function(e){var t,n,r,a,i,o=0,l=this.chart;if(!e)for(t=0,n=l.data.datasets.length;t<n;++t)if(l.isDatasetVisible(t)){e=(r=l.getDatasetMeta(t)).data,a=r.controller;break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)"inner"!==(i=a.resolveDataElementOptions(t)).borderAlign&&(o=Math.max(o,i.borderWidth||0,i.hoverBorderWidth||0));return o}},{key:"getMaxOffset",value:function(e){for(var t=0,n=0,r=e.length;n<r;++n){var a=this.resolveDataElementOptions(n);t=Math.max(t,a.offset||0,a.hoverOffset||0)}return t}},{key:"_getRingWeightOffset",value:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}},{key:"_getRingWeight",value:function(e){return Math.max(Zc(this.chart.data.datasets[e].weight,1),0)}},{key:"_getVisibleDatasetWeightTotal",value:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}]),n}(hh);Wd(Sh,"id","doughnut"),Wd(Sh,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Wd(Sh,"descriptors",{_scriptable:function(e){return"spacing"!==e},_indexable:function(e){return"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}}),Wd(Sh,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(e){var t=e.data;if(t.labels.length&&t.datasets.length){var n=e.legend.options.labels,r=n.pointStyle,a=n.color;return t.labels.map((function(t,n){var i=e.getDatasetMeta(0).controller.getStyle(n);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:a,lineWidth:i.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(n),index:n}}))}return[]}},onClick:function(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}});var Oh=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,this.supportsDecimation=!0,Rd(Hd(n.prototype),"initialize",this).call(this)}},{key:"update",value:function(e){var t=this._cachedMeta,n=t.dataset,r=t.data,a=void 0===r?[]:r,i=t._dataset,o=this.chart._animationsDisabled,l=Uu(t,a,o),s=l.start,c=l.count;this._drawStart=s,this._drawCount=c,Gu(t)&&(s=0,c=a.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=a;var u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:u},e),this.updateElements(a,s,c,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this._cachedMeta,o=i.iScale,l=i.vScale,s=i._stacked,c=i._dataset,u=this._getSharedOptions(t,r),f=u.sharedOptions,d=u.includeOptions,h=o.axis,p=l.axis,v=this.options,m=v.spanGaps,y=v.segment,g=Su(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===r,x=t+n,_=e.length,w=t>0&&this.getParsed(t-1),k=0;k<_;++k){var S=e[k],O=b?S:{};if(k<t||k>=x)O.skip=!0;else{var E=this.getParsed(k),A=Bc(E[p]),C=O[h]=o.getPixelForValue(E[h],k),j=O[p]=a||A?l.getBasePixel():l.getPixelForValue(s?this.applyStack(l,E,s):E[p],k);O.skip=isNaN(C)||isNaN(j)||A,O.stop=k>0&&Math.abs(E[h]-w[h])>g,y&&(O.parsed=E,O.raw=c.data[k]),d&&(O.options=f||this.resolveDataElementOptions(k,S.active?"active":r)),b||this.updateElement(S,k,O,r),w=E}}}},{key:"getMaxOverflow",value:function(){var e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;var a=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,a,i)/2}},{key:"draw",value:function(){var e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),Rd(Hd(n.prototype),"draw",this).call(this)}}]),n}(hh);Wd(Oh,"id","line"),Wd(Oh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Wd(Oh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var Eh=function(e){Ld(n,e);var t=Td(n);function n(e,r){var a;return qd(this,n),(a=t.call(this,e,r)).innerRadius=void 0,a.outerRadius=void 0,a}return Kd(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],a=af(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:a}}},{key:"parseObjectData",value:function(e,t,n,r){return ed.bind(this)(e,t,n,r)}},{key:"update",value:function(e){var t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}},{key:"getMinMax",value:function(){var e=this,t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((function(t,r){var a=e.getParsed(r).r;!isNaN(a)&&e.chart.getDataVisibility(r)&&(a<n.min&&(n.min=a),a>n.max&&(n.max=a))})),n}},{key:"_updateRadius",value:function(){var e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),a=Math.max(r/2,0),i=(a-Math.max(n.cutoutPercentage?a/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=a-i*this.index,this.innerRadius=this.outerRadius-i}},{key:"updateElements",value:function(e,t,n,r){var a,i="reset"===r,o=this.chart,l=o.options.animation,s=this._cachedMeta.rScale,c=s.xCenter,u=s.yCenter,f=s.getIndexAngle(0)-.5*du,d=f,h=360/this.countVisibleElements();for(a=0;a<t;++a)d+=this._computeAngle(a,r,h);for(a=t;a<t+n;a++){var p=e[a],v=d,m=d+this._computeAngle(a,r,h),y=o.getDataVisibility(a)?s.getDistanceFromCenterForValue(this.getParsed(a).r):0;d=m,i&&(l.animateScale&&(y=0),l.animateRotate&&(v=m=f));var g={x:c,y:u,innerRadius:0,outerRadius:y,startAngle:v,endAngle:m,options:this.resolveDataElementOptions(a,p.active?"active":r)};this.updateElement(p,a,g,r)}}},{key:"countVisibleElements",value:function(){var e=this,t=this._cachedMeta,n=0;return t.data.forEach((function(t,r){!isNaN(e.getParsed(r).r)&&e.chart.getDataVisibility(r)&&n++})),n}},{key:"_computeAngle",value:function(e,t,n){return this.chart.getDataVisibility(e)?Eu(this.resolveDataElementOptions(e,t).angle||n):0}}]),n}(hh);Wd(Eh,"id","polarArea"),Wd(Eh,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Wd(Eh,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(e){var t=e.data;if(t.labels.length&&t.datasets.length){var n=e.legend.options.labels,r=n.pointStyle,a=n.color;return t.labels.map((function(t,n){var i=e.getDatasetMeta(0).controller.getStyle(n);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:a,lineWidth:i.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(n),index:n}}))}return[]}},onClick:function(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var Ah=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n)}(Sh);Wd(Ah,"id","pie"),Wd(Ah,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var Ch=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}},{key:"parseObjectData",value:function(e,t,n,r){return ed.bind(this)(e,t,n,r)}},{key:"update",value:function(e){var t=this._cachedMeta,n=t.dataset,r=t.data||[],a=t.iScale.getLabels();if(n.points=r,"resize"!==e){var i=this.resolveDatasetElementOptions(e);this.options.showLine||(i.borderWidth=0);var o={_loop:!0,_fullLoop:a.length===r.length,options:i};this.updateElement(n,void 0,o,e)}this.updateElements(r,0,r.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var a=this._cachedMeta.rScale,i="reset"===r,o=t;o<t+n;o++){var l=e[o],s=this.resolveDataElementOptions(o,l.active?"active":r),c=a.getPointPositionForValue(o,this.getParsed(o).r),u=i?a.xCenter:c.x,f=i?a.yCenter:c.y,d={x:u,y:f,angle:c.angle,skip:isNaN(u)||isNaN(f),options:s};this.updateElement(l,o,d,r)}}}]),n}(hh);Wd(Ch,"id","radar"),Wd(Ch,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Wd(Ch,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});var jh=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart.data.labels||[],r=t.xScale,a=t.yScale,i=this.getParsed(e),o=r.getLabelForValue(i.x),l=a.getLabelForValue(i.y);return{label:n[e]||"",value:"("+o+", "+l+")"}}},{key:"update",value:function(e){var t=this._cachedMeta,n=t.data,r=void 0===n?[]:n,a=this.chart._animationsDisabled,i=Uu(t,r,a),o=i.start,l=i.count;if(this._drawStart=o,this._drawCount=l,Gu(t)&&(o=0,l=r.length),this.options.showLine){this.datasetElementType||this.addElements();var s=t.dataset,c=t._dataset;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!c._decimated,s.points=r;var u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:u},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(r,o,l,e)}},{key:"addElements",value:function(){var e=this.options.showLine;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),Rd(Hd(n.prototype),"addElements",this).call(this)}},{key:"updateElements",value:function(e,t,n,r){for(var a="reset"===r,i=this._cachedMeta,o=i.iScale,l=i.vScale,s=i._stacked,c=i._dataset,u=this.resolveDataElementOptions(t,r),f=this.getSharedOptions(u),d=this.includeOptions(r,f),h=o.axis,p=l.axis,v=this.options,m=v.spanGaps,y=v.segment,g=Su(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===r,x=t>0&&this.getParsed(t-1),_=t;_<t+n;++_){var w=e[_],k=this.getParsed(_),S=b?w:{},O=Bc(k[p]),E=S[h]=o.getPixelForValue(k[h],_),A=S[p]=a||O?l.getBasePixel():l.getPixelForValue(s?this.applyStack(l,k,s):k[p],_);S.skip=isNaN(E)||isNaN(A)||O,S.stop=_>0&&Math.abs(k[h]-x[h])>g,y&&(S.parsed=k,S.raw=c.data[_]),d&&(S.options=f||this.resolveDataElementOptions(_,w.active?"active":r)),b||this.updateElement(w,_,S,r),x=k}this.updateSharedOptions(f,r,u)}},{key:"getMaxOverflow",value:function(){var e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){for(var n=0,r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}var a=e.dataset,i=a.options&&a.options.borderWidth||0;if(!t.length)return i;var o=t[0].size(this.resolveDataElementOptions(0)),l=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(i,o,l)/2}}]),n}(hh);function Dh(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Wd(jh,"id","scatter"),Wd(jh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Wd(jh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Mh={_date:function(){function e(t){qd(this,e),Wd(this,"options",void 0),this.options=t||{}}return Kd(e,[{key:"init",value:function(){}},{key:"formats",value:function(){return Dh()}},{key:"parse",value:function(){return Dh()}},{key:"format",value:function(){return Dh()}},{key:"add",value:function(){return Dh()}},{key:"diff",value:function(){return Dh()}},{key:"startOf",value:function(){return Dh()}},{key:"endOf",value:function(){return Dh()}}],[{key:"override",value:function(t){Object.assign(e.prototype,t)}}]),e}()};function Ph(e,t,n,r){var a=e.controller,i=e.data,o=e._sorted,l=a._cachedMeta.iScale;if(l&&t===l.axis&&"r"!==t&&o&&i.length){var s=l._reversePixels?Fu:Tu;if(!r)return s(i,t,n);if(a._sharedOptions){var c=i[0],u="function"==typeof c.getRange&&c.getRange(t);if(u){var f=s(i,t,n-u),d=s(i,t,n+u);return{lo:f.lo,hi:d.hi}}}}return{lo:0,hi:i.length-1}}function Rh(e,t,n,r,a){for(var i=e.getSortedVisibleDatasetMetas(),o=n[t],l=0,s=i.length;l<s;++l)for(var c=i[l],u=c.index,f=c.data,d=Ph(i[l],t,o,a),h=d.lo,p=d.hi,v=h;v<=p;++v){var m=f[v];m.skip||r(m,u,v)}}function Ih(e,t,n,r,a){var i=[];return a||e.isPointInArea(t)?(Rh(e,n,t,(function(n,o,l){(a||xf(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&i.push({element:n,datasetIndex:o,index:l})}),!0),i):i}function Lh(e,t,n,r,a,i){return i||e.isPointInArea(t)?"r"!==n||r?function(e,t,n,r,a,i){var o=[],l=function(e){var t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){var a=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(i,2))}}(n),s=Number.POSITIVE_INFINITY;return Rh(e,n,t,(function(n,c,u){var f=n.inRange(t.x,t.y,a);if(!r||f){var d=n.getCenterPoint(a);if(i||e.isPointInArea(d)||f){var h=l(t,d);h<s?(o=[{element:n,datasetIndex:c,index:u}],s=h):h===s&&o.push({element:n,datasetIndex:c,index:u})}}})),o}(e,t,n,r,a,i):function(e,t,n,r){var a=[];return Rh(e,n,t,(function(e,n,i){var o=e.getProps(["startAngle","endAngle"],r),l=o.startAngle,s=o.endAngle;Ru(ju(e,{x:t.x,y:t.y}).angle,l,s)&&a.push({element:e,datasetIndex:n,index:i})})),a}(e,t,n,a):[]}function Nh(e,t,n,r,a){var i=[],o="x"===n?"inXRange":"inYRange",l=!1;return Rh(e,n,t,(function(e,r,s){e[o](t[n],a)&&(i.push({element:e,datasetIndex:r,index:s}),l=l||e.inRange(t.x,t.y,a))})),r&&!l?[]:i}var Th={evaluateInteractionItems:Rh,modes:{index:function(e,t,n,r){var a=pd(t,e),i=n.axis||"x",o=n.includeInvisible||!1,l=n.intersect?Ih(e,a,i,r,o):Lh(e,a,i,!1,r,o),s=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach((function(e){var t=l[0].index,n=e.data[t];n&&!n.skip&&s.push({element:n,datasetIndex:e.index,index:t})})),s):[]},dataset:function(e,t,n,r){var a=pd(t,e),i=n.axis||"xy",o=n.includeInvisible||!1,l=n.intersect?Ih(e,a,i,r,o):Lh(e,a,i,!1,r,o);if(l.length>0){var s=l[0].datasetIndex,c=e.getDatasetMeta(s).data;l=[];for(var u=0;u<c.length;++u)l.push({element:c[u],datasetIndex:s,index:u})}return l},point:function(e,t,n,r){return Ih(e,pd(t,e),n.axis||"xy",r,n.includeInvisible||!1)},nearest:function(e,t,n,r){var a=pd(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;return Lh(e,a,i,n.intersect,r,o)},x:function(e,t,n,r){return Nh(e,pd(t,e),"x",n.intersect,r)},y:function(e,t,n,r){return Nh(e,pd(t,e),"y",n.intersect,r)}}},Fh=["left","top","right","bottom"];function zh(e,t){return e.filter((function(e){return e.pos===t}))}function Hh(e,t){return e.filter((function(e){return-1===Fh.indexOf(e.pos)&&e.box.axis===t}))}function Vh(e,t){return e.sort((function(e,n){var r=t?n:e,a=t?e:n;return r.weight===a.weight?r.index-a.index:r.weight-a.weight}))}function Wh(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function $h(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Bh(e,t,n,r){var a=n.pos,i=n.box,o=e.maxPadding;if(!Uc(a)){n.size&&(e[a]-=n.size);var l=r[n.stack]||{size:0,count:1};l.size=Math.max(l.size,n.horizontal?i.height:i.width),n.size=l.size/l.count,e[a]+=n.size}i.getPadding&&$h(o,i.getPadding());var s=Math.max(0,t.outerWidth-Wh(o,e,"left","right")),c=Math.max(0,t.outerHeight-Wh(o,e,"top","bottom")),u=s!==e.w,f=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:u,other:f}:{same:f,other:u}}function Yh(e,t){var n=t.maxPadding;return function(e){var r={left:0,top:0,right:0,bottom:0};return e.forEach((function(e){r[e]=Math.max(t[e],n[e])})),r}(e?["left","right"]:["top","bottom"])}function Uh(e,t,n,r){var a,i,o,l,s,c,u=[];for(a=0,i=e.length,s=0;a<i;++a){(l=(o=e[a]).box).update(o.width||t.w,o.height||t.h,Yh(o.horizontal,t));var f=Bh(t,n,o,r),d=f.same,h=f.other;s|=d&&u.length,c=c||h,l.fullSize||u.push(o)}return s&&Uh(u,t,n,r)||c}function Gh(e,t,n,r,a){e.top=n,e.left=t,e.right=t+r,e.bottom=n+a,e.width=r,e.height=a}function qh(e,t,n,r){var a,i=n.padding,o=t.x,l=t.y,s=$d(e);try{for(s.s();!(a=s.n()).done;){var c=a.value,u=c.box,f=r[c.stack]||{count:1,placed:0,weight:1},d=c.stackWeight/f.weight||1;if(c.horizontal){var h=t.w*d,p=f.size||u.height;cu(f.start)&&(l=f.start),u.fullSize?Gh(u,i.left,l,n.outerWidth-i.right-i.left,p):Gh(u,t.left+f.placed,l,h,p),f.start=l,f.placed+=h,l=u.bottom}else{var v=t.h*d,m=f.size||u.width;cu(f.start)&&(o=f.start),u.fullSize?Gh(u,o,i.top,m,n.outerHeight-i.bottom-i.top):Gh(u,o,t.top+f.placed,m,v),f.start=o,f.placed+=v,o=u.right}}}catch(e){s.e(e)}finally{s.f()}t.x=o,t.y=l}var Zh=function(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(e){t.draw(e)}}]},e.boxes.push(t)},Kh=function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},Xh=function(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},Jh=function(e,t,n,r){if(e){var a=Nf(e.options.layout.padding),i=Math.max(t-a.width,0),o=Math.max(n-a.height,0),l=function(e){var t=function(e){var t,n,r,a,i,o,l=[];for(t=0,n=(e||[]).length;t<n;++t){var s=r=e[t];a=s.position;var c=s.options;i=c.stack;var u=c.stackWeight;o=void 0===u?1:u,l.push({index:t,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&a+i,stackWeight:o})}return l}(e),n=Vh(t.filter((function(e){return e.box.fullSize})),!0),r=Vh(zh(t,"left"),!0),a=Vh(zh(t,"right")),i=Vh(zh(t,"top"),!0),o=Vh(zh(t,"bottom")),l=Hh(t,"x"),s=Hh(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:a.concat(s).concat(o).concat(l),chartArea:zh(t,"chartArea"),vertical:r.concat(a).concat(s),horizontal:i.concat(o).concat(l)}}(e.boxes),s=l.vertical,c=l.horizontal;Jc(e.boxes,(function(e){"function"==typeof e.beforeLayout&&e.beforeLayout()}));var u=s.reduce((function(e,t){return t.box.options&&!1===t.box.options.display?e:e+1}),0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},a);$h(d,Nf(r));var h=Object.assign({maxPadding:d,w:i,h:o,x:a.left,y:a.top},a),p=function(e,t){var n,r,a,i=function(e){var t,n={},r=$d(e);try{for(r.s();!(t=r.n()).done;){var a=t.value,i=a.stack,o=a.pos,l=a.stackWeight;if(i&&Fh.includes(o)){var s=n[i]||(n[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=l}}}catch(e){r.e(e)}finally{r.f()}return n}(e),o=t.vBoxMaxWidth,l=t.hBoxMaxHeight;for(n=0,r=e.length;n<r;++n){var s=(a=e[n]).box.fullSize,c=i[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*o:s&&t.availableWidth,a.height=l):(a.width=o,a.height=u?u*l:s&&t.availableHeight)}return i}(s.concat(c),f);Uh(l.fullSize,h,f,p),Uh(s,h,f,p),Uh(c,h,f,p)&&Uh(s,h,f,p),function(e){var t=e.maxPadding;function n(n){var r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(h),qh(l.leftAndTop,h,f,p),h.x+=h.w,h.y+=h.h,qh(l.rightAndBottom,h,f,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Jc(l.chartArea,(function(t){var n=t.box;Object.assign(n,e.chartArea),n.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})}))}},Qh=function(){function e(){qd(this,e)}return Kd(e,[{key:"acquireContext",value:function(e,t){}},{key:"releaseContext",value:function(e){return!1}},{key:"addEventListener",value:function(e,t,n){}},{key:"removeEventListener",value:function(e,t,n){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getMaximumSize",value:function(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}},{key:"isAttached",value:function(e){return!0}},{key:"updateConfig",value:function(e){}}]),e}(),ep=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"acquireContext",value:function(e){return e&&e.getContext&&e.getContext("2d")||null}},{key:"updateConfig",value:function(e){e.options.animation=!1}}]),n}(Qh),tp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},np=function(e){return null===e||""===e},rp=!!yd&&{passive:!0};function ap(e,t,n){e.canvas.removeEventListener(t,n,rp)}function ip(e,t){var n,r=$d(e);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a===t||a.contains(t))return!0}}catch(e){r.e(e)}finally{r.f()}}function op(e,t,n){var r=e.canvas,a=new MutationObserver((function(e){var t,a=!1,i=$d(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;a=(a=a||ip(o.addedNodes,r))&&!ip(o.removedNodes,r)}}catch(e){i.e(e)}finally{i.f()}a&&n()}));return a.observe(document,{childList:!0,subtree:!0}),a}function lp(e,t,n){var r=e.canvas,a=new MutationObserver((function(e){var t,a=!1,i=$d(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;a=(a=a||ip(o.removedNodes,r))&&!ip(o.addedNodes,r)}}catch(e){i.e(e)}finally{i.f()}a&&n()}));return a.observe(document,{childList:!0,subtree:!0}),a}var sp=new Map,cp=0;function up(){var e=window.devicePixelRatio;e!==cp&&(cp=e,sp.forEach((function(t,n){n.currentDevicePixelRatio!==e&&t()})))}function fp(e,t,n){var r=e.canvas,a=r&&cd(r);if(a){var i=$u((function(e,t){var r=a.clientWidth;n(e,t),r<a.clientWidth&&n()}),window),o=new ResizeObserver((function(e){var t=e[0],n=t.contentRect.width,r=t.contentRect.height;0===n&&0===r||i(n,r)}));return o.observe(a),function(e,t){sp.size||window.addEventListener("resize",up),sp.set(e,t)}(e,i),o}}function dp(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){sp.delete(e),sp.size||window.removeEventListener("resize",up)}(e)}function hp(e,t,n){var r=e.canvas,a=$u((function(t){null!==e.ctx&&n(function(e,t){var n=tp[e.type]||e.type,r=pd(e,t),a=r.x,i=r.y;return{type:n,chart:t,native:e,x:void 0!==a?a:null,y:void 0!==i?i:null}}(t,e))}),e);return function(e,t,n){e.addEventListener(t,n,rp)}(r,t,a),a}var pp=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"acquireContext",value:function(e,t){var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){var n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e.$chartjs={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",np(a)){var i=gd(e,"width");void 0!==i&&(e.width=i)}if(np(r))if(""===e.style.height)e.height=e.width/(t||2);else{var o=gd(e,"height");void 0!==o&&(e.height=o)}}(e,t),n):null}},{key:"releaseContext",value:function(e){var t=e.canvas;if(!t.$chartjs)return!1;var n=t.$chartjs.initial;["height","width"].forEach((function(e){var r=n[e];Bc(r)?t.removeAttribute(e):t.setAttribute(e,r)}));var r=n.style||{};return Object.keys(r).forEach((function(e){t.style[e]=r[e]})),t.width=t.width,delete t.$chartjs,!0}},{key:"addEventListener",value:function(e,t,n){this.removeEventListener(e,t);var r=e.$proxies||(e.$proxies={}),a={attach:op,detach:lp,resize:fp}[t]||hp;r[t]=a(e,t,n)}},{key:"removeEventListener",value:function(e,t){var n=e.$proxies||(e.$proxies={}),r=n[t];r&&(({attach:dp,detach:dp,resize:dp}[t]||ap)(e,t,r),n[t]=void 0)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getMaximumSize",value:function(e,t,n,r){return function(e,t,n,r){var a=fd(e),i=hd(a,"margin"),o=ud(a.maxWidth,e,"clientWidth")||vu,l=ud(a.maxHeight,e,"clientHeight")||vu,s=function(e,t,n){var r,a;if(void 0===t||void 0===n){var i=cd(e);if(i){var o=i.getBoundingClientRect(),l=fd(i),s=hd(l,"border","width"),c=hd(l,"padding");t=o.width-c.width-s.width,n=o.height-c.height-s.height,r=ud(l.maxWidth,i,"clientWidth"),a=ud(l.maxHeight,i,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||vu,maxHeight:a||vu}}(e,t,n),c=s.width,u=s.height;if("content-box"===a.boxSizing){var f=hd(a,"border","width"),d=hd(a,"padding");c-=d.width+f.width,u-=d.height+f.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=vd(Math.min(c,o,s.maxWidth)),u=vd(Math.min(u,l,s.maxHeight)),c&&!u&&(u=vd(c/2)),(void 0!==t||void 0!==n)&&r&&s.height&&u>s.height&&(u=s.height,c=vd(Math.floor(u*r))),{width:c,height:u}}(e,t,n,r)}},{key:"isAttached",value:function(e){var t=cd(e);return!(!t||!t.isConnected)}}]),n}(Qh),vp=function(){function e(){qd(this,e),Wd(this,"x",void 0),Wd(this,"y",void 0),Wd(this,"active",!1),Wd(this,"options",void 0),Wd(this,"$animations",void 0)}return Kd(e,[{key:"tooltipPosition",value:function(e){var t=this.getProps(["x","y"],e);return{x:t.x,y:t.y}}},{key:"hasValue",value:function(){return Su(this.x)&&Su(this.y)}},{key:"getProps",value:function(e,t){var n=this,r=this.$animations;if(!t||!r)return this;var a={};return e.forEach((function(e){a[e]=r[e]&&r[e].active()?r[e]._to:n[e]})),a}}]),e}();function mp(e,t,n,r,a){var i,o,l,s=Zc(r,0),c=Math.min(Zc(a,e.length),e.length),u=0;for(n=Math.ceil(n),a&&(n=(i=a-r)/Math.floor(i/n)),l=s;l<0;)u++,l=Math.round(s+u*n);for(o=Math.max(s,0);o<c;o++)o===l&&(t.push(e[o]),u++,l=Math.round(s+u*n))}Wd(vp,"defaults",{}),Wd(vp,"defaultRoutes",void 0);var yp=function(e,t,n){return"top"===t||"left"===t?e[t]+n:e[t]-n},gp=function(e,t){return Math.min(t||e,e)};function bp(e,t){for(var n=[],r=e.length/t,a=e.length,i=0;i<a;i+=r)n.push(e[Math.floor(i)]);return n}function xp(e,t,n){var r,a=e.ticks.length,i=Math.min(t,a-1),o=e._startPixel,l=e._endPixel,s=1e-6,c=e.getPixelForTick(i);if(!(n&&(r=1===a?Math.max(c-o,l-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,(c+=i<t?r:-r)<o-s||c>l+s)))return c}function _p(e){return e.drawTicks?e.tickLength:0}function kp(e,t){if(!e.display)return 0;var n=Tf(e.font,t),r=Nf(e.padding);return(Yc(e.text)?e.text.length:1)*n.lineHeight+r.height}function Sp(e,t,n){var r=Bu(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=function(e){return"left"===e?"right":"right"===e?"left":e}(r)),r}var Op=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this)).id=e.id,r.type=e.type,r.options=void 0,r.ctx=e.ctx,r.chart=e.chart,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r._margins={left:0,right:0,top:0,bottom:0},r.maxWidth=void 0,r.maxHeight=void 0,r.paddingTop=void 0,r.paddingBottom=void 0,r.paddingLeft=void 0,r.paddingRight=void 0,r.axis=void 0,r.labelRotation=void 0,r.min=void 0,r.max=void 0,r._range=void 0,r.ticks=[],r._gridLineItems=null,r._labelItems=null,r._labelSizes=null,r._length=0,r._maxLength=0,r._longestTextCache={},r._startPixel=void 0,r._endPixel=void 0,r._reversePixels=!1,r._userMax=void 0,r._userMin=void 0,r._suggestedMax=void 0,r._suggestedMin=void 0,r._ticksLength=0,r._borderValue=0,r._cache={},r._dataLimitsCached=!1,r.$context=void 0,r}return Kd(n,[{key:"init",value:function(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}},{key:"parse",value:function(e,t){return e}},{key:"getUserBounds",value:function(){var e=this._userMin,t=this._userMax,n=this._suggestedMin,r=this._suggestedMax;return e=qc(e,Number.POSITIVE_INFINITY),t=qc(t,Number.NEGATIVE_INFINITY),n=qc(n,Number.POSITIVE_INFINITY),r=qc(r,Number.NEGATIVE_INFINITY),{min:qc(e,n),max:qc(t,r),minDefined:Gc(e),maxDefined:Gc(t)}}},{key:"getMinMax",value:function(e){var t,n=this.getUserBounds(),r=n.min,a=n.max,i=n.minDefined,o=n.maxDefined;if(i&&o)return{min:r,max:a};for(var l=this.getMatchingVisibleMetas(),s=0,c=l.length;s<c;++s)t=l[s].controller.getMinMax(this,e),i||(r=Math.min(r,t.min)),o||(a=Math.max(a,t.max));return{min:qc(r=o&&r>a?a:r,qc(a=i&&r>a?r:a,r)),max:qc(a,qc(r,a))}}},{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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}},{key:"getLabelItems",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chart.chartArea,t=this._labelItems||(this._labelItems=this._computeLabelItems(e));return t}},{key:"beforeLayout",value:function(){this._cache={},this._dataLimitsCached=!1}},{key:"beforeUpdate",value:function(){Xc(this.options.beforeUpdate,[this])}},{key:"update",value:function(e,t,n){var r=this.options,a=r.beginAtZero,i=r.grace,o=r.ticks,l=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,n){var r=e.min,a=e.max,i=Kc(t,(a-r)/2),o=function(e,t){return n&&0===e?0:e+t};return{min:o(r,-Math.abs(i)),max:o(a,i)}}(this,i,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();var s=l<this.ticks.length;this._convertTicksToLabels(s?bp(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(e,t){var n=e.options.ticks,r=function(e){var t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),a=e._maxLength/n;return Math.floor(Math.min(r,a))}(e),a=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?function(e){var t,n,r=[];for(t=0,n=e.length;t<n;t++)e[t].major&&r.push(t);return r}(t):[],o=i.length,l=i[0],s=i[o-1],c=[];if(o>a)return function(e,t,n,r){var a,i=0,o=n[0];for(r=Math.ceil(r),a=0;a<e.length;a++)a===o&&(t.push(e[a]),o=n[++i*r])}(t,c,i,o/a),c;var u=function(e,t,n){var r=function(e){var t,n,r=e.length;if(r<2)return!1;for(n=e[0],t=1;t<r;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),a=t.length/n;if(!r)return Math.max(a,1);for(var i=function(e){var t,n=[],r=Math.sqrt(e);for(t=1;t<r;t++)e%t==0&&(n.push(t),n.push(e/t));return r===(0|r)&&n.push(r),n.sort((function(e,t){return e-t})).pop(),n}(r),o=0,l=i.length-1;o<l;o++){var s=i[o];if(s>a)return s}return Math.max(a,1)}(i,t,a);if(o>0){var f,d,h=o>1?Math.round((s-l)/(o-1)):null;for(mp(t,c,u,Bc(h)?0:l-h,l),f=0,d=o-1;f<d;f++)mp(t,c,u,i[f],i[f+1]);return mp(t,c,u,s,Bc(h)?t.length:s+h),c}return mp(t,c,u),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}},{key:"configure",value:function(){var e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}},{key:"afterUpdate",value:function(){Xc(this.options.afterUpdate,[this])}},{key:"beforeSetDimensions",value:function(){Xc(this.options.beforeSetDimensions,[this])}},{key:"setDimensions",value:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}},{key:"afterSetDimensions",value:function(){Xc(this.options.afterSetDimensions,[this])}},{key:"_callHooks",value:function(e){this.chart.notifyPlugins(e,this.getContext()),Xc(this.options[e],[this])}},{key:"beforeDataLimits",value:function(){this._callHooks("beforeDataLimits")}},{key:"determineDataLimits",value:function(){}},{key:"afterDataLimits",value:function(){this._callHooks("afterDataLimits")}},{key:"beforeBuildTicks",value:function(){this._callHooks("beforeBuildTicks")}},{key:"buildTicks",value:function(){return[]}},{key:"afterBuildTicks",value:function(){this._callHooks("afterBuildTicks")}},{key:"beforeTickToLabelConversion",value:function(){Xc(this.options.beforeTickToLabelConversion,[this])}},{key:"generateTickLabels",value:function(e){var t,n,r,a=this.options.ticks;for(t=0,n=e.length;t<n;t++)(r=e[t]).label=Xc(a.callback,[r.value,t,e],this)}},{key:"afterTickToLabelConversion",value:function(){Xc(this.options.afterTickToLabelConversion,[this])}},{key:"beforeCalculateLabelRotation",value:function(){Xc(this.options.beforeCalculateLabelRotation,[this])}},{key:"calculateLabelRotation",value:function(){var e,t,n,r=this.options,a=r.ticks,i=gp(this.ticks.length,r.ticks.maxTicksLimit),o=a.minRotation||0,l=a.maxRotation,s=o;if(!this._isVisible()||!a.display||o>=l||i<=1||!this.isHorizontal())this.labelRotation=o;else{var c=this._getLabelSizes(),u=c.widest.width,f=c.highest.height,d=Iu(this.chart.width-u,0,this.maxWidth);u+6>(e=r.offset?this.maxWidth/i:d/(i-1))&&(e=d/(i-(r.offset?.5:1)),t=this.maxHeight-_p(r.grid)-a.padding-kp(r.title,this.chart.options.font),n=Math.sqrt(u*u+f*f),s=Au(Math.min(Math.asin(Iu((c.highest.height+6)/e,-1,1)),Math.asin(Iu(t/n,-1,1))-Math.asin(Iu(f/n,-1,1)))),s=Math.max(o,Math.min(l,s))),this.labelRotation=s}}},{key:"afterCalculateLabelRotation",value:function(){Xc(this.options.afterCalculateLabelRotation,[this])}},{key:"afterAutoSkip",value:function(){}},{key:"beforeFit",value:function(){Xc(this.options.beforeFit,[this])}},{key:"fit",value:function(){var e={width:0,height:0},t=this.chart,n=this.options,r=n.ticks,a=n.title,i=n.grid,o=this._isVisible(),l=this.isHorizontal();if(o){var s=kp(a,t.options.font);if(l?(e.width=this.maxWidth,e.height=_p(i)+s):(e.height=this.maxHeight,e.width=_p(i)+s),r.display&&this.ticks.length){var c=this._getLabelSizes(),u=c.first,f=c.last,d=c.widest,h=c.highest,p=2*r.padding,v=Eu(this.labelRotation),m=Math.cos(v),y=Math.sin(v);if(l){var g=r.mirror?0:y*d.width+m*h.height;e.height=Math.min(this.maxHeight,e.height+g+p)}else{var b=r.mirror?0:m*d.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+b+p)}this._calculatePadding(u,f,y,m)}}this._handleMargins(),l?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}},{key:"_calculatePadding",value:function(e,t,n,r){var a=this.options,i=a.ticks,o=i.align,l=i.padding,s=a.position,c=0!==this.labelRotation,u="top"!==s&&"x"===this.axis;if(this.isHorizontal()){var f=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),h=0,p=0;c?u?(h=r*e.width,p=n*t.height):(h=n*e.height,p=r*t.width):"start"===o?p=t.width:"end"===o?h=e.width:"inner"!==o&&(h=e.width/2,p=t.width/2),this.paddingLeft=Math.max((h-f+l)*this.width/(this.width-f),0),this.paddingRight=Math.max((p-d+l)*this.width/(this.width-d),0)}else{var v=t.height/2,m=e.height/2;"start"===o?(v=0,m=e.height):"end"===o&&(v=t.height,m=0),this.paddingTop=v+l,this.paddingBottom=m+l}}},{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(){Xc(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var e=this.options,t=e.axis,n=e.position;return"top"===n||"bottom"===n||"x"===t}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(e){var t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)Bc(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}},{key:"_getLabelSizes",value:function(){var e=this._labelSizes;if(!e){var t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=bp(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}},{key:"_computeLabelSizes",value:function(e,t,n){var r,a,i,o,l,s,c,u,f,d,h,p=this.ctx,v=this._longestTextCache,m=[],y=[],g=Math.floor(t/gp(t,n)),b=0,x=0;for(r=0;r<t;r+=g){if(o=e[r].label,l=this._resolveTickFontOptions(r),p.font=s=l.string,c=v[s]=v[s]||{data:{},gc:[]},u=l.lineHeight,f=d=0,Bc(o)||Yc(o)){if(Yc(o))for(a=0,i=o.length;a<i;++a)Bc(h=o[a])||Yc(h)||(f=pf(p,c.data,c.gc,f,h),d+=u)}else f=pf(p,c.data,c.gc,f,o),d=u;m.push(f),y.push(d),b=Math.max(f,b),x=Math.max(d,x)}!function(e,t){Jc(e,(function(e){var n,r=e.gc,a=r.length/2;if(a>t){for(n=0;n<a;++n)delete e.data[r[n]];r.splice(0,a)}}))}(v,t);var _=m.indexOf(b),w=y.indexOf(x),k=function(e){return{width:m[e]||0,height:y[e]||0}};return{first:k(0),last:k(t-1),widest:k(_),highest:k(w),widths:m,heights:y}}},{key:"getLabelForValue",value:function(e){return e}},{key:"getPixelForValue",value:function(e,t){return NaN}},{key:"getValueForPixel",value:function(e){}},{key:"getPixelForTick",value:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getPixelForDecimal",value:function(e){this._reversePixels&&(e=1-e);var t=this._startPixel+e*this._length;return Iu(this._alignToPixels?mf(this.chart,t,0):t,-32768,32767)}},{key:"getDecimalForPixel",value:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var e=this.min,t=this.max;return e<0&&t<0?t:e>0&&t>0?e:0}},{key:"getContext",value:function(e){var t=this.ticks||[];if(e>=0&&e<t.length){var n=t[e];return n.$context||(n.$context=function(e,t,n){return zf(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=zf(this.chart.getContext(),{scale:this,type:"scale"}))}},{key:"_tickSize",value:function(){var e=this.options.ticks,t=Eu(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),a=this._getLabelSizes(),i=e.autoSkipPadding||0,o=a?a.widest.width+i:0,l=a?a.highest.height+i:0;return this.isHorizontal()?l*n>o*r?o/n:l/r:l*r<o*n?l/n:o/r}},{key:"_isVisible",value:function(){var e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}},{key:"_computeGridLineItems",value:function(e){var t,n,r,a,i,o,l,s,c,u,f,d,h=this.axis,p=this.chart,v=this.options,m=v.grid,y=v.position,g=v.border,b=m.offset,x=this.isHorizontal(),_=this.ticks.length+(b?1:0),w=_p(m),k=[],S=g.setContext(this.getContext()),O=S.display?S.width:0,E=O/2,A=function(e){return mf(p,e,O)};if("top"===y)t=A(this.bottom),o=this.bottom-w,s=t-E,u=A(e.top)+E,d=e.bottom;else if("bottom"===y)t=A(this.top),u=e.top,d=A(e.bottom)-E,o=t+E,s=this.top+w;else if("left"===y)t=A(this.right),i=this.right-w,l=t-E,c=A(e.left)+E,f=e.right;else if("right"===y)t=A(this.left),c=e.left,f=A(e.right)-E,i=t+E,l=this.left+w;else if("x"===h){if("center"===y)t=A((e.top+e.bottom)/2+.5);else if(Uc(y)){var C=Object.keys(y)[0],j=y[C];t=A(this.chart.scales[C].getPixelForValue(j))}u=e.top,d=e.bottom,s=(o=t+E)+w}else if("y"===h){if("center"===y)t=A((e.left+e.right)/2);else if(Uc(y)){var D=Object.keys(y)[0],M=y[D];t=A(this.chart.scales[D].getPixelForValue(M))}l=(i=t-E)-w,c=e.left,f=e.right}var P=Zc(v.ticks.maxTicksLimit,_),R=Math.max(1,Math.ceil(_/P));for(n=0;n<_;n+=R){var I=this.getContext(n),L=m.setContext(I),N=g.setContext(I),T=L.lineWidth,F=L.color,z=N.dash||[],H=N.dashOffset,V=L.tickWidth,W=L.tickColor,$=L.tickBorderDash||[],B=L.tickBorderDashOffset;void 0!==(r=xp(this,n,b))&&(a=mf(p,r,T),x?i=l=c=f=a:o=s=u=d=a,k.push({tx1:i,ty1:o,tx2:l,ty2:s,x1:c,y1:u,x2:f,y2:d,width:T,color:F,borderDash:z,borderDashOffset:H,tickWidth:V,tickColor:W,tickBorderDash:$,tickBorderDashOffset:B}))}return this._ticksLength=_,this._borderValue=t,k}},{key:"_computeLabelItems",value:function(e){var t,n,r,a,i,o,l,s,c,u,f,d=this.axis,h=this.options,p=h.position,v=h.ticks,m=this.isHorizontal(),y=this.ticks,g=v.align,b=v.crossAlign,x=v.padding,_=v.mirror,w=_p(h.grid),k=w+x,S=_?-x:k,O=-Eu(this.labelRotation),E=[],A="middle";if("top"===p)i=this.bottom-S,o=this._getXAxisLabelAlignment();else if("bottom"===p)i=this.top+S,o=this._getXAxisLabelAlignment();else if("left"===p){var C=this._getYAxisLabelAlignment(w);o=C.textAlign,a=C.x}else if("right"===p){var j=this._getYAxisLabelAlignment(w);o=j.textAlign,a=j.x}else if("x"===d){if("center"===p)i=(e.top+e.bottom)/2+k;else if(Uc(p)){var D=Object.keys(p)[0],M=p[D];i=this.chart.scales[D].getPixelForValue(M)+k}o=this._getXAxisLabelAlignment()}else if("y"===d){if("center"===p)a=(e.left+e.right)/2-k;else if(Uc(p)){var P=Object.keys(p)[0],R=p[P];a=this.chart.scales[P].getPixelForValue(R)}o=this._getYAxisLabelAlignment(w).textAlign}"y"===d&&("start"===g?A="top":"end"===g&&(A="bottom"));var I=this._getLabelSizes();for(t=0,n=y.length;t<n;++t){r=y[t].label;var L=v.setContext(this.getContext(t));l=this.getPixelForTick(t)+v.labelOffset,c=(s=this._resolveTickFontOptions(t)).lineHeight;var N=(u=Yc(r)?r.length:1)/2,T=L.color,F=L.textStrokeColor,z=L.textStrokeWidth,H=o;m?(a=l,"inner"===o&&(H=t===n-1?this.options.reverse?"left":"right":0===t?this.options.reverse?"right":"left":"center"),f="top"===p?"near"===b||0!==O?-u*c+c/2:"center"===b?-I.highest.height/2-N*c+c:-I.highest.height+c/2:"near"===b||0!==O?c/2:"center"===b?I.highest.height/2-N*c:I.highest.height-u*c,_&&(f*=-1),0===O||L.showLabelBackdrop||(a+=c/2*Math.sin(O))):(i=l,f=(1-u)*c/2);var V=void 0;if(L.showLabelBackdrop){var W=Nf(L.backdropPadding),$=I.heights[t],B=I.widths[t],Y=f-W.top,U=0-W.left;switch(A){case"middle":Y-=$/2;break;case"bottom":Y-=$}switch(o){case"center":U-=B/2;break;case"right":U-=B}V={left:U,top:Y,width:B+W.width,height:$+W.height,color:L.backdropColor}}E.push({label:r,font:s,textOffset:f,options:{rotation:O,color:T,strokeColor:F,strokeWidth:z,textAlign:H,textBaseline:A,translation:[a,i],backdrop:V}})}return E}},{key:"_getXAxisLabelAlignment",value:function(){var e=this.options,t=e.position,n=e.ticks;if(-Eu(this.labelRotation))return"top"===t?"left":"right";var r="center";return"start"===n.align?r="left":"end"===n.align?r="right":"inner"===n.align&&(r="inner"),r}},{key:"_getYAxisLabelAlignment",value:function(e){var t,n,r=this.options,a=r.position,i=r.ticks,o=i.crossAlign,l=i.mirror,s=i.padding,c=e+s,u=this._getLabelSizes().widest.width;return"left"===a?l?(n=this.right+s,"near"===o?t="left":"center"===o?(t="center",n+=u/2):(t="right",n+=u)):(n=this.right-c,"near"===o?t="right":"center"===o?(t="center",n-=u/2):(t="left",n=this.left)):"right"===a?l?(n=this.left+s,"near"===o?t="right":"center"===o?(t="center",n-=u/2):(t="left",n-=u)):(n=this.left+c,"near"===o?t="left":"center"===o?(t="center",n+=u/2):(t="right",n=this.right)):t="right",{textAlign:t,x:n}}},{key:"_computeLabelArea",value:function(){if(!this.options.ticks.mirror){var e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}}},{key:"drawBackground",value:function(){var e=this.ctx,t=this.options.backgroundColor,n=this.left,r=this.top,a=this.width,i=this.height;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,a,i),e.restore())}},{key:"getLineWidthForValue",value:function(e){var t=this.options.grid;if(!this._isVisible()||!t.display)return 0;var n=this.ticks.findIndex((function(t){return t.value===e}));return n>=0?t.setContext(this.getContext(n)).lineWidth:0}},{key:"drawGrid",value:function(e){var t,n,r=this.options.grid,a=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),o=function(e,t,n){n.width&&n.color&&(a.save(),a.lineWidth=n.width,a.strokeStyle=n.color,a.setLineDash(n.borderDash||[]),a.lineDashOffset=n.borderDashOffset,a.beginPath(),a.moveTo(e.x,e.y),a.lineTo(t.x,t.y),a.stroke(),a.restore())};if(r.display)for(t=0,n=i.length;t<n;++t){var l=i[t];r.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),r.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}},{key:"drawBorder",value:function(){var e=this.chart,t=this.ctx,n=this.options,r=n.border,a=n.grid,i=r.setContext(this.getContext()),o=r.display?i.width:0;if(o){var l,s,c,u,f=a.setContext(this.getContext(0)).lineWidth,d=this._borderValue;this.isHorizontal()?(l=mf(e,this.left,o)-o/2,s=mf(e,this.right,f)+f/2,c=u=d):(c=mf(e,this.top,o)-o/2,u=mf(e,this.bottom,f)+f/2,l=s=d),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(l,c),t.lineTo(s,u),t.stroke(),t.restore()}}},{key:"drawLabels",value:function(e){if(this.options.ticks.display){var t=this.ctx,n=this._computeLabelArea();n&&_f(t,n);var r,a=$d(this.getLabelItems(e));try{for(a.s();!(r=a.n()).done;){var i=r.value,o=i.options,l=i.font;Cf(t,i.label,0,i.textOffset,l,o)}}catch(e){a.e(e)}finally{a.f()}n&&wf(t)}}},{key:"drawTitle",value:function(){var e=this.ctx,t=this.options,n=t.position,r=t.title,a=t.reverse;if(r.display){var i=Tf(r.font),o=Nf(r.padding),l=r.align,s=i.lineHeight/2;"bottom"===n||"center"===n||Uc(n)?(s+=o.bottom,Yc(r.text)&&(s+=i.lineHeight*(r.text.length-1))):s+=o.top;var c=function(e,t,n,r){var a,i,o,l=e.top,s=e.left,c=e.bottom,u=e.right,f=e.chart,d=f.chartArea,h=f.scales,p=0,v=c-l,m=u-s;if(e.isHorizontal()){if(i=Yu(r,s,u),Uc(n)){var y=Object.keys(n)[0],g=n[y];o=h[y].getPixelForValue(g)+v-t}else o="center"===n?(d.bottom+d.top)/2+v-t:yp(e,n,t);a=u-s}else{if(Uc(n)){var b=Object.keys(n)[0],x=n[b];i=h[b].getPixelForValue(x)-m+t}else i="center"===n?(d.left+d.right)/2-m+t:yp(e,n,t);o=Yu(r,c,l),p="left"===n?-yu:yu}return{titleX:i,titleY:o,maxWidth:a,rotation:p}}(this,s,n,l),u=c.titleX,f=c.titleY,d=c.maxWidth,h=c.rotation;Cf(e,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:Sp(l,n,a),textBaseline:"middle",translation:[u,f]})}}},{key:"draw",value:function(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}},{key:"_layers",value:function(){var e=this,t=this.options,r=t.ticks&&t.ticks.z||0,a=Zc(t.grid&&t.grid.z,-1),i=Zc(t.border&&t.border.z,0);return this._isVisible()&&this.draw===n.prototype.draw?[{z:a,draw:function(t){e.drawBackground(),e.drawGrid(t),e.drawTitle()}},{z:i,draw:function(){e.drawBorder()}},{z:r,draw:function(t){e.drawLabels(t)}}]:[{z:r,draw:function(t){e.draw(t)}}]}},{key:"getMatchingVisibleMetas",value:function(e){var t,n,r=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",i=[];for(t=0,n=r.length;t<n;++t){var o=r[t];o[a]!==this.id||e&&o.type!==e||i.push(o)}return i}},{key:"_resolveTickFontOptions",value:function(e){return Tf(this.options.ticks.setContext(this.getContext(e)).font)}},{key:"_maxDigits",value:function(){var e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}]),n}(vp),Ep=function(){function e(t,n,r){qd(this,e),this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}return Kd(e,[{key:"isForType",value:function(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}},{key:"register",value:function(e){var t,n=Object.getPrototypeOf(e);(function(e){return"id"in e&&"defaults"in e})(n)&&(t=this.register(n));var r=this.items,a=e.id,i=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+e);return a in r||(r[a]=e,function(e,t,n){var r=ru(Object.create(null),[n?hf.get(n):{},hf.get(t),e.defaults]);hf.set(t,r),e.defaultRoutes&&function(e,t){Object.keys(t).forEach((function(n){var r=n.split("."),a=r.pop(),i=[e].concat(r).join("."),o=t[n].split("."),l=o.pop(),s=o.join(".");hf.route(i,a,s,l)}))}(t,e.defaultRoutes),e.descriptors&&hf.describe(t,e.descriptors)}(e,i,t),this.override&&hf.override(e.id,e.overrides)),i}},{key:"get",value:function(e){return this.items[e]}},{key:"unregister",value:function(e){var t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in hf[r]&&(delete hf[r][n],this.override&&delete sf[n])}}]),e}(),Ap=function(){function e(){qd(this,e),this.controllers=new Ep(hh,"datasets",!0),this.elements=new Ep(vp,"elements"),this.plugins=new Ep(Object,"plugins"),this.scales=new Ep(Op,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}return Kd(e,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t)}},{key:"remove",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t)}},{key:"addControllers",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.controllers)}},{key:"addElements",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.elements)}},{key:"addPlugins",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.plugins)}},{key:"addScales",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("register",t,this.scales)}},{key:"getController",value:function(e){return this._get(e,this.controllers,"controller")}},{key:"getElement",value:function(e){return this._get(e,this.elements,"element")}},{key:"getPlugin",value:function(e){return this._get(e,this.plugins,"plugin")}},{key:"getScale",value:function(e){return this._get(e,this.scales,"scale")}},{key:"removeControllers",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.controllers)}},{key:"removeElements",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.elements)}},{key:"removePlugins",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.plugins)}},{key:"removeScales",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._each("unregister",t,this.scales)}},{key:"_each",value:function(e,t,n){var r=this;Yd(t).forEach((function(t){var a=n||r._getRegistryForType(t);n||a.isForType(t)||a===r.plugins&&t.id?r._exec(e,a,t):Jc(t,(function(t){var a=n||r._getRegistryForType(t);r._exec(e,a,t)}))}))}},{key:"_exec",value:function(e,t,n){var r=su(e);Xc(n["before"+r],[],n),t[e](n),Xc(n["after"+r],[],n)}},{key:"_getRegistryForType",value:function(e){for(var t=0;t<this._typedRegistries.length;t++){var n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}},{key:"_get",value:function(e,t,n){var r=t.get(e);if(void 0===r)throw new Error('"'+e+'" is not a registered '+n+".");return r}}]),e}(),Cp=new Ap,jp=function(){function e(){qd(this,e),this._init=[]}return Kd(e,[{key:"notify",value:function(e,t,n,r){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));var a=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(a,e,t,n);return"afterDestroy"===t&&(this._notify(a,e,"stop"),this._notify(this._init,e,"uninstall")),i}},{key:"_notify",value:function(e,t,n,r){r=r||{};var a,i=$d(e);try{for(i.s();!(a=i.n()).done;){var o=a.value,l=o.plugin;if(!1===Xc(l[n],[t,r,o.options],l)&&r.cancelable)return!1}}catch(e){i.e(e)}finally{i.f()}return!0}},{key:"invalidate",value:function(){Bc(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}},{key:"_descriptors",value:function(e){if(this._cache)return this._cache;var t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}},{key:"_createDescriptors",value:function(e,t){var n=e&&e.config,r=Zc(n.options&&n.options.plugins,{}),a=function(e){for(var t={},n=[],r=Object.keys(Cp.plugins.items),a=0;a<r.length;a++)n.push(Cp.getPlugin(r[a]));for(var i=e.plugins||[],o=0;o<i.length;o++){var l=i[o];-1===n.indexOf(l)&&(n.push(l),t[l.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==r||t?function(e,t,n,r){var a,i=t.plugins,o=t.localIds,l=[],s=e.getContext(),c=$d(i);try{for(c.s();!(a=c.n()).done;){var u=a.value,f=u.id,d=Dp(n[f],r);null!==d&&l.push({plugin:u,options:Mp(e.config,{plugin:u,local:o[f]},d,s)})}}catch(e){c.e(e)}finally{c.f()}return l}(e,a,r,t):[]}},{key:"_notifyStateChanges",value:function(e){var t=this._oldCache||[],n=this._cache,r=function(e,t){return e.filter((function(e){return!t.some((function(t){return e.plugin.id===t.plugin.id}))}))};this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}]),e}();function Dp(e,t){return t||!1!==e?!0===e?{}:e:null}function Mp(e,t,n,r){var a=t.plugin,i=t.local,o=e.pluginScopeKeys(a),l=e.getOptionScopes(n,o);return i&&a.defaults&&l.push(a.defaults),e.createResolver(l,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Pp(e,t){var n=hf.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Rp(e){if("x"===e||"y"===e||"r"===e)return e}function Ip(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function Lp(e){if(Rp(e))return e;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0,i=n;a<i.length;a++){var o=i[a],l=o.axis||Ip(o.position)||e.length>1&&Rp(e[0].toLowerCase());if(l)return l}throw new Error("Cannot determine type of '".concat(e,"' axis. Please provide 'axis' or 'position' option."))}function Np(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Tp(e){var t=e.options||(e.options={});t.plugins=Zc(t.plugins,{}),t.scales=function(e,t){var n=sf[e.type]||{scales:{}},r=t.scales||{},a=Pp(e.type,t),i=Object.create(null);return Object.keys(r).forEach((function(t){var o=r[t];if(!Uc(o))return console.error("Invalid scale configuration for scale: ".concat(t));if(o._proxy)return console.warn("Ignoring resolver passed as options for scale: ".concat(t));var l=Lp(t,o,function(e,t){if(t.data&&t.data.datasets){var n=t.data.datasets.filter((function(t){return t.xAxisID===e||t.yAxisID===e}));if(n.length)return Np(e,"x",n[0])||Np(e,"y",n[0])}return{}}(t,e),hf.scales[o.type]),s=function(e,t){return e===t?"_index_":"_value_"}(l,a),c=n.scales||{};i[t]=au(Object.create(null),[{axis:l},o,c[l],c[s]])})),e.data.datasets.forEach((function(n){var a=n.type||e.type,o=n.indexAxis||Pp(a,t),l=(sf[a]||{}).scales||{};Object.keys(l).forEach((function(e){var t=function(e,t){var n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,o),a=n[t+"AxisID"]||t;i[a]=i[a]||Object.create(null),au(i[a],[{axis:t},r[a],l[e]])}))})),Object.keys(i).forEach((function(e){var t=i[e];au(t,[hf.scales[t.type],hf.scale])})),i}(e,t)}function Fp(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}var zp=new Map,Hp=new Set;function Vp(e,t){var n=zp.get(e);return n||(n=t(),zp.set(e,n),Hp.add(n)),n}var Wp=function(e,t,n){var r=lu(t,n);void 0!==r&&e.add(r)},$p=function(){function e(t){qd(this,e),this._config=function(e){return(e=e||{}).data=Fp(e.data),Tp(e),e}(t),this._scopeCache=new Map,this._resolverCache=new Map}return Kd(e,[{key:"platform",get:function(){return this._config.platform}},{key:"type",get:function(){return this._config.type},set:function(e){this._config.type=e}},{key:"data",get:function(){return this._config.data},set:function(e){this._config.data=Fp(e)}},{key:"options",get:function(){return this._config.options},set:function(e){this._config.options=e}},{key:"plugins",get:function(){return this._config.plugins}},{key:"update",value:function(){var e=this._config;this.clearCache(),Tp(e)}},{key:"clearCache",value:function(){this._scopeCache.clear(),this._resolverCache.clear()}},{key:"datasetScopeKeys",value:function(e){return Vp(e,(function(){return[["datasets.".concat(e),""]]}))}},{key:"datasetAnimationScopeKeys",value:function(e,t){return Vp("".concat(e,".transition.").concat(t),(function(){return[["datasets.".concat(e,".transitions.").concat(t),"transitions.".concat(t)],["datasets.".concat(e),""]]}))}},{key:"datasetElementScopeKeys",value:function(e,t){return Vp("".concat(e,"-").concat(t),(function(){return[["datasets.".concat(e,".elements.").concat(t),"datasets.".concat(e),"elements.".concat(t),""]]}))}},{key:"pluginScopeKeys",value:function(e){var t=e.id,n=this.type;return Vp("".concat(n,"-plugin-").concat(t),(function(){return[["plugins.".concat(t)].concat(Yd(e.additionalOptionScopes||[]))]}))}},{key:"_cachedScopes",value:function(e,t){var n=this._scopeCache,r=n.get(e);return r&&!t||(r=new Map,n.set(e,r)),r}},{key:"getOptionScopes",value:function(e,t,n){var r=this.options,a=this.type,i=this._cachedScopes(e,n),o=i.get(t);if(o)return o;var l=new Set;t.forEach((function(t){e&&(l.add(e),t.forEach((function(t){return Wp(l,e,t)}))),t.forEach((function(e){return Wp(l,r,e)})),t.forEach((function(e){return Wp(l,sf[a]||{},e)})),t.forEach((function(e){return Wp(l,hf,e)})),t.forEach((function(e){return Wp(l,cf,e)}))}));var s=Array.from(l);return 0===s.length&&s.push(Object.create(null)),Hp.has(t)&&i.set(t,s),s}},{key:"chartOptionScopes",value:function(){var e=this.options,t=this.type;return[e,sf[t]||{},hf.datasets[t]||{},{type:t},hf,cf]}},{key:"resolveNamedOptions",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""],a={$shared:!0},i=Bp(this._resolverCache,e,r),o=i.resolver,l=i.subPrefixes,s=o;if(Up(o,t)){a.$shared=!1,n=uu(n)?n():n;var c=this.createResolver(e,n,l);s=Vf(o,n,c)}var u,f=$d(t);try{for(f.s();!(u=f.n()).done;){var d=u.value;a[d]=s[d]}}catch(e){f.e(e)}finally{f.f()}return a}},{key:"createResolver",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0,a=Bp(this._resolverCache,e,n),i=a.resolver;return Uc(t)?Vf(i,t,void 0,r):i}}]),e}();function Bp(e,t,n){var r=e.get(t);r||(r=new Map,e.set(t,r));var a=n.join(),i=r.get(a);return i||(i={resolver:Hf(t,n),subPrefixes:n.filter((function(e){return!e.toLowerCase().includes("hover")}))},r.set(a,i)),i}var Yp=function(e){return Uc(e)&&Object.getOwnPropertyNames(e).reduce((function(t,n){return t||uu(e[n])}),!1)};function Up(e,t){var n,r=Wf(e),a=r.isScriptable,i=r.isIndexable,o=$d(t);try{for(o.s();!(n=o.n()).done;){var l=n.value,s=a(l),c=i(l),u=(c||s)&&e[l];if(s&&(uu(u)||Yp(u))||c&&Yc(u))return!0}}catch(e){o.e(e)}finally{o.f()}return!1}var Gp=["top","bottom","left","right","chartArea"];function qp(e,t){return"top"===e||"bottom"===e||-1===Gp.indexOf(e)&&"x"===t}function Zp(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Kp(e){var t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Xc(n&&n.onComplete,[e],t)}function Xp(e){var t=e.chart,n=t.options.animation;Xc(n&&n.onProgress,[e],t)}function Jp(e){return sd()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Qp={},ev=function(e){var t=Jp(e);return Object.values(Qp).filter((function(e){return e.canvas===t})).pop()};function tv(e,t,n){for(var r=0,a=Object.keys(e);r<a.length;r++){var i=a[r],o=+i;if(o>=t){var l=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=l)}}}function nv(e,t,n){return e.options.clip?e[n]:t[n]}var rv=function(){function e(t,n){var r=this;qd(this,e);var a=this.config=new $p(n),i=Jp(t),o=ev(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");var l=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||function(e){return!sd()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?ep:pp}(i)),this.platform.updateConfig(a);var s,c,u,f=this.platform.acquireContext(i,l.aspectRatio),d=f&&f.canvas,h=d&&d.height,p=d&&d.width;this.id=$c(),this.ctx=f,this.canvas=d,this.width=p,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 jp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(s=function(e){return r.update(e)},c=l.resizeDelay||0,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c?(clearTimeout(u),u=setTimeout(s,c,t)):s.apply(this,t),c}),this._dataChanges=[],Qp[this.id]=this,f&&d?(Xd.listen(this,"complete",Kp),Xd.listen(this,"progress",Xp),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}return Kd(e,[{key:"aspectRatio",get:function(){var e=this.options,t=e.aspectRatio,n=e.maintainAspectRatio,r=this.width,a=this.height,i=this._aspectRatio;return Bc(t)?n&&i?i:a?r/a:null:t}},{key:"data",get:function(){return this.config.data},set:function(e){this.config.data=e}},{key:"options",get:function(){return this._options},set:function(e){this.config.options=e}},{key:"registry",get:function(){return Cp}},{key:"_initialize",value:function(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():md(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}},{key:"clear",value:function(){return yf(this.canvas,this.ctx),this}},{key:"stop",value:function(){return Xd.stop(this),this}},{key:"resize",value:function(e,t){Xd.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}},{key:"_resize",value:function(e,t){var n=this.options,r=this.canvas,a=n.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,t,a),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,md(this,o,!0)&&(this.notifyPlugins("resize",{size:i}),Xc(n.onResize,[this,i],this),this.attached&&this._doResize(l)&&this.render())}},{key:"ensureScalesHaveIDs",value:function(){Jc(this.options.scales||{},(function(e,t){e.id=t}))}},{key:"buildOrUpdateScales",value:function(){var e=this,t=this.options,n=t.scales,r=this.scales,a=Object.keys(r).reduce((function(e,t){return e[t]=!1,e}),{}),i=[];n&&(i=i.concat(Object.keys(n).map((function(e){var t=n[e],r=Lp(e,t),a="r"===r,i="x"===r;return{options:t,dposition:a?"chartArea":i?"bottom":"left",dtype:a?"radialLinear":i?"category":"linear"}})))),Jc(i,(function(n){var i=n.options,o=i.id,l=Lp(o,i),s=Zc(i.type,n.dtype);void 0!==i.position&&qp(i.position,l)===qp(n.dposition)||(i.position=n.dposition),a[o]=!0;var c=null;o in r&&r[o].type===s?c=r[o]:(c=new(Cp.getScale(s))({id:o,type:s,ctx:e.ctx,chart:e}),r[c.id]=c),c.init(i,t)})),Jc(a,(function(e,t){e||delete r[t]})),Jc(r,(function(t){Xh(0,t,t.options),Zh(e,t)}))}},{key:"_updateMetasets",value:function(){var e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((function(e,t){return e.index-t.index})),n>t){for(var r=t;r<n;++r)this._destroyDatasetMeta(r);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Zp("order","index"))}},{key:"_removeUnreferencedMetasets",value:function(){var e=this,t=this._metasets,n=this.data.datasets;t.length>n.length&&delete this._stacks,t.forEach((function(t,r){0===n.filter((function(e){return e===t._dataset})).length&&e._destroyDatasetMeta(r)}))}},{key:"buildOrUpdateControllers",value:function(){var e,t,n=[],r=this.data.datasets;for(this._removeUnreferencedMetasets(),e=0,t=r.length;e<t;e++){var a=r[e],i=this.getDatasetMeta(e),o=a.type||this.config.type;if(i.type&&i.type!==o&&(this._destroyDatasetMeta(e),i=this.getDatasetMeta(e)),i.type=o,i.indexAxis=a.indexAxis||Pp(o,this.options),i.order=a.order||0,i.index=e,i.label=""+a.label,i.visible=this.isDatasetVisible(e),i.controller)i.controller.updateIndex(e),i.controller.linkScales();else{var l=Cp.getController(o),s=hf.datasets[o],c=s.datasetElementType,u=s.dataElementType;Object.assign(l,{dataElementType:Cp.getElement(u),datasetElementType:c&&Cp.getElement(c)}),i.controller=new l(this,e),n.push(i.controller)}}return this._updateMetasets(),n}},{key:"_resetElements",value:function(){var e=this;Jc(this.data.datasets,(function(t,n){e.getDatasetMeta(n).controller.reset()}),this)}},{key:"reset",value:function(){this._resetElements(),this.notifyPlugins("reset")}},{key:"update",value:function(e){var t=this.config;t.update();var n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})){var a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");for(var i=0,o=0,l=this.data.datasets.length;o<l;o++){var s=this.getDatasetMeta(o).controller,c=!r&&-1===a.indexOf(s);s.buildOrUpdateElements(c),i=Math.max(+s.getMaxOverflow(),i)}i=this._minPadding=n.layout.autoPadding?i:0,this._updateLayout(i),r||Jc(a,(function(e){e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Zp("z","_idx"));var u=this._active,f=this._lastEvent;f?this._eventHandler(f,!0):u.length&&this._updateHoverStyles(u,u,!0),this.render()}}},{key:"_updateScales",value:function(){var e=this;Jc(this.scales,(function(t){Kh(e,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}},{key:"_checkEventBindings",value:function(){var e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);fu(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}},{key:"_updateHiddenIndices",value:function(){var e,t=this._hiddenIndices,n=$d(this._getUniformDataChanges()||[]);try{for(n.s();!(e=n.n()).done;){var r=e.value,a=r.method,i=r.start,o=r.count;tv(t,i,"_removeElements"===a?-o:o)}}catch(e){n.e(e)}finally{n.f()}}},{key:"_getUniformDataChanges",value:function(){var e=this._dataChanges;if(e&&e.length){this._dataChanges=[];for(var t=this.data.datasets.length,n=function(t){return new Set(e.filter((function(e){return e[0]===t})).map((function(e,t){return t+","+e.splice(1).join(",")})))},r=n(0),a=1;a<t;a++)if(!fu(r,n(a)))return;return Array.from(r).map((function(e){return e.split(",")})).map((function(e){return{method:e[1],start:+e[2],count:+e[3]}}))}}},{key:"_updateLayout",value:function(e){var t=this;if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){Jh(this,this.width,this.height,e);var n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Jc(this.boxes,(function(e){var n;r&&"chartArea"===e.position||(e.configure&&e.configure(),(n=t._layers).push.apply(n,Yd(e._layers())))}),this),this._layers.forEach((function(e,t){e._idx=t})),this.notifyPlugins("afterLayout")}}},{key:"_updateDatasets",value:function(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(var t=0,n=this.data.datasets.length;t<n;++t)this.getDatasetMeta(t).controller.configure();for(var r=0,a=this.data.datasets.length;r<a;++r)this._updateDataset(r,uu(e)?e({datasetIndex:r}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}},{key:"_updateDataset",value:function(e,t){var n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}},{key:"render",value:function(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Xd.has(this)?this.attached&&!Xd.running(this)&&Xd.start(this):(this.draw(),Kp({chart:this})))}},{key:"draw",value:function(){var e;if(this._resizeBeforeDraw){var t=this._resizeBeforeDraw,n=t.width,r=t.height;this._resize(n,r),this._resizeBeforeDraw=null}if(this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){var a=this._layers;for(e=0;e<a.length&&a[e].z<=0;++e)a[e].draw(this.chartArea);for(this._drawDatasets();e<a.length;++e)a[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}}},{key:"_getSortedDatasetMetas",value:function(e){var t,n,r=this._sortedMetasets,a=[];for(t=0,n=r.length;t<n;++t){var i=r[t];e&&!i.visible||a.push(i)}return a}},{key:"getSortedVisibleDatasetMetas",value:function(){return this._getSortedDatasetMetas(!0)}},{key:"_drawDatasets",value:function(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){for(var e=this.getSortedVisibleDatasetMetas(),t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(e){var t=this.ctx,n=e._clip,r=!n.disabled,a=function(e,t){var n=e.xScale,r=e.yScale;return n&&r?{left:nv(n,t,"left"),right:nv(n,t,"right"),top:nv(r,t,"top"),bottom:nv(r,t,"bottom")}:t}(e,this.chartArea),i={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(r&&_f(t,{left:!1===n.left?0:a.left-n.left,right:!1===n.right?this.width:a.right+n.right,top:!1===n.top?0:a.top-n.top,bottom:!1===n.bottom?this.height:a.bottom+n.bottom}),e.controller.draw(),r&&wf(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}},{key:"isPointInArea",value:function(e){return xf(e,this.chartArea,this._minPadding)}},{key:"getElementsAtEventForMode",value:function(e,t,n,r){var a=Th.modes[t];return"function"==typeof a?a(this,e,n,r):[]}},{key:"getDatasetMeta",value:function(e){var t=this.data.datasets[e],n=this._metasets,r=n.filter((function(e){return e&&e._dataset===t})).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}},{key:"getContext",value:function(){return this.$context||(this.$context=zf(null,{chart:this,type:"chart"}))}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(e){var t=this.data.datasets[e];if(!t)return!1;var n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}},{key:"setDatasetVisibility",value:function(e,t){this.getDatasetMeta(e).hidden=!t}},{key:"toggleDataVisibility",value:function(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}},{key:"getDataVisibility",value:function(e){return!this._hiddenIndices[e]}},{key:"_updateVisibility",value:function(e,t,n){var r=n?"show":"hide",a=this.getDatasetMeta(e),i=a.controller._resolveAnimations(void 0,r);cu(t)?(a.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),i.update(a,{visible:n}),this.update((function(t){return t.datasetIndex===e?r:void 0})))}},{key:"hide",value:function(e,t){this._updateVisibility(e,t,!1)}},{key:"show",value:function(e,t){this._updateVisibility(e,t,!0)}},{key:"_destroyDatasetMeta",value:function(e){var t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}},{key:"_stop",value:function(){var e,t;for(this.stop(),Xd.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}},{key:"destroy",value:function(){this.notifyPlugins("beforeDestroy");var e=this.canvas,t=this.ctx;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),yf(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Qp[this.id],this.notifyPlugins("afterDestroy")}},{key:"toBase64Image",value:function(){var e;return(e=this.canvas).toDataURL.apply(e,arguments)}},{key:"bindEvents",value:function(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}},{key:"bindUserEvents",value:function(){var e=this,t=this._listeners,n=this.platform,r=function(t,n,r){t.offsetX=n,t.offsetY=r,e._eventHandler(t)};Jc(this.options.events,(function(a){return function(r,a){n.addEventListener(e,r,a),t[r]=a}(a,r)}))}},{key:"bindResponsiveEvents",value:function(){var e=this;this._responsiveListeners||(this._responsiveListeners={});var t,n=this._responsiveListeners,r=this.platform,a=function(t,a){r.addEventListener(e,t,a),n[t]=a},i=function(t,a){n[t]&&(r.removeEventListener(e,t,a),delete n[t])},o=function(t,n){e.canvas&&e.resize(t,n)},l=function n(){i("attach",n),e.attached=!0,e.resize(),a("resize",o),a("detach",t)};t=function(){e.attached=!1,i("resize",o),e._stop(),e._resize(0,0),a("attach",l)},r.isAttached(this.canvas)?l():t()}},{key:"unbindEvents",value:function(){var e=this;Jc(this._listeners,(function(t,n){e.platform.removeEventListener(e,n,t)})),this._listeners={},Jc(this._responsiveListeners,(function(t,n){e.platform.removeEventListener(e,n,t)})),this._responsiveListeners=void 0}},{key:"updateHoverStyle",value:function(e,t,n){var r,a,i,o=n?"set":"remove";for("dataset"===t&&this.getDatasetMeta(e[0].datasetIndex).controller["_"+o+"DatasetHoverStyle"](),a=0,i=e.length;a<i;++a){var l=(r=e[a])&&this.getDatasetMeta(r.datasetIndex).controller;l&&l[o+"HoverStyle"](r.element,r.datasetIndex,r.index)}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(e){var t=this,n=this._active||[],r=e.map((function(e){var n=e.datasetIndex,r=e.index,a=t.getDatasetMeta(n);if(!a)throw new Error("No dataset found at index "+n);return{datasetIndex:n,element:a.data[r],index:r}}));!Qc(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}},{key:"notifyPlugins",value:function(e,t,n){return this._plugins.notify(this,e,t,n)}},{key:"isPluginEnabled",value:function(e){return 1===this._plugins._cache.filter((function(t){return t.plugin.id===e})).length}},{key:"_updateHoverStyles",value:function(e,t,n){var r=this.options.hover,a=function(e,t){return e.filter((function(e){return!t.some((function(t){return e.datasetIndex===t.datasetIndex&&e.index===t.index}))}))},i=a(t,e),o=n?e:a(e,t);i.length&&this.updateHoverStyle(i,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}},{key:"_eventHandler",value:function(e,t){var n=this,r={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},a=function(t){return(t.options.events||n.options.events).includes(e.native.type)};if(!1!==this.notifyPlugins("beforeEvent",r,a)){var i=this._handleEvent(e,t,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(i||r.changed)&&this.render(),this}}},{key:"_handleEvent",value:function(e,t,n){var r=this._active,a=void 0===r?[]:r,i=this.options,o=t,l=this._getActiveElements(e,a,n,o),s=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),c=function(e,t,n,r){return n&&"mouseout"!==e.type?r?t:e:null}(e,this._lastEvent,n,s);n&&(this._lastEvent=null,Xc(i.onHover,[e,l,this],this),s&&Xc(i.onClick,[e,l,this],this));var u=!Qc(l,a);return(u||t)&&(this._active=l,this._updateHoverStyles(l,a,t)),this._lastEvent=c,u}},{key:"_getActiveElements",value:function(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;var a=this.options.hover;return this.getElementsAtEventForMode(e,a.mode,a,r)}}],[{key:"register",value:function(){Cp.add.apply(Cp,arguments),av()}},{key:"unregister",value:function(){Cp.remove.apply(Cp,arguments),av()}}]),e}();function av(){return Jc(rv.instances,(function(e){return e._plugins.invalidate()}))}function iv(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function ov(e,t,n,r,a,i){var o=t.x,l=t.y,s=t.startAngle,c=t.pixelMargin,u=t.innerRadius,f=Math.max(t.outerRadius+r+n-c,0),d=u>0?u+r+n+c:0,h=0,p=a-s;if(r){var v=((u>0?u-r:0)+(f>0?f-r:0))/2;h=(p-(0!==v?p*v/(v+r):p))/2}var m=(p-Math.max(.001,p*f-n/du)/f)/2,y=s+m+h,g=a-m-h,b=function(e,t,n,r){var a=Rf(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),i=(n-t)/2,o=Math.min(i,r*t/2),l=function(e){var t=(n-Math.min(i,e))*r/2;return Iu(e,0,Math.min(i,t))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:Iu(a.innerStart,0,o),innerEnd:Iu(a.innerEnd,0,o)}}(t,d,f,g-y),x=b.outerStart,_=b.outerEnd,w=b.innerStart,k=b.innerEnd,S=f-x,O=f-_,E=y+x/S,A=g-_/O,C=d+w,j=d+k,D=y+w/C,M=g-k/j;if(e.beginPath(),i){var P=(E+A)/2;if(e.arc(o,l,f,E,P),e.arc(o,l,f,P,A),_>0){var R=iv(O,A,o,l);e.arc(R.x,R.y,_,A,g+yu)}var I=iv(j,g,o,l);if(e.lineTo(I.x,I.y),k>0){var L=iv(j,M,o,l);e.arc(L.x,L.y,k,g+yu,M+Math.PI)}var N=(g-k/d+(y+w/d))/2;if(e.arc(o,l,d,g-k/d,N,!0),e.arc(o,l,d,N,y+w/d,!0),w>0){var T=iv(C,D,o,l);e.arc(T.x,T.y,w,D+Math.PI,y-yu)}var F=iv(S,y,o,l);if(e.lineTo(F.x,F.y),x>0){var z=iv(S,E,o,l);e.arc(z.x,z.y,x,y-yu,E)}}else{e.moveTo(o,l);var H=Math.cos(E)*f+o,V=Math.sin(E)*f+l;e.lineTo(H,V);var W=Math.cos(A)*f+o,$=Math.sin(A)*f+l;e.lineTo(W,$)}e.closePath()}Wd(rv,"defaults",hf),Wd(rv,"instances",Qp),Wd(rv,"overrides",sf),Wd(rv,"registry",Cp),Wd(rv,"version","4.4.0"),Wd(rv,"getChart",ev);var lv=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),Wd(zd(r=t.call(this)),"circumference",void 0),Wd(zd(r),"endAngle",void 0),Wd(zd(r),"fullCircles",void 0),Wd(zd(r),"innerRadius",void 0),Wd(zd(r),"outerRadius",void 0),Wd(zd(r),"pixelMargin",void 0),Wd(zd(r),"startAngle",void 0),r.options=void 0,r.circumference=void 0,r.startAngle=void 0,r.endAngle=void 0,r.innerRadius=void 0,r.outerRadius=void 0,r.pixelMargin=0,r.fullCircles=0,e&&Object.assign(zd(r),e),r}return Kd(n,[{key:"inRange",value:function(e,t,n){var r=ju(this.getProps(["x","y"],n),{x:e,y:t}),a=r.angle,i=r.distance,o=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),l=o.startAngle,s=o.endAngle,c=o.innerRadius,u=o.outerRadius,f=o.circumference,d=(this.options.spacing+this.options.borderWidth)/2,h=Zc(f,s-l)>=hu||Ru(a,l,s),p=Lu(i,c+d,u+d);return h&&p}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),n=t.x,r=t.y,a=t.startAngle,i=t.endAngle,o=t.innerRadius,l=t.outerRadius,s=this.options,c=s.offset,u=(a+i)/2,f=(o+l+s.spacing+c)/2;return{x:n+Math.cos(u)*f,y:r+Math.sin(u)*f}}},{key:"tooltipPosition",value:function(e){return this.getCenterPoint(e)}},{key:"draw",value:function(e){var t=this.options,n=this.circumference,r=(t.offset||0)/4,a=(t.spacing||0)/2,i=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>hu?Math.floor(n/hu):0,!(0===n||this.innerRadius<0||this.outerRadius<0)){e.save();var o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);var l=r*(1-Math.sin(Math.min(du,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,r,a){var i=t.fullCircles,o=t.startAngle,l=t.circumference,s=t.endAngle;if(i){ov(e,t,n,r,s,a);for(var c=0;c<i;++c)e.fill();isNaN(l)||(s=o+(l%hu||hu))}ov(e,t,n,r,s,a),e.fill()}(e,this,l,a,i),function(e,t,n,r,a){var i=t.fullCircles,o=t.startAngle,l=t.circumference,s=t.options,c=s.borderWidth,u=s.borderJoinStyle,f=s.borderDash,d=s.borderDashOffset,h="inner"===s.borderAlign;if(c){e.setLineDash(f||[]),e.lineDashOffset=d,h?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");var p=t.endAngle;if(i){ov(e,t,n,r,p,a);for(var v=0;v<i;++v)e.stroke();isNaN(l)||(p=o+(l%hu||hu))}h&&function(e,t,n){var r=t.startAngle,a=t.pixelMargin,i=t.x,o=t.y,l=t.outerRadius,s=t.innerRadius,c=a/l;e.beginPath(),e.arc(i,o,l,r-c,n+c),s>a?(c=a/s,e.arc(i,o,s,n+c,r-c,!0)):e.arc(i,o,a,n+yu,r-yu),e.closePath(),e.clip()}(e,t,p),i||(ov(e,t,n,r,p,a),e.stroke())}}(e,this,l,a,i),e.restore()}}}]),n}(vp);function sv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;e.lineCap=Zc(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Zc(n.borderDash,t.borderDash)),e.lineDashOffset=Zc(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Zc(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Zc(n.borderWidth,t.borderWidth),e.strokeStyle=Zc(n.borderColor,t.borderColor)}function cv(e,t,n){e.lineTo(n.x,n.y)}function uv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.length,a=n.start,i=void 0===a?0:a,o=n.end,l=void 0===o?r-1:o,s=t.start,c=t.end,u=Math.max(i,s),f=Math.min(l,c),d=i<s&&l<s||i>c&&l>c;return{count:r,start:u,loop:t.loop,ilen:f<u&&!d?r+f-u:f-u}}function fv(e,t,n,r){var a,i,o,l=t.points,s=t.options,c=uv(l,n,r),u=c.count,f=c.start,d=c.loop,h=c.ilen,p=function(e){return e.stepped?kf:e.tension||"monotone"===e.cubicInterpolationMode?Sf:cv}(s),v=r||{},m=v.move,y=void 0===m||m,g=v.reverse;for(a=0;a<=h;++a)(i=l[(f+(g?h-a:a))%u]).skip||(y?(e.moveTo(i.x,i.y),y=!1):p(e,o,i,g,s.stepped),o=i);return d&&p(e,o,i=l[(f+(g?h:0))%u],g,s.stepped),!!d}function dv(e,t,n,r){var a,i,o,l,s,c,u=t.points,f=uv(u,n,r),d=f.count,h=f.start,p=f.ilen,v=r||{},m=v.move,y=void 0===m||m,g=v.reverse,b=0,x=0,_=function(e){return(h+(g?p-e:e))%d},w=function(){l!==s&&(e.lineTo(b,s),e.lineTo(b,l),e.lineTo(b,c))};for(y&&(i=u[_(0)],e.moveTo(i.x,i.y)),a=0;a<=p;++a)if(!(i=u[_(a)]).skip){var k=i.x,S=i.y,O=0|k;O===o?(S<l?l=S:S>s&&(s=S),b=(x*b+k)/++x):(w(),e.lineTo(k,S),o=O,x=0,l=s=S),c=S}w()}function hv(e){var t=e.options,n=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n?fv:dv}Wd(lv,"id","arc"),Wd(lv,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Wd(lv,"defaultRoutes",{backgroundColor:"backgroundColor"}),Wd(lv,"descriptors",{_scriptable:!0,_indexable:function(e){return"borderDash"!==e}});var pv="function"==typeof Path2D;var vv=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this)).animated=!0,r.options=void 0,r._chart=void 0,r._loop=void 0,r._fullLoop=void 0,r._path=void 0,r._points=void 0,r._segments=void 0,r._decimated=!1,r._pointsUpdated=!1,r._datasetIndex=void 0,e&&Object.assign(zd(r),e),r}return Kd(n,[{key:"updateControlPoints",value:function(e,t){var n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){var r=n.spanGaps?this._loop:this._fullLoop;(function(e,t,n,r,a){var i,o,l,s;if(t.spanGaps&&(e=e.filter((function(e){return!e.skip}))),"monotone"===t.cubicInterpolationMode)!function(e){var t,n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",i=rd(a),o=e.length,l=Array(o).fill(0),s=Array(o),c=nd(e,0);for(t=0;t<o;++t)if(n=r,r=c,c=nd(e,t+1),r){if(c){var u=c[a]-r[a];l[t]=0!==u?(c[i]-r[i])/u:0}s[t]=n?c?_u(l[t-1])!==_u(l[t])?0:(l[t-1]+l[t])/2:l[t-1]:l[t]}id(e,l,s),od(e,s,a)}(e,a);else{var c=r?e[e.length-1]:e[0];for(i=0,o=e.length;i<o;++i)s=ad(c,l=e[i],e[Math.min(i+1,o-(r?0:1))%o],t.tension),l.cp1x=s.previous.x,l.cp1y=s.previous.y,l.cp2x=s.next.x,l.cp2y=s.next.y,c=l}t.capBezierPoints&&function(e,t){var n,r,a,i,o,l=xf(e[0],t);for(n=0,r=e.length;n<r;++n)o=i,i=l,l=n<r-1&&xf(e[n+1],t),i&&(a=e[n],o&&(a.cp1x=ld(a.cp1x,t.left,t.right),a.cp1y=ld(a.cp1y,t.top,t.bottom)),l&&(a.cp2x=ld(a.cp2x,t.left,t.right),a.cp2y=ld(a.cp2y,t.top,t.bottom)))}(e,n)})(this._points,n,e,r,t),this._pointsUpdated=!0}}},{key:"points",get:function(){return this._points},set:function(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}},{key:"segments",get:function(){return this._segments||(this._segments=function(e,t){var n=e.points,r=e.options.spanGaps,a=n.length;if(!a)return[];var i=!!e._loop,o=function(e,t,n,r){var a=0,i=t-1;if(n&&!r)for(;a<t&&!e[a].skip;)a++;for(;a<t&&e[a].skip;)a++;for(a%=t,n&&(i+=a);i>a&&e[i%t].skip;)i--;return{start:a,end:i%=t}}(n,a,i,r),l=o.start,s=o.end;return function(e,t,n,r){return r&&r.setContext&&n?function(e,t,n,r){var a=e._chart.getContext(),i=jd(e.options),o=e._datasetIndex,l=e.options.spanGaps,s=n.length,c=[],u=i,f=t[0].start,d=f;function h(e,t,r,a){var i=l?-1:1;if(e!==t){for(e+=s;n[e%s].skip;)e-=i;for(;n[t%s].skip;)t+=i;e%s!=t%s&&(c.push({start:e%s,end:t%s,loop:r,style:a}),u=a,f=t%s)}}var p,v=Fc(t);try{for(v.s();!(p=v.n()).done;){var m=p.value;f=l?f:m.start;var y=n[f%s],g=void 0;for(d=f+1;d<=m.end;d++){var b=n[d%s];Dd(g=jd(r.setContext(zf(a,{type:"segment",p0:y,p1:b,p0DataIndex:(d-1)%s,p1DataIndex:d%s,datasetIndex:o}))),u)&&h(f,d-1,m.loop,u),y=b,u=g}f<d-1&&h(f,d-1,m.loop,u)}}catch(e){v.e(e)}finally{v.f()}return c}(e,t,n,r):t}(e,!0===r?[{start:l,end:s,loop:i}]:function(e,t,n,r){var a,i=e.length,o=[],l=t,s=e[t];for(a=t+1;a<=n;++a){var c=e[a%i];c.skip||c.stop?s.skip||(r=!1,o.push({start:t%i,end:(a-1)%i,loop:r}),t=l=c.stop?a:null):(l=a,s.skip&&(t=a)),s=c}return null!==l&&o.push({start:t%i,end:l%i,loop:r}),o}(n,l,s<l?s+a:s,!!e._fullLoop&&0===l&&s===a-1),n,t)}(this,this.options.segment))}},{key:"first",value:function(){var e=this.segments,t=this.points;return e.length&&t[e[0].start]}},{key:"last",value:function(){var e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}},{key:"interpolate",value:function(e,t){var n=this.options,r=e[t],a=this.points,i=Cd(this,{property:t,start:r,end:r});if(i.length){var o,l,s=[],c=function(e){return e.stepped?xd:e.tension||"monotone"===e.cubicInterpolationMode?_d:bd}(n);for(o=0,l=i.length;o<l;++o){var u=i[o],f=u.start,d=u.end,h=a[f],p=a[d];if(h!==p){var v=c(h,p,Math.abs((r-h[t])/(p[t]-h[t])),n.stepped);v[t]=e[t],s.push(v)}else s.push(h)}return 1===s.length?s[0]:s}}},{key:"pathSegment",value:function(e,t,n){return hv(this)(e,this,t,n)}},{key:"path",value:function(e,t,n){var r=this.segments,a=hv(this),i=this._loop;t=t||0,n=n||this.points.length-t;var o,l=$d(r);try{for(l.s();!(o=l.n()).done;)i&=a(e,this,o.value,{start:t,end:t+n-1})}catch(e){l.e(e)}finally{l.f()}return!!i}},{key:"draw",value:function(e,t,n,r){var a=this.options||{};(this.points||[]).length&&a.borderWidth&&(e.save(),function(e,t,n,r){pv&&!t.options.segment?function(e,t,n,r){var a=t._path;a||(a=t._path=new Path2D,t.path(a,n,r)&&a.closePath()),sv(e,t.options),e.stroke(a)}(e,t,n,r):function(e,t,n,r){var a,i=t.segments,o=t.options,l=hv(t),s=$d(i);try{for(s.s();!(a=s.n()).done;){var c=a.value;sv(e,o,c.style),e.beginPath(),l(e,t,c,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}}catch(e){s.e(e)}finally{s.f()}}(e,t,n,r)}(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}]),n}(vp);function mv(e,t,n,r){var a=e.options,i=e.getProps([n],r)[n];return Math.abs(t-i)<a.radius+a.hitRadius}Wd(vv,"id","line"),Wd(vv,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Wd(vv,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Wd(vv,"descriptors",{_scriptable:!0,_indexable:function(e){return"borderDash"!==e&&"fill"!==e}});var yv=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),Wd(zd(r=t.call(this)),"parsed",void 0),Wd(zd(r),"skip",void 0),Wd(zd(r),"stop",void 0),r.options=void 0,r.parsed=void 0,r.skip=void 0,r.stop=void 0,e&&Object.assign(zd(r),e),r}return Kd(n,[{key:"inRange",value:function(e,t,n){var r=this.options,a=this.getProps(["x","y"],n),i=a.x,o=a.y;return Math.pow(e-i,2)+Math.pow(t-o,2)<Math.pow(r.hitRadius+r.radius,2)}},{key:"inXRange",value:function(e,t){return mv(this,e,"x",t)}},{key:"inYRange",value:function(e,t){return mv(this,e,"y",t)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y"],e);return{x:t.x,y:t.y}}},{key:"size",value:function(e){var t=(e=e||this.options||{}).radius||0;return 2*((t=Math.max(t,t&&e.hoverRadius||0))+(t&&e.borderWidth||0))}},{key:"draw",value:function(e,t){var n=this.options;this.skip||n.radius<.1||!xf(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,gf(e,n,this.x,this.y))}},{key:"getRange",value:function(){var e=this.options||{};return e.radius+e.hitRadius}}]),n}(vp);function gv(e,t){var n,r,a,i,o,l=e.getProps(["x","y","base","width","height"],t),s=l.x,c=l.y,u=l.base,f=l.width,d=l.height;return e.horizontal?(o=d/2,n=Math.min(s,u),r=Math.max(s,u),a=c-o,i=c+o):(n=s-(o=f/2),r=s+o,a=Math.min(c,u),i=Math.max(c,u)),{left:n,top:a,right:r,bottom:i}}function bv(e,t,n,r){return e?0:Iu(t,n,r)}function xv(e,t,n,r){var a=null===t,i=null===n,o=e&&!(a&&i)&&gv(e,r);return o&&(a||Lu(t,o.left,o.right))&&(i||Lu(n,o.top,o.bottom))}function _v(e,t){e.rect(t.x,t.y,t.w,t.h)}function wv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.x!==n.x?-t:0,a=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-a;return{x:e.x+r,y:e.y+a,w:e.w+i,h:e.h+o,radius:e.radius}}Wd(yv,"id","point"),Wd(yv,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Wd(yv,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var kv=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this)).options=void 0,r.horizontal=void 0,r.base=void 0,r.width=void 0,r.height=void 0,r.inflateAmount=void 0,e&&Object.assign(zd(r),e),r}return Kd(n,[{key:"draw",value:function(e){var t,n,r,a,i,o,l=this.inflateAmount,s=this.options,c=s.borderColor,u=s.backgroundColor,f=(n=gv(t=this),r=n.right-n.left,a=n.bottom-n.top,i=function(e,t,n){var r=e.options.borderWidth,a=e.borderSkipped,i=If(r);return{t:bv(a.top,i.top,0,n),r:bv(a.right,i.right,0,t),b:bv(a.bottom,i.bottom,0,n),l:bv(a.left,i.left,0,t)}}(t,r/2,a/2),o=function(e,t,n){var r=e.getProps(["enableBorderRadius"]).enableBorderRadius,a=e.options.borderRadius,i=Lf(a),o=Math.min(t,n),l=e.borderSkipped,s=r||Uc(a);return{topLeft:bv(!s||l.top||l.left,i.topLeft,0,o),topRight:bv(!s||l.top||l.right,i.topRight,0,o),bottomLeft:bv(!s||l.bottom||l.left,i.bottomLeft,0,o),bottomRight:bv(!s||l.bottom||l.right,i.bottomRight,0,o)}}(t,r/2,a/2),{outer:{x:n.left,y:n.top,w:r,h:a,radius:o},inner:{x:n.left+i.l,y:n.top+i.t,w:r-i.l-i.r,h:a-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}),d=f.inner,h=f.outer,p=function(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}(h.radius)?jf:_v;e.save(),h.w===d.w&&h.h===d.h||(e.beginPath(),p(e,wv(h,l,d)),e.clip(),p(e,wv(d,-l,h)),e.fillStyle=c,e.fill("evenodd")),e.beginPath(),p(e,wv(d,l)),e.fillStyle=u,e.fill(),e.restore()}},{key:"inRange",value:function(e,t,n){return xv(this,e,t,n)}},{key:"inXRange",value:function(e,t){return xv(this,e,null,t)}},{key:"inYRange",value:function(e,t){return xv(this,null,e,t)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","base","horizontal"],e),n=t.x,r=t.y,a=t.base,i=t.horizontal;return{x:i?(n+a)/2:n,y:i?r:(r+a)/2}}},{key:"getRange",value:function(e){return"x"===e?this.width/2:this.height/2}}]),n}(vp);function Sv(e,t,n,r){if(!r){var a=t[e],i=n[e];return"angle"===e&&(a=Pu(a),i=Pu(i)),{property:e,start:a,end:i}}}function Ov(e,t,n){for(;t>e;t--){var r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Ev(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Av(e,t){var n=[],r=!1;return Yc(e)?(r=!0,n=e):n=function(e,t){var n=e||{},r=n.x,a=void 0===r?null:r,i=n.y,o=void 0===i?null:i,l=t.points,s=[];return t.segments.forEach((function(e){var t=e.start,n=e.end;n=Ov(t,n,l);var r=l[t],i=l[n];null!==o?(s.push({x:r.x,y:o}),s.push({x:i.x,y:o})):null!==a&&(s.push({x:a,y:r.y}),s.push({x:a,y:i.y}))})),s}(e,t),n.length?new vv({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Cv(e){return e&&!1!==e.fill}function jv(e,t,n){var r,a=e[t].fill,i=[t];if(!n)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!Gc(a))return a;if(!(r=e[a]))return!1;if(r.visible)return a;i.push(a),a=r.fill}return!1}function Dv(e,t,n){var r=function(e){var t=e.options,n=t.fill,r=Zc(n&&n.target,n);return void 0===r&&(r=!!t.backgroundColor),!1!==r&&null!==r&&(!0===r?"origin":r)}(e);if(Uc(r))return!isNaN(r.value)&&r;var a=parseFloat(r);return Gc(a)&&Math.floor(a)===a?function(e,t,n,r){return"-"!==e&&"+"!==e||(n=t+n),!(n===t||n<0||n>=r)&&n}(r[0],t,a,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Mv(e,t,n){for(var r=[],a=0;a<n.length;a++){var i=Pv(n[a],t,"x"),o=i.first,l=i.last,s=i.point;if(!(!s||o&&l))if(o)r.unshift(s);else if(e.push(s),!l)break}e.push.apply(e,r)}function Pv(e,t,n){var r=e.interpolate(t,n);if(!r)return{};for(var a=r[n],i=e.segments,o=e.points,l=!1,s=!1,c=0;c<i.length;c++){var u=i[c],f=o[u.start][n],d=o[u.end][n];if(Lu(a,f,d)){l=a===f,s=a===d;break}}return{first:l,last:s,point:r}}Wd(kv,"id","bar"),Wd(kv,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Wd(kv,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Rv=function(){function e(t){qd(this,e),this.x=t.x,this.y=t.y,this.radius=t.radius}return Kd(e,[{key:"pathSegment",value:function(e,t,n){var r=this.x,a=this.y,i=this.radius;return t=t||{start:0,end:hu},e.arc(r,a,i,t.end,t.start,!0),!n.bounds}},{key:"interpolate",value:function(e){var t=this.x,n=this.y,r=this.radius,a=e.angle;return{x:t+Math.cos(a)*r,y:n+Math.sin(a)*r,angle:a}}}]),e}();function Iv(e,t,n){var r=function(e){var t=e.chart,n=e.fill,r=e.line;if(Gc(n))return function(e,t){var n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}(t,n);if("stack"===n)return function(e){var t=e.scale,n=e.index,r=e.line,a=[],i=r.segments,o=r.points,l=function(e,t){for(var n=[],r=e.getMatchingVisibleMetas("line"),a=0;a<r.length;a++){var i=r[a];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}(t,n);l.push(Av({x:null,y:t.bottom},r));for(var s=0;s<i.length;s++)for(var c=i[s],u=c.start;u<=c.end;u++)Mv(a,o[u],l);return new vv({points:a,options:{}})}(e);if("shape"===n)return!0;var a=function(e){return(e.scale||{}).getPointPositionForValue?function(e){var t=e.scale,n=e.fill,r=t.options,a=t.getLabels().length,i=r.reverse?t.max:t.min,o=function(e,t,n){return"start"===e?n:"end"===e?t.options.reverse?t.min:t.max:Uc(e)?e.value:t.getBaseValue()}(n,t,i),l=[];if(r.grid.circular){var s=t.getPointPositionForValue(0,i);return new Rv({x:s.x,y:s.y,radius:t.getDistanceFromCenterForValue(o)})}for(var c=0;c<a;++c)l.push(t.getPointPositionForValue(c,o));return l}(e):function(e){var t=e.scale,n=void 0===t?{}:t,r=function(e,t){var n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:Uc(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(e.fill,n);if(Gc(r)){var a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}(e)}(e);return a instanceof Rv?a:Av(a,r)}(t),a=t.line,i=t.scale,o=t.axis,l=a.options,s=l.fill,c=l.backgroundColor,u=s||{},f=u.above,d=void 0===f?c:f,h=u.below,p=void 0===h?c:h;r&&a.points.length&&(_f(e,n),function(e,t){var n=t.line,r=t.target,a=t.above,i=t.below,o=t.area,l=t.scale,s=n._loop?"angle":t.axis;e.save(),"x"===s&&i!==a&&(Lv(e,r,o.top),Nv(e,{line:n,target:r,color:a,scale:l,property:s}),e.restore(),e.save(),Lv(e,r,o.bottom)),Nv(e,{line:n,target:r,color:i,scale:l,property:s}),e.restore()}(e,{line:a,target:r,above:d,below:p,area:n,scale:i,axis:o}),wf(e))}function Lv(e,t,n){var r=t.segments,a=t.points,i=!0,o=!1;e.beginPath();var l,s=$d(r);try{for(s.s();!(l=s.n()).done;){var c=l.value,u=c.start,f=c.end,d=a[u],h=a[Ov(u,f,a)];i?(e.moveTo(d.x,d.y),i=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),(o=!!t.pathSegment(e,c,{move:o}))?e.closePath():e.lineTo(h.x,n)}}catch(e){s.e(e)}finally{s.f()}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Nv(e,t){var n,r=t.line,a=t.target,i=t.property,o=t.color,l=t.scale,s=function(e,t,n){var r,a=e.segments,i=e.points,o=t.points,l=[],s=$d(a);try{for(s.s();!(r=s.n()).done;){var c=r.value,u=c.start,f=c.end;f=Ov(u,f,i);var d=Sv(n,i[u],i[f],c.loop);if(t.segments){var h,p=$d(Cd(t,d));try{for(p.s();!(h=p.n()).done;){var v,m=h.value,y=Sv(n,o[m.start],o[m.end],m.loop),g=$d(Ad(c,i,y));try{for(g.s();!(v=g.n()).done;){var b=v.value;l.push({source:b,target:m,start:Wd({},n,Ev(d,y,"start",Math.max)),end:Wd({},n,Ev(d,y,"end",Math.min))})}}catch(e){g.e(e)}finally{g.f()}}}catch(e){p.e(e)}finally{p.f()}}else l.push({source:c,target:d,start:i[u],end:i[f]})}}catch(e){s.e(e)}finally{s.f()}return l}(r,a,i),c=$d(s);try{for(c.s();!(n=c.n()).done;){var u=n.value,f=u.source,d=u.target,h=u.start,p=u.end,v=f.style,m=(v=void 0===v?{}:v).backgroundColor,y=void 0===m?o:m,g=!0!==a;e.save(),e.fillStyle=y,Tv(e,l,g&&Sv(i,h,p)),e.beginPath();var b=!!r.pathSegment(e,f),x=void 0;if(g){b?e.closePath():Fv(e,a,p,i);var _=!!a.pathSegment(e,d,{move:b,reverse:!0});(x=b&&_)||Fv(e,a,h,i)}e.closePath(),e.fill(x?"evenodd":"nonzero"),e.restore()}}catch(e){c.e(e)}finally{c.f()}}function Tv(e,t,n){var r=t.chart.chartArea,a=r.top,i=r.bottom,o=n||{},l=o.property,s=o.start,c=o.end;"x"===l&&(e.beginPath(),e.rect(s,a,c-s,i-a),e.clip())}function Fv(e,t,n,r){var a=t.interpolate(n,r);a&&e.lineTo(a.x,a.y)}var zv={id:"filler",afterDatasetsUpdate:function(e,t,n){var r,a,i,o,l=(e.data.datasets||[]).length,s=[];for(a=0;a<l;++a)o=null,(i=(r=e.getDatasetMeta(a)).dataset)&&i.options&&i instanceof vv&&(o={visible:e.isDatasetVisible(a),index:a,fill:Dv(i,a,l),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:i}),r.$filler=o,s.push(o);for(a=0;a<l;++a)(o=s[a])&&!1!==o.fill&&(o.fill=jv(s,a,n.propagate))},beforeDraw:function(e,t,n){for(var r="beforeDraw"===n.drawTime,a=e.getSortedVisibleDatasetMetas(),i=e.chartArea,o=a.length-1;o>=0;--o){var l=a[o].$filler;l&&(l.line.updateControlPoints(i,l.axis),r&&l.fill&&Iv(e.ctx,l,i))}},beforeDatasetsDraw:function(e,t,n){if("beforeDatasetsDraw"===n.drawTime)for(var r=e.getSortedVisibleDatasetMetas(),a=r.length-1;a>=0;--a){var i=r[a].$filler;Cv(i)&&Iv(e.ctx,i,e.chartArea)}},beforeDatasetDraw:function(e,t,n){var r=t.meta.$filler;Cv(r)&&"beforeDatasetDraw"===n.drawTime&&Iv(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Hv=function(e,t){var n=e.boxHeight,r=void 0===n?t:n,a=e.boxWidth,i=void 0===a?t:a;return e.usePointStyle&&(r=Math.min(r,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:r,itemHeight:Math.max(t,r)}},Vv=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this))._added=!1,r.legendHitBoxes=[],r._hoveredItem=null,r.doughnutMode=!1,r.chart=e.chart,r.options=e.options,r.ctx=e.ctx,r.legendItems=void 0,r.columnSizes=void 0,r.lineWidths=void 0,r.maxHeight=void 0,r.maxWidth=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.height=void 0,r.width=void 0,r._margins=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return Kd(n,[{key:"update",value:function(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,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 e=this,t=this.options.labels||{},n=Xc(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter((function(n){return t.filter(n,e.chart.data)}))),t.sort&&(n=n.sort((function(n,r){return t.sort(n,r,e.chart.data)}))),this.options.reverse&&n.reverse(),this.legendItems=n}},{key:"fit",value:function(){var e=this.options,t=this.ctx;if(e.display){var n,r,a=e.labels,i=Tf(a.font),o=i.size,l=this._computeTitleHeight(),s=Hv(a,o),c=s.boxWidth,u=s.itemHeight;t.font=i.string,this.isHorizontal()?(n=this.maxWidth,r=this._fitRows(l,o,c,u)+10):(r=this.maxHeight,n=this._fitCols(l,i,c,u)+10),this.width=Math.min(n,e.maxWidth||this.maxWidth),this.height=Math.min(r,e.maxHeight||this.maxHeight)}else this.width=this.height=0}},{key:"_fitRows",value:function(e,t,n,r){var a=this.ctx,i=this.maxWidth,o=this.options.labels.padding,l=this.legendHitBoxes=[],s=this.lineWidths=[0],c=r+o,u=e;a.textAlign="left",a.textBaseline="middle";var f=-1,d=-c;return this.legendItems.forEach((function(e,h){var p=n+t/2+a.measureText(e.text).width;(0===h||s[s.length-1]+p+2*o>i)&&(u+=c,s[s.length-(h>0?0:1)]=0,d+=c,f++),l[h]={left:0,top:d,row:f,width:p,height:r},s[s.length-1]+=p+o})),u}},{key:"_fitCols",value:function(e,t,n,r){var a=this.ctx,i=this.maxHeight,o=this.options.labels.padding,l=this.legendHitBoxes=[],s=this.columnSizes=[],c=i-e,u=o,f=0,d=0,h=0,p=0;return this.legendItems.forEach((function(e,i){var v=function(e,t,n,r,a){var i=function(e,t,n,r){var a=e.text;return a&&"string"!=typeof a&&(a=a.reduce((function(e,t){return e.length>t.length?e:t}))),t+n.size/2+r.measureText(a).width}(r,e,t,n),o=function(e,t,n){var r=e;return"string"!=typeof t.text&&(r=Wv(t,n)),r}(a,r,t.lineHeight);return{itemWidth:i,itemHeight:o}}(n,t,a,e,r),m=v.itemWidth,y=v.itemHeight;i>0&&d+y+2*o>c&&(u+=f+o,s.push({width:f,height:d}),h+=f+o,p++,f=d=0),l[i]={left:h,top:d,col:p,width:m,height:y},f=Math.max(f,m),d+=y+o})),u+=f,s.push({width:f,height:d}),u}},{key:"adjustHitBoxes",value:function(){if(this.options.display){var e=this._computeTitleHeight(),t=this.legendHitBoxes,n=this.options,r=n.align,a=n.labels.padding,i=wd(n.rtl,this.left,this.width);if(this.isHorizontal()){var o,l=0,s=Yu(r,this.left+a,this.right-this.lineWidths[l]),c=$d(t);try{for(c.s();!(o=c.n()).done;){var u=o.value;l!==u.row&&(l=u.row,s=Yu(r,this.left+a,this.right-this.lineWidths[l])),u.top+=this.top+e+a,u.left=i.leftForLtr(i.x(s),u.width),s+=u.width+a}}catch(e){c.e(e)}finally{c.f()}}else{var f,d=0,h=Yu(r,this.top+e+a,this.bottom-this.columnSizes[d].height),p=$d(t);try{for(p.s();!(f=p.n()).done;){var v=f.value;v.col!==d&&(d=v.col,h=Yu(r,this.top+e+a,this.bottom-this.columnSizes[d].height)),v.top=h,v.left+=this.left+a,v.left=i.leftForLtr(i.x(v.left),v.width),h+=v.height+a}}catch(e){p.e(e)}finally{p.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){if(this.options.display){var e=this.ctx;_f(e,this),this._draw(),wf(e)}}},{key:"_draw",value:function(){var e,t=this,n=this.options,r=this.columnSizes,a=this.lineWidths,i=this.ctx,o=n.align,l=n.labels,s=hf.color,c=wd(n.rtl,this.left,this.width),u=Tf(l.font),f=l.padding,d=u.size,h=d/2;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;var p=Hv(l,d),v=p.boxWidth,m=p.boxHeight,y=p.itemHeight,g=this.isHorizontal(),b=this._computeTitleHeight();e=g?{x:Yu(o,this.left+f,this.right-a[0]),y:this.top+f+b,line:0}:{x:this.left+f,y:Yu(o,this.top+b+f,this.bottom-r[0].height),line:0},kd(this.ctx,n.textDirection);var x=y+f;this.legendItems.forEach((function(p,_){i.strokeStyle=p.fontColor,i.fillStyle=p.fontColor;var w=i.measureText(p.text).width,k=c.textAlign(p.textAlign||(p.textAlign=l.textAlign)),S=v+h+w,O=e.x,E=e.y;if(c.setWidth(t.width),g?_>0&&O+S+f>t.right&&(E=e.y+=x,e.line++,O=e.x=Yu(o,t.left+f,t.right-a[e.line])):_>0&&E+x>t.bottom&&(O=e.x=O+r[e.line].width+f,e.line++,E=e.y=Yu(o,t.top+b+f,t.bottom-r[e.line].height)),function(e,t,n){if(!(isNaN(v)||v<=0||isNaN(m)||m<0)){i.save();var r=Zc(n.lineWidth,1);if(i.fillStyle=Zc(n.fillStyle,s),i.lineCap=Zc(n.lineCap,"butt"),i.lineDashOffset=Zc(n.lineDashOffset,0),i.lineJoin=Zc(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=Zc(n.strokeStyle,s),i.setLineDash(Zc(n.lineDash,[])),l.usePointStyle){var a={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},o=c.xPlus(e,v/2);bf(i,a,o,t+h,l.pointStyleWidth&&v)}else{var u=t+Math.max((d-m)/2,0),f=c.leftForLtr(e,v),p=Lf(n.borderRadius);i.beginPath(),Object.values(p).some((function(e){return 0!==e}))?jf(i,{x:f,y:u,w:v,h:m,radius:p}):i.rect(f,u,v,m),i.fill(),0!==r&&i.stroke()}i.restore()}}(c.x(O),E,p),O=function(e,t,n,r){return e===(r?"left":"right")?n:"center"===e?(t+n)/2:t}(k,O+v+h,g?O+S:t.right,n.rtl),function(e,t,n){Cf(i,n.text,e,t+y/2,u,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})}(c.x(O),E,p),g)e.x+=S+f;else if("string"!=typeof p.text){var A=u.lineHeight;e.y+=Wv(p,A)+f}else e.y+=x})),Sd(this.ctx,n.textDirection)}},{key:"drawTitle",value:function(){var e=this.options,t=e.title,n=Tf(t.font),r=Nf(t.padding);if(t.display){var a,i=wd(e.rtl,this.left,this.width),o=this.ctx,l=t.position,s=n.size/2,c=r.top+s,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max.apply(Math,Yd(this.lineWidths)),a=this.top+c,u=Yu(e.align,u,this.right-f);else{var d=this.columnSizes.reduce((function(e,t){return Math.max(e,t.height)}),0);a=c+Yu(e.align,this.top,this.bottom-d-e.labels.padding-this._computeTitleHeight())}var h=Yu(l,u,u+f);o.textAlign=i.textAlign(Bu(l)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=n.string,Cf(o,t.text,h,a,n)}}},{key:"_computeTitleHeight",value:function(){var e=this.options.title,t=Tf(e.font),n=Nf(e.padding);return e.display?t.lineHeight+n.height:0}},{key:"_getLegendItemAt",value:function(e,t){var n,r,a;if(Lu(e,this.left,this.right)&&Lu(t,this.top,this.bottom))for(a=this.legendHitBoxes,n=0;n<a.length;++n)if(Lu(e,(r=a[n]).left,r.left+r.width)&&Lu(t,r.top,r.top+r.height))return this.legendItems[n];return null}},{key:"handleEvent",value:function(e){var t=this.options;if(function(e,t){return!("mousemove"!==e&&"mouseout"!==e||!t.onHover&&!t.onLeave)||!(!t.onClick||"click"!==e&&"mouseup"!==e)}(e.type,t)){var n,r,a=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){var i=this._hoveredItem,o=(r=a,null!==(n=i)&&null!==r&&n.datasetIndex===r.datasetIndex&&n.index===r.index);i&&!o&&Xc(t.onLeave,[e,i,this],this),this._hoveredItem=a,a&&!o&&Xc(t.onHover,[e,a,this],this)}else a&&Xc(t.onClick,[e,a,this],this)}}}]),n}(vp);function Wv(e,t){return t*(e.text?e.text.length:0)}var $v={id:"legend",_element:Vv,start:function(e,t,n){var r=e.legend=new Vv({ctx:e.ctx,options:n,chart:e});Xh(0,r,n),Zh(e,r)},stop:function(e){Kh(e,e.legend),delete e.legend},beforeUpdate:function(e,t,n){var r=e.legend;Xh(0,r,n),r.options=n},afterUpdate:function(e){var t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent:function(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick:function(e,t,n){var r=t.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),t.hidden=!0):(a.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:function(e){return e.chart.options.color},boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.legend.options.labels,r=n.usePointStyle,a=n.pointStyle,i=n.textAlign,o=n.color,l=n.useBorderRadius,s=n.borderRadius;return e._getSortedDatasetMetas().map((function(e){var n=e.controller.getStyle(r?0:void 0),c=Nf(n.borderWidth);return{text:t[e.index].label,fillStyle:n.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:n.borderCapStyle,lineDash:n.borderDash,lineDashOffset:n.borderDashOffset,lineJoin:n.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:n.borderColor,pointStyle:a||n.pointStyle,rotation:n.rotation,textAlign:i||n.textAlign,borderRadius:l&&(s||n.borderRadius),datasetIndex:e.index}}),this)}},title:{color:function(e){return e.chart.options.color},display:!1,position:"center",text:""}},descriptors:{_scriptable:function(e){return!e.startsWith("on")},labels:{_scriptable:function(e){return!["generateLabels","filter","sort"].includes(e)}}}},Bv=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this)).chart=e.chart,r.options=e.options,r.ctx=e.ctx,r._padding=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return Kd(n,[{key:"update",value:function(e,t){var n=this.options;if(this.left=0,this.top=0,n.display){this.width=this.right=e,this.height=this.bottom=t;var r=Yc(n.text)?n.text.length:1;this._padding=Nf(n.padding);var a=r*Tf(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}else this.width=this.height=this.right=this.bottom=0}},{key:"isHorizontal",value:function(){var e=this.options.position;return"top"===e||"bottom"===e}},{key:"_drawArgs",value:function(e){var t,n,r,a=this.top,i=this.left,o=this.bottom,l=this.right,s=this.options,c=s.align,u=0;return this.isHorizontal()?(n=Yu(c,i,l),r=a+e,t=l-i):("left"===s.position?(n=i+e,r=Yu(c,o,a),u=-.5*du):(n=l-e,r=Yu(c,a,o),u=.5*du),t=o-a),{titleX:n,titleY:r,maxWidth:t,rotation:u}}},{key:"draw",value:function(){var e=this.ctx,t=this.options;if(t.display){var n=Tf(t.font),r=n.lineHeight/2+this._padding.top,a=this._drawArgs(r),i=a.titleX,o=a.titleY,l=a.maxWidth,s=a.rotation;Cf(e,t.text,0,0,n,{color:t.color,maxWidth:l,rotation:s,textAlign:Bu(t.align),textBaseline:"middle",translation:[i,o]})}}}]),n}(vp),Yv={id:"title",_element:Bv,start:function(e,t,n){!function(e,t){var n=new Bv({ctx:e.ctx,options:t,chart:e});Xh(0,n,t),Zh(e,n),e.titleBlock=n}(e,n)},stop:function(e){var t=e.titleBlock;Kh(e,t),delete e.titleBlock},beforeUpdate:function(e,t,n){var r=e.titleBlock;Xh(0,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Uv=(new WeakMap,{average:function(e){if(!e.length)return!1;var t,n,r=0,a=0,i=0;for(t=0,n=e.length;t<n;++t){var o=e[t].element;if(o&&o.hasValue()){var l=o.tooltipPosition();r+=l.x,a+=l.y,++i}}return{x:r/i,y:a/i}},nearest:function(e,t){if(!e.length)return!1;var n,r,a,i=t.x,o=t.y,l=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){var s=e[n].element;if(s&&s.hasValue()){var c=Du(t,s.getCenterPoint());c<l&&(l=c,a=s)}}if(a){var u=a.tooltipPosition();i=u.x,o=u.y}return{x:i,y:o}}});function Gv(e,t){return t&&(Yc(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function qv(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Zv(e,t){var n=t.element,r=t.datasetIndex,a=t.index,i=e.getDatasetMeta(r).controller,o=i.getLabelAndValue(a),l=o.label,s=o.value;return{chart:e,label:l,parsed:i.getParsed(a),raw:e.data.datasets[r].data[a],formattedValue:s,dataset:i.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function Kv(e,t){var n=e.chart.ctx,r=e.body,a=e.footer,i=e.title,o=t.boxWidth,l=t.boxHeight,s=Tf(t.bodyFont),c=Tf(t.titleFont),u=Tf(t.footerFont),f=i.length,d=a.length,h=r.length,p=Nf(t.padding),v=p.height,m=0,y=r.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);y+=e.beforeBody.length+e.afterBody.length,f&&(v+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),y&&(v+=h*(t.displayColors?Math.max(l,s.lineHeight):s.lineHeight)+(y-h)*s.lineHeight+(y-1)*t.bodySpacing),d&&(v+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);var g=0,b=function(e){m=Math.max(m,n.measureText(e).width+g)};return n.save(),n.font=c.string,Jc(e.title,b),n.font=s.string,Jc(e.beforeBody.concat(e.afterBody),b),g=t.displayColors?o+2+t.boxPadding:0,Jc(r,(function(e){Jc(e.before,b),Jc(e.lines,b),Jc(e.after,b)})),g=0,n.font=u.string,Jc(e.footer,b),n.restore(),{width:m+=p.width,height:v}}function Xv(e,t,n,r){var a=n.x,i=n.width,o=e.width,l=e.chartArea,s=l.left,c=l.right,u="center";return"center"===r?u=a<=(s+c)/2?"left":"right":a<=i/2?u="left":a>=o-i/2&&(u="right"),function(e,t,n,r){var a=r.x,i=r.width,o=n.caretSize+n.caretPadding;return"left"===e&&a+i+o>t.width||"right"===e&&a-i-o<0||void 0}(u,e,t,n)&&(u="center"),u}function Jv(e,t,n){var r=n.yAlign||t.yAlign||function(e,t){var n=t.y,r=t.height;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||Xv(e,t,n,r),yAlign:r}}function Qv(e,t,n,r){var a=e.caretSize,i=e.caretPadding,o=e.cornerRadius,l=n.xAlign,s=n.yAlign,c=a+i,u=Lf(o),f=u.topLeft,d=u.topRight,h=u.bottomLeft,p=u.bottomRight,v=function(e,t){var n=e.x,r=e.width;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,l),m=function(e,t,n){var r=e.y,a=e.height;return"top"===t?r+=n:r-="bottom"===t?a+n:a/2,r}(t,s,c);return"center"===s?"left"===l?v+=c:"right"===l&&(v-=c):"left"===l?v-=Math.max(f,h)+a:"right"===l&&(v+=Math.max(d,p)+a),{x:Iu(v,0,r.width-t.width),y:Iu(m,0,r.height-t.height)}}function em(e,t,n){var r=Nf(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function tm(e){return Gv([],qv(e))}function nm(e,t){var n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var rm={beforeTitle:Vc,title:function(e){if(e.length>0){var t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Vc,beforeBody:Vc,beforeLabel:Vc,label:function(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;var t=e.dataset.label||"";t&&(t+=": ");var n=e.formattedValue;return Bc(n)||(t+=n),t},labelColor:function(e){var t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor:function(){return this.options.bodyColor},labelPointStyle:function(e){var t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Vc,afterBody:Vc,beforeFooter:Vc,footer:Vc,afterFooter:Vc};function am(e,t,n,r){var a=e[t].call(n,r);return void 0===a?rm[t].call(n,r):a}var im=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this)).opacity=0,r._active=[],r._eventPosition=void 0,r._size=void 0,r._cachedAnimations=void 0,r._tooltipItems=[],r.$animations=void 0,r.$context=void 0,r.chart=e.chart,r.options=e.options,r.dataPoints=void 0,r.title=void 0,r.beforeBody=void 0,r.body=void 0,r.afterBody=void 0,r.footer=void 0,r.xAlign=void 0,r.yAlign=void 0,r.x=void 0,r.y=void 0,r.height=void 0,r.width=void 0,r.caretX=void 0,r.caretY=void 0,r.labelColors=void 0,r.labelPointStyles=void 0,r.labelTextColors=void 0,r}return Kd(n,[{key:"initialize",value:function(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var e=this._cachedAnimations;if(e)return e;var t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,a=new th(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}},{key:"getContext",value:function(){return this.$context||(this.$context=(this,zf(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}},{key:"getTitle",value:function(e,t){var n=t.callbacks,r=am(n,"beforeTitle",this,e),a=am(n,"title",this,e),i=am(n,"afterTitle",this,e),o=[];return o=Gv(o,qv(r)),o=Gv(o,qv(a)),Gv(o,qv(i))}},{key:"getBeforeBody",value:function(e,t){return tm(am(t.callbacks,"beforeBody",this,e))}},{key:"getBody",value:function(e,t){var n=this,r=t.callbacks,a=[];return Jc(e,(function(e){var t={before:[],lines:[],after:[]},i=nm(r,e);Gv(t.before,qv(am(i,"beforeLabel",n,e))),Gv(t.lines,am(i,"label",n,e)),Gv(t.after,qv(am(i,"afterLabel",n,e))),a.push(t)})),a}},{key:"getAfterBody",value:function(e,t){return tm(am(t.callbacks,"afterBody",this,e))}},{key:"getFooter",value:function(e,t){var n=t.callbacks,r=am(n,"beforeFooter",this,e),a=am(n,"footer",this,e),i=am(n,"afterFooter",this,e),o=[];return o=Gv(o,qv(r)),o=Gv(o,qv(a)),Gv(o,qv(i))}},{key:"_createItems",value:function(e){var t,n,r=this,a=this._active,i=this.chart.data,o=[],l=[],s=[],c=[];for(t=0,n=a.length;t<n;++t)c.push(Zv(this.chart,a[t]));return e.filter&&(c=c.filter((function(t,n,r){return e.filter(t,n,r,i)}))),e.itemSort&&(c=c.sort((function(t,n){return e.itemSort(t,n,i)}))),Jc(c,(function(t){var n=nm(e.callbacks,t);o.push(am(n,"labelColor",r,t)),l.push(am(n,"labelPointStyle",r,t)),s.push(am(n,"labelTextColor",r,t))})),this.labelColors=o,this.labelPointStyles=l,this.labelTextColors=s,this.dataPoints=c,c}},{key:"update",value:function(e,t){var n,r=this.options.setContext(this.getContext()),a=this._active,i=[];if(a.length){var o=Uv[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);var l=this._size=Kv(this,r),s=Object.assign({},o,l),c=Jv(this.chart,r,s),u=Qv(r,s,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,n={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=i,this.$context=void 0,n&&this._resolveAnimations().update(this,n),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:t})}},{key:"drawCaret",value:function(e,t,n,r){var a=this.getCaretPosition(e,n,r);t.lineTo(a.x1,a.y1),t.lineTo(a.x2,a.y2),t.lineTo(a.x3,a.y3)}},{key:"getCaretPosition",value:function(e,t,n){var r,a,i,o,l,s,c=this.xAlign,u=this.yAlign,f=n.caretSize,d=Lf(n.cornerRadius),h=d.topLeft,p=d.topRight,v=d.bottomLeft,m=d.bottomRight,y=e.x,g=e.y,b=t.width,x=t.height;return"center"===u?(l=g+x/2,"left"===c?(a=(r=y)-f,o=l+f,s=l-f):(a=(r=y+b)+f,o=l-f,s=l+f),i=r):(a="left"===c?y+Math.max(h,v)+f:"right"===c?y+b-Math.max(p,m)-f:this.caretX,"top"===u?(l=(o=g)-f,r=a-f,i=a+f):(l=(o=g+x)+f,r=a+f,i=a-f),s=o),{x1:r,x2:a,x3:i,y1:o,y2:l,y3:s}}},{key:"drawTitle",value:function(e,t,n){var r,a,i,o=this.title,l=o.length;if(l){var s=wd(n.rtl,this.x,this.width);for(e.x=em(this,n.titleAlign,n),t.textAlign=s.textAlign(n.titleAlign),t.textBaseline="middle",r=Tf(n.titleFont),a=n.titleSpacing,t.fillStyle=n.titleColor,t.font=r.string,i=0;i<l;++i)t.fillText(o[i],s.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+a,i+1===l&&(e.y+=n.titleMarginBottom-a)}}},{key:"_drawColorBox",value:function(e,t,n,r,a){var i=this.labelColors[n],o=this.labelPointStyles[n],l=a.boxHeight,s=a.boxWidth,c=Tf(a.bodyFont),u=em(this,"left",a),f=r.x(u),d=l<c.lineHeight?(c.lineHeight-l)/2:0,h=t.y+d;if(a.usePointStyle){var p={radius:Math.min(s,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},v=r.leftForLtr(f,s)+s/2,m=h+l/2;e.strokeStyle=a.multiKeyBackground,e.fillStyle=a.multiKeyBackground,gf(e,p,v,m),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,gf(e,p,v,m)}else{e.lineWidth=Uc(i.borderWidth)?Math.max.apply(Math,Yd(Object.values(i.borderWidth))):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;var y=r.leftForLtr(f,s),g=r.leftForLtr(r.xPlus(f,1),s-2),b=Lf(i.borderRadius);Object.values(b).some((function(e){return 0!==e}))?(e.beginPath(),e.fillStyle=a.multiKeyBackground,jf(e,{x:y,y:h,w:s,h:l,radius:b}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),jf(e,{x:g,y:h+1,w:s-2,h:l-2,radius:b}),e.fill()):(e.fillStyle=a.multiKeyBackground,e.fillRect(y,h,s,l),e.strokeRect(y,h,s,l),e.fillStyle=i.backgroundColor,e.fillRect(g,h+1,s-2,l-2))}e.fillStyle=this.labelTextColors[n]}},{key:"drawBody",value:function(e,t,n){var r,a,i,o,l,s,c,u=this.body,f=n.bodySpacing,d=n.bodyAlign,h=n.displayColors,p=n.boxHeight,v=n.boxWidth,m=n.boxPadding,y=Tf(n.bodyFont),g=y.lineHeight,b=0,x=wd(n.rtl,this.x,this.width),_=function(n){t.fillText(n,x.x(e.x+b),e.y+g/2),e.y+=g+f},w=x.textAlign(d);for(t.textAlign=d,t.textBaseline="middle",t.font=y.string,e.x=em(this,w,n),t.fillStyle=n.bodyColor,Jc(this.beforeBody,_),b=h&&"right"!==w?"center"===d?v/2+m:v+2+m:0,o=0,s=u.length;o<s;++o){for(r=u[o],a=this.labelTextColors[o],t.fillStyle=a,Jc(r.before,_),i=r.lines,h&&i.length&&(this._drawColorBox(t,e,o,x,n),g=Math.max(y.lineHeight,p)),l=0,c=i.length;l<c;++l)_(i[l]),g=y.lineHeight;Jc(r.after,_)}b=0,g=y.lineHeight,Jc(this.afterBody,_),e.y-=f}},{key:"drawFooter",value:function(e,t,n){var r,a,i=this.footer,o=i.length;if(o){var l=wd(n.rtl,this.x,this.width);for(e.x=em(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=l.textAlign(n.footerAlign),t.textBaseline="middle",r=Tf(n.footerFont),t.fillStyle=n.footerColor,t.font=r.string,a=0;a<o;++a)t.fillText(i[a],l.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+n.footerSpacing}}},{key:"drawBackground",value:function(e,t,n,r){var a=this.xAlign,i=this.yAlign,o=e.x,l=e.y,s=n.width,c=n.height,u=Lf(r.cornerRadius),f=u.topLeft,d=u.topRight,h=u.bottomLeft,p=u.bottomRight;t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+f,l),"top"===i&&this.drawCaret(e,t,n,r),t.lineTo(o+s-d,l),t.quadraticCurveTo(o+s,l,o+s,l+d),"center"===i&&"right"===a&&this.drawCaret(e,t,n,r),t.lineTo(o+s,l+c-p),t.quadraticCurveTo(o+s,l+c,o+s-p,l+c),"bottom"===i&&this.drawCaret(e,t,n,r),t.lineTo(o+h,l+c),t.quadraticCurveTo(o,l+c,o,l+c-h),"center"===i&&"left"===a&&this.drawCaret(e,t,n,r),t.lineTo(o,l+f),t.quadraticCurveTo(o,l,o+f,l),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}},{key:"_updateAnimationTarget",value:function(e){var t=this.chart,n=this.$animations,r=n&&n.x,a=n&&n.y;if(r||a){var i=Uv[e.position].call(this,this._active,this._eventPosition);if(!i)return;var o=this._size=Kv(this,e),l=Object.assign({},i,this._size),s=Jv(t,e,l),c=Qv(e,l,s,t);r._to===c.x&&a._to===c.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,c))}}},{key:"_willRender",value:function(){return!!this.opacity}},{key:"draw",value:function(e){var t=this.options.setContext(this.getContext()),n=this.opacity;if(n){this._updateAnimationTarget(t);var r={width:this.width,height:this.height},a={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;var i=Nf(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(a,e,r,t),kd(e,t.textDirection),a.y+=i.top,this.drawTitle(a,e,t),this.drawBody(a,e,t),this.drawFooter(a,e,t),Sd(e,t.textDirection),e.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(e,t){var n=this,r=this._active,a=e.map((function(e){var t=e.datasetIndex,r=e.index,a=n.chart.getDatasetMeta(t);if(!a)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:a.data[r],index:r}})),i=!Qc(r,a),o=this._positionChanged(a,t);(i||o)&&(this._active=a,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}},{key:"handleEvent",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var r=this.options,a=this._active||[],i=this._getActiveElements(e,a,t,n),o=this._positionChanged(i,e),l=t||!Qc(i,a)||o;return l&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),l}},{key:"_getActiveElements",value:function(e,t,n,r){var a=this.options;if("mouseout"===e.type)return[];if(!r)return t;var i=this.chart.getElementsAtEventForMode(e,a.mode,a,n);return a.reverse&&i.reverse(),i}},{key:"_positionChanged",value:function(e,t){var n=this.caretX,r=this.caretY,a=this.options,i=Uv[a.position].call(this,e,t);return!1!==i&&(n!==i.x||r!==i.y)}}]),n}(vp);Wd(im,"positioners",Uv);var om={id:"tooltip",_element:im,positioners:Uv,afterInit:function(e,t,n){n&&(e.tooltip=new im({chart:e,options:n}))},beforeUpdate:function(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset:function(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw:function(e){var t=e.tooltip;if(t&&t._willRender()){var n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",Pd(Pd({},n),{},{cancelable:!0})))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent:function(e,t){if(e.tooltip){var n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(e,t){return t.bodyFont.size},boxWidth:function(e,t){return t.bodyFont.size},multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:rm},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:function(e){return"filter"!==e&&"itemSort"!==e&&"external"!==e},_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function lm(e){var t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var sm=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this,e))._startValue=void 0,r._valueRange=0,r._addedLabels=[],r}return Kd(n,[{key:"init",value:function(e){var t=this._addedLabels;if(t.length){var r,a=this.getLabels(),i=$d(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,l=o.index,s=o.label;a[l]===s&&a.splice(l,1)}}catch(e){i.e(e)}finally{i.f()}this._addedLabels=[]}Rd(Hd(n.prototype),"init",this).call(this,e)}},{key:"parse",value:function(e,t){if(Bc(e))return null;var n=this.getLabels();return function(e,t){return null===e?null:Iu(Math.round(e),0,t)}(t=isFinite(t)&&n[t]===e?t:function(e,t,n,r){var a=e.indexOf(t);return-1===a?function(e,t,n,r){return"string"==typeof t?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n}(e,t,n,r):a!==e.lastIndexOf(t)?n:a}(n,e,Zc(t,e),this._addedLabels),n.length-1)}},{key:"determineDataLimits",value:function(){var e=this.getUserBounds(),t=e.minDefined,n=e.maxDefined,r=this.getMinMax(!0),a=r.min,i=r.max;"ticks"===this.options.bounds&&(t||(a=0),n||(i=this.getLabels().length-1)),this.min=a,this.max=i}},{key:"buildTicks",value:function(){var e=this.min,t=this.max,n=this.options.offset,r=[],a=this.getLabels();a=0===e&&t===a.length-1?a:a.slice(e,t+1),this._valueRange=Math.max(a.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(var i=e;i<=t;i++)r.push({value:i});return r}},{key:"getLabelForValue",value:function(e){return lm.call(this,e)}},{key:"configure",value:function(){Rd(Hd(n.prototype),"configure",this).call(this),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}},{key:"getPixelForValue",value:function(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}},{key:"getPixelForTick",value:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getValueForPixel",value:function(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),n}(Op);function cm(e,t,n){var r=n.horizontal,a=Eu(n.minRotation),i=(r?Math.sin(a):Math.cos(a))||.001,o=.75*t*(""+e).length;return Math.min(t/i,o)}Wd(sm,"id","category"),Wd(sm,"defaults",{ticks:{callback:lm}});var um=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this,e)).start=void 0,r.end=void 0,r._startValue=void 0,r._endValue=void 0,r._valueRange=0,r}return Kd(n,[{key:"parse",value:function(e,t){return Bc(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}},{key:"handleTickRangeOptions",value:function(){var e=this.options.beginAtZero,t=this.getUserBounds(),n=t.minDefined,r=t.maxDefined,a=this.min,i=this.max,o=function(e){return a=n?a:e},l=function(e){return i=r?i:e};if(e){var s=_u(a),c=_u(i);s<0&&c<0?l(0):s>0&&c>0&&o(0)}if(a===i){var u=0===i?1:Math.abs(.05*i);l(i+u),e||o(a-u)}this.min=a,this.max=i}},{key:"getTickLimit",value:function(){var e,t=this.options.ticks,n=t.maxTicksLimit,r=t.stepSize;return r?(e=Math.ceil(this.max/r)-Math.floor(this.min/r)+1)>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(r," would result generating up to ").concat(e," ticks. Limiting to 1000.")),e=1e3):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var e=this.options,t=e.ticks,n=this.getTickLimit(),r=function(e,t){var n,r,a,i,o,l,s,c=[],u=e.bounds,f=e.step,d=e.min,h=e.max,p=e.precision,v=e.count,m=e.maxTicks,y=e.maxDigits,g=e.includeBounds,b=f||1,x=m-1,_=t.min,w=t.max,k=!Bc(d),S=!Bc(h),O=!Bc(v),E=(w-_)/(y+1),A=ku((w-_)/x/b)*b;if(A<1e-14&&!k&&!S)return[{value:_},{value:w}];(i=Math.ceil(w/A)-Math.floor(_/A))>x&&(A=ku(i*A/x/b)*b),Bc(p)||(n=Math.pow(10,p),A=Math.ceil(A*n)/n),"ticks"===u?(r=Math.floor(_/A)*A,a=Math.ceil(w/A)*A):(r=_,a=w),k&&S&&f&&(o=(h-d)/f,l=A/1e3,(s=Math.round(o))-l<=o&&s+l>=o)?(A=(h-d)/(i=Math.round(Math.min((h-d)/A,m))),r=d,a=h):O?A=((a=S?h:a)-(r=k?d:r))/(i=v-1):i=wu(i=(a-r)/A,Math.round(i),A/1e3)?Math.round(i):Math.ceil(i);var C=Math.max(Cu(A),Cu(r));n=Math.pow(10,Bc(p)?C:p),r=Math.round(r*n)/n,a=Math.round(a*n)/n;var j=0;for(k&&(g&&r!==d?(c.push({value:d}),r<d&&j++,wu(Math.round((r+j*A)*n)/n,d,cm(d,E,e))&&j++):r<d&&j++);j<i;++j){var D=Math.round((r+j*A)*n)/n;if(S&&D>h)break;c.push({value:D})}return S&&g&&a!==h?c.length&&wu(c[c.length-1].value,h,cm(h,E,e))?c[c.length-1].value=h:c.push({value:h}):S&&a!==h||c.push({value:a}),c}({maxTicks:n=Math.max(2,n),bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&Ou(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}},{key:"configure",value:function(){var e=this.ticks,t=this.min,r=this.max;if(Rd(Hd(n.prototype),"configure",this).call(this),this.options.offset&&e.length){var a=(r-t)/Math.max(e.length-1,1)/2;t-=a,r+=a}this._startValue=t,this._endValue=r,this._valueRange=r-t}},{key:"getLabelForValue",value:function(e){return af(e,this.chart.options.locale,this.options.ticks.format)}}]),n}(Op),fm=function(e){Ld(n,e);var t=Td(n);function n(){return qd(this,n),t.apply(this,arguments)}return Kd(n,[{key:"determineDataLimits",value:function(){var e=this.getMinMax(!0),t=e.min,n=e.max;this.min=Gc(t)?t:0,this.max=Gc(n)?n:1,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){var e=this.isHorizontal(),t=e?this.width:this.height,n=Eu(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,a.lineHeight/r))}},{key:"getPixelForValue",value:function(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}]),n}(um);Wd(fm,"id","linear"),Wd(fm,"defaults",{ticks:{callback:lf.formatters.numeric}});var dm=function(e){return Math.floor(xu(e))},hm=function(e,t){return Math.pow(10,dm(e)+t)};function pm(e){return 1==e/Math.pow(10,dm(e))}function vm(e,t,n){var r=Math.pow(10,n),a=Math.floor(e/r);return Math.ceil(t/r)-a}var mm=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this,e)).start=void 0,r.end=void 0,r._startValue=void 0,r._valueRange=0,r}return Kd(n,[{key:"parse",value:function(e,t){var n=um.prototype.parse.apply(this,[e,t]);if(0!==n)return Gc(n)&&n>0?n:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var e=this.getMinMax(!0),t=e.min,n=e.max;this.min=Gc(t)?Math.max(0,t):null,this.max=Gc(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Gc(this._userMin)&&(this.min=t===hm(this.min,0)?hm(this.min,-1):hm(this.min,0)),this.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var e=this.getUserBounds(),t=e.minDefined,n=e.maxDefined,r=this.min,a=this.max,i=function(e){return r=t?r:e},o=function(e){return a=n?a:e};r===a&&(r<=0?(i(1),o(10)):(i(hm(r,-1)),o(hm(a,1)))),r<=0&&i(hm(a,-1)),a<=0&&o(hm(r,1)),this.min=r,this.max=a}},{key:"buildTicks",value:function(){var e=this.options,t=function(e,t){var n=t.min,r=t.max;n=qc(e.min,n);for(var a=[],i=dm(n),o=function(e,t){for(var n=dm(t-e);vm(e,t,n)>10;)n++;for(;vm(e,t,n)<10;)n--;return Math.min(n,dm(e))}(n,r),l=o<0?Math.pow(10,Math.abs(o)):1,s=Math.pow(10,o),c=i>o?Math.pow(10,i):0,u=Math.round((n-c)*l)/l,f=Math.floor((n-c)/s/10)*s*10,d=Math.floor((u-f)/Math.pow(10,o)),h=qc(e.min,Math.round((c+f+d*Math.pow(10,o))*l)/l);h<r;)a.push({value:h,major:pm(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(d=2,l=++o>=0?1:l),h=Math.round((c+f+d*Math.pow(10,o))*l)/l;var p=qc(e.max,h);return a.push({value:p,major:pm(p),significand:d}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&Ou(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}},{key:"getLabelForValue",value:function(e){return void 0===e?"0":af(e,this.chart.options.locale,this.options.ticks.format)}},{key:"configure",value:function(){var e=this.min;Rd(Hd(n.prototype),"configure",this).call(this),this._startValue=xu(e),this._valueRange=xu(this.max)-xu(e)}},{key:"getPixelForValue",value:function(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(xu(e)-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(e){var t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}]),n}(Op);function ym(e){var t=e.ticks;if(t.display&&e.display){var n=Nf(t.backdropPadding);return Zc(t.font&&t.font.size,hf.font.size)+n.height}return 0}function gm(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function bm(e,t,n,r,a){var i=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),l=0,s=0;r.start<t.l?(l=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-l)):r.end>t.r&&(l=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+l)),a.start<t.t?(s=(t.t-a.start)/o,e.t=Math.min(e.t,t.t-s)):a.end>t.b&&(s=(a.end-t.b)/o,e.b=Math.max(e.b,t.b+s))}function xm(e,t,n){var r,a,i,o=e.drawingArea,l=n.extra,s=n.additionalAngle,c=n.padding,u=n.size,f=e.getPointPosition(t,o+l+c,s),d=Math.round(Au(Pu(f.angle+yu))),h=function(e,t,n){return 90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t),e}(f.y,u.h,d),p=function(e){return 0===e||180===e?"center":e<180?"left":"right"}(d),v=(r=f.x,a=u.w,"right"===(i=p)?r-=a:"center"===i&&(r-=a/2),r);return{visible:!0,x:f.x,y:h,textAlign:p,left:v,top:h,right:v+u.w,bottom:h+u.h}}function _m(e,t){if(!t)return!0;var n=e.left,r=e.top,a=e.right,i=e.bottom;return!(xf({x:n,y:r},t)||xf({x:n,y:i},t)||xf({x:a,y:r},t)||xf({x:a,y:i},t))}function wm(e,t,n){var r=n.left,a=n.top,i=n.right,o=n.bottom,l=t.backdropColor;if(!Bc(l)){var s=Lf(t.borderRadius),c=Nf(t.backdropPadding);e.fillStyle=l;var u=r-c.left,f=a-c.top,d=i-r+c.width,h=o-a+c.height;Object.values(s).some((function(e){return 0!==e}))?(e.beginPath(),jf(e,{x:u,y:f,w:d,h,radius:s}),e.fill()):e.fillRect(u,f,d,h)}}function km(e,t,n,r){var a=e.ctx;if(n)a.arc(e.xCenter,e.yCenter,t,0,hu);else{var i=e.getPointPosition(0,t);a.moveTo(i.x,i.y);for(var o=1;o<r;o++)i=e.getPointPosition(o,t),a.lineTo(i.x,i.y)}}Wd(mm,"id","logarithmic"),Wd(mm,"defaults",{ticks:{callback:lf.formatters.logarithmic,major:{enabled:!0}}});var Sm=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this,e)).xCenter=void 0,r.yCenter=void 0,r.drawingArea=void 0,r._pointLabels=[],r._pointLabelItems=[],r}return Kd(n,[{key:"setDimensions",value:function(){var e=this._padding=Nf(ym(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}},{key:"determineDataLimits",value:function(){var e=this.getMinMax(!1),t=e.min,n=e.max;this.min=Gc(t)&&!isNaN(t)?t:0,this.max=Gc(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){return Math.ceil(this.drawingArea/ym(this.options))}},{key:"generateTickLabels",value:function(e){var t=this;um.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((function(e,n){var r=Xc(t.options.pointLabels.callback,[e,n],t);return r||0===r?r:""})).filter((function(e,n){return t.chart.getDataVisibility(n)}))}},{key:"fit",value:function(){var e=this.options;e.display&&e.pointLabels.display?function(e){for(var t,n,r,a={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},a),o=[],l=[],s=e._pointLabels.length,c=e.options.pointLabels,u=c.centerPointLabels?du/s:0,f=0;f<s;f++){var d=c.setContext(e.getPointLabelContext(f));l[f]=d.padding;var h=e.getPointPosition(f,e.drawingArea+l[f],u),p=Tf(d.font),v=(t=e.ctx,n=p,r=Yc(r=e._pointLabels[f])?r:[r],{w:vf(t,n.string,r),h:r.length*n.lineHeight});o[f]=v;var m=Pu(e.getIndexAngle(f)+u),y=Math.round(Au(m));bm(i,a,m,gm(y,h.x,v.w,0,180),gm(y,h.y,v.h,90,270))}e.setCenterPoint(a.l-i.l,i.r-a.r,a.t-i.t,i.b-a.b),e._pointLabelItems=function(e,t,n){for(var r,a=[],i=e._pointLabels.length,o=e.options,l=o.pointLabels,s=l.centerPointLabels,c=l.display,u={extra:ym(o)/2,additionalAngle:s?du/i:0},f=0;f<i;f++){u.padding=n[f],u.size=t[f];var d=xm(e,f,u);a.push(d),"auto"===c&&(d.visible=_m(d,r),d.visible&&(r=d))}return a}(e,o,l)}(this):this.setCenterPoint(0,0,0,0)}},{key:"setCenterPoint",value:function(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}},{key:"getIndexAngle",value:function(e){return Pu(e*(hu/(this._pointLabels.length||1))+Eu(this.options.startAngle||0))}},{key:"getDistanceFromCenterForValue",value:function(e){if(Bc(e))return NaN;var t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}},{key:"getValueForDistanceFromCenter",value:function(e){if(Bc(e))return NaN;var t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}},{key:"getPointLabelContext",value:function(e){var t=this._pointLabels||[];if(e>=0&&e<t.length){var n=t[e];return function(e,t,n){return zf(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}},{key:"getPointPosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getIndexAngle(e)-yu+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}},{key:"getPointPositionForValue",value:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}},{key:"getBasePosition",value:function(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}},{key:"getPointLabelPosition",value:function(e){var t=this._pointLabelItems[e];return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}},{key:"drawBackground",value:function(){var e=this.options,t=e.backgroundColor,n=e.grid.circular;if(t){var r=this.ctx;r.save(),r.beginPath(),km(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}},{key:"drawGrid",value:function(){var e,t,n,r=this,a=this.ctx,i=this.options,o=i.angleLines,l=i.grid,s=i.border,c=this._pointLabels.length;if(i.pointLabels.display&&function(e,t){for(var n=e.ctx,r=e.options.pointLabels,a=t-1;a>=0;a--){var i=e._pointLabelItems[a];if(i.visible){var o=r.setContext(e.getPointLabelContext(a));wm(n,o,i);var l=Tf(o.font),s=i.x,c=i.y,u=i.textAlign;Cf(n,e._pointLabels[a],s,c+l.lineHeight/2,l,{color:o.color,textAlign:u,textBaseline:"middle"})}}}(this,c),l.display&&this.ticks.forEach((function(e,n){if(0!==n){t=r.getDistanceFromCenterForValue(e.value);var a=r.getContext(n),i=l.setContext(a),o=s.setContext(a);!function(e,t,n,r,a){var i=e.ctx,o=t.circular,l=t.color,s=t.lineWidth;!o&&!r||!l||!s||n<0||(i.save(),i.strokeStyle=l,i.lineWidth=s,i.setLineDash(a.dash),i.lineDashOffset=a.dashOffset,i.beginPath(),km(e,n,o,r),i.closePath(),i.stroke(),i.restore())}(r,i,t,c,o)}})),o.display){for(a.save(),e=c-1;e>=0;e--){var u=o.setContext(this.getPointLabelContext(e)),f=u.color,d=u.lineWidth;d&&f&&(a.lineWidth=d,a.strokeStyle=f,a.setLineDash(u.borderDash),a.lineDashOffset=u.borderDashOffset,t=this.getDistanceFromCenterForValue(i.ticks.reverse?this.min:this.max),n=this.getPointPosition(e,t),a.beginPath(),a.moveTo(this.xCenter,this.yCenter),a.lineTo(n.x,n.y),a.stroke())}a.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var e=this,t=this.ctx,n=this.options,r=n.ticks;if(r.display){var a,i,o=this.getIndexAngle(0);t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((function(o,l){if(0!==l||n.reverse){var s=r.setContext(e.getContext(l)),c=Tf(s.font);if(a=e.getDistanceFromCenterForValue(e.ticks[l].value),s.showLabelBackdrop){t.font=c.string,i=t.measureText(o.label).width,t.fillStyle=s.backdropColor;var u=Nf(s.backdropPadding);t.fillRect(-i/2-u.left,-a-c.size/2-u.top,i+u.width,c.size+u.height)}Cf(t,o.label,0,-a,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}})),t.restore()}}},{key:"drawTitle",value:function(){}}]),n}(um);Wd(Sm,"id","radialLinear"),Wd(Sm,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:lf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(e){return e},padding:5,centerPointLabels:!1}}),Wd(Sm,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Wd(Sm,"descriptors",{angleLines:{_fallback:"grid"}});var Om={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}},Em=Object.keys(Om);function Am(e,t){return e-t}function Cm(e,t){if(Bc(t))return null;var n=e._adapter,r=e._parseOpts,a=r.parser,i=r.round,o=r.isoWeekday,l=t;return"function"==typeof a&&(l=a(l)),Gc(l)||(l="string"==typeof a?n.parse(l,a):n.parse(l)),null===l?null:(i&&(l="week"!==i||!Su(o)&&!0!==o?n.startOf(l,i):n.startOf(l,"isoWeek",o)),+l)}function jm(e,t,n,r){for(var a=Em.length,i=Em.indexOf(e);i<a-1;++i){var o=Om[Em[i]],l=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(l*o.size))<=r)return Em[i]}return Em[a-1]}function Dm(e,t,n){if(n){if(n.length){var r=Nu(n,t),a=r.lo,i=r.hi;e[n[a]>=t?n[a]:n[i]]=!0}}else e[t]=!0}function Mm(e,t,n){var r,a,i=[],o={},l=t.length;for(r=0;r<l;++r)o[a=t[r]]=r,i.push({value:a,major:!1});return 0!==l&&n?function(e,t,n,r){var a,i,o=e._adapter,l=+o.startOf(t[0].value,r),s=t[t.length-1].value;for(a=l;a<=s;a=+o.add(a,1,r))(i=n[a])>=0&&(t[i].major=!0);return t}(e,i,o,n):i}var Pm=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this,e))._cache={data:[],labels:[],all:[]},r._unit="day",r._majorUnit=void 0,r._offsets={},r._normalized=!1,r._parseOpts=void 0,r}return Kd(n,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.time||(e.time={}),a=this._adapter=new Mh._date(e.adapters.date);a.init(t),au(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},Rd(Hd(n.prototype),"init",this).call(this,e),this._normalized=t.normalized}},{key:"parse",value:function(e,t){return void 0===e?null:Cm(this,e)}},{key:"beforeLayout",value:function(){Rd(Hd(n.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var e=this.options,t=this._adapter,n=e.time.unit||"day",r=this.getUserBounds(),a=r.min,i=r.max,o=r.minDefined,l=r.maxDefined;function s(e){o||isNaN(e.min)||(a=Math.min(a,e.min)),l||isNaN(e.max)||(i=Math.max(i,e.max))}o&&l||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),a=Gc(a)&&!isNaN(a)?a:+t.startOf(Date.now(),n),i=Gc(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(a,i-1),this.max=Math.max(a+1,i)}},{key:"_getLabelBounds",value:function(){var e=this.getLabelTimestamps(),t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}},{key:"buildTicks",value:function(){var e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);var a=this.min,i=function(e,t,n){for(var r=0,a=e.length;r<a&&e[r]<t;)r++;for(;a>r&&e[a-1]>n;)a--;return r>0||a<e.length?e.slice(r,a):e}(r,a,this.max);return this._unit=t.unit||(n.autoSkip?jm(t.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(e,t,n,r,a){for(var i=Em.length-1;i>=Em.indexOf(n);i--){var o=Em[i];if(Om[o].common&&e._adapter.diff(a,r,o)>=t-1)return o}return Em[n?Em.indexOf(n):0]}(this,i.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(var t=Em.indexOf(e)+1,n=Em.length;t<n;++t)if(Om[Em[t]].common)return Em[t]}(this._unit):void 0,this.initOffsets(r),e.reverse&&i.reverse(),Mm(this,i,this._majorUnit)}},{key:"afterAutoSkip",value:function(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((function(e){return+e.value})))}},{key:"initOffsets",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=0,a=0;this.options.offset&&n.length&&(e=this.getDecimalForValue(n[0]),r=1===n.length?1-e:(this.getDecimalForValue(n[1])-e)/2,t=this.getDecimalForValue(n[n.length-1]),a=1===n.length?t:(t-this.getDecimalForValue(n[n.length-2]))/2);var i=n.length<3?.5:.25;r=Iu(r,0,i),a=Iu(a,0,i),this._offsets={start:r,end:a,factor:1/(r+1+a)}}},{key:"_generate",value:function(){var e,t,n=this._adapter,r=this.min,a=this.max,i=this.options,o=i.time,l=o.unit||jm(o.minUnit,r,a,this._getLabelCapacity(r)),s=Zc(i.ticks.stepSize,1),c="week"===l&&o.isoWeekday,u=Su(c)||!0===c,f={},d=r;if(u&&(d=+n.startOf(d,"isoWeek",c)),d=+n.startOf(d,u?"day":l),n.diff(a,r,l)>1e5*s)throw new Error(r+" and "+a+" are too far apart with stepSize of "+s+" "+l);var h="data"===i.ticks.source&&this.getDataTimestamps();for(e=d,t=0;e<a;e=+n.add(e,s,l),t++)Dm(f,e,h);return e!==a&&"ticks"!==i.bounds&&1!==t||Dm(f,e,h),Object.keys(f).sort(Am).map((function(e){return+e}))}},{key:"getLabelForValue",value:function(e){var t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}},{key:"format",value:function(e,t){var n=this.options.time.displayFormats,r=this._unit,a=t||n[r];return this._adapter.format(e,a)}},{key:"_tickFormatFunction",value:function(e,t,n,r){var a=this.options,i=a.ticks.callback;if(i)return Xc(i,[e,t,n],this);var o=a.time.displayFormats,l=this._unit,s=this._majorUnit,c=l&&o[l],u=s&&o[s],f=n[t],d=s&&u&&f&&f.major;return this._adapter.format(e,r||(d?u:c))}},{key:"generateTickLabels",value:function(e){var t,n,r;for(t=0,n=e.length;t<n;++t)(r=e[t]).label=this._tickFormatFunction(r.value,t,e)}},{key:"getDecimalForValue",value:function(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}},{key:"getPixelForValue",value:function(e){var t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}},{key:"getValueForPixel",value:function(e){var t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}},{key:"_getLabelSize",value:function(e){var t=this.options.ticks,n=this.ctx.measureText(e).width,r=Eu(this.isHorizontal()?t.maxRotation:t.minRotation),a=Math.cos(r),i=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*a+o*i,h:n*i+o*a}}},{key:"_getLabelCapacity",value:function(e){var t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,a=this._tickFormatFunction(e,0,Mm(this,[e],this._majorUnit),r),i=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return o>0?o:1}},{key:"getDataTimestamps",value:function(){var e,t,n=this._cache.data||[];if(n.length)return n;var r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}},{key:"getLabelTimestamps",value:function(){var e,t,n=this._cache.labels||[];if(n.length)return n;var r=this.getLabels();for(e=0,t=r.length;e<t;++e)n.push(Cm(this,r[e]));return this._cache.labels=this._normalized?n:this.normalize(n)}},{key:"normalize",value:function(e){return Vu(e.sort(Am))}}]),n}(Op);function Rm(e,t,n){var r,a,i,o,l=0,s=e.length-1;if(n){if(t>=e[l].pos&&t<=e[s].pos){var c=Tu(e,"pos",t);l=c.lo,s=c.hi}var u=e[l];r=u.pos,i=u.time;var f=e[s];a=f.pos,o=f.time}else{if(t>=e[l].time&&t<=e[s].time){var d=Tu(e,"time",t);l=d.lo,s=d.hi}var h=e[l];r=h.time,i=h.pos;var p=e[s];a=p.time,o=p.pos}var v=a-r;return v?i+(o-i)*(t-r)/v:i}Wd(Pm,"id","time"),Wd(Pm,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});var Im=function(e){Ld(n,e);var t=Td(n);function n(e){var r;return qd(this,n),(r=t.call(this,e))._table=[],r._minPos=void 0,r._tableRange=void 0,r}return Kd(n,[{key:"initOffsets",value:function(){var e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Rm(t,this.min),this._tableRange=Rm(t,this.max)-this._minPos,Rd(Hd(n.prototype),"initOffsets",this).call(this,e)}},{key:"buildLookupTable",value:function(e){var t,n,r,a,i,o=this.min,l=this.max,s=[],c=[];for(t=0,n=e.length;t<n;++t)(a=e[t])>=o&&a<=l&&s.push(a);if(s.length<2)return[{time:o,pos:0},{time:l,pos:1}];for(t=0,n=s.length;t<n;++t)i=s[t+1],r=s[t-1],a=s[t],Math.round((i+r)/2)!==a&&c.push({time:a,pos:t/(n-1)});return c}},{key:"_generate",value:function(){var e=this.min,t=this.max,r=Rd(Hd(n.prototype),"getDataTimestamps",this).call(this);return r.includes(e)&&r.length||r.splice(0,0,e),r.includes(t)&&1!==r.length||r.push(t),r.sort((function(e,t){return e-t}))}},{key:"_getTimestampsForTable",value:function(){var e=this._cache.all||[];if(e.length)return e;var t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,this._cache.all=e}},{key:"getDecimalForValue",value:function(e){return(Rm(this._table,e)-this._minPos)/this._tableRange}},{key:"getValueForPixel",value:function(e){var t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Rm(this._table,n*this._tableRange+this._minPos,!0)}}]),n}(Pm);Wd(Im,"id","timeseries"),Wd(Im,"defaults",Pm.defaults);var Lm=["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"];function Nm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nm(Object(n),!0).forEach((function(t){Fm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zm="label";function Hm(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Vm(e,t){e.labels=t}function Wm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zm,r=[];e.datasets=t.map((function(t){var a=e.datasets.find((function(e){return e[n]===t[n]}));return a&&t.data&&!r.includes(a)?(r.push(a),Object.assign(a,t),a):Tm({},t)}))}function $m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zm,n={labels:[],datasets:[]};return Vm(n,e.labels),Wm(n,e.datasets,t),n}function Bm(t,n){var r=t.height,a=void 0===r?150:r,i=t.width,o=void 0===i?300:i,l=t.redraw,s=void 0!==l&&l,c=t.datasetIdKey,u=t.type,f=t.data,d=t.options,h=t.plugins,p=void 0===h?[]:h,v=t.fallbackContent,m=t.updateMode,y=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,Lm),g=(0,e.useRef)(null),b=(0,e.useRef)(),x=function(){g.current&&(b.current=new rv(g.current,{type:u,data:$m(f,c),options:d&&Tm({},d),plugins:p}),Hm(n,b.current))},_=function(){Hm(n,null),b.current&&(b.current.destroy(),b.current=null)};return(0,e.useEffect)((function(){!s&&b.current&&d&&function(e,t){var n=e.options;n&&t&&Object.assign(n,t)}(b.current,d)}),[s,d]),(0,e.useEffect)((function(){!s&&b.current&&Vm(b.current.config.data,f.labels)}),[s,f.labels]),(0,e.useEffect)((function(){!s&&b.current&&f.datasets&&Wm(b.current.config.data,f.datasets,c)}),[s,f.datasets]),(0,e.useEffect)((function(){b.current&&(s?(_(),setTimeout(x)):b.current.update(m))}),[s,d,f.labels,f.datasets,m]),(0,e.useEffect)((function(){b.current&&(_(),setTimeout(x))}),[u]),(0,e.useEffect)((function(){return x(),function(){return _()}}),[]),e.createElement("canvas",Object.assign({ref:g,role:"img",height:a,width:o},y),v)}var Ym=(0,e.forwardRef)(Bm);function Um(t,n){return rv.register(n),(0,e.forwardRef)((function(n,r){return e.createElement(Ym,Object.assign({},n,{ref:r,type:t}))}))}var Gm=Um("line",Oh),qm=Um("bar",wh),Zm=Um("pie",Ah);const Km=function(e){var t=e.selectedChartMetrics;return React.createElement(React.Fragment,null,React.createElement("div",{className:"flex h-[19px] justify-between items-center text-[12px] text-grey-1"},t.length>0&&t.length<3&&React.createElement("span",null,Us[t[0]].label),t.length>1&&t.length<3&&React.createElement("span",null,Us[t[1]].label)))};var Xm=function(e){var t,n=e.num,r=e.decimalPoints,a=void 0===r||r,i=e.showSuffix,o=void 0===i||i,l=e.forceDecimalPlaces,s=void 0!==l&&l,c=["","k","m"],u=0;for(n=null==n?0:n;n>=1e3&&u<c.length-1;)n/=1e3,u++;t=s?2:a?n%1==0?0:1:0;var f=n.toFixed(t);return s||(f=f.replace(/\.0+$/,"")),f+(o?c[u]:"")},Jm=function(e,t){return e=parseFloat(e)||0,0!==(t=parseFloat(t)||0)?parseInt(((e-t)/t*100).toFixed(0)):e>0?1/0:0},Qm=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e===1/0)return"∞";var n=Xm({num:e});return n+(t?"%":"")};function ey(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ty(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ey(Object(n),!0).forEach((function(t){ny(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ey(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ny(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ry(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ay(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ay(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ay(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}rv.register(sm,fm,yv,vv,kv,wh,Oh,Yv,om,$v,zv);var iy=(0,e.memo)((function(n){var r=n.charts,a=n.selectedChartMetrics,i=ry((0,e.useState)({selectedMetricsTotalPoints:0,labels:[],datasets:[]}),2),o=i[0],l=i[1],s=ry((0,e.useState)(!1),2),c=s[0],u=s[1],f=ry((0,e.useState)(qs()),2),d=f[0],h=f[1];(0,e.useEffect)((function(){var e=0,t=[];a.map((function(n,i){var o;if(null===(o=Us[n])||void 0===o||!o.locked){var l=(null==r?void 0:r.data[n])||[],s=l.map((function(e){return e.total}));l.map((function(t){e+=parseFloat(t.total)}));var c={label:n,data:s,borderColor:Us[n].color,fill:!0,borderWidth:2,pointHoverRadius:5,backgroundColor:function(e){var t=e.chart.ctx.createLinearGradient(0,0,0,400),r=Us[n].color.replace("#",""),a=parseInt(r.substr(0,2),16),i=parseInt(r.substr(2,2),16),o=parseInt(r.substr(4,2),16);return t.addColorStop(0,"rgba(".concat(a,", ").concat(i,", ").concat(o,", 0.2)")),t.addColorStop(1,"rgba(255, 255, 255, 0)"),t},spanGaps:!0};"revenue"===n?(c.type="bar",c.backgroundColor="#deb77b",c.borderColor=Us[n].color,c.borderWidth=0,c.fill=!1,c.order=1,c.barThickness="flex",c.maxBarThickness=25,c.borderRadius={topLeft:6,topRight:6,bottomLeft:0,bottomRight:0},c.borderSkipped=!1,delete c.backgroundColor,c.backgroundColor="#deb77b"):c.order=2,a.length<=2&&(c.yAxisID="chart-y-axis-"+(i+1)),t.push(c)}})),l({selectedMetricsTotalPoints:e,labels:p(r.labels),datasets:t})}),[r,a]);var p=function(e){return e.map((function(e,t){return e.includes(":")?e:"list"===(null==r?void 0:r.filter)?g()(e).format("DD/MM/YYYY"):"weekly"===(null==r?void 0:r.filter)?g()(e).format("DD/MM/YY"):"monthly"===(null==r?void 0:r.filter)?g()(e).format("MMM YYYY"):g()(e).format("DD/MM/YYYY")}))};(0,e.useEffect)((function(){var e=function(){h(qs())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var v=function(){var e={x:{ticks:{maxTicksLimit:10,color:"dark"===d?"#fff":"#41495B"},grid:{offset:!0,display:!0,drawBorder:!1,drawOnChartArea:!1,drawTicks:!1,tickLength:0,borderColor:"#d1d2db",color:"#d1d2db"}}},t=null;if(a.length>2)t={y:{border:{display:!1},ticks:{display:!1,beginAtZero:!0,maxTicksLimit:5},grid:{display:!0,drawBorder:!1,showGridLines:!1,drawOnChartArea:!0,borderDashOffset:25,borderColor:"#d1d2db",borderWidth:0,color:"#d1d2db"}}};else{var n={},r={position:"left",display:!0,axis:"y",border:{display:!1},min:0,ticks:{display:!0,beginAtZero:!0,maxTicksLimit:5,color:"dark"===d?"#fff":"#41495B"},title:{display:!1},grid:{display:!0,drawBorder:!1,showGridLines:!1,drawOnChartArea:!0,borderDashOffset:25,borderColor:"#d1d2db",borderWidth:0,color:"#d1d2db"}};1===a.length&&(n["chart-y-axis-1"]=r),2===a.length&&(n["chart-y-axis-1"]=r,n["chart-y-axis-2"]={position:"right",display:!0,axis:"y",border:{display:!1},min:0,ticks:{display:!0,beginAtZero:!0,maxTicksLimit:5,color:"dark"===d?"#fff":"#41495B"},title:{display:!1},grid:{display:!0,drawBorder:!1,showGridLines:!1,drawOnChartArea:!1,borderDashOffset:25,borderColor:"#d1d2db",borderWidth:0,color:"#d1d2db"}}),t=n}return ty(ty({},e),t)};(0,e.useEffect)((function(){u(v())}),[]),(0,e.useEffect)((function(){u(v())}),[d,a]);var m={maintainAspectRatio:!1,scales:c,elements:{line:{tension:.3},point:{radius:0}},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!1},filler:{propagate:!1},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{title:function(e){var t=r.labels[e[0].dataIndex];return t.includes(":")?t:"list"===(null==r?void 0:r.filter)?g()(t).format("dddd, MMM D"):"weekly"===(null==r?void 0:r.filter)?g()(t).format("DD MMM YY")+" "+fbox_admin_js_object.langs.TO+" "+g()(t).add(6,"day").format("DD MMM YY"):t},label:function(e){var t,n,r,a=parseFloat(e.raw),i=e.dataset.label;if(null!==(t=Us[i])&&void 0!==t&&t.locked)return"";var o=Us[i].label;"conversionrate"===i&&(a=Xm({num:a,decimalPoints:!0})),a=0!==a?a.toLocaleString("en-US"):a;var l=(null===(n=Us[i])||void 0===n?void 0:n.suffix)||"",s=(null===(r=Us[i])||void 0===r?void 0:r.prefix)||"";return s?a=s+a:l&&(a+=l)," "+a+" "+o},afterLabel:function(e){var t,n=e.dataset.label;if("revenue"===n&&(null===(t=Us[n])||void 0===t||!t.locked)&&r.revenue_breakdown){var a,i=(null===(a=fbox_admin_js_object)||void 0===a?void 0:a.revenue_attribution_currency)||"$",o=r.labels[e.dataIndex],l=r.revenue_breakdown[o];if(l){var s=l.view_through_revenue,c=l.conversion_through_revenue,u=[];if(s>0){var f=s.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});u.push("View-Through: ".concat(i).concat(f))}if(c>0){var d=c.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});u.push("Conversion-Through: ".concat(i).concat(d))}return u}}return[]}}}}};return t().createElement("div",{className:"flex flex-col gap-2 flex-grow justify-between"},0===o.labels.length?t().createElement(Zs,null):t().createElement(t().Fragment,null,t().createElement("div",null,t().createElement(Km,{selectedChartMetrics:a}),t().createElement("div",{className:"relative"},t().createElement("div",null,t().createElement(Ym,{type:"line",data:o,options:m,plugins:[{afterDatasetsDraw:function(e){var t,n,r;if(null!=e&&null!==(t=e.tooltip)&&void 0!==t&&t._active&&null!=e&&null!==(n=e.tooltip)&&void 0!==n&&null!==(r=n._active)&&void 0!==r&&r.length){var a=e.scales["chart-y-axis-1"]?"chart-y-axis-1":"y",i=e.tooltip._active[0],o=e.ctx,l=i.element.x,s=e.scales[a].top,c=e.scales[a].bottom;o.save(),o.beginPath(),o.moveTo(l,s),o.lineTo(l,c),o.setLineDash([1,1]),o.lineWidth=2,o.strokeStyle="#a1a1a1",o.stroke(),o.restore()}}}],key:Date.now(),style:{maxWidth:"100%"},height:336})),0===o.selectedMetricsTotalPoints&&t().createElement("div",{className:"w-full flex flex-col items-center gap-2 justify-center absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 dark:text-white"},t().createElement("svg",{width:"81",height:"80",viewBox:"0 0 81 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t().createElement("circle",{cx:"41.5",cy:"40",r:"36",fill:"#D1D4F4"}),t().createElement("path",{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M27.0432 7.01953C40.1252 7.54876 50.5683 18.3215 50.5683 31.5333C50.5683 37.589 48.3743 43.1323 44.7379 47.4116L46.8613 49.5349C47.9768 49.001 49.354 49.1962 50.2782 50.1204L66.2755 66.1177C64.3226 67.9708 62.1621 69.6072 59.8324 70.9883L44.6213 55.7772C43.6983 54.8541 43.5025 53.4792 44.0339 52.3645L41.9092 50.2398C37.6304 53.8746 32.0884 56.0675 26.0342 56.0675C17.7197 56.0675 10.3712 51.9315 5.93383 45.6047C5.64824 43.7781 5.5 41.9059 5.5 39.9992C5.5 38.3617 5.60933 36.7497 5.82108 35.1702C7.53793 44.7761 15.9346 52.0675 26.0342 52.0675C37.3749 52.0675 46.5683 42.874 46.5683 31.5333C46.5683 20.1926 37.3749 10.9992 26.0342 10.9992C23.2676 10.9992 20.6289 11.5463 18.2202 12.5382C20.8611 10.2972 23.8294 8.43036 27.0432 7.01953Z",fill:"#41495B"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.9373 43.4396C41.7184 42.6586 42.9847 42.6586 43.7658 43.4396L57.9079 57.5817C58.689 58.3628 58.689 59.6291 57.9079 60.4102C57.1269 61.1912 55.8605 61.1912 55.0795 60.4101L40.9373 46.268C40.1563 45.487 40.1563 44.2206 40.9373 43.4396Z",fill:"#41495B"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M61.6675 69.8244L44.6209 52.7777C43.4493 51.6061 43.4493 49.7067 44.6209 48.5351L46.0351 47.1209C47.2067 45.9493 49.1061 45.9493 50.2777 47.1209L67.7705 64.6136C65.939 66.5676 63.892 68.3172 61.6675 69.8244Z",fill:"#F5CE81"}),t().createElement("path",{d:"M48.5683 28.5342C48.5683 40.9794 38.4794 51.0683 26.0342 51.0683C13.5889 51.0683 3.5 40.9794 3.5 28.5342C3.5 16.0889 13.5889 6 26.0342 6C38.4794 6 48.5683 16.0889 48.5683 28.5342Z",fill:"#F4F5FE"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.0342 8C14.6935 8 5.5 17.1935 5.5 28.5342C5.5 39.8749 14.6935 49.0683 26.0342 49.0683C37.3749 49.0683 46.5683 39.8749 46.5683 28.5342C46.5683 17.1935 37.3749 8 26.0342 8ZM1.5 28.5342C1.5 14.9843 12.4843 4 26.0342 4C39.584 4 50.5683 14.9843 50.5683 28.5342C50.5683 42.084 39.584 53.0683 26.0342 53.0683C12.4843 53.0683 1.5 42.084 1.5 28.5342Z",fill:"#050931"}),t().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26 14C17.9919 14 11.5 20.4919 11.5 28.5C11.5 29.6046 10.6046 30.5 9.5 30.5C8.39543 30.5 7.5 29.6046 7.5 28.5C7.5 18.2827 15.7827 10 26 10C27.1046 10 28 10.8954 28 12C28 13.1046 27.1046 14 26 14Z",fill:"white"})),t().createElement("div",null,fbox_admin_js_object.langs.NO," ",a.map((function(e){return Us[e].label})).join(", ")," ",fbox_admin_js_object.langs.DATA_AVAILABLE,"."))))))}));const oy=iy;var ly=(0,e.memo)((function(t){var n=t.isLoading,r=t.filter,a=t.performanceChartFiltersItems,i=t.showChartFiltersDropdown,o=t.setShowChartFiltersDropdown,l=t.toggleIsOpen,s=t.selectFilter,c=(0,e.useRef)("Performance_dropdownRef");return _s(c,(function(){o(!1)})),(Object.keys(a).length>0||i)&&!n&&React.createElement("div",{className:"relative flex-shrink-0 dark:text-grey-3",ref:c},React.createElement("span",{className:"inline-flex items-center whitespace-nowrap cursor-pointer hover:text-black dark:hover:text-white",onClick:l},Ks[r],React.createElement(ws,{className:i?"rotate-180":""})),i&&React.createElement("div",{className:"absolute z-20 top-full text-base right-0 rounded-[4px] shadow-box bg-white dark:bg-[#343d43] flex flex-col"},Object.keys(a).map((function(e,t){return React.createElement("div",{key:t,className:"p-1 pr-2 cursor-pointer ".concat(r===e?"pointer-events-none bg-pale-blue dark:bg-white dark:text-black":"bg-white hover:bg-pale-blue dark:bg-transparent dark:hover:bg-pale-blue dark:hover:text-black"),onClick:function(){return s(e)}},a[e])}))))}));const sy=ly;var cy=function(e){return e||"__all_templates__"};const uy=function(e){var t=e.onRetry,n=e.className,r=void 0===n?"":n,a=fbox_admin_js_object.langs||{};return React.createElement("div",{className:"flex flex-col items-center justify-center gap-1 flex-grow text-center ".concat(r)},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-gray-400 dark:text-gray-500"},React.createElement("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),React.createElement("path",{d:"M12 7.5v5M12 16h.01",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})),React.createElement("span",{className:"text-sm text-gray-600 dark:text-gray-300"},a.COULDNT_LOAD_DATA),t&&React.createElement("button",{type:"button",onClick:t,className:"bg-transparent border-0 p-0 cursor-pointer text-sm text-accent hover:underline"},a.TRY_AGAIN))};var fy=(0,e.memo)((function(e){var t=e.children,n=e.fontSize,r=void 0===n?"text-[12px]":n,a=e.size,i=void 0===a?"w-[150px]":a,o=e.textAlign,l=void 0===o?"text-center":o,s=e.padding,c=void 0===s?"p-1":s,u=e.top,f=void 0===u?"top-[calc(100%+8px)]":u,d=e.className,h=void 0===d?"":d;return React.createElement("div",{className:"absolute opacity-0 -z-10 pointer-events-none ".concat(f," group-hover:opacity-100 group-hover:z-30 group-hover:pointer-events-auto shadow-lg ").concat(l," bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 ").concat(c," rounded text-gray-800 dark:text-white ").concat(r," ").concat(i).concat(""!==h?" "+h:" left-1/2 translate-x-[-50%]")},t)}));const dy=fy;function hy(){return hy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hy.apply(this,arguments)}function py(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const vy=function(n){var r,a,i=n.upgradePlan,o=void 0===i?"":i,l=n.feature,s=void 0===l?"":l,c=n.className,u=void 0===c?"":c,f=n.label,d=void 0===f?"":f,h=n.size,p=void 0===h?"text-[12px]":h,v=n.showLabel,m=void 0!==v&&v,y=n.iconSize,g=void 0===y?10:y,b=n.disableHoverReveal,x=void 0!==b&&b,_=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return py(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?py(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),w=_[0],k=_[1],S="fpf-modal-opener inline-flex cursor-pointer items-center gap-0 rounded-full border border-amber-200 bg-amber-50 px-1.5 py-0.5 font-medium leading-none text-amber-700 z-10 ".concat(p),O=u?"".concat(S," ").concat(u):"relative ".concat(S),E="Available in ".concat(o," plan"),A={"data-fpf-modal":"#fireboxUpgradeToPlan","data-fpf-modal-item":s,"data-current-plan":(null===(r=fbox_admin_js_object)||void 0===r?void 0:r.license_plan)||(null===(a=fbox_admin_js_object)||void 0===a?void 0:a.license_type)||"basic","data-upgrade-plan":o};return t().createElement("span",hy({className:O,"aria-label":"Locked • ".concat(E),title:E},A,{onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)}}),t().createElement("svg",{width:g,height:g,viewBox:"0 0 24 24",className:"fill-current","aria-hidden":"true",focusable:"false"},t().createElement("path",{d:"M6 10V8a6 6 0 1112 0v2h1a1 1 0 011 1v9a1 1 0 01-1 1H5a1 1 0 01-1-1v-9a1 1 0 011-1h1zm2 0h8V8a4 4 0 10-8 0v2z"})),d||o?m?t().createElement("span",{className:"pl-1"},d||o):t().createElement("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-out ".concat(!x&&w?"pl-1 max-w-[10rem] opacity-100":"pl-0 max-w-0 opacity-0")},d||o):null)},my=function(e){var t,n,r,a=e.slug,i=e.lockedPlan,o=e.numberClass,l=e.label,s=e.value,c=e.previousPeriodValue,u=e.prefix,f=void 0===u?"":u,d=e.suffix,h=void 0===d?"":d,p=e.formatSuffix,v=e.decimalPoints,m=void 0===v||v,y=e.tooltipMessage,g=e.showCheckbox,b=void 0!==g&&g,x=e.isSelected,_=void 0!==x&&x,w=e.onToggle,k=e.isClickable,S=void 0!==k&&k,O=function(){return React.createElement(React.Fragment,null,Xm({num:s,showSuffix:p,decimalPoints:m}),null!=h?h:"")},E=(t=parseFloat(s)||0,0===(n=parseFloat(c)||0)?t>0?100:null:(t-n)/n*100);return React.createElement("div",{className:"flex flex-col"},React.createElement("div",{className:"flex items-center gap-[4px] relative".concat(S?" cursor-pointer":""),onClick:S?w:void 0},b&&React.createElement("div",{className:"".concat(S?"":"opacity-50 cursor-not-allowed")},React.createElement("div",{className:"w-[16px] h-[16px] flex-shrink-0 border border-solid rounded flex items-center justify-center transition-all ".concat(_?"".concat(function(){var e="";switch(a){case"views":e="bg-metric-views";break;case"clicks":e="bg-metric-clicks";break;case"conversions":e="bg-metric-conversions";break;case"conversionrate":e="bg-metric-conversion-rate";break;case"revenue":e="bg-metric-revenue"}return e}()," border-transparent"):"bg-white dark:bg-dark-1 border-gray-400 hover:border-gray-700")},_&&React.createElement("svg",{width:"10",height:"7",viewBox:"0 0 12 9",fill:"none",className:"text-white"},React.createElement("path",{d:"M1 4.5L4 7.5L11 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))),React.createElement("span",{className:"flex gap-[4px] text-sm text-gray-700 dark:text-gray-200 relative"},React.createElement("span",{className:"group/metriclabel"},l,y&&React.createElement("div",{className:"cursor-default",onClick:function(e){return!i&&e.stopPropagation()},onMouseDown:function(e){return!i&&e.stopPropagation()},onMouseUp:function(e){return!i&&e.stopPropagation()}},React.createElement(dy,{size:"w-[300px]",fontSize:"text-[14px]",textAlign:"text-left",padding:"p-2",top:"top-full",className:"left-0 right-auto translate-x-0 hidden group-hover/metriclabel:flex flex-col"},y))),i&&React.createElement(vy,{feature:l,upgradePlan:i,disableHoverReveal:!0}))),React.createElement("div",{className:"font-bold mt-1 text-gray-900 dark:text-white".concat(o?" "+o:""),style:{fontSize:"26px",lineHeight:"1.2"},title:(r=new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:m?2:0,maximumFractionDigits:m?2:0}).format(s||0),(null!=f?f:"")+r+(null!=h?h:""))},null!=e&&e.formatNumberLayout?e.formatNumberLayout({num:s,suffix:h,showSuffix:p,decimalPoints:m,defaultLayout:O}):O()),null!==E&&React.createElement("div",{className:"flex items-center gap-[4px] font-medium ".concat(E>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),style:{fontSize:"12px"}},React.createElement("span",null,E>=0?"+":"",E.toFixed(1),"%"),E>=0?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",class:"w-[12px] h-[12px] text-green-500 dark:text-green-600 rotate-180","stroke-width":"2"},React.createElement("path",{"fill-rule":"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v8.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.22 3.22V2.75A.75.75 0 0 1 8 2Z","clip-rule":"evenodd"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",class:"w-[12px] h-[12px] text-red-500 dark:text-red-700 ","stroke-width":"2"},React.createElement("path",{"fill-rule":"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v8.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.22 3.22V2.75A.75.75 0 0 1 8 2Z","clip-rule":"evenodd"}))))};var yy=["overall"];function gy(){return gy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gy.apply(this,arguments)}var by=(0,e.memo)((function(e){var t=e.overall,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,yy);return React.createElement(my,gy({label:fbox_admin_js_object.langs.VIEWS,value:t.current.views||0,previousPeriodValue:t.previous.views||0,tooltipMessage:React.createElement(React.Fragment,null,React.createElement("div",null,fbox_admin_js_object.langs.VIEWS_TOOLTIP_DESC),React.createElement("div",{className:"mt-1"},React.createElement("a",{href:"https://www.fireplugins.com/docs/analytics/analytics/?utm_source=product&utm_campaign=firebox-".concat("lite"===fbox_admin_js_object.license_type?"free":"pro","&utm_content=misc&utm_medium=analytics-views#Views"),target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-dark-1 dark:hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase()))),slug:"views"},n))}));const xy=by;var _y=["overall"];function wy(){return wy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wy.apply(this,arguments)}var ky=(0,e.memo)((function(e){var t=e.overall,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,_y);return React.createElement(my,wy({label:fbox_admin_js_object.langs.CONVERSIONS,value:t.current.conversions||0,previousPeriodValue:t.previous.conversions||0,tooltipMessage:React.createElement(React.Fragment,null,React.createElement("div",null,fbox_admin_js_object.langs.CONVERSIONS_TOOLTIP_DESC),React.createElement("div",{className:"mt-1"},React.createElement("a",{href:"https://www.fireplugins.com/docs/analytics/analytics/?utm_source=product&utm_campaign=firebox-".concat("lite"===fbox_admin_js_object.license_type?"free":"pro","&utm_content=misc&utm_medium=analytics-conversions#Conversions"),target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-dark-1 dark:hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase()))),slug:"conversions"},n))}));const Sy=ky;var Oy=["overall"];function Ey(){return Ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ey.apply(this,arguments)}var Ay=(0,e.memo)((function(e){var t=e.overall,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,Oy);return React.createElement(my,Ey({label:"CVR",value:t.current.conversionrate||fbox_admin_js_object.langs["N/A"],previousPeriodValue:t.previous.conversionrate||0,formatNumberLayout:function(e){var t,n,r,a=e.num;return e.suffix,e.showSuffix,e.decimalPoints,e.defaultLayout,a===fbox_admin_js_object.langs["N/A"]?fbox_admin_js_object.langs["N/A"]:(n=Xm({num:t=a,showSuffix:!1,decimalPoints:!0})+"%",r=Xm({num:t,showSuffix:!1,decimalPoints:!0})+"%",React.createElement("span",{title:r},n))},suffix:"%",formatSuffix:!1,tooltipMessage:React.createElement(React.Fragment,null,React.createElement("div",null,fbox_admin_js_object.langs.CONVERSION_RATE_TOOLTIP_DESC),React.createElement("div",{className:"mt-1"},React.createElement("a",{href:"https://www.fireplugins.com/docs/analytics/analytics/?utm_source=product&utm_campaign=firebox-".concat("lite"===fbox_admin_js_object.license_type?"free":"pro","&utm_content=misc&utm_medium=analytics-conversion-rate#Conversion-Rate"),target:"_blank",className:"text-[#888] no-underline font-semibold hover:text-dark-1 dark:hover:text-white"},fbox_admin_js_object.langs.READ_MORE.toUpperCase()))),slug:"conversionrate"},n))}));const Cy=Ay;function jy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jy(Object(n),!0).forEach((function(t){My(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function My(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Py(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||Ry(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ry(e,t){if(e){if("string"==typeof e)return Iy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Iy(e,t):void 0}}function Iy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ly={labels:[],data:{views:[],clicks:[],conversions:[],conversionrate:[],revenue:[]},days_between:null};const Ny=function(){var n,r,a,i,o=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},l=Py((0,e.useState)([]),2),s=l[0],c=l[1],f=Py((0,e.useState)(!0),2),d=f[0],h=f[1],v=Py((0,e.useState)(!1),2),m=v[0],y=v[1],g=Py((0,e.useState)(!1),2),b=g[0],x=g[1],_=Py((0,e.useState)(!1),2),w=_[0],k=_[1],S=Py((0,e.useState)(Ks),2),O=S[0],E=S[1],A=Py((0,e.useState)(!1),2),C=A[0],j=A[1],D=Py((0,e.useState)("list"),2),M=D[0],P=D[1],R=Py((0,e.useState)((null==o?void 0:o.performanceFilters)||["views"]),2),I=R[0],L=R[1],N=Py((0,e.useState)(Ly),2),T=N[0],F=N[1],z=Py((0,e.useState)({current:{},previous:{}}),2),H=z[0],V=z[1],W=p(),$=W.components,B=(W.loading,t().createRef()),Y=u(),U=Y.date_period,G=Y.custom_date_period,q=Y.selected_campaign,Z=["views","clicks","conversions","conversionrate","revenue"],K=function(){var e,t,n,r=Ss(U,G),a=r.start_date,i=r.end_date,o=Math.round((Date.parse(i)-Date.parse(a))/864e5);if(n=o<30?{}:o<90?{list:fbox_admin_js_object.langs.DAILY,weekly:fbox_admin_js_object.langs.WEEKLY}:Ks,E(o<30?[]:n),"list"===M||n.hasOwnProperty(M)){if(!["today","custom"].includes(U)&&null!=s&&null!==(e=s[cy(q)])&&void 0!==e&&null!==(t=e[U])&&void 0!==t&&t[M]){var l=s[cy(q)][U][M];return F(l.chartData),V(l.overallData),k(!1),void h(!1)}var u=new FormData;u.append("nonce",fpf_js_object.nonce),u.append("action","firebox_analytics_get_charts_data"),u.append("start_date",a),u.append("end_date",i),u.append("selected_campaign",q),u.append("filter",M);var f=new FormData;f.append("nonce",fpf_js_object.nonce),f.append("action","firebox_analytics_stats"),f.append("date_period",U),f.append("start_date",a),f.append("end_date",i),f.append("selected_campaign",q),y(!1),Promise.all([Ms(u),Ms(f)]).then((function(e){var t=Py(e,2),n=t[0],r=t[1],a=n,i=r;Object.keys(a.data).map((function(e){a.data[e]=1===o?$s(a.labels,a.data[e]):Ws(a.labels,a.data[e])})),a.filter=M,F(a),V(i),k(!1),h(!1),["today","custom"].includes(U)||c((function(e){var t,n=cy(q);return Dy(Dy({},e),{},My({},n,Dy(Dy({},e[n]),{},My({},U,Dy(Dy({},null===(t=e[n])||void 0===t?void 0:t[U]),{},My({},M,{chartData:a,overallData:i}))))))}))})).catch((function(e){console.error("Performance fetch error:",e),k(!1),h(!1),y(!0)}))}else P("list")};xs((function(){K(),x(!0)}),B),(0,e.useEffect)((function(){b&&(h(!0),K())}),[q,M]),(0,e.useEffect)((function(){b&&"custom"===U&&(2===G.length&&(null===G[0]||null===G[1])||(h(!0),K()))}),[G]),(0,e.useEffect)((function(){b&&"custom"!==U&&(h(!0),K())}),[U]);var X,J=(0,e.useCallback)((function(e){if(Z.includes(e)){var t=function(e){return function(e){if(Array.isArray(e))return Iy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ry(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(I),n=t.indexOf(e);-1!==n?t.splice(n,1):t.push(e);var r=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};r.performanceFilters=t,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(r)),0!==t.length&&L(t)}}),[I,Z]),Q=(0,e.useCallback)((function(){j((function(e){return!e}))}),[]),ee=(0,e.useCallback)((function(e){j(!1),k(!0),P(e)}),[M]),te=(0,e.useCallback)((function(e){Z.includes(e)&&J(e)}),[J,Z]);return m?t().createElement("div",{ref:B,className:"relative group flex flex-col gap-3 bg-white dark:bg-dark-1 rounded p-3 h-auto"},t().createElement(uy,{onRetry:function(){h(!0),K()},className:"min-h-[240px]"})):t().createElement("div",{ref:B,className:"relative group flex flex-col gap-3 bg-white dark:bg-dark-1 rounded p-3 h-auto"},t().createElement("div",{className:"flex flex-wrap items-start justify-between gap-3"},t().createElement("div",{className:"flex flex-1 flex-wrap items-start min-w-0 divide-solid"},(X=function(){var e,n;if(d&&(null==s||null===(e=s[cy(q)])||void 0===e||null===(n=e[U])||void 0===n||!n[M]))return t().createElement("div",{className:"flex flex-wrap gap-3"},Array.from({length:7},(function(e,n){return t().createElement("div",{key:"skeleton-".concat(n),className:"flex flex-col gap-1"},t().createElement("div",{className:"flex items-center gap-[4px]"},t().createElement("div",{className:"animate-pulse h-[16px] w-[16px] bg-slate-200 dark:bg-slate-700 rounded-sm"}),t().createElement("div",{className:"animate-pulse h-[16px] w-16 bg-slate-200 dark:bg-slate-700 rounded"})),t().createElement("div",{className:"animate-pulse h-3 w-12 bg-slate-200 dark:bg-slate-700 rounded"}),t().createElement("div",{className:"animate-pulse h-2 w-8 bg-slate-200 dark:bg-slate-700 rounded"}))})));var r=[];return r.push(t().createElement(xy,{key:"views",overall:H,showCheckbox:!0,isSelected:I.includes("views"),onToggle:function(){return te("views")},isClickable:!0})),null!=$&&$.Revenue&&r.push(t().createElement($.Revenue,{key:"revenue",overall:H,showCheckbox:!0,isSelected:I.includes("revenue"),onToggle:function(){return te("revenue")}})),null!=$&&$.Clicks&&r.push(t().createElement($.Clicks,{key:"clicks",overall:H,showCheckbox:!0,isSelected:I.includes("clicks"),onToggle:function(){return te("clicks")}})),r.push(t().createElement(Sy,{key:"conversions",overall:H,showCheckbox:!0,isSelected:I.includes("conversions"),onToggle:function(){return te("conversions")},isClickable:!0})),r.push(t().createElement(Cy,{key:"conversionrate",overall:H,showCheckbox:!0,isSelected:I.includes("conversionrate"),onToggle:function(){return te("conversionrate")},isClickable:!0})),null!=$&&$.ViewThroughRevenue&&r.push(t().createElement($.ViewThroughRevenue,{key:"view_through_revenue",overall:H})),null!=$&&$.ClickThroughRevenue&&r.push(t().createElement($.ClickThroughRevenue,{key:"conversion_through_revenue",overall:H})),r.map((function(e,n){return t().createElement("div",{key:n,className:"".concat(n>0?"pl-3 ml-3 border-l border-t-0 border-r-0 border-b-0 border-gray-200 dark:border-gray-600":"")},e)}))}(),X)),t().createElement(sy,{isLoading:d,filter:M,performanceChartFiltersItems:O,showChartFiltersDropdown:C,setShowChartFiltersDropdown:j,toggleIsOpen:Q,selectFilter:ee})),t().createElement("div",{className:"flex flex-col gap-3"},(!d||null!=s&&null!==(n=s[cy(q)])&&void 0!==n&&null!==(r=n[U])&&void 0!==r&&r[M])&&(!w||null!=s&&null!==(a=s[cy(q)])&&void 0!==a&&null!==(i=a[U])&&void 0!==i&&i[M])?t().createElement(oy,{charts:T,selectedChartMetrics:I}):t().createElement(Zs,null)))};function Ty(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Fy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fy(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zy=(0,e.createContext)(),Hy=function(n){var r=n.children,a=Ty((0,e.useState)({current:{views:null,conversions:null,conversionrate:null,revenue:null,view_through_revenue:null,conversion_through_revenue:null},previous:{views:null,conversions:null,conversionrate:null,revenue:null,view_through_revenue:null,conversion_through_revenue:null}}),2),i=a[0],o=a[1],l=Ty((0,e.useState)(!0),2),s=l[0],c=l[1];return t().createElement(zy.Provider,{value:{overallData:i,setOverallData:o,isLoading:s,setIsLoading:c}},r)};const Vy=(0,e.memo)((function(){var e=u().campaign;return React.createElement("div",{className:"group relative bg-white dark:bg-dark-1 rounded p-3 flex flex-col gap-3 dark:text-white"},React.createElement("div",{className:"flex gap-1 justify-between"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.CAMPAIGN_INFO),e&&React.createElement("a",{href:fbox_admin_js_object.campaigns_item_edit_url.replace("{{ID}}",e.ID),className:"inline-flex text-base items-center gap-1 underline text-accent hover:text-accent-hover dark:text-grey-1 dark:hover:text-white"},fbox_admin_js_object.langs.EDIT_CAMPAIGN)),!1===e?React.createElement("div",{className:"flex flex-grow items-center justify-center text-sm text-default dark:text-grey-1"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE):null===e?React.createElement("div",{className:"flex flex-col gap-2"},React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-[29px] w-full bg-slate-200 dark:bg-slate-700 rounded"})):React.createElement("div",{className:"grid grid-rows-6 flex-grow max-h-[256px] gap-2"},React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.STATUS,":"),React.createElement("span",{className:"".concat("publish"===e.post_status?"text-custom-green font-bold":"text-grey-1")},"publish"===e.post_status?fbox_admin_js_object.langs.ACTIVE:fbox_admin_js_object.langs.DISABLED)),React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.CREATED,":"),React.createElement("span",null,g()(e.post_date).format("ddd. D MMM YYYY, HH:mm"))),React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.LAST_VIEWED,":"),React.createElement("span",null,null!=e&&e.last_date_viewed?g()(e.last_date_viewed).format("ddd. D MMM YYYY, HH:mm"):fbox_admin_js_object.langs["N/A"])),React.createElement("div",{className:"flex justify-between items-center gap-1"},React.createElement("span",null,fbox_admin_js_object.langs.ID,":"),React.createElement("span",null,e.ID))))})),Wy=function(){return React.createElement("div",{className:"flex gap-1 flex-grow flex-wrap-reverse overflow-hidden"},React.createElement("div",{className:"animate-pulse w-2 h-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-4 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-0 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-6 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-5 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-0 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-4 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-4 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-0 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-2 h-6 bg-slate-200 dark:bg-slate-700 rounded"}))};function $y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}rv.register(sm,fm,kv,Yv,om,$v);var By=(0,e.memo)((function(t){var n=t.labels,r=t.data,a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(qs()),2),i=a[0],o=a[1];(0,e.useEffect)((function(){var e=function(){o(qs())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var l={maintainAspectRatio:!1,scales:{x:{ticks:{color:"dark"===i?"#fff":"#41495B",maxTicksLimit:9},grid:{drawBorder:!1,display:!1},border:{display:!1}},y:{ticks:{maxTicksLimit:5,display:!1,beginAtZero:!0},grid:{color:"dark"===i?"#E1E1E1":"#d1d2db",drawBorder:!1,display:!0},border:{display:!1}}},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{label:function(e){var t=parseFloat(e.raw),n=Us.views.label;return" "+(t=0!==t?t.toLocaleString("en-US"):t)+" "+n}}}}},s={labels:n,datasets:[{data:r,borderRadius:8,backgroundColor:"#5383EC"}]},c=(null==r?void 0:r.reduce((function(e,t){return e+t}),0))||0;return React.createElement(React.Fragment,null,null!==r?React.createElement("div",{className:"relative"},React.createElement(qm,{options:l,data:s,key:Date.now(),height:256}),0===c&&React.createElement("div",{className:"absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-center text-default dark:text-white text-sm"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE)):React.createElement(Wy,null))}));const Yy=By;function Uy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Gy=(0,e.memo)((function(t){var n=t.isLoading,r=void 0!==n&&n,a=t.filter,i=t.setFilterHandler,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Uy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uy(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),l=o[0],s=o[1],c=(0,e.useRef)("Filters_PopularViewTimes");_s(c,(function(){s(!1)}));var u={all_days:fbox_admin_js_object.langs.ALL_DAYS,monday:fbox_admin_js_object.langs.MONDAY,tuesday:fbox_admin_js_object.langs.TUESDAY,wednesday:fbox_admin_js_object.langs.WEDNESDAY,thursday:fbox_admin_js_object.langs.THURSDAY,friday:fbox_admin_js_object.langs.FRIDAY,saturday:fbox_admin_js_object.langs.SATURDAY,sunday:fbox_admin_js_object.langs.SUNDAY};return React.createElement("div",{ref:c,className:"relative dark:text-grey-3".concat(r?" pointer-events-none opacity-50":""),onClick:function(){return s(!l)}},React.createElement("div",{className:"inline-flex items-center cursor-pointer hover:text-black dark:hover:text-white text-black dark:text-white"},u[a],React.createElement(ws,null)),l&&React.createElement("div",{className:"absolute z-20 text-base top-full right-0 rounded-[4px] shadow-box bg-white dark:bg-[#343d43] flex flex-col"},Object.keys(u).map((function(e,t){return React.createElement("div",{key:t,onClick:function(){return i(e)},className:"p-1 pr-2 cursor-pointer ".concat(a===e?"pointer-events-none bg-pale-blue dark:bg-white dark:text-black":"bg-white hover:bg-pale-blue dark:bg-transparent dark:hover:bg-pale-blue dark:hover:text-black")},u[e])}))))}));const qy=Gy,Zy=function(e){var t=e.className,n=void 0===t?"":t;return React.createElement("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24"},React.createElement("path",{d:"M252.309-100.001q-29.923 0-51.115-21.193-21.193-21.192-21.193-51.115v-375.382q0-29.923 21.193-51.115 21.192-21.193 51.115-21.193h47.692v-80q0-74.922 52.538-127.46Q405.078-879.997 480-879.997t127.461 52.538q52.538 52.538 52.538 127.46v80h47.692q29.923 0 51.115 21.193 21.193 21.192 21.193 51.115v375.382q0 29.923-21.193 51.115-21.192 21.193-51.115 21.193H252.309Zm0-59.999h455.382q5.385 0 8.847-3.462 3.462-3.462 3.462-8.847v-375.382q0-5.385-3.462-8.847-3.462-3.462-8.847-3.462H252.309q-5.385 0-8.847 3.462-3.462 3.462-3.462 8.847v375.382q0 5.385 3.462 8.847 3.462 3.462 8.847 3.462ZM480-290.001q29.154 0 49.576-20.423 20.423-20.422 20.423-49.576t-20.423-49.576Q509.154-429.999 480-429.999t-49.576 20.423Q410.001-389.154 410.001-360t20.423 49.576q20.422 20.423 49.576 20.423ZM360-619.999h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80ZM240-160v-400 400Z",fill:"currentColor"}))},Ky=function(e){var t=e.className,n=void 0===t?"":t;return React.createElement("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24"},React.createElement("path",{d:"M252.309-619.999H600v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85h-59.999q0-74.922 52.538-127.46Q405.078-879.997 480-879.997t127.461 52.538q52.538 52.538 52.538 127.46v80h47.692q29.923 0 51.115 21.193 21.193 21.192 21.193 51.115v375.382q0 29.923-21.193 51.115-21.192 21.193-51.115 21.193H252.309q-29.923 0-51.115-21.193-21.193-21.192-21.193-51.115v-375.382q0-29.923 21.193-51.115 21.192-21.193 51.115-21.193Zm0 459.999h455.382q5.385 0 8.847-3.462 3.462-3.462 3.462-8.847v-375.382q0-5.385-3.462-8.847-3.462-3.462-8.847-3.462H252.309q-5.385 0-8.847 3.462-3.462 3.462-3.462 8.847v375.382q0 5.385 3.462 8.847 3.462 3.462 8.847 3.462ZM480-290.001q29.154 0 49.576-20.423 20.423-20.422 20.423-49.576t-20.423-49.576Q509.154-429.999 480-429.999t-49.576 20.423Q410.001-389.154 410.001-360t20.423 49.576q20.422 20.423 49.576 20.423ZM240-160v-400 400Z",fill:"currentColor"}))},Xy=function(e){var t=e.label,n=e.type,r=void 0===n?"":n,a=e.currentPlan,i=void 0===a?fbox_admin_js_object.license_plan:a,o=e.upgradePlan,l=void 0===o?fbox_admin_js_object.langs.PRO:o,s=e.className,c=void 0===s?"":s,u="text-grey-1 hover:text-custom-red",f="fpfUpgradeToPro";return"upgrade"===r&&(u="bg-custom-red hover:bg-custom-red-dark text-white py-1.5 px-3 font-bold flex rounded",f="fireboxUpgradeToPlan"),React.createElement("a",{href:"#",className:"group/icon shadow-none outline-none inline-flex items-center justify-center gap-1 no-underline ".concat(u," fpf-modal-opener").concat(c?" "+c:""),"data-fpf-modal":"#".concat(f),"data-fpf-modal-item":t,"data-current-plan":i[0].toUpperCase()+i.slice(1),"data-upgrade-plan":l},wp.i18n.sprintf(fbox_admin_js_object.langs.UPGRADE_TO_X,l),React.createElement(Zy,{className:"inline-flex group-hover/icon:hidden","aria-hidden":"true"}),React.createElement(Ky,{className:"hidden group-hover/icon:inline-flex","aria-hidden":"true"}))};function Jy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jy(Object(n),!0).forEach((function(t){eg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ng(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const rg=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=tg((0,e.useState)([]),2),r=n[0],a=n[1],i=tg((0,e.useState)(!1),2),o=i[0],l=i[1],s=tg((0,e.useState)(!1),2),c=s[0],f=s[1],d=tg((0,e.useState)(!1),2),h=d[0],p=d[1],v=tg((0,e.useState)(null),2),m=v[0],y=v[1],g=tg((0,e.useState)((null==t?void 0:t.viewHoursFilter)||"all_days"),2),b=g[0],x=g[1],_=tg((0,e.useState)(function(){for(var e=[],t=0;t<=23;t++){var n=t.toString().padStart(2,"0");e.push("".concat(n,":00"))}return e}()),2),w=_[0],k=(_[1],tg((0,e.useState)(0),2)),S=k[0],O=k[1],E=u(),A=E.date_period,C=E.custom_date_period,j=E.selected_campaign,D=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.viewHoursFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),x(e)}),[b]),M=function(e){var t,n;if(!["today","custom"].includes(A)&&null!=r&&null!==(t=r[cy(j)])&&void 0!==t&&null!==(n=t[A])&&void 0!==n&&n[b])return y(r[cy(j)][A][b]),l(!1),void(e&&e());var i=Ss(A,C),o=i.start_date,s=i.end_date,c=Math.round((Date.parse(s)-Date.parse(o))/864e5);O(c);var u=new FormData;if(u.append("nonce",fpf_js_object.nonce),u.append("action","firebox_analytics_get_popular_view_items"),u.append("start_date",o),u.append("end_date",s),u.append("campaign",j),"all_days"!==b){var d=!1;switch(b){case"monday":d=0;break;case"tuesday":d=1;break;case"wednesday":d=2;break;case"thursday":d=3;break;case"friday":d=4;break;case"saturday":d=5;break;case"sunday":d=6}(d||0===d)&&u.append("weekday",d)}f(!1),Ms(u).then((function(t){var n=t;if(null==t||!t.pro){var r=$s(w,t);n=(null==r?void 0:r.map((function(e){return e.total})))||[]}y(n),l(!1),["today","custom"].includes(A)||a((function(e){var t;return Qy(Qy({},e),{},eg({},cy(j),Qy(Qy({},e[cy(j)]),{},eg({},A,Qy(Qy({},null===(t=e[cy(j)])||void 0===t?void 0:t[A]),{},eg({},b,n))))))})),l(!1),e&&e()})).catch((function(e){console.error("Popular view times fetch error:",e),l(!1),f(!0)}))},P=React.createRef();return xs((function(){M(),p(!0)}),P),(0,e.useEffect)((function(){h&&(null!=m&&m.pro||(l(!0),M()))}),[j,b]),(0,e.useEffect)((function(){h&&"custom"===A&&(2===C.length&&(null===C[0]||null===C[1])||null!=m&&m.pro||(l(!0),M()))}),[C]),(0,e.useEffect)((function(){h&&"custom"!==A&&(null!=m&&m.pro||(l(!0),M()))}),[A]),React.createElement("div",{className:"relative flex flex-col gap-3 justify-between bg-white dark:bg-dark-1 rounded p-3",ref:P},React.createElement("div",{className:"flex gap-3 justify-between items-center"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.VIEW_HOURS),!c&&!(null!=m&&m.pro)&&null!==m&&S>1&&React.createElement(qy,{isLoading:o,filter:b,setFilterHandler:D})),c?React.createElement(uy,{onRetry:function(){l(!0),M()},className:"min-h-[200px]"}):null!=m&&m.pro?React.createElement(Xy,{label:fbox_admin_js_object.langs.VIEW_HOURS,className:"flex-grow"}):null!==m&&o&&h?React.createElement(Wy,null):React.createElement(Yy,{labels:w,data:m}))};function ag(e,t){if(e){if("string"==typeof e)return ig(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ig(e,t):void 0}}function ig(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}rv.register(lv,om,$v);const og=function(t){var n=t.labelIsEvent,r=void 0!==n&&n,a=t.metricConfig,i=t.data,o=t.showPieLegends,l=function(e){return function(e){if(Array.isArray(e))return ig(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ag(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(i);l=l.splice(0,30);var s=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||ag(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(qs()),2),c=s[0],u=s[1],f=l.map((function(e){return e.label})),d=["#83D2FF","#FF83CD","#B983FF","#FFB983","#83FFB9"];(0,e.useEffect)((function(){var e=function(){u(qs())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var h={labels:f,datasets:[{data:l.map((function(e){return e.total})),backgroundColor:d}]},p={maintainAspectRatio:!1,plugins:{legend:{display:o,labels:{usePointStyle:!0,color:"dark"===c?"#fff":"#41495B"},position:"bottom"},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{label:function(e){var t=Xm({num:parseFloat(e.raw),decimalPoints:(null==a?void 0:a.decimalPoints)||!1,forceDecimalPlaces:(null==a?void 0:a.forceDecimalPlaces)||!1}),n=r?e.label:(null==a?void 0:a.label)||"";t=0!==t?t.toLocaleString("en-US"):t;var i=(null==a?void 0:a.suffix)||"",o=(null==a?void 0:a.prefix)||"";return o?t=o+t:i&&(t+=i)," "+t+" "+n}}}}};return React.createElement(Zm,{className:"self-center",data:h,options:p,width:210,height:210,key:Date.now()})},lg=function(e){var t=e.labelLayout,n=void 0===t?null:t,r=e.data,a=e.metricConfig;return r.map((function(e,t){var r,i,o=e.label||fbox_admin_js_object.langs["N/A"],l=null!=e&&e.full_label?e.full_label:o,s=parseFloat(e.total)||0,c=null!==(r=null==a?void 0:a.suffix)&&void 0!==r?r:"",u=null!==(i=null==a?void 0:a.prefix)&&void 0!==i?i:"",f="";null!=a&&a.showTitleWithSuffix&&(f=Xm({num:s})+c);var d=Xm({num:s,decimalPoints:(null==a?void 0:a.decimalPoints)||!1,forceDecimalPlaces:(null==a?void 0:a.forceDecimalPlaces)||!1}),h=d;return u?h=u+d:c&&(h=d+c),React.createElement("div",{key:t,className:"flex items-center justify-between gap-2"},n?n(e):React.createElement("div",{className:"truncate",title:l},o),React.createElement("div",{className:"font-bold ".concat((null==a?void 0:a.colorClass)||""),title:f},h))}))};function sg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const cg=function(t){var n=t.metricConfig,r=t.data,a=t.height,i=void 0===a?220:a,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(qs()),2),l=o[0],s=o[1],c=r.map((function(e){return e.label})),u=r.map((function(e){return e.total}));(0,e.useEffect)((function(){var e=function(){s(qs())};return window.addEventListener("fireplugins/theme/change",e),function(){window.removeEventListener("fireplugins/theme/change",e)}}),[]);var f={maintainAspectRatio:!1,barThickness:25,scales:{x:{ticks:{color:"dark"===l?"#fff":"#41495B",maxTicksLimit:7},grid:{drawBorder:!1,display:!1},border:{display:!1}},y:{ticks:{maxTicksLimit:4,display:!1,beginAtZero:!0},grid:{color:"dark"===l?"#E1E1E1":"#d1d2db",drawBorder:!1,display:!0},border:{display:!1}}},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#343d43",padding:16,titleColor:"#999",bodyFont:{size:14},callbacks:{label:function(e){var t=Xm({num:parseFloat(e.raw),decimalPoints:(null==n?void 0:n.decimalPoints)||!1,forceDecimalPlaces:(null==n?void 0:n.forceDecimalPlaces)||!1}),r=(null==n?void 0:n.label)||"",a=(null==n?void 0:n.suffix)||"",i=(null==n?void 0:n.prefix)||"";return t=0!==t?t.toLocaleString("en-US"):t,i?t=i+t:a&&(t+=a)," "+t+" "+r}}}}},d={labels:c,datasets:[{data:u,borderRadius:8,backgroundColor:"#5383EC"}]},h=(null==r?void 0:r.reduce((function(e,t){return e+t}),0))||0;return React.createElement("div",{className:"relative"},React.createElement(qm,{options:f,data:d,key:Date.now(),height:i}),0===h&&React.createElement("div",{className:"absolute z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-center text-default dark:text-white text-sm"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE))};function ug(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ug(Object(n),!0).forEach((function(t){dg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ug(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hg=(0,e.memo)((function(e){var t,n,r,a,i=e.labelIsEvent,o=void 0!==i&&i,l=e.labelLayout,s=e.label,c=e.showMetricLabel,u=void 0===c||c,f=e.data,d=e.filter,h=e.chartType,p=e.showPieLegends,v=void 0===p||p,m=(null===(t=f[d])||void 0===t||null===(n=t.map((function(e){return parseFloat(e.total)})))||void 0===n?void 0:n.reduce((function(e,t){return e+t}),0))||0,y=fg(fg({},Us[d]),{},{decimalPoints:"conversionrate"===d||"revenue"===d,forceDecimalPlaces:"revenue"===d,showTitleWithSuffix:"conversionrate"===d});return React.createElement("div",{className:"flex flex-col gap-3 flex-grow max-h-[256px]"},"list"===h||u?React.createElement("div",{className:"flex gap-3 text-xs text-grey-1 ".concat("pie"===h?"justify-center":"justify-between")},"list"===h&&React.createElement("div",null,s),u&&React.createElement("div",{className:"list"!==h?"flex flex-grow justify-center":""},null==Us||null===(r=Us[d])||void 0===r?void 0:r.label)):"",!m||m<0?React.createElement("div",{className:"text-center py-5 text-sm dark:text-grey-1 flex items-center justify-center flex-grow"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE):"pie"===h?React.createElement("div",null,React.createElement(og,{metricConfig:y,data:f[d],labelIsEvent:o,showPieLegends:v})):"bar"===h?React.createElement(cg,{metricConfig:y,data:f[d]}):React.createElement("div",{className:"fpframework-custom-scrollbar"},React.createElement("div",{className:"flex flex-col gap-[20px] flex-grow dark:text-white overscroll-contain"},React.createElement(lg,{labelLayout:l,data:f[d],metricConfig:y}),30===(null===(a=f[d])||void 0===a?void 0:a.length)&&React.createElement("div",{className:"text-sm text-center text-gray-400 dark:text-grey-1"},fbox_admin_js_object.langs.SHOWING_TOP_30_RESULTS))))}));const pg=hg,vg=function(){return React.createElement("svg",{className:"hover:text-black dark:text-white",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("mask",{id:"mask0_511_3087",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},React.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),React.createElement("g",{mask:"url(#mask0_511_3087)"},React.createElement("path",{d:"M9.69245 21.5L9.31168 18.4538C9.04373 18.3641 8.76905 18.2384 8.48763 18.0769C8.20621 17.9153 7.9546 17.7422 7.7328 17.5576L4.91165 18.7499L2.604 14.75L5.04438 12.9058C5.0213 12.757 5.00495 12.6077 4.99533 12.4577C4.98571 12.3077 4.9809 12.1583 4.9809 12.0096C4.9809 11.8673 4.98571 11.7227 4.99533 11.5759C5.00495 11.4291 5.0213 11.2686 5.04438 11.0942L2.604 9.24998L4.91165 5.26925L7.72318 6.45195C7.96421 6.26092 8.22159 6.08623 8.4953 5.9279C8.76904 5.76955 9.03795 5.6423 9.30205 5.54615L9.69245 2.5H14.3078L14.6885 5.55578C14.9885 5.66474 15.26 5.79198 15.503 5.9375C15.7459 6.08302 15.9911 6.2545 16.2386 6.45195L19.0886 5.26925L21.3962 9.24998L18.9174 11.123C18.9533 11.2846 18.9728 11.4355 18.976 11.5759C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1359 18.9776 12.274 18.9712 12.4144C18.9648 12.5548 18.9417 12.7154 18.902 12.8962L21.3616 14.75L19.0539 18.7499L16.2386 17.548C15.9911 17.7455 15.7386 17.9201 15.4809 18.0721C15.2232 18.224 14.959 18.348 14.6885 18.4442L14.3078 21.5H9.69245ZM12.0116 15C12.8437 15 13.5517 14.708 14.1357 14.124C14.7196 13.54 15.0116 12.832 15.0116 12C15.0116 11.1679 14.7196 10.4599 14.1357 9.87595C13.5517 9.29198 12.8437 9 12.0116 9C11.1693 9 10.4588 9.29198 9.87993 9.87595C9.3011 10.4599 9.01168 11.1679 9.01168 12C9.01168 12.832 9.3011 13.54 9.87993 14.124C10.4588 14.708 11.1693 15 12.0116 15ZM12.0116 13.5C11.595 13.5 11.2408 13.3541 10.9491 13.0625C10.6575 12.7708 10.5116 12.4166 10.5116 12C10.5116 11.5833 10.6575 11.2291 10.9491 10.9375C11.2408 10.6458 11.595 10.5 12.0116 10.5C12.4283 10.5 12.7825 10.6458 13.0741 10.9375C13.3658 11.2291 13.5116 11.5833 13.5116 12C13.5116 12.4166 13.3658 12.7708 13.0741 13.0625C12.7825 13.3541 12.4283 13.5 12.0116 13.5ZM11.0001 20H12.9655L13.3251 17.3211C13.8354 17.1878 14.3017 16.9984 14.7241 16.7529C15.1466 16.5074 15.5539 16.1917 15.9463 15.8058L18.4309 16.85L19.4155 15.15L17.2463 13.5154C17.3296 13.2564 17.3863 13.0025 17.4165 12.7538C17.4466 12.5051 17.4616 12.2538 17.4616 12C17.4616 11.7397 17.4466 11.4884 17.4165 11.2461C17.3863 11.0038 17.3296 10.7564 17.2463 10.5038L19.4347 8.84998L18.4501 7.14998L15.9366 8.2096C15.602 7.8519 15.2011 7.53588 14.7338 7.26153C14.2664 6.98716 13.7937 6.79293 13.3155 6.67883L13.0001 3.99998H11.0155L10.6847 6.6692C10.1745 6.78972 9.7033 6.97433 9.27125 7.22305C8.8392 7.47177 8.42703 7.79228 8.03473 8.1846L5.5501 7.14998L4.56548 8.84998L6.7251 10.4596C6.64177 10.6968 6.58344 10.9436 6.5501 11.2C6.51677 11.4564 6.5001 11.7263 6.5001 12.0096C6.5001 12.2699 6.51677 12.525 6.5501 12.775C6.58344 13.025 6.63856 13.2718 6.71548 13.5154L4.56548 15.15L5.5501 16.85L8.0251 15.8C8.40459 16.1897 8.81035 16.509 9.2424 16.7577C9.67445 17.0064 10.152 17.1974 10.6751 17.3308L11.0001 20Z",fill:"currentColor"})))};var mg=["feature","upgradePlan","currentPlan","className","as","dataAttrs","children"];function yg(){return yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yg.apply(this,arguments)}function gg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gg(Object(n),!0).forEach((function(t){xg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _g=function(e){var n,r,a,i,o=e.feature,l=e.upgradePlan,s=e.currentPlan,c=e.className,u=void 0===c?"":c,f=e.as,d=void 0===f?"div":f,h=e.dataAttrs,p=e.children,v=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,mg),m=l||(null===globalThis||void 0===globalThis||null===(n=globalThis.fbox_admin_js_object)||void 0===n||null===(r=n.langs)||void 0===r?void 0:r.PRO)||"Pro",y=bg(bg({},{"data-fpf-modal":"#fireboxUpgradeToPlan","data-fpf-modal-item":o,"data-current-plan":s||(null===globalThis||void 0===globalThis||null===(a=globalThis.fbox_admin_js_object)||void 0===a?void 0:a.license_plan)||(null===globalThis||void 0===globalThis||null===(i=globalThis.fbox_admin_js_object)||void 0===i?void 0:i.license_type)||"basic","data-upgrade-plan":m}),h||{});return t().createElement(d,yg({className:"fpf-modal-opener ".concat(u)},y,v),p)};function wg(){return wg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wg.apply(this,arguments)}function kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Sg=function(t){var n=t.filter,r=t.setFilterHandler,a=t.chartType,i=t.setChartTypeHandler,o=t.chartsFilterable,l=void 0===o||o,s=t.excludeMetrics,c=void 0===s?[]:s,u=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),f=u[0],d=u[1],h={list:"List",pie:"Pie"},p=(0,e.useRef)("Filters_CountriesSettings");return _s(p,(function(){d(!1)})),React.createElement("div",{className:"relative inline-flex",ref:p},React.createElement("div",{onClick:function(){return d(!f)},className:"cursor-pointer inline-flex".concat(f?" text-black":"")},React.createElement(vg,null)),f&&React.createElement("div",{className:"absolute z-20 text-base top-full w-[150px] right-0 rounded shadow-box bg-white dark:bg-[#343d43] flex flex-col"},React.createElement("div",{className:"flex flex-col text-default cursor-pointer"},Object.keys(Us).map((function(e,t){var a,i,o,l;if(c.includes(e))return null;var s=!(null===(a=Us[e])||void 0===a||!a.locked),u="".concat(0===t?"rounded-tl rounded-tr ":"","p-1 text-default ").concat(s?"cursor-pointer opacity-80 hover:opacity-100":"hover:bg-pale-blue dark:hover:bg-[#6b7a84] hover:text-black dark:hover:text-white"),f=e===n?"bg-pale-blue text-black dark:text-black".concat(s?"":" pointer-events-none"):"dark:text-grey-3",h="".concat(u," ").concat(f),p=s?_g:"div",v=s?{feature:(null===(i=Us[e])||void 0===i?void 0:i.label)||e}:{};return React.createElement(p,wg({key:t,className:h},v,{onClick:function(){if(s)return d(!1);!function(e){r(e),d(!1)}(e)}}),React.createElement("div",{className:"flex items-center justify-between gap-2"},React.createElement("span",null,Us[e].label),s&&React.createElement(vy,{feature:Us[e].label,upgradePlan:null===(o=fbox_admin_js_object)||void 0===o||null===(l=o.langs)||void 0===l?void 0:l.PRO,size:"text-base",iconSize:14,showLabel:!1})))}))),l&&React.createElement("div",{className:"p-[10px] border border-b-0 border-l-0 border-r-0 border-solid border-grey-3"},React.createElement("div",{className:"flex justify-between border border-solid border-grey-3 rounded-2xl bg-grey-4 p-[1px] gap-[2px]"},Object.keys(h).map((function(e,t){return React.createElement("div",{key:t,className:"".concat(a===e?"bg-accent text-white pointer-events-none":"text-grey-1 dark:text-gray-600 hover:bg-pale-blue hover:text:black"," rounded-2xl cursor-pointer px-2 py-[4px]"),onClick:function(){return function(e){i(e),d(!1)}(e)}},h[e])}))))))},Og=function(e){var t=e.chartType,n=void 0===t?"list":t;return React.createElement("div",{className:"flex flex-col gap-1 flex-grow"},"list"===n&&React.createElement("div",{className:"flex justify-between gap-3"},React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"})),"bar"===n&&React.createElement("div",{className:"flex gap-3 flex-grow items-end"},React.createElement("div",{className:"animate-pulse w-8 h-full bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-5 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-1 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-6 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse w-8 h-2 bg-slate-200 dark:bg-slate-700 rounded"})),"bar"!==n&&React.createElement("div",{className:"flex flex-col gap-2"},"list"===n?React.createElement(React.Fragment,null,React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"})):React.createElement("div",{className:"animate-pulse w-[256px] h-[256px] bg-slate-200 dark:bg-slate-700 self-center rounded-full"})))};var Eg=(0,e.memo)((function(e){var t=e.labelIsEvent,n=void 0!==t&&t,r=e.boxRef,a=e.labelLayout,i=e.label,o=e.showMetricLabel,l=void 0===o||o,s=e.isLoading,c=e.hasError,u=void 0!==c&&c,f=e.onRetry,d=e.data,h=e.filter,p=e.setFilterHandler,v=e.chartType,m=e.setChartTypeHandler,y=e.chartsFilterable,g=e.showFiltersDropdown,b=void 0===g||g,x=e.showPieLegends,_=void 0===x||x,w=e.excludeMetrics,k=void 0===w?[]:w;return React.createElement("div",{ref:r,className:"relative bg-white dark:bg-dark-1 rounded flex flex-col gap-3 p-3 h-[356px]"},React.createElement("div",{className:"flex gap-1 justify-between"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},i),!u&&!(null!=d&&d.pro)&&null!==d&&b&&!s&&React.createElement(Sg,{excludeMetrics:k,filter:h,setFilterHandler:p,chartType:v,setChartTypeHandler:m,chartsFilterable:y})),u?React.createElement(uy,{onRetry:f}):null===d?React.createElement(Og,{chartType:v}):null!=d&&d.pro?React.createElement(Xy,{label:i,className:"flex-grow"}):s?React.createElement(Og,{chartType:v}):React.createElement(pg,{showMetricLabel:l,labelIsEvent:n,labelLayout:a,label:i,data:d,filter:h,chartType:v,showPieLegends:_}))}));const Ag=Eg;function Cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jg=React.createElement("svg",{width:"16",height:"16",className:"rounded-full",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M8.00141 16C6.89494 16 5.85491 15.79 4.88132 15.3701C3.90772 14.9502 3.06082 14.3803 2.34064 13.6604C1.62044 12.9405 1.05028 12.094 0.63017 11.1208C0.210057 10.1477 0 9.10788 0 8.00141C0 6.89494 0.209966 5.85491 0.629896 4.88132C1.04983 3.90772 1.61972 3.06082 2.33958 2.34064C3.05946 1.62044 3.90598 1.05028 4.87915 0.630171C5.8523 0.210058 6.89212 0 7.99859 0C9.10506 0 10.1451 0.209966 11.1187 0.629897C12.0923 1.04983 12.9392 1.61972 13.6594 2.33959C14.3796 3.05946 14.9497 3.90598 15.3698 4.87915C15.7899 5.8523 16 6.89212 16 7.99859C16 9.10506 15.79 10.1451 15.3701 11.1187C14.9502 12.0923 14.3803 12.9392 13.6604 13.6594C12.9405 14.3796 12.094 14.9497 11.1208 15.3698C10.1477 15.7899 9.10788 16 8.00141 16ZM7.15789 14.6948V13.0526C6.69473 13.0526 6.29824 12.8877 5.96842 12.5579C5.63859 12.2281 5.47368 11.8316 5.47368 11.3684V10.5263L1.43156 6.48421C1.38946 6.73684 1.35086 6.98947 1.31577 7.2421C1.28068 7.49474 1.26314 7.74737 1.26314 8C1.26314 9.69825 1.82104 11.186 2.93683 12.4632C4.05262 13.7404 5.45964 14.4842 7.15789 14.6948ZM12.9684 12.5474C13.2491 12.2386 13.5018 11.9053 13.7263 11.5474C13.9509 11.1895 14.1369 10.8176 14.2842 10.4316C14.4316 10.0456 14.5439 9.64913 14.6211 9.24211C14.6983 8.83509 14.7369 8.42105 14.7369 8C14.7369 6.62049 14.3557 5.36062 13.5935 4.22041C12.8313 3.08021 11.8089 2.25748 10.5263 1.75222V2.10525C10.5263 2.56841 10.3614 2.9649 10.0316 3.29472C9.70176 3.62455 9.30527 3.78946 8.84211 3.78946H7.15789V5.47368C7.15789 5.71227 7.07719 5.91228 6.91579 6.07368C6.75438 6.23508 6.55438 6.31578 6.31578 6.31578H4.63157V8H9.68421C9.92281 8 10.1228 8.0807 10.2842 8.24211C10.4456 8.40351 10.5263 8.60351 10.5263 8.84211V11.3684H11.3684C11.7333 11.3684 12.0632 11.4772 12.3579 11.6947C12.6526 11.9123 12.8562 12.1965 12.9684 12.5474Z",fill:"currentColor"}));const Dg=function(t){var n=t.url,r=t.width,a=void 0===r?16:r,i=t.height,o=void 0===i?16:i,l=t.className,s=void 0===l?"":l,c=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Cg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),u=c[0],f=c[1],d=function(e){try{var t=new URL(e),n=t.hostname.replace(/^www\./,"");return"".concat(t.protocol,"//").concat(n)}catch(e){return!1}}(n);return!d||u?jg:React.createElement("img",{src:"".concat(d,"/favicon.ico"),onError:function(e){e.target.onerror=null,f(!0)},alt:"Favicon",width:a,height:o,className:s})};function Mg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mg(Object(n),!0).forEach((function(t){Rg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ig(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Ng=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Ig((0,e.useState)([]),2),r=n[0],a=n[1],i=Ig((0,e.useState)(!1),2),o=i[0],l=i[1],s=Ig((0,e.useState)(!1),2),c=s[0],f=s[1],d=Ig((0,e.useState)(!1),2),h=d[0],p=d[1],v=Ig((0,e.useState)((null==t?void 0:t.referrersFilter)||"views"),2),m=v[0],y=v[1],g=Ig((0,e.useState)("list"),2),b=g[0],x=g[1],_=Ig((0,e.useState)(null),2),w=_[0],k=_[1],S=u(),O=S.date_period,E=S.custom_date_period,A=S.selected_campaign,C=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.referrersFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),y(e)}),[m]),j=(0,e.useCallback)((function(e){x(e)}),[b]),D=function(e){var t;if(!["today","custom"].includes(O)&&null!=r&&null!==(t=r[cy(A)])&&void 0!==t&&t[O])return k(r[cy(A)][O]),void f(!1);var n=Ss(O,E),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","referrers"),l.append("campaign",A),p(!1),Ms(l).then((function(t){k(t),f(!1),["today","custom"].includes(O)||a((function(e){return Pg(Pg({},e),{},Rg({},cy(A),Pg(Pg({},e[cy(A)]),{},Rg({},O,t))))})),e&&e()})).catch((function(e){console.error("Referrers fetch error:",e),f(!1),p(!0)}))},M=React.createRef();return xs((function(){D(),l(!0)}),M,[O,E,A]),(0,e.useEffect)((function(){o&&(null!=w&&w.pro||(f(!0),D()))}),[A]),(0,e.useEffect)((function(){o&&"custom"===O&&(2===E.length&&(null===E[0]||null===E[1])||null!=w&&w.pro||(f(!0),D()))}),[E]),(0,e.useEffect)((function(){o&&"custom"!==O&&(null!=w&&w.pro||(f(!0),D()))}),[O]),React.createElement(Ag,{boxRef:M,labelLayout:function(e){var t=e.label||fbox_admin_js_object.langs["N/A"],n=null!=e&&e.full_label?e.full_label:t;return React.createElement("div",{className:"inline-flex items-center gap-[12px] truncate"},React.createElement(Dg,{url:n,height:16}),React.createElement("div",{className:"truncate",title:n},t))},label:fbox_admin_js_object.langs.REFERRERS,isLoading:null!==w&&c&&o,hasError:h,onRetry:function(){f(!0),D()},data:w,filter:m,setFilterHandler:C,chartType:b,setChartTypeHandler:j,chartsFilterable:!1})},Tg=function(){return React.createElement("div",{className:"flex flex-col gap-1"},React.createElement("div",{className:"flex justify-between gap-3"},React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"flex gap-1"},React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-1 w-[50px] bg-slate-200 dark:bg-slate-700 rounded"}))),React.createElement("div",{className:"flex flex-col gap-2"},React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-3 bg-slate-200 dark:bg-slate-700 rounded"})))};function Fg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fg(Object(n),!0).forEach((function(t){Hg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Wg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const $g=function(){var t=Vg((0,e.useState)([]),2),n=t[0],r=t[1],a=Vg((0,e.useState)(!1),2),i=a[0],o=a[1],l=Vg((0,e.useState)(!1),2),s=l[0],c=l[1],f=Vg((0,e.useState)(!1),2),d=f[0],h=f[1],p=Vg((0,e.useState)(null),2),v=p[0],m=p[1],y=u(),g=y.date_period,b=y.custom_date_period,x=function(e){if(!["today","custom"].includes(g)&&null!=n&&n[g])return m(n[g]),void c(!1);var t=Ss(g,b),a=t.start_date,i=t.end_date,o=new FormData;o.append("nonce",fpf_js_object.nonce),o.append("action","firebox_analytics_get_conversions_data"),o.append("start_date",a),o.append("end_date",i),h(!1),Ms(o).then((function(t){m(t),["today","custom"].includes(g)||r((function(e){return zg(zg({},e),{},Hg({},g,t))})),c(!1),e&&e()})).catch((function(e){console.error("Conversions fetch error:",e),c(!1),h(!0)}))};(0,e.useEffect)((function(){i&&"custom"===g&&(2===b.length&&(null===b[0]||null===b[1])||null!=v&&v.pro||(c(!0),x()))}),[b]),(0,e.useEffect)((function(){i&&"custom"!==g&&(null!=v&&v.pro||(c(!0),x()))}),[g]);var _=(0,e.useRef)();return xs((function(){x(),o(!0)}),_,[g,b]),React.createElement("div",{ref:_,className:"relative bg-white dark:bg-dark-1 rounded flex flex-col gap-3 p-3 h-[356px]"},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.CONVERSIONS),d?React.createElement(uy,{onRetry:function(){c(!0),x()}}):null!=v&&v.pro?React.createElement(Xy,{label:fbox_admin_js_object.langs.CONVERSIONS,className:"flex-grow"}):null===v||s?React.createElement(Tg,null):React.createElement("div",{className:"flex flex-col gap-3 flex-grow max-h-[256px]"},React.createElement("div",{className:"flex gap-1 text-xs justify-between text-grey-1"},React.createElement("div",null,fbox_admin_js_object.langs.CAMPAIGN),React.createElement("div",{className:"inline-flex items-center gap-3"},React.createElement("div",{className:"w-[67px]"},fbox_admin_js_object.langs.CONVERSIONS),React.createElement("div",{className:"w-[88px]"},fbox_admin_js_object.langs.CONVERSION_RATE))),React.createElement("div",{className:"fpframework-custom-scrollbar h-full"},React.createElement("div",{className:"flex flex-col gap-[20px] flex-grow dark:text-white overscroll-contain h-full"},v.length>0?React.createElement(React.Fragment,null,v.map((function(e,t){var n=e.title||fbox_admin_js_object.langs["N/A"],r=parseFloat(e.conversions)||0,a=parseFloat(e.conversionrate)||0;return React.createElement("div",{key:t,className:"flex items-center justify-between gap-2"},React.createElement("a",{href:fbox_admin_js_object.campaigns_item_analytics_url.replace("{{ID}}",e.id),title:n,className:"truncate no-underline text-default hover:text-accent dark:text-white dark:hover:text-grey-3 shadow-none outline-none"},n),React.createElement("div",{className:"inline-flex items-center gap-3 text-right"},React.createElement("div",{className:"font-bold ".concat(Us.conversions.colorClass," w-[67px]")},Xm({num:r}),Us.conversions.suffix||""),React.createElement("div",{className:"font-bold ".concat(Us.conversionrate.colorClass," w-[88px]")},Xm({num:a,decimalPoints:!0}),Us.conversionrate.suffix||"")))})),30===(null==v?void 0:v.length)&&React.createElement("div",{className:"text-sm text-center text-gray-400 dark:text-grey-1"},fbox_admin_js_object.langs.SHOWING_TOP_30_RESULTS)):React.createElement("div",{className:"text-center py-5 text-sm dark:text-grey-1 flex items-center justify-center flex-grow"},fbox_admin_js_object.langs.NO_DATA_AVAILABLE)))))};function Bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bg(Object(n),!0).forEach((function(t){Ug(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ug(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Zg=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Gg((0,e.useState)([]),2),r=n[0],a=n[1],i=Gg((0,e.useState)(!1),2),o=i[0],l=i[1],s=Gg((0,e.useState)(!1),2),c=s[0],f=s[1],d=Gg((0,e.useState)(!1),2),h=d[0],p=d[1],v=Gg((0,e.useState)((null==t?void 0:t.countriesFilter)||"views"),2),m=v[0],y=v[1],g=Gg((0,e.useState)("list"),2),b=g[0],x=(g[1],Gg((0,e.useState)(null),2)),_=x[0],w=x[1],k=u(),S=k.date_period,O=k.custom_date_period,E=k.selected_campaign,A=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.countriesFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),y(e)}),[m]),C=function(e){var t;if(!["today","custom"].includes(S)&&null!=r&&null!==(t=r[cy(E)])&&void 0!==t&&t[S])return w(r[cy(E)][S]),void f(!1);var n=Ss(S,O),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","countries"),l.append("campaign",E),p(!1),Ms(l).then((function(t){w(t),f(!1),["today","custom"].includes(S)||a((function(e){return Yg(Yg({},e),{},Ug({},cy(E),Yg(Yg({},e[cy(E)]),{},Ug({},S,t))))})),e&&e()})).catch((function(e){console.error("Countries fetch error:",e),f(!1),p(!0)}))},j=React.createRef();return xs((function(){C(),l(!0)}),j,[S,O,E]),(0,e.useEffect)((function(){o&&(null!=_&&_.pro||(f(!0),C()))}),[E]),(0,e.useEffect)((function(){o&&"custom"===S&&(2===O.length&&(null===O[0]||null===O[1])||null!=_&&_.pro||(f(!0),C()))}),[O]),(0,e.useEffect)((function(){o&&"custom"!==S&&(null!=_&&_.pro||(f(!0),C()))}),[S]),React.createElement(Ag,{boxRef:j,labelLayout:function(e){return React.createElement("div",{className:"inline-flex items-center gap-1"},(null==e?void 0:e.code)&&React.createElement("img",{width:24,src:fbox_admin_js_object.flags_url.replace("{{FLAG}}",e.code.toLowerCase()),alt:e.label+" "+fbox_admin_js_object.langs.FLAG}),e.label||fbox_admin_js_object.langs["N/A"])},label:fbox_admin_js_object.langs.COUNTRIES,isLoading:null!==_&&c&&o,hasError:h,onRetry:function(){f(!0),C()},data:_,filter:m,setFilterHandler:A,chartType:b,chartsFilterable:!1})};function Kg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kg(Object(n),!0).forEach((function(t){Jg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const tb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Qg((0,e.useState)([]),2),r=n[0],a=n[1],i=Qg((0,e.useState)(!1),2),o=i[0],l=i[1],s=Qg((0,e.useState)(!1),2),c=s[0],f=s[1],d=Qg((0,e.useState)(!1),2),h=d[0],p=d[1],v=Qg((0,e.useState)((null==t?void 0:t.devicesFilter)||"views"),2),m=v[0],y=v[1],g=Qg((0,e.useState)(null),2),b=g[0],x=g[1],_=u(),w=_.date_period,k=_.custom_date_period,S=_.selected_campaign,O=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.devicesFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),y(e)}),[m]),E=function(e){var t;if(!["today","custom"].includes(w)&&null!=r&&null!==(t=r[cy(S)])&&void 0!==t&&t[w])return x(r[cy(S)][w]),void f(!1);var n=Ss(w,k),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","devices"),l.append("campaign",S),p(!1),Ms(l).then((function(t){x(t),f(!1),["today","custom"].includes(w)||a((function(e){return Xg(Xg({},e),{},Jg({},cy(S),Xg(Xg({},e[cy(S)]),{},Jg({},w,t))))})),e&&e()})).catch((function(e){console.error("Devices fetch error:",e),f(!1),p(!0)}))},A=React.createRef();return xs((function(){E(),l(!0)}),A,[w,k,S]),(0,e.useEffect)((function(){o&&(null!=b&&b.pro||(f(!0),E()))}),[S]),(0,e.useEffect)((function(){o&&"custom"===w&&(2===k.length&&(null===k[0]||null===k[1])||null!=b&&b.pro||(f(!0),E()))}),[k]),(0,e.useEffect)((function(){o&&"custom"!==w&&(null!=b&&b.pro||(f(!0),E()))}),[w]),React.createElement(Ag,{boxRef:A,label:fbox_admin_js_object.langs.DEVICES,isLoading:null!==b&&c&&o,hasError:h,onRetry:function(){f(!0),E()},data:b,filter:m,setFilterHandler:O,chartType:"pie",chartsFilterable:!1})};function nb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nb(Object(n),!0).forEach((function(t){ab(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ab(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ib(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ob(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ob(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ob(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const lb=function(){var t=ib((0,e.useState)([]),2),n=t[0],r=t[1],a=ib((0,e.useState)(!1),2),i=a[0],o=a[1],l=ib((0,e.useState)(!1),2),s=l[0],c=l[1],f=ib((0,e.useState)(!1),2),d=f[0],h=f[1],p=ib((0,e.useState)(null),2),v=p[0],m=p[1],y=u(),g=y.date_period,b=y.custom_date_period,x=y.selected_campaign,_=function(e){var t;if(!["today","custom"].includes(g)&&null!=n&&null!==(t=n[cy(x)])&&void 0!==t&&t[g])return m(n[cy(x)][g]),void c(!1);var a=Ss(g,b),i=a.start_date,o=a.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","events"),l.append("campaign",x),h(!1),Ms(l).then((function(t){m(t),c(!1),["today","custom"].includes(g)||r((function(e){return rb(rb({},e),{},ab({},cy(x),rb(rb({},e[cy(x)]),{},ab({},g,t))))})),e&&e()})).catch((function(e){console.error("Events fetch error:",e),c(!1),h(!0)}))},w=React.createRef();return xs((function(){_(),o(!0)}),w,[g,b,x]),(0,e.useEffect)((function(){i&&(null!=v&&v.pro||(c(!0),_()))}),[x]),(0,e.useEffect)((function(){i&&"custom"===g&&(2===b.length&&(null===b[0]||null===b[1])||null!=v&&v.pro||(c(!0),_()))}),[b]),(0,e.useEffect)((function(){i&&"custom"!==g&&(null!=v&&v.pro||(c(!0),_()))}),[g]),React.createElement(Ag,{boxRef:w,label:fbox_admin_js_object.langs.EVENTS,labelIsEvent:!0,isLoading:null!==v&&s&&i,hasError:d,onRetry:function(){c(!0),_()},data:v,filter:"views",chartType:"pie",chartsFilterable:!1,showFiltersDropdown:!1})};function sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sb(Object(n),!0).forEach((function(t){ub(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ub(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return db(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?db(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function db(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const hb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=fb((0,e.useState)([]),2),r=n[0],a=n[1],i=fb((0,e.useState)(!1),2),o=i[0],l=i[1],s=fb((0,e.useState)(!1),2),c=s[0],f=s[1],d=fb((0,e.useState)(!1),2),h=d[0],p=d[1],v=fb((0,e.useState)((null==t?void 0:t.pathsFilter)||"views"),2),m=v[0],y=v[1],g=fb((0,e.useState)("list"),2),b=g[0],x=g[1],_=fb((0,e.useState)(null),2),w=_[0],k=_[1],S=u(),O=S.date_period,E=S.custom_date_period,A=S.selected_campaign,C=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.pathsFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),y(e)}),[m]),j=(0,e.useCallback)((function(e){x(e)}),[b]),D=function(e){var t;if(!["today","custom"].includes(O)&&null!=r&&null!==(t=r[cy(A)])&&void 0!==t&&t[O])return k(r[cy(A)][O]),void f(!1);var n=Ss(O,E),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","pages"),l.append("campaign",A),p(!1),Ms(l).then((function(t){k(t),f(!1),["today","custom"].includes(O)||a((function(e){return cb(cb({},e),{},ub({},cy(A),cb(cb({},e[cy(A)]),{},ub({},O,t))))})),e&&e()})).catch((function(e){console.error("Pages fetch error:",e),f(!1),p(!0)}))},M=React.createRef();return xs((function(){D(),l(!0)}),M,[O,E,A]),(0,e.useEffect)((function(){o&&(null!=w&&w.pro||(f(!0),D()))}),[A]),(0,e.useEffect)((function(){o&&"custom"===O&&(2===E.length&&(null===E[0]||null===E[1])||null!=w&&w.pro||(f(!0),D()))}),[E]),(0,e.useEffect)((function(){o&&"custom"!==O&&(null!=w&&w.pro||(f(!0),D()))}),[O]),React.createElement(Ag,{boxRef:M,label:fbox_admin_js_object.langs.PATHS,isLoading:null!==w&&c&&o,hasError:h,onRetry:function(){f(!0),D()},data:w,filter:m,setFilterHandler:C,chartType:b,setChartTypeHandler:j,chartsFilterable:!1})};function pb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pb(Object(n),!0).forEach((function(t){mb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const bb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=yb((0,e.useState)([]),2),r=n[0],a=n[1],i=yb((0,e.useState)(!1),2),o=i[0],l=i[1],s=yb((0,e.useState)(!1),2),c=s[0],f=s[1],d=yb((0,e.useState)(!1),2),h=d[0],p=d[1],v=yb((0,e.useState)((null==t?void 0:t.topCampaignsFilter)||"views"),2),m=v[0],y=v[1],g=yb((0,e.useState)(null),2),b=g[0],x=g[1],_=u(),w=_.date_period,k=_.custom_date_period,S=_.selected_campaign,O=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.topCampaignsFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),y(e)}),[m]),E=function(e){var t;if(!["today","custom"].includes(w)&&null!=r&&null!==(t=r[cy(S)])&&void 0!==t&&t[w])return x(r[cy(S)][w]),void f(!1);var n=Ss(w,k),i=n.start_date,o=n.end_date,l=new FormData;l.append("nonce",fpf_js_object.nonce),l.append("action","firebox_analytics_get_shared_data"),l.append("start_date",i),l.append("end_date",o),l.append("item","top_campaign"),p(!1),Ms(l).then((function(t){x(t),["today","custom"].includes(w)||a((function(e){return vb(vb({},e),{},mb({},cy(S),vb(vb({},e[cy(S)]),{},mb({},w,t))))})),f(!1),e&&e()})).catch((function(e){console.error("Top campaigns fetch error:",e),f(!1),p(!0)}))},A=React.createRef();return xs((function(){E(),l(!0)}),A,[w,k]),(0,e.useEffect)((function(){o&&(null!=b&&b.pro||(f(!0),E()))}),[S]),(0,e.useEffect)((function(){o&&"custom"===w&&(2===k.length&&(null===k[0]||null===k[1])||null!=b&&b.pro||(f(!0),E()))}),[k]),(0,e.useEffect)((function(){o&&"custom"!==w&&(null!=b&&b.pro||(f(!0),E()))}),[w]),React.createElement(Ag,{boxRef:A,labelLayout:function(e){var t=e.label||fbox_admin_js_object.langs["N/A"],n=null!=e&&e.full_label?e.full_label:t;return React.createElement(React.Fragment,null,null!=e&&e.link?React.createElement("a",{href:e.link,className:"truncate no-underline text-default hover:text-accent dark:text-white dark:hover:text-grey-3 shadow-none outline-none",title:n},t):React.createElement("div",{className:"truncate",title:n},t))},label:fbox_admin_js_object.langs.TOP_CAMPAIGNS,isLoading:null!==b&&c&&o,hasError:h,onRetry:function(){f(!0),E()},data:b,filter:m,setFilterHandler:O,chartType:"list",chartsFilterable:!1})},xb=function(e){var t=e.currentValue,n=e.previousValue,r=e.includePercentSign,a=void 0===r||r,i=e.showArrow,o=void 0===i||i,l=e.className,s=void 0===l?"":l,c=e.title,u=void 0===c?null:c,f=e.children,d=void 0===f?null:f,h=e.layout,p=void 0===h?"horizontal":h,v=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Jm(e,t),a=Qm(r,n);return{raw:r,formatted:a,isPositive:r>0,hasChange:0!==r}}(t,n,a);if(!v.hasChange)return null;var m=u||fbox_admin_js_object.langs.PERCENTAGE_DIFFERENCE_AGAINST_PREVIOUS_PERIOD,y=React.createElement("div",{className:"inline-flex items-center gap-[4px] leading-none"},React.createElement("span",{className:"text-[12px] font-bold ".concat(v.isPositive?"text-custom-green":"text-custom-red")},v.formatted),o&&(v.isPositive?React.createElement("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M0.596191 5.2495L4.99999 0.845703L9.40379 5.2495H0.596191Z",fill:"#0F9D58"})):React.createElement("svg",{width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M4.49999 5.1538L0.0961914 0.75H8.90379L4.49999 5.1538Z",fill:"#DB4437"}))));return"vertical"===p&&d?React.createElement("div",{className:s,title:m},y,d):React.createElement("div",{className:"inline-flex items-center gap-[4px] leading-none ".concat(s),title:m},React.createElement("span",{className:"text-[12px] font-bold ".concat(v.isPositive?"text-custom-green":"text-custom-red")},v.formatted),o&&(v.isPositive?React.createElement("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M0.596191 5.2495L4.99999 0.845703L9.40379 5.2495H0.596191Z",fill:"#0F9D58"})):React.createElement("svg",{width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M4.49999 5.1538L0.0961914 0.75H8.90379L4.49999 5.1538Z",fill:"#DB4437"}))))};rv.register(sm,fm,yv,vv,Yv,om,$v,zv);const _b=function(e){var t=e.labels,n=e.data,r=e.metricKey,a={labels:t,datasets:[{label:Us[r],data:n,borderColor:Us[r].color,fill:!0,borderWidth:1,pointHoverRadius:0,backgroundColor:function(e){var t=e.chart.ctx.createLinearGradient(0,0,0,40);return t.addColorStop(0,Us[r].color),t.addColorStop(1,"rgba(255, 255, 255, 0)"),t},spanGaps:!0}]};return React.createElement(Gm,{data:a,options:{maintainAspectRatio:!1,scales:{x:{ticks:{display:!1},grid:{drawBorder:!1,display:!1},border:{display:!1}},y:{ticks:{display:!1,beginAtZero:!0},grid:{drawBorder:!1,display:!1},border:{display:!1}}},elements:{line:{tension:.3},point:{radius:0}},plugins:{tooltip:{enabled:!1},legend:{display:!1},filler:{propagate:!1}}},key:Date.now(),height:40})};var wb=(0,e.memo)((function(e){var t=e.data;return React.createElement("div",{className:"grid gap-3 grid-cols-3 grid-rows-2 flex-grow"},Object.keys(t.data).map((function(e,n){var r,a,i,o,l,s,c,u,f=Us[e].label,d=t.data[e].title||"",h=(null===(r=t.data[e])||void 0===r?void 0:r.currentTotal)||0,p=(null===(a=t.data[e])||void 0===a?void 0:a.previousTotal)||0,v=(null===(i=t.data[e])||void 0===i||null===(o=i.data)||void 0===o?void 0:o.map((function(e){return e.total})))||[],m=null!==(l=null===(s=Us[e])||void 0===s?void 0:s.suffix)&&void 0!==l?l:"",y=null!==(c=null===(u=Us[e])||void 0===u?void 0:u.prefix)&&void 0!==c?c:"",g="";"conversionrate"===e&&(g=Xm({num:h})+m);var b=Xm({num:h,decimalPoints:"conversionrate"===e||"revenue"===e,forceDecimalPlaces:"revenue"===e}),x=b;return y?x=y+b:m&&(x=b+m),React.createElement("div",{className:"flex flex-col gap-[4px]".concat(n>=3?" justify-end":""),key:n},React.createElement("div",{className:"text-xs text-grey-1"},f),React.createElement("div",{className:"truncate dark:text-white",title:d},d||fbox_admin_js_object.langs["N/A"]),React.createElement("div",{className:"flex gap-1 dark:text-white items-center"},d&&React.createElement("span",{className:"font-bold text-[20px]",title:g},x),React.createElement(xb,{currentValue:h,previousValue:p,includePercentSign:!0})),v.length>0&&React.createElement("div",null,React.createElement(_b,{metricKey:e,labels:t.labels,data:v})),v.length<=0&&React.createElement("div",{className:"text-xs text-grey-1 h-5 flex items-center"},fbox_admin_js_object.langs.NO_CAMPAIGN_DATA_FOUND))})))}));const kb=wb;function Sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Ob=function(){return React.createElement("div",{className:"grid gap-4 grid-cols-3 grid-rows-2 flex-grow"},function(e){return function(e){if(Array.isArray(e))return Sb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sb(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Array(5).keys()).map((function(e,t){return React.createElement("div",{key:t},React.createElement("div",{className:"animate-pulse mb-1 h-1 w-1/2 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-2 w-2/3 bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse mt-1 mb-1 h-2 w-[100px] bg-slate-200 dark:bg-slate-700 rounded"}),React.createElement("div",{className:"animate-pulse h-5 w-full bg-slate-200 dark:bg-slate-700 rounded"}))})))};function Eb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ab(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Eb(Object(n),!0).forEach((function(t){Cb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Db(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Db(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Db(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Mb=function(){var t=React.createRef(),n=jb((0,e.useState)([]),2),r=n[0],a=n[1],i=jb((0,e.useState)(!1),2),o=i[0],l=i[1],s=jb((0,e.useState)(!1),2),c=s[0],f=s[1],d=jb((0,e.useState)(!1),2),h=d[0],p=d[1],v=u(),m=v.date_period,y=v.custom_date_period,g=jb((0,e.useState)(null),2),b=g[0],x=g[1],_=function(e){if(!["today","custom"].includes(m)&&null!=r&&r[m])return x(r[m]),l(!1),void(e&&e());var t=Ss(m,y),n=t.start_date,i=t.end_date,o=Math.round((Date.parse(i)-Date.parse(n))/864e5),s=new FormData;s.append("nonce",fpf_js_object.nonce),s.append("action","firebox_analytics_most_popular_campaigns"),s.append("start_date",n),s.append("end_date",i),f(!1),Ms(s).then((function(t){var n=t;null!=n&&n.data&&Object.keys(n.data).map((function(e,t){var r,a;null!==(r=n.data[e])&&void 0!==r&&null!==(a=r.data)&&void 0!==a&&a.length&&(n.data[e].data=1===o?$s(n.labels,n.data[e].data):Ws(n.labels,n.data[e].data))})),["today","custom"].includes(m)||a((function(e){return Ab(Ab({},e),{},Cb({},m,n))})),x(n),l(!1),e&&e()})).catch((function(e){console.error("Most popular campaigns fetch error:",e),l(!1),f(!0)}))};return xs((function(){_(),p(!0)}),t,[m,y]),(0,e.useEffect)((function(){h&&"custom"===m&&(2===y.length&&(null===y[0]||null===y[1])||null!=b&&b.pro||(l(!0),_()))}),[y]),(0,e.useEffect)((function(){h&&"custom"!==m&&(null!=b&&b.pro||(l(!0),_()))}),[m]),React.createElement("div",{className:"relative flex flex-col gap-3 justify-between bg-white dark:bg-dark-1 rounded p-3",ref:t},React.createElement("h2",{className:"text-[20px] text-default dark:text-white"},fbox_admin_js_object.langs.MOST_POPULAR_CAMPAIGNS),c?React.createElement(uy,{onRetry:function(){l(!0),_()},className:"min-h-[200px]"}):null!=b&&b.pro?React.createElement(Xy,{label:fbox_admin_js_object.langs.MOST_POPULAR_CAMPAIGNS,className:"flex-grow"}):null!=b&&b.labels&&0!==b.labels.length?o?React.createElement(Ob,null):React.createElement(kb,{data:b}):React.createElement(Ob,null))};function Pb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pb(Object(n),!0).forEach((function(t){Ib(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ib(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Tb=function(){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{},n=Lb((0,e.useState)([]),2),r=n[0],a=n[1],i=Lb((0,e.useState)(!1),2),o=i[0],l=i[1],s=Lb((0,e.useState)(!1),2),c=s[0],f=s[1],d=Lb((0,e.useState)(!1),2),h=d[0],p=d[1],v=Lb((0,e.useState)((null==t?void 0:t.dayOfTheWeekFilter)||"views"),2),m=v[0],y=v[1],g=Lb((0,e.useState)([fbox_admin_js_object.langs.MONDAY,fbox_admin_js_object.langs.TUESDAY,fbox_admin_js_object.langs.WEDNESDAY,fbox_admin_js_object.langs.THURSDAY,fbox_admin_js_object.langs.FRIDAY,fbox_admin_js_object.langs.SATURDAY,fbox_admin_js_object.langs.SUNDAY]),2),b=g[0],x=(g[1],Lb((0,e.useState)(null),2)),_=x[0],w=x[1],k=u(),S=k.date_period,O=k.custom_date_period,E=k.selected_campaign,A=(0,e.useCallback)((function(e){var t=localStorage.getItem("fireboxAnalyticsStateData")?JSON.parse(localStorage.getItem("fireboxAnalyticsStateData")):{};t.dayOfTheWeekFilter=e,localStorage.setItem("fireboxAnalyticsStateData",JSON.stringify(t)),y(e)}),[m]),C=function(e){var t;if(!["today","custom"].includes(S)&&null!=r&&null!==(t=r[cy(E)])&&void 0!==t&&t[S])return w(r[cy(E)][S]),l(!1),void(e&&e());var n=Ss(S,O),i=n.start_date,o=n.end_date,s=new FormData;s.append("nonce",fpf_js_object.nonce),s.append("action","firebox_analytics_get_day_of_the_week"),s.append("start_date",i),s.append("end_date",o),s.append("campaign",E),f(!1),Ms(s).then((function(t){var n=t;null!=t&&t.pro||Object.keys(n).map((function(e){n[e]=function(e,t){var n=new Map;return null!=t&&t.length&&t.forEach((function(e){n.set(e.label,parseFloat(e.total))})),e.map((function(e){return{label:e,total:(null==n?void 0:n.get(e))||"0.00"}}))}(b,n[e])})),w(n),l(!1),["today","custom"].includes(S)||a((function(e){return Rb(Rb({},e),{},Ib({},cy(E),Rb(Rb({},e[cy(E)]),{},Ib({},S,n))))})),l(!1),e&&e()})).catch((function(e){console.error("Day of the week fetch error:",e),l(!1),f(!0)}))},j=React.createRef();return xs((function(){C(),p(!0)}),j,[S,O,E]),(0,e.useEffect)((function(){h&&(null!=_&&_.pro||(l(!0),C()))}),[E]),(0,e.useEffect)((function(){h&&"custom"===S&&(2===O.length&&(null===O[0]||null===O[1])||null!=_&&_.pro||(l(!0),C()))}),[O]),(0,e.useEffect)((function(){h&&"custom"!==S&&(null!=_&&_.pro||(l(!0),C()))}),[S]),React.createElement(Ag,{boxRef:j,label:fbox_admin_js_object.langs.DAY_OF_THE_WEEK,isLoading:null!==_&&o&&h,hasError:c,onRetry:function(){l(!0),C()},data:_,filter:m,setFilterHandler:A,chartType:"bar",chartsFilterable:!1})};function Fb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(n),!0).forEach((function(t){Hb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Wb=function(){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Vb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)([]),2),n=t[0],r=t[1],a=u(),i=a.selected_campaign,o=a.date_period,l=a.custom_date_period,s=p(),c=s.components,d=s.loading,h=f(),v=Ss(o,l),m=v.start_date,y=v.end_date,g=Math.round((Date.parse(y)-Date.parse(m))/864e5);return(0,e.useEffect)((function(){if(null!==i){if(n[i])return void h({type:"SET_CAMPAIGN",payload:n[i]});!function(e,t){var n=new FormData;n.append("nonce",fpf_js_object.nonce),n.append("action","firebox_analytics_get_campaign"),n.append("campaign",e),Ms(n).then((function(e){t(e)})).catch((function(e){console.error("Campaign fetch error:",e),t(null)}))}(i,(function(e){var t,a=!(null==e||null===(t=e.campaign)||void 0===t||!t.ID)&&e.campaign;r(zb(zb({},n),{},Hb({},i,a))),h({type:"SET_CAMPAIGN",payload:a})}))}}),[i]),React.createElement(e.Fragment,null,!d&&(null==c?void 0:c.SalesFunnel)&&React.createElement(c.SalesFunnel,{date_period:o,custom_date_period:l,selected_campaign:i}),React.createElement("div",{className:"grid gap-5 grid-cols-1 lg:grid-cols-2 grid-rows-4"},i?React.createElement(Vy,null):React.createElement(Mb,null),React.createElement(rg,null),g>1&&React.createElement(Tb,null),!i&&React.createElement(bb,null),React.createElement(Zg,null),React.createElement(Ng,null),React.createElement(tb,null),React.createElement(hb,null),React.createElement(lb,null),!i&&React.createElement($g,null)))};function $b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bb,Yb=localStorage.getItem("firebox_analytics_date_period")||"month_to_date",Ub={yesterday:"today",last_30_days:"last_4_weeks",last_week:"last_7_days",last_month:"month_to_date"}[Bb=Yb]||Bb;Ub!==Yb&&localStorage.setItem("firebox_analytics_date_period",Ub);var Gb=localStorage.getItem("firebox_analytics_custom_date_period"),qb=[];if(Gb)try{var Zb=JSON.parse(Gb);Zb&&Array.isArray(Zb)&&2===Zb.length&&Zb[0]&&Zb[1]&&(qb=Zb.map((function(e){return new Date(e)})))}catch(e){console.warn("Invalid custom date period in localStorage, ignoring"),localStorage.removeItem("firebox_analytics_custom_date_period")}var Kb={campaign:null,date_period:Ub,custom_date_period:qb,selected_campaign:new URLSearchParams(window.location.search).get("campaign")||null},Xb=function(t){var n=t.children,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$b(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useReducer)(l,Kb),2),a=r[0],i=r[1];return React.createElement(s.Provider,{value:a},React.createElement(c.Provider,{value:i},n))};function Jb(){return React.createElement(React.Fragment,null,React.createElement(Xb,null,React.createElement(Hy,null,React.createElement(m,{_title:fbox_admin_js_object.langs.ANALYTICS,call_to_action:!1}),React.createElement(Js,null),React.createElement(Ny,null),React.createElement(Wb,null))))}(0,r.s)(document.querySelector("#fpf-firebox-analytics")).render(React.createElement(Jb,null))})()})(); |