Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsjet-saas/Source/public/dist/js/
Upload File :
Current File : /home/users/unlimited/www/whatsjet-saas/Source/public/dist/js/dashboard.js

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function s(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function a(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;for(var e in t)if(n(t,e))return;return 1}function o(t){return void 0===t}function r(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){for(var i=[],s=t.length,n=0;n<s;++n)i.push(e(t[n],n));return i}function c(t,e){for(var i in e)n(e,i)&&(t[i]=e[i]);return n(e,"toString")&&(t.toString=e.toString),n(e,"valueOf")&&(t.valueOf=e.valueOf),t}function d(t,e,i,s){return Se(t,e,i,s,!0).utc()}function u(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}function f(t){var e,i,s=t._d&&!isNaN(t._d.getTime());return s&&(e=u(t),i=g.call(e.parsedDateParts,(function(t){return null!=t})),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i),t._strict)&&(s=s&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t)?s:(t._isValid=s,t._isValid)}function p(t){var e=d(NaN);return null!=t?c(u(e),t):u(e).userInvalidated=!0,e}var g=Array.prototype.some||function(t){for(var e=Object(this),i=e.length>>>0,s=0;s<i;s++)if(s in e&&t.call(this,e[s],s,e))return!0;return!1},m=e.momentProperties=[],b=!1;function y(t,e){var i,s,n,a=m.length;if(o(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),o(e._i)||(t._i=e._i),o(e._f)||(t._f=e._f),o(e._l)||(t._l=e._l),o(e._strict)||(t._strict=e._strict),o(e._tzm)||(t._tzm=e._tzm),o(e._isUTC)||(t._isUTC=e._isUTC),o(e._offset)||(t._offset=e._offset),o(e._pf)||(t._pf=u(e)),o(e._locale)||(t._locale=e._locale),0<a)for(i=0;i<a;i++)o(n=e[s=m[i]])||(t[s]=n);return t}function _(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,e.updateOffset(this),b=!1)}function x(t){return t instanceof _||null!=t&&null!=t._isAMomentObject}function v(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function w(t,i){var s=!0;return c((function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),s){for(var a,o,r=[],l=arguments.length,h=0;h<l;h++){if(a="","object"==typeof arguments[h]){for(o in a+="\n["+h+"] ",arguments[0])n(arguments[0],o)&&(a+=o+": "+arguments[0][o]+", ");a=a.slice(0,-2)}else a=arguments[h];r.push(a)}v(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),s=!1}return i.apply(this,arguments)}),i)}var k={};function M(t,i){null!=e.deprecationHandler&&e.deprecationHandler(t,i),k[t]||(v(i),k[t]=!0)}function D(t){return"undefined"!=typeof Function&&t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function S(t,e){var i,a=c({},t);for(i in e)n(e,i)&&(s(t[i])&&s(e[i])?(a[i]={},c(a[i],t[i]),c(a[i],e[i])):null!=e[i]?a[i]=e[i]:delete a[i]);for(i in t)n(t,i)&&!n(e,i)&&s(t[i])&&(a[i]=c({},a[i]));return a}function C(t){null!=t&&this.set(t)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var P=Object.keys||function(t){var e,i=[];for(e in t)n(t,e)&&i.push(e);return i};function O(t,e,i){var s=""+Math.abs(t);return(0<=t?i?"+":"":"-")+Math.pow(10,Math.max(0,e-s.length)).toString().substr(1)+s}var T=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Y=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,A={},L={};function R(t,e,i,s){var n="string"==typeof s?function(){return this[s]()}:s;t&&(L[t]=n),e&&(L[e[0]]=function(){return O(n.apply(this,arguments),e[1],e[2])}),i&&(L[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function E(t,e){return t.isValid()?(e=I(e,t.localeData()),A[e]=A[e]||function(t){for(var e,i=t.match(T),s=0,n=i.length;s<n;s++)L[i[s]]?i[s]=L[i[s]]:i[s]=(e=i[s]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var s="",a=0;a<n;a++)s+=D(i[a])?i[a].call(e,t):i[a];return s}}(e),A[e](t)):t.localeData().invalidDate()}function I(t,e){var i=5;function s(t){return e.longDateFormat(t)||t}for(Y.lastIndex=0;0<=i&&Y.test(t);)t=t.replace(Y,s),Y.lastIndex=0,--i;return t}var N={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function F(t){return"string"==typeof t?N[t]||N[t.toLowerCase()]:void 0}function W(t){var e,i,s={};for(i in t)n(t,i)&&(e=F(i))&&(s[e]=t[i]);return s}var z={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},V=/\d/,H=/\d\d/,B=/\d{3}/,j=/\d{4}/,U=/[+-]?\d{6}/,$=/\d\d?/,G=/\d\d\d\d?/,q=/\d\d\d\d\d\d?/,X=/\d{1,3}/,Z=/\d{1,4}/,K=/[+-]?\d{1,6}/,J=/\d+/,Q=/[+-]?\d+/,tt=/Z|[+-]\d\d:?\d\d/gi,et=/Z|[+-]\d\d(?::?\d\d)?/gi,it=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,st=/^[1-9]\d?/,nt=/^([1-9]\d|\d)/;function at(t,e,i){ct[t]=D(e)?e:function(t,s){return t&&i?i:e}}function ot(t,e){return n(ct,t)?ct[t](e._strict,e._locale):new RegExp(rt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,s,n){return e||i||s||n}))))}function rt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function lt(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ht(t){var e=0;return 0!=(t=+t)&&isFinite(t)?lt(t):e}var ct={},dt={};function ut(t,e){var i,s,n=e;for("string"==typeof t&&(t=[t]),r(e)&&(n=function(t,i){i[e]=ht(t)}),s=t.length,i=0;i<s;i++)dt[t[i]]=n}function ft(t,e){ut(t,(function(t,i,s,n){s._w=s._w||{},e(t,s._w,s,n)}))}function pt(t){return t%4==0&&t%100!=0||t%400==0}var gt=0,mt=1,bt=2,yt=3,_t=4,xt=5,vt=6,wt=7,kt=8;function Mt(t){return pt(t)?366:365}R("Y",0,0,(function(){var t=this.year();return t<=9999?O(t,4):"+"+t})),R(0,["YY",2],0,(function(){return this.year()%100})),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),at("Y",Q),at("YY",$,H),at("YYYY",Z,j),at("YYYYY",K,U),at("YYYYYY",K,U),ut(["YYYYY","YYYYYY"],gt),ut("YYYY",(function(t,i){i[gt]=2===t.length?e.parseTwoDigitYear(t):ht(t)})),ut("YY",(function(t,i){i[gt]=e.parseTwoDigitYear(t)})),ut("Y",(function(t,e){e[gt]=parseInt(t,10)})),e.parseTwoDigitYear=function(t){return ht(t)+(68<ht(t)?1900:2e3)};var Dt,St=Ct("FullYear",!0);function Ct(t,i){return function(s){return null!=s?(Ot(this,t,s),e.updateOffset(this,i),this):Pt(this,t)}}function Pt(t,e){if(!t.isValid())return NaN;var i=t._d,s=t._isUTC;switch(e){case"Milliseconds":return s?i.getUTCMilliseconds():i.getMilliseconds();case"Seconds":return s?i.getUTCSeconds():i.getSeconds();case"Minutes":return s?i.getUTCMinutes():i.getMinutes();case"Hours":return s?i.getUTCHours():i.getHours();case"Date":return s?i.getUTCDate():i.getDate();case"Day":return s?i.getUTCDay():i.getDay();case"Month":return s?i.getUTCMonth():i.getMonth();case"FullYear":return s?i.getUTCFullYear():i.getFullYear();default:return NaN}}function Ot(t,e,i){var s,n,a;if(t.isValid()&&!isNaN(i)){switch(s=t._d,n=t._isUTC,e){case"Milliseconds":return n?s.setUTCMilliseconds(i):s.setMilliseconds(i);case"Seconds":return n?s.setUTCSeconds(i):s.setSeconds(i);case"Minutes":return n?s.setUTCMinutes(i):s.setMinutes(i);case"Hours":return n?s.setUTCHours(i):s.setHours(i);case"Date":return n?s.setUTCDate(i):s.setDate(i);case"FullYear":break;default:return}e=i,a=t.month(),t=29!==(t=t.date())||1!==a||pt(e)?t:28,n?s.setUTCFullYear(e,a,t):s.setFullYear(e,a,t)}}function Tt(t,e){var i;return isNaN(t)||isNaN(e)?NaN:(t+=(e-(i=(e%(i=12)+i)%i))/12,1==i?pt(t)?29:28:31-i%7%2)}Dt=Array.prototype.indexOf||function(t){for(var e=0;e<this.length;++e)if(this[e]===t)return e;return-1},R("M",["MM",2],"Mo",(function(){return this.month()+1})),R("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),R("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),at("M",$,st),at("MM",$,H),at("MMM",(function(t,e){return e.monthsShortRegex(t)})),at("MMMM",(function(t,e){return e.monthsRegex(t)})),ut(["M","MM"],(function(t,e){e[mt]=ht(t)-1})),ut(["MMM","MMMM"],(function(t,e,i,s){null!=(s=i._locale.monthsParse(t,s,i._strict))?e[mt]=s:u(i).invalidMonth=t}));var Yt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),At="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Lt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Rt=it,Et=it;function It(t,e){if(t.isValid()){if("string"==typeof e)if(/^\d+$/.test(e))e=ht(e);else if(!r(e=t.localeData().monthsParse(e)))return;var i=(i=t.date())<29?i:Math.min(i,Tt(t.year(),e));t._isUTC?t._d.setUTCMonth(e,i):t._d.setMonth(e,i)}}function Nt(t){return null!=t?(It(this,t),e.updateOffset(this,!0),this):Pt(this,"Month")}function Ft(){function t(t,e){return e.length-t.length}for(var e,i,s=[],n=[],a=[],o=0;o<12;o++)i=d([2e3,o]),e=rt(this.monthsShort(i,"")),i=rt(this.months(i,"")),s.push(e),n.push(i),a.push(i),a.push(e);s.sort(t),n.sort(t),a.sort(t),this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Wt(t,e,i,s,n,a,o){var r;return t<100&&0<=t?(r=new Date(t+400,e,i,s,n,a,o),isFinite(r.getFullYear())&&r.setFullYear(t)):r=new Date(t,e,i,s,n,a,o),r}function zt(t){var e;return t<100&&0<=t?((e=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,e)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Vt(t,e,i){return(i=7+e-i)-(7+zt(t,0,i).getUTCDay()-e)%7-1}function Ht(t,e,i,s,n){var a;i=(e=1+7*(e-1)+(7+i-s)%7+Vt(t,s,n))<=0?Mt(a=t-1)+e:e>Mt(t)?(a=t+1,e-Mt(t)):(a=t,e);return{year:a,dayOfYear:i}}function Bt(t,e,i){var s,n,a=Vt(t.year(),e,i);return(a=Math.floor((t.dayOfYear()-a-1)/7)+1)<1?s=a+jt(n=t.year()-1,e,i):a>jt(t.year(),e,i)?(s=a-jt(t.year(),e,i),n=t.year()+1):(n=t.year(),s=a),{week:s,year:n}}function jt(t,e,i){var s=Vt(t,e,i);e=Vt(t+1,e,i);return(Mt(t)-s+e)/7}function Ut(t,e){return t.slice(e,7).concat(t.slice(0,e))}R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),at("w",$,st),at("ww",$,H),at("W",$,st),at("WW",$,H),ft(["w","ww","W","WW"],(function(t,e,i,s){e[s.substr(0,1)]=ht(t)})),R("d",0,"do","day"),R("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),R("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),R("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),at("d",$),at("e",$),at("E",$),at("dd",(function(t,e){return e.weekdaysMinRegex(t)})),at("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),at("dddd",(function(t,e){return e.weekdaysRegex(t)})),ft(["dd","ddd","dddd"],(function(t,e,i,s){null!=(s=i._locale.weekdaysParse(t,s,i._strict))?e.d=s:u(i).invalidWeekday=t})),ft(["d","e","E"],(function(t,e,i,s){e[s]=ht(t)}));var $t="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),qt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Xt=it,Zt=it,Kt=it;function Jt(){function t(t,e){return e.length-t.length}for(var e,i,s,n=[],a=[],o=[],r=[],l=0;l<7;l++)s=d([2e3,1]).day(l),e=rt(this.weekdaysMin(s,"")),i=rt(this.weekdaysShort(s,"")),s=rt(this.weekdays(s,"")),n.push(e),a.push(i),o.push(s),r.push(e),r.push(i),r.push(s);n.sort(t),a.sort(t),o.sort(t),r.sort(t),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Qt(){return this.hours()%12||12}function te(t,e){R(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function ee(t,e){return e._meridiemParse}R("H",["HH",2],0,"hour"),R("h",["hh",2],0,Qt),R("k",["kk",2],0,(function(){return this.hours()||24})),R("hmm",0,0,(function(){return""+Qt.apply(this)+O(this.minutes(),2)})),R("hmmss",0,0,(function(){return""+Qt.apply(this)+O(this.minutes(),2)+O(this.seconds(),2)})),R("Hmm",0,0,(function(){return""+this.hours()+O(this.minutes(),2)})),R("Hmmss",0,0,(function(){return""+this.hours()+O(this.minutes(),2)+O(this.seconds(),2)})),te("a",!0),te("A",!1),at("a",ee),at("A",ee),at("H",$,nt),at("h",$,st),at("k",$,st),at("HH",$,H),at("hh",$,H),at("kk",$,H),at("hmm",G),at("hmmss",q),at("Hmm",G),at("Hmmss",q),ut(["H","HH"],yt),ut(["k","kk"],(function(t,e,i){t=ht(t),e[yt]=24===t?0:t})),ut(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),ut(["h","hh"],(function(t,e,i){e[yt]=ht(t),u(i).bigHour=!0})),ut("hmm",(function(t,e,i){var s=t.length-2;e[yt]=ht(t.substr(0,s)),e[_t]=ht(t.substr(s)),u(i).bigHour=!0})),ut("hmmss",(function(t,e,i){var s=t.length-4,n=t.length-2;e[yt]=ht(t.substr(0,s)),e[_t]=ht(t.substr(s,2)),e[xt]=ht(t.substr(n)),u(i).bigHour=!0})),ut("Hmm",(function(t,e,i){var s=t.length-2;e[yt]=ht(t.substr(0,s)),e[_t]=ht(t.substr(s))})),ut("Hmmss",(function(t,e,i){var s=t.length-4,n=t.length-2;e[yt]=ht(t.substr(0,s)),e[_t]=ht(t.substr(s,2)),e[xt]=ht(t.substr(n))})),it=Ct("Hours",!0);var ie,se={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Yt,monthsShort:At,week:{dow:0,doy:6},weekdays:$t,weekdaysMin:qt,weekdaysShort:Gt,meridiemParse:/[ap]\.?m?\.?/i},ne={},ae={};function oe(t){return t&&t.toLowerCase().replace("_","-")}function re(t){var e,i;if(void 0===ne[t]&&"undefined"!=typeof module&&module&&module.exports&&(i=t)&&i.match("^[^/\\\\]*$"))try{e=ie._abbr,require("./locale/"+t),le(e)}catch(e){ne[t]=null}return ne[t]}function le(t,e){return t&&((e=o(e)?ce(t):he(t,e))?ie=e:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ie._abbr}function he(t,e){if(null===e)return delete ne[t],null;var i,s=se;if(e.abbr=t,null!=ne[t])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=ne[t]._config;else if(null!=e.parentLocale)if(null!=ne[e.parentLocale])s=ne[e.parentLocale]._config;else{if(null==(i=re(e.parentLocale)))return ae[e.parentLocale]||(ae[e.parentLocale]=[]),ae[e.parentLocale].push({name:t,config:e}),null;s=i._config}return ne[t]=new C(S(s,e)),ae[t]&&ae[t].forEach((function(t){he(t.name,t.config)})),le(t),ne[t]}function ce(t){var e;if(!(t=t&&t._locale&&t._locale._abbr?t._locale._abbr:t))return ie;if(!i(t)){if(e=re(t))return e;t=[t]}return function(t){for(var e,i,s,n,a=0;a<t.length;){for(e=(n=oe(t[a]).split("-")).length,i=(i=oe(t[a+1]))?i.split("-"):null;0<e;){if(s=re(n.slice(0,e).join("-")))return s;if(i&&i.length>=e&&function(t,e){for(var i=Math.min(t.length,e.length),s=0;s<i;s+=1)if(t[s]!==e[s])return s;return i}(n,i)>=e-1)break;e--}a++}return ie}(t)}function de(t){var e=t._a;return e&&-2===u(t).overflow&&(e=e[mt]<0||11<e[mt]?mt:e[bt]<1||e[bt]>Tt(e[gt],e[mt])?bt:e[yt]<0||24<e[yt]||24===e[yt]&&(0!==e[_t]||0!==e[xt]||0!==e[vt])?yt:e[_t]<0||59<e[_t]?_t:e[xt]<0||59<e[xt]?xt:e[vt]<0||999<e[vt]?vt:-1,u(t)._overflowDayOfYear&&(e<gt||bt<e)&&(e=bt),u(t)._overflowWeeks&&-1===e&&(e=wt),u(t)._overflowWeekday&&-1===e&&(e=kt),u(t).overflow=e),t}var ue=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,fe=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pe=/Z|[+-]\d\d(?::?\d\d)?/,ge=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],me=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],be=/^\/?Date\((-?\d+)/i,ye=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,_e={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function xe(t){var e,i,s,n,a,o,r=t._i,l=ue.exec(r)||fe.exec(r),h=(r=ge.length,me.length);if(l){for(u(t).iso=!0,e=0,i=r;e<i;e++)if(ge[e][1].exec(l[1])){n=ge[e][0],s=!1!==ge[e][2];break}if(null==n)t._isValid=!1;else{if(l[3]){for(e=0,i=h;e<i;e++)if(me[e][1].exec(l[3])){a=(l[2]||" ")+me[e][0];break}if(null==a)return void(t._isValid=!1)}if(s||null==a){if(l[4]){if(!pe.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=n+(a||"")+(o||""),Me(t)}else t._isValid=!1}}else t._isValid=!1}function ve(t){var e,i,s=ye.exec(t._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));s?(e=function(t,e,i,s,n,a){return t=[function(t){return(t=parseInt(t,10))<=49?2e3+t:t<=999?1900+t:t}(t),At.indexOf(e),parseInt(i,10),parseInt(s,10),parseInt(n,10)],a&&t.push(parseInt(a,10)),t}(s[4],s[3],s[2],s[5],s[6],s[7]),function(t,e,i){if(!t||Gt.indexOf(t)===new Date(e[0],e[1],e[2]).getDay())return 1;u(i).weekdayMismatch=!0,i._isValid=!1}(s[1],e,t)&&(t._a=e,t._tzm=(e=s[8],i=s[9],s=s[10],e?_e[e]:i?0:((e=parseInt(s,10))-(i=e%100))/100*60+i),t._d=zt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),u(t).rfc2822=!0)):t._isValid=!1}function we(t,e,i){return null!=t?t:null!=e?e:i}function ke(t){var i,s,n,a,o,r,l,h,c,d,f,p=[];if(!t._d){for(n=t,a=new Date(e.now()),s=n._useUTC?[a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()]:[a.getFullYear(),a.getMonth(),a.getDate()],t._w&&null==t._a[bt]&&null==t._a[mt]&&(null!=(a=(n=t)._w).GG||null!=a.W||null!=a.E?(h=1,c=4,o=we(a.GG,n._a[gt],Bt(Ce(),1,4).year),r=we(a.W,1),((l=we(a.E,1))<1||7<l)&&(d=!0)):(h=n._locale._week.dow,c=n._locale._week.doy,f=Bt(Ce(),h,c),o=we(a.gg,n._a[gt],f.year),r=we(a.w,f.week),null!=a.d?((l=a.d)<0||6<l)&&(d=!0):null!=a.e?(l=a.e+h,(a.e<0||6<a.e)&&(d=!0)):l=h),r<1||r>jt(o,h,c)?u(n)._overflowWeeks=!0:null!=d?u(n)._overflowWeekday=!0:(f=Ht(o,r,l,h,c),n._a[gt]=f.year,n._dayOfYear=f.dayOfYear)),null!=t._dayOfYear&&(a=we(t._a[gt],s[gt]),(t._dayOfYear>Mt(a)||0===t._dayOfYear)&&(u(t)._overflowDayOfYear=!0),d=zt(a,0,t._dayOfYear),t._a[mt]=d.getUTCMonth(),t._a[bt]=d.getUTCDate()),i=0;i<3&&null==t._a[i];++i)t._a[i]=p[i]=s[i];for(;i<7;i++)t._a[i]=p[i]=null==t._a[i]?2===i?1:0:t._a[i];24===t._a[yt]&&0===t._a[_t]&&0===t._a[xt]&&0===t._a[vt]&&(t._nextDay=!0,t._a[yt]=0),t._d=(t._useUTC?zt:Wt).apply(null,p),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[yt]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(u(t).weekdayMismatch=!0)}}function Me(t){if(t._f===e.ISO_8601)xe(t);else if(t._f===e.RFC_2822)ve(t);else{t._a=[],u(t).empty=!0;for(var i,s,a,o,r,l=""+t._i,h=l.length,c=0,d=I(t._f,t._locale).match(T)||[],f=d.length,p=0;p<f;p++)s=d[p],(i=(l.match(ot(s,t))||[])[0])&&(0<(a=l.substr(0,l.indexOf(i))).length&&u(t).unusedInput.push(a),l=l.slice(l.indexOf(i)+i.length),c+=i.length),L[s]?(i?u(t).empty=!1:u(t).unusedTokens.push(s),a=s,r=t,null!=(o=i)&&n(dt,a)&&dt[a](o,r._a,r,a)):t._strict&&!i&&u(t).unusedTokens.push(s);u(t).charsLeftOver=h-c,0<l.length&&u(t).unusedInput.push(l),t._a[yt]<=12&&!0===u(t).bigHour&&0<t._a[yt]&&(u(t).bigHour=void 0),u(t).parsedDateParts=t._a.slice(0),u(t).meridiem=t._meridiem,t._a[yt]=function(t,e,i){return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((t=t.isPM(i))&&e<12&&(e+=12),e=t||12!==e?e:0):e}(t._locale,t._a[yt],t._meridiem),null!==(h=u(t).era)&&(t._a[gt]=t._locale.erasConvertYear(h,t._a[gt])),ke(t),de(t)}}function De(t){var n,a,d,g=t._i,m=t._f;if(t._locale=t._locale||ce(t._l),null===g||void 0===m&&""===g)return p({nullInput:!0});if("string"==typeof g&&(t._i=g=t._locale.preparse(g)),x(g))return new _(de(g));if(l(g))t._d=g;else if(i(m)){var b,v,w,k,M,D,S=t,C=!1,P=S._f.length;if(0===P)u(S).invalidFormat=!0,S._d=new Date(NaN);else{for(k=0;k<P;k++)M=0,D=!1,b=y({},S),null!=S._useUTC&&(b._useUTC=S._useUTC),b._f=S._f[k],Me(b),f(b)&&(D=!0),M=(M+=u(b).charsLeftOver)+10*u(b).unusedTokens.length,u(b).score=M,C?M<w&&(w=M,v=b):(null==w||M<w||D)&&(w=M,v=b,D)&&(C=!0);c(S,v||b)}}else m?Me(t):o(m=(g=t)._i)?g._d=new Date(e.now()):l(m)?g._d=new Date(m.valueOf()):"string"==typeof m?(a=g,null!==(n=be.exec(a._i))?a._d=new Date(+n[1]):(xe(a),!1===a._isValid&&(delete a._isValid,ve(a),!1===a._isValid)&&(delete a._isValid,a._strict?a._isValid=!1:e.createFromInputFallback(a)))):i(m)?(g._a=h(m.slice(0),(function(t){return parseInt(t,10)})),ke(g)):s(m)?(n=g)._d||(d=void 0===(a=W(n._i)).day?a.date:a.day,n._a=h([a.year,a.month,d,a.hour,a.minute,a.second,a.millisecond],(function(t){return t&&parseInt(t,10)})),ke(n)):r(m)?g._d=new Date(m):e.createFromInputFallback(g);return f(t)||(t._d=null),t}function Se(t,e,n,o,r){var l={};return!0!==e&&!1!==e||(o=e,e=void 0),!0!==n&&!1!==n||(o=n,n=void 0),(s(t)&&a(t)||i(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=r,l._l=n,l._i=t,l._f=e,l._strict=o,(r=new _(de(De(r=l))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Ce(t,e,i,s){return Se(t,e,i,s,!1)}function Pe(t,e){var s,n;if(!(e=1===e.length&&i(e[0])?e[0]:e).length)return Ce();for(s=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](s)||(s=e[n]);return s}e.createFromInputFallback=w("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),e.ISO_8601=function(){},e.RFC_2822=function(){},G=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Ce.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:p()})),q=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Ce.apply(null,arguments);return this.isValid()&&t.isValid()?this<t?this:t:p()}));var Oe=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Te(t){var e=(t=W(t)).year||0,i=t.quarter||0,s=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,r=t.hour||0,l=t.minute||0,h=t.second||0,c=t.millisecond||0;this._isValid=function(t){var e,i,s=!1,a=Oe.length;for(e in t)if(n(t,e)&&(-1===Dt.call(Oe,e)||null!=t[e]&&isNaN(t[e])))return!1;for(i=0;i<a;++i)if(t[Oe[i]]){if(s)return!1;parseFloat(t[Oe[i]])!==ht(t[Oe[i]])&&(s=!0)}return!0}(t),this._milliseconds=+c+1e3*h+6e4*l+1e3*r*60*60,this._days=+o+7*a,this._months=+s+3*i+12*e,this._data={},this._locale=ce(),this._bubble()}function Ye(t){return t instanceof Te}function Ae(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function Le(t,e){R(t,0,0,(function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+O(~~(t/60),2)+e+O(~~t%60,2)}))}Le("Z",":"),Le("ZZ",""),at("Z",et),at("ZZ",et),ut(["Z","ZZ"],(function(t,e,i){i._useUTC=!0,i._tzm=Ee(et,t)}));var Re=/([\+\-]|\d\d)/gi;function Ee(t,e){return null===(e=(e||"").match(t))?null:0===(e=60*(t=((e[e.length-1]||[])+"").match(Re)||["-",0,0])[1]+ht(t[2]))?0:"+"===t[0]?e:-e}function Ie(t,i){var s;return i._isUTC?(i=i.clone(),s=(x(t)||l(t)?t:Ce(t)).valueOf()-i.valueOf(),i._d.setTime(i._d.valueOf()+s),e.updateOffset(i,!1),i):Ce(t).local()}function Ne(t){return-Math.round(t._d.getTimezoneOffset())}function Fe(){return!!this.isValid()&&this._isUTC&&0===this._offset}e.updateOffset=function(){};var We=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ze=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ve(t,e){var i,s=t;return Ye(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:r(t)||!isNaN(+t)?(s={},e?s[e]=+t:s.milliseconds=+t):(e=We.exec(t))?(i="-"===e[1]?-1:1,s={y:0,d:ht(e[bt])*i,h:ht(e[yt])*i,m:ht(e[_t])*i,s:ht(e[xt])*i,ms:ht(Ae(1e3*e[vt]))*i}):(e=ze.exec(t))?(i="-"===e[1]?-1:1,s={y:He(e[2],i),M:He(e[3],i),w:He(e[4],i),d:He(e[5],i),h:He(e[6],i),m:He(e[7],i),s:He(e[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(e=function(t,e){var i;return t.isValid()&&e.isValid()?(e=Ie(e,t),t.isBefore(e)?i=Be(t,e):((i=Be(e,t)).milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}(Ce(s.from),Ce(s.to)),(s={}).ms=e.milliseconds,s.M=e.months),i=new Te(s),Ye(t)&&n(t,"_locale")&&(i._locale=t._locale),Ye(t)&&n(t,"_isValid")&&(i._isValid=t._isValid),i}function He(t,e){return t=t&&parseFloat(t.replace(",",".")),(isNaN(t)?0:t)*e}function Be(t,e){var i={};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function je(t,e){return function(i,s){var n;return null===s||isNaN(+s)||(M(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=i,i=s,s=n),Ue(this,Ve(i,s),t),this}}function Ue(t,i,s,n){var a=i._milliseconds,o=Ae(i._days);i=Ae(i._months);t.isValid()&&(n=null==n||n,i&&It(t,Pt(t,"Month")+i*s),o&&Ot(t,"Date",Pt(t,"Date")+o*s),a&&t._d.setTime(t._d.valueOf()+a*s),n)&&e.updateOffset(t,o||i)}function $e(t){return"string"==typeof t||t instanceof String}function Ge(t,e){var i,s;return t.date()<e.date()?-Ge(e,t):-((i=12*(e.year()-t.year())+(e.month()-t.month()))+(e-(s=t.clone().add(i,"months"))<0?(e-s)/(s-t.clone().add(i-1,"months")):(e-s)/(t.clone().add(1+i,"months")-s)))||0}function qe(t){return void 0===t?this._locale._abbr:(null!=(t=ce(t))&&(this._locale=t),this)}function Xe(){return this._locale}Ve.fn=Te.prototype,Ve.invalid=function(){return Ve(NaN)},Yt=je(1,"add"),$t=je(-1,"subtract"),e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",qt=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));var Ze=126227808e5;function Ke(t,e){return(t%e+e)%e}function Je(t,e,i){return t<100&&0<=t?new Date(t+400,e,i)-Ze:new Date(t,e,i).valueOf()}function Qe(t,e,i){return t<100&&0<=t?Date.UTC(t+400,e,i)-Ze:Date.UTC(t,e,i)}function ti(t,e){return e.erasAbbrRegex(t)}function ei(){for(var t,e,i,s=[],n=[],a=[],o=[],r=this.eras(),l=0,h=r.length;l<h;++l)t=rt(r[l].name),e=rt(r[l].abbr),i=rt(r[l].narrow),n.push(t),s.push(e),a.push(i),o.push(t),o.push(e),o.push(i);this._erasRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}function ii(t,e){R(0,[t,t.length],0,e)}function si(t,e,i,s,n){var a;return null==t?Bt(this,s,n).year:(a=jt(t,s,n),function(t,e,i,s,n){return e=zt((t=Ht(t,e,i,s,n)).year,0,t.dayOfYear),this.year(e.getUTCFullYear()),this.month(e.getUTCMonth()),this.date(e.getUTCDate()),this}.call(this,t,e=a<e?a:e,i,s,n))}R("N",0,0,"eraAbbr"),R("NN",0,0,"eraAbbr"),R("NNN",0,0,"eraAbbr"),R("NNNN",0,0,"eraName"),R("NNNNN",0,0,"eraNarrow"),R("y",["y",1],"yo","eraYear"),R("y",["yy",2],0,"eraYear"),R("y",["yyy",3],0,"eraYear"),R("y",["yyyy",4],0,"eraYear"),at("N",ti),at("NN",ti),at("NNN",ti),at("NNNN",(function(t,e){return e.erasNameRegex(t)})),at("NNNNN",(function(t,e){return e.erasNarrowRegex(t)})),ut(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,i,s){(s=i._locale.erasParse(t,s,i._strict))?u(i).era=s:u(i).invalidEra=t})),at("y",J),at("yy",J),at("yyy",J),at("yyyy",J),at("yo",(function(t,e){return e._eraYearOrdinalRegex||J})),ut(["y","yy","yyy","yyyy"],gt),ut(["yo"],(function(t,e,i,s){var n;i._locale._eraYearOrdinalRegex&&(n=t.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?e[gt]=i._locale.eraYearOrdinalParse(t,n):e[gt]=parseInt(t,10)})),R(0,["gg",2],0,(function(){return this.weekYear()%100})),R(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),ii("gggg","weekYear"),ii("ggggg","weekYear"),ii("GGGG","isoWeekYear"),ii("GGGGG","isoWeekYear"),at("G",Q),at("g",Q),at("GG",$,H),at("gg",$,H),at("GGGG",Z,j),at("gggg",Z,j),at("GGGGG",K,U),at("ggggg",K,U),ft(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,s){e[s.substr(0,2)]=ht(t)})),ft(["gg","GG"],(function(t,i,s,n){i[n]=e.parseTwoDigitYear(t)})),R("Q",0,"Qo","quarter"),at("Q",V),ut("Q",(function(t,e){e[mt]=3*(ht(t)-1)})),R("D",["DD",2],"Do","date"),at("D",$,st),at("DD",$,H),at("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),ut(["D","DD"],bt),ut("Do",(function(t,e){e[bt]=ht(t.match($)[0])})),Z=Ct("Date",!0),R("DDD",["DDDD",3],"DDDo","dayOfYear"),at("DDD",X),at("DDDD",B),ut(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=ht(t)})),R("m",["mm",2],0,"minute"),at("m",$,nt),at("mm",$,H),ut(["m","mm"],_t);var ni;j=Ct("Minutes",!1),R("s",["ss",2],0,"second"),at("s",$,nt),at("ss",$,H),ut(["s","ss"],xt),K=Ct("Seconds",!1);for(R("S",0,0,(function(){return~~(this.millisecond()/100)})),R(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),R(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),R(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),R(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),R(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),R(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),at("S",X,V),at("SS",X,H),at("SSS",X,B),ni="SSSS";ni.length<=9;ni+="S")at(ni,J);function ai(t,e){e[vt]=ht(1e3*("0."+t))}for(ni="S";ni.length<=9;ni+="S")ut(ni,ai);function oi(t){return t}function ri(t,e,i,s){var n=ce();s=d().set(s,e);return n[i](s,t)}function li(t,e,i){if(r(t)&&(e=t,t=void 0),t=t||"",null!=e)return ri(t,e,i,"month");for(var s=[],n=0;n<12;n++)s[n]=ri(t,n,i,"month");return s}function hi(t,e,i,s){"boolean"==typeof t?r(e)&&(i=e,e=void 0):(e=t,t=!1,r(i=e)&&(i=e,e=void 0)),e=e||"";var n,a=ce(),o=t?a._week.dow:0,l=[];if(null!=i)return ri(e,(i+o)%7,s,"day");for(n=0;n<7;n++)l[n]=ri(e,(n+o)%7,s,"day");return l}U=Ct("Milliseconds",!1),R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName"),(st=_.prototype).add=Yt,st.calendar=function(t,o){1===arguments.length&&(arguments[0]?function(t){return x(t)||l(t)||$e(t)||r(t)||function(t){var e=i(t),s=!1;return e&&(s=0===t.filter((function(e){return!r(e)&&$e(t)})).length),e&&s}(t)||function(t){var e,i=s(t)&&!a(t),o=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],l=r.length;for(e=0;e<l;e+=1)o=o||n(t,r[e]);return i&&o}(t)||null==t}(arguments[0])?(t=arguments[0],o=void 0):function(t){for(var e=s(t)&&!a(t),i=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r=0;r<o.length;r+=1)i=i||n(t,o[r]);return e&&i}(arguments[0])&&(o=arguments[0],t=void 0):o=t=void 0);var h=Ie(t=t||Ce(),this).startOf("day");h=e.calendarFormat(this,h)||"sameElse",o=o&&(D(o[h])?o[h].call(this,t):o[h]);return this.format(o||this.localeData().calendar(h,this,Ce(t)))},st.clone=function(){return new _(this)},st.diff=function(t,e,i){var s,n,a;if(!this.isValid())return NaN;if(!(s=Ie(t,this)).isValid())return NaN;switch(n=6e4*(s.utcOffset()-this.utcOffset()),e=F(e)){case"year":a=Ge(this,s)/12;break;case"month":a=Ge(this,s);break;case"quarter":a=Ge(this,s)/3;break;case"second":a=(this-s)/1e3;break;case"minute":a=(this-s)/6e4;break;case"hour":a=(this-s)/36e5;break;case"day":a=(this-s-n)/864e5;break;case"week":a=(this-s-n)/6048e5;break;default:a=this-s}return i?a:lt(a)},st.endOf=function(t){var i,s;if(void 0!==(t=F(t))&&"millisecond"!==t&&this.isValid()){switch(s=this._isUTC?Qe:Je,t){case"year":i=s(this.year()+1,0,1)-1;break;case"quarter":i=s(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":i=s(this.year(),this.month()+1,1)-1;break;case"week":i=s(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":i=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":i=s(this.year(),this.month(),this.date()+1)-1;break;case"hour":i=this._d.valueOf(),i+=36e5-Ke(i+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":i=this._d.valueOf(),i+=6e4-Ke(i,6e4)-1;break;case"second":i=this._d.valueOf(),i+=1e3-Ke(i,1e3)-1}this._d.setTime(i),e.updateOffset(this,!0)}return this},st.format=function(t){return t=E(this,t=t||(this.isUtc()?e.defaultFormatUtc:e.defaultFormat)),this.localeData().postformat(t)},st.from=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||Ce(t).isValid())?Ve({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},st.fromNow=function(t){return this.from(Ce(),t)},st.to=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||Ce(t).isValid())?Ve({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},st.toNow=function(t){return this.to(Ce(),t)},st.get=function(t){return D(this[t=F(t)])?this[t]():this},st.invalidAt=function(){return u(this).overflow},st.isAfter=function(t,e){return t=x(t)?t:Ce(t),!(!this.isValid()||!t.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf())},st.isBefore=function(t,e){return t=x(t)?t:Ce(t),!(!this.isValid()||!t.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf())},st.isBetween=function(t,e,i,s){return t=x(t)?t:Ce(t),e=x(e)?e:Ce(e),!!(this.isValid()&&t.isValid()&&e.isValid())&&("("===(s=s||"()")[0]?this.isAfter(t,i):!this.isBefore(t,i))&&(")"===s[1]?this.isBefore(e,i):!this.isAfter(e,i))},st.isSame=function(t,e){t=x(t)?t:Ce(t);return!(!this.isValid()||!t.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()===t.valueOf():(t=t.valueOf(),this.clone().startOf(e).valueOf()<=t&&t<=this.clone().endOf(e).valueOf()))},st.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},st.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},st.isValid=function(){return f(this)},st.lang=qt,st.locale=qe,st.localeData=Xe,st.max=q,st.min=G,st.parsingFlags=function(){return c({},u(this))},st.set=function(t,e){if("object"==typeof t)for(var i=function(t){var e,i=[];for(e in t)n(t,e)&&i.push({unit:e,priority:z[e]});return i.sort((function(t,e){return t.priority-e.priority})),i}(t=W(t)),s=i.length,a=0;a<s;a++)this[i[a].unit](t[i[a].unit]);else if(D(this[t=F(t)]))return this[t](e);return this},st.startOf=function(t){var i,s;if(void 0!==(t=F(t))&&"millisecond"!==t&&this.isValid()){switch(s=this._isUTC?Qe:Je,t){case"year":i=s(this.year(),0,1);break;case"quarter":i=s(this.year(),this.month()-this.month()%3,1);break;case"month":i=s(this.year(),this.month(),1);break;case"week":i=s(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":i=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":i=s(this.year(),this.month(),this.date());break;case"hour":i=this._d.valueOf(),i-=Ke(i+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":i=this._d.valueOf(),i-=Ke(i,6e4);break;case"second":i=this._d.valueOf(),i-=Ke(i,1e3)}this._d.setTime(i),e.updateOffset(this,!0)}return this},st.subtract=$t,st.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},st.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},st.toDate=function(){return new Date(this.valueOf())},st.toISOString=function(t){var e;return this.isValid()?(e=(t=!0!==t)?this.clone().utc():this).year()<0||9999<e.year()?E(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",E(e,"Z")):E(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ"):null},st.inspect=function(){var t,e,i;return this.isValid()?(e="moment",t="",this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z"),e="["+e+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+i+"-MM-DD[T]HH:mm:ss.SSS"+t+'[")]')):"moment.invalid(/* "+this._i+" */)"},"undefined"!=typeof Symbol&&null!=Symbol.for&&(st[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),st.toJSON=function(){return this.isValid()?this.toISOString():null},st.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},st.unix=function(){return Math.floor(this.valueOf()/1e3)},st.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},st.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},st.eraName=function(){for(var t,e=this.localeData().eras(),i=0,s=e.length;i<s;++i){if(t=this.clone().startOf("day").valueOf(),e[i].since<=t&&t<=e[i].until)return e[i].name;if(e[i].until<=t&&t<=e[i].since)return e[i].name}return""},st.eraNarrow=function(){for(var t,e=this.localeData().eras(),i=0,s=e.length;i<s;++i){if(t=this.clone().startOf("day").valueOf(),e[i].since<=t&&t<=e[i].until)return e[i].narrow;if(e[i].until<=t&&t<=e[i].since)return e[i].narrow}return""},st.eraAbbr=function(){for(var t,e=this.localeData().eras(),i=0,s=e.length;i<s;++i){if(t=this.clone().startOf("day").valueOf(),e[i].since<=t&&t<=e[i].until)return e[i].abbr;if(e[i].until<=t&&t<=e[i].since)return e[i].abbr}return""},st.eraYear=function(){for(var t,i,s=this.localeData().eras(),n=0,a=s.length;n<a;++n)if(t=s[n].since<=s[n].until?1:-1,i=this.clone().startOf("day").valueOf(),s[n].since<=i&&i<=s[n].until||s[n].until<=i&&i<=s[n].since)return(this.year()-e(s[n].since).year())*t+s[n].offset;return this.year()},st.year=St,st.isLeapYear=function(){return pt(this.year())},st.weekYear=function(t){return si.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},st.isoWeekYear=function(t){return si.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},st.quarter=st.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},st.month=Nt,st.daysInMonth=function(){return Tt(this.year(),this.month())},st.week=st.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},st.isoWeek=st.isoWeeks=function(t){var e=Bt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},st.weeksInYear=function(){var t=this.localeData()._week;return jt(this.year(),t.dow,t.doy)},st.weeksInWeekYear=function(){var t=this.localeData()._week;return jt(this.weekYear(),t.dow,t.doy)},st.isoWeeksInYear=function(){return jt(this.year(),1,4)},st.isoWeeksInISOWeekYear=function(){return jt(this.isoWeekYear(),1,4)},st.date=Z,st.day=st.days=function(t){var e,i,s;return this.isValid()?(e=Pt(this,"Day"),null!=t?(i=t,s=this.localeData(),t="string"!=typeof i?i:isNaN(i)?"number"==typeof(i=s.weekdaysParse(i))?i:null:parseInt(i,10),this.add(t-e,"d")):e):null!=t?this:NaN},st.weekday=function(t){var e;return this.isValid()?(e=(this.day()+7-this.localeData()._week.dow)%7,null==t?e:this.add(t-e,"d")):null!=t?this:NaN},st.isoWeekday=function(t){var e,i;return this.isValid()?null!=t?(e=t,i=this.localeData(),i="string"==typeof e?i.weekdaysParse(e)%7||7:isNaN(e)?null:e,this.day(this.day()%7?i:i-7)):this.day()||7:null!=t?this:NaN},st.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},st.hour=st.hours=it,st.minute=st.minutes=j,st.second=st.seconds=K,st.millisecond=st.milliseconds=U,st.utcOffset=function(t,i,s){var n,a=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null==t)return this._isUTC?a:Ne(this);if("string"==typeof t){if(null===(t=Ee(et,t)))return this}else Math.abs(t)<16&&!s&&(t*=60);return!this._isUTC&&i&&(n=Ne(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),a!==t&&(!i||this._changeInProgress?Ue(this,Ve(t-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this},st.utc=function(t){return this.utcOffset(0,t)},st.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t)&&this.subtract(Ne(this),"m"),this},st.parseZone=function(){var t;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(t=Ee(tt,this._i))?this.utcOffset(t):this.utcOffset(0,!0)),this},st.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Ce(t).utcOffset():0,(this.utcOffset()-t)%60==0)},st.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},st.isLocal=function(){return!!this.isValid()&&!this._isUTC},st.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},st.isUtc=Fe,st.isUTC=Fe,st.zoneAbbr=function(){return this._isUTC?"UTC":""},st.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},st.dates=w("dates accessor is deprecated. Use date instead.",Z),st.months=w("months accessor is deprecated. Use month instead",Nt),st.years=w("years accessor is deprecated. Use year instead",St),st.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?(this.utcOffset(t="string"!=typeof t?-t:t,e),this):-this.utcOffset()})),st.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){var t,e;return o(this._isDSTShifted)&&(y(t={},this),(t=De(t))._a?(e=(t._isUTC?d:Ce)(t._a),this._isDSTShifted=this.isValid()&&0<function(t,e){for(var i=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),n=0,a=0;a<i;a++)ht(t[a])!==ht(e[a])&&n++;return n+s}(t._a,e.toArray())):this._isDSTShifted=!1),this._isDSTShifted})),(nt=C.prototype).calendar=function(t,e,i){return D(t=this._calendar[t]||this._calendar.sameElse)?t.call(e,i):t},nt.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.match(T).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])},nt.invalidDate=function(){return this._invalidDate},nt.ordinal=function(t){return this._ordinal.replace("%d",t)},nt.preparse=oi,nt.postformat=oi,nt.relativeTime=function(t,e,i,s){var n=this._relativeTime[i];return D(n)?n(t,e,i,s):n.replace(/%d/i,t)},nt.pastFuture=function(t,e){return D(t=this._relativeTime[0<t?"future":"past"])?t(e):t.replace(/%s/i,e)},nt.set=function(t){var e,i;for(i in t)n(t,i)&&(D(e=t[i])?this[i]=e:this["_"+i]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},nt.eras=function(t,i){for(var s,n=this._eras||ce("en")._eras,a=0,o=n.length;a<o;++a){if("string"==typeof n[a].since)s=e(n[a].since).startOf("day"),n[a].since=s.valueOf();switch(typeof n[a].until){case"undefined":n[a].until=1/0;break;case"string":s=e(n[a].until).startOf("day").valueOf(),n[a].until=s.valueOf()}}return n},nt.erasParse=function(t,e,i){var s,n,a,o,r,l=this.eras();for(t=t.toUpperCase(),s=0,n=l.length;s<n;++s)if(a=l[s].name.toUpperCase(),o=l[s].abbr.toUpperCase(),r=l[s].narrow.toUpperCase(),i)switch(e){case"N":case"NN":case"NNN":if(o===t)return l[s];break;case"NNNN":if(a===t)return l[s];break;case"NNNNN":if(r===t)return l[s]}else if(0<=[a,o,r].indexOf(t))return l[s]},nt.erasConvertYear=function(t,i){var s=t.since<=t.until?1:-1;return void 0===i?e(t.since).year():e(t.since).year()+(i-t.offset)*s},nt.erasAbbrRegex=function(t){return n(this,"_erasAbbrRegex")||ei.call(this),t?this._erasAbbrRegex:this._erasRegex},nt.erasNameRegex=function(t){return n(this,"_erasNameRegex")||ei.call(this),t?this._erasNameRegex:this._erasRegex},nt.erasNarrowRegex=function(t){return n(this,"_erasNarrowRegex")||ei.call(this),t?this._erasNarrowRegex:this._erasRegex},nt.months=function(t,e){return t?(i(this._months)?this._months:this._months[(this._months.isFormat||Lt).test(e)?"format":"standalone"])[t.month()]:i(this._months)?this._months:this._months.standalone},nt.monthsShort=function(t,e){return t?(i(this._monthsShort)?this._monthsShort:this._monthsShort[Lt.test(e)?"format":"standalone"])[t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},nt.monthsParse=function(t,e,i){var s,n;if(this._monthsParseExact)return function(t,e,i){var s,n,a;t=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)a=d([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(a,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(n=Dt.call(this._shortMonthsParse,t))?n:null:-1!==(n=Dt.call(this._longMonthsParse,t))?n:null:"MMM"===e?-1!==(n=Dt.call(this._shortMonthsParse,t))||-1!==(n=Dt.call(this._longMonthsParse,t))?n:null:-1!==(n=Dt.call(this._longMonthsParse,t))||-1!==(n=Dt.call(this._shortMonthsParse,t))?n:null}.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(n=d([2e3,s]),i&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),i||this._monthsParse[s]||(n="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[s]=new RegExp(n.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[s].test(t))return s;if(i&&"MMM"===e&&this._shortMonthsParse[s].test(t))return s;if(!i&&this._monthsParse[s].test(t))return s}},nt.monthsRegex=function(t){return this._monthsParseExact?(n(this,"_monthsRegex")||Ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):(n(this,"_monthsRegex")||(this._monthsRegex=Et),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},nt.monthsShortRegex=function(t){return this._monthsParseExact?(n(this,"_monthsRegex")||Ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(n(this,"_monthsShortRegex")||(this._monthsShortRegex=Rt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},nt.week=function(t){return Bt(t,this._week.dow,this._week.doy).week},nt.firstDayOfYear=function(){return this._week.doy},nt.firstDayOfWeek=function(){return this._week.dow},nt.weekdays=function(t,e){return e=i(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"],!0===t?Ut(e,this._week.dow):t?e[t.day()]:e},nt.weekdaysMin=function(t){return!0===t?Ut(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},nt.weekdaysShort=function(t){return!0===t?Ut(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},nt.weekdaysParse=function(t,e,i){var s,n;if(this._weekdaysParseExact)return function(t,e,i){var s,n,a;t=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)a=d([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(a,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(n=Dt.call(this._weekdaysParse,t))?n:null:"ddd"===e?-1!==(n=Dt.call(this._shortWeekdaysParse,t))?n:null:-1!==(n=Dt.call(this._minWeekdaysParse,t))?n:null:"dddd"===e?-1!==(n=Dt.call(this._weekdaysParse,t))||-1!==(n=Dt.call(this._shortWeekdaysParse,t))||-1!==(n=Dt.call(this._minWeekdaysParse,t))?n:null:"ddd"===e?-1!==(n=Dt.call(this._shortWeekdaysParse,t))||-1!==(n=Dt.call(this._weekdaysParse,t))||-1!==(n=Dt.call(this._minWeekdaysParse,t))?n:null:-1!==(n=Dt.call(this._minWeekdaysParse,t))||-1!==(n=Dt.call(this._weekdaysParse,t))||-1!==(n=Dt.call(this._shortWeekdaysParse,t))?n:null}.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(n=d([2e3,1]).day(s),i&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(n,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(n,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(n,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(n="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[s]=new RegExp(n.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[s].test(t))return s;if(i&&"ddd"===e&&this._shortWeekdaysParse[s].test(t))return s;if(i&&"dd"===e&&this._minWeekdaysParse[s].test(t))return s;if(!i&&this._weekdaysParse[s].test(t))return s}},nt.weekdaysRegex=function(t){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(n(this,"_weekdaysRegex")||(this._weekdaysRegex=Xt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},nt.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(n(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Zt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},nt.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(n(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(n(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Kt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},nt.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},nt.meridiem=function(t,e,i){return 11<t?i?"pm":"PM":i?"am":"AM"},le("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ht(t%100/10)?"th":1==e?"st":2==e?"nd":3==e?"rd":"th")}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",le),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",ce);var ci=Math.abs;function di(t,e,i,s){return e=Ve(e,i),t._milliseconds+=s*e._milliseconds,t._days+=s*e._days,t._months+=s*e._months,t._bubble()}function ui(t){return t<0?Math.floor(t):Math.ceil(t)}function fi(t){return 4800*t/146097}function pi(t){return 146097*t/4800}function gi(t){return function(){return this.as(t)}}function mi(t){return function(){return this.isValid()?this._data[t]:NaN}}V=gi("ms"),H=gi("s"),X=gi("m"),B=gi("h"),Yt=gi("d"),q=gi("w"),G=gi("M"),$t=gi("Q"),it=gi("y"),j=V;K=mi("milliseconds"),U=mi("seconds"),Z=mi("minutes"),St=mi("hours"),nt=mi("days");var bi=mi("months"),yi=mi("years"),_i=Math.round,xi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};var vi=Math.abs;function wi(t){return(0<t)-(t<0)||+t}function ki(){var t,e,i,s,n,a,o,r,l,h,c;return this.isValid()?(t=vi(this._milliseconds)/1e3,e=vi(this._days),i=vi(this._months),(r=this.asSeconds())?(s=lt(t/60),n=lt(s/60),t%=60,s%=60,a=lt(i/12),i%=12,o=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=wi(this._months)!==wi(r)?"-":"",h=wi(this._days)!==wi(r)?"-":"",c=wi(this._milliseconds)!==wi(r)?"-":"",(r<0?"-":"")+"P"+(a?l+a+"Y":"")+(i?l+i+"M":"")+(e?h+e+"D":"")+(n||s||t?"T":"")+(n?c+n+"H":"")+(s?c+s+"M":"")+(t?c+o+"S":"")):"P0D"):this.localeData().invalidDate()}var Mi=Te.prototype;return Mi.isValid=function(){return this._isValid},Mi.abs=function(){var t=this._data;return this._milliseconds=ci(this._milliseconds),this._days=ci(this._days),this._months=ci(this._months),t.milliseconds=ci(t.milliseconds),t.seconds=ci(t.seconds),t.minutes=ci(t.minutes),t.hours=ci(t.hours),t.months=ci(t.months),t.years=ci(t.years),this},Mi.add=function(t,e){return di(this,t,e,1)},Mi.subtract=function(t,e){return di(this,t,e,-1)},Mi.as=function(t){if(!this.isValid())return NaN;var e,i,s=this._milliseconds;if("month"===(t=F(t))||"quarter"===t||"year"===t)switch(e=this._days+s/864e5,i=this._months+fi(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(pi(this._months)),t){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return 24*e+s/36e5;case"minute":return 1440*e+s/6e4;case"second":return 86400*e+s/1e3;case"millisecond":return Math.floor(864e5*e)+s;default:throw new Error("Unknown unit "+t)}},Mi.asMilliseconds=V,Mi.asSeconds=H,Mi.asMinutes=X,Mi.asHours=B,Mi.asDays=Yt,Mi.asWeeks=q,Mi.asMonths=G,Mi.asQuarters=$t,Mi.asYears=it,Mi.valueOf=j,Mi._bubble=function(){var t=this._milliseconds,e=this._days,i=this._months,s=this._data;return 0<=t&&0<=e&&0<=i||t<=0&&e<=0&&i<=0||(t+=864e5*ui(pi(i)+e),i=e=0),s.milliseconds=t%1e3,t=lt(t/1e3),s.seconds=t%60,t=lt(t/60),s.minutes=t%60,t=lt(t/60),s.hours=t%24,e+=lt(t/24),i+=t=lt(fi(e)),e-=ui(pi(t)),t=lt(i/12),i%=12,s.days=e,s.months=i,s.years=t,this},Mi.clone=function(){return Ve(this)},Mi.get=function(t){return t=F(t),this.isValid()?this[t+"s"]():NaN},Mi.milliseconds=K,Mi.seconds=U,Mi.minutes=Z,Mi.hours=St,Mi.days=nt,Mi.weeks=function(){return lt(this.days()/7)},Mi.months=bi,Mi.years=yi,Mi.humanize=function(t,e){var i,s;return this.isValid()?(i=!1,s=xi,"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(i=t),"object"==typeof e&&(s=Object.assign({},xi,e),null!=e.s)&&null==e.ss&&(s.ss=e.s-1),e=function(t,e,i,s){var n=Ve(t).abs(),a=_i(n.as("s")),o=_i(n.as("m")),r=_i(n.as("h")),l=_i(n.as("d")),h=_i(n.as("M")),c=_i(n.as("w"));return n=_i(n.as("y")),a=(a<=i.ss?["s",a]:a<i.s&&["ss",a])||(o<=1?["m"]:o<i.m&&["mm",o])||(r<=1?["h"]:r<i.h&&["hh",r])||(l<=1?["d"]:l<i.d&&["dd",l]),(a=(a=null!=i.w?a||(c<=1?["w"]:c<i.w&&["ww",c]):a)||(h<=1?["M"]:h<i.M&&["MM",h])||(n<=1?["y"]:["yy",n]))[2]=e,a[3]=0<+t,a[4]=s,function(t,e,i,s,n){return n.relativeTime(e||1,!!i,t,s)}.apply(null,a)}(this,!i,s,t=this.localeData()),i&&(e=t.pastFuture(+this,e)),t.postformat(e)):this.localeData().invalidDate()},Mi.toISOString=ki,Mi.toString=ki,Mi.toJSON=ki,Mi.locale=qe,Mi.localeData=Xe,Mi.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ki),Mi.lang=qt,R("X",0,0,"unix"),R("x",0,0,"valueOf"),at("x",Q),at("X",/[+-]?\d+(\.\d{1,3})?/),ut("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t))})),ut("x",(function(t,e,i){i._d=new Date(ht(t))})),e.version="2.30.1",t=Ce,e.fn=st,e.min=function(){return Pe("isBefore",[].slice.call(arguments,0))},e.max=function(){return Pe("isAfter",[].slice.call(arguments,0))},e.now=function(){return Date.now?Date.now():+new Date},e.utc=d,e.unix=function(t){return Ce(1e3*t)},e.months=function(t,e){return li(t,e,"months")},e.isDate=l,e.locale=le,e.invalid=p,e.duration=Ve,e.isMoment=x,e.weekdays=function(t,e,i){return hi(t,e,i,"weekdays")},e.parseZone=function(){return Ce.apply(null,arguments).parseZone()},e.localeData=ce,e.isDuration=Ye,e.monthsShort=function(t,e){return li(t,e,"monthsShort")},e.weekdaysMin=function(t,e,i){return hi(t,e,i,"weekdaysMin")},e.defineLocale=he,e.updateLocale=function(t,e){var i,s;return null!=e?(s=se,null!=ne[t]&&null!=ne[t].parentLocale?ne[t].set(S(ne[t]._config,e)):(e=S(s=null!=(i=re(t))?i._config:s,e),null==i&&(e.abbr=t),(s=new C(e)).parentLocale=ne[t],ne[t]=s),le(t)):null!=ne[t]&&(null!=ne[t].parentLocale?(ne[t]=ne[t].parentLocale,t===le()&&le(t)):null!=ne[t]&&delete ne[t]),ne[t]},e.locales=function(){return P(ne)},e.weekdaysShort=function(t,e,i){return hi(t,e,i,"weekdaysShort")},e.normalizeUnits=F,e.relativeTimeRounding=function(t){return void 0===t?_i:"function"==typeof t&&(_i=t,!0)},e.relativeTimeThreshold=function(t,e){return void 0!==xi[t]&&(void 0===e?xi[t]:(xi[t]=e,"s"===t&&(xi.ss=e-1),!0))},e.calendarFormat=function(t,e){return(t=t.diff(e,"days",!0))<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"},e.prototype=st,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})),function(t,e){if("function"==typeof define&&define.amd)define(["moment","jquery"],(function(t,i){return i.fn||(i.fn={}),"function"!=typeof t&&t.hasOwnProperty("default")&&(t=t.default),e(t,i)}));else if("object"==typeof module&&module.exports){var i="undefined"!=typeof window?window.jQuery:void 0;i||(i=require("jquery")).fn||(i.fn={});var s="undefined"!=typeof window&&void 0!==window.moment?window.moment:require("moment");module.exports=e(s,i)}else t.daterangepicker=e(t.moment,t.jQuery)}(this,(function(t,e){var i=function(i,s,n){if(this.parentEl="body",this.element=e(i),this.startDate=t().startOf("day"),this.endDate=t().endOf("day"),this.minDate=!1,this.maxDate=!1,this.maxSpan=!1,this.autoApply=!1,this.singleDatePicker=!1,this.showDropdowns=!1,this.minYear=t().subtract(100,"year").format("YYYY"),this.maxYear=t().add(100,"year").format("YYYY"),this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.timePicker=!1,this.timePicker24Hour=!1,this.timePickerIncrement=1,this.timePickerSeconds=!1,this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.ranges={},this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses="btn btn-sm",this.applyButtonClasses="btn-primary",this.cancelButtonClasses="btn-default",this.locale={direction:"ltr",format:t.localeData().longDateFormat("L"),separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:t.weekdaysMin(),monthNames:t.monthsShort(),firstDay:t.localeData().firstDayOfWeek()},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},"object"==typeof s&&null!==s||(s={}),"string"==typeof(s=e.extend(this.element.data(),s)).template||s.template instanceof e||(s.template='<div class="daterangepicker"><div class="ranges"></div><div class="drp-calendar left"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-calendar right"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-buttons"><span class="drp-selected"></span><button class="cancelBtn" type="button"></button><button class="applyBtn" disabled="disabled" type="button"></button> </div></div>'),this.parentEl=s.parentEl&&e(s.parentEl).length?e(s.parentEl):e(this.parentEl),this.container=e(s.template).appendTo(this.parentEl),"object"==typeof s.locale&&("string"==typeof s.locale.direction&&(this.locale.direction=s.locale.direction),"string"==typeof s.locale.format&&(this.locale.format=s.locale.format),"string"==typeof s.locale.separator&&(this.locale.separator=s.locale.separator),"object"==typeof s.locale.daysOfWeek&&(this.locale.daysOfWeek=s.locale.daysOfWeek.slice()),"object"==typeof s.locale.monthNames&&(this.locale.monthNames=s.locale.monthNames.slice()),"number"==typeof s.locale.firstDay&&(this.locale.firstDay=s.locale.firstDay),"string"==typeof s.locale.applyLabel&&(this.locale.applyLabel=s.locale.applyLabel),"string"==typeof s.locale.cancelLabel&&(this.locale.cancelLabel=s.locale.cancelLabel),"string"==typeof s.locale.weekLabel&&(this.locale.weekLabel=s.locale.weekLabel),"string"==typeof s.locale.customRangeLabel)){(f=document.createElement("textarea")).innerHTML=s.locale.customRangeLabel;var a=f.value;this.locale.customRangeLabel=a}if(this.container.addClass(this.locale.direction),"string"==typeof s.startDate&&(this.startDate=t(s.startDate,this.locale.format)),"string"==typeof s.endDate&&(this.endDate=t(s.endDate,this.locale.format)),"string"==typeof s.minDate&&(this.minDate=t(s.minDate,this.locale.format)),"string"==typeof s.maxDate&&(this.maxDate=t(s.maxDate,this.locale.format)),"object"==typeof s.startDate&&(this.startDate=t(s.startDate)),"object"==typeof s.endDate&&(this.endDate=t(s.endDate)),"object"==typeof s.minDate&&(this.minDate=t(s.minDate)),"object"==typeof s.maxDate&&(this.maxDate=t(s.maxDate)),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),"string"==typeof s.applyButtonClasses&&(this.applyButtonClasses=s.applyButtonClasses),"string"==typeof s.applyClass&&(this.applyButtonClasses=s.applyClass),"string"==typeof s.cancelButtonClasses&&(this.cancelButtonClasses=s.cancelButtonClasses),"string"==typeof s.cancelClass&&(this.cancelButtonClasses=s.cancelClass),"object"==typeof s.maxSpan&&(this.maxSpan=s.maxSpan),"object"==typeof s.dateLimit&&(this.maxSpan=s.dateLimit),"string"==typeof s.opens&&(this.opens=s.opens),"string"==typeof s.drops&&(this.drops=s.drops),"boolean"==typeof s.showWeekNumbers&&(this.showWeekNumbers=s.showWeekNumbers),"boolean"==typeof s.showISOWeekNumbers&&(this.showISOWeekNumbers=s.showISOWeekNumbers),"string"==typeof s.buttonClasses&&(this.buttonClasses=s.buttonClasses),"object"==typeof s.buttonClasses&&(this.buttonClasses=s.buttonClasses.join(" ")),"boolean"==typeof s.showDropdowns&&(this.showDropdowns=s.showDropdowns),"number"==typeof s.minYear&&(this.minYear=s.minYear),"number"==typeof s.maxYear&&(this.maxYear=s.maxYear),"boolean"==typeof s.showCustomRangeLabel&&(this.showCustomRangeLabel=s.showCustomRangeLabel),"boolean"==typeof s.singleDatePicker&&(this.singleDatePicker=s.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),"boolean"==typeof s.timePicker&&(this.timePicker=s.timePicker),"boolean"==typeof s.timePickerSeconds&&(this.timePickerSeconds=s.timePickerSeconds),"number"==typeof s.timePickerIncrement&&(this.timePickerIncrement=s.timePickerIncrement),"boolean"==typeof s.timePicker24Hour&&(this.timePicker24Hour=s.timePicker24Hour),"boolean"==typeof s.autoApply&&(this.autoApply=s.autoApply),"boolean"==typeof s.autoUpdateInput&&(this.autoUpdateInput=s.autoUpdateInput),"boolean"==typeof s.linkedCalendars&&(this.linkedCalendars=s.linkedCalendars),"function"==typeof s.isInvalidDate&&(this.isInvalidDate=s.isInvalidDate),"function"==typeof s.isCustomDate&&(this.isCustomDate=s.isCustomDate),"boolean"==typeof s.alwaysShowCalendars&&(this.alwaysShowCalendars=s.alwaysShowCalendars),0!=this.locale.firstDay)for(var o=this.locale.firstDay;o>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),o--;var r,l,h;if(void 0===s.startDate&&void 0===s.endDate&&e(this.element).is(":text")){var c=e(this.element).val(),d=c.split(this.locale.separator);r=l=null,2==d.length?(r=t(d[0],this.locale.format),l=t(d[1],this.locale.format)):this.singleDatePicker&&""!==c&&(r=t(c,this.locale.format),l=t(c,this.locale.format)),null!==r&&null!==l&&(this.setStartDate(r),this.setEndDate(l))}if("object"==typeof s.ranges){for(h in s.ranges){r="string"==typeof s.ranges[h][0]?t(s.ranges[h][0],this.locale.format):t(s.ranges[h][0]),l="string"==typeof s.ranges[h][1]?t(s.ranges[h][1],this.locale.format):t(s.ranges[h][1]),this.minDate&&r.isBefore(this.minDate)&&(r=this.minDate.clone());var u=this.maxDate;if(this.maxSpan&&u&&r.clone().add(this.maxSpan).isAfter(u)&&(u=r.clone().add(this.maxSpan)),u&&l.isAfter(u)&&(l=u.clone()),!(this.minDate&&l.isBefore(this.minDate,this.timepicker?"minute":"day")||u&&r.isAfter(u,this.timepicker?"minute":"day"))){var f;(f=document.createElement("textarea")).innerHTML=h;a=f.value;this.ranges[a]=[r,l]}}var p="<ul>";for(h in this.ranges)p+='<li data-range-key="'+h+'">'+h+"</li>";this.showCustomRangeLabel&&(p+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+"</li>"),p+="</ul>",this.container.find(".ranges").prepend(p)}"function"==typeof n&&(this.callback=n),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide()),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&this.container.addClass("auto-apply"),"object"==typeof s.ranges&&this.container.addClass("show-ranges"),this.singleDatePicker&&(this.container.addClass("single"),this.container.find(".drp-calendar.left").addClass("single"),this.container.find(".drp-calendar.left").show(),this.container.find(".drp-calendar.right").hide(),!this.timePicker&&this.autoApply&&this.container.addClass("auto-apply")),(void 0===s.ranges&&!this.singleDatePicker||this.alwaysShowCalendars)&&this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyButtonClasses.length&&this.container.find(".applyBtn").addClass(this.applyButtonClasses),this.cancelButtonClasses.length&&this.container.find(".cancelBtn").addClass(this.cancelButtonClasses),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".drp-calendar").on("click.daterangepicker",".prev",e.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",e.proxy(this.clickNext,this)).on("mousedown.daterangepicker","td.available",e.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",e.proxy(this.hoverDate,this)).on("change.daterangepicker","select.yearselect",e.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",e.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",e.proxy(this.timeChanged,this)),this.container.find(".ranges").on("click.daterangepicker","li",e.proxy(this.clickRange,this)),this.container.find(".drp-buttons").on("click.daterangepicker","button.applyBtn",e.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",e.proxy(this.clickCancel,this)),this.element.is("input")||this.element.is("button")?this.element.on({"click.daterangepicker":e.proxy(this.show,this),"focus.daterangepicker":e.proxy(this.show,this),"keyup.daterangepicker":e.proxy(this.elementChanged,this),"keydown.daterangepicker":e.proxy(this.keydown,this)}):(this.element.on("click.daterangepicker",e.proxy(this.toggle,this)),this.element.on("keydown.daterangepicker",e.proxy(this.toggle,this))),this.updateElement()};return i.prototype={constructor:i,setStartDate:function(e){"string"==typeof e&&(this.startDate=t(e,this.locale.format)),"object"==typeof e&&(this.startDate=t(e)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.floor(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.isShowing||this.updateElement(),this.updateMonthsInView()},setEndDate:function(e){"string"==typeof e&&(this.endDate=t(e,this.locale.format)),"object"==typeof e&&(this.endDate=t(e)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),this.maxSpan&&this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.maxSpan)),this.previousRightTime=this.endDate.clone(),this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.isShowing||this.updateElement(),this.updateMonthsInView()},isInvalidDate:function(){return!1},isCustomDate:function(){return!1},updateView:function(){this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").prop("disabled",!1).removeClass("disabled"):this.container.find(".right .calendar-time select").prop("disabled",!0).addClass("disabled")),this.endDate&&this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.updateMonthsInView(),this.updateCalendars(),this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.startDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM"))&&(this.endDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.endDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM")))return;this.leftCalendar.month=this.startDate.clone().date(2),this.linkedCalendars||this.endDate.month()==this.startDate.month()&&this.endDate.year()==this.startDate.year()?this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"):this.rightCalendar.month=this.endDate.clone().date(2)}else this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"));this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&this.rightCalendar.month>this.maxDate&&(this.rightCalendar.month=this.maxDate.clone().date(2),this.leftCalendar.month=this.maxDate.clone().date(2).subtract(1,"month"))},updateCalendars:function(){if(this.timePicker){var t,e,i,s;if(this.endDate){if(t=parseInt(this.container.find(".left .hourselect").val(),10),e=parseInt(this.container.find(".left .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".left .minuteselect option:last").val(),10)),i=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,!this.timePicker24Hour)"PM"===(s=this.container.find(".left .ampmselect").val())&&t<12&&(t+=12),"AM"===s&&12===t&&(t=0)}else if(t=parseInt(this.container.find(".right .hourselect").val(),10),e=parseInt(this.container.find(".right .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".right .minuteselect option:last").val(),10)),i=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,!this.timePicker24Hour)"PM"===(s=this.container.find(".right .ampmselect").val())&&t<12&&(t+=12),"AM"===s&&12===t&&(t=0);this.leftCalendar.month.hour(t).minute(e).second(i),this.rightCalendar.month.hour(t).minute(e).second(i)}this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),null!=this.endDate&&this.calculateChosenLabel()},renderCalendar:function(i){var s,n=(s="left"==i?this.leftCalendar:this.rightCalendar).month.month(),a=s.month.year(),o=s.month.hour(),r=s.month.minute(),l=s.month.second(),h=t([a,n]).daysInMonth(),c=t([a,n,1]),d=t([a,n,h]),u=t(c).subtract(1,"month").month(),f=t(c).subtract(1,"month").year(),p=t([f,u]).daysInMonth(),g=c.day();(s=[]).firstDay=c,s.lastDay=d;for(var m=0;m<6;m++)s[m]=[];var b=p-g+this.locale.firstDay+1;b>p&&(b-=7),g==this.locale.firstDay&&(b=p-6);for(var y=t([f,u,b,12,r,l]),_=(m=0,0),x=0;m<42;m++,_++,y=t(y).add(24,"hour"))m>0&&_%7==0&&(_=0,x++),s[x][_]=y.clone().hour(o).minute(r).second(l),y.hour(12),this.minDate&&s[x][_].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&s[x][_].isBefore(this.minDate)&&"left"==i&&(s[x][_]=this.minDate.clone()),this.maxDate&&s[x][_].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&s[x][_].isAfter(this.maxDate)&&"right"==i&&(s[x][_]=this.maxDate.clone());"left"==i?this.leftCalendar.calendar=s:this.rightCalendar.calendar=s;var v="left"==i?this.minDate:this.startDate,w=this.maxDate,k=("left"==i?this.startDate:this.endDate,this.locale.direction,'<table class="table-condensed">');k+="<thead>",k+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(k+="<th></th>"),v&&!v.isBefore(s.firstDay)||this.linkedCalendars&&"left"!=i?k+="<th></th>":k+='<th class="prev available"><span></span></th>';var M=this.locale.monthNames[s[1][1].month()]+s[1][1].format(" YYYY");if(this.showDropdowns){for(var D=s[1][1].month(),S=s[1][1].year(),C=w&&w.year()||this.maxYear,P=v&&v.year()||this.minYear,O=S==P,T=S==C,Y='<select class="monthselect">',A=0;A<12;A++)(!O||v&&A>=v.month())&&(!T||w&&A<=w.month())?Y+="<option value='"+A+"'"+(A===D?" selected='selected'":"")+">"+this.locale.monthNames[A]+"</option>":Y+="<option value='"+A+"'"+(A===D?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[A]+"</option>";Y+="</select>";for(var L='<select class="yearselect">',R=P;R<=C;R++)L+='<option value="'+R+'"'+(R===S?' selected="selected"':"")+">"+R+"</option>";M=Y+(L+="</select>")}if(k+='<th colspan="5" class="month">'+M+"</th>",w&&!w.isAfter(s.lastDay)||this.linkedCalendars&&"right"!=i&&!this.singleDatePicker?k+="<th></th>":k+='<th class="next available"><span></span></th>',k+="</tr>",k+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(k+='<th class="week">'+this.locale.weekLabel+"</th>"),e.each(this.locale.daysOfWeek,(function(t,e){k+="<th>"+e+"</th>"})),k+="</tr>",k+="</thead>",k+="<tbody>",null==this.endDate&&this.maxSpan){var E=this.startDate.clone().add(this.maxSpan).endOf("day");w&&!E.isBefore(w)||(w=E)}for(x=0;x<6;x++){k+="<tr>",this.showWeekNumbers?k+='<td class="week">'+s[x][0].week()+"</td>":this.showISOWeekNumbers&&(k+='<td class="week">'+s[x][0].isoWeek()+"</td>");for(_=0;_<7;_++){var I=[];s[x][_].isSame(new Date,"day")&&I.push("today"),s[x][_].isoWeekday()>5&&I.push("weekend"),s[x][_].month()!=s[1][1].month()&&I.push("off","ends"),this.minDate&&s[x][_].isBefore(this.minDate,"day")&&I.push("off","disabled"),w&&s[x][_].isAfter(w,"day")&&I.push("off","disabled"),this.isInvalidDate(s[x][_])&&I.push("off","disabled"),s[x][_].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&I.push("active","start-date"),null!=this.endDate&&s[x][_].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&I.push("active","end-date"),null!=this.endDate&&s[x][_]>this.startDate&&s[x][_]<this.endDate&&I.push("in-range");var N=this.isCustomDate(s[x][_]);!1!==N&&("string"==typeof N?I.push(N):Array.prototype.push.apply(I,N));var F="",W=!1;for(m=0;m<I.length;m++)F+=I[m]+" ","disabled"==I[m]&&(W=!0);W||(F+="available"),k+='<td class="'+F.replace(/^\s+|\s+$/g,"")+'" data-title="r'+x+"c"+_+'">'+s[x][_].date()+"</td>"}k+="</tr>"}k+="</tbody>",k+="</table>",this.container.find(".drp-calendar."+i+" .calendar-table").html(k)},renderTimePicker:function(t){if("right"!=t||this.endDate){var e,i,s,n=this.maxDate;if(!this.maxSpan||this.maxDate&&!this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate)||(n=this.startDate.clone().add(this.maxSpan)),"left"==t)i=this.startDate.clone(),s=this.minDate;else if("right"==t){i=this.endDate.clone(),s=this.startDate;var a=this.container.find(".drp-calendar.right .calendar-time");if(""!=a.html()&&(i.hour(isNaN(i.hour())?a.find(".hourselect option:selected").val():i.hour()),i.minute(isNaN(i.minute())?a.find(".minuteselect option:selected").val():i.minute()),i.second(isNaN(i.second())?a.find(".secondselect option:selected").val():i.second()),!this.timePicker24Hour)){var o=a.find(".ampmselect option:selected").val();"PM"===o&&i.hour()<12&&i.hour(i.hour()+12),"AM"===o&&12===i.hour()&&i.hour(0)}i.isBefore(this.startDate)&&(i=this.startDate.clone()),n&&i.isAfter(n)&&(i=n.clone())}e='<select class="hourselect">';for(var r=this.timePicker24Hour?0:1,l=this.timePicker24Hour?23:12,h=r;h<=l;h++){var c=h;this.timePicker24Hour||(c=i.hour()>=12?12==h?12:h+12:12==h?0:h);var d=i.clone().hour(c),u=!1;s&&d.minute(59).isBefore(s)&&(u=!0),n&&d.minute(0).isAfter(n)&&(u=!0),c!=i.hour()||u?e+=u?'<option value="'+h+'" disabled="disabled" class="disabled">'+h+"</option>":'<option value="'+h+'">'+h+"</option>":e+='<option value="'+h+'" selected="selected">'+h+"</option>"}e+="</select> ",e+=': <select class="minuteselect">';for(h=0;h<60;h+=this.timePickerIncrement){var f=h<10?"0"+h:h;d=i.clone().minute(h),u=!1;s&&d.second(59).isBefore(s)&&(u=!0),n&&d.second(0).isAfter(n)&&(u=!0),i.minute()!=h||u?e+=u?'<option value="'+h+'" disabled="disabled" class="disabled">'+f+"</option>":'<option value="'+h+'">'+f+"</option>":e+='<option value="'+h+'" selected="selected">'+f+"</option>"}if(e+="</select> ",this.timePickerSeconds){e+=': <select class="secondselect">';for(h=0;h<60;h++){f=h<10?"0"+h:h,d=i.clone().second(h),u=!1;s&&d.isBefore(s)&&(u=!0),n&&d.isAfter(n)&&(u=!0),i.second()!=h||u?e+=u?'<option value="'+h+'" disabled="disabled" class="disabled">'+f+"</option>":'<option value="'+h+'">'+f+"</option>":e+='<option value="'+h+'" selected="selected">'+f+"</option>"}e+="</select> "}if(!this.timePicker24Hour){e+='<select class="ampmselect">';var p="",g="";s&&i.clone().hour(12).minute(0).second(0).isBefore(s)&&(p=' disabled="disabled" class="disabled"'),n&&i.clone().hour(0).minute(0).second(0).isAfter(n)&&(g=' disabled="disabled" class="disabled"'),i.hour()>=12?e+='<option value="AM"'+p+'>AM</option><option value="PM" selected="selected"'+g+">PM</option>":e+='<option value="AM" selected="selected"'+p+'>AM</option><option value="PM"'+g+">PM</option>",e+="</select>"}this.container.find(".drp-calendar."+t+" .calendar-time").html(e)}},updateFormInputs:function(){this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").prop("disabled",!1):this.container.find("button.applyBtn").prop("disabled",!0)},move:function(){var t,i={top:0,left:0},s=this.drops,n=e(window).width();switch(this.parentEl.is("body")||(i={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},n=this.parentEl[0].clientWidth+this.parentEl.offset().left),s){case"auto":(t=this.element.offset().top+this.element.outerHeight()-i.top)+this.container.outerHeight()>=this.parentEl[0].scrollHeight&&(t=this.element.offset().top-this.container.outerHeight()-i.top,s="up");break;case"up":t=this.element.offset().top-this.container.outerHeight()-i.top;break;default:t=this.element.offset().top+this.element.outerHeight()-i.top}this.container.css({top:0,left:0,right:"auto"});var a=this.container.outerWidth();if(this.container.toggleClass("drop-up","up"==s),"left"==this.opens){var o=n-this.element.offset().left-this.element.outerWidth();a+o>e(window).width()?this.container.css({top:t,right:"auto",left:9}):this.container.css({top:t,right:o,left:"auto"})}else if("center"==this.opens){(r=this.element.offset().left-i.left+this.element.outerWidth()/2-a/2)<0?this.container.css({top:t,right:"auto",left:9}):r+a>e(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:r,right:"auto"})}else{var r;(r=this.element.offset().left-i.left)+a>e(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:r,right:"auto"})}},show:function(t){this.isShowing||(this._outsideClickProxy=e.proxy((function(t){this.outsideClick(t)}),this),e(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),e(window).on("resize.daterangepicker",e.proxy((function(t){this.move(t)}),this)),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.previousRightTime=this.endDate.clone(),this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)},hide:function(t){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate.clone(),this.endDate.clone(),this.chosenLabel),this.updateElement(),e(document).off(".daterangepicker"),e(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1)},toggle:function(t){this.isShowing?this.hide():this.show()},outsideClick:function(t){var i=e(t.target);"focusin"==t.type||i.closest(this.element).length||i.closest(this.container).length||i.closest(".calendar-table").length||(this.hide(),this.element.trigger("outsideClick.daterangepicker",this))},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)},clickRange:function(t){var e=t.target.getAttribute("data-range-key");if(this.chosenLabel=e,e==this.locale.customRangeLabel)this.showCalendars();else{var i=this.ranges[e];this.startDate=i[0],this.endDate=i[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.alwaysShowCalendars||this.hideCalendars(),this.clickApply()}},clickPrev:function(t){e(t.target).parents(".drp-calendar").hasClass("left")?(this.leftCalendar.month.subtract(1,"month"),this.linkedCalendars&&this.rightCalendar.month.subtract(1,"month")):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(t){e(t.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.month.add(1,"month"):(this.rightCalendar.month.add(1,"month"),this.linkedCalendars&&this.leftCalendar.month.add(1,"month")),this.updateCalendars()},hoverDate:function(t){if(e(t.target).hasClass("available")){var i=e(t.target).attr("data-title"),s=i.substr(1,1),n=i.substr(3,1),a=e(t.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[s][n]:this.rightCalendar.calendar[s][n],o=this.leftCalendar,r=this.rightCalendar,l=this.startDate;this.endDate||this.container.find(".drp-calendar tbody td").each((function(t,i){if(!e(i).hasClass("week")){var s=e(i).attr("data-title"),n=s.substr(1,1),h=s.substr(3,1),c=e(i).parents(".drp-calendar").hasClass("left")?o.calendar[n][h]:r.calendar[n][h];c.isAfter(l)&&c.isBefore(a)||c.isSame(a,"day")?e(i).addClass("in-range"):e(i).removeClass("in-range")}}))}},clickDate:function(t){if(e(t.target).hasClass("available")){var i=e(t.target).attr("data-title"),s=i.substr(1,1),n=i.substr(3,1),a=e(t.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[s][n]:this.rightCalendar.calendar[s][n];if(this.endDate||a.isBefore(this.startDate,"day")){if(this.timePicker){var o=parseInt(this.container.find(".left .hourselect").val(),10);if(!this.timePicker24Hour)"PM"===(h=this.container.find(".left .ampmselect").val())&&o<12&&(o+=12),"AM"===h&&12===o&&(o=0);var r=parseInt(this.container.find(".left .minuteselect").val(),10);isNaN(r)&&(r=parseInt(this.container.find(".left .minuteselect option:last").val(),10));var l=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0;a=a.clone().hour(o).minute(r).second(l)}this.endDate=null,this.setStartDate(a.clone())}else if(!this.endDate&&a.isBefore(this.startDate))this.setEndDate(this.startDate.clone());else{if(this.timePicker){var h;o=parseInt(this.container.find(".right .hourselect").val(),10);if(!this.timePicker24Hour)"PM"===(h=this.container.find(".right .ampmselect").val())&&o<12&&(o+=12),"AM"===h&&12===o&&(o=0);r=parseInt(this.container.find(".right .minuteselect").val(),10);isNaN(r)&&(r=parseInt(this.container.find(".right .minuteselect option:last").val(),10));l=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0;a=a.clone().hour(o).minute(r).second(l)}this.setEndDate(a.clone()),this.autoApply&&(this.calculateChosenLabel(),this.clickApply())}this.singleDatePicker&&(this.setEndDate(this.startDate),!this.timePicker&&this.autoApply&&this.clickApply()),this.updateView(),t.stopPropagation()}},calculateChosenLabel:function(){var t=!0,e=0;for(var i in this.ranges){if(this.timePicker){var s=this.timePickerSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm";if(this.startDate.format(s)==this.ranges[i][0].format(s)&&this.endDate.format(s)==this.ranges[i][1].format(s)){t=!1,this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").attr("data-range-key");break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[i][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[i][1].format("YYYY-MM-DD")){t=!1,this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").attr("data-range-key");break}e++}t&&(this.showCustomRangeLabel?this.chosenLabel=this.container.find(".ranges li:last").addClass("active").attr("data-range-key"):this.chosenLabel=null,this.showCalendars())},clickApply:function(t){this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(t){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(t){var i=e(t.target).closest(".drp-calendar").hasClass("left"),s=i?"left":"right",n=this.container.find(".drp-calendar."+s),a=parseInt(n.find(".monthselect").val(),10),o=n.find(".yearselect").val();i||(o<this.startDate.year()||o==this.startDate.year()&&a<this.startDate.month())&&(a=this.startDate.month(),o=this.startDate.year()),this.minDate&&(o<this.minDate.year()||o==this.minDate.year()&&a<this.minDate.month())&&(a=this.minDate.month(),o=this.minDate.year()),this.maxDate&&(o>this.maxDate.year()||o==this.maxDate.year()&&a>this.maxDate.month())&&(a=this.maxDate.month(),o=this.maxDate.year()),i?(this.leftCalendar.month.month(a).year(o),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.clone().add(1,"month"))):(this.rightCalendar.month.month(a).year(o),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,"month"))),this.updateCalendars()},timeChanged:function(t){var i=e(t.target).closest(".drp-calendar"),s=i.hasClass("left"),n=parseInt(i.find(".hourselect").val(),10),a=parseInt(i.find(".minuteselect").val(),10);isNaN(a)&&(a=parseInt(i.find(".minuteselect option:last").val(),10));var o=this.timePickerSeconds?parseInt(i.find(".secondselect").val(),10):0;if(!this.timePicker24Hour){var r=i.find(".ampmselect").val();"PM"===r&&n<12&&(n+=12),"AM"===r&&12===n&&(n=0)}if(s){var l=this.startDate.clone();l.hour(n),l.minute(a),l.second(o),this.setStartDate(l),this.singleDatePicker?this.endDate=this.startDate.clone():this.endDate&&this.endDate.format("YYYY-MM-DD")==l.format("YYYY-MM-DD")&&this.endDate.isBefore(l)&&this.setEndDate(l.clone())}else if(this.endDate){var h=this.endDate.clone();h.hour(n),h.minute(a),h.second(o),this.setEndDate(h)}this.updateCalendars(),this.updateFormInputs(),this.renderTimePicker("left"),this.renderTimePicker("right")},elementChanged:function(){if(this.element.is("input")&&this.element.val().length){var e=this.element.val().split(this.locale.separator),i=null,s=null;2===e.length&&(i=t(e[0],this.locale.format),s=t(e[1],this.locale.format)),(this.singleDatePicker||null===i||null===s)&&(s=i=t(this.element.val(),this.locale.format)),i.isValid()&&s.isValid()&&(this.setStartDate(i),this.setEndDate(s),this.updateView())}},keydown:function(t){9!==t.keyCode&&13!==t.keyCode||this.hide(),27===t.keyCode&&(t.preventDefault(),t.stopPropagation(),this.hide())},updateElement:function(){if(this.element.is("input")&&this.autoUpdateInput){var t=this.startDate.format(this.locale.format);this.singleDatePicker||(t+=this.locale.separator+this.endDate.format(this.locale.format)),t!==this.element.val()&&this.element.val(t).trigger("change")}},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}},e.fn.daterangepicker=function(t,s){var n=e.extend(!0,{},e.fn.daterangepicker.defaultOptions,t);return this.each((function(){var t=e(this);t.data("daterangepicker")&&t.data("daterangepicker").remove(),t.data("daterangepicker",new i(t,n,s))})),this},i})),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";var t=Object.freeze({__proto__:null,get Colors(){return La},get Decimation(){return Ia},get Filler(){return Qa},get Legend(){return so},get SubTitle(){return ro},get Title(){return ao},get Tooltip(){return ko}});function e(){}const i=(()=>{let t=0;return()=>t++})();function s(t){return null==t}function n(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function a(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function r(t,e){return o(t)?t:e}function l(t,e){return void 0===t?e:t}const h=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,c=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function d(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function u(t,e,i,s){let o,r,l;if(n(t))if(r=t.length,s)for(o=r-1;o>=0;o--)e.call(i,t[o],o);else for(o=0;o<r;o++)e.call(i,t[o],o);else if(a(t))for(l=Object.keys(t),r=l.length,o=0;o<r;o++)e.call(i,t[l[o]],l[o])}function f(t,e){let i,s,n,a;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],a=e[i],n.datasetIndex!==a.datasetIndex||n.index!==a.index)return!1;return!0}function p(t){if(n(t))return t.map(p);if(a(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=p(t[i[n]]);return e}return t}function g(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function m(t,e,i,s){if(!g(t))return;const n=e[t],o=i[t];a(n)&&a(o)?b(n,o,s):e[t]=p(o)}function b(t,e,i){const s=n(e)?e:[e],o=s.length;if(!a(t))return t;const r=(i=i||{}).merger||m;let l;for(let e=0;e<o;++e){if(l=s[e],!a(l))continue;const n=Object.keys(l);for(let e=0,s=n.length;e<s;++e)r(n[e],t,l,i)}return t}function y(t,e){return b(t,e,{merger:_})}function _(t,e,i){if(!g(t))return;const s=e[t],n=i[t];a(s)&&a(n)?y(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=p(n))}const x={"":t=>t,x:t=>t.x,y:t=>t.y};function v(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function w(t,e){const i=x[e]||(x[e]=function(t){const e=v(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function k(t){return t.charAt(0).toUpperCase()+t.slice(1)}const M=t=>void 0!==t,D=t=>"function"==typeof t,S=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function C(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const P=Math.PI,O=2*P,T=O+P,Y=Number.POSITIVE_INFINITY,A=P/180,L=P/2,R=P/4,E=2*P/3,I=Math.log10,N=Math.sign;function F(t,e,i){return Math.abs(t-e)<i}function W(t){const e=Math.round(t);t=F(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(I(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function z(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}function V(t){return!isNaN(parseFloat(t))&&isFinite(t)}function H(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function B(t,e,i){let s,n,a;for(s=0,n=t.length;s<n;s++)a=t[s][i],isNaN(a)||(e.min=Math.min(e.min,a),e.max=Math.max(e.max,a))}function j(t){return t*(P/180)}function U(t){return t*(180/P)}function $(t){if(!o(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function G(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let a=Math.atan2(s,i);return a<-.5*P&&(a+=O),{angle:a,distance:n}}function q(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function X(t,e){return(t-e+T)%O-P}function Z(t){return(t%O+O)%O}function K(t,e,i,s){const n=Z(t),a=Z(e),o=Z(i),r=Z(a-n),l=Z(o-n),h=Z(n-a),c=Z(n-o);return n===a||n===o||s&&a===o||r>l&&h<c}function J(t,e,i){return Math.max(e,Math.min(i,t))}function Q(t){return J(t,-32768,32767)}function tt(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function et(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,a=0;for(;n-a>1;)s=a+n>>1,i(s)?a=s:n=s;return{lo:a,hi:n}}const it=(t,e,i,s)=>et(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),st=(t,e,i)=>et(t,i,(s=>t[s][e]>=i));function nt(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const at=["push","pop","shift","splice","unshift"];function ot(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),at.forEach((e=>{const i="_onData"+k(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function rt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(at.forEach((e=>{delete t[e]})),delete t._chartjs)}function lt(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ht="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ct(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,ht.call(window,(()=>{s=!1,t.apply(e,i)})))}}function dt(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const ut=t=>"start"===t?"left":"end"===t?"right":"center",ft=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,pt=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function gt(t,e,i){const s=e.length;let n=0,a=s;if(t._sorted){const{iScale:o,_parsed:r}=t,l=o.axis,{min:h,max:c,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(n=J(Math.min(it(r,l,h).lo,i?s:it(e,l,o.getPixelForValue(h)).lo),0,s-1)),a=u?J(Math.max(it(r,o.axis,c,!0).hi+1,i?0:it(e,l,o.getPixelForValue(c),!0).hi+1),n,s)-n:s-n}return{start:n,count:a}}function mt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const a=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),a}var bt=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],a=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)})))}_refresh(){this._request||(this._running=!0,this._request=ht.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let a,o=n.length-1,r=!1;for(;o>=0;--o)a=n[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),r=!0):(n[o]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};function yt(t){return t+.5|0}const _t=(t,e,i)=>Math.max(Math.min(t,i),e);function xt(t){return _t(yt(2.55*t),0,255)}function vt(t){return _t(yt(255*t),0,255)}function wt(t){return _t(yt(t/2.55)/100,0,1)}function kt(t){return _t(yt(100*t),0,100)}const Mt={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},Dt=[..."0123456789ABCDEF"],St=t=>Dt[15&t],Ct=t=>Dt[(240&t)>>4]+Dt[15&t],Pt=t=>(240&t)>>4==(15&t);const Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Tt(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function Yt(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function At(t,e,i){const s=Tt(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function Lt(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),a=Math.min(e,i,s),o=(n+a)/2;let r,l,h;return n!==a&&(h=n-a,l=o>.5?h/(2-n-a):h/(n+a),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,o]}function Rt(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(vt)}function Et(t,e,i){return Rt(Tt,t,e,i)}function It(t){return(t%360+360)%360}const Nt={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"},Ft={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let Wt;const zt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Vt=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Ht=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Bt(t,e,i){if(t){let s=Lt(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=Et(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function jt(t,e){return t?Object.assign(e||{},t):t}function Ut(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=vt(t[3]))):(e=jt(t,{r:0,g:0,b:0,a:1})).a=vt(e.a),e}function $t(t){return"r"===t.charAt(0)?function(t){const e=zt.exec(t);let i,s,n,a=255;if(e){if(e[7]!==i){const t=+e[7];a=e[8]?xt(t):_t(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?xt(i):_t(i,0,255)),s=255&(e[4]?xt(s):_t(s,0,255)),n=255&(e[6]?xt(n):_t(n,0,255)),{r:i,g:s,b:n,a:a}}}(t):function(t){const e=Ot.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?xt(+e[5]):vt(+e[5]));const n=It(+e[2]),a=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Rt(At,t,e,i)}(n,a,o):"hsv"===e[1]?function(t,e,i){return Rt(Yt,t,e,i)}(n,a,o):Et(n,a,o),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class Gt{constructor(t){if(t instanceof Gt)return t;const e=typeof t;let i;var s,n,a;"object"===e?i=Ut(t):"string"===e&&(a=(s=t).length,"#"===s[0]&&(4===a||5===a?n={r:255&17*Mt[s[1]],g:255&17*Mt[s[2]],b:255&17*Mt[s[3]],a:5===a?17*Mt[s[4]]:255}:7!==a&&9!==a||(n={r:Mt[s[1]]<<4|Mt[s[2]],g:Mt[s[3]]<<4|Mt[s[4]],b:Mt[s[5]]<<4|Mt[s[6]],a:9===a?Mt[s[7]]<<4|Mt[s[8]]:255})),i=n||function(t){Wt||(Wt=function(){const t={},e=Object.keys(Ft),i=Object.keys(Nt);let s,n,a,o,r;for(s=0;s<e.length;s++){for(o=r=e[s],n=0;n<i.length;n++)a=i[n],r=r.replace(a,Nt[a]);a=parseInt(Ft[o],16),t[r]=[a>>16&255,a>>8&255,255&a]}return t}(),Wt.transparent=[0,0,0,0]);const e=Wt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||$t(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=jt(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=Ut(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${wt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?function(t){var e=(t=>Pt(t.r)&&Pt(t.g)&&Pt(t.b)&&Pt(t.a))(t)?St:Ct;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=Lt(t),i=e[0],s=kt(e[1]),n=kt(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${wt(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const a=e===n?.5:e,o=2*a-1,r=i.a-s.a,l=((o*r==-1?o:(o+r)/(1+o*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=Ht(wt(t.r)),n=Ht(wt(t.g)),a=Ht(wt(t.b));return{r:vt(Vt(s+i*(Ht(wt(e.r))-s))),g:vt(Vt(n+i*(Ht(wt(e.g))-n))),b:vt(Vt(a+i*(Ht(wt(e.b))-a))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Gt(this.rgb)}alpha(t){return this._rgb.a=vt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=yt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Bt(this._rgb,2,t),this}darken(t){return Bt(this._rgb,2,-t),this}saturate(t){return Bt(this._rgb,1,t),this}desaturate(t){return Bt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Lt(t);i[0]=It(i[0]+e),i=Et(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function qt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Xt(t){return qt(t)?t:new Gt(t)}function Zt(t){return qt(t)?t:new Gt(t).saturate(.5).darken(.1).hexString()}const Kt=["x","y","borderWidth","radius","tension"],Jt=["color","borderColor","backgroundColor"],Qt=new Map;function te(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=Qt.get(i);return s||(s=new Intl.NumberFormat(t,e),Qt.set(i,s)),s}(e,i).format(t)}const ee={values:t=>n(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,a=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),a=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=I(Math.abs(a)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),te(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(I(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?ee.numeric.call(this,t,e,i):""}};var ie={formatters:ee};const se=Object.create(null),ne=Object.create(null);function ae(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function oe(t,e,i){return"string"==typeof e?b(ae(t,e),i):b(ae(t,""),e)}var re=new class{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Zt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Zt(e.borderColor),this.hoverColor=(t,e)=>Zt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return oe(this,t,e)}get(t){return ae(this,t)}describe(t,e){return oe(ne,t,e)}override(t,e){return oe(se,t,e)}route(t,e,i,s){const n=ae(this,t),o=ae(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[s];return a(t)?Object.assign({},e,t):l(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach((t=>t(this)))}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Jt},numbers:{type:"number",properties:Kt}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ie.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function le(){return"undefined"!=typeof window&&"undefined"!=typeof document}function he(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ce(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const de=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function ue(t,e){return de(t).getPropertyValue(e)}const fe=["top","right","bottom","left"];function pe(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const a=fe[n];s[a]=parseFloat(t[e+"-"+a+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const ge=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function me(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=de(i),a="border-box"===n.boxSizing,o=pe(n,"padding"),r=pe(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:a}=s;let o,r,l=!1;if(ge(n,a,t.target))o=n,r=a;else{const t=e.getBoundingClientRect();o=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:o,y:r,box:l}}(t,i),d=o.left+(c&&r.left),u=o.top+(c&&r.top);let{width:f,height:p}=e;return a&&(f-=o.width+r.width,p-=o.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/p*i.height/s)}}const be=t=>Math.round(10*t)/10;function ye(t,e,i,s){const n=de(t),a=pe(n,"margin"),o=ce(n.maxWidth,t,"clientWidth")||Y,r=ce(n.maxHeight,t,"clientHeight")||Y,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const a=t&&he(t);if(a){const t=a.getBoundingClientRect(),o=de(a),r=pe(o,"border","width"),l=pe(o,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=ce(o.maxWidth,a,"clientWidth"),n=ce(o.maxHeight,a,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||Y,maxHeight:n||Y}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=pe(n,"border","width"),e=pe(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-a.width),c=Math.max(0,s?h/s:c-a.height),h=be(Math.min(h,o,l.maxWidth)),c=be(Math.min(c,r,l.maxHeight)),h&&!c&&(c=be(h/2)),(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=be(Math.floor(c*s))),{width:h,height:c}}function _e(t,e,i){const s=e||1,n=Math.floor(t.height*s),a=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||o.height!==n||o.width!==a)&&(t.currentDevicePixelRatio=s,o.height=n,o.width=a,t.ctx.setTransform(s,0,0,s,0,0),!0)}const xe=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};le()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ve(t,e){const i=ue(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function we(t){return!t||s(t.size)||s(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ke(t,e,i,s,n){let a=e[n];return a||(a=e[n]=t.measureText(n).width,i.push(n)),a>s&&(s=a),s}function Me(t,e,i,s){let a=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(a=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let r=0;const l=i.length;let h,c,d,u,f;for(h=0;h<l;h++)if(u=i[h],null==u||n(u)){if(n(u))for(c=0,d=u.length;c<d;c++)f=u[c],null==f||n(f)||(r=ke(t,a,o,r,f))}else r=ke(t,a,o,r,u);t.restore();const p=o.length/2;if(p>i.length){for(h=0;h<p;h++)delete a[o[h]];o.splice(0,p)}return r}function De(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Se(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Ce(t,e,i,s){Pe(t,e,i,s,null)}function Pe(t,e,i,s,n){let a,o,r,l,h,c,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*A;if(f&&"object"==typeof f&&(a=f.toString(),"[object HTMLImageElement]"===a||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,g,0,0,O):t.arc(i,s,g,0,O),t.closePath();break;case"triangle":c=n?n/2:g,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=E,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=E,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,o=Math.cos(m+R)*l,d=Math.cos(m+R)*(n?n/2-h:l),r=Math.sin(m+R)*l,u=Math.sin(m+R)*(n?n/2-h:l),t.arc(i-d,s-r,h,m-P,m-L),t.arc(i+u,s-o,h,m-L,m),t.arc(i+d,s+r,h,m,m+L),t.arc(i-u,s+o,h,m+L,m+P),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=n?n/2:l,t.rect(i-c,s-l,2*c,2*l);break}m+=R;case"rectRot":d=Math.cos(m)*(n?n/2:g),o=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+u,s-o),t.lineTo(i+d,s+r),t.lineTo(i-u,s+o),t.closePath();break;case"crossRot":m+=R;case"cross":d=Math.cos(m)*(n?n/2:g),o=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-o),t.lineTo(i-u,s+o);break;case"star":d=Math.cos(m)*(n?n/2:g),o=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-o),t.lineTo(i-u,s+o),m+=R,d=Math.cos(m)*(n?n/2:g),o=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-o),t.lineTo(i-u,s+o);break;case"line":o=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,t.moveTo(i-o,s-r),t.lineTo(i+o,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Oe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Te(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ye(t){t.restore()}function Ae(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Le(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function Re(t,e,i,s,n){if(n.strikethrough||n.underline){const a=t.measureText(s),o=e-a.actualBoundingBoxLeft,r=e+a.actualBoundingBoxRight,l=i-a.actualBoundingBoxAscent,h=i+a.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(o,c),t.lineTo(r,c),t.stroke()}}function Ee(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Ie(t,e,i,a,o,r={}){const l=n(e)?e:[e],h=r.strokeWidth>0&&""!==r.strokeColor;let c,d;for(t.save(),t.font=o.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),s(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),c=0;c<l.length;++c)d=l[c],r.backdrop&&Ee(t,r.backdrop),h&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),s(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(d,i,a,r.maxWidth)),t.fillText(d,i,a,r.maxWidth),Re(t,i,a,d,r),a+=Number(o.lineHeight);t.restore()}function Ne(t,e){const{x:i,y:s,w:n,h:a,radius:o}=e;t.arc(i+o.topLeft,s+o.topLeft,o.topLeft,1.5*P,P,!0),t.lineTo(i,s+a-o.bottomLeft),t.arc(i+o.bottomLeft,s+a-o.bottomLeft,o.bottomLeft,P,L,!0),t.lineTo(i+n-o.bottomRight,s+a),t.arc(i+n-o.bottomRight,s+a-o.bottomRight,o.bottomRight,L,0,!0),t.lineTo(i+n,s+o.topRight),t.arc(i+n-o.topRight,s+o.topRight,o.topRight,0,-L,!0),t.lineTo(i+o.topLeft,s)}function Fe(t,e=[""],i,s,n=()=>t[0]){const a=i||t;void 0===s&&(s=Xe("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:a,_fallback:s,_getTarget:n,override:i=>Fe([i,...t],e,a,s)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Be(i,s,(()=>function(t,e,i,s){let n;for(const a of e)if(n=Xe(Ve(a,t),i),void 0!==n)return He(t,n)?Ge(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ze(t).includes(e),ownKeys:t=>Ze(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function We(t,e,i,s){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ze(t,s),setContext:e=>We(t,e,i,s),override:n=>We(t.override(n),e,i,s)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Be(t,e,(()=>function(t,e,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:l}=t;let h=s[e];return D(h)&&l.isScriptable(e)&&(h=function(t,e,i,s){const{_proxy:n,_context:a,_subProxy:o,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(a,o||s);return r.delete(t),He(t,l)&&(l=Ge(n._scopes,n,t,l)),l}(e,h,t,i)),n(h)&&h.length&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:l}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(a(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const a of i){const i=Ge(s,n,t,a);e.push(We(i,o,r&&r[t],l))}}return e}(e,h,t,l.isIndexable)),He(e,h)&&(h=We(h,o,r&&r[e],l)),h}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function ze(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:D(i)?i:()=>i,isIndexable:D(s)?s:()=>s}}const Ve=(t,e)=>t?t+k(e):e,He=(t,e)=>a(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Be(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function je(t,e,i){return D(t)?t(e,i):t}const Ue=(t,e)=>!0===t?e:"string"==typeof t?w(e,t):void 0;function $e(t,e,i,s,n){for(const a of e){const e=Ue(i,a);if(e){t.add(e);const a=je(e._fallback,i,n);if(void 0!==a&&a!==i&&a!==s)return a}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Ge(t,e,i,s){const o=e._rootScopes,r=je(e._fallback,i,s),l=[...t,...o],h=new Set;h.add(s);let c=qe(h,l,i,r||i,s);return null!==c&&(void 0===r||r===i||(c=qe(h,l,r,c,s),null!==c))&&Fe(Array.from(h),[""],o,r,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const o=s[e];return n(o)&&a(i)?i:o||{}}(e,i,s)))}function qe(t,e,i,s,n){for(;i;)i=$e(t,e,i,s,n);return i}function Xe(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Ze(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function Ke(t,e,i,s){const{iScale:n}=t,{key:a="r"}=this._parsing,o=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],o[r]={r:n.parse(w(c,a),h)};return o}const Je=Number.EPSILON||1e-14,Qe=(t,e)=>e<t.length&&!t[e].skip&&t[e],ti=t=>"x"===t?"y":"x";function ei(t,e,i,s){const n=t.skip?e:t,a=e,o=i.skip?e:i,r=q(a,n),l=q(o,a);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:a.x-d*(o.x-n.x),y:a.y-d*(o.y-n.y)},next:{x:a.x+u*(o.x-n.x),y:a.y+u*(o.y-n.y)}}}function ii(t,e="x"){const i=ti(e),s=t.length,n=Array(s).fill(0),a=Array(s);let o,r,l,h=Qe(t,0);for(o=0;o<s;++o)if(r=l,l=h,h=Qe(t,o+1),l){if(h){const t=h[e]-l[e];n[o]=0!==t?(h[i]-l[i])/t:0}a[o]=r?h?N(n[o-1])!==N(n[o])?0:(n[o-1]+n[o])/2:n[o-1]:n[o]}!function(t,e,i){const s=t.length;let n,a,o,r,l,h=Qe(t,0);for(let c=0;c<s-1;++c)l=h,h=Qe(t,c+1),l&&h&&(F(e[c],0,Je)?i[c]=i[c+1]=0:(n=i[c]/e[c],a=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(a,2),r<=9||(o=3/Math.sqrt(r),i[c]=n*o*e[c],i[c+1]=a*o*e[c])))}(t,n,a),function(t,e,i="x"){const s=ti(i),n=t.length;let a,o,r,l=Qe(t,0);for(let h=0;h<n;++h){if(o=r,r=l,l=Qe(t,h+1),!r)continue;const n=r[i],c=r[s];o&&(a=(n-o[i])/3,r[`cp1${i}`]=n-a,r[`cp1${s}`]=c-a*e[h]),l&&(a=(l[i]-n)/3,r[`cp2${i}`]=n+a,r[`cp2${s}`]=c+a*e[h])}}(t,a,e)}function si(t,e,i){return Math.max(Math.min(t,i),e)}function ni(t,e,i,s,n){let a,o,r,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)ii(t,n);else{let i=s?t[t.length-1]:t[0];for(a=0,o=t.length;a<o;++a)r=t[a],l=ei(i,r,t[Math.min(a+1,o-(s?0:1))%o],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,a,o,r=Oe(t[0],e);for(i=0,s=t.length;i<s;++i)o=a,a=r,r=i<s-1&&Oe(t[i+1],e),a&&(n=t[i],o&&(n.cp1x=si(n.cp1x,e.left,e.right),n.cp1y=si(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=si(n.cp2x,e.left,e.right),n.cp2y=si(n.cp2y,e.top,e.bottom)))}(t,i)}const ai=t=>0===t||1===t,oi=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*O/i),ri=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*O/i)+1,li={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*L),easeOutSine:t=>Math.sin(t*L),easeInOutSine:t=>-.5*(Math.cos(P*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ai(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ai(t)?t:oi(t,.075,.3),easeOutElastic:t=>ai(t)?t:ri(t,.075,.3),easeInOutElastic(t){const e=.1125;return ai(t)?t:t<.5?.5*oi(2*t,e,.45):.5+.5*ri(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-li.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*li.easeInBounce(2*t):.5*li.easeOutBounce(2*t-1)+.5};function hi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ci(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function di(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},o=hi(t,n,i),r=hi(n,a,i),l=hi(a,e,i),h=hi(o,r,i),c=hi(r,l,i);return hi(h,c,i)}const ui=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pi(t,e){const i=(""+t).match(ui);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const gi=t=>+t||0;function mi(t,e){const i={},s=a(e),n=s?Object.keys(e):e,o=a(t)?s?i=>l(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=gi(o(t));return i}function bi(t){return mi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yi(t){return mi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function _i(t){const e=bi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function xi(t,e){t=t||{},e=e||re.font;let i=l(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=l(t.style,e.style);s&&!(""+s).match(fi)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:l(t.family,e.family),lineHeight:pi(l(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:l(t.weight,e.weight),string:""};return n.string=we(n),n}function vi(t,e,i,s){let a,o,r,l=!0;for(a=0,o=t.length;a<o;++a)if(r=t[a],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),l=!1),void 0!==i&&n(r)&&(r=r[i%r.length],l=!1),void 0!==r))return s&&!l&&(s.cacheable=!1),r}function wi(t,e,i){const{min:s,max:n}=t,a=c(e,(n-s)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(s,-Math.abs(a)),max:o(n,a)}}function ki(t,e){return Object.assign(Object.create(t),e)}function Mi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Di(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Si(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ci(t){return"angle"===t?{between:K,compare:X,normalize:Z}:{between:tt,compare:(t,e)=>t-e,normalize:t=>t}}function Pi({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function Oi(t,e,i){if(!i)return[t];const{property:s,start:n,end:a}=i,o=e.length,{compare:r,between:l,normalize:h}=Ci(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:a}=i,{between:o,normalize:r}=Ci(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&o(r(e[d%l][s]),n,a);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),p=[];let g,m,b,y=!1,_=null;for(let t=c,i=c;t<=d;++t)m=e[t%o],m.skip||(g=h(m[s]),g!==b&&(y=l(g,n,a),null===_&&(y||l(n,b,g)&&0!==r(n,b))&&(_=0===r(g,n)?t:i),null!==_&&(!y||0===r(a,g)||l(a,b,g))&&(p.push(Pi({start:_,end:t,loop:u,count:o,style:f})),_=null),i=t,b=g));return null!==_&&p.push(Pi({start:_,end:d,loop:u,count:o,style:f})),p}function Ti(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const a=Oi(s[n],t.points,e);a.length&&i.push(...a)}return i}function Yi(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const a=!!t._loop,{start:o,end:r}=function(t,e,i,s){let n=0,a=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(a+=n);a>n&&t[a%e].skip;)a--;return a%=e,{start:n,end:a}}(i,n,a,s);return Ai(t,!0===s?[{start:o,end:r,loop:a}]:function(t,e,i,s){const n=t.length,a=[];let o,r=e,l=t[e];for(o=e+1;o<=i;++o){const i=t[o%n];i.skip||i.stop?l.skip||(s=!1,a.push({start:e%n,end:(o-1)%n,loop:s}),e=r=i.stop?o:null):(r=o,l.skip&&(e=o)),l=i}return null!==r&&a.push({start:e%n,end:r%n,loop:s}),a}(i,o,r<o?r+n:r,!!t._fullLoop&&0===o&&r===n-1),i,e)}function Ai(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),a=Li(t.options),{_datasetIndex:o,options:{spanGaps:r}}=t,l=i.length,h=[];let c=a,d=e[0].start,u=d;function f(t,e,s,n){const a=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=a;for(;i[e%l].skip;)e+=a;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=r?d:t.start;let e,a=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=Li(s.setContext(ki(n,{type:"segment",p0:a,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),Ri(e,c)&&f(d,u-1,t.loop,c),a=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}function Li(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Ri(t,e){if(!e)return!1;const i=[],s=function(t,e){return qt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}var Ei=Object.freeze({__proto__:null,HALF_PI:L,INFINITY:Y,PI:P,PITAU:T,QUARTER_PI:R,RAD_PER_DEG:A,TAU:O,TWO_THIRDS_PI:E,_addGrace:wi,_alignPixel:De,_alignStartEnd:ft,_angleBetween:K,_angleDiff:X,_arrayUnique:lt,_attachContext:We,_bezierCurveTo:Le,_bezierInterpolation:di,_boundSegment:Oi,_boundSegments:Ti,_capitalize:k,_computeSegments:Yi,_createResolver:Fe,_decimalPlaces:$,_deprecated:function(t,e,i,s){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+s+'" instead')},_descriptors:ze,_elementsEqual:f,_factorize:z,_filterBetween:nt,_getParentNode:he,_getStartAndCountOfVisiblePoints:gt,_int16Range:Q,_isBetween:tt,_isClickEvent:C,_isDomSupported:le,_isPointInArea:Oe,_limitValue:J,_longestText:Me,_lookup:et,_lookupByKey:it,_measureText:ke,_merger:m,_mergerIf:_,_normalizeAngle:Z,_parseObjectDataRadialScale:Ke,_pointInLine:hi,_readValueToProps:mi,_rlookupByKey:st,_scaleRangesChanged:mt,_setMinAndMaxByKey:B,_splitKey:v,_steppedInterpolation:ci,_steppedLineTo:Ae,_textX:pt,_toLeftRightCenter:ut,_updateBezierControlPoints:ni,addRoundedRectPath:Ne,almostEquals:F,almostWhole:H,callback:d,clearCanvas:Se,clipArea:Te,clone:p,color:Xt,createContext:ki,debounce:dt,defined:M,distanceBetweenPoints:q,drawPoint:Ce,drawPointLegend:Pe,each:u,easingEffects:li,finiteOrDefault:r,fontString:function(t,e,i){return e+" "+t+"px "+i},formatNumber:te,getAngleFromPoint:G,getHoverColor:Zt,getMaximumSize:ye,getRelativePosition:me,getRtlAdapter:Mi,getStyle:ue,isArray:n,isFinite:o,isFunction:D,isNullOrUndef:s,isNumber:V,isObject:a,isPatternOrGradient:qt,listenArrayEvents:ot,log10:I,merge:b,mergeIf:y,niceNum:W,noop:e,overrideTextDirection:Di,readUsedSize:ve,renderText:Ie,requestAnimFrame:ht,resolve:vi,resolveObjectKey:w,restoreTextDirection:Si,retinaScale:_e,setsEqual:S,sign:N,splineCurve:ei,splineCurveMonotone:ii,supportsEventListenerOptions:xe,throttled:ct,toDegrees:U,toDimension:c,toFont:xi,toFontString:we,toLineHeight:pi,toPadding:_i,toPercentage:h,toRadians:j,toTRBL:bi,toTRBLCorners:yi,uid:i,unclipArea:Ye,unlistenArrayEvents:rt,valueOrDefault:l});function Ii(t,e,i,s){const{controller:n,data:a,_sorted:o}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&o&&a.length){const t=r._reversePixels?st:it;if(!s)return t(a,e,i);if(n._sharedOptions){const s=a[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(a,e,i-n),o=t(a,e,i+n);return{lo:s.lo,hi:o.hi}}}}return{lo:0,hi:a.length-1}}function Ni(t,e,i,s,n){const a=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=a.length;t<i;++t){const{index:i,data:r}=a[t],{lo:l,hi:h}=Ii(a[t],e,o,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t)}}}function Fi(t,e,i,s,n){const a=[];return n||t.isPointInArea(e)?(Ni(t,i,e,(function(i,o,r){(n||Oe(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&a.push({element:i,datasetIndex:o,index:r})}),!0),a):a}function Wi(t,e,i,s,n,a){return a||t.isPointInArea(e)?"r"!==i||s?function(t,e,i,s,n,a){let o=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,a=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(a,2))}}(i);let l=Number.POSITIVE_INFINITY;return Ni(t,i,e,(function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!a&&!t.isPointInArea(u)&&!d)return;const f=r(e,u);f<l?(o=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&o.push({element:i,datasetIndex:h,index:c})})),o}(t,e,i,s,n,a):function(t,e,i,s){let n=[];return Ni(t,i,e,(function(t,i,a){const{startAngle:o,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:l}=G(t,{x:e.x,y:e.y});K(l,o,r)&&n.push({element:t,datasetIndex:i,index:a})})),n}(t,e,i,n):[]}function zi(t,e,i,s,n){const a=[],o="x"===i?"inXRange":"inYRange";let r=!1;return Ni(t,i,e,((t,s,l)=>{t[o](e[i],n)&&(a.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:a}var Vi={evaluateInteractionItems:Ni,modes:{index(t,e,i,s){const n=me(e,t),a=i.axis||"x",o=i.includeInvisible||!1,r=i.intersect?Fi(t,n,a,s,o):Wi(t,n,a,!1,s,o),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=me(e,t),a=i.axis||"xy",o=i.includeInvisible||!1;let r=i.intersect?Fi(t,n,a,s,o):Wi(t,n,a,!1,s,o);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point:(t,e,i,s)=>Fi(t,me(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=me(e,t),a=i.axis||"xy",o=i.includeInvisible||!1;return Wi(t,n,a,i.intersect,s,o)},x:(t,e,i,s)=>zi(t,me(e,t),"x",i.intersect,s),y:(t,e,i,s)=>zi(t,me(e,t),"y",i.intersect,s)}};const Hi=["left","top","right","bottom"];function Bi(t,e){return t.filter((t=>t.pos===e))}function ji(t,e){return t.filter((t=>-1===Hi.indexOf(t.pos)&&t.box.axis===e))}function Ui(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function $i(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Gi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function qi(t,e,i,s){const{pos:n,box:o}=i,r=t.maxPadding;if(!a(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&Gi(r,o.getPadding());const l=Math.max(0,e.outerWidth-$i(r,t,"left","right")),h=Math.max(0,e.outerHeight-$i(r,t,"top","bottom")),c=l!==t.w,d=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:c,other:d}:{same:d,other:c}}function Xi(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}(t?["left","right"]:["top","bottom"])}function Zi(t,e,i,s){const n=[];let a,o,r,l,h,c;for(a=0,o=t.length,h=0;a<o;++a){r=t[a],l=r.box,l.update(r.width||e.w,r.height||e.h,Xi(r.horizontal,e));const{same:o,other:d}=qi(e,i,r,s);h|=o&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&Zi(n,e,i,s)||c}function Ki(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function Ji(t,e,i,s){const n=i.padding;let{x:a,y:o}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,a=l.size||t.height;M(l.start)&&(o=l.start),t.fullSize?Ki(t,n.left,o,i.outerWidth-n.right-n.left,a):Ki(t,e.left+l.placed,o,s,a),l.start=o,l.placed+=s,o=t.bottom}else{const s=e.h*h,o=l.size||t.width;M(l.start)&&(a=l.start),t.fullSize?Ki(t,a,n.top,o,i.outerHeight-n.bottom-n.top):Ki(t,a,e.top+l.placed,o,s),l.start=a,l.placed+=s,a=t.right}}e.x=a,e.y=o}var Qi={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=_i(t.options.layout.padding),a=Math.max(e-n.width,0),o=Math.max(i-n.height,0),r=function(t){const e=function(t){const e=[];let i,s,n,a,o,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:a,options:{stack:o,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:a,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&a+o,stackWeight:r});return e}(t),i=Ui(e.filter((t=>t.box.fullSize)),!0),s=Ui(Bi(e,"left"),!0),n=Ui(Bi(e,"right")),a=Ui(Bi(e,"top"),!0),o=Ui(Bi(e,"bottom")),r=ji(e,"x"),l=ji(e,"y");return{fullSize:i,leftAndTop:s.concat(a),rightAndBottom:n.concat(l).concat(o).concat(r),chartArea:Bi(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:a.concat(o).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;u(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},n);Gi(f,_i(s));const p=Object.assign({maxPadding:f,w:a,h:o,x:n.left,y:n.top},n),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Hi.includes(s))continue;const a=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let a,o,r;for(a=0,o=t.length;a<o;++a){r=t[a];const{fullSize:o}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:o&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:o&&e.availableHeight)}return i}(l.concat(h),d);Zi(r.fullSize,p,d,g),Zi(l,p,d,g),Zi(h,p,d,g)&&Zi(l,p,d,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),Ji(r.leftAndTop,p,d,g),p.x+=p.w,p.y+=p.h,Ji(r.rightAndBottom,p,d,g),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},u(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class ts{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class es extends ts{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const is="$chartjs",ss={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ns=t=>null===t||""===t,as=!!xe&&{passive:!0};function os(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,as)}function rs(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ls(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||rs(i.addedNodes,s),e=e&&!rs(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function hs(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||rs(i.removedNodes,s),e=e&&!rs(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const cs=new Map;let ds=0;function us(){const t=window.devicePixelRatio;t!==ds&&(ds=t,cs.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function fs(t,e,i){const s=t.canvas,n=s&&he(s);if(!n)return;const a=ct(((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i()}),window),o=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return o.observe(n),function(t,e){cs.size||window.addEventListener("resize",us),cs.set(t,e)}(t,a),o}function ps(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){cs.delete(t),cs.size||window.removeEventListener("resize",us)}(t)}function gs(t,e,i){const s=t.canvas,n=ct((e=>{null!==t.ctx&&i(function(t,e){const i=ss[t.type]||t.type,{x:s,y:n}=me(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,as)}(s,e,n),n}class ms extends ts{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[is]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",ns(n)){const e=ve(t,"width");void 0!==e&&(t.width=e)}if(ns(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ve(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[is])return!1;const i=e[is].initial;["height","width"].forEach((t=>{const n=i[t];s(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[is],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:ls,detach:hs,resize:fs}[e]||gs;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:ps,detach:ps,resize:ps}[e]||os)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ye(t,e,i,s)}isAttached(t){const e=t&&he(t);return!(!e||!e.isConnected)}}function bs(t){return!le()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?es:ms}var ys=Object.freeze({__proto__:null,BasePlatform:ts,BasicPlatform:es,DomPlatform:ms,_detectPlatform:bs});const _s="transparent",xs={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=Xt(t||_s),n=s.valid&&Xt(e||_s);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class vs{constructor(t,e,i,s){const n=e[i];s=vi([t.to,s,n,t.from]);const a=vi([t.from,n,s]);this._active=!0,this._fn=t.fn||xs[t.type||typeof a],this._easing=li[t.easing]||li.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,a=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=vi([t.to,e,s,t.from]),this._from=vi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,a=this._loop,o=this._to;let r;if(this._active=n!==o&&(a||e<i),!this._active)return this._target[s]=o,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=a&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,o,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class ws{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!a(t))return;const e=Object.keys(re.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const o=t[s];if(!a(o))return;const r={};for(const t of e)r[t]=o[t];(n(o.properties)&&o.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,r)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let r;for(r=a.length-1;r>=0;--r){const l=a[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,o);continue}c.cancel()}d&&d.duration?(n[l]=c=new vs(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(bt.add(this._chart,i),!0):void 0}}function ks(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,a=void 0===i.max?e:0;return{start:s?a:n,end:s?n:a}}function Ms(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,a;for(n=0,a=s.length;n<a;++n)i.push(s[n].index);return i}function Ds(t,e,i,s={}){const n=t.keys,a="single"===s.mode;let r,l,h,c;if(null!==e){for(r=0,l=n.length;r<l;++r){if(h=+n[r],h===i){if(s.all)continue;break}c=t.values[h],o(c)&&(a||0===e||N(e)===N(c))&&(e+=c)}return e}}function Ss(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Cs(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function Ps(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function Os(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:a,vScale:o,index:r}=s,l=a.axis,h=o.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(a,o,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:a,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=Cs(n,c,a),u[r]=d,u._top=Ps(u,o,!0,s.type),u._bottom=Ps(u,o,!1,s.type),(u._visualValues||(u._visualValues={}))[r]=d}}function Ts(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Ys(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const As=t=>"reset"===t||"none"===t,Ls=(t,e)=>e?t:Object.assign({},t);class Rs{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ss(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ys(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=l(i.xAxisID,Ts(t,"x")),a=e.yAxisID=l(i.yAxisID,Ts(t,"y")),o=e.rAxisID=l(i.rAxisID,Ts(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,a,o),c=e.vAxisID=s(r,a,n,o);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&rt(this._data,this),t._stacked&&Ys(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(a(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",a="x"===s.axis?"x":"y",o=Object.keys(t),r=new Array(o.length);let l,h,c;for(l=0,h=o.length;l<h;++l)c=o[l],r[l]={[n]:c,[a]:t[c]};return r}(e,t)}else if(i!==e){if(i){rt(i,this);const t=this._cachedMeta;Ys(t),t._parsed=[]}e&&Object.isExtensible(e)&&ot(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=Ss(e.vScale,e),e.stack!==i.stack&&(s=!0,Ys(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&Os(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,l=o.axis;let h,c,d,u=0===t&&e===s.length||i._sorted,f=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,d=s;else{d=n(s[t])?this.parseArrayData(i,s,t,e):a(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const o=()=>null===c[l]||f&&c[l]<f[l];for(h=0;h<e;++h)i._parsed[h+t]=c=d[h],u&&(o()&&(u=!1),f=c);i._sorted=u}r&&Os(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:a}=t,o=n.axis,r=a.axis,l=n.getLabels(),h=n===a,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[o]:h||n.parse(l[f],f),[r]:a.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:a}=t,o=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],o[r]={x:n.parse(c[0],h),y:a.parse(c[1],h)};return o}parseObjectData(t,e,i,s){const{xScale:n,yScale:a}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(w(u,o),d),y:a.parse(w(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,a=e[t.axis];return Ds({keys:Ms(s,!0),values:e._stacks[t.axis]._visualValues},a,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let a=null===n?NaN:n;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=Ds(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Ms(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let u,f;function p(){f=s[u];const e=f[r.axis];return!o(f[t.axis])||c>e||d<e}for(u=0;u<a&&(p()||(this.updateRangeFromParsed(h,t,f,l),!n));++u);if(n)for(u=a-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(h,t,f,l);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,a;for(s=0,n=e.length;s<n;++s)a=e[s][t.axis],o(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return a(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(l(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=ks(t,i),n=ks(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,a=[],o=this._drawStart||0,r=this._drawCount||s.length-o,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,o,r),h=o;h<o+r;++h){const e=s[h];e.hidden||(e.active&&l?a.push(e):e.draw(t,n))}for(h=0;h<a.length;++h)a[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return ki(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return ki(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,a=t+"-"+e,o=n[a],r=this.enableOptionSharing&&M(i);if(o)return Ls(o,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(re.elements[t]),f=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s,e)),c);return f.$shared&&(f.$shared=r,n[a]=Object.freeze(Ls(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,a=`animation-${e}`,o=n[a];if(o)return o;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),a=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(a,this.getContext(t,i,e))}const l=new ws(s,r&&r.animations);return r&&r._cacheable&&(n[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||As(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),a=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:a}}updateElement(t,e,i,s){As(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!As(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,a=Math.min(n,s);a&&this.parse(0,a),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,a=t+e;let o;const r=t=>{for(t.length+=e,o=t.length-1;o>=a;o--)t[o]=t[o-e]};for(r(n),o=t;o<a;++o)n[o]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Ys(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class Es{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return V(this.x)&&V(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function Is(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),a=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=o.length,l=o[0],h=o[r-1],c=[];if(r>a)return function(t,e,i,s){let n,a=0,o=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===o&&(e.push(t[n]),a++,o=i[a*s])}(e,c,o,r/a),c;const d=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const a=z(s);for(let t=0,e=a.length-1;t<e;t++){const e=a[t];if(e>n)return e}return Math.max(n,1)}(o,e,a);if(r>0){let t,i;const n=r>1?Math.round((h-l)/(r-1)):null;for(Ns(e,c,d,s(n)?0:l-n,l),t=0,i=r-1;t<i;t++)Ns(e,c,d,o[t],o[t+1]);return Ns(e,c,d,h,s(n)?e.length:h+n),c}return Ns(e,c,d),c}function Ns(t,e,i,s,n){const a=l(s,0),o=Math.min(l(n,t.length),t.length);let r,h,c,d=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),c=a;c<0;)d++,c=Math.round(a+d*i);for(h=Math.max(a,0);h<o;h++)h===c&&(e.push(t[h]),d++,c=Math.round(a+d*i))}const Fs=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Ws=(t,e)=>Math.min(e||t,t);function zs(t,e){const i=[],s=t.length/e,n=t.length;let a=0;for(;a<n;a+=s)i.push(t[Math.floor(a)]);return i}function Vs(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),a=t._startPixel,o=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-a,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<a-r||h>o+r)))return h}function Hs(t){return t.drawTicks?t.tickLength:0}function Bs(t,e){if(!t.display)return 0;const i=xi(t.font,e),s=_i(t.padding);return(n(t.text)?t.text.length:1)*i.lineHeight+s.height}function js(t,e,i){let s=ut(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Us extends Es{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=r(t,Number.POSITIVE_INFINITY),e=r(e,Number.NEGATIVE_INFINITY),i=r(i,Number.POSITIVE_INFINITY),s=r(s,Number.NEGATIVE_INFINITY),{min:r(t,i),max:r(e,s),minDefined:o(t),maxDefined:o(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:a}=this.getUserBounds();if(n&&a)return{min:i,max:s};const o=this.getMatchingVisibleMetas();for(let r=0,l=o.length;r<l;++r)e=o[r].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),a||(s=Math.max(s,e.max));return i=a&&i>s?s:i,s=n&&i>s?i:s,{min:r(i,r(s,i)),max:r(s,r(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){d(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=wi(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=o<this.ticks.length;this._convertTicksToLabels(r?zs(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=Is(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){d(this.options.afterUpdate,[this])}beforeSetDimensions(){d(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){d(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),d(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){d(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=d(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){d(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){d(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Ws(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,n=e.maxRotation;let a,o,r,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=J(this.chart.width-c,0,this.maxWidth);a=t.offset?this.maxWidth/i:u/(i-1),c+6>a&&(a=u/(i-(t.offset?.5:1)),o=this.maxHeight-Hs(t.grid)-e.padding-Bs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=U(Math.min(Math.asin(J((h.highest.height+6)/a,-1,1)),Math.asin(J(o/r,-1,1))-Math.asin(J(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){d(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){d(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const a=Bs(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=Hs(n)+a):(t.height=this.maxHeight,t.width=Hs(n)+a),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:a}=this._getLabelSizes(),r=2*i.padding,l=j(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=i.mirror?0:c*n.width+h*a.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*a.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:a},position:o}=this.options,r=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-h+a)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+a,this.paddingBottom=s+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){d(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)s(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=zs(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:a,_longestTextCache:o}=this,r=[],l=[],h=Math.floor(e/Ws(e,i));let c,d,f,p,g,m,b,y,_,x,v,w=0,k=0;for(c=0;c<e;c+=h){if(p=t[c].label,g=this._resolveTickFontOptions(c),a.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},y=g.lineHeight,_=x=0,s(p)||n(p)){if(n(p))for(d=0,f=p.length;d<f;++d)v=p[d],s(v)||n(v)||(_=ke(a,b.data,b.gc,_,v),x+=y)}else _=ke(a,b.data,b.gc,_,p),x=y;r.push(_),l.push(x),w=Math.max(_,w),k=Math.max(x,k)}!function(t,e){u(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}}))}(o,e);const M=r.indexOf(w),D=l.indexOf(k),S=t=>({width:r[t]||0,height:l[t]||0});return{first:S(0),last:S(e-1),widest:S(M),highest:S(D),widths:r,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Q(this._alignToPixels?De(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return ki(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=ki(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=j(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),a=t.autoSkipPadding||0,o=n?n.widest.width+a:0,r=n?n.highest.height+a:0;return this.isHorizontal()?r*i>o*s?o/i:r/s:r*s<o*i?r/i:o/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:r}=s,h=n.offset,c=this.isHorizontal(),d=this.ticks.length+(h?1:0),u=Hs(n),f=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(t){return De(i,t,g)};let y,_,x,v,w,k,M,D,S,C,P,O;if("top"===o)y=b(this.bottom),k=this.bottom-u,D=y-m,C=b(t.top)+m,O=t.bottom;else if("bottom"===o)y=b(this.top),C=t.top,O=b(t.bottom)-m,k=y+m,D=this.top+u;else if("left"===o)y=b(this.right),w=this.right-u,M=y-m,S=b(t.left)+m,P=t.right;else if("right"===o)y=b(this.left),S=t.left,P=b(t.right)-m,w=y+m,M=this.left+u;else if("x"===e){if("center"===o)y=b((t.top+t.bottom)/2+.5);else if(a(o)){const t=Object.keys(o)[0],e=o[t];y=b(this.chart.scales[t].getPixelForValue(e))}C=t.top,O=t.bottom,k=y+m,D=k+u}else if("y"===e){if("center"===o)y=b((t.left+t.right)/2);else if(a(o)){const t=Object.keys(o)[0],e=o[t];y=b(this.chart.scales[t].getPixelForValue(e))}w=y-m,M=w-u,S=t.left,P=t.right}const T=l(s.ticks.maxTicksLimit,d),Y=Math.max(1,Math.ceil(d/T));for(_=0;_<d;_+=Y){const t=this.getContext(_),e=n.setContext(t),s=r.setContext(t),a=e.lineWidth,o=e.color,l=s.dash||[],d=s.dashOffset,u=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;x=Vs(this,_,h),void 0!==x&&(v=De(i,x,a),c?w=M=S=P=v:k=D=C=O=v,f.push({tx1:w,ty1:k,tx2:M,ty2:D,x1:S,y1:C,x2:P,y2:O,width:a,color:o,borderDash:l,borderDashOffset:d,tickWidth:u,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=d,this._borderValue=y,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),l=this.ticks,{align:h,crossAlign:c,padding:d,mirror:u}=o,f=Hs(i.grid),p=f+d,g=u?-d:p,m=-j(this.labelRotation),b=[];let y,_,x,v,w,k,M,D,S,C,P,O,T="middle";if("top"===s)k=this.bottom-g,M=this._getXAxisLabelAlignment();else if("bottom"===s)k=this.top+g,M=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(f);M=t.textAlign,w=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(f);M=t.textAlign,w=t.x}else if("x"===e){if("center"===s)k=(t.top+t.bottom)/2+p;else if(a(s)){const t=Object.keys(s)[0],e=s[t];k=this.chart.scales[t].getPixelForValue(e)+p}M=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)w=(t.left+t.right)/2-p;else if(a(s)){const t=Object.keys(s)[0],e=s[t];w=this.chart.scales[t].getPixelForValue(e)}M=this._getYAxisLabelAlignment(f).textAlign}"y"===e&&("start"===h?T="top":"end"===h&&(T="bottom"));const Y=this._getLabelSizes();for(y=0,_=l.length;y<_;++y){x=l[y],v=x.label;const t=o.setContext(this.getContext(y));D=this.getPixelForTick(y)+o.labelOffset,S=this._resolveTickFontOptions(y),C=S.lineHeight,P=n(v)?v.length:1;const e=P/2,i=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let d,f=M;if(r?(w=D,"inner"===M&&(f=y===_-1?this.options.reverse?"left":"right":0===y?this.options.reverse?"right":"left":"center"),O="top"===s?"near"===c||0!==m?-P*C+C/2:"center"===c?-Y.highest.height/2-e*C+C:-Y.highest.height+C/2:"near"===c||0!==m?C/2:"center"===c?Y.highest.height/2-e*C:Y.highest.height-P*C,u&&(O*=-1),0===m||t.showLabelBackdrop||(w+=C/2*Math.sin(m))):(k=D,O=(1-P)*C/2),t.showLabelBackdrop){const e=_i(t.backdropPadding),i=Y.heights[y],s=Y.widths[y];let n=O-e.top,a=0-e.left;switch(T){case"middle":n-=i/2;break;case"bottom":n-=i}switch(M){case"center":a-=s/2;break;case"right":a-=s;break;case"inner":y===_-1?a-=s:y>0&&(a-=s/2)}d={left:a,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}b.push({label:v,font:S,textOffset:O,options:{rotation:m,color:i,strokeColor:a,strokeWidth:h,textAlign:f,textBaseline:T,translation:[w,k],backdrop:d}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-j(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,a=t+n,o=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l+=o)):(l=this.right-a,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l-=o)):(l=this.left+a,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,a;const o=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,a=s.length;n<a;++n){const t=s[n];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,n=i.setContext(this.getContext()),a=i.display?n.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let l,h,c,d;this.isHorizontal()?(l=De(t,this.left,a)-a/2,h=De(t,this.right,o)+o/2,c=d=r):(c=De(t,this.top,a)-a/2,d=De(t,this.bottom,o)+o/2,l=h=r),e.save(),e.lineWidth=n.width,e.strokeStyle=n.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Te(e,i);const s=this.getLabelItems(t);for(const t of s){const i=t.options,s=t.font;Ie(e,t.label,0,t.textOffset,s,i)}i&&Ye(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=xi(i.font),r=_i(i.padding),l=i.align;let h=o.lineHeight/2;"bottom"===e||"center"===e||a(e)?(h+=r.bottom,n(i.text)&&(h+=o.lineHeight*(i.text.length-1))):h+=r.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=function(t,e,i,s){const{top:n,left:o,bottom:r,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let u,f,p,g=0;const m=r-n,b=l-o;if(t.isHorizontal()){if(f=ft(s,o,l),a(i)){const t=Object.keys(i)[0],s=i[t];p=d[t].getPixelForValue(s)+m-e}else p="center"===i?(c.bottom+c.top)/2+m-e:Fs(t,i,e);u=l-o}else{if(a(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-b+e}else f="center"===i?(c.left+c.right)/2-b+e:Fs(t,i,e);p=ft(s,r,n),g="left"===i?-L:L}return{titleX:f,titleY:p,maxWidth:u,rotation:g}}(this,h,e,l);Ie(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:f,textAlign:js(l,e,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=l(t.grid&&t.grid.z,-1),s=l(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Us.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,a;for(n=0,a=e.length;n<a;++n){const a=e[n];a[i]!==this.id||t&&a.type!==t||s.push(a)}return s}_resolveTickFontOptions(t){return xi(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class $s{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,a=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=b(Object.create(null),[i?re.get(i):{},re.get(e),t.defaults]);re.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),n=s.pop(),a=[t].concat(s).join("."),o=e[i].split("."),r=o.pop(),l=o.join(".");re.route(a,n,l,r)}))}(e,t.defaultRoutes),t.descriptors&&re.describe(e,t.descriptors)}(t,a,i),this.override&&re.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in re[s]&&(delete re[s][i],this.override&&delete se[i])}}var Gs=new class{constructor(){this.controllers=new $s(Rs,"datasets",!0),this.elements=new $s(Es,"elements"),this.plugins=new $s(Object,"plugins"),this.scales=new $s(Us,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):u(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=k(t);d(i["before"+s],[],i),e[t](i),d(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}};class qs{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===d(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){s(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=l(i.options&&i.options.plugins,{}),n=function(t){const e={},i=[],s=Object.keys(Gs.plugins.items);for(let t=0;t<s.length;t++)i.push(Gs.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){const a=[],o=t.getContext();for(const r of e){const e=r.id,l=Xs(s[e],n);null!==l&&a.push({plugin:r,options:Zs(t.config,{plugin:r,local:i[e]},l,o)})}return a}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Xs(t,e){return e||!1!==t?!0===t?{}:t:null}function Zs(t,{plugin:e,local:i},s,n){const a=t.pluginScopeKeys(e),o=t.getOptionScopes(s,a);return i&&e.defaults&&o.push(e.defaults),t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ks(t,e){const i=re.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Js(t){if("x"===t||"y"===t||"r"===t)return t}function Qs(t,...e){if(Js(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&Js(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tn(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function en(t){const e=t.options||(t.options={});e.plugins=l(e.plugins,{}),e.scales=function(t,e){const i=se[t.type]||{scales:{}},s=e.scales||{},n=Ks(t.type,e),o=Object.create(null);return Object.keys(s).forEach((e=>{const r=s[e];if(!a(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const l=Qs(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return tn(t,"x",i[0])||tn(t,"y",i[0])}return{}}(e,t),re.scales[r.type]),h=function(t,e){return t===e?"_index_":"_value_"}(l,n),c=i.scales||{};o[e]=y(Object.create(null),[{axis:l},r,c[l],c[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,a=i.indexAxis||Ks(n,e),r=(se[n]||{}).scales||{};Object.keys(r).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),y(o[n],[{axis:e},s[n],r[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];y(e,[re.scales[e.type],re.scale])})),o}(t,e)}function sn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const nn=new Map,an=new Set;function on(t,e){let i=nn.get(t);return i||(i=e(),nn.set(t,i),an.add(i)),i}const rn=(t,e,i)=>{const s=w(e,i);void 0!==s&&t.add(s)};class ln{constructor(t){this._config=function(t){return(t=t||{}).data=sn(t.data),en(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=sn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),en(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return on(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return on(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return on(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return on(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>rn(r,t,e)))),e.forEach((t=>rn(r,s,t))),e.forEach((t=>rn(r,se[n]||{},t))),e.forEach((t=>rn(r,re,t))),e.forEach((t=>rn(r,ne,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),an.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,se[e]||{},re.datasets[e]||{},{type:e},re,ne]}resolveNamedOptions(t,e,i,s=[""]){const a={$shared:!0},{resolver:o,subPrefixes:r}=hn(this._resolverCache,t,s);let l=o;(function(t,e){const{isScriptable:i,isIndexable:s}=ze(t);for(const a of e){const e=i(a),o=s(a),r=(o||e)&&t[a];if(e&&(D(r)||cn(r))||o&&n(r))return!0}return!1})(o,e)&&(a.$shared=!1,l=We(o,i=D(i)?i():i,this.createResolver(t,i,r)));for(const t of e)a[t]=l[t];return a}createResolver(t,e,i=[""],s){const{resolver:n}=hn(this._resolverCache,t,i);return a(e)?We(n,e,void 0,s):n}}function hn(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let a=s.get(n);return a||(a={resolver:Fe(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,a)),a}const cn=t=>a(t)&&Object.getOwnPropertyNames(t).some((e=>D(t[e]))),dn=["top","bottom","left","right","chartArea"];function un(t,e){return"top"===t||"bottom"===t||-1===dn.indexOf(t)&&"x"===e}function fn(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function pn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),d(i&&i.onComplete,[t],e)}function gn(t){const e=t.chart,i=e.options.animation;d(i&&i.onProgress,[t],e)}function mn(t){return le()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bn={},yn=t=>{const e=mn(t);return Object.values(bn).filter((t=>t.canvas===e)).pop()};function _n(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const a=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=a)}}}function xn(t,e,i){return t.options.clip?t[i]:e[i]}class vn{static defaults=re;static instances=bn;static overrides=se;static registry=Gs;static version="4.4.3";static getChart=yn;static register(...t){Gs.add(...t),wn()}static unregister(...t){Gs.remove(...t),wn()}constructor(t,e){const s=this.config=new ln(e),n=mn(t),a=yn(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||bs(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,o.aspectRatio),l=r&&r.canvas,h=l&&l.height,c=l&&l.width;this.id=i(),this.ctx=r,this.canvas=l,this.width=c,this.height=h,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new qs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=dt((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],bn[this.id]=this,r&&l?(bt.listen(this,"complete",pn),bt.listen(this,"progress",gn),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return s(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Gs}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_e(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Se(this.canvas,this.ctx),this}stop(){return bt.stop(this),this}resize(t,e){bt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,n),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,_e(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),d(i.onResize,[this,a],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){u(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Qs(t,i),n="r"===s,a="x"===s;return{options:i,dposition:n?"chartArea":a?"bottom":"left",dtype:n?"radialLinear":a?"category":"linear"}})))),u(n,(e=>{const n=e.options,a=n.id,o=Qs(a,n),r=l(n.type,e.dtype);void 0!==n.position&&un(n.position,o)===un(e.dposition)||(n.position=e.dposition),s[a]=!0;let h=null;a in i&&i[a].type===r?h=i[a]:(h=new(Gs.getScale(r))({id:a,type:r,ctx:this.ctx,chart:this}),i[h.id]=h),h.init(n,t)})),u(s,((t,e)=>{t||delete i[e]})),u(i,(t=>{Qi.configure(this,t,t.options),Qi.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(fn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const a=s.type||this.config.type;if(n.type&&n.type!==a&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=a,n.indexAxis=s.indexAxis||Ks(a,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=Gs.getController(a),{datasetElementType:s,dataElementType:o}=re.datasets[a];Object.assign(e,{dataElementType:Gs.getElement(o),datasetElementType:s&&Gs.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){u(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),a=Math.max(+e.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||u(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fn("z","_idx"));const{_active:o,_lastEvent:r}=this;r?this._eventHandler(r,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){u(this.scales,(t=>{Qi.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);S(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)_n(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!S(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Qi.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],u(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,D(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(bt.has(this)?this.attached&&!bt.running(this)&&bt.start(this):(this.draw(),pn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:xn(i,e,"left"),right:xn(i,e,"right"),top:xn(s,e,"top"),bottom:xn(s,e,"bottom")}:e}(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(s&&Te(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&Ye(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Oe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Vi.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=ki(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),a=n.controller._resolveAnimations(void 0,s);M(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),bt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Se(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete bn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};u(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",n),i("detach",a)};a=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){u(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},u(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,a,o,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,r=t.length;o<r;++o){a=t[o];const e=a&&this.getDatasetMeta(a.datasetIndex).controller;e&&e[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!f(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),a=n(e,t),o=i?t:n(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,a=e,o=this._getActiveElements(t,s,i,a),r=C(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,d(n.onHover,[t,o,this],this),r&&d(n.onClick,[t,o,this],this));const h=!f(o,s);return(h||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function wn(){return u(vn.instances,(t=>t._plugins.invalidate()))}function kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Mn{static override(t){Object.assign(Mn.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return kn()}parse(){return kn()}format(){return kn()}add(){return kn()}diff(){return kn()}startOf(){return kn()}endOf(){return kn()}}var Dn={_date:Mn};function Sn(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=lt(s.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let s,n,a,o,r=e._length;const l=()=>{32767!==a&&-32768!==a&&(M(o)&&(r=Math.min(r,Math.abs(a-o)||r)),o=a)};for(s=0,n=i.length;s<n;++s)a=e.getPixelForValue(i[s]),l();for(o=void 0,s=0,n=e.ticks.length;s<n;++s)a=e.getPixelForTick(s),l();return r}function Cn(t,e,i,s){return n(t)?function(t,e,i,s){const n=i.parse(t[0],s),a=i.parse(t[1],s),o=Math.min(n,a),r=Math.max(n,a);let l=o,h=r;Math.abs(o)>Math.abs(r)&&(l=r,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:a,min:o,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Pn(t,e,i,s){const n=t.iScale,a=t.vScale,o=n.getLabels(),r=n===a,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=r||n.parse(o[h],h),l.push(Cn(u,d,a,h));return l}function On(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Tn(t,e,i,s){let n=e.borderSkipped;const a={};if(!n)return void(t.borderSkipped=a);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:r,reverse:l,top:h,bottom:c}=function(t){let e,i,s,n,a;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",a="start"):(n="start",a="end"),{start:i,end:s,reverse:e,top:n,bottom:a}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(a[Yn(c,o,r,l)]=!0,n=h)),a[Yn(n,o,r,l)]=!0,t.borderSkipped=a}function Yn(t,e,i,s){var n,a,o;return s?(o=i,t=An(t=(n=t)===(a=e)?o:n===o?a:n,i,e)):t=An(t,e,i),t}function An(t,e,i){return"start"===t?e:"end"===t?i:t}function Ln(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class Rn extends Rs{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:s,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,r=t=>+i[t];if(a(i[t])){const{key:t="value"}=this._parsing;r=e=>+w(i[e],t)}for(n=t,o=t+e;n<o;++n)s._parsed[n]=r(n)}}_getRotation(){return j(this.options.rotation-90)}_getCircumference(){return j(this.options.circumference)}_getRotationExtents(){let t=O,e=-O;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),a=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),r=Math.min(h(this.options.cutout,o),1),l=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(t,e,i){let s=1,n=1,a=0,o=0;if(e<O){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(t,e,s)=>K(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),p=(t,e,s)=>K(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),g=f(0,h,d),m=f(L,c,u),b=p(P,h,d),y=p(P+L,c,u);s=(g-b)/2,n=(m-y)/2,a=-(g+b)/2,o=-(m+y)/2}return{ratioX:s,ratioY:n,offsetX:a,offsetY:o}}(u,d,r),b=(i.width-a)/f,y=(i.height-a)/p,_=Math.max(Math.min(b,y)/2,0),x=c(this.options.radius,_),v=(x-Math.max(x*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,s.total=this.calculateTotal(),this.outerRadius=x-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/O)}updateElements(t,e,i,s){const n="reset"===s,a=this.chart,o=a.chartArea,r=a.options.animation,l=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,s);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,n);for(g=e;g<e+i;++g){const e=this._circumference(g,n),i=t[g],a={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};p&&(a.options=f||this.resolveDataElementOptions(g,i.active?"active":s)),m+=e,this.updateElement(i,g,a,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?O*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=te(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,a,o,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=o.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(l(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class En extends Rs{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:s,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=te(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return Ke.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),a=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const n="reset"===s,a=this.chart,o=a.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*P;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,s,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,p=u+this._computeAngle(d,s,f),g=a.getDataVisibility(d)?r.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=p,n&&(o.animateScale&&(g=0),o.animateRotate&&(i=p=c));const m={x:l,y:h,innerRadius:0,outerRadius:g,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(d,e.active?"active":s)};this.updateElement(e,d,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?j(this.resolveDataElementOptions(t,e).angle||i):0}}var In=Object.freeze({__proto__:null,BarController:class extends Rs{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return Pn(t,e,i,s)}parseArrayData(t,e,i,s){return Pn(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:a}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?o:r,h="x"===a.axis?o:r,c=[];let d,u,f,p;for(d=i,u=i+s;d<u;++d)p=e[d],f={},f[n.axis]=n.parse(w(p,l),d),c.push(Cn(w(p,h),f,a,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),a=n._custom,o=On(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const a="reset"===n,{index:o,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),h=r.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=a||s(e[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,c),g=(e._stacks||{})[r.axis],m={horizontal:h,base:i.base,enableBorderRadius:!g||On(e._custom)||o===g._top||o===g._bottom,x:h?i.head:p.center,y:h?p.center:i.head,height:h?p.size:Math.abs(i.size),width:h?Math.abs(i.size):p.size};u&&(m.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const b=m.options||t[f].options;Tn(m,b,g,o),Ln(m,b,c.ratio),this.updateElement(t[f],f,m,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),a=i.options.stacked,o=[],r=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(s(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!r(i))&&((!1===a||-1===o.indexOf(i.stack)||void 0===a&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,a;for(n=0,a=e.data.length;n<a;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const o=t.barThickness;return{min:o||Sn(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:a,minBarLength:o}}=this,r=a||0,l=this.getParsed(t),h=l._custom,c=On(h);let d,u,f=l[e.axis],p=0,g=i?this.applyStack(e,l,i):f;g!==f&&(p=g-f,g=f),c&&(f=h.barStart,g=h.barEnd-h.barStart,0!==f&&N(f)!==N(h.barEnd)&&(p=0),p+=f);const m=s(a)||c?p:a;let b=e.getPixelForValue(m);if(d=this.chart.getDataVisibility(t)?e.getPixelForValue(p+g):b,u=d-b,Math.abs(u)<o){u=function(t,e,i){return 0!==t?N(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,r)*o,f===r&&(b-=u/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),a=Math.min(t,s),h=Math.max(t,s);b=Math.max(Math.min(b,h),a),d=b+u,i&&!c&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(d)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const t=N(u)*e.getLineWidthForValue(r)/2;b+=t,u-=t}return{size:u,base:b,head:d,center:d+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,a=n.skipNull,o=l(n.maxBarThickness,1/0);let r,h;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,s){const n=e.pixels,a=n[t];let o=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===o&&(o=a-(null===r?e.end-e.start:r-a)),null===r&&(r=a+a-o);const h=a-(a-Math.min(o,r))/2*l;return{chunk:Math.abs(r-o)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,n,i):function(t,e,i,n){const a=i.barThickness;let o,r;return s(a)?(o=e.min*i.categoryPercentage,r=i.barPercentage):(o=a*n,r=1),{chunk:o/n,ratio:r,start:e.pixels[t]-o/2}}(t,e,n,i),c=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);r=l.start+l.chunk*c+l.chunk/2,h=Math.min(o,l.chunk*l.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),h=Math.min(o,e.min*e.ratio);return{base:r-h/2,head:r+h/2,center:r,size:h}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[e.axis]||i[n].hidden||i[n].draw(this._ctx)}},BubbleController:class extends Rs{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=l(s[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=l(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),r=n.getLabelForValue(a.y),l=a._custom;return{label:i[t]||"",value:"("+o+", "+r+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(e,s),h=a.axis,c=o.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!n&&this.getParsed(d),u={},f=u[h]=n?a.getPixelForDecimal(.5):a.getPixelForValue(i[h]),p=u[c]=n?o.getBasePixel():o.getPixelForValue(i[c]);u.skip=isNaN(f)||isNaN(p),l&&(u.options=r||this.resolveDataElementOptions(d,e.active?"active":s),n&&(u.options.radius=0)),this.updateElement(e,d,u,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=l(i&&i._custom,n),s}},DoughnutController:Rn,LineController:class extends Rs{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,a=this.chart._animationsDisabled;let{start:o,count:r}=gt(e,s,a);this._drawStart=o,this._drawCount=r,mt(e)&&(o=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:l},t),this.updateElements(s,o,r,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:o,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,n),u=o.axis,f=r.axis,{spanGaps:p,segment:g}=this.options,m=V(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===n,y=e+i,_=t.length;let x=e>0&&this.getParsed(e-1);for(let i=0;i<_;++i){const p=t[i],_=b?p:{};if(i<e||i>=y){_.skip=!0;continue}const v=this.getParsed(i),w=s(v[f]),k=_[u]=o.getPixelForValue(v[u],i),M=_[f]=a||w?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],i);_.skip=isNaN(k)||isNaN(M)||w,_.stop=i>0&&Math.abs(v[u]-x[u])>m,g&&(_.parsed=v,_.raw=h.data[i]),d&&(_.options=c||this.resolveDataElementOptions(i,p.active?"active":n)),b||this.updateElement(p,i,_,n),x=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends Rn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:En,RadarController:class extends Rs{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Ke.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const a={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,a="reset"===s;for(let o=e;o<e+i;o++){const e=t[o],i=this.resolveDataElementOptions(o,e.active?"active":s),r=n.getPointPositionForValue(o,this.getParsed(o).r),l=a?n.xCenter:r.x,h=a?n.yCenter:r.y,c={x:l,y:h,angle:r.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,o,c,s)}}},ScatterController:class extends Rs{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),r=n.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+r+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:n,count:a}=gt(e,i,s);if(this._drawStart=n,this._drawCount=a,mt(e)&&(n=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:n,_dataset:a}=e;n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!a._decimated,n.points=i;const o=this.resolveDatasetElementOptions(t);o.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:o},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,n,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const a="reset"===n,{iScale:o,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(c),u=this.includeOptions(n,d),f=o.axis,p=r.axis,{spanGaps:g,segment:m}=this.options,b=V(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||"none"===n;let _=e>0&&this.getParsed(e-1);for(let c=e;c<e+i;++c){const e=t[c],i=this.getParsed(c),g=y?e:{},x=s(i[p]),v=g[f]=o.getPixelForValue(i[f],c),w=g[p]=a||x?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,i,l):i[p],c);g.skip=isNaN(v)||isNaN(w)||x,g.stop=c>0&&Math.abs(i[f]-_[f])>b,m&&(g.parsed=i,g.raw=h.data[c]),u&&(g.options=d||this.resolveDataElementOptions(c,e.active?"active":n)),y||this.updateElement(e,c,g,n),_=i}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,a)/2}}});function Nn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Fn(t,e,i,s,n,a){const{x:o,y:r,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let f=0;const p=n-l;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;f=(p-(0!==t?p*t/(t+s):p))/2}const g=(p-Math.max(.001,p*d-i/P)/d)/2,m=l+g+f,b=n-g-f,{outerStart:y,outerEnd:_,innerStart:x,innerEnd:v}=function(t,e,i,s){const n=mi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),a=(i-e)/2,o=Math.min(a,s*e/2),r=t=>{const e=(i-Math.min(a,t))*s/2;return J(t,0,Math.min(a,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:J(n.innerStart,0,o),innerEnd:J(n.innerEnd,0,o)}}(e,u,d,b-m),w=d-y,k=d-_,M=m+y/w,D=b-_/k,S=u+x,C=u+v,O=m+x/S,T=b-v/C;if(t.beginPath(),a){const e=(M+D)/2;if(t.arc(o,r,d,M,e),t.arc(o,r,d,e,D),_>0){const e=Nn(k,D,o,r);t.arc(e.x,e.y,_,D,b+L)}const i=Nn(C,b,o,r);if(t.lineTo(i.x,i.y),v>0){const e=Nn(C,T,o,r);t.arc(e.x,e.y,v,b+L,T+Math.PI)}const s=(b-v/u+(m+x/u))/2;if(t.arc(o,r,u,b-v/u,s,!0),t.arc(o,r,u,s,m+x/u,!0),x>0){const e=Nn(S,O,o,r);t.arc(e.x,e.y,x,O+Math.PI,m-L)}const n=Nn(w,m,o,r);if(t.lineTo(n.x,n.y),y>0){const e=Nn(w,M,o,r);t.arc(e.x,e.y,y,m-L,M)}}else{t.moveTo(o,r);const e=Math.cos(M)*d+o,i=Math.sin(M)*d+r;t.lineTo(e,i);const s=Math.cos(D)*d+o,n=Math.sin(D)*d+r;t.lineTo(s,n)}t.closePath()}function Wn(t,e,i=e){t.lineCap=l(i.borderCapStyle,e.borderCapStyle),t.setLineDash(l(i.borderDash,e.borderDash)),t.lineDashOffset=l(i.borderDashOffset,e.borderDashOffset),t.lineJoin=l(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=l(i.borderWidth,e.borderWidth),t.strokeStyle=l(i.borderColor,e.borderColor)}function zn(t,e,i){t.lineTo(i.x,i.y)}function Vn(t,e,i={}){const s=t.length,{start:n=0,end:a=s-1}=i,{start:o,end:r}=e,l=Math.max(n,o),h=Math.min(a,r),c=n<o&&a<o||n>r&&a>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Hn(t,e,i,s){const{points:n,options:a}=e,{count:o,start:r,loop:l,ilen:h}=Vn(n,i,s),c=function(t){return t.stepped?Ae:t.tension||"monotone"===t.cubicInterpolationMode?Le:zn}(a);let d,u,f,{move:p=!0,reverse:g}=s||{};for(d=0;d<=h;++d)u=n[(r+(g?h-d:d))%o],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):c(t,f,u,g,a.stepped),f=u);return l&&(u=n[(r+(g?h:0))%o],c(t,f,u,g,a.stepped)),!!l}function Bn(t,e,i,s){const n=e.points,{count:a,start:o,ilen:r}=Vn(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,p,g,m=0,b=0;const y=t=>(o+(h?r-t:t))%a,_=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=n[y(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[y(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>p&&(p=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=s,b=0,f=p=i),g=i}_()}function jn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Hn:Bn}const Un="function"==typeof Path2D;class $n extends Es{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;ni(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Yi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,a=Ti(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],r=function(t){return t.stepped?ci:t.tension||"monotone"===t.cubicInterpolationMode?di:hi}(i);let l,h;for(l=0,h=a.length;l<h;++l){const{start:h,end:c}=a[l],d=n[h],u=n[c];if(d===u){o.push(d);continue}const f=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],o.push(f)}return 1===o.length?o[0]:o}pathSegment(t,e,i){return jn(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=jn(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=n(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){Un&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Wn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:a}=e,o=jn(e);for(const r of n)Wn(t,a,r.style),t.beginPath(),o(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Gn(t,e,i,s){const n=t.options,{[i]:a}=t.getProps([i],s);return Math.abs(e-a)<n.radius+n.hitRadius}function qn(t,e){const{x:i,y:s,base:n,width:a,height:o}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=o/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=a/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function Xn(t,e,i,s){return t?0:J(e,i,s)}function Zn(t){const e=qn(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,a=bi(s);return{t:Xn(n.top,a.top,0,i),r:Xn(n.right,a.right,0,e),b:Xn(n.bottom,a.bottom,0,i),l:Xn(n.left,a.left,0,e)}}(t,i/2,s/2),o=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=yi(n),r=Math.min(e,i),l=t.borderSkipped,h=s||a(n);return{topLeft:Xn(!h||l.top||l.left,o.topLeft,0,r),topRight:Xn(!h||l.top||l.right,o.topRight,0,r),bottomLeft:Xn(!h||l.bottom||l.left,o.bottomLeft,0,r),bottomRight:Xn(!h||l.bottom||l.right,o.bottomRight,0,r)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function Kn(t,e,i,s){const n=null===e,a=null===i,o=t&&!(n&&a)&&qn(t,s);return o&&(n||tt(e,o.left,o.right))&&(a||tt(i,o.top,o.bottom))}function Jn(t,e){t.rect(e.x,e.y,e.w,e.h)}function Qn(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,a=(t.x+t.w!==i.x+i.w?e:0)-s,o=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+a,h:t.h+o,radius:t.radius}}var ta=Object.freeze({__proto__:null,ArcElement:class extends Es{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:a}=G(s,{x:t,y:e}),{startAngle:o,endAngle:r,innerRadius:h,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,f=l(d,r-o)>=O||K(n,o,r),p=tt(a,h+u,c+u);return f&&p}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:a,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(a+o+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>O?Math.floor(i/O):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*s,Math.sin(o)*s);const r=s*(1-Math.sin(Math.min(P,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,n){const{fullCircles:a,startAngle:o,circumference:r}=e;let l=e.endAngle;if(a){Fn(t,e,i,s,l,n);for(let e=0;e<a;++e)t.fill();isNaN(r)||(l=o+(r%O||O))}Fn(t,e,i,s,l,n),t.fill()}(t,this,r,n,a),function(t,e,i,s,n){const{fullCircles:a,startAngle:o,circumference:r,options:l}=e,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u}=l,f="inner"===l.borderAlign;if(!h)return;t.setLineDash(d||[]),t.lineDashOffset=u,f?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let p=e.endAngle;if(a){Fn(t,e,i,s,p,n);for(let e=0;e<a;++e)t.stroke();isNaN(r)||(p=o+(r%O||O))}f&&function(t,e,i){const{startAngle:s,pixelMargin:n,x:a,y:o,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(a,o,r,s-h,i+h),l>n?(h=n/l,t.arc(a,o,l,i+h,s-h,!0)):t.arc(a,o,n,i+L,s-L),t.closePath(),t.clip()}(t,e,p),a||(Fn(t,e,i,s,p,n),t.stroke())}(t,this,r,n,a),t.restore()}},BarElement:class extends Es{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:a}=Zn(this),o=(r=a.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?Ne:Jn;var r;t.save(),a.w===n.w&&a.h===n.h||(t.beginPath(),o(t,Qn(a,e,n)),t.clip(),o(t,Qn(n,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,Qn(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Kn(this,t,e,i)}inXRange(t,e){return Kn(this,t,null,e)}inYRange(t,e){return Kn(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:$n,PointElement:class extends Es{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:a}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Gn(this,t,"x",e)}inYRange(t,e){return Gn(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Oe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Ce(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});function ea(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function ia(t,e,{horizontal:i,minRotation:s}){const n=j(s),a=(i?Math.sin(n):Math.cos(n))||.001,o=.75*e*(""+t).length;return Math.min(e/a,o)}class sa extends Us{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return s(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const a=t=>s=e?s:t,o=t=>n=i?n:t;if(t){const t=N(s),e=N(n);t<0&&e<0?o(0):t>0&&e>0&&a(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);o(n+e),t||a(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:a,min:o,max:r,precision:l,count:h,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=a||1,p=c-1,{min:g,max:m}=e,b=!s(o),y=!s(r),_=!s(h),x=(m-g)/(d+1);let v,w,k,M,D=W((m-g)/p/f)*f;if(D<1e-14&&!b&&!y)return[{value:g},{value:m}];M=Math.ceil(m/D)-Math.floor(g/D),M>p&&(D=W(M*D/p/f)*f),s(l)||(v=Math.pow(10,l),D=Math.ceil(D*v)/v),"ticks"===n?(w=Math.floor(g/D)*D,k=Math.ceil(m/D)*D):(w=g,k=m),b&&y&&a&&H((r-o)/a,D/1e3)?(M=Math.round(Math.min((r-o)/D,c)),D=(r-o)/M,w=o,k=r):_?(w=b?o:w,k=y?r:k,M=h-1,D=(k-w)/M):(M=(k-w)/D,M=F(M,Math.round(M),D/1e3)?Math.round(M):Math.ceil(M));const S=Math.max($(D),$(w));v=Math.pow(10,s(l)?S:l),w=Math.round(w*v)/v,k=Math.round(k*v)/v;let C=0;for(b&&(u&&w!==o?(i.push({value:o}),w<o&&C++,F(Math.round((w+C*D)*v)/v,o,ia(o,x,t))&&C++):w<o&&C++);C<M;++C){const t=Math.round((w+C*D)*v)/v;if(y&&t>r)break;i.push({value:t})}return y&&u&&k!==r?i.length&&F(i[i.length-1].value,r,ia(r,x,t))?i[i.length-1].value=r:i.push({value:r}):y&&k!==r||i.push({value:k}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&B(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return te(t,this.chart.options.locale,this.options.ticks.format)}}class na extends sa{static id="linear";static defaults={ticks:{callback:ie.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=o(t)?t:0,this.max=o(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=j(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const aa=t=>Math.floor(I(t)),oa=(t,e)=>Math.pow(10,aa(t)+e);function ra(t){return 1==t/Math.pow(10,aa(t))}function la(t,e,i){const s=Math.pow(10,i),n=Math.floor(t/s);return Math.ceil(e/s)-n}class ha extends Us{static id="logarithmic";static defaults={ticks:{callback:ie.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=sa.prototype.parse.apply(this,[t,e]);if(0!==i)return o(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=o(t)?Math.max(0,t):null,this.max=o(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!o(this._userMin)&&(this.min=t===oa(this.min,0)?oa(this.min,-1):oa(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,a=t=>s=e?s:t;i===s&&(i<=0?(n(1),a(10)):(n(oa(i,-1)),a(oa(s,1)))),i<=0&&n(oa(s,-1)),s<=0&&a(oa(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=function(t,{min:e,max:i}){e=r(t.min,e);const s=[],n=aa(e);let a=function(t,e){let i=aa(e-t);for(;la(t,e,i)>10;)i++;for(;la(t,e,i)<10;)i--;return Math.min(i,aa(t))}(e,i),o=a<0?Math.pow(10,Math.abs(a)):1;const l=Math.pow(10,a),h=n>a?Math.pow(10,n):0,c=Math.round((e-h)*o)/o,d=Math.floor((e-h)/l/10)*l*10;let u=Math.floor((c-d)/Math.pow(10,a)),f=r(t.min,Math.round((h+d+u*Math.pow(10,a))*o)/o);for(;f<i;)s.push({value:f,major:ra(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(a++,u=2,o=a>=0?1:o),f=Math.round((h+d+u*Math.pow(10,a))*o)/o;const p=r(t.max,f);return s.push({value:p,major:ra(p),significand:u}),s}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&B(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":te(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=I(t),this._valueRange=I(this.max)-I(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(I(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ca(t){const e=t.ticks;if(e.display&&t.display){const t=_i(e.backdropPadding);return l(e.font&&e.font.size,re.font.size)+t.height}return 0}function da(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function ua(t,e,i,s,n){const a=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let r=0,l=0;s.start<e.l?(r=(e.l-s.start)/a,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/a,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(l=(e.t-n.start)/o,t.t=Math.min(t.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function fa(t,e,i){const s=t.drawingArea,{extra:n,additionalAngle:a,padding:o,size:r}=i,l=t.getPointPosition(e,s+n+o,a),h=Math.round(U(Z(l.angle+L))),c=function(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}(l.y,r.h,h),d=function(t){return 0===t||180===t?"center":t<180?"left":"right"}(h),u=function(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}(l.x,r.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:u,top:c,right:u+r.w,bottom:c+r.h}}function pa(t,e){if(!e)return!0;const{left:i,top:s,right:n,bottom:a}=t;return!(Oe({x:i,y:s},e)||Oe({x:i,y:a},e)||Oe({x:n,y:s},e)||Oe({x:n,y:a},e))}function ga(t,e,i){const{left:n,top:a,right:o,bottom:r}=i,{backdropColor:l}=e;if(!s(l)){const i=yi(e.borderRadius),s=_i(e.backdropPadding);t.fillStyle=l;const h=n-s.left,c=a-s.top,d=o-n+s.width,u=r-a+s.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),Ne(t,{x:h,y:c,w:d,h:u,radius:i}),t.fill()):t.fillRect(h,c,d,u)}}function ma(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,O);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let a=1;a<s;a++)i=t.getPointPosition(a,e),n.lineTo(i.x,i.y)}}class ba extends sa{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ie.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=_i(ca(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=o(t)&&!isNaN(t)?t:0,this.max=o(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ca(this.options))}generateTickLabels(t){sa.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=d(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],a=[],o=t._pointLabels.length,r=t.options.pointLabels,l=r.centerPointLabels?P/o:0;for(let u=0;u<o;u++){const o=r.setContext(t.getPointLabelContext(u));a[u]=o.padding;const f=t.getPointPosition(u,t.drawingArea+a[u],l),p=xi(o.font),g=(h=t.ctx,c=p,d=n(d=t._pointLabels[u])?d:[d],{w:Me(h,c.string,d),h:d.length*c.lineHeight});s[u]=g;const m=Z(t.getIndexAngle(u)+l),b=Math.round(U(m));ua(i,e,m,da(b,f.x,g.w,0,180),da(b,f.y,g.h,90,270))}var h,c,d;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const s=[],n=t._pointLabels.length,a=t.options,{centerPointLabels:o,display:r}=a.pointLabels,l={extra:ca(a)/2,additionalAngle:o?P/n:0};let h;for(let a=0;a<n;a++){l.padding=i[a],l.size=e[a];const n=fa(t,a,l);s.push(n),"auto"===r&&(n.visible=pa(n,h),n.visible&&(h=n))}return s}(t,s,a)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return Z(t*(O/(this._pointLabels.length||1))+j(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(s(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(s(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return ki(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-L+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),ma(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:n}=e,a=this._pointLabels.length;let o,r,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=t._pointLabelItems[n];if(!e.visible)continue;const a=s.setContext(t.getPointLabelContext(n));ga(i,a,e);const o=xi(a.font),{x:r,y:l,textAlign:h}=e;Ie(i,t._pointLabels[n],r,l+o.lineHeight/2,o,{color:a.color,textAlign:h,textBaseline:"middle"})}}(this,a),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){r=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),o=s.setContext(i),l=n.setContext(i);!function(t,e,i,s,n){const a=t.ctx,o=e.circular,{color:r,lineWidth:l}=e;!o&&!s||!r||!l||i<0||(a.save(),a.strokeStyle=r,a.lineWidth=l,a.setLineDash(n.dash),a.lineDashOffset=n.dashOffset,a.beginPath(),ma(t,i,o,s),a.closePath(),a.stroke(),a.restore())}(this,o,r,a,l)}})),i.display){for(t.save(),o=a-1;o>=0;o--){const s=i.setContext(this.getPointLabelContext(o)),{color:n,lineWidth:a}=s;a&&n&&(t.lineWidth=a,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,o)=>{if(0===o&&this.min>=0&&!e.reverse)return;const r=i.setContext(this.getContext(o)),l=xi(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[o].value),r.showLabelBackdrop){t.font=l.string,a=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=_i(r.backdropPadding);t.fillRect(-a/2-e.left,-n-l.size/2-e.top,a+e.width,l.size+e.height)}Ie(t,s.label,0,-n,l,{color:r.color,strokeColor:r.textStrokeColor,strokeWidth:r.textStrokeWidth})})),t.restore()}drawTitle(){}}const ya={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}},_a=Object.keys(ya);function xa(t,e){return t-e}function va(t,e){if(s(e))return null;const i=t._adapter,{parser:n,round:a,isoWeekday:r}=t._parseOpts;let l=e;return"function"==typeof n&&(l=n(l)),o(l)||(l="string"==typeof n?i.parse(l,n):i.parse(l)),null===l?null:(a&&(l="week"!==a||!V(r)&&!0!==r?i.startOf(l,a):i.startOf(l,"isoWeek",r)),+l)}function wa(t,e,i,s){const n=_a.length;for(let a=_a.indexOf(t);a<n-1;++a){const t=ya[_a[a]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return _a[a]}return _a[n-1]}function ka(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=et(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function Ma(t,e,i){const s=[],n={},a=e.length;let o,r;for(o=0;o<a;++o)r=e[o],n[r]=o,s.push({value:r,major:!1});return 0!==a&&i?function(t,e,i,s){const n=t._adapter,a=+n.startOf(e[0].value,s),o=e[e.length-1].value;let r,l;for(r=a;r<=o;r=+n.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}(t,s,n,i):s}class Da extends Us{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Dn._date(t.adapters.date);s.init(e),y(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:va(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:a,maxDefined:r}=this.getUserBounds();function l(t){a||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}a&&r||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),s=o(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=o(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,a=nt(s,n,this.max);return this._unit=e.unit||(i.autoSkip?wa(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let a=_a.length-1;a>=_a.indexOf(i);a--){const i=_a[a];if(ya[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return _a[i?_a.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=_a.indexOf(t)+1,i=_a.length;e<i;++e)if(ya[_a[e]].common)return _a[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&a.reverse(),Ma(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;s=J(s,0,a),n=J(n,0,a),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,a=n.unit||wa(n.minUnit,e,i,this._getLabelCapacity(e)),o=l(s.ticks.stepSize,1),r="week"===a&&n.isoWeekday,h=V(r)||!0===r,c={};let d,u,f=e;if(h&&(f=+t.startOf(f,"isoWeek",r)),f=+t.startOf(f,h?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const p="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;d<i;d=+t.add(d,o,a),u++)ka(c,d,p);return d!==i&&"ticks"!==s.bounds&&1!==u||ka(c,d,p),Object.keys(c).sort(xa).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(t,e,i,s){const n=this.options,a=n.ticks.callback;if(a)return d(a,[t,e,i],this);const o=n.time.displayFormats,r=this._unit,l=this._majorUnit,h=r&&o[r],c=l&&o[l],u=i[e],f=l&&c&&u&&u.major;return this._adapter.format(t,s||(f?c:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=j(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*n+o*a,h:i*a+o*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,Ma(this,[t],this._majorUnit),s),a=this._getLabelSize(n),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(va(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return lt(t.sort(xa))}}function Sa(t,e,i){let s,n,a,o,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=it(t,"pos",e)),({pos:s,time:a}=t[r]),({pos:n,time:o}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=it(t,"time",e)),({time:s,pos:a}=t[r]),({time:n,pos:o}=t[l]));const h=n-s;return h?a+(o-a)*(e-s)/h:a}var Ca=Object.freeze({__proto__:null,CategoryScale:class extends Us{static id="category";static defaults={ticks:{callback:ea}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(s(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:J(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,l(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return ea.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:na,LogarithmicScale:ha,RadialLinearScale:ba,TimeScale:Da,TimeSeriesScale:class extends Da{static id="timeseries";static defaults=Da.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Sa(e,this.min),this._tableRange=Sa(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let a,o,r,l,h;for(a=0,o=t.length;a<o;++a)l=t[a],l>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)h=s[a+1],r=s[a-1],l=s[a],Math.round((h+r)/2)!==l&&n.push({time:l,pos:a/(o-1)});return n}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Sa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Sa(this._table,i*this._tableRange+this._minPos,!0)}}});const Pa=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Oa=Pa.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Ta(t){return Pa[t%Pa.length]}function Ya(t){return Oa[t%Oa.length]}function Aa(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var La={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:a}=n;if(!i.forceOverride&&(Aa(s)||(o=n)&&(o.borderColor||o.backgroundColor)||a&&Aa(a)))return;var o;const r=function(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof Rn?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ta(e++))),e}(i,e):n instanceof En?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ya(e++))),e}(i,e):n&&(e=function(t,e){return t.borderColor=Ta(e),t.backgroundColor=Ya(e),++e}(i,e))}}(t);s.forEach(r)}};function Ra(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Ea(t){t.data.datasets.forEach((t=>{Ra(t)}))}var Ia={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Ea(t);const n=t.width;t.data.datasets.forEach(((e,a)=>{const{_data:o,indexAxis:r}=e,l=t.getDatasetMeta(a),h=o||e.data;if("y"===vi([r,t.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const c=t.scales[l.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let d,{start:u,count:f}=function(t,e){const i=e.length;let s,n=0;const{iScale:a}=t,{min:o,max:r,minDefined:l,maxDefined:h}=a.getUserBounds();return l&&(n=J(it(e,a.axis,o).lo,0,i-1)),s=h?J(it(e,a.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(l,h);if(f<=(i.threshold||4*n))Ra(e);else{switch(s(o)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":d=function(t,e,i,s,n){const a=n.samples||s;if(a>=i)return t.slice(e,e+i);const o=[],r=(i-2)/(a-2);let l=0;const h=e+i-1;let c,d,u,f,p,g=e;for(o[l++]=t[g],c=0;c<a-2;c++){let s,n=0,a=0;const h=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,b=m-h;for(s=h;s<m;s++)n+=t[s].x,a+=t[s].y;n/=b,a/=b;const y=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:x,y:v}=t[g];for(u=f=-1,s=y;s<_;s++)f=.5*Math.abs((x-n)*(t[s].y-v)-(x-t[s].x)*(a-v)),f>u&&(u=f,d=t[s],p=s);o[l++]=d,g=p}return o[l++]=t[h],o}(h,u,f,n,i);break;case"min-max":d=function(t,e,i,n){let a,o,r,l,h,c,d,u,f,p,g=0,m=0;const b=[],y=e+i-1,_=t[e].x,x=t[y].x-_;for(a=e;a<e+i;++a){o=t[a],r=(o.x-_)/x*n,l=o.y;const e=0|r;if(e===h)l<f?(f=l,c=a):l>p&&(p=l,d=a),g=(m*g+o.x)/++m;else{const i=a-1;if(!s(c)&&!s(d)){const e=Math.min(c,d),s=Math.max(c,d);e!==u&&e!==i&&b.push({...t[e],x:g}),s!==u&&s!==i&&b.push({...t[s],x:g})}a>0&&i!==u&&b.push(t[i]),b.push(o),h=e,m=0,f=p=l,c=d=u=a}}return b}(h,u,f,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=d}}))},destroy(t){Ea(t)}};function Na(t,e,i,s){if(s)return;let n=e[t],a=i[t];return"angle"===t&&(n=Z(n),a=Z(a)),{property:t,start:n,end:a}}function Fa(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Wa(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function za(t,e){let i=[],s=!1;return n(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,a=[];return e.segments.forEach((({start:t,end:e})=>{e=Fa(t,e,n);const o=n[t],r=n[e];null!==s?(a.push({x:o.x,y:s}),a.push({x:r.x,y:s})):null!==i&&(a.push({x:i,y:o.y}),a.push({x:i,y:r.y}))})),a}(t,e),i.length?new $n({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function Va(t){return t&&!1!==t.fill}function Ha(t,e,i){let s=t[e].fill;const n=[e];let a;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!o(s))return s;if(a=t[s],!a)return!1;if(a.visible)return s;n.push(s),s=a.fill}return!1}function Ba(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=l(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if(a(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return o(n)&&Math.floor(n)===n?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function ja(t,e,i){const s=[];for(let n=0;n<i.length;n++){const a=i[n],{first:o,last:r,point:l}=Ua(a,e,"x");if(!(!l||o&&r))if(o)s.unshift(l);else if(t.push(l),!r)break}t.push(...s)}function Ua(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],a=t.segments,o=t.points;let r=!1,l=!1;for(let t=0;t<a.length;t++){const e=a[t],s=o[e.start][i],h=o[e.end][i];if(tt(n,s,h)){r=n===s,l=n===h;break}}return{first:r,last:l,point:s}}class $a{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:a}=this;return e=e||{start:0,end:O},t.arc(s,n,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function Ga(t){const{chart:e,fill:i,line:s}=t;if(o(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],a=s.segments,o=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(za({x:null,y:e.bottom},s));for(let t=0;t<a.length;t++){const e=a[t];for(let t=e.start;t<=e.end;t++)ja(n,o[t],r)}return new $n({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,r=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:a(t)?t.value:e.getBaseValue(),s}(i,e,o),l=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,o);return new $a({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<n;++t)l.push(e.getPointPositionForValue(t,r));return l}(t):function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:a(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(o(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof $a?n:za(n,s)}function qa(t,e,i){const s=Ga(e),{line:n,scale:a,axis:o}=e,r=n.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&n.points.length&&(Te(t,i),function(t,e){const{line:i,target:s,above:n,below:a,area:o,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&a!==n&&(Xa(t,s,o.top),Za(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore(),t.save(),Xa(t,s,o.bottom)),Za(t,{line:i,target:s,color:a,scale:r,property:l}),t.restore()}(t,{line:n,target:s,above:c,below:d,area:i,scale:a,axis:o}),Ye(t))}function Xa(t,e,i){const{segments:s,points:n}=e;let a=!0,o=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[Fa(s,l,n)];a?(t.moveTo(h.x,h.y),a=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),o=!!e.pathSegment(t,r,{move:o}),o?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Za(t,e){const{line:i,target:s,property:n,color:a,scale:o}=e,r=function(t,e,i){const s=t.segments,n=t.points,a=e.points,o=[];for(const t of s){let{start:s,end:r}=t;r=Fa(s,r,n);const l=Na(i,n[s],n[r],t.loop);if(!e.segments){o.push({source:t,target:l,start:n[s],end:n[r]});continue}const h=Ti(e,l);for(const e of h){const s=Na(i,a[e.start],a[e.end],e.loop),r=Oi(t,n,s);for(const t of r)o.push({source:t,target:e,start:{[i]:Wa(l,s,"start",Math.max)},end:{[i]:Wa(l,s,"end",Math.min)}})}}return o}(i,s,n);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=a}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,Ka(t,o,d&&Na(n,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():Ja(t,s,c,n);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||Ja(t,s,h,n)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function Ka(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:a,start:o,end:r}=i||{};"x"===a&&(t.beginPath(),t.rect(o,s,r-o,n-s),t.clip())}function Ja(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var Qa={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let a,o,r,l;for(o=0;o<s;++o)a=t.getDatasetMeta(o),r=a.dataset,l=null,r&&r.options&&r instanceof $n&&(l={visible:t.isDatasetVisible(o),index:o,fill:Ba(r,o,s),chart:t,axis:a.controller.options.indexAxis,scale:a.vScale,line:r}),a.$filler=l,n.push(l);for(o=0;o<s;++o)l=n[o],l&&!1!==l.fill&&(l.fill=Ha(n,o,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),a=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(a,i.axis),s&&i.fill&&qa(t.ctx,i,a))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;Va(i)&&qa(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;Va(s)&&"beforeDatasetDraw"===i.drawTime&&qa(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const to=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class eo extends Es{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=d(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=xi(i.font),n=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:r}=to(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(a,n,o,r)+10):(h=this.maxHeight,l=this._fitCols(a,s,o,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:a,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+o;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const p=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+p+2*o>a)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:p,height:s},l[l.length-1]+=p+o})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:a,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=a-t;let c=o,d=0,u=0,f=0,p=0;return this.legendItems.forEach(((t,a)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,s,n){const a=function(t,e,i,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce(((t,e)=>t.length>e.length?t:e))),e+i.size/2+s.measureText(n).width}(s,t,e,i),o=function(t,e,i){let s=t;return"string"!=typeof e.text&&(s=io(e,i)),s}(n,s,e.lineHeight);return{itemWidth:a,itemHeight:o}}(i,e,n,t,s);a>0&&u+m+2*o>h&&(c+=d+o,l.push({width:d,height:u}),f+=d+o,p++,d=u=0),r[a]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+o})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,a=Mi(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=ft(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,o=ft(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=a.leftForLtr(a.x(o),r.width),o+=r.width+s}else{let n=0,o=ft(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,o=ft(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=o,r.left+=this.left+s,r.left=a.leftForLtr(a.x(r.left),r.width),o+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Te(t,this),this._draw(),Ye(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:a}=t,o=re.color,r=Mi(t.rtl,this.left,this.width),h=xi(a.font),{padding:c}=a,d=h.size,u=d/2;let f;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=to(a,d),b=this.isHorizontal(),y=this._computeTitleHeight();f=b?{x:ft(n,this.left+c,this.right-i[0]),y:this.top+c+y,line:0}:{x:this.left+c,y:ft(n,this.top+y+c,this.bottom-e[0].height),line:0},Di(this.ctx,t.textDirection);const _=m+c;this.legendItems.forEach(((x,v)=>{s.strokeStyle=x.fontColor,s.fillStyle=x.fontColor;const w=s.measureText(x.text).width,k=r.textAlign(x.textAlign||(x.textAlign=a.textAlign)),M=p+u+w;let D=f.x,S=f.y;if(r.setWidth(this.width),b?v>0&&D+M+c>this.right&&(S=f.y+=_,f.line++,D=f.x=ft(n,this.left+c,this.right-i[f.line])):v>0&&S+_>this.bottom&&(D=f.x=D+e[f.line].width+c,f.line++,S=f.y=ft(n,this.top+y+c,this.bottom-e[f.line].height)),function(t,e,i){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const n=l(i.lineWidth,1);if(s.fillStyle=l(i.fillStyle,o),s.lineCap=l(i.lineCap,"butt"),s.lineDashOffset=l(i.lineDashOffset,0),s.lineJoin=l(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=l(i.strokeStyle,o),s.setLineDash(l(i.lineDash,[])),a.usePointStyle){const o={radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=r.xPlus(t,p/2);Pe(s,o,l,e+u,a.pointStyleWidth&&p)}else{const a=e+Math.max((d-g)/2,0),o=r.leftForLtr(t,p),l=yi(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?Ne(s,{x:o,y:a,w:p,h:g,radius:l}):s.rect(o,a,p,g),s.fill(),0!==n&&s.stroke()}s.restore()}(r.x(D),S,x),D=pt(k,D+p+u,b?D+M:this.right,t.rtl),function(t,e,i){Ie(s,i.text,t,e+m/2,h,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)})}(r.x(D),S,x),b)f.x+=M+c;else if("string"!=typeof x.text){const t=h.lineHeight;f.y+=io(x,t)+c}else f.y+=_})),Si(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=xi(e.font),s=_i(e.padding);if(!e.display)return;const n=Mi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=ft(t.align,c,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+ft(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=ft(o,c,c+d);a.textAlign=n.textAlign(ut(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Ie(a,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=xi(t.font),i=_i(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(tt(t,this.left,this.right)&&tt(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],tt(t,s.left,s.left+s.width)&&tt(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const a=this._hoveredItem,o=(n=i,null!==(s=a)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);a&&!o&&d(e.onLeave,[t,a,this],this),this._hoveredItem=i,i&&!o&&d(e.onHover,[t,i,this],this)}else i&&d(e.onClick,[t,i,this],this);var s,n}}function io(t,e){return e*(t.text?t.text.length:0)}var so={id:"legend",_element:eo,start(t,e,i){const s=t.legend=new eo({ctx:t.ctx,options:i,chart:t});Qi.configure(t,s,i),Qi.addBox(t,s)},stop(t){Qi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;Qi.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:a,useBorderRadius:o,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=_i(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:o&&(r||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class no extends Es{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=n(i.text)?i.text.length:1;this._padding=_i(i.padding);const a=s*xi(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:a}=this,o=a.align;let r,l,h,c=0;return this.isHorizontal()?(l=ft(o,i,n),h=e+t,r=n-i):("left"===a.position?(l=i+t,h=ft(o,s,e),c=-.5*P):(l=n-t,h=ft(o,e,s),c=.5*P),r=s-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=xi(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:a,maxWidth:o,rotation:r}=this._drawArgs(s);Ie(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:r,textAlign:ut(e.align),textBaseline:"middle",translation:[n,a]})}}var ao={id:"title",_element:no,start(t,e,i){!function(t,e){const i=new no({ctx:t.ctx,options:e,chart:t});Qi.configure(t,i,e),Qi.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Qi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;Qi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const oo=new WeakMap;var ro={id:"subtitle",start(t,e,i){const s=new no({ctx:t.ctx,options:i,chart:t});Qi.configure(t,s,i),Qi.addBox(t,s),oo.set(t,s)},stop(t){Qi.removeBox(t,oo.get(t)),oo.delete(t)},beforeUpdate(t,e,i){const s=oo.get(t);Qi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const lo={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,a=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++a}}return{x:[...s].reduce(((t,e)=>t+e))/s.size,y:n/a}},nearest(t,e){if(!t.length)return!1;let i,s,n,a=e.x,o=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=q(e,s.getCenterPoint());t<r&&(r=t,n=s)}}if(n){const t=n.tooltipPosition();a=t.x,o=t.y}return{x:a,y:o}}};function ho(t,e){return e&&(n(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function co(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function uo(t,e){const{element:i,datasetIndex:s,index:n}=e,a=t.getDatasetMeta(s).controller,{label:o,value:r}=a.getLabelAndValue(n);return{chart:t,label:o,parsed:a.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:a.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function fo(t,e){const i=t.chart.ctx,{body:s,footer:n,title:a}=t,{boxWidth:o,boxHeight:r}=e,l=xi(e.bodyFont),h=xi(e.titleFont),c=xi(e.footerFont),d=a.length,f=n.length,p=s.length,g=_i(e.padding);let m=g.height,b=0,y=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);y+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),y&&(m+=p*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(y-p)*l.lineHeight+(y-1)*e.bodySpacing),f&&(m+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let _=0;const x=function(t){b=Math.max(b,i.measureText(t).width+_)};return i.save(),i.font=h.string,u(t.title,x),i.font=l.string,u(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,u(s,(t=>{u(t.before,x),u(t.lines,x),u(t.after,x)})),_=0,i.font=c.string,u(t.footer,x),i.restore(),b+=g.width,{width:b,height:m}}function po(t,e,i,s){const{x:n,width:a}=i,{width:o,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=a/2?h="left":n>=o-a/2&&(h="right"),function(t,e,i,s){const{x:n,width:a}=s,o=i.caretSize+i.caretPadding;return"left"===t&&n+a+o>e.width||"right"===t&&n-a-o<0||void 0}(h,t,e,i)&&(h="center"),h}function go(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||po(t,e,i,s),yAlign:s}}function mo(t,e,i,s){const{caretSize:n,caretPadding:a,cornerRadius:o}=t,{xAlign:r,yAlign:l}=i,h=n+a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=yi(o);let p=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const g=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?p+=h:"right"===r&&(p-=h):"left"===r?p-=Math.max(c,u)+n:"right"===r&&(p+=Math.max(d,f)+n),{x:J(p,0,s.width-e.width),y:J(g,0,s.height-e.height)}}function bo(t,e,i){const s=_i(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function yo(t){return ho([],co(t))}function _o(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const xo={beforeTitle:e,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:e,beforeBody:e,beforeLabel:e,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return s(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:e,afterBody:e,beforeFooter:e,footer:e,afterFooter:e};function vo(t,e,i,s){const n=t[e].call(i,s);return void 0===n?xo[e].call(i,s):n}class wo extends Es{static positioners=lo;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new ws(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=ki(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){const{callbacks:i}=e,s=vo(i,"beforeTitle",this,t),n=vo(i,"title",this,t),a=vo(i,"afterTitle",this,t);let o=[];return o=ho(o,co(s)),o=ho(o,co(n)),o=ho(o,co(a)),o}getBeforeBody(t,e){return yo(vo(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return u(t,(t=>{const e={before:[],lines:[],after:[]},n=_o(i,t);ho(e.before,co(vo(n,"beforeLabel",this,t))),ho(e.lines,vo(n,"label",this,t)),ho(e.after,co(vo(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return yo(vo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=vo(i,"beforeFooter",this,t),n=vo(i,"footer",this,t),a=vo(i,"afterFooter",this,t);let o=[];return o=ho(o,co(s)),o=ho(o,co(n)),o=ho(o,co(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],a=[];let o,r,l=[];for(o=0,r=e.length;o<r;++o)l.push(uo(this.chart,e[o]));return t.filter&&(l=l.filter(((e,s,n)=>t.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),u(l,(e=>{const i=_o(t.callbacks,e);s.push(vo(i,"labelColor",this,e)),n.push(vo(i,"labelPointStyle",this,e)),a.push(vo(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,a=[];if(s.length){const t=lo[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const e=this._size=fo(this,i),o=Object.assign({},t,e),r=go(this.chart,i,o),l=mo(i,o,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=a,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=yi(o),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,y,_,x;return"center"===n?(_=u+p/2,"left"===s?(g=d,m=g-a,y=_+a,x=_-a):(g=d+f,m=g+a,y=_-a,x=_+a),b=g):(m="left"===s?d+Math.max(r,h)+a:"right"===s?d+f-Math.max(l,c)-a:this.caretX,"top"===n?(y=u,_=y-a,g=m-a,b=m+a):(y=u+p,_=y+a,g=m+a,b=m-a),x=y),{x1:g,x2:m,x3:b,y1:y,y2:_,y3:x}}drawTitle(t,e,i){const s=this.title,n=s.length;let a,o,r;if(n){const l=Mi(i.rtl,this.x,this.width);for(t.x=bo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=xi(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,r=0;r<n;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,r+1===n&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,n){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:h}=n,c=xi(n.bodyFont),d=bo(this,"left",n),u=s.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,p=e.y+f;if(n.usePointStyle){const e={radius:Math.min(h,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(u,h)+h/2,a=p+l/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,Ce(t,e,i,a),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ce(t,e,i,a)}else{t.lineWidth=a(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=s.leftForLtr(u,h),i=s.leftForLtr(s.xPlus(u,1),h-2),r=yi(o.borderRadius);Object.values(r).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,Ne(t,{x:e,y:p,w:h,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ne(t,{x:i,y:p+1,w:h-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,p,h,l),t.strokeRect(e,p,h,l),t.fillStyle=o.backgroundColor,t.fillRect(i,p+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:a,displayColors:o,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=xi(i.bodyFont);let d=c.lineHeight,f=0;const p=Mi(i.rtl,this.x,this.width),g=function(i){e.fillText(i,p.x(t.x+f),t.y+d/2),t.y+=d+n},m=p.textAlign(a);let b,y,_,x,v,w,k;for(e.textAlign=a,e.textBaseline="middle",e.font=c.string,t.x=bo(this,m,i),e.fillStyle=i.bodyColor,u(this.beforeBody,g),f=o&&"right"!==m?"center"===a?l/2+h:l+2+h:0,x=0,w=s.length;x<w;++x){for(b=s[x],y=this.labelTextColors[x],e.fillStyle=y,u(b.before,g),_=b.lines,o&&_.length&&(this._drawColorBox(e,t,x,p,i),d=Math.max(c.lineHeight,r)),v=0,k=_.length;v<k;++v)g(_[v]),d=c.lineHeight;u(b.after,g)}f=0,d=c.lineHeight,u(this.afterBody,g),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let a,o;if(n){const r=Mi(i.rtl,this.x,this.width);for(t.x=bo(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",a=xi(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<n;++o)e.fillText(s[o],r.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:a}=this,{x:o,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=yi(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+c,r),"top"===a&&this.drawCaret(t,e,i,s),e.lineTo(o+l-d,r),e.quadraticCurveTo(o+l,r,o+l,r+d),"center"===a&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(o+l,r+h-f),e.quadraticCurveTo(o+l,r+h,o+l-f,r+h),"bottom"===a&&this.drawCaret(t,e,i,s),e.lineTo(o+u,r+h),e.quadraticCurveTo(o,r+h,o,r+h-u),"center"===a&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(o,r+c),e.quadraticCurveTo(o,r,o+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=lo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=fo(this,t),o=Object.assign({},i,this._size),r=go(e,t,o),l=mo(t,o,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=_i(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Di(t,e.textDirection),n.y+=a.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Si(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!f(i,s),a=this._positionChanged(s,e);(n||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],a=this._getActiveElements(t,n,e,i),o=this._positionChanged(a,t),r=e||!f(a,n)||o;return r&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const a=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,a=lo[n.position].call(this,t,e);return!1!==a&&(i!==a.x||s!==a.y)}}var ko={id:"tooltip",_element:wo,positioners:lo,afterInit(t,e,i){i&&(t.tooltip=new wo({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:xo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return vn.register(In,Ca,ta,t),vn.helpers={...Ei},vn._adapters=Dn,vn.Animation=vs,vn.Animations=ws,vn.animator=bt,vn.controllers=Gs.controllers.items,vn.DatasetController=Rs,vn.Element=Es,vn.elements=ta,vn.Interaction=Vi,vn.layouts=Qi,vn.platforms=ys,vn.Scale=Us,vn.Ticks=ie,Object.assign(vn,In,Ca,ta,t,ys),vn.Chart=vn,"undefined"!=typeof window&&(window.Chart=vn),vn}));