andoncloud-prometheus-widget 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/Widget.stories.d.ts +2 -4
- package/dist/version.d.ts +1 -1
- package/package.json +13 -11
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var React=require("react"),andoncloudDashboardToolkit=require("andoncloud-dashboard-toolkit"),andoncloudWidgetBase=require("andoncloud-widget-base"),iconsMaterial=require("@mui/icons-material"),material=require("@mui/material");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=/*#__PURE__*/_interopDefaultLegacy(React);function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _objectWithoutPropertiesLoose$1(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}function _objectWithoutProperties(e,t){if(null==e)return{};var n,r,a=_objectWithoutPropertiesLoose$1(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(e){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=e.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(n.name=r[1],(voidElements[r[1]]||"/"===e.charAt(e.length-2))&&(n.voidElement=!0),n.name.startsWith("!--"))){var a=e.indexOf("--\x3e");return{type:"comment",comment:-1!==a?e.slice(4,a):""}}for(var i=new RegExp(t),o=null;null!==(o=i.exec(e));)if(o[0].trim())if(o[1]){var s=o[1].trim(),l=[s,""];s.indexOf("=")>-1&&(l=s.split("=")),n.attrs[l[0]]=l[1],i.lastIndex--}else o[2]&&(n.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return n}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,o=[],l=[],u=-1,c=!1;if(0!==e.indexOf("<")){var d=e.indexOf("<");o.push({type:"text",content:-1===d?e:e.substring(0,d)})}return e.replace(r,function(r,s){if(c){if(r!=="</"+a.name+">")return;c=!1}var d,h="/"!==r.charAt(1),f=r.startsWith("\x3c!--"),p=s+r.length,g=e.charAt(p);if(f){var m=n(r);return u<0?(o.push(m),o):((d=l[u]).children.push(m),o)}if(h&&(u++,"tag"===(a=n(r)).type&&t.components[a.name]&&(a.type="component",c=!0),a.voidElement||c||!g||"<"===g||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===u&&o.push(a),(d=l[u-1])&&d.children.push(a),l[u]=a),(!h||a.voidElement)&&(u>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(u--,a=-1===u?o:l[u]),!c&&"<"!==g&&g)){d=-1===u?o:l[u].children;var v=e.indexOf("<",p),y=e.slice(p,-1===v?void 0:v);i.test(y)&&(y=" "),(v>-1&&u+d.length>=0||" "!==y)&&d.push({type:"text",content:y})}}),o},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};function warn(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var alreadyWarned={};function warnOnce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&alreadyWarned[t[0]]||("string"==typeof t[0]&&(alreadyWarned[t[0]]=new Date),warn.apply(void 0,t))}function loadNamespaces(e,t,n){e.loadNamespaces(t,function(){e.isInitialized?n():e.on("initialized",function t(){setTimeout(function(){e.off("initialized",t)},0),n()})})}function oldI18nextHasLoadedNamespace(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],a=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!o(r,e)||a&&!o(i,e)))}function hasLoadedNamespace(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return warnOnce("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):oldI18nextHasLoadedNamespace(e,t,n)}var matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},unescapeHtmlEntity=function(e){return htmlEntities[e]},unescape$1=function(e){return e.replace(matchHtmlEntity,unescapeHtmlEntity)};function ownKeys$a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$a(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var defaultOptions={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1},i18nInstance;function setDefaults(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};defaultOptions=_objectSpread$a(_objectSpread$a({},defaultOptions),e)}function getDefaults(){return defaultOptions}function setI18n(e){i18nInstance=e}function getI18n(){return i18nInstance}var _excluded$2=["format"],_excluded2=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$9(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hasChildren(e,t){if(!e)return!1;var n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function getChildren(e){return e?e.props?e.props.children:e.children:[]}function hasValidReactChildren(e){return"[object Array]"===Object.prototype.toString.call(e)&&e.every(function(e){return React.isValidElement(e)})}function getAsArray(e){return Array.isArray(e)?e:[e]}function mergeProps(e,t){var n=_objectSpread$9({},t);return n.props=Object.assign(e.props,t.props),n}function nodesToString(e,t){if(!e)return"";var n="",r=getAsArray(e),a=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return r.forEach(function(e,r){if("string"==typeof e)n+="".concat(e);else if(React.isValidElement(e)){var i=Object.keys(e.props).length,o=a.indexOf(e.type)>-1,s=e.props.children;if(!s&&o&&0===i)n+="<".concat(e.type,"/>");else if(s||o&&0===i)if(e.props.i18nIsDynamicList)n+="<".concat(r,"></").concat(r,">");else if(o&&1===i&&"string"==typeof s)n+="<".concat(e.type,">").concat(s,"</").concat(e.type,">");else{var l=nodesToString(s,t);n+="<".concat(r,">").concat(l,"</").concat(r,">")}else n+="<".concat(r,"></").concat(r,">")}else if(null===e)warn("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===_typeof(e)){var u=e.format,c=_objectWithoutProperties(e,_excluded$2),d=Object.keys(c);if(1===d.length){var h=u?"".concat(d[0],", ").concat(u):d[0];n+="{{".concat(h,"}}")}else warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",e)}else warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",e)}),n}function renderNodes(e,t,n,r,a,i){if(""===t)return[];var o=r.transKeepBasicHtmlNodesFor||[],s=t&&new RegExp(o.join("|")).test(t);if(!e&&!s)return[t];var l={};!function e(t){getAsArray(t).forEach(function(t){"string"!=typeof t&&(hasChildren(t)?e(getChildren(t)):"object"!==_typeof(t)||React.isValidElement(t)||Object.assign(l,t))})}(e);var u=c.parse("<0>".concat(t,"</0>")),d=_objectSpread$9(_objectSpread$9({},l),a);function h(e,t,n){var r=getChildren(e),a=p(r,t.children,n);return hasValidReactChildren(r)&&0===a.length?r:a}function f(e,t,n,r,a){e.dummy&&(e.children=t),n.push(React.cloneElement(e,_objectSpread$9(_objectSpread$9({},e.props),{},{key:r}),a?void 0:t))}function p(t,a,l){var u=getAsArray(t);return getAsArray(a).reduce(function(t,a,c){var g=a.children&&a.children[0]&&a.children[0].content&&n.services.interpolator.interpolate(a.children[0].content,d,n.language);if("tag"===a.type){var m=u[parseInt(a.name,10)];!m&&1===l.length&&l[0][a.name]&&(m=l[0][a.name]),m||(m={});var v=0!==Object.keys(a.attrs).length?mergeProps({props:a.attrs},m):m,y=React.isValidElement(v),b=y&&hasChildren(a,!0)&&!a.voidElement,x=s&&"object"===_typeof(v)&&v.dummy&&!y,_="object"===_typeof(e)&&null!==e&&Object.hasOwnProperty.call(e,a.name);if("string"==typeof v){var w=n.services.interpolator.interpolate(v,d,n.language);t.push(w)}else if(hasChildren(v)||b)f(v,h(v,a,l),t,c);else if(x){var k=p(u,a.children,l);t.push(React.cloneElement(v,_objectSpread$9(_objectSpread$9({},v.props),{},{key:c}),k))}else if(Number.isNaN(parseFloat(a.name)))if(_)f(v,h(v,a,l),t,c,a.voidElement);else if(r.transSupportBasicHtmlNodes&&o.indexOf(a.name)>-1)if(a.voidElement)t.push(React.createElement(a.name,{key:"".concat(a.name,"-").concat(c)}));else{var S=p(u,a.children,l);t.push(React.createElement(a.name,{key:"".concat(a.name,"-").concat(c)},S))}else if(a.voidElement)t.push("<".concat(a.name," />"));else{var O=p(u,a.children,l);t.push("<".concat(a.name,">").concat(O,"</").concat(a.name,">"))}else if("object"!==_typeof(v)||y)t.push(1===a.children.length&&g?React.cloneElement(v,_objectSpread$9(_objectSpread$9({},v.props),{},{key:c}),g):React.cloneElement(v,_objectSpread$9(_objectSpread$9({},v.props),{},{key:c})));else{var M=a.children[0]?g:null;M&&t.push(M)}}else if("text"===a.type){var P=r.transWrapTextNodes,C=i?r.unescape(n.services.interpolator.interpolate(a.content,d,n.language)):n.services.interpolator.interpolate(a.content,d,n.language);t.push(P?React.createElement(P,{key:"".concat(a.name,"-").concat(c)},C):C)}return t},[])}return getChildren(p([{dummy:!0,children:e||[]}],u,getAsArray(e||[]))[0])}function Trans$1(e){var t=e.children,n=e.count,r=e.parent,a=e.i18nKey,i=e.context,o=e.tOptions,s=void 0===o?{}:o,l=e.values,u=e.defaults,c=e.components,d=e.ns,h=e.i18n,f=e.t,p=e.shouldUnescape,g=_objectWithoutProperties(e,_excluded2),m=h||getI18n();if(!m)return warnOnce("You will need to pass in an i18next instance by using i18nextReactModule"),t;var v=f||m.t.bind(m)||function(e){return e};i&&(s.context=i);var y=_objectSpread$9(_objectSpread$9({},getDefaults()),m.options&&m.options.react),b=d||v.ns||m.options&&m.options.defaultNS;b="string"==typeof b?[b]:b||["translation"];var x=u||nodesToString(t,y)||y.transEmptyNodeValue||a,_=y.hashTransKey,w=a||(_?_(x):x),k=l?s.interpolation:{interpolation:_objectSpread$9(_objectSpread$9({},s.interpolation),{},{prefix:"#$?",suffix:"?$#"})},S=_objectSpread$9(_objectSpread$9(_objectSpread$9(_objectSpread$9({},s),{},{count:n},l),k),{},{defaultValue:x,ns:b}),O=renderNodes(c||t,w?v(w,S):x,m,y,S,p),M=void 0!==r?r:y.defaultTransParent;return M?React.createElement(M,g,O):O}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var initReactI18next={type:"3rdParty",init:function(e){setDefaults(e.options.react),setI18n(e)}},I18nContext=React.createContext(),ReportNamespaces=function(){function e(){_classCallCheck(this,e),this.usedNamespaces={}}return _createClass(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach(function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}(),_excluded$1=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$8(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Trans(e){var t=e.children,n=e.count,r=e.parent,a=e.i18nKey,i=e.context,o=e.tOptions,s=void 0===o?{}:o,l=e.values,u=e.defaults,c=e.components,d=e.ns,h=e.i18n,f=e.t,p=e.shouldUnescape,g=_objectWithoutProperties(e,_excluded$1),m=React.useContext(I18nContext)||{},v=m.defaultNS,y=h||m.i18n||getI18n(),b=f||y&&y.t.bind(y);return Trans$1(_objectSpread$8({children:t,count:n,parent:r,i18nKey:a,context:i,tOptions:s,values:l,defaults:u,components:c,ns:d||b&&b.ns||v||y&&y.options&&y.options.defaultNS,i18n:y,t:f,shouldUnescape:p},g))}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function ownKeys$7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$7(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var usePrevious=function(e,t){var n=React.useRef();return React.useEffect(function(){n.current=t?n.current:e},[e,t]),n.current};function useTranslation(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=React.useContext(I18nContext)||{},a=r.i18n,i=r.defaultNS,o=n||a||getI18n();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new ReportNamespaces),!o){warnOnce("You will need to pass in an i18next instance by using initReactI18next");var s=function(e){return Array.isArray(e)?e[e.length-1]:e},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}o.options.react&&void 0!==o.options.react.wait&&warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=_objectSpread$7(_objectSpread$7(_objectSpread$7({},getDefaults()),o.options.react),t),c=u.useSuspense,d=u.keyPrefix,h=e||i||o.options&&o.options.defaultNS;h="string"==typeof h?[h]:h||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(h);var f=(o.isInitialized||o.initializedStoreOnce)&&h.every(function(e){return hasLoadedNamespace(e,o,u)});function p(){return o.getFixedT(null,"fallback"===u.nsMode?h:h[0],d)}var g=React.useState(p),m=_slicedToArray(g,2),v=m[0],y=m[1],b=h.join(),x=usePrevious(b),_=React.useRef(!0);React.useEffect(function(){var e=u.bindI18n,t=u.bindI18nStore;function n(){_.current&&y(p)}return _.current=!0,f||c||loadNamespaces(o,h,function(){_.current&&y(p)}),f&&x&&x!==b&&_.current&&y(p),e&&o&&o.on(e,n),t&&o&&o.store.on(t,n),function(){_.current=!1,e&&o&&e.split(" ").forEach(function(e){return o.off(e,n)}),t&&o&&t.split(" ").forEach(function(e){return o.store.off(e,n)})}},[o,b]);var w=React.useRef(!0);React.useEffect(function(){_.current&&!w.current&&y(p),w.current=!1},[o,d]);var k=[v,o,f];if(k.t=v,k.i18n=o,k.ready=f,f)return k;if(!f&&!c)return k;throw new Promise(function(e){loadNamespaces(o,h,function(){e()})})}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function ownKeys$6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$6(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var consoleLogger={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Logger=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this.init(t,n)}return _createClass(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||consoleLogger,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,_objectSpread$6(_objectSpread$6({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),baseLogger=new Logger,EventEmitter=function(){function e(){_classCallCheck(this,e),this.observers={}}return _createClass(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach(function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)}),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter(function(e){return e!==t}):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var a=[].concat(this.observers[e]);a.forEach(function(e){e.apply(void 0,n)})}if(this.observers["*"]){var i=[].concat(this.observers["*"]);i.forEach(function(t){t.apply(t,[e].concat(n))})}}}]),e}();function defer(){var e,t,n=new Promise(function(n,r){e=n,t=r});return n.resolve=e,n.reject=t,n}function makeString(e){return null==e?"":""+e}function copy(e,t,n){e.forEach(function(e){t[e]&&(n[e]=t[e])})}function getLastOfPath(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function a(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(a())return{};var o=r(i.shift());!e[o]&&n&&(e[o]=new n),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return a()?{}:{obj:e,k:r(i.shift())}}function setPath(e,t,n){var r=getLastOfPath(e,t,Object);r.obj[r.k]=n}function pushPath(e,t,n,r){var a=getLastOfPath(e,t,Object),i=a.obj,o=a.k;i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function getPath(e,t){var n=getLastOfPath(e,t),r=n.obj;if(r)return r[n.k]}function getPathWithDefaults(e,t,n){var r=getPath(e,n);return void 0!==r?r:getPath(t,n)}function deepExtend(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):deepExtend(e[r],t[r],n):e[r]=t[r]);return e}function regexEscape(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return _entityMap[e]}):e}var isIE10="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,chars=[" ",",","?","!",";"];function looksLikeObjectPath(e,t,n){t=t||"",n=n||"";var r=chars.filter(function(e){return t.indexOf(e)<0&&n.indexOf(e)<0});if(0===r.length)return!0;var a=new RegExp("(".concat(r.map(function(e){return"?"===e?"\\?":e}).join("|"),")")),i=!a.test(e);if(!i){var o=e.indexOf(n);o>0&&!a.test(e.substring(0,o))&&(i=!0)}return i}function ownKeys$5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$5(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _createSuper$3(e){var t=_isNativeReflectConstruct$3();return function(){var n,r=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$3(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function deepFind(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),a=e,i=0;i<r.length;++i){if(!a)return;if("string"==typeof a[r[i]]&&i+1<r.length)return;if(void 0===a[r[i]]){for(var o=2,s=r.slice(i,i+o).join(n),l=a[s];void 0===l&&r.length>i+o;)o++,l=a[s=r.slice(i,i+o).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var u=r.slice(i+o).join(n);return u?deepFind(l,u,n):void 0}a=a[r[i]]}return a}}var ResourceStore=function(e){_inherits(n,EventEmitter);var t=_createSuper$3(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck(this,n),r=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(r)),r.data=e||{},r.options=a,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return _createClass(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,t];n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(o=e.split("."));var s=getPath(this.data,o);return s||!i||"string"!=typeof n?s:deepFind(this.data&&this.data[e]&&this.data[e][t],n,a)}},{key:"addResource",value:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(o=e.split("."))[1]),this.addNamespaces(t),setPath(this.data,o,r),a.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var a in n)"string"!=typeof n[a]&&"[object Array]"!==Object.prototype.toString.apply(n[a])||this.addResource(e,t,a,n[a],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(o=e.split("."))[1]),this.addNamespaces(t);var s=getPath(this.data,o)||{};r?deepExtend(s,n,a):s=_objectSpread$5(_objectSpread$5({},s),n),setPath(this.data,o,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?_objectSpread$5(_objectSpread$5({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(function(e){return t[e]&&Object.keys(t[e]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(),postProcessor={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,a){var i=this;return e.forEach(function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,a))}),t}};function ownKeys$4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$4(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _createSuper$2(e){var t=_isNativeReflectConstruct$2();return function(){var n,r=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$2(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var checkedLoadedFor={},Translator=function(e){_inherits(n,EventEmitter);var t=_createSuper$2(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,n),r=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(r)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,_assertThisInitialized(r)),r.options=a,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=baseLogger.create("translator"),r}return _createClass(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||looksLikeObjectPath(e,n,r));if(i&&!o){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:a};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(r)}return"string"==typeof a&&(a=[a]),{key:e,namespaces:a}}},{key:"translate",value:function(e,t,r){var a=this;if("object"!==_typeof(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,u=s.namespaces,c=u[u.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var f=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(c).concat(f).concat(l),p):"".concat(c).concat(f).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),g=p&&p.res,m=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(g),b=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof g&&"boolean"!=typeof g&&"number"!=typeof g;if(_&&g&&w&&b.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,g,_objectSpread$4(_objectSpread$4({},t),{},{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=k,p):k}if(o){var S="[object Array]"===y,O=S?[]:{},M=S?v:m;for(var P in g)if(Object.prototype.hasOwnProperty.call(g,P)){var C="".concat(M).concat(o).concat(P);O[P]=this.translate(C,_objectSpread$4(_objectSpread$4({},t),{joinArrays:!1,ns:u})),O[P]===C&&(O[P]=g[P])}g=O}}else if(_&&"string"==typeof x&&"[object Array]"===y)(g=g.join(x))&&(g=this.extendTranslation(g,e,t,r));else{var D=!1,T=!1,R=void 0!==t.count&&"string"!=typeof t.count,A=n.hasDefaultValue(t),j=R?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(j)]||t.defaultValue;!this.isValidLookup(g)&&A&&(D=!0,g=N),this.isValidLookup(g)||(T=!0,g=l);var E=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,I=E&&T?void 0:g,L=A&&N!==g&&this.options.updateMissing;if(T||D||L){if(this.logger.log(L?"updateKey":"missingKey",d,c,l,L?N:g),o){var F=this.resolve(l,_objectSpread$4(_objectSpread$4({},t),{},{keySeparator:!1}));F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var W=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var V=0;V<z.length;V++)W.push(z[V]);else"all"===this.options.saveMissingTo?W=this.languageUtils.toResolveHierarchy(t.lng||this.language):W.push(t.lng||this.language);var Y=function(e,n,r){var i=A&&r!==g?r:I;a.options.missingKeyHandler?a.options.missingKeyHandler(e,c,n,i,L,t):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(e,c,n,i,L,t),a.emit("missingKey",e,c,n,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?W.forEach(function(e){a.pluralResolver.getSuffixes(e,t).forEach(function(n){Y([e],l+n,t["defaultValue".concat(n)]||N)})}):Y(W,l,N))}g=this.extendTranslation(g,e,t,p,r),T&&g===l&&this.options.appendNamespaceToMissingKey&&(g="".concat(c,":").concat(l)),(T||D)&&this.options.parseMissingKeyHandler&&(g="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(c,":").concat(l):l,D?g:void 0):this.options.parseMissingKeyHandler(g))}return i?(p.res=g,p):g}},{key:"extendTranslation",value:function(e,t,n,r,a){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,_objectSpread$4(_objectSpread$4({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(_objectSpread$4(_objectSpread$4({},n),{interpolation:_objectSpread$4(_objectSpread$4({},this.options.interpolation),n.interpolation)}));var o,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var l=e.match(this.interpolator.nestingRegexp);o=l&&l.length}var u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u=_objectSpread$4(_objectSpread$4({},this.options.interpolation.defaultVariables),u)),e=this.interpolator.interpolate(e,u,n.lng||this.language,n),s){var c=e.match(this.interpolator.nestingRegexp);o<(c&&c.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return a&&a[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))},n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=postProcessor.handle(h,e,t,this.options&&this.options.postProcessPassResolved?_objectSpread$4({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,a,i,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!o.isValidLookup(t)){var l=o.extractFromKey(e,s),u=l.key;n=u;var c=l.namespaces;o.options.fallbackNS&&(c=c.concat(o.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,h=d&&!s.ordinal&&0===s.count&&o.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);c.forEach(function(e){o.isValidLookup(t)||(i=e,!checkedLoadedFor["".concat(p[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(i)&&(checkedLoadedFor["".concat(p[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(function(n){if(!o.isValidLookup(t)){a=n;var i,l=[u];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(l,u,n,e,s);else{var c;d&&(c=o.pluralResolver.getSuffix(n,s.count,s));var p="".concat(o.options.pluralSeparator,"zero");if(d&&(l.push(u+c),h&&l.push(u+p)),f){var g="".concat(u).concat(o.options.contextSeparator).concat(s.context);l.push(g),d&&(l.push(g+c),h&&l.push(g+p))}}for(;i=l.pop();)o.isValidLookup(t)||(r=i,t=o.getResource(n,e,i,s))}}))})}}),{res:t,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}();function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var LanguageUtil=function(){function e(t){_classCallCheck(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(function(e){return e.toLowerCase()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=capitalize(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=capitalize(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=capitalize(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach(function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}}),!t&&this.options.supportedLngs&&e.forEach(function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find(function(e){if(0===e.indexOf(r))return e})}}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),a=[],i=function(e){e&&(n.isSupportedCode(e)?a.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach(function(e){a.indexOf(e)<0&&i(n.formatLanguageCode(e))}),a}}]),e}(),sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},deprecatedJsonVersions=["v1","v2","v3"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var e={};return sets.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:_rulesPluralsTypes[t.fc]}})}),e}var PluralResolver=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this.languageUtils=t,this.options=n,this.logger=baseLogger.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}return _createClass(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(function(e){return"".concat(t).concat(e)})}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort(function(e,t){return suffixesOrder[e]-suffixesOrder[t]}).map(function(e){return"".concat(t.options.prepend).concat(e)}):r.numbers.map(function(r){return t.getSuffix(e,r,n)}):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.plurals(e.noAbs?t:Math.abs(t)),a=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===a?a="plural":1===a&&(a=""));var i=function(){return n.options.prepend&&a.toString()?n.options.prepend+a.toString():a.toString()};return"v1"===this.options.compatibilityJSON?1===a?"":"number"==typeof a?"_plural_".concat(a.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]),e}();function ownKeys$3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$3(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Interpolator=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,e),this.logger=baseLogger.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return _createClass(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:escape,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?regexEscape(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?regexEscape(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?regexEscape(t.nestingPrefix):t.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=t.nestingSuffix?regexEscape(t.nestingSuffix):t.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var a,i,o,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0){var a=getPathWithDefaults(t,l,e);return s.alwaysFormat?s.format(a,void 0,n,_objectSpread$3(_objectSpread$3(_objectSpread$3({},r),t),{},{interpolationkey:e})):a}var i=e.split(s.formatSeparator),o=i.shift().trim(),u=i.join(s.formatSeparator).trim();return s.format(getPathWithDefaults(t,l,o),u,n,_objectSpread$3(_objectSpread$3(_objectSpread$3({},r),t),{},{interpolationkey:o}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return u(s.escapeValue?s.escape(e):e)}}].forEach(function(t){for(o=0;a=t.regex.exec(e);){var n=a[1].trim();if(void 0===(i=c(n)))if("function"==typeof d){var l=d(e,a,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(h){i=a[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=makeString(i));var u=t.safeValue(i);if(e=e.replace(a[0],u),h?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,++o>=s.maxReplaces)break}}),e}},{key:"nest",value:function(e,t){var n,r,a,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,a)).match(/'/g),s=i.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{a=JSON.parse(i),t&&(a=_objectSpread$3(_objectSpread$3({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var l=[];(a=(a=_objectSpread$3({},o)).replace&&"string"!=typeof a.replace?a.replace:a).applyPostProcessor=!1,delete a.defaultValue;var u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var c=n[1].split(this.formatSeparator).map(function(e){return e.trim()});n[1]=c.shift(),l=c,u=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=makeString(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),u&&(r=l.reduce(function(e,t){return i.format(e,t,o.lng,_objectSpread$3(_objectSpread$3({},o),{},{interpolationkey:n[1].trim()}))},r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function ownKeys$2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$2(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function parseFormatStr(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var a=r[1].substring(0,r[1].length-1);"currency"===t&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):"relativetime"===t&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(function(e){if(e){var t=_toArray(e.split(":")),r=t[0],a=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=a),"false"===a&&(n[r.trim()]=!1),"true"===a&&(n[r.trim()]=!0),isNaN(a)||(n[r.trim()]=parseInt(a,10))}})}return{formatName:t,formatOptions:n}}function createCachedFormatter(e){var t={};return function(n,r,a){var i=r+JSON.stringify(a),o=t[i];return o||(o=e(r,a),t[i]=o),o(n)}}var Formatter=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,e),this.logger=baseLogger.create("formatter"),this.options=t,this.formats={number:createCachedFormatter(function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}}),currency:createCachedFormatter(function(e,t){var n=new Intl.NumberFormat(e,_objectSpread$2(_objectSpread$2({},t),{},{style:"currency"}));return function(e){return n.format(e)}}),datetime:createCachedFormatter(function(e,t){var n=new Intl.DateTimeFormat(e,_objectSpread$2({},t));return function(e){return n.format(e)}}),relativetime:createCachedFormatter(function(e,t){var n=new Intl.RelativeTimeFormat(e,_objectSpread$2({},t));return function(e){return n.format(e,t.range||"day")}}),list:createCachedFormatter(function(e,t){var n=new Intl.ListFormat(e,_objectSpread$2({},t));return function(e){return n.format(e)}})},this.init(t)}return _createClass(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=createCachedFormatter(t)}},{key:"format",value:function(e,t,n,r){var a=this;return t.split(this.formatSeparator).reduce(function(e,t){var i=parseFormatStr(t),o=i.formatName,s=i.formatOptions;if(a.formats[o]){var l=e;try{var u=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{};l=a.formats[o](e,u.locale||u.lng||r.locale||r.lng||n,_objectSpread$2(_objectSpread$2(_objectSpread$2({},s),r),u))}catch(e){a.logger.warn(e)}return l}return a.logger.warn("there was no format function for ".concat(o)),e},e)}}]),e}();function ownKeys$1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _createSuper$1(e){var t=_isNativeReflectConstruct$1();return function(){var n,r=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function removePending(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}var Connector=function(e){_inherits(n,EventEmitter);var t=_createSuper$1(n);function n(e,r,a){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return _classCallCheck(this,n),i=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(i)),i.backend=e,i.store=r,i.services=a,i.languageUtils=a.languageUtils,i.options=o,i.logger=baseLogger.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=o.maxParallelReads||10,i.readingCalls=0,i.maxRetries=o.maxRetries>=0?o.maxRetries:5,i.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(a,o.backend,o),i}return _createClass(n,[{key:"queueLoad",value:function(e,t,n,r){var a=this,i={},o={},s={},l={};return e.forEach(function(e){var r=!0;t.forEach(function(t){var s="".concat(e,"|").concat(t);!n.reload&&a.store.hasResourceBundle(e,t)?a.state[s]=2:a.state[s]<0||(1===a.state[s]?void 0===o[s]&&(o[s]=!0):(a.state[s]=1,r=!1,void 0===o[s]&&(o[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))}),r||(s[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),a=r[0],i=r[1];t&&this.emit("failedLoading",a,i,t),n&&this.store.addResourceBundle(a,i,n),this.state[e]=t?-1:2;var o={};this.queue.forEach(function(n){pushPath(n.loaded,[a],i),removePending(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(function(e){o[e]||(o[e]={});var t=n.loaded[e];t.length&&t.forEach(function(t){void 0===o[e][t]&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,t,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:a,wait:i,callback:o});else{this.readingCalls++;var s=function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var u=r.waitingReads.shift();r.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}s&&l&&a<r.maxRetries?setTimeout(function(){r.read.call(r,e,t,n,a+1,2*i,o)},i):o(s,l)},l=this.backend[n].bind(this.backend);if(2!==l.length)return l(e,t,s);try{var u=l(e,t);u&&"function"==typeof u.then?u.then(function(e){return s(null,e)}).catch(s):s(null,u)}catch(e){s(e)}}}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(function(e){n.loadOne(e)})}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,function(r,o){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(a," failed"),r),!r&&o&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(a),o),t.loaded(e,r,o)})}},{key:"saveMissing",value:function(e,t,n,r,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=_objectSpread$1(_objectSpread$1({},i),{},{isUpdate:a}),l=this.backend.create.bind(this.backend);if(l.length<6)try{var u;(u=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof u.then?u.then(function(e){return o(null,e)}).catch(o):o(null,u)}catch(e){o(e)}else l(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}]),n}();function get(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===_typeof(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===_typeof(e[2])||"object"===_typeof(e[3])){var n=e[3]||e[2];Object.keys(n).forEach(function(e){t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function noop(){}function bindMemberFunctions(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}var I18n=function(e){_inherits(n,EventEmitter);var t=_createSuper(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(_classCallCheck(this,n),e=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(e)),e.options=transformOptions(r),e.services={},e.logger=baseLogger,e.modules={external:[]},bindMemberFunctions(_assertThisInitialized(e)),a&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,a),_possibleConstructorReturn(e,_assertThisInitialized(e));setTimeout(function(){e.init(r,a)},0)}return e}return _createClass(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=get();function a(e){return e?"function"==typeof e?new e:e:null}if(this.options=_objectSpread(_objectSpread(_objectSpread({},r),this.options),transformOptions(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=_objectSpread(_objectSpread({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;baseLogger.init(this.modules.logger?a(this.modules.logger):null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=Formatter);var o=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var s=this.services;s.logger=baseLogger,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new PluralResolver(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=a(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new Interpolator(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Connector(a(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];e.emit.apply(e,[t].concat(r))}),this.modules.languageDetector&&(s.languageDetector=a(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=a(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];e.emit.apply(e,[t].concat(r))}),this.modules.external.forEach(function(t){t.init&&t.init(e)})}if(this.format=this.options.interpolation.format,n||(n=noop),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach(function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}});var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach(function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}});var d=defer(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,r=n,a="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(a&&"cimode"===a.toLowerCase())return r();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach(function(e){i.indexOf(e)<0&&i.push(e)})};if(a)o(a);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach(function(e){return o(e)})}this.options.preload&&this.options.preload.forEach(function(e){return o(e)}),this.services.backendConnector.load(i,this.options.ns,function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)})}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=defer();return e||(e=this.languages),t||(t=this.options.ns),n||(n=noop),this.services.backendConnector.reload(e,t,function(e){r.resolve(),n(e)}),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&postProcessor.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=defer();this.emit("languageChanging",e);var a=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var o="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);o&&(n.language||a(o),n.translator.language||n.translator.changeLanguage(o),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(o)),n.loadResources(o,function(e){!function(e,i){i?(a(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve(function(){return n.t.apply(n,arguments)}),t&&t(e,function(){return n.t.apply(n,arguments)})}(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,a=function e(t,a){var i;if("object"!==_typeof(a)){for(var o=arguments.length,s=new Array(o>2?o-2:0),l=2;l<o;l++)s[l-2]=arguments[l];i=r.options.overloadTranslationOptionHandler([t,a].concat(s))}else i=_objectSpread({},a);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,i.keyPrefix=i.keyPrefix||n||e.keyPrefix;var u,c=r.options.keySeparator||".";return u=i.keyPrefix&&Array.isArray(t)?t.map(function(e){return"".concat(i.keyPrefix).concat(c).concat(e)}):i.keyPrefix?"".concat(i.keyPrefix).concat(c).concat(t):t,r.t(u,i)};return"string"==typeof e?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],a=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,o);if(void 0!==s)return s}return!(!this.hasResourceBundle(r,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(r,e)||a&&!o(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=defer();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)}),this.loadResources(function(e){r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=defer();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],a=e.filter(function(e){return r.indexOf(e)<0});return a.length?(this.options.preload=r.concat(a),this.loadResources(function(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new LanguageUtil(get());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,a=_objectSpread(_objectSpread(_objectSpread({},this.options),t),{isClone:!0}),i=new n(a);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var o=["store","services","language"];return o.forEach(function(t){i[t]=e[t]}),i.services=_objectSpread({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new Translator(i.services,i.options),i.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))}),i.init(a,r),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}();_defineProperty(I18n,"createInstance",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new I18n(e,t)});var instance=I18n.createInstance();instance.createInstance=I18n.createInstance;var Loading$1="Loading",Period$1="Period",Query$1="Query",Cancel$1="Cancel",Save$1="Save",Settings$1="Settings",en={Loading:Loading$1,"Previous shift":"Previous shift","Current shift":"Current shift","Endpoint URL":"Endpoint URL",Period:Period$1,Query:Query$1,"Add another query":"Add another query","Displayed query parameter":"Displayed query parameter","Add another displayed query parameter":"Add another displayed query parameter","X axis unit":"X axis unit","Y axis unit":"Y axis unit",Cancel:Cancel$1,Save:Save$1,Settings:Settings$1},Loading="Wczytywanie",Period="Okres",Query="Zapytanie",Cancel="Anuluj",Save="Zapisz",Settings="Ustawienia",pl={Loading:Loading,"Previous shift":"Poprzednia zmiana","Current shift":"Obecna zmiana","Endpoint URL":"Adres URL",Period:Period,Query:Query,"Add another query":"Dodaj kolejne zapytanie","Displayed query parameter":"Wyświetlany parametr zapytania","Add another displayed query parameter":"Dodaj kolejny wyświetlany parametr zapytania","X axis unit":"Jednostka osi X","Y axis unit":"Jednostka osi Y",Cancel:Cancel,Save:Save,Settings:Settings},resources={en:{translation:en},pl:{translation:pl}};function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}instance.use(initReactI18next).init({resources:resources,lng:"pl",interpolation:{escapeValue:!1}});var LIBRARY_VERSION="1.2.3",QueriesPeriod;!function(e){e.CURRENT_SHIFT="CURRENT_SHIFT",e.PREVIOUS_SHIFT="PREVIOUS_SHIFT"}(QueriesPeriod||(QueriesPeriod={}));var SettingsFormContent=function(e){var t=e.settings,n=e.onSettingsChange,r=useTranslation().t,a={mt:2};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{placeholder:r("Endpoint URL"),value:(null==t?void 0:t.endpointUrl)||"",onChange:function(e){return n({endpointUrl:e.target.value})},fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.Select,{placeholder:r("Period"),value:(null==t?void 0:t.queriesPeriod)||QueriesPeriod.CURRENT_SHIFT,onChange:function(e){return n({queriesPeriod:e.target.value})},fullWidth:!0},Object.keys(QueriesPeriod).map(function(e){return React__default.default.createElement(material.MenuItem,{key:e,value:QueriesPeriod[e]},r(QueriesPeriod[e]===QueriesPeriod.PREVIOUS_SHIFT?"Previous shift":"Current shift"))}))),((null==t?void 0:t.prometheusQueries)||[""]).map(function(e,i){return React__default.default.createElement(material.FormControl,{key:i,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%"},React__default.default.createElement(material.TextField,{placeholder:r("Query"),value:e,onChange:function(e){return function(e,r){var a=[].concat((null==t?void 0:t.prometheusQueries)||[""]);a[e]=r,n({prometheusQueries:a})}(i,e.target.value)},fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat((null==t?void 0:t.prometheusQueries)||[""]);r.splice(e,1),n({prometheusQueries:r})}(i)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat((null==t?void 0:t.prometheusQueries)||[""]);n({prometheusQueries:[].concat(e,[""])})},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(Trans,{t:r},"Add another query")),((null==t?void 0:t.displayedQueryParams)||[""]).map(function(e,i){return React__default.default.createElement(material.FormControl,{key:i,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%"},React__default.default.createElement(material.TextField,{placeholder:r("Displayed query parameter"),value:e,onChange:function(e){return function(e,r){var a=[].concat((null==t?void 0:t.displayedQueryParams)||[""]);a[e]=r,n({displayedQueryParams:a})}(i,e.target.value)},fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat((null==t?void 0:t.displayedQueryParams)||[""]);r.splice(e,1),n({displayedQueryParams:r})}(i)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat((null==t?void 0:t.displayedQueryParams)||[""]);n({displayedQueryParams:[].concat(e,[""])})},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(Trans,{t:r},"Add another displayed query parameter")),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{placeholder:r("X axis unit"),value:(null==t?void 0:t.xAxisUnit)||"",onChange:function(e){return n({xAxisUnit:e.target.value})},fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{placeholder:r("Y axis unit"),value:(null==t?void 0:t.yAxisUnit)||"",onChange:function(e){return n({yAxisUnit:e.target.value})},fullWidth:!0})))},commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e){var t={exports:{}};return e(t,t.exports),t.exports}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var moment$1=createCommonjsModule(function(e,t){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(o(e,t))return!1;return!0}function l(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var n,r=[],a=e.length;for(n=0;n<a;++n)r.push(t(e[n],n));return r}function h(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,n,r){return kt(e,t,n,r,!0).utc()}function p(e){return null==e._pf&&(e._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}),e._pf}function g(e){if(null==e._isValid){var t=p(e),r=n.call(t.parsedDateParts,function(e){return null!=e}),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function m(e){var t=f(NaN);return null!=e?h(p(t),e):p(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var v=r.momentProperties=[],y=!1;function b(e,t){var n,r,a,i=v.length;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=p(t)),l(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)l(a=t[r=v[n]])||(e[r]=a);return e}function x(e){b(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,r.updateOffset(this),y=!1)}function _(e){return e instanceof x||null!=e&&null!=e._isAMomentObject}function w(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var n=!0;return h(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var a,i,s,l=[],u=arguments.length;for(i=0;i<u;i++){if(a="","object"==typeof arguments[i]){for(s in a+="\n["+i+"] ",arguments[0])o(arguments[0],s)&&(a+=s+": "+arguments[0][s]+", ");a=a.slice(0,-2)}else a=arguments[i];l.push(a)}w(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var S,O={};function M(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),O[e]||(w(t),O[e]=!0)}function P(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,t){var n,r=h({},e);for(n in t)o(t,n)&&(i(e[n])&&i(t[n])?(r[n]={},h(r[n],e[n]),h(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)o(e,n)&&!o(t,n)&&i(e[n])&&(r[n]=h({},r[n]));return r}function D(e){null!=e&&this.set(e)}function T(e,t,n){var r=""+Math.abs(e);return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-r.length)).toString().substr(1)+r}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n};var R=/(\[[^\[]*\])|(\\)?([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,A=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,j={},N={};function E(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(N[e]=a),t&&(N[t[0]]=function(){return T(a.apply(this,arguments),t[1],t[2])}),n&&(N[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function I(e,t){return e.isValid()?(t=L(t,e.localeData()),j[t]=j[t]||function(e){var t,n,r,a=e.match(R);for(t=0,n=a.length;t<n;t++)a[t]=N[a[t]]?N[a[t]]:(r=a[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=P(a[r])?a[r].call(t,e):a[r];return i}}(t),j[t](e)):e.localeData().invalidDate()}function L(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(A.lastIndex=0;n>=0&&A.test(e);)e=e.replace(A,r),A.lastIndex=0,n-=1;return e}var F={};function W(e,t){var n=e.toLowerCase();F[n]=F[n+"s"]=F[t]=e}function z(e){return"string"==typeof e?F[e]||F[e.toLowerCase()]:void 0}function V(e){var t,n,r={};for(n in e)o(e,n)&&(t=z(n))&&(r[t]=e[n]);return r}var Y={};function B(e,t){Y[e]=t}function H(e){return e%4==0&&e%100!=0||e%400==0}function $(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function U(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=$(t)),n}function q(e,t){return function(n){return null!=n?(K(this,e,n),r.updateOffset(this,t),this):G(this,e)}}function G(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function K(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&H(e.year())&&1===e.month()&&29===e.date()?(n=U(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),_e(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var J,Q=/\d/,Z=/\d\d/,X=/\d{3}/,ee=/\d{4}/,te=/[+-]?\d{6}/,ne=/\d\d?/,re=/\d\d\d\d?/,ae=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,oe=/\d{1,4}/,se=/[+-]?\d{1,6}/,le=/\d+/,ue=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,de=/Z|[+-]\d\d(?::?\d\d)?/gi,he=/[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;function fe(e,t,n){J[e]=P(t)?t:function(e,r){return e&&n?n:t}}function pe(e,t){return o(J,e)?J[e](t._strict,t._locale):new RegExp(function(e){return ge(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,a){return t||n||r||a}))}(e))}function ge(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}J={};var me,ve={};function ye(e,t){var n,r,a=t;for("string"==typeof e&&(e=[e]),u(t)&&(a=function(e,n){n[t]=U(e)}),r=e.length,n=0;n<r;n++)ve[e[n]]=a}function be(e,t){ye(e,function(e,n,r,a){r._w=r._w||{},t(e,r._w,r,a)})}function xe(e,t,n){null!=t&&o(ve,e)&&ve[e](t,n._a,n,e)}function _e(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=function(e,t){return(e%12+12)%12}(t);return e+=(t-n)/12,1===n?H(e)?29:28:31-n%7%2}me=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},E("M",["MM",2],"Mo",function(){return this.month()+1}),E("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),E("MMMM",0,0,function(e){return this.localeData().months(this,e)}),W("month","M"),B("month",8),fe("M",ne),fe("MM",ne,Z),fe("MMM",function(e,t){return t.monthsShortRegex(e)}),fe("MMMM",function(e,t){return t.monthsRegex(e)}),ye(["M","MM"],function(e,t){t[1]=U(e)-1}),ye(["MMM","MMMM"],function(e,t,n,r){var a=n._locale.monthsParse(e,r,n._strict);null!=a?t[1]=a:p(n).invalidMonth=e});var we="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ke="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Se=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Oe=he,Me=he;function Pe(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=f([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=me.call(this._shortMonthsParse,o))?a:null:-1!==(a=me.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=me.call(this._shortMonthsParse,o))||-1!==(a=me.call(this._longMonthsParse,o))?a:null:-1!==(a=me.call(this._longMonthsParse,o))||-1!==(a=me.call(this._shortMonthsParse,o))?a:null}function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=U(t);else if(!u(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),_e(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function De(e){return null!=e?(Ce(this,e),r.updateOffset(this,!0),this):G(this,"Month")}function Te(){function e(e,t){return t.length-e.length}var t,n,r=[],a=[],i=[];for(t=0;t<12;t++)n=f([2e3,t]),r.push(this.monthsShort(n,"")),a.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(e),a.sort(e),i.sort(e),t=0;t<12;t++)r[t]=ge(r[t]),a[t]=ge(a[t]);for(t=0;t<24;t++)i[t]=ge(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Re(e){return H(e)?366:365}E("Y",0,0,function(){var e=this.year();return e<=9999?T(e,4):"+"+e}),E(0,["YY",2],0,function(){return this.year()%100}),E(0,["YYYY",4],0,"year"),E(0,["YYYYY",5],0,"year"),E(0,["YYYYYY",6,!0],0,"year"),W("year","y"),B("year",1),fe("Y",ue),fe("YY",ne,Z),fe("YYYY",oe,ee),fe("YYYYY",se,te),fe("YYYYYY",se,te),ye(["YYYYY","YYYYYY"],0),ye("YYYY",function(e,t){t[0]=2===e.length?r.parseTwoDigitYear(e):U(e)}),ye("YY",function(e,t){t[0]=r.parseTwoDigitYear(e)}),ye("Y",function(e,t){t[0]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return U(e)+(U(e)>68?1900:2e3)};var Ae=q("FullYear",!0);function je(e,t,n,r,a,i,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,a,i,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,a,i,o),s}function Ne(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ee(e,t,n){var r=7+t-n;return-(7+Ne(e,0,r).getUTCDay()-t)%7+r-1}function Ie(e,t,n,r,a){var i,o,s=1+7*(t-1)+(7+n-r)%7+Ee(e,r,a);return s<=0?o=Re(i=e-1)+s:s>Re(e)?(i=e+1,o=s-Re(e)):(i=e,o=s),{year:i,dayOfYear:o}}function Le(e,t,n){var r,a,i=Ee(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?r=o+Fe(a=e.year()-1,t,n):o>Fe(e.year(),t,n)?(r=o-Fe(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function Fe(e,t,n){var r=Ee(e,t,n),a=Ee(e+1,t,n);return(Re(e)-r+a)/7}function We(e,t){return e.slice(t,7).concat(e.slice(0,t))}E("w",["ww",2],"wo","week"),E("W",["WW",2],"Wo","isoWeek"),W("week","w"),W("isoWeek","W"),B("week",5),B("isoWeek",5),fe("w",ne),fe("ww",ne,Z),fe("W",ne),fe("WW",ne,Z),be(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=U(e)}),E("d",0,"do","day"),E("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),E("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),E("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),E("e",0,0,"weekday"),E("E",0,0,"isoWeekday"),W("day","d"),W("weekday","e"),W("isoWeekday","E"),B("day",11),B("weekday",11),B("isoWeekday",11),fe("d",ne),fe("e",ne),fe("E",ne),fe("dd",function(e,t){return t.weekdaysMinRegex(e)}),fe("ddd",function(e,t){return t.weekdaysShortRegex(e)}),fe("dddd",function(e,t){return t.weekdaysRegex(e)}),be(["dd","ddd","dddd"],function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:p(n).invalidWeekday=e}),be(["d","e","E"],function(e,t,n,r){t[r]=U(e)});var ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ve="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ye="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Be=he,He=he,$e=he;function Ue(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=f([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=me.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=me.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=me.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=me.call(this._weekdaysParse,o))||-1!==(a=me.call(this._shortWeekdaysParse,o))||-1!==(a=me.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=me.call(this._shortWeekdaysParse,o))||-1!==(a=me.call(this._weekdaysParse,o))||-1!==(a=me.call(this._minWeekdaysParse,o))?a:null:-1!==(a=me.call(this._minWeekdaysParse,o))||-1!==(a=me.call(this._weekdaysParse,o))||-1!==(a=me.call(this._shortWeekdaysParse,o))?a:null}function qe(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),r=ge(this.weekdaysMin(n,"")),a=ge(this.weekdaysShort(n,"")),i=ge(this.weekdays(n,"")),o.push(r),s.push(a),l.push(i),u.push(r),u.push(a),u.push(i);o.sort(e),s.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ge(){return this.hours()%12||12}function Ke(e,t){E(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Je(e,t){return t._meridiemParse}E("H",["HH",2],0,"hour"),E("h",["hh",2],0,Ge),E("k",["kk",2],0,function(){return this.hours()||24}),E("hmm",0,0,function(){return""+Ge.apply(this)+T(this.minutes(),2)}),E("hmmss",0,0,function(){return""+Ge.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),E("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),E("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),W("hour","h"),B("hour",13),fe("a",Je),fe("A",Je),fe("H",ne),fe("h",ne),fe("k",ne),fe("HH",ne,Z),fe("hh",ne,Z),fe("kk",ne,Z),fe("hmm",re),fe("hmmss",ae),fe("Hmm",re),fe("Hmmss",ae),ye(["H","HH"],3),ye(["k","kk"],function(e,t,n){var r=U(e);t[3]=24===r?0:r}),ye(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ye(["h","hh"],function(e,t,n){t[3]=U(e),p(n).bigHour=!0}),ye("hmm",function(e,t,n){var r=e.length-2;t[3]=U(e.substr(0,r)),t[4]=U(e.substr(r)),p(n).bigHour=!0}),ye("hmmss",function(e,t,n){var r=e.length-4,a=e.length-2;t[3]=U(e.substr(0,r)),t[4]=U(e.substr(r,2)),t[5]=U(e.substr(a)),p(n).bigHour=!0}),ye("Hmm",function(e,t,n){var r=e.length-2;t[3]=U(e.substr(0,r)),t[4]=U(e.substr(r))}),ye("Hmmss",function(e,t,n){var r=e.length-4,a=e.length-2;t[3]=U(e.substr(0,r)),t[4]=U(e.substr(r,2)),t[5]=U(e.substr(a))});var Qe,Ze=q("Hours",!0),Xe={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:we,monthsShort:ke,week:{dow:0,doy:6},weekdays:ze,weekdaysMin:Ye,weekdaysShort:Ve,meridiemParse:/[ap]\.?m?\.?/i},et={},tt={};function nt(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(t){var n=null;if(void 0===et[t]&&e&&e.exports&&function(e){return null!=e.match("^[^/\\\\]*$")}(t))try{n=Qe._abbr,commonjsRequire("./locale/"+t),it(n)}catch(e){et[t]=null}return et[t]}function it(e,t){var n;return e&&((n=l(t)?st(e):ot(e,t))?Qe=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Qe._abbr}function ot(e,t){if(null!==t){var n,r=Xe;if(t.abbr=e,null!=et[e])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."),r=et[e]._config;else if(null!=t.parentLocale)if(null!=et[t.parentLocale])r=et[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return tt[t.parentLocale]||(tt[t.parentLocale]=[]),tt[t.parentLocale].push({name:e,config:t}),null;r=n._config}return et[e]=new D(C(r,t)),tt[e]&&tt[e].forEach(function(e){ot(e.name,e.config)}),it(e),et[e]}return delete et[e],null}function st(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Qe;if(!a(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,r,a,i=0;i<e.length;){for(t=(a=rt(e[i]).split("-")).length,n=(n=rt(e[i+1]))?n.split("-"):null;t>0;){if(r=at(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&nt(a,n)>=t-1)break;t--}i++}return Qe}(e)}function lt(e){var t,n=e._a;return n&&-2===p(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>_e(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,p(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),p(e)._overflowWeeks&&-1===t&&(t=7),p(e)._overflowWeekday&&-1===t&&(t=8),p(e).overflow=t),e}var ut=/^\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)?)?$/,ct=/^\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)?)?$/,dt=/Z|[+-]\d\d(?::?\d\d)?/,ht=[["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]],ft=[["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/]],pt=/^\/?Date\((-?\d+)/i,gt=/^(?:(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}))$/,mt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vt(e){var t,n,r,a,i,o,s=e._i,l=ut.exec(s)||ct.exec(s),u=ht.length,c=ft.length;if(l){for(p(e).iso=!0,t=0,n=u;t<n;t++)if(ht[t][1].exec(l[1])){a=ht[t][0],r=!1!==ht[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=c;t<n;t++)if(ft[t][1].exec(l[3])){i=(l[2]||" ")+ft[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!dt.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),_t(e)}else e._isValid=!1}function yt(e){var t,n,r,a,i,o,s,l,u,c=gt.exec(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}(e._i));if(c){if(n=c[3],r=c[2],a=c[5],i=c[6],o=c[7],s=[(l=c[4],u=parseInt(l,10),u<=49?2e3+u:u<=999?1900+u:u),ke.indexOf(n),parseInt(r,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),!function(e,t,n){return!e||Ve.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(p(n).weekdayMismatch=!0,n._isValid=!1,!1)}(c[1],t=s,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return mt[e];if(t)return 0;var r=parseInt(n,10),a=r%100;return(r-a)/100*60+a}(c[8],c[9],c[10]),e._d=Ne.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function bt(e,t,n){return null!=e?e:null!=t?t:n}function xt(e){var t,n,a,i,o,s=[];if(!e._d){for(a=function(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,r,a,i,o,s,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,o=4,n=bt(t.GG,e._a[0],Le(St(),1,4).year),r=bt(t.W,1),((a=bt(t.E,1))<1||a>7)&&(l=!0)):(i=e._locale._week.dow,o=e._locale._week.doy,u=Le(St(),i,o),n=bt(t.gg,e._a[0],u.year),r=bt(t.w,u.week),null!=t.d?((a=t.d)<0||a>6)&&(l=!0):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(l=!0)):a=i),r<1||r>Fe(n,i,o)?p(e)._overflowWeeks=!0:null!=l?p(e)._overflowWeekday=!0:(s=Ie(n,r,a,i,o),e._a[0]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=bt(e._a[0],a[0]),(e._dayOfYear>Re(o)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),n=Ne(o,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Ne:je).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(p(e).weekdayMismatch=!0)}}function _t(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],p(e).empty=!0;var t,n,a,i,o,s,l,u=""+e._i,c=u.length,d=0;for(l=(a=L(e._f,e._locale).match(R)||[]).length,t=0;t<l;t++)(n=(u.match(pe(i=a[t],e))||[])[0])&&((o=u.substr(0,u.indexOf(n))).length>0&&p(e).unusedInput.push(o),u=u.slice(u.indexOf(n)+n.length),d+=n.length),N[i]?(n?p(e).empty=!1:p(e).unusedTokens.push(i),xe(i,n,e)):e._strict&&!n&&p(e).unusedTokens.push(i);p(e).charsLeftOver=c-d,u.length>0&&p(e).unusedInput.push(u),e._a[3]<=12&&!0===p(e).bigHour&&e._a[3]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(s=p(e).era)&&(e._a[0]=e._locale.erasConvertYear(s,e._a[0])),xt(e),lt(e)}else yt(e);else vt(e)}function wt(e){var t=e._i,n=e._f;return e._locale=e._locale||st(e._l),null===t||void 0===n&&""===t?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),_(t)?new x(lt(t)):(c(t)?e._d=t:a(n)?function(e){var t,n,r,a,i,o,s=!1,l=e._f.length;if(0===l)return p(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<l;a++)i=0,o=!1,t=b({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],_t(t),g(t)&&(o=!0),i+=p(t).charsLeftOver,i+=10*p(t).unusedTokens.length,p(t).score=i,s?i<r&&(r=i,n=t):(null==r||i<r||o)&&(r=i,n=t,o&&(s=!0));h(e,n||t)}(e):n?_t(e):function(e){var t=e._i;l(t)?e._d=new Date(r.now()):c(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=pt.exec(e._i);null===t?(vt(e),!1===e._isValid&&(delete e._isValid,yt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):a(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),xt(e)):i(t)?function(e){if(!e._d){var t=V(e._i);e._a=d([t.year,t.month,void 0===t.day?t.date:t.day,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),xt(e)}}(e):u(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),g(e)||(e._d=null),e))}function kt(e,t,n,r,o){var l,u={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(i(e)&&s(e)||a(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=n,u._i=e,u._f=t,u._strict=r,(l=new x(lt(wt(u))))._nextDay&&(l.add(1,"d"),l._nextDay=void 0),l}function St(e,t,n,r){return kt(e,t,n,r,!1)}r.createFromInputFallback=k("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(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var Ot=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=St.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),Mt=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=St.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()});function Pt(e,t){var n,r;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return St();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var Ct=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Dt(e){var t=V(e),n=t.year||0,r=t.quarter||0,a=t.month||0,i=t.week||t.isoWeek||0,s=t.day||0,l=t.hour||0,u=t.minute||0,c=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,n,r=!1,a=Ct.length;for(t in e)if(o(e,t)&&(-1===me.call(Ct,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<a;++n)if(e[Ct[n]]){if(r)return!1;parseFloat(e[Ct[n]])!==U(e[Ct[n]])&&(r=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*u+1e3*l*60*60,this._days=+s+7*i,this._months=+a+3*r+12*n,this._data={},this._locale=st(),this._bubble()}function Tt(e){return e instanceof Dt}function Rt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function At(e,t){E(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+T(~~(e/60),2)+t+T(~~e%60,2)})}At("Z",":"),At("ZZ",""),fe("Z",de),fe("ZZ",de),ye(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Nt(de,e)});var jt=/([\+\-]|\d\d)/gi;function Nt(e,t){var n,r,a=(t||"").match(e);return null===a?null:0===(r=60*(n=((a[a.length-1]||[])+"").match(jt)||["-",0,0])[1]+U(n[2]))?0:"+"===n[0]?r:-r}function Et(e,t){var n,a;return t._isUTC?(n=t.clone(),a=(_(e)||c(e)?e.valueOf():St(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),r.updateOffset(n,!1),n):St(e).local()}function It(e){return-Math.round(e._d.getTimezoneOffset())}function Lt(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Ft=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Wt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function zt(e,t){var n,r,a,i,s,l,c=e,d=null;return Tt(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=Ft.exec(e))?(n="-"===d[1]?-1:1,c={y:0,d:U(d[2])*n,h:U(d[3])*n,m:U(d[4])*n,s:U(d[5])*n,ms:U(Rt(1e3*d[6]))*n}):(d=Wt.exec(e))?c={y:Vt(d[2],n="-"===d[1]?-1:1),M:Vt(d[3],n),w:Vt(d[4],n),d:Vt(d[5],n),h:Vt(d[6],n),m:Vt(d[7],n),s:Vt(d[8],n)}:null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(i=St(c.from),s=St(c.to),a=i.isValid()&&s.isValid()?(s=Et(s,i),i.isBefore(s)?l=Yt(i,s):((l=Yt(s,i)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(c={}).ms=a.milliseconds,c.M=a.months),r=new Dt(c),Tt(e)&&o(e,"_locale")&&(r._locale=e._locale),Tt(e)&&o(e,"_isValid")&&(r._isValid=e._isValid),r}function Vt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Yt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Bt(e,t){return function(n,r){var a;return null===r||isNaN(+r)||(M(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),Ht(this,zt(n,r),e),this}}function Ht(e,t,n,a){var i=t._milliseconds,o=Rt(t._days),s=Rt(t._months);e.isValid()&&(a=null==a||a,s&&Ce(e,G(e,"Month")+s*n),o&&K(e,"Date",G(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),a&&r.updateOffset(e,o||s))}zt.fn=Dt.prototype,zt.invalid=function(){return zt(NaN)};var $t=Bt(1,"add"),Ut=Bt(-1,"subtract");function qt(e){return"string"==typeof e||e instanceof String}function Gt(e){return _(e)||c(e)||qt(e)||u(e)||function(e){var t=a(e),n=!1;return t&&(n=0===e.filter(function(t){return!u(t)&&qt(e)}).length),t&&n}(e)||function(e){var t,n=i(e)&&!s(e),r=!1,a=["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=a.length;for(t=0;t<l;t+=1)r=r||o(e,a[t]);return n&&r}(e)||null==e}function Kt(e){var t,n=i(e)&&!s(e),r=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<a.length;t+=1)r=r||o(e,a[t]);return n&&r}function Jt(e,t){if(e.date()<t.date())return-Jt(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=st(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Zt=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Xt(){return this._locale}var en=1e3,tn=6e4,nn=36e5,rn=126227808e5;function an(e,t){return(e%t+t)%t}function on(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-rn:new Date(e,t,n).valueOf()}function sn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-rn:Date.UTC(e,t,n)}function ln(e,t){return t.erasAbbrRegex(e)}function un(){var e,t,n=[],r=[],a=[],i=[],o=this.eras();for(e=0,t=o.length;e<t;++e)r.push(ge(o[e].name)),n.push(ge(o[e].abbr)),a.push(ge(o[e].narrow)),i.push(ge(o[e].name)),i.push(ge(o[e].abbr)),i.push(ge(o[e].narrow));this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+r.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}function cn(e,t){E(0,[e,e.length],0,t)}function dn(e,t,n,r,a){var i;return null==e?Le(this,r,a).year:(t>(i=Fe(e,r,a))&&(t=i),hn.call(this,e,t,n,r,a))}function hn(e,t,n,r,a){var i=Ie(e,t,n,r,a),o=Ne(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}E("N",0,0,"eraAbbr"),E("NN",0,0,"eraAbbr"),E("NNN",0,0,"eraAbbr"),E("NNNN",0,0,"eraName"),E("NNNNN",0,0,"eraNarrow"),E("y",["y",1],"yo","eraYear"),E("y",["yy",2],0,"eraYear"),E("y",["yyy",3],0,"eraYear"),E("y",["yyyy",4],0,"eraYear"),fe("N",ln),fe("NN",ln),fe("NNN",ln),fe("NNNN",function(e,t){return t.erasNameRegex(e)}),fe("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),ye(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var a=n._locale.erasParse(e,r,n._strict);a?p(n).era=a:p(n).invalidEra=e}),fe("y",le),fe("yy",le),fe("yyy",le),fe("yyyy",le),fe("yo",function(e,t){return t._eraYearOrdinalRegex||le}),ye(["y","yy","yyy","yyyy"],0),ye(["yo"],function(e,t,n,r){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),t[0]=n._locale.eraYearOrdinalParse?n._locale.eraYearOrdinalParse(e,a):parseInt(e,10)}),E(0,["gg",2],0,function(){return this.weekYear()%100}),E(0,["GG",2],0,function(){return this.isoWeekYear()%100}),cn("gggg","weekYear"),cn("ggggg","weekYear"),cn("GGGG","isoWeekYear"),cn("GGGGG","isoWeekYear"),W("weekYear","gg"),W("isoWeekYear","GG"),B("weekYear",1),B("isoWeekYear",1),fe("G",ue),fe("g",ue),fe("GG",ne,Z),fe("gg",ne,Z),fe("GGGG",oe,ee),fe("gggg",oe,ee),fe("GGGGG",se,te),fe("ggggg",se,te),be(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=U(e)}),be(["gg","GG"],function(e,t,n,a){t[a]=r.parseTwoDigitYear(e)}),E("Q",0,"Qo","quarter"),W("quarter","Q"),B("quarter",7),fe("Q",Q),ye("Q",function(e,t){t[1]=3*(U(e)-1)}),E("D",["DD",2],"Do","date"),W("date","D"),B("date",9),fe("D",ne),fe("DD",ne,Z),fe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],2),ye("Do",function(e,t){t[2]=U(e.match(ne)[0])});var fn=q("Date",!0);E("DDD",["DDDD",3],"DDDo","dayOfYear"),W("dayOfYear","DDD"),B("dayOfYear",4),fe("DDD",ie),fe("DDDD",X),ye(["DDD","DDDD"],function(e,t,n){n._dayOfYear=U(e)}),E("m",["mm",2],0,"minute"),W("minute","m"),B("minute",14),fe("m",ne),fe("mm",ne,Z),ye(["m","mm"],4);var pn=q("Minutes",!1);E("s",["ss",2],0,"second"),W("second","s"),B("second",15),fe("s",ne),fe("ss",ne,Z),ye(["s","ss"],5);var gn,mn,vn=q("Seconds",!1);for(E("S",0,0,function(){return~~(this.millisecond()/100)}),E(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),E(0,["SSS",3],0,"millisecond"),E(0,["SSSS",4],0,function(){return 10*this.millisecond()}),E(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),E(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),E(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),E(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),E(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),W("millisecond","ms"),B("millisecond",16),fe("S",ie,Q),fe("SS",ie,Z),fe("SSS",ie,X),gn="SSSS";gn.length<=9;gn+="S")fe(gn,le);function yn(e,t){t[6]=U(1e3*("0."+e))}for(gn="S";gn.length<=9;gn+="S")ye(gn,yn);mn=q("Milliseconds",!1),E("z",0,0,"zoneAbbr"),E("zz",0,0,"zoneName");var bn=x.prototype;function xn(e){return e}bn.add=$t,bn.calendar=function(e,t){1===arguments.length&&(arguments[0]?Gt(arguments[0])?(e=arguments[0],t=void 0):Kt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||St(),a=Et(n,this).startOf("day"),i=r.calendarFormat(this,a)||"sameElse",o=t&&(P(t[i])?t[i].call(this,n):t[i]);return this.format(o||this.localeData().calendar(i,this,St(n)))},bn.clone=function(){return new x(this)},bn.diff=function(e,t,n){var r,a,i;if(!this.isValid())return NaN;if(!(r=Et(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=z(t)){case"year":i=Jt(this,r)/12;break;case"month":i=Jt(this,r);break;case"quarter":i=Jt(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-a)/864e5;break;case"week":i=(this-r-a)/6048e5;break;default:i=this-r}return n?i:$(i)},bn.endOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?sn:on,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=nn-an(t+(this._isUTC?0:this.utcOffset()*tn),nn)-1;break;case"minute":t=this._d.valueOf(),t+=tn-an(t,tn)-1;break;case"second":t=this._d.valueOf(),t+=en-an(t,en)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},bn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=I(this,e);return this.localeData().postformat(t)},bn.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||St(e).isValid())?zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},bn.fromNow=function(e){return this.from(St(),e)},bn.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||St(e).isValid())?zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},bn.toNow=function(e){return this.to(St(),e)},bn.get=function(e){return P(this[e=z(e)])?this[e]():this},bn.invalidAt=function(){return p(this).overflow},bn.isAfter=function(e,t){var n=_(e)?e:St(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},bn.isBefore=function(e,t){var n=_(e)?e:St(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},bn.isBetween=function(e,t,n,r){var a=_(e)?e:St(e),i=_(t)?t:St(t);return!!(this.isValid()&&a.isValid()&&i.isValid())&&("("===(r=r||"()")[0]?this.isAfter(a,n):!this.isBefore(a,n))&&(")"===r[1]?this.isBefore(i,n):!this.isAfter(i,n))},bn.isSame=function(e,t){var n,r=_(e)?e:St(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},bn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},bn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},bn.isValid=function(){return g(this)},bn.lang=Zt,bn.locale=Qt,bn.localeData=Xt,bn.max=Mt,bn.min=Ot,bn.parsingFlags=function(){return h({},p(this))},bn.set=function(e,t){if("object"==typeof e){var n,r=function(e){var t,n=[];for(t in e)o(e,t)&&n.push({unit:t,priority:Y[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=V(e)),a=r.length;for(n=0;n<a;n++)this[r[n].unit](e[r[n].unit])}else if(P(this[e=z(e)]))return this[e](t);return this},bn.startOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?sn:on,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=an(t+(this._isUTC?0:this.utcOffset()*tn),nn);break;case"minute":t=this._d.valueOf(),t-=an(t,tn);break;case"second":t=this._d.valueOf(),t-=an(t,en)}return this._d.setTime(t),r.updateOffset(this,!0),this},bn.subtract=Ut,bn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},bn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},bn.toDate=function(){return new Date(this.valueOf())},bn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?I(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):P(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",I(n,"Z")):I(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},bn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n="moment",r="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+r+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(bn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),bn.toJSON=function(){return this.isValid()?this.toISOString():null},bn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},bn.unix=function(){return Math.floor(this.valueOf()/1e3)},bn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},bn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},bn.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""},bn.eraNarrow=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""},bn.eraAbbr=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""},bn.eraYear=function(){var e,t,n,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until||i[e].until<=a&&a<=i[e].since)return(this.year()-r(i[e].since).year())*n+i[e].offset;return this.year()},bn.year=Ae,bn.isLeapYear=function(){return H(this.year())},bn.weekYear=function(e){return dn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},bn.isoWeekYear=function(e){return dn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},bn.quarter=bn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},bn.month=De,bn.daysInMonth=function(){return _e(this.year(),this.month())},bn.week=bn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},bn.isoWeek=bn.isoWeeks=function(e){var t=Le(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},bn.weeksInYear=function(){var e=this.localeData()._week;return Fe(this.year(),e.dow,e.doy)},bn.weeksInWeekYear=function(){var e=this.localeData()._week;return Fe(this.weekYear(),e.dow,e.doy)},bn.isoWeeksInYear=function(){return Fe(this.year(),1,4)},bn.isoWeeksInISOWeekYear=function(){return Fe(this.isoWeekYear(),1,4)},bn.date=fn,bn.day=bn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},bn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},bn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},bn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},bn.hour=bn.hours=Ze,bn.minute=bn.minutes=pn,bn.second=bn.seconds=vn,bn.millisecond=bn.milliseconds=mn,bn.utcOffset=function(e,t,n){var a,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Nt(de,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(a=It(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!t||this._changeInProgress?Ht(this,zt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:It(this)},bn.utc=function(e){return this.utcOffset(0,e)},bn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(It(this),"m")),this},bn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Nt(ce,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},bn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?St(e).utcOffset():0,(this.utcOffset()-e)%60==0)},bn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},bn.isLocal=function(){return!!this.isValid()&&!this._isUTC},bn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},bn.isUtc=Lt,bn.isUTC=Lt,bn.zoneAbbr=function(){return this._isUTC?"UTC":""},bn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},bn.dates=k("dates accessor is deprecated. Use date instead.",fn),bn.months=k("months accessor is deprecated. Use month instead",De),bn.years=k("years accessor is deprecated. Use year instead",Ae),bn.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),bn.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return b(t,this),(t=wt(t))._a?(e=t._isUTC?f(t._a):St(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var r,a=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),o=0;for(r=0;r<a;r++)U(e[r])!==U(t[r])&&o++;return o+i}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var _n=D.prototype;function wn(e,t,n,r){var a=st(),i=f().set(r,t);return a[n](i,e)}function kn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return wn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=wn(e,r,n,"month");return a}function Sn(e,t,n,r){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var a,i=st(),o=e?i._week.dow:0,s=[];if(null!=n)return wn(t,(n+o)%7,r,"day");for(a=0;a<7;a++)s[a]=wn(t,(a+o)%7,r,"day");return s}_n.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return P(r)?r.call(t,n):r},_n.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},_n.invalidDate=function(){return this._invalidDate},_n.ordinal=function(e){return this._ordinal.replace("%d",e)},_n.preparse=xn,_n.postformat=xn,_n.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return P(a)?a(e,t,n,r):a.replace(/%d/i,e)},_n.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return P(n)?n(t):n.replace(/%s/i,t)},_n.set=function(e){var t,n;for(n in e)o(e,n)&&(P(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},_n.eras=function(e,t){var n,a,i,o=this._eras||st("en")._eras;for(n=0,a=o.length;n<a;++n)switch("string"==typeof o[n].since&&(i=r(o[n].since).startOf("day"),o[n].since=i.valueOf()),typeof o[n].until){case"undefined":o[n].until=Infinity;break;case"string":i=r(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf()}return o},_n.erasParse=function(e,t,n){var r,a,i,o,s,l=this.eras();for(e=e.toUpperCase(),r=0,a=l.length;r<a;++r)if(i=l[r].name.toUpperCase(),o=l[r].abbr.toUpperCase(),s=l[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[r];break;case"NNNN":if(i===e)return l[r];break;case"NNNNN":if(s===e)return l[r]}else if([i,o,s].indexOf(e)>=0)return l[r]},_n.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},_n.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||un.call(this),e?this._erasAbbrRegex:this._erasRegex},_n.erasNameRegex=function(e){return o(this,"_erasNameRegex")||un.call(this),e?this._erasNameRegex:this._erasRegex},_n.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||un.call(this),e?this._erasNarrowRegex:this._erasRegex},_n.months=function(e,t){return e?a(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Se).test(t)?"format":"standalone"][e.month()]:a(this._months)?this._months:this._months.standalone},_n.monthsShort=function(e,t){return e?a(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Se.test(t)?"format":"standalone"][e.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},_n.monthsParse=function(e,t,n){var r,a,i;if(this._monthsParseExact)return Pe.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=f([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},_n.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Te.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=Me),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},_n.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Te.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Oe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},_n.week=function(e){return Le(e,this._week.dow,this._week.doy).week},_n.firstDayOfYear=function(){return this._week.doy},_n.firstDayOfWeek=function(){return this._week.dow},_n.weekdays=function(e,t){var n=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?We(n,this._week.dow):e?n[e.day()]:n},_n.weekdaysMin=function(e){return!0===e?We(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},_n.weekdaysShort=function(e){return!0===e?We(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},_n.weekdaysParse=function(e,t,n){var r,a,i;if(this._weekdaysParseExact)return Ue.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=f([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},_n.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Be),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},_n.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=He),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},_n.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=$e),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},_n.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},_n.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},it("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-Infinity,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===U(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=k("moment.lang is deprecated. Use moment.locale instead.",it),r.langData=k("moment.langData is deprecated. Use moment.localeData instead.",st);var On=Math.abs;function Mn(e,t,n,r){var a=zt(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function Pn(e){return e<0?Math.floor(e):Math.ceil(e)}function Cn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Tn(e){return function(){return this.as(e)}}var Rn=Tn("ms"),An=Tn("s"),jn=Tn("m"),Nn=Tn("h"),En=Tn("d"),In=Tn("w"),Ln=Tn("M"),Fn=Tn("Q"),Wn=Tn("y");function zn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vn=zn("milliseconds"),Yn=zn("seconds"),Bn=zn("minutes"),Hn=zn("hours"),$n=zn("days"),Un=zn("months"),qn=zn("years"),Gn=Math.round,Kn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jn(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var Qn=Math.abs;function Zn(e){return(e>0)-(e<0)||+e}function Xn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,a,i,o,s,l=Qn(this._milliseconds)/1e3,u=Qn(this._days),c=Qn(this._months),d=this.asSeconds();return d?(e=$(l/60),t=$(e/60),l%=60,e%=60,n=$(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=d<0?"-":"",i=Zn(this._months)!==Zn(d)?"-":"",o=Zn(this._days)!==Zn(d)?"-":"",s=Zn(this._milliseconds)!==Zn(d)?"-":"",a+"P"+(n?i+n+"Y":"")+(c?i+c+"M":"")+(u?o+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var er=Dt.prototype;return er.isValid=function(){return this._isValid},er.abs=function(){var e=this._data;return this._milliseconds=On(this._milliseconds),this._days=On(this._days),this._months=On(this._months),e.milliseconds=On(e.milliseconds),e.seconds=On(e.seconds),e.minutes=On(e.minutes),e.hours=On(e.hours),e.months=On(e.months),e.years=On(e.years),this},er.add=function(e,t){return Mn(this,e,t,1)},er.subtract=function(e,t){return Mn(this,e,t,-1)},er.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=z(e))||"quarter"===e||"year"===e)switch(n=this._months+Cn(t=this._days+r/864e5),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},er.asMilliseconds=Rn,er.asSeconds=An,er.asMinutes=jn,er.asHours=Nn,er.asDays=En,er.asWeeks=In,er.asMonths=Ln,er.asQuarters=Fn,er.asYears=Wn,er.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*U(this._months/12):NaN},er._bubble=function(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Pn(Dn(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=$(i/1e3),l.seconds=e%60,t=$(e/60),l.minutes=t%60,n=$(t/60),l.hours=n%24,o+=$(n/24),s+=a=$(Cn(o)),o-=Pn(Dn(a)),r=$(s/12),s%=12,l.days=o,l.months=s,l.years=r,this},er.clone=function(){return zt(this)},er.get=function(e){return e=z(e),this.isValid()?this[e+"s"]():NaN},er.milliseconds=Vn,er.seconds=Yn,er.minutes=Bn,er.hours=Hn,er.days=$n,er.weeks=function(){return $(this.days()/7)},er.months=Un,er.years=qn,er.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,a=!1,i=Kn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(a=e),"object"==typeof t&&(i=Object.assign({},Kn,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),r=function(e,t,n,r){var a=zt(e).abs(),i=Gn(a.as("s")),o=Gn(a.as("m")),s=Gn(a.as("h")),l=Gn(a.as("d")),u=Gn(a.as("M")),c=Gn(a.as("w")),d=Gn(a.as("y")),h=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||o<=1&&["m"]||o<n.m&&["mm",o]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(h=h||c<=1&&["w"]||c<n.w&&["ww",c]),(h=h||u<=1&&["M"]||u<n.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=r,Jn.apply(null,h)}(this,!a,i,n=this.localeData()),a&&(r=n.pastFuture(+this,r)),n.postformat(r)},er.toISOString=Xn,er.toString=Xn,er.toJSON=Xn,er.locale=Qt,er.localeData=Xt,er.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xn),er.lang=Zt,E("X",0,0,"unix"),E("x",0,0,"valueOf"),fe("x",ue),fe("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),ye("x",function(e,t,n){n._d=new Date(U(e))}),r.version="2.29.4",t=St,r.fn=bn,r.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},r.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=f,r.unix=function(e){return St(1e3*e)},r.months=function(e,t){return kn(e,t,"months")},r.isDate=c,r.locale=it,r.invalid=m,r.duration=zt,r.isMoment=_,r.weekdays=function(e,t,n){return Sn(e,t,n,"weekdays")},r.parseZone=function(){return St.apply(null,arguments).parseZone()},r.localeData=st,r.isDuration=Tt,r.monthsShort=function(e,t){return kn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return Sn(e,t,n,"weekdaysMin")},r.defineLocale=ot,r.updateLocale=function(e,t){if(null!=t){var n,r,a=Xe;null!=et[e]&&null!=et[e].parentLocale?et[e].set(C(et[e]._config,t)):(null!=(r=at(e))&&(a=r._config),t=C(a,t),null==r&&(t.abbr=e),(n=new D(t)).parentLocale=et[e],et[e]=n),it(e)}else null!=et[e]&&(null!=et[e].parentLocale?(et[e]=et[e].parentLocale,e===it()&&it(e)):null!=et[e]&&delete et[e]);return et[e]},r.locales=function(){return S(et)},r.weekdaysShort=function(e,t,n){return Sn(e,t,n,"weekdaysShort")},r.normalizeUnits=z,r.relativeTimeRounding=function(e){return void 0===e?Gn:"function"==typeof e&&(Gn=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==Kn[e]&&(void 0===t?Kn[e]:(Kn[e]=t,"s"===e&&(Kn.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=bn,r.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"},r}()}),Chart$1=createCommonjsModule(function(e,t){e.exports=function(e){e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(e,n){return function(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[t[r]]=r);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var i in a)if(a.hasOwnProperty(i)){if(!("channels"in a[i]))throw new Error("missing channels property: "+i);if(!("labels"in a[i]))throw new Error("missing channel labels property: "+i);if(a[i].labels.length!==a[i].channels)throw new Error("channel and label counts mismatch: "+i);var o=a[i].channels,s=a[i].labels;delete a[i].channels,delete a[i].labels,Object.defineProperty(a[i],"channels",{value:o}),Object.defineProperty(a[i],"labels",{value:s})}a.rgb.hsl=function(e){var t,n,r=e[0]/255,a=e[1]/255,i=e[2]/255,o=Math.min(r,a,i),s=Math.max(r,a,i),l=s-o;return s===o?t=0:r===s?t=(a-i)/l:a===s?t=2+(i-r)/l:i===s&&(t=4+(r-a)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+s)/2,[t,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(e){var t,n,r,a,i,o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?a=i=0:(i=c/u,t=d(o),n=d(s),r=d(l),o===u?a=r-n:s===u?a=1/3+t-r:l===u&&(a=2/3+n-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*u]},a.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,r))*100,100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},a.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,a=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-a)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-a-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var r=n[e];if(r)return r;var a,i,o,s=Infinity;for(var l in t)if(t.hasOwnProperty(l)){var u=(i=e,o=t[l],Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)+Math.pow(i[2]-o[2],2));u<s&&(s=u,a=l)}return a},a.keyword.rgb=function(e){return t[e]},a.rgb.xyz=function(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(e){var t,n,r,a,i,o=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[i=255*l,i,i];t=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(r=o+1/3*-(u-1))<0&&r++,r>1&&r--,a[u]=255*(i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t);return a},a.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,a=n,i=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,a*=i<=1?i:2-i,[t,100*(0===r?2*a/(i+a):2*n/(r+n)),(r+n)/2*100]},a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,a=Math.floor(t)%6,i=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*i),l=255*r*(1-n*(1-i));switch(r*=255,a){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}},a.hsv.hsl=function(e){var t,n,r,a=e[0],i=e[1]/100,o=e[2]/100,s=Math.max(o,.01);return r=(2-i)*o,n=i*s,[a,100*(n=(n/=(t=(2-i)*s)<=1?t:2-t)||0),100*(r/=2)]},a.hwb.rgb=function(e){var t,n,r,a,i,o,s,l=e[0]/360,u=e[1]/100,c=e[2]/100,d=u+c;switch(d>1&&(u/=d,c/=d),r=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(r=1-r),a=u+r*((n=1-c)-u),t){default:case 6:case 0:i=n,o=a,s=u;break;case 1:i=a,o=n,s=u;break;case 2:i=u,o=n,s=a;break;case 3:i=u,o=a,s=n;break;case 4:i=a,o=u,s=n;break;case 5:i=n,o=u,s=a}return[255*i,255*o,255*s]},a.cmyk.rgb=function(e){var t=e[1]/100,n=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-r)+r)),255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},a.xyz.rgb=function(e){var t,n,r,a=e[0]/100,i=e[1]/100,o=e[2]/100;return n=-.9689*a+1.8758*i+.0415*o,r=.0557*a+-.204*i+1.057*o,t=(t=3.2406*a+-1.5372*i+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(e){var t,n,r;t=e[1]/500+(n=(e[0]+16)/116),r=n-e[2]/200;var a=Math.pow(n,3),i=Math.pow(t,3),o=Math.pow(r,3);return n=a>.008856?a:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},a.lab.lch=function(e){var t,n=e[0],r=e[1],a=e[2];return(t=360*Math.atan2(a,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+a*a),t]},a.lch.lab=function(e){var t,n=e[1];return t=e[2]/360*2*Math.PI,[e[0],n*Math.cos(t),n*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map(function(e){return e+e}).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,a=e[2]/255,i=Math.max(Math.max(n,r),a),o=Math.min(Math.min(n,r),a),s=i-o;return t=s<=0?0:i===n?(r-a)/s%6:i===r?2+(a-n)/s:4+(n-r)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(e){var t,n=e[1]/100,r=e[2]/100,a=0;return(t=r<.5?2*n*r:2*n*(1-r))<1&&(a=(r-.5*t)/(1-t)),[e[0],100*t,100*a]},a.hsv.hcg=function(e){var t=e[2]/100,n=e[1]/100*t,r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},a.hcg.rgb=function(e){var t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];var r,a=[0,0,0],i=e[0]/360%1*6,o=i%1,s=1-o;switch(Math.floor(i)){case 0:a[0]=1,a[1]=o,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=o;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=o,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return[255*(t*a[0]+(r=(1-t)*n)),255*(t*a[1]+r),255*(t*a[2]+r)]},a.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},a.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},a.hwb.hcg=function(e){var t=1-e[2]/100,n=t-e[1]/100,r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}(n={exports:{}}),n.exports}();function r(e,t){return function(n){return t(e(n))}}function a(e,t){for(var a=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;t[o].parent;)a.unshift(t[o].parent),i=r(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=a,i}var i={};Object.keys(n).forEach(function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});var t=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(n),r=t.length,a=0;a<r;a++)e[t[a]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var a=r.pop(),i=Object.keys(n[a]),o=i.length,s=0;s<o;s++){var l=i[s],u=t[l];-1===u.distance&&(u.distance=t[a].distance+1,u.parent=a,r.unshift(l))}return t}(e),r={},i=Object.keys(t),o=i.length,s=0;s<o;s++){var l=i[s];null!==t[l].parent&&(r[l]=a(l,t))}return r}(e);Object.keys(t).forEach(function(n){var r=t[n];i[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var r=n.length,a=0;a<r;a++)n[a]=Math.round(n[a]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(r),i[e][n].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})});var o=i,s={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},l={getRgba:u,getHsla:c,getRgb:function(e){var t=u(e);return t&&t.slice(0,3)},getHsl:function(e){var t=c(e);return t&&t.slice(0,3)},getHwb:d,getAlpha:function(e){var t=u(e);return t||(t=c(e))||(t=d(e))?t[3]:void 0},hexString:function(e,t){return t=void 0!==t&&3===e.length?t:e[3],"#"+m(e[0])+m(e[1])+m(e[2])+(t>=0&&t<1?m(Math.round(255*t)):"")},rgbString:function(e,t){return t<1||e[3]&&e[3]<1?h(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},rgbaString:h,percentString:function(e,t){return t<1||e[3]&&e[3]<1?f(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"},percentaString:f,hslString:function(e,t){return t<1||e[3]&&e[3]<1?p(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"},hslaString:p,hwbString:function(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"},keyword:function(e){return v[e.slice(0,3)]}};function u(e){if(e){var t=[0,0,0],n=1,r=e.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(r){a=(r=r[1])[3];for(var i=0;i<t.length;i++)t[i]=parseInt(r[i]+r[i],16);a&&(n=Math.round(parseInt(a+a,16)/255*100)/100)}else if(r=e.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(a=r[2],r=r[1],i=0;i<t.length;i++)t[i]=parseInt(r.slice(2*i,2*i+2),16);a&&(n=Math.round(parseInt(a,16)/255*100)/100)}else if(r=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(i=0;i<t.length;i++)t[i]=parseInt(r[i+1]);n=parseFloat(r[4])}else if(r=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(i=0;i<t.length;i++)t[i]=Math.round(2.55*parseFloat(r[i+1]));n=parseFloat(r[4])}else if(r=e.match(/(\w+)/)){if("transparent"==r[1])return[0,0,0,0];if(!(t=s[r[1]]))return}for(i=0;i<t.length;i++)t[i]=g(t[i],0,255);return n=n||0==n?g(n,0,1):1,t[3]=n,t}}function c(e){if(e){var t=e.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(n)?1:n,0,1)]}}}function d(e){if(e){var t=e.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(n)?1:n,0,1)]}}}function h(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function f(e,t){return"rgba("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%, "+(t||e[3]||1)+")"}function p(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function g(e,t,n){return Math.min(Math.max(t,e),n)}function m(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var v={};for(var y in s)v[s[y]]=y;var b=function(e){return e instanceof b?e:this instanceof b?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof e?(t=l.getRgba(e))?this.setValues("rgb",t):(t=l.getHsla(e))?this.setValues("hsl",t):(t=l.getHwb(e))&&this.setValues("hwb",t):"object"==typeof e&&(void 0!==(t=e).r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new b(e);var t};b.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e=(e%=360)<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return l.hexString(this.values.rgb)},rgbString:function(){return l.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return l.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return l.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return l.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return l.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return l.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return l.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;n<e.length;n++){var r=e[n]/255;t[n]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,r=e,a=void 0===t?.5:t,i=2*a-1,o=n.alpha()-r.alpha(),s=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*a+r.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new b,r=this.values,a=n.values;for(var i in r)r.hasOwnProperty(i)&&("[object Array]"===(t={}.toString.call(e=r[i]))?a[i]=e.slice(0):"[object Number]"===t?a[i]=e:console.error("unexpected color value:",e));return n}},b.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},b.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},b.prototype.getValues=function(e){for(var t=this.values,n={},r=0;r<e.length;r++)n[e.charAt(r)]=t[e][r];return 1!==t.alpha&&(n.a=t.alpha),n},b.prototype.setValues=function(e,t){var n,r,a=this.values,i=this.spaces,s=this.maxes,l=1;if(this.valid=!0,"alpha"===e)l=t;else if(t.length)a[e]=t.slice(0,e.length),l=t[e.length];else if(void 0!==t[e.charAt(0)]){for(n=0;n<e.length;n++)a[e][n]=t[e.charAt(n)];l=t.a}else if(void 0!==t[i[e][0]]){var u=i[e];for(n=0;n<e.length;n++)a[e][n]=t[u[n]];l=t.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===e)return!1;for(n=0;n<e.length;n++)r=Math.max(0,Math.min(s[e][n],a[e][n])),a[e][n]=Math.round(r);for(var c in i)c!==e&&(a[c]=o[e][c](a[e]));return!0},b.prototype.setSpace=function(e,t){var n=t[0];return void 0===n?this.getValues(e):("number"==typeof n&&(n=Array.prototype.slice.call(t)),this.setValues(e,n),this)},b.prototype.setChannel=function(e,t,n){var r=this.values[e];return void 0===n?r[t]:(n===r[t]||(r[t]=n,this.setValues(e,r)),this)},"undefined"!=typeof window&&(window.Color=b);var x=b;function _(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}var w,k={noop:function(){},uid:(w=0,function(){return w++}),isNullOrUndef:function(e){return null==e},isArray:function(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)},isObject:function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)},isFinite:function(e){return("number"==typeof e||e instanceof Number)&&isFinite(e)},valueOrDefault:function(e,t){return void 0===e?t:e},valueAtIndexOrDefault:function(e,t,n){return k.valueOrDefault(k.isArray(e)?e[t]:e,n)},callback:function(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)},each:function(e,t,n,r){var a,i,o;if(k.isArray(e))if(i=e.length,r)for(a=i-1;a>=0;a--)t.call(n,e[a],a);else for(a=0;a<i;a++)t.call(n,e[a],a);else if(k.isObject(e))for(i=(o=Object.keys(e)).length,a=0;a<i;a++)t.call(n,e[o[a]],o[a])},arrayEquals:function(e,t){var n,r,a,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=t[n],(a=e[n])instanceof Array&&i instanceof Array){if(!k.arrayEquals(a,i))return!1}else if(a!==i)return!1;return!0},clone:function(e){if(k.isArray(e))return e.map(k.clone);if(k.isObject(e)){for(var t=Object.create(e),n=Object.keys(e),r=n.length,a=0;a<r;++a)t[n[a]]=k.clone(e[n[a]]);return t}return e},_merger:function(e,t,n,r){if(_(e)){var a=t[e],i=n[e];k.isObject(a)&&k.isObject(i)?k.merge(a,i,r):t[e]=k.clone(i)}},_mergerIf:function(e,t,n){if(_(e)){var r=t[e],a=n[e];k.isObject(r)&&k.isObject(a)?k.mergeIf(r,a):t.hasOwnProperty(e)||(t[e]=k.clone(a))}},merge:function(e,t,n){var r,a,i,o,s,l=k.isArray(t)?t:[t],u=l.length;if(!k.isObject(e))return e;for(r=(n=n||{}).merger||k._merger,a=0;a<u;++a)if(k.isObject(t=l[a]))for(s=0,o=(i=Object.keys(t)).length;s<o;++s)r(i[s],e,t,n);return e},mergeIf:function(e,t){return k.merge(e,t,{merger:k._mergerIf})},extend:Object.assign||function(e){return k.merge(e,[].slice.call(arguments,1),{merger:function(e,t,n){t[e]=n[e]}})},inherits:function(e){var t=this,n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},r=function(){this.constructor=n};return r.prototype=t.prototype,n.prototype=new r,n.extend=k.inherits,e&&k.extend(n.prototype,e),n.__super__=t.prototype,n},_deprecated:function(e,t,n,r){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+r+'" instead')}},S=k;k.callCallback=k.callback,k.indexOf=function(e,t,n){return Array.prototype.indexOf.call(e,t,n)},k.getValueOrDefault=k.valueOrDefault,k.getValueAtIndexOrDefault=k.valueAtIndexOrDefault;var O={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return 1-Math.cos(e*(Math.PI/2))},easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0;return 0===e?0:1===e?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1),-1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0;return 0===e?0:1===e?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1),1*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0;return 0===e?0:2==(e/=.5)?1:(n||(n=.45),t=n/(2*Math.PI)*Math.asin(1),e<1?1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:1*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-O.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*O.easeInBounce(2*e):.5*O.easeOutBounce(2*e-1)+.5}},M={effects:O};S.easingEffects=O;var P=Math.PI,C=P/180,D=2*P,T=P/2,R=P/4,A=2*P/3,j={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,r,a,i){if(i){var o=Math.min(i,a/2,r/2),s=t+o,l=n+o,u=t+r-o,c=n+a-o;e.moveTo(t,l),s<u&&l<c?(e.arc(s,l,o,-P,-T),e.arc(u,l,o,-T,0),e.arc(u,c,o,0,T),e.arc(s,c,o,T,P)):s<u?(e.moveTo(s,n),e.arc(u,l,o,-T,T),e.arc(s,l,o,T,P+T)):l<c?(e.arc(s,l,o,-P,0),e.arc(s,c,o,0,P)):e.arc(s,l,o,-P,P),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,a)},drawPoint:function(e,t,n,r,a,i){var o,s,l,u,c,d=(i||0)*C;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(o=t.toString())||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(r,a),e.rotate(d),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(n)||n<=0)){switch(e.beginPath(),t){default:e.arc(r,a,n,0,D),e.closePath();break;case"triangle":e.moveTo(r+Math.sin(d)*n,a-Math.cos(d)*n),d+=A,e.lineTo(r+Math.sin(d)*n,a-Math.cos(d)*n),d+=A,e.lineTo(r+Math.sin(d)*n,a-Math.cos(d)*n),e.closePath();break;case"rectRounded":u=n-(c=.516*n),s=Math.cos(d+R)*u,l=Math.sin(d+R)*u,e.arc(r-s,a-l,c,d-P,d-T),e.arc(r+l,a-s,c,d-T,d),e.arc(r+s,a+l,c,d,d+T),e.arc(r-l,a+s,c,d+T,d+P),e.closePath();break;case"rect":if(!i){u=Math.SQRT1_2*n,e.rect(r-u,a-u,2*u,2*u);break}d+=R;case"rectRot":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+l,a-s),e.lineTo(r+s,a+l),e.lineTo(r-l,a+s),e.closePath();break;case"crossRot":d+=R;case"cross":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l),e.moveTo(r+l,a-s),e.lineTo(r-l,a+s);break;case"star":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l),e.moveTo(r+l,a-s),e.lineTo(r-l,a+s),d+=R,s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l),e.moveTo(r+l,a-s),e.lineTo(r-l,a+s);break;case"line":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l);break;case"dash":e.moveTo(r,a),e.lineTo(r+Math.cos(d)*n,a+Math.sin(d)*n)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){var n=1e-6;return e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n},clipArea:function(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()},unclipArea:function(e){e.restore()},lineTo:function(e,t,n,r){var a=n.steppedLine;if(a){if("middle"===a){var i=(t.x+n.x)/2;e.lineTo(i,r?n.y:t.y),e.lineTo(i,r?t.y:n.y)}else"after"===a&&!r||"after"!==a&&r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}else n.tension?e.bezierCurveTo(r?t.controlPointPreviousX:t.controlPointNextX,r?t.controlPointPreviousY:t.controlPointNextY,r?n.controlPointNextX:n.controlPointPreviousX,r?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):e.lineTo(n.x,n.y)}},N=j;S.clear=j.clear,S.drawRoundedRectangle=function(e){e.beginPath(),j.roundedRect.apply(j,arguments)};var E={_set:function(e,t){return S.merge(this[e]||(this[e]={}),t)}};E._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var I=E,L=S.valueOrDefault,F={toLineHeight:function(e,t){var n=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,n,r,a;return S.isObject(e)?(t=+e.top||0,n=+e.right||0,r=+e.bottom||0,a=+e.left||0):t=n=r=a=+e||0,{top:t,right:n,bottom:r,left:a,height:t+r,width:a+n}},_parseFont:function(e){var t=I.global,n=L(e.fontSize,t.defaultFontSize),r={family:L(e.fontFamily,t.defaultFontFamily),lineHeight:S.options.toLineHeight(L(e.lineHeight,t.defaultLineHeight),n),size:n,style:L(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return r.string=function(e){return!e||S.isNullOrUndef(e.size)||S.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(r),r},resolve:function(e,t,n,r){var a,i,o,s=!0;for(a=0,i=e.length;a<i;++a)if(void 0!==(o=e[a])&&(void 0!==t&&"function"==typeof o&&(o=o(t),s=!1),void 0!==n&&S.isArray(o)&&(o=o[n],s=!1),void 0!==o))return r&&!s&&(r.cacheable=!1),o}},W={_factorize:function(e){var t,n=[],r=Math.sqrt(e);for(t=1;t<r;t++)e%t==0&&(n.push(t),n.push(e/t));return r===(0|r)&&n.push(r),n.sort(function(e,t){return e-t}).pop(),n},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,n=Math.round(t);return e===Math.pow(10,n)?n:t}},z=W;S.log10=W.log10;var V=S,Y=N,B=F,H=z;V.easing=M,V.canvas=Y,V.options=B,V.math=H,V.rtl={getRtlAdapter:function(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}},overrideTextDirection:function(e,t){var n,r;"ltr"!==t&&"rtl"!==t||(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)},restoreTextDirection:function(e){var t=e.prevTextDirection;void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}};var $=function(e){V.extend(this,e),this.initialize.apply(this,arguments)};V.extend($.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=V.extend({},e._model)),e._start={},e},transition:function(e){var t=this,n=t._model,r=t._start,a=t._view;return n&&1!==e?(a||(a=t._view={}),r||(r=t._start={}),function(e,t,n,r){var a,i,o,s,l,u,c,d,h,f=Object.keys(n);for(a=0,i=f.length;a<i;++a)if(u=n[o=f[a]],t.hasOwnProperty(o)||(t[o]=u),(s=t[o])!==u&&"_"!==o[0]){if(e.hasOwnProperty(o)||(e[o]=s),(c=typeof u)==typeof(l=e[o]))if("string"===c){if((d=x(l)).valid&&(h=x(u)).valid){t[o]=h.mix(d,r).rgbString();continue}}else if(V.isFinite(l)&&V.isFinite(u)){t[o]=l+(u-l)*r;continue}t[o]=u}}(r,a,n,e),t):(t._view=V.extend({},n),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return V.isNumber(this._model.x)&&V.isNumber(this._model.y)}}),$.extend=V.inherits;var U=$,q=U.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),G=q;Object.defineProperty(q.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(q.prototype,"chartInstance",{get:function(){return this.chart},set:function(e){this.chart=e}}),I._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:V.noop,onComplete:V.noop}});var K={animations:[],request:null,addAnimation:function(e,t,n,r){var a,i,o=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=n,r||(e.animating=!0),a=0,i=o.length;a<i;++a)if(o[a].chart===e)return void(o[a]=t);o.push(t),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(e){var t=V.findIndex(this.animations,function(t){return t.chart===e});-1!==t&&(this.animations.splice(t,1),e.animating=!1)},requestAnimationFrame:function(){var e=this;null===e.request&&(e.request=V.requestAnimFrame.call(window,function(){e.request=null,e.startDigest()}))},startDigest:function(){var e=this;e.advance(),e.animations.length>0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,r,a=this.animations,i=0;i<a.length;)t=(e=a[i]).chart,n=e.numSteps,r=Math.floor((Date.now()-e.startTime)/e.duration*n)+1,e.currentStep=Math.min(r,n),V.callback(e.render,[t,e],t),V.callback(e.onAnimationProgress,[e],t),e.currentStep>=n?(V.callback(e.onAnimationComplete,[e],t),t.animating=!1,a.splice(i,1)):++i}},J=V.options.resolve,Q=["push","pop","shift","splice","unshift"];function Z(e,t){var n=e._chartjs;if(n){var r=n.listeners,a=r.indexOf(t);-1!==a&&r.splice(a,1),r.length>0||(Q.forEach(function(t){delete e[t]}),delete e._chartjs)}}var X=function(e,t){this.initialize(e,t)};V.extend(X.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,r=n.scales,a=e.getDataset(),i=n.options.scales;null!==t.xAxisID&&t.xAxisID in r&&!a.xAxisID||(t.xAxisID=a.xAxisID||i.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in r&&!a.yAxisID||(t.yAxisID=a.yAxisID||i.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&Z(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,r=n.getMeta(),a=n.getDataset().data||[],i=r.data;for(e=0,t=a.length;e<t;++e)i[e]=i[e]||n.createMetaData(e);r.dataset=r.dataset||n.createMetaDataset()},addElementAndReset:function(e){var t=this.createMetaData(e);this.getMeta().data.splice(e,0,t),this.updateElement(t,e,!0)},buildOrUpdateElements:function(){var e,t,n=this,r=n.getDataset(),a=r.data||(r.data=[]);n._data!==a&&(n._data&&Z(n._data,n),a&&Object.isExtensible(a)&&(t=n,(e=a)._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Q.forEach(function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),a=r.apply(this,t);return V.each(e._chartjs.listeners,function(e){"function"==typeof e[n]&&e[n].apply(e,t)}),a}})}))),n._data=a),n.resyncElements()},_configure:function(){var e=this;e._config=V.merge(Object.create(null),[e.chart.options.datasets[e._type],e.getDataset()],{merger:function(e,t,n){"_meta"!==e&&"data"!==e&&V._merger(e,t,n)}})},_update:function(e){var t=this;t._configure(),t._cachedDataOpts=null,t.update(e)},update:V.noop,transition:function(e){for(var t=this.getMeta(),n=t.data||[],r=n.length,a=0;a<r;++a)n[a].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],n=t.length,r=0;for(e.dataset&&e.dataset.draw();r<n;++r)t[r].draw()},getStyle:function(e){var t,n=this,r=n.getMeta(),a=r.dataset;return n._configure(),!1!==(t=a&&void 0===e?n._resolveDatasetElementOptions(a||{}):n._resolveDataElementOptions(r.data[e=e||0]||{},e)).fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var n,r,a,i,o=this,s=o.chart,l=o._config,u=e.custom||{},c=s.options.elements[o.datasetElementType.prototype._type]||{},d=o._datasetElementOptions,h={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:t};for(n=0,r=d.length;n<r;++n)a=d[n],i=t?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,h[a]=J([u[i],l[i],c[i]],f);return h},_resolveDataElementOptions:function(e,t){var n=this,r=e&&e.custom,a=n._cachedDataOpts;if(a&&!r)return a;var i,o,s,l,u=n.chart,c=n._config,d=u.options.elements[n.dataElementType.prototype._type]||{},h=n._dataElementOptions,f={},p={chart:u,dataIndex:t,dataset:n.getDataset(),datasetIndex:n.index},g={cacheable:!r};if(r=r||{},V.isArray(h))for(o=0,s=h.length;o<s;++o)f[l=h[o]]=J([r[l],c[l],d[l]],p,t,g);else for(o=0,s=(i=Object.keys(h)).length;o<s;++o)f[l=i[o]]=J([r[l],c[h[l]],c[l],d[l]],p,t,g);return g.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(e){V.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],n=e._index,r=e.custom||{},a=e._model,i=V.getHoverColor;e.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=J([r.hoverBackgroundColor,t.hoverBackgroundColor,i(a.backgroundColor)],void 0,n),a.borderColor=J([r.hoverBorderColor,t.hoverBorderColor,i(a.borderColor)],void 0,n),a.borderWidth=J([r.hoverBorderWidth,t.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,n,r,a,i,o=this.getMeta().dataset,s={};if(o){for(i=o._model,a=this._resolveDatasetElementOptions(o,!0),e=0,t=(r=Object.keys(a)).length;e<t;++e)s[n=r[e]]=i[n],i[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var e=this,t=e.getMeta(),n=e.getDataset().data,r=t.data.length,a=n.length;a<r?t.data.splice(a,r-a):a>r&&e.insertElements(r,a-r)},insertElements:function(e,t){for(var n=0;n<t;++n)this.addElementAndReset(e+n)},onDataPush:function(){var e=arguments.length;this.insertElements(this.getDataset().data.length-e,e)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(e,t){this.getMeta().data.splice(e,t),this.insertElements(e,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),X.extend=V.inherits;var ee=X,te=2*Math.PI;function ne(e,t){var n=t.startAngle,r=t.endAngle,a=t.pixelMargin,i=a/t.outerRadius,o=t.x,s=t.y;e.beginPath(),e.arc(o,s,t.outerRadius,n-i,r+i),t.innerRadius>a?e.arc(o,s,t.innerRadius-a,r+(i=a/t.innerRadius),n-i,!0):e.arc(o,s,a,r+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}I._set("global",{elements:{arc:{backgroundColor:I.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var re=U.extend({_type:"arc",inLabelRange:function(e){var t=this._view;return!!t&&Math.pow(e-t.x,2)<Math.pow(t.radius+t.hoverRadius,2)},inRange:function(e,t){var n=this._view;if(n){for(var r=V.getAngleFromPoint(n,{x:e,y:t}),a=r.angle,i=r.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=te;for(;a>s;)a-=te;for(;a<o;)a+=te;return a>=o&&a<=s&&i>=n.innerRadius&&i<=n.outerRadius}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,r="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-r,0),pixelMargin:r,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/te)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+te,t.beginPath(),t.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),t.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),t.closePath(),e=0;e<a.fullCircles;++e)t.fill();a.endAngle=a.startAngle+n.circumference%te}t.beginPath(),t.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),t.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),t.closePath(),t.fill(),n.borderWidth&&function(e,t,n){var r="inner"===t.borderAlign;r?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&function(e,t,n,r){var a,i=n.endAngle;for(r&&(n.endAngle=n.startAngle+te,ne(e,n),n.endAngle=i,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=te,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+te,n.startAngle,!0),a=0;a<n.fullCircles;++a)e.stroke();for(e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.startAngle+te),a=0;a<n.fullCircles;++a)e.stroke()}(e,t,n,r),r&&ne(e,n),e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.endAngle),e.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),e.closePath(),e.stroke()}(t,n,a),t.restore()}}),ae=V.valueOrDefault,ie=I.global.defaultColor;I._set("global",{elements:{line:{tension:.4,backgroundColor:ie,borderWidth:3,borderColor:ie,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var oe=U.extend({_type:"line",draw:function(){var e,t,n,r=this,a=r._view,i=r._chart.ctx,o=a.spanGaps,s=r._children.slice(),l=I.global,u=l.elements.line,c=-1,d=r._loop;if(s.length){if(r._loop){for(e=0;e<s.length;++e)if(t=V.previousItem(s,e),!s[e]._view.skip&&t._view.skip){s=s.slice(e).concat(s.slice(0,e)),d=o;break}d&&s.push(s[0])}for(i.save(),i.lineCap=a.borderCapStyle||u.borderCapStyle,i.setLineDash&&i.setLineDash(a.borderDash||u.borderDash),i.lineDashOffset=ae(a.borderDashOffset,u.borderDashOffset),i.lineJoin=a.borderJoinStyle||u.borderJoinStyle,i.lineWidth=ae(a.borderWidth,u.borderWidth),i.strokeStyle=a.borderColor||l.defaultColor,i.beginPath(),(n=s[0]._view).skip||(i.moveTo(n.x,n.y),c=0),e=1;e<s.length;++e)n=s[e]._view,t=-1===c?V.previousItem(s,e):s[c],n.skip||(c!==e-1&&!o||-1===c?i.moveTo(n.x,n.y):V.canvas.lineTo(i,t._view,n),c=e);d&&i.closePath(),i.stroke(),i.restore()}}}),se=V.valueOrDefault,le=I.global.defaultColor;function ue(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}I._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:le,borderColor:le,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ce=U.extend({_type:"point",inRange:function(e,t){var n=this._view;return!!n&&Math.pow(e-n.x,2)+Math.pow(t-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:ue,inXRange:ue,inYRange:function(e){var t=this._view;return!!t&&Math.abs(e-t.y)<t.radius+t.hitRadius},getCenterPoint:function(){var e=this._view;return{x:e.x,y:e.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y,padding:e.radius+e.borderWidth}},draw:function(e){var t=this._view,n=this._chart.ctx,r=t.pointStyle,a=t.rotation,i=t.radius,o=t.x,s=t.y,l=I.global,u=l.defaultColor;t.skip||(void 0===e||V.canvas._isPointInArea(t,e))&&(n.strokeStyle=t.borderColor||u,n.lineWidth=se(t.borderWidth,l.elements.point.borderWidth),n.fillStyle=t.backgroundColor||u,V.canvas.drawPoint(n,r,i,o,s,a))}}),de=I.global.defaultColor;function he(e){return e&&void 0!==e.width}function fe(e){var t,n,r,a,i;return he(e)?(t=e.x-(i=e.width/2),n=e.x+i,r=Math.min(e.y,e.base),a=Math.max(e.y,e.base)):(i=e.height/2,t=Math.min(e.x,e.base),n=Math.max(e.x,e.base),r=e.y-i,a=e.y+i),{left:t,top:r,right:n,bottom:a}}function pe(e,t,n){return e===t?n:e===n?t:e}function ge(e,t,n){var r=null===t,a=null===n,i=!(!e||r&&a)&&fe(e);return i&&(r||t>=i.left&&t<=i.right)&&(a||n>=i.top&&n<=i.bottom)}I._set("global",{elements:{rectangle:{backgroundColor:de,borderColor:de,borderSkipped:"bottom",borderWidth:0}}});var me=U.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=function(e){var t=fe(e),n=t.right-t.left,r=t.bottom-t.top,a=function(e,t,n){var r,a,i,o,s=e.borderWidth,l=function(e){var t=e.borderSkipped,n={};return t?(e.horizontal?e.base>e.x&&(t=pe(t,"left","right")):e.base<e.y&&(t=pe(t,"bottom","top")),n[t]=!0,n):n}(e);return V.isObject(s)?(r=+s.top||0,a=+s.right||0,i=+s.bottom||0,o=+s.left||0):r=a=i=o=+s||0,{t:l.top||r<0?0:r>n?n:r,r:l.right||a<0?0:a>t?t:a,b:l.bottom||i<0?0:i>n?n:i,l:l.left||o<0?0:o>t?t:o}}(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b}}}(t),r=n.outer,a=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(r.x,r.y,r.w,r.h),r.w===a.w&&r.h===a.h||(e.save(),e.beginPath(),e.rect(r.x,r.y,r.w,r.h),e.clip(),e.fillStyle=t.borderColor,e.rect(a.x,a.y,a.w,a.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return ge(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return he(n)?ge(n,e,null):ge(n,null,t)},inXRange:function(e){return ge(this._view,e,null)},inYRange:function(e){return ge(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return he(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return he(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),ve={},ye=oe,be=ce,xe=me;ve.Arc=re,ve.Line=ye,ve.Point=be,ve.Rectangle=xe;var _e=V._deprecated,we=V.valueOrDefault;I._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),I._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var ke=ee.extend({dataElementType:ve.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,n=this;ee.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0,t=n._getIndexScale().options,_e("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),_e("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),_e("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),_e("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),_e("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,n,r=this,a=r.getMeta().data;for(r._ruler=r.getRuler(),t=0,n=a.length;t<n;++t)r.updateElement(a[t],t,e)},updateElement:function(e,t,n){var r=this,a=r.getMeta(),i=r.getDataset(),o=r._resolveDataElementOptions(e,t);e._xScale=r.getScaleForId(a.xAxisID),e._yScale=r.getScaleForId(a.yAxisID),e._datasetIndex=r.index,e._index=t,e._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:i.label,label:r.chart.data.labels[t]},V.isArray(i.data[t])&&(e._model.borderSkipped=null),r._updateElementGeometry(e,t,n,o),e.pivot()},_updateElementGeometry:function(e,t,n,r){var a=this,i=e._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),c=a.calculateBarValuePixels(a.index,t,r),d=a.calculateBarIndexPixels(a.index,t,u,r);i.horizontal=l,i.base=n?s:c.base,i.x=l?n?s:c.head:d.center,i.y=l?d.center:n?s:c.head,i.height=l?d.size:void 0,i.width=l?void 0:d.size},_getStacks:function(e){var t,n,r=this._getIndexScale(),a=r._getMatchingVisibleMetas(this._type),i=r.options.stacked,o=a.length,s=[];for(t=0;t<o&&(n=a[t],(!1===i||-1===s.indexOf(n.stack)||void 0===i&&void 0===n.stack)&&s.push(n.stack),n.index!==e);++t);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var n=this._getStacks(e),r=void 0!==t?n.indexOf(t):-1;return-1===r?n.length-1:r},getRuler:function(){var e,t,n=this,r=n._getIndexScale(),a=[];for(e=0,t=n.getMeta().data.length;e<t;++e)a.push(r.getPixelForValue(null,e,n.index));return{pixels:a,start:r._startPixel,end:r._endPixel,stackCount:n.getStackCount(),scale:r}},calculateBarValuePixels:function(e,t,n){var r,a,i,o,s,l,u,c=this,d=c.chart,h=c._getValueScale(),f=h.isHorizontal(),p=d.data.datasets,g=h._getMatchingVisibleMetas(c._type),m=h._parseValue(p[e].data[t]),v=n.minBarLength,y=h.options.stacked,b=c.getMeta().stack,x=void 0===m.start?0:m.max>=0&&m.min>=0?m.min:m.max,_=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,w=g.length;if(y||void 0===y&&void 0!==b)for(r=0;r<w&&(a=g[r]).index!==e;++r)a.stack===b&&(i=void 0===(u=h._parseValue(p[a.index].data[t])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&i<0||m.max>=0&&i>0)&&(x+=i));return o=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+_))-o,void 0!==v&&Math.abs(l)<v&&(l=v,s=_>=0&&!f||_<0&&f?o-v:o+v),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,n,r){var a="flex"===r.barThickness?function(e,t,n){var r,a=t.pixels,i=a[e],o=e>0?a[e-1]:null,s=e<a.length-1?a[e+1]:null,l=n.categoryPercentage;return null===o&&(o=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-o),r=i-(i-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/t.stackCount,ratio:n.barPercentage,start:r}}(t,n,r):function(e,t,n){var r,a,i=n.barThickness,o=t.stackCount,s=t.pixels[e],l=V.isNullOrUndef(i)?function(e,t){var n,r,a,i,o=e._length;for(a=1,i=t.length;a<i;++a)o=Math.min(o,Math.abs(t[a]-t[a-1]));for(a=0,i=e.getTicks().length;a<i;++a)r=e.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(r-n)):o,n=r;return o}(t.scale,t.pixels):-1;return V.isNullOrUndef(i)?(r=l*n.categoryPercentage,a=n.barPercentage):(r=i*o,a=1),{chunk:r/o,ratio:a,start:s-r/2}}(t,n,r),i=this.getStackIndex(e,this.getMeta().stack),o=a.start+a.chunk*i+a.chunk/2,s=Math.min(we(r.maxBarThickness,Infinity),a.chunk*a.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),r=e.getMeta().data,a=e.getDataset(),i=r.length,o=0;for(V.canvas.clipArea(t.ctx,t.chartArea);o<i;++o){var s=n._parseValue(a.data[o]);isNaN(s.min)||isNaN(s.max)||r[o].draw()}V.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var e=this,t=V.extend({},ee.prototype._resolveDataElementOptions.apply(e,arguments)),n=e._getIndexScale().options,r=e._getValueScale().options;return t.barPercentage=we(n.barPercentage,t.barPercentage),t.barThickness=we(n.barThickness,t.barThickness),t.categoryPercentage=we(n.categoryPercentage,t.categoryPercentage),t.maxBarThickness=we(n.maxBarThickness,t.maxBarThickness),t.minBarLength=we(r.minBarLength,t.minBarLength),t}}),Se=V.valueOrDefault,Oe=V.options.resolve;I._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return(t.datasets[e.datasetIndex].label||"")+": ("+e.xLabel+", "+e.yLabel+", "+t.datasets[e.datasetIndex].data[e.index].r+")"}}}});var Me=ee.extend({dataElementType:ve.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,n=t.getMeta();V.each(n.data,function(n,r){t.updateElement(n,r,e)})},updateElement:function(e,t,n){var r=this,a=r.getMeta(),i=e.custom||{},o=r.getScaleForId(a.xAxisID),s=r.getScaleForId(a.yAxisID),l=r._resolveDataElementOptions(e,t),u=r.getDataset().data[t],c=r.index,d=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,t,c),h=n?s.getBasePixel():s.getPixelForValue(u,t,c);e._xScale=o,e._yScale=s,e._options=l,e._datasetIndex=c,e._index=t,e._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:i.skip||isNaN(d)||isNaN(h),x:d,y:h},e.pivot()},setHoverStyle:function(e){var t=e._model,n=e._options,r=V.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Se(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=Se(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=Se(n.hoverBorderWidth,n.borderWidth),t.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(e,t){var n=this,r=n.chart,a=n.getDataset(),i=e.custom||{},o=a.data[t]||{},s=ee.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:r,dataIndex:t,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=V.extend({},s)),s.radius=Oe([i.radius,o.r,n._config.radius,r.options.elements.point.radius],l,t),s}}),Pe=V.valueOrDefault,Ce=Math.PI,De=2*Ce,Te=Ce/2;I._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,n,r,a=document.createElement("ul"),i=e.data,o=i.datasets,s=i.labels;if(a.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(r=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&r.appendChild(document.createTextNode(s[t]));return a.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,r){var a=e.getDatasetMeta(0),i=a.controller.getStyle(r);return{text:n,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[r])||a.data[r].hidden,index:r}}):[]}},onClick:function(e,t){var n,r,a,i=t.index,o=this.chart;for(n=0,r=(o.data.datasets||[]).length;n<r;++n)(a=o.getDatasetMeta(n)).data[i]&&(a.data[i].hidden=!a.data[i].hidden);o.update()}},cutoutPercentage:50,rotation:-Te,circumference:De,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var n=t.labels[e.index],r=": "+t.datasets[e.datasetIndex].data[e.index];return V.isArray(n)?(n=n.slice())[0]+=r:n+=r,n}}}});var Re=ee.extend({dataElementType:ve.Arc,linkScales:V.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&++t;return t},update:function(e){var t,n,r=this,a=r.chart,i=a.chartArea,o=a.options,s=1,l=1,u=0,c=0,d=r.getMeta(),h=d.data,f=o.cutoutPercentage/100||0,p=o.circumference,g=r._getRingWeight(r.index);if(p<De){var m=o.rotation%De,v=(m+=m>=Ce?-De:m<-Ce?De:0)+p,y=Math.cos(m),b=Math.sin(m),x=Math.cos(v),_=Math.sin(v),w=m<=0&&v>=0||v>=De,k=m<=Te&&v>=Te||v>=De+Te,S=m<=-Te&&v>=-Te||v>=Ce+Te,O=m===-Ce||v>=Ce?-1:Math.min(y,y*f,x,x*f),M=S?-1:Math.min(b,b*f,_,_*f),P=w?1:Math.max(y,y*f,x,x*f),C=k?1:Math.max(b,b*f,_,_*f);s=(P-O)/2,l=(C-M)/2,u=-(P+O)/2,c=-(C+M)/2}for(t=0,n=h.length;t<n;++t)h[t]._options=r._resolveDataElementOptions(h[t],t);for(a.borderWidth=r.getMaxBorderWidth(),a.outerRadius=Math.max(Math.min((i.right-i.left-a.borderWidth)/s,(i.bottom-i.top-a.borderWidth)/l)/2,0),a.innerRadius=Math.max(a.outerRadius*f,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(r._getVisibleDatasetWeightTotal()||1),a.offsetX=u*a.outerRadius,a.offsetY=c*a.outerRadius,d.total=r.calculateTotal(),r.outerRadius=a.outerRadius-a.radiusLength*r._getRingWeightOffset(r.index),r.innerRadius=Math.max(r.outerRadius-a.radiusLength*g,0),t=0,n=h.length;t<n;++t)r.updateElement(h[t],t,e)},updateElement:function(e,t,n){var r=this,a=r.chart,i=a.chartArea,o=a.options,s=o.animation,l=(i.left+i.right)/2,u=(i.top+i.bottom)/2,c=o.rotation,d=o.rotation,h=r.getDataset(),f=n&&s.animateRotate||e.hidden?0:r.calculateCircumference(h.data[t])*(o.circumference/De),p=e._options||{};V.extend(e,{_datasetIndex:r.index,_index:t,_model:{backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,borderAlign:p.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:c,endAngle:d,circumference:f,outerRadius:n&&s.animateScale?0:r.outerRadius,innerRadius:n&&s.animateScale?0:r.innerRadius,label:V.valueAtIndexOrDefault(h.label,t,a.data.labels[t])}});var g=e._model;n&&s.animateRotate||(g.startAngle=0===t?o.rotation:r.getMeta().data[t-1]._model.endAngle,g.endAngle=g.startAngle+g.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),n=this.getMeta(),r=0;return V.each(n.data,function(n,a){e=t.data[a],isNaN(e)||n.hidden||(r+=Math.abs(e))}),r},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?De*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,r,a,i,o,s,l,u=0,c=this.chart;if(!e)for(t=0,n=c.data.datasets.length;t<n;++t)if(c.isDatasetVisible(t)){e=(r=c.getDatasetMeta(t)).data,t!==this.index&&(i=r.controller);break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)a=e[t],i?(i._configure(),o=i._resolveDataElementOptions(a,t)):o=a._options,"inner"!==o.borderAlign&&(u=(l=o.hoverBorderWidth)>(u=(s=o.borderWidth)>u?s:u)?l:u);return u},setHoverStyle:function(e){var t=e._model,n=e._options,r=V.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Pe(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=Pe(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=Pe(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t},_getRingWeight:function(e){return Math.max(Pe(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});I._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),I._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ae=ke.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),je=V.valueOrDefault,Ne=V.options.resolve,Ee=V.canvas._isPointInArea;function Ie(e,t){var n=e&&e.options.ticks||{},r=n.reverse,a=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:a,end:r?a:i}}function Le(e,t,n){var r=n/2,a=Ie(e,r),i=Ie(t,r);return{top:i.end,right:a.end,bottom:i.start,left:a.start}}function Fe(e){var t,n,r,a;return V.isObject(e)?(t=e.top,n=e.right,r=e.bottom,a=e.left):t=n=r=a=e,{top:t,right:n,bottom:r,left:a}}I._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var We=ee.extend({datasetElementType:ve.Line,dataElementType:ve.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(e){var t,n,r=this,a=r.getMeta(),i=a.dataset,o=a.data||[],s=r._config,l=r._showLine=je(s.showLine,r.chart.options.showLines);for(r._xScale=r.getScaleForId(a.xAxisID),r._yScale=r.getScaleForId(a.yAxisID),l&&(void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),i._scale=r._yScale,i._datasetIndex=r.index,i._children=o,i._model=r._resolveDatasetElementOptions(i),i.pivot()),t=0,n=o.length;t<n;++t)r.updateElement(o[t],t,e);for(l&&0!==i._model.tension&&r.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var r,a,i=this,o=i.getMeta(),s=e.custom||{},l=i.getDataset(),u=i.index,c=l.data[t],d=i._xScale,h=i._yScale,f=o.dataset._model,p=i._resolveDataElementOptions(e,t);r=d.getPixelForValue("object"==typeof c?c:NaN,t,u),a=n?h.getBasePixel():i.calculatePointY(c,t,u),e._xScale=d,e._yScale=h,e._options=p,e._datasetIndex=u,e._index=t,e._model={x:r,y:a,skip:s.skip||isNaN(r)||isNaN(a),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:je(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(e){var t=this,n=t._config,r=e.custom||{},a=t.chart.options,i=a.elements.line,o=ee.prototype._resolveDatasetElementOptions.apply(t,arguments);return o.spanGaps=je(n.spanGaps,a.spanGaps),o.tension=je(n.lineTension,i.tension),o.steppedLine=Ne([r.steppedLine,n.steppedLine,i.stepped]),o.clip=Fe(je(n.clip,Le(t._xScale,t._yScale,o.borderWidth))),o},calculatePointY:function(e,t,n){var r,a,i,o,s,l,u=this.chart,c=this._yScale,d=0,h=0;if(c.options.stacked){for(o=+c.getRightValue(e),l=(s=u._getSortedVisibleDatasetMetas()).length,r=0;r<l&&(a=s[r]).index!==n;++r)"line"===a.type&&a.yAxisID===c.id&&((i=+c.getRightValue(u.data.datasets[a.index].data[t]))<0?h+=i||0:d+=i||0);return c.getPixelForValue(o<0?h+o:d+o)}return c.getPixelForValue(e)},updateBezierControlPoints:function(){var e,t,n,r,a=this.chart,i=this.getMeta(),o=i.dataset._model,s=a.chartArea,l=i.data||[];function u(e,t,n){return Math.max(Math.min(e,n),t)}if(o.spanGaps&&(l=l.filter(function(e){return!e._model.skip})),"monotone"===o.cubicInterpolationMode)V.splineCurveMonotone(l);else for(e=0,t=l.length;e<t;++e)n=l[e]._model,r=V.splineCurve(V.previousItem(l,e)._model,n,V.nextItem(l,e)._model,o.tension),n.controlPointPreviousX=r.previous.x,n.controlPointPreviousY=r.previous.y,n.controlPointNextX=r.next.x,n.controlPointNextY=r.next.y;if(a.options.elements.line.capBezierPoints)for(e=0,t=l.length;e<t;++e)Ee(n=l[e]._model,s)&&(e>0&&Ee(l[e-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),e<l.length-1&&Ee(l[e+1]._model,s)&&(n.controlPointNextX=u(n.controlPointNextX,s.left,s.right),n.controlPointNextY=u(n.controlPointNextY,s.top,s.bottom)))},draw:function(){var e,t=this,n=t.chart,r=t.getMeta(),a=r.data||[],i=n.chartArea,o=n.canvas,s=0,l=a.length;for(t._showLine&&(V.canvas.clipArea(n.ctx,{left:!1===(e=r.dataset._model.clip).left?0:i.left-e.left,right:!1===e.right?o.width:i.right+e.right,top:!1===e.top?0:i.top-e.top,bottom:!1===e.bottom?o.height:i.bottom+e.bottom}),r.dataset.draw(),V.canvas.unclipArea(n.ctx));s<l;++s)a[s].draw(i)},setHoverStyle:function(e){var t=e._model,n=e._options,r=V.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=je(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=je(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=je(n.hoverBorderWidth,n.borderWidth),t.radius=je(n.hoverRadius,n.radius)}}),ze=V.options.resolve;I._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(e){var t,n,r,a=document.createElement("ul"),i=e.data,o=i.datasets,s=i.labels;if(a.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(r=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&r.appendChild(document.createTextNode(s[t]));return a.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,r){var a=e.getDatasetMeta(0),i=a.controller.getStyle(r);return{text:n,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[r])||a.data[r].hidden,index:r}}):[]}},onClick:function(e,t){var n,r,a,i=t.index,o=this.chart;for(n=0,r=(o.data.datasets||[]).length;n<r;++n)(a=o.getDatasetMeta(n)).data[i].hidden=!a.data[i].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return t.labels[e.index]+": "+e.yLabel}}}});var Ve=ee.extend({dataElementType:ve.Arc,linkScales:V.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,r,a=this,i=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],c=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),t=0,n=i.data.length;t<n;t++)l[t]=s,r=a._computeAngle(t),u[t]=r,s+=r;for(t=0,n=c.length;t<n;++t)c[t]._options=a._resolveDataElementOptions(c[t],t),a.updateElement(c[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,n=t.chartArea,r=t.options,a=Math.min(n.right-n.left,n.bottom-n.top);t.outerRadius=Math.max(a/2,0),t.innerRadius=Math.max(r.cutoutPercentage?t.outerRadius/100*r.cutoutPercentage:1,0),t.radiusLength=(t.outerRadius-t.innerRadius)/t.getVisibleDatasetCount(),e.outerRadius=t.outerRadius-t.radiusLength*e.index,e.innerRadius=e.outerRadius-t.radiusLength},updateElement:function(e,t,n){var r=this,a=r.chart,i=r.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,c=l.xCenter,d=l.yCenter,h=o.startAngle,f=e.hidden?0:l.getDistanceFromCenterForValue(i.data[t]),p=r._starts[t],g=p+(e.hidden?0:r._angles[t]),m=s.animateScale?0:l.getDistanceFromCenterForValue(i.data[t]),v=e._options||{};V.extend(e,{_datasetIndex:r.index,_index:t,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:c,y:d,innerRadius:0,outerRadius:n?m:f,startAngle:n&&s.animateRotate?h:p,endAngle:n&&s.animateRotate?h:g,label:V.valueAtIndexOrDefault(u,t,u[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),n=0;return V.each(t.data,function(t,r){isNaN(e.data[r])||t.hidden||n++}),n},setHoverStyle:function(e){var t=e._model,n=e._options,r=V.getHoverColor,a=V.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=a(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=a(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(e){var t=this,n=this.getMeta().count,r=t.getDataset(),a=t.getMeta();return isNaN(r.data[e])||a.data[e].hidden?0:ze([t.chart.options.elements.arc.angle,2*Math.PI/n],{chart:t.chart,dataIndex:e,dataset:r,datasetIndex:t.index},e)}});I._set("pie",V.clone(I.doughnut)),I._set("pie",{cutoutPercentage:0});var Ye=Re,Be=V.valueOrDefault;I._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var He=ee.extend({datasetElementType:ve.Line,dataElementType:ve.Point,linkScales:V.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,r=this,a=r.getMeta(),i=a.dataset,o=a.data||[],s=r.chart.scale,l=r._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),i._scale=s,i._datasetIndex=r.index,i._children=o,i._loop=!0,i._model=r._resolveDatasetElementOptions(i),i.pivot(),t=0,n=o.length;t<n;++t)r.updateElement(o[t],t,e);for(r.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var r=this,a=e.custom||{},i=r.getDataset(),o=r.chart.scale,s=o.getPointPositionForValue(t,i.data[t]),l=r._resolveDataElementOptions(e,t),u=r.getMeta().dataset._model,c=n?o.xCenter:s.x,d=n?o.yCenter:s.y;e._scale=o,e._options=l,e._datasetIndex=r.index,e._index=t,e._model={x:c,y:d,skip:a.skip||isNaN(c)||isNaN(d),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Be(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,n=e.chart.options,r=ee.prototype._resolveDatasetElementOptions.apply(e,arguments);return r.spanGaps=Be(t.spanGaps,n.spanGaps),r.tension=Be(t.lineTension,n.elements.line.tension),r},updateBezierControlPoints:function(){var e,t,n,r,a=this.getMeta(),i=this.chart.chartArea,o=a.data||[];function s(e,t,n){return Math.max(Math.min(e,n),t)}for(a.dataset._model.spanGaps&&(o=o.filter(function(e){return!e._model.skip})),e=0,t=o.length;e<t;++e)n=o[e]._model,r=V.splineCurve(V.previousItem(o,e,!0)._model,n,V.nextItem(o,e,!0)._model,n.tension),n.controlPointPreviousX=s(r.previous.x,i.left,i.right),n.controlPointPreviousY=s(r.previous.y,i.top,i.bottom),n.controlPointNextX=s(r.next.x,i.left,i.right),n.controlPointNextY=s(r.next.y,i.top,i.bottom)},setHoverStyle:function(e){var t=e._model,n=e._options,r=V.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Be(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=Be(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=Be(n.hoverBorderWidth,n.borderWidth),t.radius=Be(n.hoverRadius,n.radius)}});I._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(e){return"("+e.xLabel+", "+e.yLabel+")"}}}}),I._set("global",{datasets:{scatter:{showLine:!1}}});var $e={bar:ke,bubble:Me,doughnut:Re,horizontalBar:Ae,line:We,polarArea:Ve,pie:Ye,radar:He,scatter:We};function Ue(e,t){return e.native?{x:e.x,y:e.y}:V.getRelativePosition(e,t)}function qe(e,t){var n,r,a,i,o,s,l=e._getSortedVisibleDatasetMetas();for(r=0,i=l.length;r<i;++r)for(a=0,o=(n=l[r].data).length;a<o;++a)(s=n[a])._view.skip||t(s)}function Ge(e,t){var n=[];return qe(e,function(e){e.inRange(t.x,t.y)&&n.push(e)}),n}function Ke(e,t,n,r){var a=Number.POSITIVE_INFINITY,i=[];return qe(e,function(e){if(!n||e.inRange(t.x,t.y)){var o=e.getCenterPoint(),s=r(t,o);s<a?(i=[e],a=s):s===a&&i.push(e)}}),i}function Je(e){var t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){var a=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(i,2))}}function Qe(e,t,n){var r=Ue(t,e);n.axis=n.axis||"x";var a=Je(n.axis),i=n.intersect?Ge(e,r):Ke(e,r,!1,a),o=[];return i.length?(e._getSortedVisibleDatasetMetas().forEach(function(e){var t=e.data[i[0]._index];t&&!t._view.skip&&o.push(t)}),o):[]}var Ze={modes:{single:function(e,t){var n=Ue(t,e),r=[];return qe(e,function(e){if(e.inRange(n.x,n.y))return r.push(e),r}),r.slice(0,1)},label:Qe,index:Qe,dataset:function(e,t,n){var r=Ue(t,e);n.axis=n.axis||"xy";var a=Je(n.axis),i=n.intersect?Ge(e,r):Ke(e,r,!1,a);return i.length>0&&(i=e.getDatasetMeta(i[0]._datasetIndex).data),i},"x-axis":function(e,t){return Qe(e,t,{intersect:!1})},point:function(e,t){return Ge(e,Ue(t,e))},nearest:function(e,t,n){var r=Ue(t,e);n.axis=n.axis||"xy";var a=Je(n.axis);return Ke(e,r,n.intersect,a)},x:function(e,t,n){var r=Ue(t,e),a=[],i=!1;return qe(e,function(e){e.inXRange(r.x)&&a.push(e),e.inRange(r.x,r.y)&&(i=!0)}),n.intersect&&!i&&(a=[]),a},y:function(e,t,n){var r=Ue(t,e),a=[],i=!1;return qe(e,function(e){e.inYRange(r.y)&&a.push(e),e.inRange(r.x,r.y)&&(i=!0)}),n.intersect&&!i&&(a=[]),a}}},Xe=V.extend;function et(e,t){return V.where(e,function(e){return e.pos===t})}function tt(e,t){return e.sort(function(e,n){var r=t?n:e,a=t?e:n;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function nt(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function rt(e,t,n){var r,a,i=n.box,o=e.maxPadding;if(n.size&&(e[n.pos]-=n.size),n.size=n.horizontal?i.height:i.width,e[n.pos]+=n.size,i.getPadding){var s=i.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(r=t.outerWidth-nt(o,e,"left","right"),a=t.outerHeight-nt(o,e,"top","bottom"),r!==e.w||a!==e.h){e.w=r,e.h=a;var l=n.horizontal?[r,e.w]:[a,e.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function at(e,t){var n,r=t.maxPadding;return n={left:0,top:0,right:0,bottom:0},(e?["left","right"]:["top","bottom"]).forEach(function(e){n[e]=Math.max(t[e],r[e])}),n}function it(e,t,n){var r,a,i,o,s,l,u=[];for(r=0,a=e.length;r<a;++r)(o=(i=e[r]).box).update(i.width||t.w,i.height||t.h,at(i.horizontal,t)),rt(t,n,i)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(i);return s&&it(u,t,n)||l}function ot(e,t,n){var r,a,i,o,s=n.padding,l=t.x,u=t.y;for(r=0,a=e.length;r<a;++r)o=(i=e[r]).box,i.horizontal?(o.left=o.fullWidth?s.left:t.left,o.right=o.fullWidth?n.outerWidth-s.right:t.left+t.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=t.top,o.bottom=t.top+t.h,o.height=o.bottom-o.top,l=o.right);t.x=l,t.y=u}I._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var st={defaults:{},addBox:function(e,t){e.boxes||(e.boxes=[]),t.fullWidth=t.fullWidth||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(){t.draw.apply(t,arguments)}}]},e.boxes.push(t)},removeBox:function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure:function(e,t,n){for(var r,a=["fullWidth","position","weight"],i=a.length,o=0;o<i;++o)n.hasOwnProperty(r=a[o])&&(t[r]=n[r])},update:function(e,t,n){if(e){var r=V.options.toPadding((e.options.layout||{}).padding),a=t-r.width,i=n-r.height,o=function(e){var t=function(e){var t,n,r,a=[];for(t=0,n=(e||[]).length;t<n;++t)a.push({index:t,box:r=e[t],pos:r.position,horizontal:r.isHorizontal(),weight:r.weight});return a}(e),n=tt(et(t,"left"),!0),r=tt(et(t,"right")),a=tt(et(t,"top"),!0),i=tt(et(t,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:r.concat(i),chartArea:et(t,"chartArea"),vertical:n.concat(r),horizontal:a.concat(i)}}(e.boxes),s=o.vertical,l=o.horizontal,u=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:a,vBoxMaxWidth:a/2/s.length,hBoxMaxHeight:i/2}),c=Xe({maxPadding:Xe({},r),w:a,h:i,x:r.left,y:r.top},r);(function(e,t){var n,r,a;for(n=0,r=e.length;n<r;++n)(a=e[n]).width=a.horizontal?a.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,a.height=a.horizontal&&t.hBoxMaxHeight})(s.concat(l),u),it(s,c,u),it(l,c,u)&&it(s,c,u),function(e){var t=e.maxPadding;function n(n){var r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(c),ot(o.leftAndTop,c,u),c.x+=c.w,c.y+=c.h,ot(o.rightAndBottom,c,u),e.chartArea={left:c.left,top:c.top,right:c.left+c.w,bottom:c.top+c.h},V.each(o.chartArea,function(t){var n=t.box;Xe(n,e.chartArea),n.update(c.w,c.h)})}}},lt=function(e){return e&&e.default||e}(/*#__PURE__*/Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"})),ut="$chartjs",ct="chartjs-",dt=ct+"size-monitor",ht=ct+"render-monitor",ft=ct+"render-animation",pt=["animationstart","webkitAnimationStart"],gt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function mt(e,t){var n=V.getStyle(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?Number(r[1]):void 0}var vt=!!function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(e){}return e}()&&{passive:!0};function yt(e,t,n){e.addEventListener(t,n,vt)}function bt(e,t,n){e.removeEventListener(t,n,vt)}function xt(e,t,n,r,a){return{type:e,chart:t,native:a||null,x:void 0!==n?n:null,y:void 0!==r?r:null}}function _t(e){var t=document.createElement("div");return t.className=e||"",t}var wt={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(e){if(!this.disableCSSInjection){var t=e.getRootNode?e.getRootNode():document;!function(e,t){var n=e[ut]||(e[ut]={});if(!n.containsStyles){n.containsStyles=!0,t="/* Chart.js */\n"+t;var r=document.createElement("style");r.setAttribute("type","text/css"),r.appendChild(document.createTextNode(t)),e.appendChild(r)}}(t.host?t:document.head,lt)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(this._ensureLoaded(e),function(e,t){var n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e[ut]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var i=mt(e,"width");void 0!==i&&(e.width=i)}if(null===r||""===r)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var o=mt(e,"height");void 0!==i&&(e.height=o)}}(e,t),n):null},releaseContext:function(e){var t=e.canvas;if(t[ut]){var n=t[ut].initial;["height","width"].forEach(function(e){var r=n[e];V.isNullOrUndef(r)?t.removeAttribute(e):t.setAttribute(e,r)}),V.each(n.style||{},function(e,n){t.style[n]=e}),t.width=t.width,delete t[ut]}},addEventListener:function(e,t,n){var r=e.canvas;if("resize"!==t){var a=n[ut]||(n[ut]={});yt(r,t,(a.proxies||(a.proxies={}))[e.id+"_"+t]=function(t){n(function(e,t){var n=gt[e.type]||e.type,r=V.getRelativePosition(e,t);return xt(n,t,r.x,r.y,e)}(t,e))})}else!function(e,t,n){var r,a,i,o,s=e[ut]||(e[ut]={}),l=s.resizer=function(e){var t=1e6,n=_t(dt),r=_t(dt+"-expand"),a=_t(dt+"-shrink");r.appendChild(_t()),a.appendChild(_t()),n.appendChild(r),n.appendChild(a),n._reset=function(){r.scrollLeft=t,r.scrollTop=t,a.scrollLeft=t,a.scrollTop=t};var i=function(){n._reset(),e()};return yt(r,"scroll",i.bind(r,"expand")),yt(a,"scroll",i.bind(a,"shrink")),n}((r=function(){if(s.resizer){var r=n.options.maintainAspectRatio&&e.parentNode,a=r?r.clientWidth:0;t(xt("resize",n)),r&&r.clientWidth<a&&n.canvas&&t(xt("resize",n))}},i=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,i||(i=!0,V.requestAnimFrame.call(window,function(){i=!1,r.apply(a,o)}))}));!function(e,t){var n=e[ut]||(e[ut]={}),r=n.renderProxy=function(e){e.animationName===ft&&t()};V.each(pt,function(t){yt(e,t,r)}),n.reflow=!!e.offsetParent,e.classList.add(ht)}(e,function(){if(s.resizer){var t=e.parentNode;t&&t!==l.parentNode&&t.insertBefore(l,t.firstChild),l._reset()}})}(r,n,e)},removeEventListener:function(e,t,n){var r,a,i,o=e.canvas;if("resize"!==t){var s=((n[ut]||{}).proxies||{})[e.id+"_"+t];s&&bt(o,t,s)}else i=(a=(r=o)[ut]||{}).resizer,delete a.resizer,function(e){var t=e[ut]||{},n=t.renderProxy;n&&(V.each(pt,function(t){bt(e,t,n)}),delete t.renderProxy),e.classList.remove(ht)}(r),i&&i.parentNode&&i.parentNode.removeChild(i)}};V.addEvent=yt,V.removeEvent=bt;var kt=V.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},wt._enabled?wt:{acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}});I._set("global",{plugins:{}});var St={_plugins:[],_cacheId:0,register:function(e){var t=this._plugins;[].concat(e).forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),this._cacheId++},unregister:function(e){var t=this._plugins;[].concat(e).forEach(function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,n){var r,a,i,o,s,l=this.descriptors(e),u=l.length;for(r=0;r<u;++r)if("function"==typeof(s=(i=(a=l[r]).plugin)[t])&&((o=[e].concat(n||[])).push(a.options),!1===s.apply(i,o)))return!1;return!0},descriptors:function(e){var t=e.$plugins||(e.$plugins={});if(t.id===this._cacheId)return t.descriptors;var n=[],r=[],a=e&&e.config||{},i=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(e){if(-1===n.indexOf(e)){var t=e.id,a=i[t];!1!==a&&(!0===a&&(a=V.clone(I.global.plugins[t])),n.push(e),r.push({plugin:e,options:a||{}}))}}),t.descriptors=r,t.id=this._cacheId,r},_invalidate:function(e){delete e.$plugins}},Ot={constructors:{},defaults:{},registerScaleType:function(e,t,n){this.constructors[e]=t,this.defaults[e]=V.clone(n)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?V.merge(Object.create(null),[I.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){var n=this;n.defaults.hasOwnProperty(e)&&(n.defaults[e]=V.extend(n.defaults[e],t))},addScalesToLayout:function(e){V.each(e.scales,function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,st.addBox(e,t)})}},Mt=V.valueOrDefault,Pt=V.rtl.getRtlAdapter;I._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:V.noop,title:function(e,t){var n="",r=t.labels,a=r?r.length:0;if(e.length>0){var i=e[0];i.label?n=i.label:i.xLabel?n=i.xLabel:a>0&&i.index<a&&(n=r[i.index])}return n},afterTitle:V.noop,beforeBody:V.noop,beforeLabel:V.noop,label:function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),V.isNullOrUndef(e.value)?n+=e.yLabel:n+=e.value,n},labelColor:function(e,t){var n=t.getDatasetMeta(e.datasetIndex).data[e.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:V.noop,afterBody:V.noop,beforeFooter:V.noop,footer:V.noop,afterFooter:V.noop}}});var Ct={average:function(e){if(!e.length)return!1;var t,n,r=0,a=0,i=0;for(t=0,n=e.length;t<n;++t){var o=e[t];if(o&&o.hasValue()){var s=o.tooltipPosition();r+=s.x,a+=s.y,++i}}return{x:r/i,y:a/i}},nearest:function(e,t){var n,r,a,i=t.x,o=t.y,s=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){var l=e[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),c=V.distanceBetweenPoints(t,u);c<s&&(s=c,a=l)}}if(a){var d=a.tooltipPosition();i=d.x,o=d.y}return{x:i,y:o}}};function Dt(e,t){return t&&(V.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Tt(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Rt(e){var t=I.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:Mt(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:Mt(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:Mt(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:Mt(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:Mt(e.titleFontStyle,t.defaultFontStyle),titleFontSize:Mt(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:Mt(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:Mt(e.footerFontStyle,t.defaultFontStyle),footerFontSize:Mt(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function At(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function jt(e){return Dt([],Tt(e))}var Nt=U.extend({initialize:function(){this._model=Rt(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,n=t.beforeTitle.apply(e,arguments),r=t.title.apply(e,arguments),a=t.afterTitle.apply(e,arguments),i=[];return i=Dt(i,Tt(n)),i=Dt(i,Tt(r)),Dt(i,Tt(a))},getBeforeBody:function(){return jt(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,r=n._options.callbacks,a=[];return V.each(e,function(e){var i={before:[],lines:[],after:[]};Dt(i.before,Tt(r.beforeLabel.call(n,e,t))),Dt(i.lines,r.label.call(n,e,t)),Dt(i.after,Tt(r.afterLabel.call(n,e,t))),a.push(i)}),a},getAfterBody:function(){return jt(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),r=t.footer.apply(e,arguments),a=t.afterFooter.apply(e,arguments),i=[];return i=Dt(i,Tt(n)),i=Dt(i,Tt(r)),Dt(i,Tt(a))},update:function(e){var t,n,r,a,i,o,s,l,u,c,d=this,h=d._options,f=d._model,p=d._model=Rt(h),g=d._active,m=d._data,v={xAlign:f.xAlign,yAlign:f.yAlign},y={x:f.x,y:f.y},b={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(g.length){p.opacity=1;var _=[],w=[];x=Ct[h.position].call(d,g,d._eventPosition);var k=[];for(t=0,n=g.length;t<n;++t)k.push((a=void 0,i=void 0,l=void 0,u=void 0,c=void 0,a=(r=g[t])._xScale,i=r._yScale||r._scale,o=r._index,u=(l=r._chart.getDatasetMeta(s=r._datasetIndex).controller)._getIndexScale(),c=l._getValueScale(),{xLabel:a?a.getLabelForIndex(o,s):"",yLabel:i?i.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:c?""+c.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:r._model.x,y:r._model.y}));h.filter&&(k=k.filter(function(e){return h.filter(e,m)})),h.itemSort&&(k=k.sort(function(e,t){return h.itemSort(e,t,m)})),V.each(k,function(e){_.push(h.callbacks.labelColor.call(d,e,d._chart)),w.push(h.callbacks.labelTextColor.call(d,e,d._chart))}),p.title=d.getTitle(k,m),p.beforeBody=d.getBeforeBody(k,m),p.body=d.getBody(k,m),p.afterBody=d.getAfterBody(k,m),p.footer=d.getFooter(k,m),p.x=x.x,p.y=x.y,p.caretPadding=h.caretPadding,p.labelColors=_,p.labelTextColors=w,p.dataPoints=k,y=function(e,t,n,r){var a=e.x,i=e.y,o=e.caretPadding,s=n.xAlign,l=n.yAlign,u=e.caretSize+o,c=e.cornerRadius+o;return"right"===s?a-=t.width:"center"===s&&((a-=t.width/2)+t.width>r.width&&(a=r.width-t.width),a<0&&(a=0)),"top"===l?i+=u:i-="bottom"===l?t.height+u:t.height/2,"center"===l?"left"===s?a+=u:"right"===s&&(a-=u):"left"===s?a-=c:"right"===s&&(a+=c),{x:a,y:i}}(p,b=function(e,t){var n=e._chart.ctx,r=2*t.yPadding,a=0,i=t.body,o=i.reduce(function(e,t){return e+t.before.length+t.lines.length+t.after.length},0),s=t.title.length,l=t.footer.length,u=t.titleFontSize,c=t.bodyFontSize,d=t.footerFontSize;r+=s*u,r+=s?(s-1)*t.titleSpacing:0,r+=s?t.titleMarginBottom:0,r+=(o+=t.beforeBody.length+t.afterBody.length)*c,r+=o?(o-1)*t.bodySpacing:0,r+=l?t.footerMarginTop:0,r+=l*d,r+=l?(l-1)*t.footerSpacing:0;var h=0,f=function(e){a=Math.max(a,n.measureText(e).width+h)};return n.font=V.fontString(u,t._titleFontStyle,t._titleFontFamily),V.each(t.title,f),n.font=V.fontString(c,t._bodyFontStyle,t._bodyFontFamily),V.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?c+2:0,V.each(i,function(e){V.each(e.before,f),V.each(e.lines,f),V.each(e.after,f)}),h=0,n.font=V.fontString(d,t._footerFontStyle,t._footerFontFamily),V.each(t.footer,f),{width:a+=2*t.xPadding,height:r}}(this,p),v=function(e,t){var n,r,a,i,o,s=e._model,l=e._chart,u=e._chart.chartArea,c="center",d="center";s.y<t.height?d="top":s.y>l.height-t.height&&(d="bottom");var h=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===d?(n=function(e){return e<=h},r=function(e){return e>h}):(n=function(e){return e<=t.width/2},r=function(e){return e>=l.width-t.width/2}),a=function(e){return e+t.width+s.caretSize+s.caretPadding>l.width},i=function(e){return e-t.width-s.caretSize-s.caretPadding<0},o=function(e){return e<=f?"top":"bottom"},n(s.x)?(c="left",a(s.x)&&(c="center",d=o(s.y))):r(s.x)&&(c="right",i(s.x)&&(c="center",d=o(s.y)));var p=e._options;return{xAlign:p.xAlign?p.xAlign:c,yAlign:p.yAlign?p.yAlign:d}}(this,b),d._chart)}else p.opacity=0;return p.xAlign=v.xAlign,p.yAlign=v.yAlign,p.x=y.x,p.y=y.y,p.width=b.width,p.height=b.height,p.caretX=x.x,p.caretY=x.y,d._model=p,e&&h.custom&&h.custom.call(d,p),d},drawCaret:function(e,t){var n=this._chart.ctx,r=this.getCaretPosition(e,t,this._view);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)},getCaretPosition:function(e,t,n){var r,a,i,o,s,l,u=n.caretSize,c=n.cornerRadius,d=n.xAlign,h=n.yAlign,f=e.x,p=e.y,g=t.width,m=t.height;if("center"===h)s=p+m/2,"left"===d?(a=(r=f)-u,i=r,o=s+u,l=s-u):(a=(r=f+g)+u,i=r,o=s-u,l=s+u);else if("left"===d?(r=(a=f+c+u)-u,i=a+u):"right"===d?(r=(a=f+g-c-u)-u,i=a+u):(r=(a=n.caretX)-u,i=a+u),"top"===h)s=(o=p)-u,l=o;else{s=(o=p+m)+u,l=o;var v=i;i=r,r=v}return{x1:r,x2:a,x3:i,y1:o,y2:s,y3:l}},drawTitle:function(e,t,n){var r,a,i,o=t.title,s=o.length;if(s){var l=Pt(t.rtl,t.x,t.width);for(e.x=At(t,t._titleAlign),n.textAlign=l.textAlign(t._titleAlign),n.textBaseline="middle",r=t.titleFontSize,a=t.titleSpacing,n.fillStyle=t.titleFontColor,n.font=V.fontString(r,t._titleFontStyle,t._titleFontFamily),i=0;i<s;++i)n.fillText(o[i],l.x(e.x),e.y+r/2),e.y+=r+a,i+1===s&&(e.y+=t.titleMarginBottom-a)}},drawBody:function(e,t,n){var r,a,i,o,s,l,u,c,d=t.bodyFontSize,h=t.bodySpacing,f=t._bodyAlign,p=t.body,g=t.displayColors,m=0,v=g?At(t,"left"):0,y=Pt(t.rtl,t.x,t.width),b=function(t){n.fillText(t,y.x(e.x+m),e.y+d/2),e.y+=d+h},x=y.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=V.fontString(d,t._bodyFontStyle,t._bodyFontFamily),e.x=At(t,x),n.fillStyle=t.bodyFontColor,V.each(t.beforeBody,b),m=g&&"right"!==x?"center"===f?d/2+1:d+2:0,s=0,u=p.length;s<u;++s){for(r=p[s],i=t.labelColors[s],n.fillStyle=a=t.labelTextColors[s],V.each(r.before,b),l=0,c=(o=r.lines).length;l<c;++l){if(g){var _=y.x(v);n.fillStyle=t.legendColorBackground,n.fillRect(y.leftForLtr(_,d),e.y,d,d),n.lineWidth=1,n.strokeStyle=i.borderColor,n.strokeRect(y.leftForLtr(_,d),e.y,d,d),n.fillStyle=i.backgroundColor,n.fillRect(y.leftForLtr(y.xPlus(_,1),d-2),e.y+1,d-2,d-2),n.fillStyle=a}b(o[l])}V.each(r.after,b)}m=0,V.each(t.afterBody,b),e.y-=h},drawFooter:function(e,t,n){var r,a,i=t.footer,o=i.length;if(o){var s=Pt(t.rtl,t.x,t.width);for(e.x=At(t,t._footerAlign),e.y+=t.footerMarginTop,n.textAlign=s.textAlign(t._footerAlign),n.textBaseline="middle",r=t.footerFontSize,n.fillStyle=t.footerFontColor,n.font=V.fontString(r,t._footerFontStyle,t._footerFontFamily),a=0;a<o;++a)n.fillText(i[a],s.x(e.x),e.y+r/2),e.y+=r+t.footerSpacing}},drawBackground:function(e,t,n,r){n.fillStyle=t.backgroundColor,n.strokeStyle=t.borderColor,n.lineWidth=t.borderWidth;var a=t.xAlign,i=t.yAlign,o=e.x,s=e.y,l=r.width,u=r.height,c=t.cornerRadius;n.beginPath(),n.moveTo(o+c,s),"top"===i&&this.drawCaret(e,r),n.lineTo(o+l-c,s),n.quadraticCurveTo(o+l,s,o+l,s+c),"center"===i&&"right"===a&&this.drawCaret(e,r),n.lineTo(o+l,s+u-c),n.quadraticCurveTo(o+l,s+u,o+l-c,s+u),"bottom"===i&&this.drawCaret(e,r),n.lineTo(o+c,s+u),n.quadraticCurveTo(o,s+u,o,s+u-c),"center"===i&&"left"===a&&this.drawCaret(e,r),n.lineTo(o,s+c),n.quadraticCurveTo(o,s,o+c,s),n.closePath(),n.fill(),t.borderWidth>0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},r={x:t.x,y:t.y},a=Math.abs(t.opacity<.001)?0:t.opacity;this._options.enabled&&(t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length)&&(e.save(),e.globalAlpha=a,this.drawBackground(r,t,e,n),r.y+=t.yPadding,V.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),V.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,n=this,r=n._options;return n._lastActive=n._lastActive||[],"mouseout"===e.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(e,r.mode,r),r.reverse&&n._active.reverse()),(t=!V.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(r.enabled||r.custom)&&(n._eventPosition={x:e.x,y:e.y},n.update(!0),n.pivot())),t}}),Et=Nt;Et.positioners=Ct;var It=V.valueOrDefault;function Lt(){return V.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){if("xAxes"===e||"yAxes"===e){var a,i,o,s=n[e].length;for(t[e]||(t[e]=[]),a=0;a<s;++a)i=It((o=n[e][a]).type,"xAxes"===e?"category":"linear"),a>=t[e].length&&t[e].push({}),V.merge(t[e][a],!t[e][a].type||o.type&&o.type!==t[e][a].type?[Ot.getScaleDefaults(i),o]:o)}else V._merger(e,t,n,r)}})}function Ft(){return V.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){var a=t[e]||Object.create(null),i=n[e];"scales"===e?t[e]=Lt(a,i):"scale"===e?t[e]=V.merge(a,[Ot.getScaleDefaults(i.type),i]):V._merger(e,t,n,r)}})}function Wt(e){var t=e.options;V.each(e.scales,function(t){st.removeBox(e,t)}),t=Ft(I.global,I[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function zt(e,t,n){var r,a=function(e){return e.id===r};do{r=t+n++}while(V.findIndex(e,a)>=0);return r}function Vt(e){return"top"===e||"bottom"===e}function Yt(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}I._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Bt=function(e,t){return this.construct(e,t),this};V.extend(Bt.prototype,{construct:function(e,t){var n=this;t=function(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=Ft(I.global,I[e.type],e.options||{}),e}(t);var r=kt.acquireContext(e,t),a=r&&r.canvas,i=a&&a.height,o=a&&a.width;n.id=V.uid(),n.ctx=r,n.canvas=a,n.config=t,n.width=o,n.height=i,n.aspectRatio=i?o/i:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Bt.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),r&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return St.notify(e,"beforeInit"),V.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),St.notify(e,"afterInit"),e},clear:function(){return V.canvas.clear(this),this},stop:function(){return K.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,r=t.canvas,a=n.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(V.getMaximumWidth(r))),o=Math.max(0,Math.floor(a?i/a:V.getMaximumHeight(r)));if((t.width!==i||t.height!==o)&&(r.width=t.width=i,r.height=t.height=o,r.style.width=i+"px",r.style.height=o+"px",V.retinaScale(t,n.devicePixelRatio),!e)){var s={width:i,height:o};St.notify(t,"resize",[s]),n.onResize&&n.onResize(t,s),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;V.each(t.xAxes,function(e,n){e.id||(e.id=zt(t.xAxes,"x-axis-",n))}),V.each(t.yAxes,function(e,n){e.id||(e.id=zt(t.yAxes,"y-axis-",n))}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},r=[],a=Object.keys(n).reduce(function(e,t){return e[t]=!1,e},{});t.scales&&(r=r.concat((t.scales.xAxes||[]).map(function(e){return{options:e,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(e){return{options:e,dtype:"linear",dposition:"left"}}))),t.scale&&r.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),V.each(r,function(t){var r=t.options,i=r.id,o=It(r.type,t.dtype);Vt(r.position)!==Vt(t.dposition)&&(r.position=t.dposition),a[i]=!0;var s=null;if(i in n&&n[i].type===o)(s=n[i]).options=r,s.ctx=e.ctx,s.chart=e;else{var l=Ot.getScaleConstructor(o);if(!l)return;s=new l({id:i,type:o,options:r,ctx:e.ctx,chart:e}),n[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)}),V.each(a,function(e,t){e||delete n[t]}),e.scales=n,Ot.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,r=[],a=n.data.datasets;for(e=0,t=a.length;e<t;e++){var i=a[e],o=n.getDatasetMeta(e),s=i.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(e),o=n.getDatasetMeta(e)),o.type=s,o.order=i.order||0,o.index=e,o.controller)o.controller.updateIndex(e),o.controller.linkScales();else{var l=$e[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,e),r.push(o.controller)}}return r},resetElements:function(){var e=this;V.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.reset()},e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,n,r=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),Wt(r),St._invalidate(r),!1!==St.notify(r,"beforeUpdate")){r.tooltip._data=r.data;var a=r.buildOrUpdateControllers();for(t=0,n=r.data.datasets.length;t<n;t++)r.getDatasetMeta(t).controller.buildOrUpdateElements();r.updateLayout(),r.options.animation&&r.options.animation.duration&&V.each(a,function(e){e.reset()}),r.updateDatasets(),r.tooltip.initialize(),r.lastActive=[],St.notify(r,"afterUpdate"),r._layers.sort(Yt("z","_idx")),r._bufferedRender?r._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:r.render(e)}},updateLayout:function(){var e=this;!1!==St.notify(e,"beforeLayout")&&(st.update(this,this.width,this.height),e._layers=[],V.each(e.boxes,function(t){t._configure&&t._configure(),e._layers.push.apply(e._layers,t._layers())},e),e._layers.forEach(function(e,t){e._idx=t}),St.notify(e,"afterScaleUpdate"),St.notify(e,"afterLayout"))},updateDatasets:function(){var e=this;if(!1!==St.notify(e,"beforeDatasetsUpdate")){for(var t=0,n=e.data.datasets.length;t<n;++t)e.updateDataset(t);St.notify(e,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this,n=t.getDatasetMeta(e),r={meta:n,index:e};!1!==St.notify(t,"beforeDatasetUpdate",[r])&&(n.controller._update(),St.notify(t,"afterDatasetUpdate",[r]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=t.options.animation,r=It(e.duration,n&&n.duration),a=e.lazy;if(!1!==St.notify(t,"beforeRender")){var i=function(e){St.notify(t,"afterRender"),V.callback(n&&n.onComplete,[e],t)};if(n&&r){var o=new G({numSteps:r/16.66,easing:e.easing||n.easing,render:function(e,t){var n=t.currentStep,r=n/t.numSteps;e.draw((0,V.easing.effects[t.easing])(r),r,n)},onAnimationProgress:n.onProgress,onAnimationComplete:i});K.addAnimation(t,o,r,a)}else t.draw(),i(new G({numSteps:0,chart:t}));return t}},draw:function(e){var t,n,r=this;if(r.clear(),V.isNullOrUndef(e)&&(e=1),r.transition(e),!(r.width<=0||r.height<=0)&&!1!==St.notify(r,"beforeDraw",[e])){for(n=r._layers,t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(r.chartArea);for(r.drawDatasets(e);t<n.length;++t)n[t].draw(r.chartArea);r._drawTooltip(e),St.notify(r,"afterDraw",[e])}},transition:function(e){for(var t=this,n=0,r=(t.data.datasets||[]).length;n<r;++n)t.isDatasetVisible(n)&&t.getDatasetMeta(n).controller.transition(e);t.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,n,r=this,a=[];for(t=0,n=(r.data.datasets||[]).length;t<n;++t)e&&!r.isDatasetVisible(t)||a.push(r.getDatasetMeta(t));return a.sort(Yt("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,n,r=this;if(!1!==St.notify(r,"beforeDatasetsDraw",[e])){for(n=(t=r._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)r.drawDataset(t[n],e);St.notify(r,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n={meta:e,index:e.index,easingValue:t};!1!==St.notify(this,"beforeDatasetDraw",[n])&&(e.controller.draw(t),St.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(e){var t=this,n=t.tooltip,r={tooltip:n,easingValue:e};!1!==St.notify(t,"beforeTooltipDraw",[r])&&(n.draw(),St.notify(t,"afterTooltipDraw",[r]))},getElementAtEvent:function(e){return Ze.modes.single(this,e)},getElementsAtEvent:function(e){return Ze.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Ze.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var r=Ze.modes[t];return"function"==typeof r?r(this,e,n):[]},getDatasetAtEvent:function(e){return Ze.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var r=n._meta[t.id];return r||(r=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),r},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t<n;++t)this.isDatasetVisible(t)&&e++;return e},isDatasetVisible:function(e){var t=this.getDatasetMeta(e);return"boolean"==typeof t.hidden?!t.hidden:!this.data.datasets[e].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(e){var t=this.id,n=this.data.datasets[e],r=n._meta&&n._meta[t];r&&(r.controller.destroy(),delete n._meta[t])},destroy:function(){var e,t,n=this,r=n.canvas;for(n.stop(),e=0,t=n.data.datasets.length;e<t;++e)n.destroyDatasetMeta(e);r&&(n.unbindEvents(),V.canvas.clear(n),kt.releaseContext(n.ctx),n.canvas=null,n.ctx=null),St.notify(n,"destroy"),delete Bt.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new Et({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var e=this,t=e._listeners={},n=function(){e.eventHandler.apply(e,arguments)};V.each(e.options.events,function(r){kt.addEventListener(e,r,n),t[r]=n}),e.options.responsive&&(n=function(){e.resize()},kt.addEventListener(e,"resize",n),t.resize=n)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,V.each(t,function(t,n){kt.removeEventListener(e,n,t)}))},updateHoverStyle:function(e,t,n){var r,a,i,o=n?"set":"remove";for(a=0,i=e.length;a<i;++a)(r=e[a])&&this.getDatasetMeta(r._datasetIndex).controller[o+"HoverStyle"](r);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,n=t.tooltip;if(!1!==St.notify(t,"beforeEvent",[e])){t._bufferedRender=!0,t._bufferedRequest=null;var r=t.handleEvent(e);n&&(r=n._start?n.handleEvent(e):r|n.handleEvent(e)),St.notify(t,"afterEvent",[e]);var a=t._bufferedRequest;return a?t.render(a):r&&!t.animating&&(t.stop(),t.render({duration:t.options.hover.animationDuration,lazy:!0})),t._bufferedRender=!1,t._bufferedRequest=null,t}},handleEvent:function(e){var t,n=this,r=n.options||{},a=r.hover;return n.lastActive=n.lastActive||[],n.active="mouseout"===e.type?[]:n.getElementsAtEventForMode(e,a.mode,a),V.callback(r.onHover||r.hover.onHover,[e.native,n.active],n),"mouseup"!==e.type&&"click"!==e.type||r.onClick&&r.onClick.call(n,e.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),t=!V.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,t}}),Bt.instances={};var Ht=Bt;function $t(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Ut(e){this.options=e||{}}Bt.Controller=Bt,Bt.types={},V.configMerge=Ft,V.scaleMerge=Lt,V.extend(Ut.prototype,{formats:$t,parse:$t,format:$t,add:$t,diff:$t,startOf:$t,endOf:$t,_create:function(e){return e}}),Ut.override=function(e){V.extend(Ut.prototype,e)};var qt={_date:Ut},Gt={formatters:{values:function(e){return V.isArray(e)?e:""+e},linear:function(e,t,n){var r=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(r)>1&&e!==Math.floor(e)&&(r=e-Math.floor(e));var a=V.log10(Math.abs(r)),i="";if(0!==e)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=V.log10(Math.abs(e)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),i=e.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),i=e.toFixed(l)}else i="0";return i},logarithmic:function(e,t,n){var r=e/Math.pow(10,Math.floor(V.log10(e)));return 0===e?"0":1===r||2===r||5===r||0===t||t===n.length-1?e.toExponential():""}}},Kt=V.isArray,Jt=V.isNullOrUndef,Qt=V.valueOrDefault,Zt=V.valueAtIndexOrDefault;function Xt(e,t,n){var r,a=e.getTicks().length,i=Math.min(t,a-1),o=e.getPixelForTick(i),s=e._startPixel,l=e._endPixel,u=1e-6;if(!(n&&(r=1===a?Math.max(o-s,l-o):0===t?(e.getPixelForTick(1)-o)/2:(o-e.getPixelForTick(i-1))/2,(o+=i<t?r:-r)<s-u||o>l+u)))return o}function en(e){return e.drawTicks?e.tickMarkLength:0}function tn(e){var t,n;return e.display?(t=V.options._parseFont(e),n=V.options.toPadding(e.padding),t.lineHeight+n.height):0}function nn(e,t){return V.extend(V.options._parseFont({fontFamily:Qt(t.fontFamily,e.fontFamily),fontSize:Qt(t.fontSize,e.fontSize),fontStyle:Qt(t.fontStyle,e.fontStyle),lineHeight:Qt(t.lineHeight,e.lineHeight)}),{color:V.options.resolve([t.fontColor,e.fontColor,I.global.defaultFontColor])})}function rn(e){var t=nn(e,e.minor);return{minor:t,major:e.major.enabled?nn(e,e.major):t}}function an(e){var t,n,r,a=[];for(n=0,r=e.length;n<r;++n)void 0!==(t=e[n])._index&&a.push(t);return a}function on(e,t,n,r){var a,i,o,s,l=Qt(n,0),u=Math.min(Qt(r,e.length),e.length),c=0;for(t=Math.ceil(t),r&&(t=(a=r-n)/Math.floor(a/t)),s=l;s<0;)c++,s=Math.round(l+c*t);for(i=Math.max(l,0);i<u;i++)o=e[i],i===s?(o._index=i,c++,s=Math.round(l+c*t)):delete o.label}I._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Gt.formatters.values,minor:{},major:{}}});var sn=U.extend({zeroLineIndex:0,getPadding:function(){var e=this;return{left:e.paddingLeft||0,top:e.paddingTop||0,right:e.paddingRight||0,bottom:e.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){V.callback(this.options.beforeUpdate,[this])},update:function(e,t,n){var r,a,i,o,s,l=this,u=l.options.ticks,c=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=e,l.maxHeight=t,l.margins=V.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],r=0,a=l.ticks.length;r<a;++r)o.push({value:l.ticks[r],major:!1});return l._ticks=o,i=l._convertTicksToLabels((s=c<o.length)?function(e,t){for(var n=[],r=e.length/t,a=0,i=e.length;a<i;a+=r)n.push(e[Math.floor(a)]);return n}(o,c):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(i=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=i,l.afterUpdate(),l.minSize},_configure:function(){var e,t,n=this,r=n.options.ticks.reverse;n.isHorizontal()?(e=n.left,t=n.right):(e=n.top,t=n.bottom,r=!r),n._startPixel=e,n._endPixel=t,n._reversePixels=r,n._length=t-e},afterUpdate:function(){V.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){V.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0},afterSetDimensions:function(){V.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){V.callback(this.options.beforeDataLimits,[this])},determineDataLimits:V.noop,afterDataLimits:function(){V.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){V.callback(this.options.beforeBuildTicks,[this])},buildTicks:V.noop,afterBuildTicks:function(e){var t=this;return Kt(e)&&e.length?V.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=V.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){V.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var e=this,t=e.options.ticks;e.ticks=e.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){V.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){V.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,n,r,a,i,o,s=this,l=s.options,u=l.ticks,c=s.getTicks().length,d=u.minRotation||0,h=u.maxRotation,f=d;!s._isVisible()||!u.display||d>=h||c<=1||!s.isHorizontal()?s.labelRotation=d:(t=(e=s._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,r=Math.min(s.maxWidth,s.chart.width-t),t+6>(a=l.offset?s.maxWidth/c:r/(c-1))&&(a=r/(c-(l.offset?.5:1)),i=s.maxHeight-en(l.gridLines)-u.padding-tn(l.scaleLabel),o=Math.sqrt(t*t+n*n),f=V.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/a,1)),Math.asin(Math.min(i/o,1))-Math.asin(n/o))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){V.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){V.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,r=e.options,a=r.ticks,i=r.scaleLabel,o=r.gridLines,s=e._isVisible(),l="bottom"===r.position,u=e.isHorizontal();if(u?t.width=e.maxWidth:s&&(t.width=en(o)+tn(i)),u?s&&(t.height=en(o)+tn(i)):t.height=e.maxHeight,a.display&&s){var c=rn(a),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,m=.4*c.minor.lineHeight,v=a.padding;if(u){var y=0!==e.labelRotation,b=V.toRadians(e.labelRotation),x=Math.cos(b),_=Math.sin(b);t.height=Math.min(e.maxHeight,t.height+(_*p.width+x*(g.height-(y?g.offset:0))+(y?0:m))+v);var w,k,S=e.getPixelForTick(0)-e.left,O=e.right-e.getPixelForTick(e.getTicks().length-1);y?(w=l?x*h.width+_*h.offset:_*(h.height-h.offset),k=l?_*(f.height-f.offset):x*f.width+_*f.offset):(w=h.width/2,k=f.width/2),e.paddingLeft=Math.max((w-S)*e.width/(e.width-S),0)+3,e.paddingRight=Math.max((k-O)*e.width/(e.width-O),0)+3}else t.width=Math.min(e.maxWidth,t.width+(a.mirror?0:p.width+v+m)),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}e.handleMargins(),u?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){V.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(Jt(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,r,a=this;for(a.ticks=e.map(function(e){return e.value}),a.beforeTickToLabelConversion(),t=a.convertTicksToLabels(e)||a.ticks,a.afterTickToLabelConversion(),n=0,r=e.length;n<r;++n)e[n].label=t[n];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=function(e,t,n,r){var a,i,o,s,l,u,c,d,h,f,p,g,m,v=n.length,y=[],b=[],x=[],_=0,w=0;for(a=0;a<v;++a){if(s=n[a].label,e.font=u=(l=n[a].major?t.major:t.minor).string,c=r[u]=r[u]||{data:{},gc:[]},d=l.lineHeight,h=f=0,Jt(s)||Kt(s)){if(Kt(s))for(i=0,o=s.length;i<o;++i)Jt(p=s[i])||Kt(p)||(h=V.measureText(e,c.data,c.gc,h,p),f+=d)}else h=V.measureText(e,c.data,c.gc,h,s),f=d;y.push(h),b.push(f),x.push(d/2),_=Math.max(h,_),w=Math.max(f,w)}function k(e){return{width:y[e]||0,height:b[e]||0,offset:x[e]||0}}return function(e,t){V.each(e,function(e){var n,r=e.gc,a=r.length/2;if(a>t){for(n=0;n<a;++n)delete e.data[r[n]];r.splice(0,a)}})}(r,v),g=y.indexOf(_),m=b.indexOf(w),{first:k(0),last:k(v-1),widest:k(g),highest:k(m)}}(e.ctx,rn(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,n,r,a;return Kt(e)?(t=+this.getRightValue(e[0]),n=+this.getRightValue(e[1]),r=Math.min(t,n),a=Math.max(t,n)):(t=void 0,n=e=+this.getRightValue(e),r=e,a=e),{min:r,max:a,start:t,end:n}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:V.noop,getPixelForValue:V.noop,getValueForPixel:V.noop,getPixelForTick:function(e){var t=this,n=t.options.offset,r=t._ticks.length,a=1/Math.max(r-(n?0:1),1);return e<0||e>r-1?null:t.getPixelForDecimal(e*a+(n?a/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,r,a,i=this,o=i.options.ticks,s=o.maxTicksLimit||i._length/i._tickSize()+1,l=o.major.enabled?function(e){var t,n,r=[];for(t=0,n=e.length;t<n;t++)e[t].major&&r.push(t);return r}(e):[],u=l.length,c=l[0],d=l[u-1];if(u>s)return function(e,t,n){var r,a,i=0,o=t[0];for(n=Math.ceil(n),r=0;r<e.length;r++)a=e[r],r===o?(a._index=r,o=t[++i*n]):delete a.label}(e,l,u/s),an(e);if(r=function(e,t,n,r){var a,i,o,s,l=function(e){var t,n,r=e.length;if(r<2)return!1;for(n=e[0],t=1;t<r;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),u=(t.length-1)/r;if(!l)return Math.max(u,1);for(o=0,s=(a=V.math._factorize(l)).length-1;o<s;o++)if((i=a[o])>u)return i;return Math.max(u,1)}(l,e,0,s),u>0){for(t=0,n=u-1;t<n;t++)on(e,r,l[t],l[t+1]);return on(e,r,V.isNullOrUndef(a=u>1?(d-c)/(u-1):null)?0:c-a,c),on(e,r,d,V.isNullOrUndef(a)?e.length:d+a),an(e)}return on(e,r),an(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=V.toRadians(e.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),i=e._getLabelSizes(),o=t.autoSkipPadding||0,s=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return e.isHorizontal()?l*r>s*a?s/r:l/a:l*a<s*r?l/r:s/a},_isVisible:function(){var e,t,n,r=this,a=r.chart,i=r.options.display;if("auto"!==i)return!!i;for(e=0,t=a.data.datasets.length;e<t;++e)if(a.isDatasetVisible(e)&&((n=a.getDatasetMeta(e)).xAxisID===r.id||n.yAxisID===r.id))return!0;return!1},_computeGridLineItems:function(e){var t,n,r,a,i,o,s,l,u,c,d,h,f,p,g,m,v,y=this,b=y.chart,x=y.options,_=x.gridLines,w=x.position,k=_.offsetGridLines,S=y.isHorizontal(),O=y._ticksToDraw,M=O.length+(k?1:0),P=en(_),C=[],D=_.drawBorder?Zt(_.lineWidth,0,0):0,T=D/2,R=V._alignPixel,A=function(e){return R(b,e,D)};for("top"===w?(t=A(y.bottom),s=y.bottom-P,u=t-T,d=A(e.top)+T,f=e.bottom):"bottom"===w?(t=A(y.top),d=e.top,f=A(e.bottom)-T,s=t+T,u=y.top+P):"left"===w?(t=A(y.right),o=y.right-P,l=t-T,c=A(e.left)+T,h=e.right):(t=A(y.left),c=e.left,h=A(e.right)-T,o=t+T,l=y.left+P),n=0;n<M;++n)Jt((r=O[n]||{}).label)&&n<O.length||(n===y.zeroLineIndex&&x.offset===k?(p=_.zeroLineWidth,g=_.zeroLineColor,m=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(p=Zt(_.lineWidth,n,1),g=Zt(_.color,n,"rgba(0,0,0,0.1)"),m=_.borderDash||[],v=_.borderDashOffset||0),void 0!==(a=Xt(y,r._index||n,k))&&(i=R(b,a,p),S?o=l=c=h=i:s=u=d=f=i,C.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:c,y1:d,x2:h,y2:f,width:p,color:g,borderDash:m,borderDashOffset:v})));return C.ticksLength=M,C.borderValue=t,C},_computeLabelItems:function(){var e,t,n,r,a,i,o,s,l,u,c,d,h=this,f=h.options,p=f.ticks,g=f.position,m=p.mirror,v=h.isHorizontal(),y=h._ticksToDraw,b=rn(p),x=p.padding,_=en(f.gridLines),w=-V.toRadians(h.labelRotation),k=[];for("top"===g?(i=h.bottom-_-x,o=w?"left":"center"):"bottom"===g?(i=h.top+_+x,o=w?"right":"center"):"left"===g?(a=h.right-(m?0:_)-x,o=m?"left":"right"):(a=h.left+(m?0:_)+x,o=m?"right":"left"),e=0,t=y.length;e<t;++e)Jt(r=(n=y[e]).label)||(s=h.getPixelForTick(n._index||e)+p.labelOffset,u=(l=n.major?b.major:b.minor).lineHeight,c=Kt(r)?r.length:1,v?(a=s,d="top"===g?((w?1:.5)-c)*u:(w?0:.5)*u):(i=s,d=(1-c)*u/2),k.push({x:a,y:i,rotation:w,label:r,font:l,textOffset:d,textAlign:o}));return k},_drawGrid:function(e){var t=this,n=t.options.gridLines;if(n.display){var r,a,i,o,s,l=t.ctx,u=t.chart,c=V._alignPixel,d=n.drawBorder?Zt(n.lineWidth,0,0):0,h=t._gridLineItems||(t._gridLineItems=t._computeGridLineItems(e));for(i=0,o=h.length;i<o;++i)a=(s=h[i]).color,(r=s.width)&&a&&(l.save(),l.lineWidth=r,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(d){var f,p,g,m,v=d,y=Zt(n.lineWidth,h.ticksLength-1,1),b=h.borderValue;t.isHorizontal()?(f=c(u,t.left,v)-v/2,p=c(u,t.right,y)+y/2,g=m=b):(g=c(u,t.top,v)-v/2,m=c(u,t.bottom,y)+y/2,f=p=b),l.lineWidth=d,l.strokeStyle=Zt(n.color,0),l.beginPath(),l.moveTo(f,g),l.lineTo(p,m),l.stroke()}}},_drawLabels:function(){var e=this;if(e.options.ticks.display){var t,n,r,a,i,o,s,l,u=e.ctx,c=e._labelItems||(e._labelItems=e._computeLabelItems());for(t=0,r=c.length;t<r;++t){if(o=(i=c[t]).font,u.save(),u.translate(i.x,i.y),u.rotate(i.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=i.textAlign,l=i.textOffset,Kt(s=i.label))for(n=0,a=s.length;n<a;++n)u.fillText(""+s[n],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,n=e.options,r=n.scaleLabel;if(r.display){var a,i,o=Qt(r.fontColor,I.global.defaultFontColor),s=V.options._parseFont(r),l=V.options.toPadding(r.padding),u=s.lineHeight/2,c=n.position,d=0;if(e.isHorizontal())a=e.left+e.width/2,i="bottom"===c?e.bottom-u-l.bottom:e.top+u+l.top;else{var h="left"===c;a=h?e.left+u+l.top:e.right-u-l.top,i=e.top+e.height/2,d=h?-.5*Math.PI:.5*Math.PI}t.save(),t.translate(a,i),t.rotate(d),t.textAlign="center",t.textBaseline="middle",t.fillStyle=o,t.font=s.string,t.fillText(r.labelString,0,0),t.restore()}},draw:function(e){var t=this;t._isVisible()&&(t._drawGrid(e),t._drawTitle(),t._drawLabels())},_layers:function(){var e=this,t=e.options,n=t.ticks&&t.ticks.z||0,r=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&n!==r&&e.draw===e._draw?[{z:r,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:n,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:n,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,n=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter(function(r){return(!e||r.type===e)&&(n?r.xAxisID===t.id:r.yAxisID===t.id)})}});sn.prototype._draw=sn.prototype.draw;var ln=sn,un=V.isNullOrUndef,cn=ln.extend({determineDataLimits:function(){var e,t=this,n=t._getLabels(),r=t.options.ticks,a=r.min,i=r.max,o=0,s=n.length-1;void 0!==a&&(e=n.indexOf(a))>=0&&(o=e),void 0!==i&&(e=n.indexOf(i))>=0&&(s=e),t.minIndex=o,t.maxIndex=s,t.min=n[o],t.max=n[s]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,r=e.maxIndex;e.ticks=0===n&&r===t.length-1?t:t.slice(n,r+1)},getLabelForIndex:function(e,t){var n=this,r=n.chart;return r.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(r.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;ln.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var r,a,i,o=this;return un(t)||un(n)||(e=o.chart.data.datasets[n].data[t]),un(e)||(r=o.isHorizontal()?e.x:e.y),(void 0!==r||void 0!==e&&isNaN(t))&&(a=o._getLabels(),e=V.valueOrDefault(r,e),t=-1!==(i=a.indexOf(e))?i:t,isNaN(t)&&(t=e)),o.getPixelForDecimal((t-o._startValue)/o._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}});cn._defaults={position:"bottom"};var dn=V.isNullOrUndef,hn=ln.extend({getRightValue:function(e){return"string"==typeof e?+e:ln.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var n=V.sign(e.min),r=V.sign(e.max);n<0&&r<0?e.max=0:n>0&&r>0&&(e.min=0)}var a=void 0!==t.min||void 0!==t.suggestedMin,i=void 0!==t.max||void 0!==t.suggestedMax;void 0!==t.min?e.min=t.min:void 0!==t.suggestedMin&&(e.min=null===e.min?t.suggestedMin:Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(e.max=null===e.max?t.suggestedMax:Math.max(e.max,t.suggestedMax)),a!==i&&e.min>=e.max&&(a?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,r=n.stepSize,a=n.maxTicksLimit;return r?e=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(e=t._computeTickLimit(),a=a||11),a&&(e=Math.min(a,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:V.noop,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),r={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:V.valueOrDefault(t.fixedStepSize,t.stepSize)},a=e.ticks=function(e,t){var n,r,a,i,o=[],s=e.stepSize,l=s||1,u=e.maxTicks-1,c=e.min,d=e.max,h=e.precision,f=t.min,p=t.max,g=V.niceNum((p-f)/u/l)*l;if(g<1e-14&&dn(c)&&dn(d))return[f,p];(i=Math.ceil(p/g)-Math.floor(f/g))>u&&(g=V.niceNum(i*g/u/l)*l),s||dn(h)?n=Math.pow(10,V._decimalPlaces(g)):(n=Math.pow(10,h),g=Math.ceil(g*n)/n),r=Math.floor(f/g)*g,a=Math.ceil(p/g)*g,s&&(!dn(c)&&V.almostWhole(c/g,g/1e3)&&(r=c),!dn(d)&&V.almostWhole(d/g,g/1e3)&&(a=d)),i=V.almostEquals(i=(a-r)/g,Math.round(i),g/1e3)?Math.round(i):Math.ceil(i),r=Math.round(r*n)/n,a=Math.round(a*n)/n,o.push(dn(c)?r:c);for(var m=1;m<i;++m)o.push(Math.round((r+m*g)*n)/n);return o.push(dn(d)?a:d),o}(r,e);e.handleDirectionalChanges(),e.max=V.max(a),e.min=V.min(a),t.reverse?(a.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),ln.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),r=t.min,a=t.max;ln.prototype._configure.call(t),t.options.offset&&n.length&&(r-=e=(a-r)/Math.max(n.length-1,1)/2,a+=e),t._startValue=r,t._endValue=a,t._valueRange=a-r}}),fn={position:"left",ticks:{callback:Gt.formatters.linear}};function pn(e,t,n,r){var a,i,o=e.options,s=function(e,t,n){var r=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[r]&&(e[r]={pos:[],neg:[]}),e[r]}(t,o.stacked,n),l=s.pos,u=s.neg,c=r.length;for(a=0;a<c;++a)i=e._parseValue(r[a]),isNaN(i.min)||isNaN(i.max)||n.data[a].hidden||(l[a]=l[a]||0,u[a]=u[a]||0,o.relativePoints?l[a]=100:i.min<0||i.max<0?u[a]+=i.min:l[a]+=i.max)}function gn(e,t,n){var r,a,i=n.length;for(r=0;r<i;++r)a=e._parseValue(n[r]),isNaN(a.min)||isNaN(a.max)||t.data[r].hidden||(e.min=Math.min(e.min,a.min),e.max=Math.max(e.max,a.max))}var mn=hn.extend({determineDataLimits:function(){var e,t,n,r,a=this,i=a.options,o=a.chart.data.datasets,s=a._getMatchingVisibleMetas(),l=i.stacked,u={},c=s.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===l)for(e=0;!l&&e<c;++e)l=void 0!==(t=s[e]).stack;for(e=0;e<c;++e)n=o[(t=s[e]).index].data,l?pn(a,u,t,n):gn(a,t,n);V.each(u,function(e){r=e.pos.concat(e.neg),a.min=Math.min(a.min,V.min(r)),a.max=Math.max(a.max,V.max(r))}),a.min=V.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=V.isFinite(a.max)&&!isNaN(a.max)?a.max:1,a.handleTickRangeOptions()},_computeTickLimit:function(){var e,t=this;return t.isHorizontal()?Math.ceil(t.width/40):(e=V.options._parseFont(t.options.ticks),Math.ceil(t.height/e.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForValue:function(e){var t=this;return t.getPixelForDecimal((+t.getRightValue(e)-t._startValue)/t._valueRange)},getValueForPixel:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange},getPixelForTick:function(e){var t=this.ticksAsNumbers;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])}});mn._defaults=fn;var vn=V.valueOrDefault,yn=V.math.log10,bn={position:"left",ticks:{callback:Gt.formatters.logarithmic}};function xn(e,t){return V.isFinite(e)&&e>=0?e:t}var _n=ln.extend({determineDataLimits:function(){var e,t,n,r,a,i,o=this,s=o.options,l=o.chart,u=l.data.datasets,c=o.isHorizontal();function d(e){return c?e.xAxisID===o.id:e.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&d(t)&&void 0!==t.stack){h=!0;break}if(s.stacked||h){var f={};for(e=0;e<u.length;e++){var p=[(t=l.getDatasetMeta(e)).type,void 0===s.stacked&&void 0===t.stack?e:"",t.stack].join(".");if(l.isDatasetVisible(e)&&d(t))for(void 0===f[p]&&(f[p]=[]),a=0,i=(r=u[e].data).length;a<i;a++){var g=f[p];n=o._parseValue(r[a]),isNaN(n.min)||isNaN(n.max)||t.data[a].hidden||n.min<0||n.max<0||(g[a]=g[a]||0,g[a]+=n.max)}}V.each(f,function(e){if(e.length>0){var t=V.min(e),n=V.max(e);o.min=Math.min(o.min,t),o.max=Math.max(o.max,n)}})}else for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&d(t))for(a=0,i=(r=u[e].data).length;a<i;a++)n=o._parseValue(r[a]),isNaN(n.min)||isNaN(n.max)||t.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=V.isFinite(o.min)?o.min:null,o.max=V.isFinite(o.max)?o.max:null,o.minNotZero=V.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;e.min=xn(t.min,e.min),e.max=xn(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(yn(e.min))-1),e.max=Math.pow(10,Math.floor(yn(e.max))+1)):(e.min=1,e.max=10)),null===e.min&&(e.min=Math.pow(10,Math.floor(yn(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(yn(e.min))+1):10),null===e.minNotZero&&(e.minNotZero=e.min>0?e.min:e.max<1?Math.pow(10,Math.floor(yn(e.max))):1)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),r={min:xn(t.min),max:xn(t.max)},a=e.ticks=function(e,t){var n,r,a=[],i=vn(e.min,Math.pow(10,Math.floor(yn(t.min)))),o=Math.floor(yn(t.max)),s=Math.ceil(t.max/Math.pow(10,o));0===i?(n=Math.floor(yn(t.minNotZero)),r=Math.floor(t.minNotZero/Math.pow(10,n)),a.push(i),i=r*Math.pow(10,n)):(n=Math.floor(yn(i)),r=Math.floor(i/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(i),10==++r&&(r=1,l=++n>=0?1:l),i=Math.round(r*Math.pow(10,n)*l)/l}while(n<o||n===o&&r<s);var u=vn(e.max,i);return a.push(u),a}(r,e);e.max=V.max(a),e.min=V.min(a),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),ln.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(yn(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;ln.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=vn(e.options.ticks.fontSize,I.global.defaultFontSize)/e._length),e._startValue=yn(t),e._valueOffset=n,e._valueRange=(yn(e.max)-yn(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(yn(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}});_n._defaults=bn;var wn=V.valueOrDefault,kn=V.valueAtIndexOrDefault,Sn=V.options.resolve,On={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Gt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Mn(e){var t=e.ticks;return t.display&&e.display?wn(t.fontSize,I.global.defaultFontSize)+2*t.backdropPaddingY:0}function Pn(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function Cn(e){return 0===e||180===e?"center":e<180?"left":"right"}function Dn(e,t,n,r){var a,i,o=n.y+r/2;if(V.isArray(t))for(a=0,i=t.length;a<i;++a)e.fillText(t[a],n.x,o),o+=r;else e.fillText(t,n.x,o)}function Tn(e,t,n){90===e||270===e?n.y-=t.h/2:(e>270||e<90)&&(n.y-=t.h)}function Rn(e){return V.isNumber(e)?e:0}var An=hn.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=Mn(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;V.each(t.data.datasets,function(a,i){if(t.isDatasetVisible(i)){var o=t.getDatasetMeta(i);V.each(a.data,function(t,a){var i=+e.getRightValue(t);isNaN(i)||o.data[a].hidden||(n=Math.min(i,n),r=Math.max(i,r))})}}),e.min=n===Number.POSITIVE_INFINITY?0:n,e.max=r===Number.NEGATIVE_INFINITY?0:r,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Mn(this.options))},convertTicksToLabels:function(){var e=this;hn.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(function(){var t=V.callback(e.options.pointLabels.callback,arguments,e);return t||0===t?t:""})},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this,t=e.options;t.display&&t.pointLabels.display?function(e){var t,n,r,a=V.options._parseFont(e.options.pointLabels),i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},o={};e.ctx.font=a.string,e._pointLabelSizes=[];var s,l,u,c=e.chart.data.labels.length;for(t=0;t<c;t++){r=e.getPointPosition(t,e.drawingArea+5),s=e.ctx,l=a.lineHeight,n=V.isArray(u=e.pointLabels[t])?{w:V.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},e._pointLabelSizes[t]=n;var d=e.getIndexAngle(t),h=V.toDegrees(d)%360,f=Pn(h,r.x,n.w,0,180),p=Pn(h,r.y,n.h,90,270);f.start<i.l&&(i.l=f.start,o.l=d),f.end>i.r&&(i.r=f.end,o.r=d),p.start<i.t&&(i.t=p.start,o.t=d),p.end>i.b&&(i.b=p.end,o.b=d)}e.setReductions(e.drawingArea,i,o)}(e):e.setCenterPoint(0,0,0,0)},setReductions:function(e,t,n){var r=this,a=t.l/Math.sin(n.l),i=Math.max(t.r-r.width,0)/Math.sin(n.r),o=-t.t/Math.cos(n.t),s=-Math.max(t.b-(r.height-r.paddingTop),0)/Math.cos(n.b);a=Rn(a),i=Rn(i),o=Rn(o),s=Rn(s),r.drawingArea=Math.min(Math.floor(e-(a+i)/2),Math.floor(e-(o+s)/2)),r.setCenterPoint(a,i,o,s)},setCenterPoint:function(e,t,n,r){var a=this,i=n+a.drawingArea,o=a.height-a.paddingTop-r-a.drawingArea;a.xCenter=Math.floor((e+a.drawingArea+(a.width-t-a.drawingArea))/2+a.left),a.yCenter=Math.floor((i+o)/2+a.top+a.paddingTop)},getIndexAngle:function(e){var t=this.chart,n=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(V.isNullOrUndef(e))return NaN;var n=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*n:(e-t.min)*n},getPointPosition:function(e,t){var n=this,r=n.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(r)*t+n.xCenter,y:Math.sin(r)*t+n.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this,n=t.min,r=t.max;return t.getPointPositionForValue(e||0,t.beginAtZero?0:n<0&&r<0?r:n>0&&r>0?n:0)},_drawGrid:function(){var e,t,n,r=this,a=r.ctx,i=r.options,o=i.gridLines,s=i.angleLines,l=wn(s.lineWidth,o.lineWidth),u=wn(s.color,o.color);if(i.pointLabels.display&&function(e){var t=e.ctx,n=e.options,r=n.pointLabels,a=Mn(n),i=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),o=V.options._parseFont(r);t.save(),t.font=o.string,t.textBaseline="middle";for(var s=e.chart.data.labels.length-1;s>=0;s--){var l=e.getPointPosition(s,i+(0===s?a/2:0)+5),u=kn(r.fontColor,s,I.global.defaultFontColor);t.fillStyle=u;var c=e.getIndexAngle(s),d=V.toDegrees(c);t.textAlign=Cn(d),Tn(d,e._pointLabelSizes[s],l),Dn(t,e.pointLabels[s],l,o.lineHeight)}t.restore()}(r),o.display&&V.each(r.ticks,function(e,n){0!==n&&(t=r.getDistanceFromCenterForValue(r.ticksAsNumbers[n]),function(e,t,n,r){var a,i=e.ctx,o=t.circular,s=e.chart.data.labels.length,l=kn(t.color,r-1),u=kn(t.lineWidth,r-1);if((o||s)&&l&&u){if(i.save(),i.strokeStyle=l,i.lineWidth=u,i.setLineDash&&(i.setLineDash(t.borderDash||[]),i.lineDashOffset=t.borderDashOffset||0),i.beginPath(),o)i.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{a=e.getPointPosition(0,n),i.moveTo(a.x,a.y);for(var c=1;c<s;c++)a=e.getPointPosition(c,n),i.lineTo(a.x,a.y)}i.closePath(),i.stroke(),i.restore()}}(r,o,t,n))}),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(Sn([s.borderDash,o.borderDash,[]])),a.lineDashOffset=Sn([s.borderDashOffset,o.borderDashOffset,0])),e=r.chart.data.labels.length-1;e>=0;e--)t=r.getDistanceFromCenterForValue(i.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),a.beginPath(),a.moveTo(r.xCenter,r.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var r,a,i=e.getIndexAngle(0),o=V.options._parseFont(n),s=wn(n.fontColor,I.global.defaultFontColor);t.save(),t.font=o.string,t.translate(e.xCenter,e.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",V.each(e.ticks,function(i,l){(0!==l||n.reverse)&&(r=e.getDistanceFromCenterForValue(e.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=t.measureText(i).width,t.fillStyle=n.backdropColor,t.fillRect(-a/2-n.backdropPaddingX,-r-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),t.fillStyle=s,t.fillText(i,0,-r))}),t.restore()}},_drawTitle:V.noop});An._defaults=On;var jn=V._deprecated,Nn=V.options.resolve,En=V.valueOrDefault,In=Number.MIN_SAFE_INTEGER||-9007199254740991,Ln=Number.MAX_SAFE_INTEGER||9007199254740991,Fn={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}},Wn=Object.keys(Fn);function zn(e,t){return e-t}function Vn(e){return V.valueOrDefault(e.time.min,e.ticks.min)}function Yn(e){return V.valueOrDefault(e.time.max,e.ticks.max)}function Bn(e,t,n,r){var a=function(e,t,n){for(var r,a,i,o=0,s=e.length-1;o>=0&&o<=s;){if(i=e[r=o+s>>1],!(a=e[r-1]||null))return{lo:null,hi:i};if(i[t]<n)o=r+1;else{if(!(a[t]>n))return{lo:a,hi:i};s=r-1}}return{lo:i,hi:null}}(e,t,n),i=a.lo?a.hi?a.lo:e[e.length-2]:e[0],o=a.lo?a.hi?a.hi:e[e.length-1]:e[1],s=o[t]-i[t];return i[r]+(o[r]-i[r])*(s?(n-i[t])/s:0)}function Hn(e,t){var n=e._adapter,r=e.options.time,a=r.parser,i=a||r.format,o=t;return"function"==typeof a&&(o=a(o)),V.isFinite(o)||(o="string"==typeof i?n.parse(o,i):n.parse(o)),null!==o?+o:(a||"function"!=typeof i||(o=i(t),V.isFinite(o)||(o=n.parse(o))),o)}function $n(e,t){if(V.isNullOrUndef(t))return null;var n=e.options.time,r=Hn(e,e.getRightValue(t));return null===r||n.round&&(r=+e._adapter.startOf(r,n.round)),r}function Un(e,t,n,r){var a,i,o=Wn.length;for(a=Wn.indexOf(e);a<o-1;++a)if((i=Fn[Wn[a]]).common&&Math.ceil((n-t)/((i.steps?i.steps:Ln)*i.size))<=r)return Wn[a];return Wn[o-1]}function qn(e,t,n){var r,a,i=[],o={},s=t.length;for(r=0;r<s;++r)o[a=t[r]]=r,i.push({value:a,major:!1});return 0!==s&&n?function(e,t,n,r){var a,i,o=e._adapter,s=+o.startOf(t[0].value,r),l=t[t.length-1].value;for(a=s;a<=l;a=+o.add(a,1,r))(i=n[a])>=0&&(t[i].major=!0);return t}(e,i,o,n):i}var Gn=ln.extend({initialize:function(){this.mergeTicksOptions(),ln.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,n=t.time||(t.time={}),r=e._adapter=new qt._date(t.adapters.date);return jn("time scale",n.format,"time.format","time.parser"),jn("time scale",n.min,"time.min","ticks.min"),jn("time scale",n.max,"time.max","ticks.max"),V.mergeIf(n.displayFormats,r.formats()),ln.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),ln.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,n,r,a,i,o,s=this,l=s.chart,u=s._adapter,c=s.options,d=c.time.unit||"day",h=Ln,f=In,p=[],g=[],m=[],v=s._getLabels();for(e=0,n=v.length;e<n;++e)m.push($n(s,v[e]));for(e=0,n=(l.data.datasets||[]).length;e<n;++e)if(l.isDatasetVisible(e))if(V.isObject((a=l.data.datasets[e].data)[0]))for(g[e]=[],t=0,r=a.length;t<r;++t)i=$n(s,a[t]),p.push(i),g[e][t]=i;else g[e]=m.slice(0),o||(p=p.concat(m),o=!0);else g[e]=[];m.length&&(h=Math.min(h,m[0]),f=Math.max(f,m[m.length-1])),p.length&&(p=n>1?function(e){var t,n,r,a={},i=[];for(t=0,n=e.length;t<n;++t)a[r=e[t]]||(a[r]=!0,i.push(r));return i}(p).sort(zn):p.sort(zn),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=$n(s,Vn(c))||h,f=$n(s,Yn(c))||f,h=h===Ln?+u.startOf(Date.now(),d):h,f=f===In?+u.endOf(Date.now(),d)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:p,datasets:g,labels:m}},buildTicks:function(){var e,t,n,r=this,a=r.min,i=r.max,o=r.options,s=o.ticks,l=o.time,u=r._timestamps,c=[],d=r.getLabelCapacity(a),h=s.source,f=o.distribution;for(u="data"===h||"auto"===h&&"series"===f?u.data:"labels"===h?u.labels:function(e,t,n,r){var a,i=e._adapter,o=e.options,s=o.time,l=s.unit||Un(s.minUnit,t,n,r),u=Nn([s.stepSize,s.unitStepSize,1]),c="week"===l&&s.isoWeekday,d=t,h=[];if(c&&(d=+i.startOf(d,"isoWeek",c)),d=+i.startOf(d,c?"day":l),i.diff(n,t,l)>1e5*u)throw t+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=d;a<n;a=+i.add(a,u,l))h.push(a);return a!==n&&"ticks"!==o.bounds||h.push(a),h}(r,a,i,d),"ticks"===o.bounds&&u.length&&(a=u[0],i=u[u.length-1]),a=$n(r,Vn(o))||a,i=$n(r,Yn(o))||i,e=0,t=u.length;e<t;++e)(n=u[e])>=a&&n<=i&&c.push(n);return r.min=a,r.max=i,r._unit=l.unit||(s.autoSkip?Un(l.minUnit,r.min,r.max,d):function(e,t,n,r,a){var i,o;for(i=Wn.length-1;i>=Wn.indexOf(n);i--)if(Fn[o=Wn[i]].common&&e._adapter.diff(a,r,o)>=t-1)return o;return Wn[n?Wn.indexOf(n):0]}(r,c.length,l.minUnit,r.min,r.max)),r._majorUnit=s.major.enabled&&"year"!==r._unit?function(e){for(var t=Wn.indexOf(e)+1,n=Wn.length;t<n;++t)if(Fn[Wn[t]].common)return Wn[t]}(r._unit):void 0,r._table=function(e,t,n,r){if("linear"===r||!e.length)return[{time:t,pos:0},{time:n,pos:1}];var a,i,o,s,l,u=[],c=[t];for(a=0,i=e.length;a<i;++a)(s=e[a])>t&&s<n&&c.push(s);for(c.push(n),a=0,i=c.length;a<i;++a)l=c[a+1],s=c[a],void 0!==(o=c[a-1])&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(i-1)});return u}(r._timestamps.data,a,i,f),r._offsets=function(e,t,n,r,a){var i,o,s=0,l=0;return a.offset&&t.length&&(i=Bn(e,"time",t[0],"pos"),s=1===t.length?1-i:(Bn(e,"time",t[1],"pos")-i)/2,o=Bn(e,"time",t[t.length-1],"pos"),l=1===t.length?o:(o-Bn(e,"time",t[t.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(r._table,c,0,0,o),s.reverse&&c.reverse(),qn(r,c,r._majorUnit)},getLabelForIndex:function(e,t){var n=this,r=n._adapter,a=n.chart.data,i=n.options.time,o=a.labels&&e<a.labels.length?a.labels[e]:"",s=a.datasets[t].data[e];return V.isObject(s)&&(o=n.getRightValue(s)),i.tooltipFormat?r.format(Hn(n,o),i.tooltipFormat):"string"==typeof o?o:r.format(Hn(n,o),i.displayFormats.datetime)},tickFormatFunction:function(e,t,n,r){var a=this,i=a.options,o=i.time.displayFormats,s=a._majorUnit,l=o[s],u=n[t],c=i.ticks,d=s&&l&&u&&u.major,h=a._adapter.format(e,r||(d?l:o[a._unit])),f=d?c.major:c.minor,p=Nn([f.callback,f.userCallback,c.callback,c.userCallback]);return p?p(h,t,n):h},convertTicksToLabels:function(e){var t,n,r=[];for(t=0,n=e.length;t<n;++t)r.push(this.tickFormatFunction(e[t].value,t,e));return r},getPixelForOffset:function(e){var t=this,n=t._offsets,r=Bn(t._table,"time",e,"pos");return t.getPixelForDecimal((n.start+r)*n.factor)},getPixelForValue:function(e,t,n){var r=this,a=null;if(void 0!==t&&void 0!==n&&(a=r._timestamps.datasets[n][t]),null===a&&(a=$n(r,e)),null!==a)return r.getPixelForOffset(a)},getPixelForTick:function(e){var t=this.getTicks();return e>=0&&e<t.length?this.getPixelForOffset(t[e].value):null},getValueForPixel:function(e){var t=this,n=t._offsets,r=t.getDecimalForPixel(e)/n.factor-n.end,a=Bn(t._table,"pos",r,"time");return t._adapter._create(a)},_getLabelSize:function(e){var t=this,n=t.options.ticks,r=t.ctx.measureText(e).width,a=V.toRadians(t.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(a),o=Math.sin(a),s=En(n.fontSize,I.global.defaultFontSize);return{w:r*i+s*o,h:r*o+s*i}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,n=t.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,i=t.tickFormatFunction(e,0,qn(t,[e],t._majorUnit),a),o=t._getLabelSize(i),s=Math.floor(t.isHorizontal()?t.width/o.w:t.height/o.h);return t.options.offset&&s--,s>0?s:1}});Gn._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var Kn={category:cn,linear:mn,logarithmic:_n,radialLinear:An,time:Gn},Jn={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};qt._date.override("function"==typeof e?{_id:"moment",formats:function(){return Jn},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,r){return e(t).add(n,r).valueOf()},diff:function(t,n,r){return e(t).diff(e(n),r)},startOf:function(t,n,r){return t=e(t),"isoWeek"===n?t.isoWeekday(r).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),I._set("global",{plugins:{filler:{propagate:!0}}});var Qn={dataset:function(e){var t=e.fill,n=e.chart,r=n.getDatasetMeta(t),a=r&&n.isDatasetVisible(t)&&r.dataset._children||[],i=a.length||0;return i?function(e,t){return t<i&&a[t]._view||null}:null},boundary:function(e){var t=e.boundary,n=t?t.x:null,r=t?t.y:null;return V.isArray(t)?function(e,n){return t[n]}:function(e){return{x:null===n?e.x:n,y:null===r?e.y:r}}}};function Zn(e,t,n){var r,a=e._model||{},i=a.fill;if(void 0===i&&(i=!!a.backgroundColor),!1===i||null===i)return!1;if(!0===i)return"origin";if(r=parseFloat(i,10),isFinite(r)&&Math.floor(r)===r)return"-"!==i[0]&&"+"!==i[0]||(r=t+r),!(r===t||r<0||r>=n)&&r;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function Xn(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,n,r,a,i,o=e.el._scale,s=o.options,l=o.chart.data.labels.length,u=e.fill,c=[];if(!l)return null;for(n=s.ticks.reverse?o.min:o.max,r=o.getPointPositionForValue(0,t=s.ticks.reverse?o.max:o.min),a=0;a<l;++a)i="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?t:n):o.getBasePosition(a),s.gridLines.circular&&(i.cx=r.x,i.cy=r.y,i.angle=o.getIndexAngle(a)-Math.PI/2),c.push(i);return c}(e):function(e){var t,n=e.el._model||{},r=e.el._scale||{},a=e.fill,i=null;if(isFinite(a))return null;if("start"===a?i=void 0===n.scaleBottom?r.bottom:n.scaleBottom:"end"===a?i=void 0===n.scaleTop?r.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:r.getBasePixel&&(i=r.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if(V.isFinite(i))return{x:(t=r.isHorizontal())?i:null,y:t?null:i}}return null}(e)}function er(e,t,n){var r,a=e[t].fill,i=[t];if(!n)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!isFinite(a))return a;if(!(r=e[a]))return!1;if(r.visible)return a;i.push(a),a=r.fill}return!1}function tr(e){var t=e.fill,n="dataset";return!1===t?null:(isFinite(t)||(n="boundary"),Qn[n](e))}function nr(e){return e&&!e.skip}function rr(e,t,n,r,a){var i,o,s,l;if(r&&a){for(e.moveTo(t[0].x,t[0].y),i=1;i<r;++i)V.canvas.lineTo(e,t[i-1],t[i]);if(void 0===n[0].angle)for(e.lineTo(n[a-1].x,n[a-1].y),i=a-1;i>0;--i)V.canvas.lineTo(e,n[i],n[i-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),i=a-1;i>0;--i)e.arc(o,s,l,n[i].angle,n[i-1].angle,!0)}}function ar(e,t,n,r,a,i){var o,s,l,u,c,d,h,f,p=t.length,g=r.spanGaps,m=[],v=[],y=0,b=0;for(e.beginPath(),o=0,s=p;o<s;++o)c=n(u=t[l=o%p]._view,l,r),d=nr(u),h=nr(c),i&&void 0===f&&d&&(s=p+(f=o+1)),d&&h?(y=m.push(u),b=v.push(c)):y&&b&&(g?(d&&m.push(u),h&&v.push(c)):(rr(e,m,v,y,b),y=b=0,m=[],v=[]));rr(e,m,v,y,b),e.closePath(),e.fillStyle=a,e.fill()}var ir={id:"filler",afterDatasetsUpdate:function(e,t){var n,r,a,i,o=(e.data.datasets||[]).length,s=t.propagate,l=[];for(r=0;r<o;++r)i=null,(a=(n=e.getDatasetMeta(r)).dataset)&&a._model&&a instanceof ve.Line&&(i={visible:e.isDatasetVisible(r),fill:Zn(a,r,o),chart:e,el:a}),n.$filler=i,l.push(i);for(r=0;r<o;++r)(i=l[r])&&(i.fill=er(l,r,s),i.boundary=Xn(i),i.mapper=tr(i))},beforeDatasetsDraw:function(e){var t,n,r,a,i,o,s,l=e._getSortedVisibleDatasetMetas(),u=e.ctx;for(n=l.length-1;n>=0;--n)(t=l[n].$filler)&&t.visible&&(i=(r=t.el)._children||[],s=(a=r._view).backgroundColor||I.global.defaultColor,(o=t.mapper)&&s&&i.length&&(V.canvas.clipArea(u,e.chartArea),ar(u,i,o,a,s,r._loop),V.canvas.unclipArea(u)))}},or=V.rtl.getRtlAdapter,sr=V.noop,lr=V.valueOrDefault;function ur(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}I._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,r=this.chart,a=r.getDatasetMeta(n);a.hidden=null===a.hidden?!r.data.datasets[n].hidden:null,r.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},r=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(n){var a=n.controller.getStyle(r?0:void 0);return{text:t[n.index].label,fillStyle:a.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(e){var t,n,r,a=document.createElement("ul"),i=e.data.datasets;for(a.setAttribute("class",e.id+"-legend"),t=0,n=i.length;t<n;t++)(r=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=i[t].backgroundColor,i[t].label&&r.appendChild(document.createTextNode(i[t].label));return a.outerHTML}});var cr=U.extend({initialize:function(e){var t=this;V.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:sr,update:function(e,t,n){var r=this;return r.beforeUpdate(),r.maxWidth=e,r.maxHeight=t,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:sr,beforeSetDimensions:sr,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:sr,beforeBuildLabels:sr,buildLabels:function(){var e=this,t=e.options.labels||{},n=V.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter(function(n){return t.filter(n,e.chart.data)})),e.options.reverse&&n.reverse(),e.legendItems=n},afterBuildLabels:sr,beforeFit:sr,fit:function(){var e=this,t=e.options,n=t.labels,r=t.display,a=e.ctx,i=V.options._parseFont(n),o=i.size,s=e.legendHitBoxes=[],l=e.minSize,u=e.isHorizontal();if(u?(l.width=e.maxWidth,l.height=r?10:0):(l.width=r?10:0,l.height=e.maxHeight),r){if(a.font=i.string,u){var c=e.lineWidths=[0],d=0;a.textAlign="left",a.textBaseline="middle",V.each(e.legendItems,function(e,t){var r=ur(n,o)+o/2+a.measureText(e.text).width;(0===t||c[c.length-1]+r+2*n.padding>l.width)&&(d+=o+n.padding,c[c.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:r,height:o},c[c.length-1]+=r+n.padding}),l.height+=d}else{var h=n.padding,f=e.columnWidths=[],p=e.columnHeights=[],g=n.padding,m=0,v=0;V.each(e.legendItems,function(e,t){var r=ur(n,o)+o/2+a.measureText(e.text).width;t>0&&v+o+2*h>l.height&&(g+=m+n.padding,f.push(m),p.push(v),m=0,v=0),m=Math.max(m,r),v+=o+h,s[t]={left:0,top:0,width:r,height:o}}),g+=m,f.push(m),p.push(v),l.width+=g}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:sr,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,r=I.global,a=r.defaultColor,i=r.elements.line,o=e.height,s=e.columnHeights,l=e.width,u=e.lineWidths;if(t.display){var c,d=or(t.rtl,e.left,e.minSize.width),h=e.ctx,f=lr(n.fontColor,r.defaultFontColor),p=V.options._parseFont(n),g=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var m=ur(n,g),v=e.legendHitBoxes,y=function(e,r){switch(t.align){case"start":return n.padding;case"end":return e-r;default:return(e-r+n.padding)/2}},b=e.isHorizontal();c=b?{x:e.left+y(l,u[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+y(o,s[0]),line:0},V.rtl.overrideTextDirection(e.ctx,t.textDirection);var x=g+n.padding;V.each(e.legendItems,function(t,r){var f=h.measureText(t.text).width,p=m+g/2+f,_=c.x,w=c.y;d.setWidth(e.minSize.width),b?r>0&&_+p+n.padding>e.left+e.minSize.width&&(w=c.y+=x,c.line++,_=c.x=e.left+y(l,u[c.line])):r>0&&w+x>e.top+e.minSize.height&&(_=c.x=_+e.columnWidths[c.line]+n.padding,c.line++,w=c.y=e.top+y(o,s[c.line]));var k=d.x(_);(function(e,t,r){if(!(isNaN(m)||m<=0)){h.save();var o=lr(r.lineWidth,i.borderWidth);if(h.fillStyle=lr(r.fillStyle,a),h.lineCap=lr(r.lineCap,i.borderCapStyle),h.lineDashOffset=lr(r.lineDashOffset,i.borderDashOffset),h.lineJoin=lr(r.lineJoin,i.borderJoinStyle),h.lineWidth=o,h.strokeStyle=lr(r.strokeStyle,a),h.setLineDash&&h.setLineDash(lr(r.lineDash,i.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(e,m/2);V.canvas.drawPoint(h,r.pointStyle,s,l,t+g/2,r.rotation)}else h.fillRect(d.leftForLtr(e,m),t,m,g),0!==o&&h.strokeRect(d.leftForLtr(e,m),t,m,g);h.restore()}})(k,w,t),v[r].left=d.leftForLtr(k,v[r].width),v[r].top=w,function(e,t,n,r){var a=g/2,i=d.xPlus(e,m+a),o=t+a;h.fillText(n.text,i,o),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(i,o),h.lineTo(d.xPlus(i,r),o),h.stroke())}(k,w,t,f),b?c.x+=p+n.padding:c.y+=x}),V.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,r,a,i=this;if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)for(a=i.legendHitBoxes,n=0;n<a.length;++n)if(e>=(r=a[n]).left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height)return i.legendItems[n];return null},handleEvent:function(e){var t,n=this,r=n.options,a="mouseup"===e.type?"click":e.type;if("mousemove"===a){if(!r.onHover&&!r.onLeave)return}else{if("click"!==a)return;if(!r.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===a?t&&r.onClick&&r.onClick.call(n,e.native,t):(r.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&r.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),r.onHover&&t&&r.onHover.call(n,e.native,t))}});function dr(e,t){var n=new cr({ctx:e.ctx,options:t,chart:e});st.configure(e,n,t),st.addBox(e,n),e.legend=n}var hr={id:"legend",_element:cr,beforeInit:function(e){var t=e.options.legend;t&&dr(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(V.mergeIf(t,I.global.legend),n?(st.configure(e,n,t),n.options=t):dr(e,t)):n&&(st.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},fr=V.noop;I._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var pr=U.extend({initialize:function(e){V.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:fr,update:function(e,t,n){var r=this;return r.beforeUpdate(),r.maxWidth=e,r.maxHeight=t,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:fr,beforeSetDimensions:fr,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:fr,beforeBuildLabels:fr,buildLabels:fr,afterBuildLabels:fr,beforeFit:fr,fit:function(){var e,t=this,n=t.options,r=t.minSize={},a=t.isHorizontal();n.display?(e=(V.isArray(n.text)?n.text.length:1)*V.options._parseFont(n).lineHeight+2*n.padding,t.width=r.width=a?t.maxWidth:e,t.height=r.height=a?e:t.maxHeight):t.width=r.width=t.height=r.height=0},afterFit:fr,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var r,a,i,o=V.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,c=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=V.valueOrDefault(n.fontColor,I.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(a=d+(f-d)/2,i=c+l,r=f-d):(a="left"===n.position?d+l:f-l,i=c+(h-c)/2,r=h-c,u=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(a,i),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var p=n.text;if(V.isArray(p))for(var g=0,m=0;m<p.length;++m)t.fillText(p[m],0,g,r),g+=s;else t.fillText(p,0,0,r);t.restore()}}});function gr(e,t){var n=new pr({ctx:e.ctx,options:t,chart:e});st.configure(e,n,t),st.addBox(e,n),e.titleBlock=n}var mr={},vr=ir,yr=hr,br={id:"title",_element:pr,beforeInit:function(e){var t=e.options.title;t&&gr(e,t)},beforeUpdate:function(e){var t=e.options.title,n=e.titleBlock;t?(V.mergeIf(t,I.global.title),n?(st.configure(e,n,t),n.options=t):gr(e,t)):n&&(st.removeBox(e,n),delete e.titleBlock)}};for(var xr in mr.filler=vr,mr.legend=yr,mr.title=br,Ht.helpers=V,function(){function e(e,t,n){var r;return"string"==typeof e?(r=parseInt(e,10),-1!==e.indexOf("%")&&(r=r/100*t.parentNode[n])):r=e,r}function t(e){return null!=e&&"none"!==e}function n(n,r,a){var i=document.defaultView,o=V._getParentNode(n),s=i.getComputedStyle(n)[r],l=i.getComputedStyle(o)[r],u=t(s),c=t(l),d=Number.POSITIVE_INFINITY;return u||c?Math.min(u?e(s,n,a):d,c?e(l,o,a):d):"none"}V.where=function(e,t){if(V.isArray(e)&&Array.prototype.filter)return e.filter(t);var n=[];return V.each(e,function(e){t(e)&&n.push(e)}),n},V.findIndex=Array.prototype.findIndex?function(e,t,n){return e.findIndex(t,n)}:function(e,t,n){n=void 0===n?e:n;for(var r=0,a=e.length;r<a;++r)if(t.call(n,e[r],r,e))return r;return-1},V.findNextWhere=function(e,t,n){V.isNullOrUndef(n)&&(n=-1);for(var r=n+1;r<e.length;r++){var a=e[r];if(t(a))return a}},V.findPreviousWhere=function(e,t,n){V.isNullOrUndef(n)&&(n=e.length);for(var r=n-1;r>=0;r--){var a=e[r];if(t(a))return a}},V.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},V.almostEquals=function(e,t,n){return Math.abs(e-t)<n},V.almostWhole=function(e,t){var n=Math.round(e);return n-t<=e&&n+t>=e},V.max=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.max(e,t)},Number.NEGATIVE_INFINITY)},V.min=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.min(e,t)},Number.POSITIVE_INFINITY)},V.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},V.toRadians=function(e){return e*(Math.PI/180)},V.toDegrees=function(e){return e*(180/Math.PI)},V._decimalPlaces=function(e){if(V.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},V.getAngleFromPoint=function(e,t){var n=t.x-e.x,r=t.y-e.y,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:a}},V.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},V.aliasPixel=function(e){return e%2==0?0:.5},V._alignPixel=function(e,t,n){var r=e.currentDevicePixelRatio,a=n/2;return Math.round((t-a)*r)/r+a},V.splineCurve=function(e,t,n,r){var a=e.skip?t:e,i=t,o=n.skip?t:n,s=Math.sqrt(Math.pow(i.x-a.x,2)+Math.pow(i.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),u=s/(s+l),c=l/(s+l),d=r*(u=isNaN(u)?0:u),h=r*(c=isNaN(c)?0:c);return{previous:{x:i.x-d*(o.x-a.x),y:i.y-d*(o.y-a.y)},next:{x:i.x+h*(o.x-a.x),y:i.y+h*(o.y-a.y)}}},V.EPSILON=Number.EPSILON||1e-14,V.splineCurveMonotone=function(e){var t,n,r,a,i,o,s,l,u,c=(e||[]).map(function(e){return{model:e._model,deltaK:0,mK:0}}),d=c.length;for(t=0;t<d;++t)if(!(r=c[t]).model.skip){if(n=t>0?c[t-1]:null,(a=t<d-1?c[t+1]:null)&&!a.model.skip){var h=a.model.x-r.model.x;r.deltaK=0!==h?(a.model.y-r.model.y)/h:0}r.mK=!n||n.model.skip?r.deltaK:!a||a.model.skip?n.deltaK:this.sign(n.deltaK)!==this.sign(r.deltaK)?0:(n.deltaK+r.deltaK)/2}for(t=0;t<d-1;++t)a=c[t+1],(r=c[t]).model.skip||a.model.skip||(V.almostEquals(r.deltaK,0,this.EPSILON)?r.mK=a.mK=0:(i=r.mK/r.deltaK,o=a.mK/r.deltaK,(l=Math.pow(i,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),r.mK=i*s*r.deltaK,a.mK=o*s*r.deltaK)));for(t=0;t<d;++t)(r=c[t]).model.skip||(a=t<d-1?c[t+1]:null,(n=t>0?c[t-1]:null)&&!n.model.skip&&(r.model.controlPointPreviousX=r.model.x-(u=(r.model.x-n.model.x)/3),r.model.controlPointPreviousY=r.model.y-u*r.mK),a&&!a.model.skip&&(r.model.controlPointNextX=r.model.x+(u=(a.model.x-r.model.x)/3),r.model.controlPointNextY=r.model.y+u*r.mK))},V.nextItem=function(e,t,n){return n?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},V.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},V.niceNum=function(e,t){var n=Math.floor(V.log10(e)),r=e/Math.pow(10,n);return(t?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,n)},V.requestAnimFrame="undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},V.getRelativePosition=function(e,t){var n,r,a=e.originalEvent||e,i=e.target||e.srcElement,o=i.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,r=s[0].clientY):(n=a.clientX,r=a.clientY);var l=parseFloat(V.getStyle(i,"padding-left")),u=parseFloat(V.getStyle(i,"padding-top")),c=parseFloat(V.getStyle(i,"padding-right")),d=parseFloat(V.getStyle(i,"padding-bottom")),h=o.bottom-o.top-u-d;return{x:n=Math.round((n-o.left-l)/(o.right-o.left-l-c)*i.width/t.currentDevicePixelRatio),y:r=Math.round((r-o.top-u)/h*i.height/t.currentDevicePixelRatio)}},V.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},V.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},V._calculatePadding=function(e,t,n){return(t=V.getStyle(e,t)).indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},V._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},V.getMaximumWidth=function(e){var t=V._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,r=n-V._calculatePadding(t,"padding-left",n)-V._calculatePadding(t,"padding-right",n),a=V.getConstraintWidth(e);return isNaN(a)?r:Math.min(r,a)},V.getMaximumHeight=function(e){var t=V._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,r=n-V._calculatePadding(t,"padding-top",n)-V._calculatePadding(t,"padding-bottom",n),a=V.getConstraintHeight(e);return isNaN(a)?r:Math.min(r,a)},V.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},V.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var r=e.canvas,a=e.height,i=e.width;r.height=a*n,r.width=i*n,e.ctx.scale(n,n),r.style.height||r.style.width||(r.style.height=a+"px",r.style.width=i+"px")}},V.fontString=function(e,t,n){return t+" "+e+"px "+n},V.longestText=function(e,t,n,r){var a=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(a=r.data={},i=r.garbageCollect=[],r.font=t),e.font=t;var o,s,l,u,c,d=0,h=n.length;for(o=0;o<h;o++)if(null!=(u=n[o])&&!0!==V.isArray(u))d=V.measureText(e,a,i,d,u);else if(V.isArray(u))for(s=0,l=u.length;s<l;s++)null==(c=u[s])||V.isArray(c)||(d=V.measureText(e,a,i,d,c));var f=i.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[i[o]];i.splice(0,f)}return d},V.measureText=function(e,t,n,r,a){var i=t[a];return i||(i=t[a]=e.measureText(a).width,n.push(a)),i>r&&(r=i),r},V.numberOfLabelLines=function(e){var t=1;return V.each(e,function(e){V.isArray(e)&&e.length>t&&(t=e.length)}),t},V.color=x?function(e){return e instanceof CanvasGradient&&(e=I.global.defaultColor),x(e)}:function(e){return console.error("Color.js not found!"),e},V.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:V.color(e).saturate(.5).darken(.1).rgbString()}}(),Ht._adapters=qt,Ht.Animation=G,Ht.animationService=K,Ht.controllers=$e,Ht.DatasetController=ee,Ht.defaults=I,Ht.Element=U,Ht.elements=ve,Ht.Interaction=Ze,Ht.layouts=st,Ht.platform=kt,Ht.plugins=St,Ht.Scale=ln,Ht.scaleService=Ot,Ht.Ticks=Gt,Ht.Tooltip=Et,Ht.helpers.each(Kn,function(e,t){Ht.scaleService.registerScaleType(t,e,e._defaults)}),mr)mr.hasOwnProperty(xr)&&Ht.plugins.register(mr[xr]);Ht.platform.initialize();var _r=Ht;return"undefined"!=typeof window&&(window.Chart=Ht),Ht.Chart=Ht,Ht.Legend=mr.legend._element,Ht.Title=mr.title._element,Ht.pluginService=Ht.plugins,Ht.PluginBase=Ht.Element.extend({}),Ht.canvasHelpers=Ht.helpers.canvas,Ht.layoutService=Ht.layouts,Ht.LinearScaleBase=hn,Ht.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){Ht[e]=function(t,n){return new Ht(t,Ht.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),_r}(function(){try{return moment$1}catch(e){}}())});const defaultDatasetIdKey="label";function reforwardRef(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function setOptions(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function setLabels(e,t){e.labels=t}function setDatasets(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultDatasetIdKey;const r=[];e.datasets=t.map(t=>{const a=e.datasets.find(e=>e[n]===t[n]);return a&&t.data&&!r.includes(a)?(r.push(a),Object.assign(a,t),a):{...t}})}function cloneData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultDatasetIdKey;const n={labels:[],datasets:[]};return setLabels(n,e.labels),setDatasets(n,e.datasets,t),n}function ChartComponent(e,t){const{height:n=150,width:r=300,redraw:a=!1,datasetIdKey:i,type:o,data:s,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...h}=e,f=React.useRef(null),p=React.useRef(),g=()=>{f.current&&(p.current=new Chart$1.Chart(f.current,{type:o,data:cloneData(s,i),options:l&&{...l},plugins:u}),reforwardRef(t,p.current))},m=()=>{reforwardRef(t,null),p.current&&(p.current.destroy(),p.current=null)};return React.useEffect(()=>{!a&&p.current&&l&&setOptions(p.current,l)},[a,l]),React.useEffect(()=>{!a&&p.current&&setLabels(p.current.config.data,s.labels)},[a,s.labels]),React.useEffect(()=>{!a&&p.current&&s.datasets&&setDatasets(p.current.config.data,s.datasets,i)},[a,s.datasets]),React.useEffect(()=>{p.current&&(a?(m(),setTimeout(g)):p.current.update(d))},[a,l,s.labels,s.datasets,d]),React.useEffect(()=>{p.current&&(m(),setTimeout(g))},[o]),React.useEffect(()=>(g(),()=>m()),[]),/*#__PURE__*/React__default.default.createElement("canvas",Object.assign({ref:f,role:"img",height:n,width:r},h),c)}const Chart=/*#__PURE__*/React.forwardRef(ChartComponent);var chartjsPluginDatasourcePrometheus_umd=createCommonjsModule(function(e,t){e.exports=function(){var e={exports:{}};!function(e,t){!function(e){var t={exports:{}},n=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},r=n,a=Object.prototype.toString;function i(e){return Array.isArray(e)}function o(e){return void 0===e}function s(e){return"[object ArrayBuffer]"===a.call(e)}function l(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===a.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}var h={isArray:i,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===a.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:l,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:c,isStream:function(e){return l(e)&&c(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===a.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:d,merge:function e(){var t={};function n(n,r){t[r]=u(t[r])&&u(n)?e(t[r],n):u(n)?e({},n):i(n)?n.slice():n}for(var r=0,a=arguments.length;r<a;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,function(t,a){e[a]=n&&"function"==typeof t?r(t,n):t}),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},f=h;function p(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var g=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(f.isURLSearchParams(t))r=t.toString();else{var a=[];f.forEach(t,function(e,t){null!=e&&(f.isArray(e)?t+="[]":e=[e],f.forEach(e,function(e){f.isDate(e)?e=e.toISOString():f.isObject(e)&&(e=JSON.stringify(e)),a.push(p(t)+"="+p(e))}))}),r=a.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},m=h;function v(){this.handlers=[]}v.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},v.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},v.prototype.forEach=function(e){m.forEach(this.handlers,function(t){null!==t&&e(t)})};var y=v,b=h,x=function(e,t,n,r,a){return e.config=t,n&&(e.code=n),e.request=r,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},w=x,k=function(e,t,n,r,a){var i=new Error(e);return w(i,t,n,r,a)},S=k,O=h,M=O.isStandardBrowserEnv()?{write:function(e,t,n,r,a,i){var o=[];o.push(e+"="+encodeURIComponent(t)),O.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),O.isString(r)&&o.push("path="+r),O.isString(a)&&o.push("domain="+a),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},P=h,C=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],D=h,T=D.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=D.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function R(e){this.message=e}R.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},R.prototype.__CANCEL__=!0;var A=R,j=h,N=M,E=g,I=T,L=k,F=_,W=A,z=h,V=function(e,t){b.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})},Y=x,B={"Content-Type":"application/x-www-form-urlencoded"};function H(e,t){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var $,U={transitional:_,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&($=function(e){return new Promise(function(t,n){var r,a=e.data,i=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}j.isFormData(a)&&delete i["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(u+":"+c)}var d=function(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}(e.baseURL,e.url);function h(){if(l){var r="getAllResponseHeaders"in l?function(e){var t,n,r,a={};return e?(P.forEach(e.split("\n"),function(e){if(r=e.indexOf(":"),t=P.trim(e.substr(0,r)).toLowerCase(),n=P.trim(e.substr(r+1)),t){if(a[t]&&C.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}(l.getAllResponseHeaders()):null;(function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(S("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)})(function(e){t(e),s()},function(e){n(e),s()},{data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}}if(l.open(e.method.toUpperCase(),E(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=h:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(h)},l.onabort=function(){l&&(n(L("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(L("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(L(t,e,(e.transitional||F).clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},j.isStandardBrowserEnv()){var f=(e.withCredentials||I(d))&&e.xsrfCookieName?N.read(e.xsrfCookieName):void 0;f&&(i[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&j.forEach(i,function(e,t){void 0===a&&"content-type"===t.toLowerCase()?delete i[t]:l.setRequestHeader(t,e)}),j.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(r=function(e){l&&(n(!e||e&&e.type?new W("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r))),a||(a=null),l.send(a)})}),$),transformRequest:[function(e,t){return V(t,"Accept"),V(t,"Content-Type"),z.isFormData(e)||z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)?e:z.isArrayBufferView(e)?e.buffer:z.isURLSearchParams(e)?(H(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):z.isObject(e)||t&&"application/json"===t["Content-Type"]?(H(t,"application/json"),function(e,t,n){if(z.isString(e))try{return(0,JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||U.transitional,n=!(t&&t.silentJSONParsing)&&"json"===this.responseType;if(n||t&&t.forcedJSONParsing&&z.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Y(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],function(e){U.headers[e]={}}),z.forEach(["post","put","patch"],function(e){U.headers[e]=z.merge(B)});var q=U,G=h,K=q,J=function(e){return!(!e||!e.__CANCEL__)},Q=h,Z=function(e,t,n){var r=this||K;return G.forEach(n,function(n){e=n.call(r,e,t)}),e},X=J,ee=q,te=A;function ne(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new te("canceled")}var re=h,ae=function(e,t){t=t||{};var n={};function r(e,t){return re.isPlainObject(e)&&re.isPlainObject(t)?re.merge(e,t):re.isPlainObject(t)?re.merge({},t):re.isArray(t)?t.slice():t}function a(n){return re.isUndefined(t[n])?re.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function i(e){if(!re.isUndefined(t[e]))return r(void 0,t[e])}function o(n){return re.isUndefined(t[n])?re.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function s(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return re.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=l[e]||a,r=t(e);re.isUndefined(r)&&t!==s||(n[e]=r)}),n},ie="0.26.1",oe=ie,se={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){se[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var le={};se.transitional=function(e,t,n){function r(e,t){return"[Axios v"+oe+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,a,i){if(!1===e)throw new Error(r(a," has been removed"+(t?" in "+t:"")));return t&&!le[a]&&(le[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,i)}};var ue={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),a=r.length;a-- >0;){var i=r[a],o=t[i];if(o){var s=e[i],l=void 0===s||o(s,i,e);if(!0!==l)throw new TypeError("option "+i+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:se},ce=h,de=g,he=y,fe=function(e){return ne(e),e.headers=e.headers||{},e.data=Z.call(e,e.data,e.headers,e.transformRequest),e.headers=Q.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Q.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||ee.adapter)(e).then(function(t){return ne(e),t.data=Z.call(e,t.data,t.headers,e.transformResponse),t},function(t){return X(t)||(ne(e),t&&t.response&&(t.response.data=Z.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},pe=ae,ge=ue,me=ge.validators;function ve(e){this.defaults=e,this.interceptors={request:new he,response:new he}}ve.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t.method=(t=pe(this.defaults,t)).method?t.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var n=t.transitional;void 0!==n&&ge.assertOptions(n,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1);var r=[],a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,r.unshift(e.fulfilled,e.rejected))});var i,o=[];if(this.interceptors.response.forEach(function(e){o.push(e.fulfilled,e.rejected)}),!a){var s=[fe,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(o),i=Promise.resolve(t);s.length;)i=i.then(s.shift(),s.shift());return i}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{i=fe(l)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},ve.prototype.getUri=function(e){return e=pe(this.defaults,e),de(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},ce.forEach(["delete","get","head","options"],function(e){ve.prototype[e]=function(t,n){return this.request(pe(n||{},{method:e,url:t,data:(n||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){ve.prototype[e]=function(t,n,r){return this.request(pe(r||{},{method:e,url:t,data:n}))}});var ye=ve,be=A;function xe(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}}),this.promise.then=function(e){var t,r=new Promise(function(e){n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e){n.reason||(n.reason=new be(e),t(n.reason))})}xe.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},xe.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},xe.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},xe.source=function(){var e;return{token:new xe(function(t){e=t}),cancel:e}};var _e=xe,we=h,ke=h,Se=n,Oe=ye,Me=ae,Pe=function e(t){var n=new Oe(t),r=Se(Oe.prototype.request,n);return ke.extend(r,Oe.prototype,n),ke.extend(r,n),r.create=function(n){return e(Me(t,n))},r}(q);Pe.Axios=Oe,Pe.Cancel=A,Pe.CancelToken=_e,Pe.isCancel=J,Pe.VERSION=ie,Pe.all=function(e){return Promise.all(e)},Pe.spread=function(e){return function(t){return e.apply(null,t)}},Pe.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},t.exports=Pe,t.exports.default=Pe;var Ce,De=t.exports;e.ResponseType=void 0,(Ce=e.ResponseType||(e.ResponseType={})).MATRIX="matrix",Ce.VECTOR="vector",Ce.SCALAR="scalar",Ce.STRING="string";class Te{constructor(e,t){if(e&&"string"!=typeof e)throw new Error("Wrong name format. Expected string.");if(t&&"object"!=typeof t)throw new Error("Wrong labels format. Expected object.");this.name=e,this.labels=t}static fromJSON(e){const t=e.__name__,n=Object.assign({},e);return delete n.__name__,new Te(t,n)}toString(){return(this.name?this.name:"")+"{"+Object.keys(this.labels).map(e=>e+'="'+this.labels[e]+'"').join(", ")+"}"}}class Re{constructor(e,t){if("object"!=typeof e||"Date"!=e.constructor.name)throw new Error("Wrong time format. Expected Date.");if("number"!=typeof t)throw new Error("Wrong value format. Expected float.");this.time=e,this.value=t}static fromJSON(e){const t=new Date(1e3*e[0]),n=parseFloat(e[1]);return new Re(t,n)}toString(){return this.time+": "+this.value}}class Ae{constructor(e,t){this.metric=e,this.values=t}static fromJSON(e){const t=e.metric?Te.fromJSON(e.metric):null,n=e.values.map(Re.fromJSON);return new Ae(t,n)}}class je{constructor(e,t){this.metric=e,this.value=t}static fromJSON(e){const t=e.metric?Te.fromJSON(e.metric):null,n=Re.fromJSON(e.value);return new je(t,n)}}class Ne{constructor(e,t){this.resultType=e,this.result=t}static fromJSON(t){const n=t.resultType;let r=null;switch(n){case e.ResponseType.MATRIX:r=t.result.map(Ae.fromJSON);break;case e.ResponseType.VECTOR:r=t.result.map(je.fromJSON);break;case e.ResponseType.SCALAR:case e.ResponseType.STRING:r=t.result;break;default:throw new Error(`Unexpected resultType: ${n}`)}return new Ne(n,r)}}class Ee{constructor(e,t,n,r,a,i,o,s){if(e&&"object"!=typeof e)throw new Error(`Unexpected format for discoveredLabels. Got ${typeof e} instead of object`);if(t&&"object"!=typeof t)throw new Error(`Unexpected format for labels. Got ${typeof t} instead of object`);if(n&&"string"!=typeof n)throw new Error(`Unexpected format for scrapePool. Got ${typeof n} instead of string`);if(r&&"string"!=typeof r)throw new Error(`Unexpected format for scrapeUrl. Got ${typeof r} instead of string`);if(a&&"string"!=typeof a)throw new Error(`Unexpected format for lastError. Got ${typeof a} instead of string`);if(i&&("object"!=typeof i||"Date"!=i.constructor.name))throw new Error(`Unexpected format for lastScrape. Got ${typeof i} instead of object`);if(o&&"number"!=typeof o)throw new Error(`Unexpected format for lastScrapeDuration. Got ${typeof o} instead of number`);if(s&&"string"!=typeof s)throw new Error(`Unexpected format for health. Got ${typeof s} instead of string`);this.discoveredLabels=e,this.labels=t,this.scrapePool=n,this.scrapeUrl=r,this.lastError=a,this.lastScrape=i,this.lastScrapeDuration=o,this.health=s}static fromJSON(e){return new Ee(e.discoveredLabels,e.labels,e.scrapePool,e.scrapeUrl,e.lastError,e.lastScrape?new Date(e.lastScrape):null,e.lastScrapeDuration?parseFloat(e.lastScrapeDuration):null,e.health)}}class Ie{constructor(e,t,n,r,a){if(e&&("object"!=typeof e||"Date"!=e.constructor.name))throw new Error(`Unexpected format for activeAt. Got ${typeof e} instead of object`);if(t&&"object"!=typeof t)throw new Error(`Unexpected format for annotations. Got ${typeof t} instead of object`);if(n&&"object"!=typeof n)throw new Error(`Unexpected format for labels. Got ${typeof n} instead of object`);if(a&&"number"!=typeof a)throw new Error(`Unexpected format for value. Got ${typeof a} instead of number`);this.activeAt=e,this.annotations=t,this.labels=n,this.state=r,this.value=a}static fromJSON(t){return new Ie(t.activeAt?new Date(t.activeAt):null,t.annotations,t.labels,e.ResponseType[t.state],t.value?parseFloat(t.value):null)}}class Le{constructor(e,t,n,r,a,i,o,s){this.alerts=e,this.annotations=t,this.duration=n,this.health=r,this.labels=a,this.name=i,this.query=o,this.type=s}static fromJSON(e){return new Le(e.alerts?e.alerts.map(Ie.fromJSON):[],e.annotations,e.duration,e.health,e.labels,e.name,e.query,e.type)}}class Fe{constructor(e,t,n,r){this.rules=e,this.file=t,this.interval=n,this.name=r}static fromJSON(e){return new Fe(e.rules?e.rules.map(Le.fromJSON):[],e.file,e.interval,e.name)}}class We{constructor(){this.baseURL="/api/v1/",this.headers={},this.auth=null,this.proxy=null,this.withCredentials=!1,this.timeout=1e4,this.preferPost=!1,this.warningHook=null}}e.Alert=Ie,e.InstantVector=je,e.Metric=Te,e.PrometheusConnectionOptions=We,e.PrometheusDriver=class{constructor(e){if(this.listifyIfNeeded=e=>e instanceof Array?e:[e],this.formatPromQlParams=e=>Object.entries(null!=e?e:{}).reduce((e,[t,n])=>(null!=n&&(n instanceof Array?n.filter(e=>null!=e).forEach(n=>e.append(`${t}[]`,n)):e.append(t,n)),e),new URLSearchParams),!(e=e||new We).endpoint)throw"Endpoint is required";e.endpoint=e.endpoint.replace(/\/$/,""),e.baseURL=e.baseURL||"/api/v1/",e.withCredentials=e.withCredentials||!1,e.timeout=e.timeout||1e4,this.options=e,this.axiosInstance=De.create(),this.options.requestInterceptor&&this.axiosInstance.interceptors.request.use(this.options.requestInterceptor.onFulfilled,this.options.requestInterceptor.onRejected),this.options.responseInterceptor&&this.axiosInstance.interceptors.response.use(this.options.responseInterceptor.onFulfilled,this.options.responseInterceptor.onRejected)}request(e,t,n,r){var a,i,o,s,l,u;const c=Object.assign({},this.options.headers||{});return this.axiosInstance.request({baseURL:this.options.endpoint+this.options.baseURL,url:t,method:e,params:this.formatPromQlParams(n),data:this.formatPromQlParams(r),headers:c,auth:(null===(a=this.options.auth)||void 0===a?void 0:a.username)&&(null===(i=this.options.auth)||void 0===i?void 0:i.password)?{username:this.options.auth.username,password:this.options.auth.password}:null,proxy:(null===(o=this.options.proxy)||void 0===o?void 0:o.host)&&(null===(s=this.options.proxy)||void 0===s?void 0:s.port)?{host:null===(l=this.options.proxy)||void 0===l?void 0:l.host,port:null===(u=this.options.proxy)||void 0===u?void 0:u.port}:null,withCredentials:this.options.withCredentials,timeout:this.options.timeout}).then(e=>this.handleResponse(e)).catch(e=>this.handleResponse(e))}handleResponse(e){const t=e.isAxiosError||!1;if(t&&(e=e.response),!e)throw{status:"error",errorType:"unexpected_error",error:"unexpected http error"};this.options.warningHook&&e.warnings&&e.warnings.length>0&&this.options.warningHook(e.warnings);const n=e.data;if(!n||null==n.status)throw{status:"error",errorType:"client_error",error:"unexpected client error"};if(t)throw e;return n.data}formatTimeToPrometheus(e,t){var n;if(e||(e=t),"number"==typeof e)return e/1e3;if("object"==typeof e&&"Date"==(null===(n=null==e?void 0:e.constructor)||void 0===n?void 0:n.name))return e.getTime()/1e3;throw new Error("Wrong time format. Expected number or Date.")}instantQuery(e,t,n){const r={query:e,time:this.formatTimeToPrometheus(t,new Date),timeout:n};return(this.options.preferPost?this.request("POST","query",null,r):this.request("GET","query",r)).then(e=>Ne.fromJSON(e))}rangeQuery(e,t,n,r,a){const i={query:e,start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n),step:r,timeout:a};return(this.options.preferPost?this.request("POST","query_range",null,i):this.request("GET","query_range",i)).then(e=>Ne.fromJSON(e))}series(e,t,n){const r={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n)};return(this.options.preferPost?this.request("POST","series",null,r):this.request("GET","series",r)).then(e=>e.map(Te.fromJSON))}labelNames(e,t,n){const r={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n)};return this.options.preferPost?this.request("POST","labels",null,r):this.request("GET","labels",r)}labelValues(e,t,n,r){const a={match:this.listifyIfNeeded(t),start:this.formatTimeToPrometheus(n,new Date),end:this.formatTimeToPrometheus(r,new Date)};return this.request("GET",`label/${e}/values`,a)}targets(e){return this.request("GET","targets",{query:e||"any"}).then(e=>({activeTargets:e.activeTargets?e.activeTargets.map(Ee.fromJSON):[],droppedTargets:e.droppedTargets?e.droppedTargets.map(Ee.fromJSON):[]}))}targetsMetadata(e,t,n){return this.request("GET","targets/metadata",{match_target:e,metric:t,limit:n})}metadata(e,t){return this.request("GET","metadata",{metric:e,limit:t})}rules(){return this.request("GET","rules").then(e=>(e.groups?e.groups:[]).map(Fe.fromJSON))}alerts(){return this.request("GET","alerts").then(e=>(e.alerts?e.alerts:[]).map(Ie.fromJSON))}alertmanagers(){return this.request("GET","alertmanagers")}status(){return this.request("GET","status/config")}statusFlags(){return this.request("GET","status/flags")}statusRuntimeInfo(){return this.request("GET","status/runtimeinfo")}statusBuildinfo(){return this.request("GET","status/buildinfo")}statusTSDB(){return this.request("GET","status/tsdb")}adminSnapshot(e){return this.request("POST","admin/tsdb/snapshot",{skip_head:e})}adminDeleteSeries(e,t,n){const r={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n)};return this.request("POST","admin/tsdb/delete_series",r)}adminCleanTombstones(){return this.request("POST","admin/tsdb/clean_tombstones")}},e.QueryResult=Ne,e.RangeVector=Ae,e.Rule=Le,e.RuleGroup=Fe,e.SampleValue=Re,e.Target=Ee,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,e.exports);var t={getPrometheusStepAuto:(e,t,n)=>{const r=(t.getTime()-e.getTime())/1e3,a=25*Math.floor(r/n);return a<1?1:a},getStartAndEndDates(e){if(e.type=e.type?e.type:"absolute","absolute"===e.type)return{type:"absolute",start:e.start,end:e.end};if("relative"===e.type)return{type:"absolute",start:new Date((new Date).getTime()+e.start),end:new Date((new Date).getTime()+e.end)};throw new Error("Unexpected options.timeRange value.")},executeQueries:(t,n,r,a,i)=>{const o=null!=n.find(e=>"string"==typeof e),s=t&&o?new e.exports.PrometheusDriver(t):null;return n.map(t=>"string"==typeof t?s.rangeQuery(t,r,a,i):t(r,a,i).then(t=>e.exports.QueryResult.fromJSON(t)))}};class n{constructor(){this.message="No data to display",this.font="16px normal 'Helvetica Nueue'",this.textAlign="center",this.textBaseline="middle",this.direction="ltr"}}class r{constructor(){this.message=null,this.font="16px normal 'Helvetica Nueue'",this.textAlign="center",this.textBaseline="middle",this.direction="ltr"}}class a{constructor(){this.prometheus=null,this.fillGaps=!1,this.tension=.4,this.cubicInterpolationMode="default",this.stepped=!1,this.fill=!1,this.borderWidth=3,this.borderColor=["rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],this.backgroundColor=["rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],this.noDataMsg=new n,this.errorMsg=new r,this.findInLabelMap=null,this.findInBorderColorMap=null,this.findInBackgroundColorMap=null,this.dataSetHook=null}assertPluginOptions(){if(!this.query)throw new Error("options.query is undefined");if(!this.timeRange)throw new Error("options.timeRange is undefined");if(null==this.timeRange.start)throw new Error("options.timeRange.start is undefined");if(null==this.timeRange.end)throw new Error("options.timeRange.end is undefined");if("object"!=typeof this.timeRange)throw new Error("options.timeRange must be a object");if("string"!=typeof this.timeRange.type)throw new Error("options.timeRange.type must be a string");if("relative"!=this.timeRange.type&&"absolute"!=this.timeRange.type)throw new Error('options.timeRange.type must be either "relative" or "absolute"');if("number"!=typeof this.timeRange.start&&("object"!=typeof this.timeRange.start||"Date"!=this.timeRange.start.constructor.name))throw new Error("options.timeRange.start must be a Date object (absolute) or integer (relative)");if("number"!=typeof this.timeRange.end&&("object"!=typeof this.timeRange.end||"Date"!=this.timeRange.end.constructor.name))throw new Error("options.timeRange.end must be a Date object (absolute) or integer (relative)");if(null!=this.timeRange.msUpdateInterval&&"number"!=typeof this.timeRange.msUpdateInterval)throw new Error("options.timeRange.msUpdateInterval must be a integer");if(null!=this.timeRange.msUpdateInterval&&this.timeRange.msUpdateInterval<1e3)throw new Error("options.timeRange.msUpdateInterval must be greater than 1s.")}getQueries(){var e,t;return"Array"!=(null===(t=null===(e=this.query)||void 0===e?void 0:e.constructor)||void 0===t?void 0:t.name)?[this.query]:this.query}}function i(e){e.config.options.scales=e.config.options.scales?e.config.options.scales:{},e.config.options.scales.xAxes=e.config.options.scales.xAxes&&e.config.options.scales.xAxes.length>0?e.config.options.scales.xAxes:[{}],e.config.options.scales.xAxes[0].time=e.config.options.scales.xAxes[0].time?e.config.options.scales.xAxes[0].time:{},e.config.options.scales.xAxes[0].type="time",e.config.options.scales.xAxes[0].distribution=e.config.options.scales.xAxes[0].distribution||"linear",e.config.options.scales.xAxes[0].time.minUnit=e.config.options.scales.xAxes[0].time.minUnit||"second"}function o(e,t,n){const r=t.metric.toString();return e.findInLabelMap&&e.findInLabelMap(t.metric)||r}function s(e,t,n){const r=e.fill?e.backgroundColor[n%e.backgroundColor.length]:"transparent";return e.findInBackgroundColorMap&&e.findInBackgroundColorMap(t.metric)||r}function l(e,t,n){const r=e.borderColor[n%e.borderColor.length];return e.findInBorderColorMap&&e.findInBorderColorMap(t.metric)||r}class u{constructor(){this.loading=!1,this.updateInterval=null,this.error=null}}return new class{constructor(){this.id="datasource-prometheus"}beforeInit(e,t){e["datasource-prometheus"]=new u}afterInit(e,t){if("line"!=e.config.type)throw"ChartDatasourcePrometheusPlugin is already compatible with Line chart\nFeel free to contribute for more!";if(!t)throw"ChartDatasourcePrometheusPlugin.options is undefined";const n=Object.assign(new a,t);n.assertPluginOptions(),n&&n.timeRange&&(n.timeRange.msUpdateInterval?e["datasource-prometheus"].updateInterval=setInterval(()=>{e.update()},n.timeRange.msUpdateInterval):e.update())}beforeUpdate(e,n){if(e["datasource-prometheus"]&&1==e["datasource-prometheus"].loading)return;const r=Object.assign(new a,n),u=r.prometheus,c=r.getQueries(),{start:d,end:h}=t.getStartAndEndDates(r.timeRange),f=r.timeRange.step||t.getPrometheusStepAuto(d,h,e.width),p=r.timeRange.minStep||f,g=p>=f?p:f;if(e["datasource-prometheus"]&&e["datasource-prometheus"].step==g&&e["datasource-prometheus"].start==d&&e["datasource-prometheus"].end==h)return;e["datasource-prometheus"].step=g,e["datasource-prometheus"].start=d,e["datasource-prometheus"].end=h,e["datasource-prometheus"].error=null;const m=t.executeQueries(u,c,d,h,g);let v={};if(e.data.datasets.length>0)for(let t in e.data.datasets){const n=e.data.datasets[t];let r=0;for(let e in n._meta)r=e;v[n.label]=!e.isDatasetVisible(n._meta[r].index)}const y=e.config.options.scales.yAxes;return e["datasource-prometheus"].loading=!0,Promise.all(m).then(t=>{const n=t.reduce((e,t,n)=>{const a=e.length,i=t.result.map((e,t)=>({yAxisID:y&&y.length>0?y[n%y.length].id:null,tension:r.tension,cubicInterpolationMode:r.cubicInterpolationMode||"default",stepped:r.stepped,fill:r.fill||!1,label:o(r,e),data:e.values.map((e,t)=>({t:e.time,y:e.value})),backgroundColor:s(r,e,a+t),borderColor:l(r,e,a+t),borderWidth:r.borderWidth,hidden:v[o(r,e)]||!1}));return e.concat(...i)},[]);e.data.datasets=n,e.data.datasets.length>0&&(r.fillGaps&&function(e,t,n,r,a){let i=a.timeRange.minStep||r;i=i>=r?i:r,e.data.datasets.forEach((r,a)=>{for(let e=r.data.length-2;e>0;e--)if(r.data[e+1].t-r.data[e].t>1100*i)for(let t=(r.data[e+1].t-r.data[e].t)/(1e3*i);t>1;t--){const t={t:new Date(r.data[e+1].t.getTime()-1e3*i),v:Number.NaN};r.data.splice(e+1,0,t)}if(Math.abs(t.getTime()-r.data[0].t)>1100*i)for(let n=Math.abs(t.getTime()-r.data[0].t)/(1e3*i);n>1;n--)e.data.datasets[a].data.unshift({t:new Date(r.data[0].t.getTime()-1e3*i),v:Number.NaN});if(Math.abs(n.getTime()-r.data[r.data.length-1].t)>1100*i)for(let t=Math.abs(n.getTime()-r.data[r.data.length-1].t)/(1e3*i);t>1;t--)e.data.datasets[a].data.push({t:new Date(r.data[e.data.datasets[a].data.length-1].t.getTime()+1e3*i),v:Number.NaN})})}(e,d,h,g,r),r.dataSetHook&&(e.data.datasets=r.dataSetHook(e.data.datasets)),i(e)),this.resumeRendering(e)}).catch(t=>{throw e.data.datasets=[],e["datasource-prometheus"].error="Failed to fetch data",i(e),this.resumeRendering(e),t}),!1}afterDraw(e,t){var n;const r=Object.assign(new a,t);if(null!=e["datasource-prometheus"].error){const t=e.ctx,a=e.width,i=e.height;return e.clear(),t.save(),t.direction=r.errorMsg.direction,t.textAlign=r.errorMsg.textAlign,t.textBaseline=r.errorMsg.textBaseline,t.font="16px normal 'Helvetica Nueue'",t.fillText((null===(n=r.errorMsg)||void 0===n?void 0:n.message)||e["datasource-prometheus"].error,a/2,i/2),void t.restore()}if(0==e.data.datasets.length){const t=e.ctx,n=e.width,a=e.height;return e.clear(),t.save(),t.direction=r.noDataMsg.direction,t.textAlign=r.noDataMsg.textAlign,t.textBaseline=r.noDataMsg.textBaseline,t.font=r.noDataMsg.font,t.fillText(r.noDataMsg.message,n/2,a/2),void t.restore()}}destroy(e){e["datasource-prometheus"].updateInterval&&clearInterval(e["datasource-prometheus"].updateInterval)}resumeRendering(e){e["datasource-prometheus"].loading=!0,e.update(),e["datasource-prometheus"].loading=!1}}}()}),ChartDatasourcePrometheusPlugin=/*@__PURE__*/getDefaultExportFromCjs(chartjsPluginDatasourcePrometheus_umd),INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function apply(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function arrayMap(e,t){for(var n=-1,r=e?e.length:0,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}function arrayPush(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,Symbol$1=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0,nativeMax=Math.max;function baseFlatten(e,t,n,r,a){var i=-1,o=e.length;for(n||(n=isFlattenable),a||(a=[]);++i<o;){var s=e[i];t>0&&n(s)?t>1?baseFlatten(s,t-1,n,r,a):arrayPush(a,s):r||(a[a.length]=s)}return a}function basePick(e,t){return basePickBy(e=Object(e),t,function(t,n){return n in e})}function basePickBy(e,t,n){for(var r=-1,a=t.length,i={};++r<a;){var o=t[r],s=e[o];n(s,o)&&(i[o]=s)}return i}function baseRest(e,t){return t=nativeMax(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,a=nativeMax(n.length-t,0),i=Array(a);++r<a;)i[r]=n[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=n[r];return o[t]=i,apply(e,this,o)}}function isFlattenable(e){return isArray(e)||isArguments(e)||!!(spreadableSymbol&&e&&e[spreadableSymbol])}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function isArguments(e){return isArrayLikeObject(e)&&hasOwnProperty.call(e,"callee")&&(!propertyIsEnumerable.call(e,"callee")||objectToString.call(e)==argsTag)}var isArray=Array.isArray;function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isFunction(e){var t=isObject(e)?objectToString.call(e):"";return t==funcTag||t==genTag}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}var pick=baseRest(function(e,t){return null==e?{}:basePick(e,arrayMap(baseFlatten(t,1),toKey))}),lodash_pick=pick,momentRange=createCommonjsModule(function(e,t){e.exports=function(e){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,n){var r=n(5)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){e.exports=n(18)()?Symbol:n(20)},function(t,n){t.exports=e},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e.split("/")}Object.defineProperty(t,"__esModule",{value:!0}),t.DateRange=void 0;var s=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.extendMoment=function(e){return e.range=function(t,n){return"string"==typeof t&&h.hasOwnProperty(t)?new f(e(this).startOf(t),e(this).endOf(t)):new f(t,n)},e.rangeFromInterval=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e();if(e.isMoment(r)||(r=e(r)),!r.isValid())throw new Error("Invalid date.");var a=r.clone().add(n,t),i=[];return i.push(e.min(r,a)),i.push(e.max(r,a)),new f(i)},e.rangeFromISOString=function(t){var n=o(t),r=e.parseZone(n[0]),a=e.parseZone(n[1]);return new f(r,a)},e.parseZoneRange=e.rangeFromISOString,e.fn.range=e.range,e.range.constructor=f,e.isRange=function(e){return e instanceof f},e.fn.within=function(e){return e.contains(this.toDate())},e};var c=r(n(2)),d=r(n(1)),h={year:!0,quarter:!0,month:!0,week:!0,day:!0,hour:!0,minute:!0,second:!0},f=t.DateRange=function(){function e(t,n){i(this,e);var r=t,a=n;if(1===arguments.length||void 0===n)if("object"===(void 0===t?"undefined":l(t))&&2===t.length){var u=s(t,2);r=u[0],a=u[1]}else if("string"==typeof t){var d=o(t),h=s(d,2);r=h[0],a=h[1]}this.start=(0,c.default)(r||0===r?r:-864e13),this.end=(0,c.default)(a||0===a?a:864e13)}return u(e,[{key:"adjacent",value:function(e){var t=this.start.isSame(e.end),n=this.end.isSame(e.start);return t&&e.start.valueOf()<=this.start.valueOf()||n&&e.end.valueOf()>=this.end.valueOf()}},{key:"add",value:function(e){return this.overlaps(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{adjacent:!1})?new this.constructor(c.default.min(this.start,e.start),c.default.max(this.end,e.end)):null}},{key:"by",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeEnd:!1,step:1},n=this;return a({},d.default.iterator,function(){var r=t.step||1,a=Math.abs(n.start.diff(n.end,e))/r,i=t.excludeEnd||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=n.start.clone().add(o*r,e),s=i?!(o<a):!(o<=a);return o++,{done:s,value:s?void 0:t}}}})}},{key:"byRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeEnd:!1,step:1},n=this,r=t.step||1,i=this.valueOf()/e.valueOf()/r,o=Math.floor(i),s=t.excludeEnd||!1,l=0;return t.hasOwnProperty("exclusive")&&(s=t.exclusive),a({},d.default.iterator,function(){return o===1/0?{done:!0}:{next:function(){var t=(0,c.default)(n.start.valueOf()+e.valueOf()*l*r),a=o===i&&s?!(l<o):!(l<=o);return l++,{done:a,value:a?void 0:t}}}})}},{key:"center",value:function(){var e=this.start.valueOf()+this.diff()/2;return(0,c.default)(e)}},{key:"clone",value:function(){return new this.constructor(this.start.clone(),this.end.clone())}},{key:"contains",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,excludeEnd:!1},r=this.start.valueOf(),a=this.end.valueOf(),i=t.valueOf(),o=t.valueOf(),s=n.excludeStart||!1,l=n.excludeEnd||!1;return n.hasOwnProperty("exclusive")&&(s=l=n.exclusive),t instanceof e&&(i=t.start.valueOf(),o=t.end.valueOf()),(r<i||r<=i&&!s)&&(a>o||a>=o&&!l)}},{key:"diff",value:function(e,t){return this.end.diff(this.start,e,t)}},{key:"duration",value:function(e,t){return this.diff(e,t)}},{key:"intersect",value:function(e){var t=this.start.valueOf(),n=this.end.valueOf(),r=e.start.valueOf(),a=e.end.valueOf(),i=r==a;if(t==n){if(t==r||t==a)return null;if(t>r&&t<a)return this.clone()}else if(i){if(r==t||r==n)return null;if(r>t&&r<n)return new this.constructor(r,r)}return t<=r&&r<n&&n<a?new this.constructor(r,n):r<t&&t<a&&a<=n?new this.constructor(t,a):r<t&&t<=n&&n<a?this.clone():t<=r&&r<=a&&a<=n?new this.constructor(r,a):null}},{key:"isEqual",value:function(e){return this.start.isSame(e.start)&&this.end.isSame(e.end)}},{key:"isSame",value:function(e){return this.isEqual(e)}},{key:"overlaps",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{adjacent:!1},n=null!==this.intersect(e);return t.adjacent&&!n?this.adjacent(e):n}},{key:"reverseBy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,step:1},n=this;return a({},d.default.iterator,function(){var r=t.step||1,a=Math.abs(n.start.diff(n.end,e))/r,i=t.excludeStart||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=n.end.clone().subtract(o*r,e),s=i?!(o<a):!(o<=a);return o++,{done:s,value:s?void 0:t}}}})}},{key:"reverseByRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,step:1},n=this,r=t.step||1,i=this.valueOf()/e.valueOf()/r,o=Math.floor(i),s=t.excludeStart||!1,l=0;return t.hasOwnProperty("exclusive")&&(s=t.exclusive),a({},d.default.iterator,function(){return o===1/0?{done:!0}:{next:function(){var t=(0,c.default)(n.end.valueOf()-e.valueOf()*l*r),a=o===i&&s?!(l<o):!(l<=o);return l++,{done:a,value:a?void 0:t}}}})}},{key:"snapTo",value:function(e){var t=this.clone();return t.start.isSame((0,c.default)(-864e13))||(t.start=t.start.startOf(e)),t.end.isSame((0,c.default)(864e13))||(t.end=t.end.endOf(e)),t}},{key:"subtract",value:function(e){var t=this.start.valueOf(),n=this.end.valueOf(),r=e.start.valueOf(),a=e.end.valueOf();return null===this.intersect(e)?[this]:r<=t&&t<n&&n<=a?[]:r<=t&&t<a&&a<n?[new this.constructor(a,n)]:t<r&&r<n&&n<=a?[new this.constructor(t,r)]:t<r&&r<a&&a<n?[new this.constructor(t,r),new this.constructor(a,n)]:t<r&&r<n&&a<n?[new this.constructor(t,r),new this.constructor(r,n)]:[]}},{key:"toDate",value:function(){return[this.start.toDate(),this.end.toDate()]}},{key:"toString",value:function(){return this.start.format()+"/"+this.end.format()}},{key:"valueOf",value:function(){return this.end.valueOf()-this.start.valueOf()}}]),e}()},function(e,t,n){var r,a=n(6),i=n(13),o=n(9),s=n(15);r=e.exports=function(e,t){var n,r,o,l,u;return arguments.length<2||"string"!=typeof e?(l=t,t=e,e=null):l=arguments[2],null==e?(n=o=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),o=s.call(e,"w")),u={value:t,configurable:n,enumerable:r,writable:o},l?a(i(l),u):u},r.gs=function(e,t,n){var r,l,u,c;return"string"!=typeof e?(u=n,n=t,t=e,e=null):u=arguments[3],null==t?t=void 0:o(t)?null==n?n=void 0:o(n)||(u=n,n=void 0):(u=t,t=n=void 0),null==e?(r=!0,l=!1):(r=s.call(e,"c"),l=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:l},u?a(i(u),c):c}},function(e,t,n){e.exports=function(){}},function(e,t,n){e.exports=n(7)()?Object.assign:n(8)},function(e,t,n){e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){var r=n(10),a=n(14),i=Math.max;e.exports=function(e,t){var n,o,s,l=i(arguments.length,2);for(e=Object(a(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},o=1;o<l;++o)r(t=arguments[o]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){e.exports=function(e){return"function"==typeof e}},function(e,t,n){e.exports=n(11)()?Object.keys:n(12)},function(e,t,n){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){var r=n(0),a=Object.keys;e.exports=function(e){return a(r(e)?Object(e):e)}},function(e,t,n){var r=n(0),a=Array.prototype.forEach,i=Object.create,o=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=i(null);return a.call(arguments,function(e){r(e)&&o(Object(e),t)}),t}},function(e,t,n){var r=n(0);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){e.exports=n(16)()?String.prototype.contains:n(17)},function(e,t,n){var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}},function(e,t,n){var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag]}},function(e,t,n){e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}},function(e,t,n){var r,a,i,o,s=n(4),l=n(21),u=Object.create,c=Object.defineProperties,d=Object.defineProperty,h=Object.prototype,f=u(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),o=!0}catch(e){}}var p=function(){var e=u(null);return function(t){for(var n,r,a=0;e[t+(a||"")];)++a;return e[t+=a||""]=!0,d(h,n="@@"+t,s.gs(null,function(e){r||(r=!0,d(this,n,s(e)),r=!1)})),n}}();i=function(e){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return a(e)},e.exports=a=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return o?r(t):(n=u(i.prototype),t=void 0===t?"":String(t),c(n,{__description__:s("",t),__name__:s("",p(t))}))},c(a,{for:s(function(e){return f[e]?f[e]:f[e]=a(String(e))}),keyFor:s(function(e){var t;for(t in l(e),f)if(f[t]===e)return t}),hasInstance:s("",r&&r.hasInstance||a("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||a("isConcatSpreadable")),iterator:s("",r&&r.iterator||a("iterator")),match:s("",r&&r.match||a("match")),replace:s("",r&&r.replace||a("replace")),search:s("",r&&r.search||a("search")),species:s("",r&&r.species||a("species")),split:s("",r&&r.split||a("split")),toPrimitive:s("",r&&r.toPrimitive||a("toPrimitive")),toStringTag:s("",r&&r.toStringTag||a("toStringTag")),unscopables:s("",r&&r.unscopables||a("unscopables"))}),c(i.prototype,{constructor:s(a),toString:s("",function(){return this.__name__})}),c(a.prototype,{toString:s(function(){return"Symbol ("+l(this).__description__+")"}),valueOf:s(function(){return l(this)})}),d(a.prototype,a.toPrimitive,s("",function(){var e=l(this);return"symbol"==typeof e?e:e.toString()})),d(a.prototype,a.toStringTag,s("c","Symbol")),d(i.prototype,a.toStringTag,s("c",a.prototype[a.toStringTag])),d(i.prototype,a.toPrimitive,s("c",a.prototype[a.toPrimitive]))},function(e,t,n){var r=n(19);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}}])}(moment$1)}),moment=momentRange.extendMoment(moment$1),getQueriesTimeRange=function(e,t){var n=moment(),r=andoncloudDashboardToolkit.normalizeShifts(null==t?void 0:t.shifts,n),a=andoncloudDashboardToolkit.getCurrentShift(n,r),i=andoncloudDashboardToolkit.getRecentShift(n,r);switch(e){case QueriesPeriod.CURRENT_SHIFT:return a?{startedAt:a.startedAt.toDate(),finishedAt:a.finishedAt.toDate()}:i?{startedAt:i.startedAt.toDate(),finishedAt:i.finishedAt.toDate()}:null;case QueriesPeriod.PREVIOUS_SHIFT:return i?{startedAt:i.startedAt.toDate(),finishedAt:i.finishedAt.toDate()}:null;default:return null}},colorName={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},isArrayish=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},simpleSwizzle=createCommonjsModule(function(e){var t=Array.prototype.concat,n=Array.prototype.slice,r=e.exports=function(e){for(var r=[],a=0,i=e.length;a<i;a++){var o=e[a];isArrayish(o)?r=t.call(r,n.call(o)):r.push(o)}return r};r.wrap=function(e){return function(){return e(r(arguments))}}}),colorString=createCommonjsModule(function(e){var t=Object.hasOwnProperty,n=Object.create(null);for(var r in colorName)t.call(colorName,r)&&(n[colorName[r]]=r);var a=e.exports={to:{},get:{}};function i(e,t,n){return Math.min(Math.max(t,e),n)}function o(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}a.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=a.get.hsl(e),n="hsl";break;case"hwb":t=a.get.hwb(e),n="hwb";break;default:t=a.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},a.get.rgb=function(e){if(!e)return null;var n,r,a,o=[0,0,0,1];if(n=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(a=n[2],n=n[1],r=0;r<3;r++){var s=2*r;o[r]=parseInt(n.slice(s,s+2),16)}a&&(o[3]=parseInt(a,16)/255)}else if(n=e.match(/^#([a-f0-9]{3,4})$/i)){for(a=(n=n[1])[3],r=0;r<3;r++)o[r]=parseInt(n[r]+n[r],16);a&&(o[3]=parseInt(a+a,16)/255)}else if(n=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)o[r]=parseInt(n[r+1],0);n[4]&&(o[3]=n[5]?.01*parseFloat(n[4]):parseFloat(n[4]))}else{if(!(n=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(n=e.match(/^(\w+)$/))?"transparent"===n[1]?[0,0,0,0]:t.call(colorName,n[1])?((o=colorName[n[1]])[3]=1,o):null:null;for(r=0;r<3;r++)o[r]=Math.round(2.55*parseFloat(n[r+1]));n[4]&&(o[3]=n[5]?.01*parseFloat(n[4]):parseFloat(n[4]))}for(r=0;r<3;r++)o[r]=i(o[r],0,255);return o[3]=i(o[3],0,1),o},a.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(n)?1:n,0,1)]}return null},a.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(n)?1:n,0,1)]}return null},a.to.hex=function(){var e=simpleSwizzle(arguments);return"#"+o(e[0])+o(e[1])+o(e[2])+(e[3]<1?o(Math.round(255*e[3])):"")},a.to.rgb=function(){var e=simpleSwizzle(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},a.to.rgb.percent=function(){var e=simpleSwizzle(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},a.to.hsl=function(){var e=simpleSwizzle(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},a.to.hwb=function(){var e=simpleSwizzle(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},a.to.keyword=function(e){return n[e.slice(0,3)]}});const reverseKeywords={};for(const e of Object.keys(colorName))reverseKeywords[colorName[e]]=e;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var conversions=convert$1;for(const e of Object.keys(convert$1)){if(!("channels"in convert$1[e]))throw new Error("missing channels property: "+e);if(!("labels"in convert$1[e]))throw new Error("missing channel labels property: "+e);if(convert$1[e].labels.length!==convert$1[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=convert$1[e];delete convert$1[e].channels,delete convert$1[e].labels,Object.defineProperty(convert$1[e],"channels",{value:t}),Object.defineProperty(convert$1[e],"labels",{value:n})}function comparativeDistance(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}function buildGraph(){const e={},t=Object.keys(conversions);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function deriveBFS(e){const t=buildGraph(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),r=Object.keys(conversions[e]);for(let a=r.length,i=0;i<a;i++){const a=r[i],o=t[a];-1===o.distance&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(a))}}return t}function link(e,t){return function(n){return t(e(n))}}function wrapConversion(e,t){const n=[t[e].parent,e];let r=conversions[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)n.unshift(t[a].parent),r=link(conversions[t[a].parent][a],r),a=t[a].parent;return r.conversion=n,r}convert$1.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=i-a;let s,l;i===a?s=0:t===i?s=(n-r)/o:n===i?s=2+(r-t)/o:r===i&&(s=4+(t-n)/o),s=Math.min(60*s,360),s<0&&(s+=360);const u=(a+i)/2;return l=i===a?0:u<=.5?o/(i+a):o/(2-i-a),[s,100*l,100*u]},convert$1.rgb.hsv=function(e){let t,n,r,a,i;const o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(a=0,i=0):(i=c/u,t=d(o),n=d(s),r=d(l),o===u?a=r-n:s===u?a=1/3+t-r:l===u&&(a=2/3+n-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*u]},convert$1.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const a=convert$1.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,100*i,100*r]},convert$1.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(1-t,1-n,1-r);return[100*((1-t-a)/(1-a)||0),100*((1-n-a)/(1-a)||0),100*((1-r-a)/(1-a)||0),100*a]},convert$1.rgb.keyword=function(e){const t=reverseKeywords[e];if(t)return t;let n,r=Infinity;for(const t of Object.keys(colorName)){const a=comparativeDistance(e,colorName[t]);a<r&&(r=a,n=t)}return n},convert$1.keyword.rgb=function(e){return colorName[e]},convert$1.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},convert$1.rgb.lab=function(e){const t=convert$1.rgb.xyz(e);let n=t[0],r=t[1],a=t[2];return n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*r-16,500*(n-r),200*(r-a)]},convert$1.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let a,i,o;if(0===n)return o=255*r,[o,o,o];a=r<.5?r*(1+n):r+n-r*n;const s=2*r-a,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,o=6*i<1?s+6*(a-s)*i:2*i<1?a:3*i<2?s+(a-s)*(2/3-i)*6:s,l[e]=255*o;return l},convert$1.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,a=n;const i=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,a*=i<=1?i:2-i,[t,100*(0===r?2*a/(i+a):2*n/(r+n)),(r+n)/2*100]},convert$1.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const a=Math.floor(t)%6,i=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*i),l=255*r*(1-n*(1-i));switch(r*=255,a){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}},convert$1.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,a=Math.max(r,.01);let i,o;o=(2-n)*r;const s=(2-n)*a;return i=n*a,i/=s<=1?s:2-s,i=i||0,o/=2,[t,100*i,100*o]},convert$1.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const a=n+r;let i;a>1&&(n/=a,r/=a);const o=Math.floor(6*t),s=1-r;i=6*t-o,0!=(1&o)&&(i=1-i);const l=n+i*(s-n);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=n;break;case 1:u=l,c=s,d=n;break;case 2:u=n,c=s,d=l;break;case 3:u=n,c=l,d=s;break;case 4:u=l,c=n,d=s;break;case 5:u=s,c=n,d=l}return[255*u,255*c,255*d]},convert$1.cmyk.rgb=function(e){const t=e[1]/100,n=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-r)+r)),255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},convert$1.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let a,i,o;return a=3.2406*t+-1.5372*n+-.4986*r,i=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=Math.min(Math.max(0,a),1),i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),[255*a,255*i,255*o]},convert$1.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},convert$1.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const a=n**3,i=t**3,o=r**3;return n=a>.008856?a:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},convert$1.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let a;return a=360*Math.atan2(r,n)/2/Math.PI,a<0&&(a+=360),[t,Math.sqrt(n*n+r*r),a]},convert$1.lch.lab=function(e){const t=e[1],n=e[2]/360*2*Math.PI;return[e[0],t*Math.cos(n),t*Math.sin(n)]},convert$1.rgb.ansi16=function(e,t=null){const[n,r,a]=e;let i=null===t?convert$1.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),0===i)return 30;let o=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===i&&(o+=60),o},convert$1.hsv.ansi16=function(e){return convert$1.rgb.ansi16(convert$1.hsv.rgb(e),e[2])},convert$1.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},convert$1.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},convert$1.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},convert$1.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},convert$1.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},convert$1.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.max(Math.max(t,n),r),i=Math.min(Math.min(t,n),r),o=a-i;let s,l;return s=o<1?i/(1-o):0,l=o<=0?0:a===t?(n-r)/o%6:a===n?2+(r-t)/o:4+(t-n)/o,l/=6,l%=1,[360*l,100*o,100*s]},convert$1.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let a=0;return r<1&&(a=(n-.5*r)/(1-r)),[e[0],100*r,100*a]},convert$1.hsv.hcg=function(e){const t=e[2]/100,n=e[1]/100*t;let r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},convert$1.hcg.rgb=function(e){const t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];const r=[0,0,0],a=e[0]/360%1*6,i=a%1,o=1-i;let s=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=i,r[2]=0;break;case 1:r[0]=o,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=i;break;case 3:r[0]=0,r[1]=o,r[2]=1;break;case 4:r[0]=i,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=o}return s=(1-t)*n,[255*(t*r[0]+s),255*(t*r[1]+s),255*(t*r[2]+s)]},convert$1.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},convert$1.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},convert$1.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},convert$1.hwb.hcg=function(e){const t=1-e[2]/100,n=t-e[1]/100;let r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},convert$1.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},convert$1.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},convert$1.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},convert$1.gray.hsl=function(e){return[0,0,e[0]]},convert$1.gray.hsv=convert$1.gray.hsl,convert$1.gray.hwb=function(e){return[0,100,e[0]]},convert$1.gray.cmyk=function(e){return[0,0,0,e[0]]},convert$1.gray.lab=function(e){return[e[0],0,0]},convert$1.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},convert$1.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var route=function(e){const t=deriveBFS(e),n={},r=Object.keys(t);for(let e=r.length,a=0;a<e;a++){const e=r[a];null!==t[e].parent&&(n[e]=wrapConversion(e,t))}return n};const convert={},models=Object.keys(conversions);function wrapRaw(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function wrapRounded(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}models.forEach(e=>{convert[e]={},Object.defineProperty(convert[e],"channels",{value:conversions[e].channels}),Object.defineProperty(convert[e],"labels",{value:conversions[e].labels});const t=route(e);Object.keys(t).forEach(n=>{const r=t[n];convert[e][n]=wrapRounded(r),convert[e][n].raw=wrapRaw(r)})});var colorConvert=convert;const skippedModels=["keyword","gray","hex"],hashedModelKeys={};for(const e of Object.keys(colorConvert))hashedModelKeys[[...colorConvert[e].labels].sort().join("")]=e;const limiters={};function Color(e,t){if(!(this instanceof Color))return new Color(e,t);if(t&&t in skippedModels&&(t=null),t&&!(t in colorConvert))throw new Error("Unknown model: "+t);let n,r;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof Color)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=colorString.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,r=colorConvert[this.model].channels,this.color=t.value.slice(0,r),this.valpha="number"==typeof t.value[r]?t.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=colorConvert[this.model].channels;const n=Array.prototype.slice.call(e,0,r);this.color=zeroArray(n,r),this.valpha="number"==typeof e[r]?e[r]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const r=t.sort().join("");if(!(r in hashedModelKeys))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=hashedModelKeys[r];const{labels:a}=colorConvert[this.model],i=[];for(n=0;n<a.length;n++)i.push(e[a[n]]);this.color=zeroArray(i)}if(limiters[this.model])for(r=colorConvert[this.model].channels,n=0;n<r;n++){const e=limiters[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Color.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in colorString.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return colorString.to[t.model](n)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[...t.color,this.valpha];return colorString.to.rgb.percent(n)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=colorConvert[this.model],{labels:n}=colorConvert[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new Color([...this.color.map(roundToPlace(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new Color([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:getset("rgb",0,maxfn(255)),green:getset("rgb",1,maxfn(255)),blue:getset("rgb",2,maxfn(255)),hue:getset(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:getset("hsl",1,maxfn(100)),lightness:getset("hsl",2,maxfn(100)),saturationv:getset("hsv",1,maxfn(100)),value:getset("hsv",2,maxfn(100)),chroma:getset("hcg",1,maxfn(100)),gray:getset("hcg",2,maxfn(100)),white:getset("hwb",1,maxfn(100)),wblack:getset("hwb",2,maxfn(100)),cyan:getset("cmyk",0,maxfn(100)),magenta:getset("cmyk",1,maxfn(100)),yellow:getset("cmyk",2,maxfn(100)),black:getset("cmyk",3,maxfn(100)),x:getset("xyz",0,maxfn(95.047)),y:getset("xyz",1,maxfn(100)),z:getset("xyz",2,maxfn(108.833)),l:getset("lab",0,maxfn(100)),a:getset("lab",1),b:getset("lab",2),keyword(e){return void 0!==e?new Color(e):colorConvert[this.model].keyword(this.color)},hex(e){return void 0!==e?new Color(e):colorString.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new Color(e);const t=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),colorString.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return Color.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),a=void 0===t?.5:t,i=2*a-1,o=n.alpha()-r.alpha(),s=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return Color.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue(),n.alpha()*a+r.alpha()*(1-a))}};for(const e of Object.keys(colorConvert)){if(skippedModels.includes(e))continue;const{channels:t}=colorConvert[e];Color.prototype[e]=function(...t){return this.model===e?new Color(this):new Color(t.length>0?t:[...assertArray(colorConvert[this.model][e].raw(this.color)),this.valpha],e)},Color[e]=function(...n){let r=n[0];return"number"==typeof r&&(r=zeroArray(n,t)),new Color(r,e)}}function roundTo(e,t){return Number(e.toFixed(t))}function roundToPlace(e){return function(t){return roundTo(t,e)}}function getset(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(limiters[r]||(limiters[r]=[]))[t]=n;return e=e[0],function(r){let a;return void 0!==r?(n&&(r=n(r)),a=this[e](),a.color[t]=r,a):(a=this[e]().color[t],n&&(a=n(a)),a)}}function maxfn(e){return function(t){return Math.max(0,Math.min(e,t))}}function assertArray(e){return Array.isArray(e)?e:[e]}function zeroArray(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}var color=Color,Color$1=color,createGradient=function(e,t){return e.createLinearGradient(0,t.bottom,0,t.top)},getScale=function(e,t){var n=e.getDatasetMeta(t);return n.controller._yScale||n.controller.chart.scales[n.yAxisID]},GradientPlugin={id:"gradient",beforeDatasetsUpdate:function(e){var t=e.ctx,n=e.data.datasets;if(t&&n)for(var r=0;r<n.length;r++){var a=n[r],i=getScale(e,r);if(i){var o=createGradient(t,i),s=Color$1(a.borderColor);o.addColorStop(0,s.alpha(.1).hexa()),o.addColorStop(1,s.alpha(.5).hexa()),a.backgroundColor=o}}}};Chart$1.defaults.global.defaultFontSize=12,Chart$1.defaults.global.defaultFontColor="rgba(255, 255, 255, 0.75)";var PrometheusChart=function PrometheusChart(_ref){var data=_ref.data,settings=_ref.settings,chart=React.useRef(),_useState=React.useState({labels:[],datasets:[]}),chartData=_useState[0],_useState2=React.useState(null),queriesTimeRange=_useState2[0],setQueriesTimeRange=_useState2[1],_useState3=React.useState([]),timeLabels=_useState3[0],setTimeLabels=_useState3[1];return React.useEffect(function(){if(chart.current&&chart.current.update(),queriesTimeRange){var e=moment(queriesTimeRange.startedAt),t=moment(queriesTimeRange.finishedAt),n=moment.range(e,t);setTimeLabels(function(){return e.isBefore(t)?Array.from(n.by("minutes",{step:15})):Array.from(n.reverseBy("minutes",{step:15}))})}},[queriesTimeRange]),React.useEffect(function(){if(setQueriesTimeRange(getQueriesTimeRange(settings.queriesPeriod,data)),(null==settings?void 0:settings.queriesPeriod)===QueriesPeriod.CURRENT_SHIFT){var e=setInterval(function(){if(chart.current&&chart.current.options.plugins){var e=getQueriesTimeRange(settings.queriesPeriod,data);setQueriesTimeRange(e),chart.current.options.plugins["datasource-prometheus"].timeRange=_extends({},chart.current.options.plugins["datasource-prometheus"].timeRange,{start:null==e?void 0:e.startedAt,end:null==e?void 0:e.finishedAt}),chart.current.update()}},3e4);return function(){clearInterval(e)}}return function(){}},[data,settings]),queriesTimeRange&&React__default.default.createElement(Chart,{ref:chart,type:"line",data:chartData,plugins:[ChartDatasourcePrometheusPlugin,GradientPlugin],options:{scales:{xAxes:[_extends({type:"time",labels:timeLabels,time:{displayFormats:{millisecond:"HH:mm:ss.SSS",second:"HH:mm:ss",minute:"HH:mm",hour:"HH"}},ticks:{source:"labels"},gridLines:{color:"rgba(255, 255, 255, 0.1)"}},settings.xAxisUnit&&{scaleLabel:{display:!0,labelString:settings.xAxisUnit}})],yAxes:[_extends({gridLines:{color:"rgba(255, 255, 255, 0.1)"}},settings.xAxisUnit&&{scaleLabel:{display:!0,labelString:settings.yAxisUnit}})]},elements:{point:{radius:0}},maintainAspectRatio:!1,animation:{duration:0},plugins:{"datasource-prometheus":{prometheus:{endpoint:settings.endpointUrl},query:settings.prometheusQueries,timeRange:{type:"absolute",start:queriesTimeRange.startedAt,end:queriesTimeRange.finishedAt,step:30},fillGaps:!0,fill:!0}},legend:{labels:{filter:function filter(item){var regex=/{(?:[^{}]*)*}/,paramsMatch=item.text.match(regex),replaceAfter=function(e,t,n){return e.substring(0,t)+n};if(paramsMatch&&0!==paramsMatch.index){var matchIndex=paramsMatch.index||0,queryParams=eval("("+paramsMatch[0].replaceAll("=",":")+")");item.text=replaceAfter(item.text,matchIndex,JSON.stringify(lodash_pick(queryParams,settings.displayedQueryParams)))}else item.text=null==settings?void 0:settings.prometheusQueries[item.datasetIndex];return item}}}}})},WidgetView=function(e){var t=e.settings;return React__default.default.createElement(material.Box,{display:"flex",width:"100%",height:"100%",p:2},t&&React__default.default.createElement(PrometheusChart,{data:e.data,settings:t}))},_excluded=["url","token","lang","data"],Widget=function(e){var t=e.url,n=e.token,r=e.lang,a=e.data,i=_objectWithoutPropertiesLoose(e,_excluded),o=React.useState(),s=o[0],l=o[1],u=React.useState(a),c=u[0],d=u[1];return React.useEffect(function(){t&&n&&l(andoncloudDashboardToolkit.getGraphqlSdk(t,n))},[t,n]),React.useEffect(function(){!a&&s&&s.shifts().then(function(e){var t=e.shifts;return d(function(e){return _extends({},e||{},{shifts:t})})}).catch(function(){})},[a,s]),React__default.default.createElement(andoncloudWidgetBase.BaseWidget,_extends({url:t,token:n,lang:r,data:c,WidgetView:WidgetView,SettingsFormContent:SettingsFormContent,version:LIBRARY_VERSION,"data-testid":"prometheus-widget"},i))},getDisplayName=function(e){switch(e){case"en":return"PromQL chart";case"pl":return"Wykres PromQL";default:return"prometheus-widget"}},permissions=[];exports.Widget=Widget,exports.getDisplayName=getDisplayName,exports.permissions=permissions;
|
|
1
|
+
var i18n=require("i18next"),React=require("react"),andoncloudDashboardToolkit=require("andoncloud-dashboard-toolkit"),andoncloudWidgetBase=require("andoncloud-widget-base"),iconsMaterial=require("@mui/icons-material"),material=require("@mui/material");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i18n__default=/*#__PURE__*/_interopDefaultLegacy(i18n),React__default=/*#__PURE__*/_interopDefaultLegacy(React);function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _objectWithoutPropertiesLoose$1(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}function _objectWithoutProperties(e,t){if(null==e)return{};var n,r,a=_objectWithoutPropertiesLoose$1(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(e){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=e.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(n.name=r[1],(voidElements[r[1]]||"/"===e.charAt(e.length-2))&&(n.voidElement=!0),n.name.startsWith("!--"))){var a=e.indexOf("--\x3e");return{type:"comment",comment:-1!==a?e.slice(4,a):""}}for(var i=new RegExp(t),o=null;null!==(o=i.exec(e));)if(o[0].trim())if(o[1]){var s=o[1].trim(),l=[s,""];s.indexOf("=")>-1&&(l=s.split("=")),n.attrs[l[0]]=l[1],i.lastIndex--}else o[2]&&(n.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return n}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,o=[],l=[],u=-1,c=!1;if(0!==e.indexOf("<")){var d=e.indexOf("<");o.push({type:"text",content:-1===d?e:e.substring(0,d)})}return e.replace(r,function(r,s){if(c){if(r!=="</"+a.name+">")return;c=!1}var d,h="/"!==r.charAt(1),f=r.startsWith("\x3c!--"),p=s+r.length,g=e.charAt(p);if(f){var m=n(r);return u<0?(o.push(m),o):((d=l[u]).children.push(m),o)}if(h&&(u++,"tag"===(a=n(r)).type&&t.components[a.name]&&(a.type="component",c=!0),a.voidElement||c||!g||"<"===g||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===u&&o.push(a),(d=l[u-1])&&d.children.push(a),l[u]=a),(!h||a.voidElement)&&(u>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(u--,a=-1===u?o:l[u]),!c&&"<"!==g&&g)){d=-1===u?o:l[u].children;var v=e.indexOf("<",p),y=e.slice(p,-1===v?void 0:v);i.test(y)&&(y=" "),(v>-1&&u+d.length>=0||" "!==y)&&d.push({type:"text",content:y})}}),o},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};function warn(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var alreadyWarned={};function warnOnce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&alreadyWarned[t[0]]||("string"==typeof t[0]&&(alreadyWarned[t[0]]=new Date),warn.apply(void 0,t))}var loadedClb=function(e,t){return function(){e.isInitialized?t():e.on("initialized",function n(){setTimeout(function(){e.off("initialized",n)},0),t()})}};function loadNamespaces(e,t,n){e.loadNamespaces(t,loadedClb(e,n))}function loadLanguages(e,t,n,r){"string"==typeof n&&(n=[n]),n.forEach(function(t){e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,loadedClb(e,r))}function oldI18nextHasLoadedNamespace(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],a=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!o(r,e)||a&&!o(i,e)))}function hasLoadedNamespace(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:n.lng,precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):oldI18nextHasLoadedNamespace(e,t,n):(warnOnce("i18n.languages were undefined or empty",t.languages),!0)}var matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},unescapeHtmlEntity=function(e){return htmlEntities[e]},unescape$1=function(e){return e.replace(matchHtmlEntity,unescapeHtmlEntity)};function ownKeys$3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$3(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var defaultOptions={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1},i18nInstance;function setDefaults(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};defaultOptions=_objectSpread$3(_objectSpread$3({},defaultOptions),e)}function getDefaults(){return defaultOptions}function setI18n(e){i18nInstance=e}function getI18n(){return i18nInstance}var _excluded$2=["format"],_excluded2=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$2(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hasChildren(e,t){if(!e)return!1;var n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function getChildren(e){return e?e.props?e.props.children:e.children:[]}function hasValidReactChildren(e){return"[object Array]"===Object.prototype.toString.call(e)&&e.every(function(e){return React.isValidElement(e)})}function getAsArray(e){return Array.isArray(e)?e:[e]}function mergeProps(e,t){var n=_objectSpread$2({},t);return n.props=Object.assign(e.props,t.props),n}function nodesToString(e,t){if(!e)return"";var n="",r=getAsArray(e),a=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return r.forEach(function(e,r){if("string"==typeof e)n+="".concat(e);else if(React.isValidElement(e)){var i=Object.keys(e.props).length,o=a.indexOf(e.type)>-1,s=e.props.children;if(!s&&o&&0===i)n+="<".concat(e.type,"/>");else if(s||o&&0===i)if(e.props.i18nIsDynamicList)n+="<".concat(r,"></").concat(r,">");else if(o&&1===i&&"string"==typeof s)n+="<".concat(e.type,">").concat(s,"</").concat(e.type,">");else{var l=nodesToString(s,t);n+="<".concat(r,">").concat(l,"</").concat(r,">")}else n+="<".concat(r,"></").concat(r,">")}else if(null===e)warn("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===_typeof(e)){var u=e.format,c=_objectWithoutProperties(e,_excluded$2),d=Object.keys(c);if(1===d.length){var h=u?"".concat(d[0],", ").concat(u):d[0];n+="{{".concat(h,"}}")}else warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",e)}else warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",e)}),n}function renderNodes(e,t,n,r,a,i){if(""===t)return[];var o=r.transKeepBasicHtmlNodesFor||[],s=t&&new RegExp(o.join("|")).test(t);if(!e&&!s)return[t];var l={};!function e(t){getAsArray(t).forEach(function(t){"string"!=typeof t&&(hasChildren(t)?e(getChildren(t)):"object"!==_typeof(t)||React.isValidElement(t)||Object.assign(l,t))})}(e);var u=c.parse("<0>".concat(t,"</0>")),d=_objectSpread$2(_objectSpread$2({},l),a);function h(e,t,n){var r=getChildren(e),a=p(r,t.children,n);return hasValidReactChildren(r)&&0===a.length?r:a}function f(e,t,n,r,a){e.dummy&&(e.children=t),n.push(React.cloneElement(e,_objectSpread$2(_objectSpread$2({},e.props),{},{key:r}),a?void 0:t))}function p(t,a,l){var u=getAsArray(t);return getAsArray(a).reduce(function(t,a,c){var g=a.children&&a.children[0]&&a.children[0].content&&n.services.interpolator.interpolate(a.children[0].content,d,n.language);if("tag"===a.type){var m=u[parseInt(a.name,10)];!m&&1===l.length&&l[0][a.name]&&(m=l[0][a.name]),m||(m={});var v=0!==Object.keys(a.attrs).length?mergeProps({props:a.attrs},m):m,y=React.isValidElement(v),b=y&&hasChildren(a,!0)&&!a.voidElement,x=s&&"object"===_typeof(v)&&v.dummy&&!y,_="object"===_typeof(e)&&null!==e&&Object.hasOwnProperty.call(e,a.name);if("string"==typeof v){var w=n.services.interpolator.interpolate(v,d,n.language);t.push(w)}else if(hasChildren(v)||b)f(v,h(v,a,l),t,c);else if(x){var k=p(u,a.children,l);t.push(React.cloneElement(v,_objectSpread$2(_objectSpread$2({},v.props),{},{key:c}),k))}else if(Number.isNaN(parseFloat(a.name)))if(_)f(v,h(v,a,l),t,c,a.voidElement);else if(r.transSupportBasicHtmlNodes&&o.indexOf(a.name)>-1)if(a.voidElement)t.push(React.createElement(a.name,{key:"".concat(a.name,"-").concat(c)}));else{var S=p(u,a.children,l);t.push(React.createElement(a.name,{key:"".concat(a.name,"-").concat(c)},S))}else if(a.voidElement)t.push("<".concat(a.name," />"));else{var M=p(u,a.children,l);t.push("<".concat(a.name,">").concat(M,"</").concat(a.name,">"))}else if("object"!==_typeof(v)||y)t.push(1===a.children.length&&g?React.cloneElement(v,_objectSpread$2(_objectSpread$2({},v.props),{},{key:c}),g):React.cloneElement(v,_objectSpread$2(_objectSpread$2({},v.props),{},{key:c})));else{var O=a.children[0]?g:null;O&&t.push(O)}}else if("text"===a.type){var D=r.transWrapTextNodes,P=i?r.unescape(n.services.interpolator.interpolate(a.content,d,n.language)):n.services.interpolator.interpolate(a.content,d,n.language);t.push(D?React.createElement(D,{key:"".concat(a.name,"-").concat(c)},P):P)}return t},[])}return getChildren(p([{dummy:!0,children:e||[]}],u,getAsArray(e||[]))[0])}function Trans$1(e){var t=e.children,n=e.count,r=e.parent,a=e.i18nKey,i=e.context,o=e.tOptions,s=void 0===o?{}:o,l=e.values,u=e.defaults,c=e.components,d=e.ns,h=e.i18n,f=e.t,p=e.shouldUnescape,g=_objectWithoutProperties(e,_excluded2),m=h||getI18n();if(!m)return warnOnce("You will need to pass in an i18next instance by using i18nextReactModule"),t;var v=f||m.t.bind(m)||function(e){return e};i&&(s.context=i);var y=_objectSpread$2(_objectSpread$2({},getDefaults()),m.options&&m.options.react),b=d||v.ns||m.options&&m.options.defaultNS;b="string"==typeof b?[b]:b||["translation"];var x=u||nodesToString(t,y)||y.transEmptyNodeValue||a,_=y.hashTransKey,w=a||(_?_(x):x),k=l?s.interpolation:{interpolation:_objectSpread$2(_objectSpread$2({},s.interpolation),{},{prefix:"#$?",suffix:"?$#"})},S=_objectSpread$2(_objectSpread$2(_objectSpread$2(_objectSpread$2({},s),{},{count:n},l),k),{},{defaultValue:x,ns:b}),M=renderNodes(c||t,w?v(w,S):x,m,y,S,p),O=void 0!==r?r:y.defaultTransParent;return O?React.createElement(O,g,M):M}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var initReactI18next={type:"3rdParty",init:function(e){setDefaults(e.options.react),setI18n(e)}},I18nContext=React.createContext(),ReportNamespaces=function(){function e(){_classCallCheck(this,e),this.usedNamespaces={}}return _createClass(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach(function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}(),_excluded$1=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Trans(e){var t=e.children,n=e.count,r=e.parent,a=e.i18nKey,i=e.context,o=e.tOptions,s=void 0===o?{}:o,l=e.values,u=e.defaults,c=e.components,d=e.ns,h=e.i18n,f=e.t,p=e.shouldUnescape,g=_objectWithoutProperties(e,_excluded$1),m=React.useContext(I18nContext)||{},v=m.defaultNS,y=h||m.i18n||getI18n(),b=f||y&&y.t.bind(y);return Trans$1(_objectSpread$1({children:t,count:n,parent:r,i18nKey:a,context:i,tOptions:s,values:l,defaults:u,components:c,ns:d||b&&b.ns||v||y&&y.options&&y.options.defaultNS,i18n:y,t:f,shouldUnescape:p},g))}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var usePrevious=function(e,t){var n=React.useRef();return React.useEffect(function(){n.current=t?n.current:e},[e,t]),n.current};function useTranslation(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=React.useContext(I18nContext)||{},a=r.defaultNS,i=n||r.i18n||getI18n();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new ReportNamespaces),!i){warnOnce("You will need to pass in an i18next instance by using initReactI18next");var o=function(e,t){return"string"==typeof t?t:t&&"object"===_typeof(t)&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},s=[o,{},!1];return s.t=o,s.i18n={},s.ready=!1,s}i.options.react&&void 0!==i.options.react.wait&&warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=_objectSpread(_objectSpread(_objectSpread({},getDefaults()),i.options.react),t),u=l.useSuspense,c=l.keyPrefix,d=e||a||i.options&&i.options.defaultNS;d="string"==typeof d?[d]:d||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(d);var h=(i.isInitialized||i.initializedStoreOnce)&&d.every(function(e){return hasLoadedNamespace(e,i,l)});function f(){return i.getFixedT(t.lng||null,"fallback"===l.nsMode?d:d[0],c)}var p=_slicedToArray(React.useState(f),2),g=p[0],m=p[1],v=d.join();t.lng&&(v="".concat(t.lng).concat(v));var y=usePrevious(v),b=React.useRef(!0);React.useEffect(function(){var e=l.bindI18n,n=l.bindI18nStore;function r(){b.current&&m(f)}return b.current=!0,h||u||(t.lng?loadLanguages(i,t.lng,d,function(){b.current&&m(f)}):loadNamespaces(i,d,function(){b.current&&m(f)})),h&&y&&y!==v&&b.current&&m(f),e&&i&&i.on(e,r),n&&i&&i.store.on(n,r),function(){b.current=!1,e&&i&&e.split(" ").forEach(function(e){return i.off(e,r)}),n&&i&&n.split(" ").forEach(function(e){return i.store.off(e,r)})}},[i,v]);var x=React.useRef(!0);React.useEffect(function(){b.current&&!x.current&&m(f),x.current=!1},[i,c]);var _=[g,i,h];if(_.t=g,_.i18n=i,_.ready=h,h)return _;if(!h&&!u)return _;throw new Promise(function(e){t.lng?loadLanguages(i,t.lng,d,function(){return e()}):loadNamespaces(i,d,function(){return e()})})}var Loading$1="Loading",Period$1="Period",Query$1="Query",Cancel$1="Cancel",Save$1="Save",Settings$1="Settings",en={Loading:Loading$1,"Previous shift":"Previous shift","Current shift":"Current shift","Endpoint URL":"Endpoint URL",Period:Period$1,Query:Query$1,"Add another query":"Add another query","Displayed query parameter":"Displayed query parameter","Add another displayed query parameter":"Add another displayed query parameter","X axis unit":"X axis unit","Y axis unit":"Y axis unit",Cancel:Cancel$1,Save:Save$1,Settings:Settings$1},Loading="Wczytywanie",Period="Okres",Query="Zapytanie",Cancel="Anuluj",Save="Zapisz",Settings="Ustawienia",pl={Loading:Loading,"Previous shift":"Poprzednia zmiana","Current shift":"Obecna zmiana","Endpoint URL":"Adres URL",Period:Period,Query:Query,"Add another query":"Dodaj kolejne zapytanie","Displayed query parameter":"Wyświetlany parametr zapytania","Add another displayed query parameter":"Dodaj kolejny wyświetlany parametr zapytania","X axis unit":"Jednostka osi X","Y axis unit":"Jednostka osi Y",Cancel:Cancel,Save:Save,Settings:Settings},resources={en:{translation:en},pl:{translation:pl}};function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}i18n__default.default.use(initReactI18next).init({resources:resources,lng:"pl",interpolation:{escapeValue:!1}});var LIBRARY_VERSION="1.2.4",QueriesPeriod;!function(e){e.CURRENT_SHIFT="CURRENT_SHIFT",e.PREVIOUS_SHIFT="PREVIOUS_SHIFT"}(QueriesPeriod||(QueriesPeriod={}));var SettingsFormContent=function(e){var t=e.settings,n=e.onSettingsChange,r=useTranslation().t,a={mt:2};return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{placeholder:r("Endpoint URL"),value:(null==t?void 0:t.endpointUrl)||"",onChange:function(e){return n({endpointUrl:e.target.value})},fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.Select,{placeholder:r("Period"),value:(null==t?void 0:t.queriesPeriod)||QueriesPeriod.CURRENT_SHIFT,onChange:function(e){return n({queriesPeriod:e.target.value})},fullWidth:!0},Object.keys(QueriesPeriod).map(function(e){return React__default.default.createElement(material.MenuItem,{key:e,value:QueriesPeriod[e]},r(QueriesPeriod[e]===QueriesPeriod.PREVIOUS_SHIFT?"Previous shift":"Current shift"))}))),((null==t?void 0:t.prometheusQueries)||[""]).map(function(e,i){return React__default.default.createElement(material.FormControl,{key:i,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%"},React__default.default.createElement(material.TextField,{placeholder:r("Query"),value:e,onChange:function(e){return function(e,r){var a=[].concat((null==t?void 0:t.prometheusQueries)||[""]);a[e]=r,n({prometheusQueries:a})}(i,e.target.value)},fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat((null==t?void 0:t.prometheusQueries)||[""]);r.splice(e,1),n({prometheusQueries:r})}(i)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat((null==t?void 0:t.prometheusQueries)||[""]);n({prometheusQueries:[].concat(e,[""])})},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(Trans,{t:r},"Add another query")),((null==t?void 0:t.displayedQueryParams)||[""]).map(function(e,i){return React__default.default.createElement(material.FormControl,{key:i,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%"},React__default.default.createElement(material.TextField,{placeholder:r("Displayed query parameter"),value:e,onChange:function(e){return function(e,r){var a=[].concat((null==t?void 0:t.displayedQueryParams)||[""]);a[e]=r,n({displayedQueryParams:a})}(i,e.target.value)},fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat((null==t?void 0:t.displayedQueryParams)||[""]);r.splice(e,1),n({displayedQueryParams:r})}(i)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat((null==t?void 0:t.displayedQueryParams)||[""]);n({displayedQueryParams:[].concat(e,[""])})},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(Trans,{t:r},"Add another displayed query parameter")),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{placeholder:r("X axis unit"),value:(null==t?void 0:t.xAxisUnit)||"",onChange:function(e){return n({xAxisUnit:e.target.value})},fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{placeholder:r("Y axis unit"),value:(null==t?void 0:t.yAxisUnit)||"",onChange:function(e){return n({yAxisUnit:e.target.value})},fullWidth:!0})))},commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e){var t={exports:{}};return e(t,t.exports),t.exports}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var moment$1=createCommonjsModule(function(e,t){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(o(e,t))return!1;return!0}function l(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var n,r=[],a=e.length;for(n=0;n<a;++n)r.push(t(e[n],n));return r}function h(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,n,r){return Rt(e,t,n,r,!0).utc()}function p(e){return null==e._pf&&(e._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}),e._pf}function g(e){if(null==e._isValid){var t=p(e),r=n.call(t.parsedDateParts,function(e){return null!=e}),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function m(e){var t=f(NaN);return null!=e?h(p(t),e):p(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var v=r.momentProperties=[],y=!1;function b(e,t){var n,r,a,i=v.length;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=p(t)),l(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)l(a=t[r=v[n]])||(e[r]=a);return e}function x(e){b(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,r.updateOffset(this),y=!1)}function _(e){return e instanceof x||null!=e&&null!=e._isAMomentObject}function w(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var n=!0;return h(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var a,i,s,l=[],u=arguments.length;for(i=0;i<u;i++){if(a="","object"==typeof arguments[i]){for(s in a+="\n["+i+"] ",arguments[0])o(arguments[0],s)&&(a+=s+": "+arguments[0][s]+", ");a=a.slice(0,-2)}else a=arguments[i];l.push(a)}w(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var S,M={};function O(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),M[e]||(w(t),M[e]=!0)}function D(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function P(e,t){var n,r=h({},e);for(n in t)o(t,n)&&(i(e[n])&&i(t[n])?(r[n]={},h(r[n],e[n]),h(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)o(e,n)&&!o(t,n)&&i(e[n])&&(r[n]=h({},r[n]));return r}function C(e){null!=e&&this.set(e)}function T(e,t,n){var r=""+Math.abs(e);return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-r.length)).toString().substr(1)+r}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n};var A=/(\[[^\[]*\])|(\\)?([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,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},N={};function E(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(N[e]=a),t&&(N[t[0]]=function(){return T(a.apply(this,arguments),t[1],t[2])}),n&&(N[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function F(e,t){return e.isValid()?(t=j(t,e.localeData()),I[t]=I[t]||function(e){var t,n,r,a=e.match(A);for(t=0,n=a.length;t<n;t++)a[t]=N[a[t]]?N[a[t]]:(r=a[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=D(a[r])?a[r].call(t,e):a[r];return i}}(t),I[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(R.lastIndex=0;n>=0&&R.test(e);)e=e.replace(R,r),R.lastIndex=0,n-=1;return e}var L={};function W(e,t){var n=e.toLowerCase();L[n]=L[n+"s"]=L[t]=e}function z(e){return"string"==typeof e?L[e]||L[e.toLowerCase()]:void 0}function Y(e){var t,n,r={};for(n in e)o(e,n)&&(t=z(n))&&(r[t]=e[n]);return r}var V={};function B(e,t){V[e]=t}function H(e){return e%4==0&&e%100!=0||e%400==0}function U(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function q(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=U(t)),n}function $(e,t){return function(n){return null!=n?(Q(this,e,n),r.updateOffset(this,t),this):G(this,e)}}function G(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Q(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&H(e.year())&&1===e.month()&&29===e.date()?(n=q(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Te(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var J,K=/\d/,Z=/\d\d/,X=/\d{3}/,ee=/\d{4}/,te=/[+-]?\d{6}/,ne=/\d\d?/,re=/\d\d\d\d?/,ae=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,oe=/\d{1,4}/,se=/[+-]?\d{1,6}/,le=/\d+/,ue=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,de=/Z|[+-]\d\d(?::?\d\d)?/gi,he=/[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;function fe(e,t,n){J[e]=D(t)?t:function(e,r){return e&&n?n:t}}function pe(e,t){return o(J,e)?J[e](t._strict,t._locale):new RegExp(function(e){return ge(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,a){return t||n||r||a}))}(e))}function ge(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}J={};var me={};function ve(e,t){var n,r,a=t;for("string"==typeof e&&(e=[e]),u(t)&&(a=function(e,n){n[t]=q(e)}),r=e.length,n=0;n<r;n++)me[e[n]]=a}function ye(e,t){ve(e,function(e,n,r,a){r._w=r._w||{},t(e,r._w,r,a)})}function be(e,t,n){null!=t&&o(me,e)&&me[e](t,n._a,n,e)}var xe,_e=0,we=1,ke=2,Se=3,Me=4,Oe=5,De=6,Pe=7,Ce=8;function Te(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=function(e,t){return(e%12+12)%12}(t);return e+=(t-n)/12,1===n?H(e)?29:28:31-n%7%2}xe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},E("M",["MM",2],"Mo",function(){return this.month()+1}),E("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),E("MMMM",0,0,function(e){return this.localeData().months(this,e)}),W("month","M"),B("month",8),fe("M",ne),fe("MM",ne,Z),fe("MMM",function(e,t){return t.monthsShortRegex(e)}),fe("MMMM",function(e,t){return t.monthsRegex(e)}),ve(["M","MM"],function(e,t){t[we]=q(e)-1}),ve(["MMM","MMMM"],function(e,t,n,r){var a=n._locale.monthsParse(e,r,n._strict);null!=a?t[we]=a:p(n).invalidMonth=e});var Ae="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ie=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ne=he,Ee=he;function Fe(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=f([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=xe.call(this._shortMonthsParse,o))?a:null:-1!==(a=xe.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=xe.call(this._shortMonthsParse,o))||-1!==(a=xe.call(this._longMonthsParse,o))?a:null:-1!==(a=xe.call(this._longMonthsParse,o))||-1!==(a=xe.call(this._shortMonthsParse,o))?a:null}function je(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=q(t);else if(!u(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Te(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Le(e){return null!=e?(je(this,e),r.updateOffset(this,!0),this):G(this,"Month")}function We(){function e(e,t){return t.length-e.length}var t,n,r=[],a=[],i=[];for(t=0;t<12;t++)n=f([2e3,t]),r.push(this.monthsShort(n,"")),a.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(e),a.sort(e),i.sort(e),t=0;t<12;t++)r[t]=ge(r[t]),a[t]=ge(a[t]);for(t=0;t<24;t++)i[t]=ge(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function ze(e){return H(e)?366:365}E("Y",0,0,function(){var e=this.year();return e<=9999?T(e,4):"+"+e}),E(0,["YY",2],0,function(){return this.year()%100}),E(0,["YYYY",4],0,"year"),E(0,["YYYYY",5],0,"year"),E(0,["YYYYYY",6,!0],0,"year"),W("year","y"),B("year",1),fe("Y",ue),fe("YY",ne,Z),fe("YYYY",oe,ee),fe("YYYYY",se,te),fe("YYYYYY",se,te),ve(["YYYYY","YYYYYY"],_e),ve("YYYY",function(e,t){t[_e]=2===e.length?r.parseTwoDigitYear(e):q(e)}),ve("YY",function(e,t){t[_e]=r.parseTwoDigitYear(e)}),ve("Y",function(e,t){t[_e]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return q(e)+(q(e)>68?1900:2e3)};var Ye=$("FullYear",!0);function Ve(e,t,n,r,a,i,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,a,i,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,a,i,o),s}function Be(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function He(e,t,n){var r=7+t-n;return-(7+Be(e,0,r).getUTCDay()-t)%7+r-1}function Ue(e,t,n,r,a){var i,o,s=1+7*(t-1)+(7+n-r)%7+He(e,r,a);return s<=0?o=ze(i=e-1)+s:s>ze(e)?(i=e+1,o=s-ze(e)):(i=e,o=s),{year:i,dayOfYear:o}}function qe(e,t,n){var r,a,i=He(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?r=o+$e(a=e.year()-1,t,n):o>$e(e.year(),t,n)?(r=o-$e(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function $e(e,t,n){var r=He(e,t,n),a=He(e+1,t,n);return(ze(e)-r+a)/7}function Ge(e,t){return e.slice(t,7).concat(e.slice(0,t))}E("w",["ww",2],"wo","week"),E("W",["WW",2],"Wo","isoWeek"),W("week","w"),W("isoWeek","W"),B("week",5),B("isoWeek",5),fe("w",ne),fe("ww",ne,Z),fe("W",ne),fe("WW",ne,Z),ye(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=q(e)}),E("d",0,"do","day"),E("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),E("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),E("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),E("e",0,0,"weekday"),E("E",0,0,"isoWeekday"),W("day","d"),W("weekday","e"),W("isoWeekday","E"),B("day",11),B("weekday",11),B("isoWeekday",11),fe("d",ne),fe("e",ne),fe("E",ne),fe("dd",function(e,t){return t.weekdaysMinRegex(e)}),fe("ddd",function(e,t){return t.weekdaysShortRegex(e)}),fe("dddd",function(e,t){return t.weekdaysRegex(e)}),ye(["dd","ddd","dddd"],function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:p(n).invalidWeekday=e}),ye(["d","e","E"],function(e,t,n,r){t[r]=q(e)});var Qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Je="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ze=he,Xe=he,et=he;function tt(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=f([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=xe.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=xe.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=xe.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=xe.call(this._weekdaysParse,o))||-1!==(a=xe.call(this._shortWeekdaysParse,o))||-1!==(a=xe.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=xe.call(this._shortWeekdaysParse,o))||-1!==(a=xe.call(this._weekdaysParse,o))||-1!==(a=xe.call(this._minWeekdaysParse,o))?a:null:-1!==(a=xe.call(this._minWeekdaysParse,o))||-1!==(a=xe.call(this._weekdaysParse,o))||-1!==(a=xe.call(this._shortWeekdaysParse,o))?a:null}function nt(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),r=ge(this.weekdaysMin(n,"")),a=ge(this.weekdaysShort(n,"")),i=ge(this.weekdays(n,"")),o.push(r),s.push(a),l.push(i),u.push(r),u.push(a),u.push(i);o.sort(e),s.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function rt(){return this.hours()%12||12}function at(e,t){E(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function it(e,t){return t._meridiemParse}E("H",["HH",2],0,"hour"),E("h",["hh",2],0,rt),E("k",["kk",2],0,function(){return this.hours()||24}),E("hmm",0,0,function(){return""+rt.apply(this)+T(this.minutes(),2)}),E("hmmss",0,0,function(){return""+rt.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),E("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),E("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),at("a",!0),at("A",!1),W("hour","h"),B("hour",13),fe("a",it),fe("A",it),fe("H",ne),fe("h",ne),fe("k",ne),fe("HH",ne,Z),fe("hh",ne,Z),fe("kk",ne,Z),fe("hmm",re),fe("hmmss",ae),fe("Hmm",re),fe("Hmmss",ae),ve(["H","HH"],Se),ve(["k","kk"],function(e,t,n){var r=q(e);t[Se]=24===r?0:r}),ve(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ve(["h","hh"],function(e,t,n){t[Se]=q(e),p(n).bigHour=!0}),ve("hmm",function(e,t,n){var r=e.length-2;t[Se]=q(e.substr(0,r)),t[Me]=q(e.substr(r)),p(n).bigHour=!0}),ve("hmmss",function(e,t,n){var r=e.length-4,a=e.length-2;t[Se]=q(e.substr(0,r)),t[Me]=q(e.substr(r,2)),t[Oe]=q(e.substr(a)),p(n).bigHour=!0}),ve("Hmm",function(e,t,n){var r=e.length-2;t[Se]=q(e.substr(0,r)),t[Me]=q(e.substr(r))}),ve("Hmmss",function(e,t,n){var r=e.length-4,a=e.length-2;t[Se]=q(e.substr(0,r)),t[Me]=q(e.substr(r,2)),t[Oe]=q(e.substr(a))});var ot,st=$("Hours",!0),lt={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:Ae,monthsShort:Re,week:{dow:0,doy:6},weekdays:Qe,weekdaysMin:Ke,weekdaysShort:Je,meridiemParse:/[ap]\.?m?\.?/i},ut={},ct={};function dt(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function ht(e){return e?e.toLowerCase().replace("_","-"):e}function ft(t){var n=null;if(void 0===ut[t]&&e&&e.exports&&function(e){return null!=e.match("^[^/\\\\]*$")}(t))try{n=ot._abbr,commonjsRequire("./locale/"+t),pt(n)}catch(e){ut[t]=null}return ut[t]}function pt(e,t){var n;return e&&((n=l(t)?mt(e):gt(e,t))?ot=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ot._abbr}function gt(e,t){if(null!==t){var n,r=lt;if(t.abbr=e,null!=ut[e])O("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."),r=ut[e]._config;else if(null!=t.parentLocale)if(null!=ut[t.parentLocale])r=ut[t.parentLocale]._config;else{if(null==(n=ft(t.parentLocale)))return ct[t.parentLocale]||(ct[t.parentLocale]=[]),ct[t.parentLocale].push({name:e,config:t}),null;r=n._config}return ut[e]=new C(P(r,t)),ct[e]&&ct[e].forEach(function(e){gt(e.name,e.config)}),pt(e),ut[e]}return delete ut[e],null}function mt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ot;if(!a(e)){if(t=ft(e))return t;e=[e]}return function(e){for(var t,n,r,a,i=0;i<e.length;){for(t=(a=ht(e[i]).split("-")).length,n=(n=ht(e[i+1]))?n.split("-"):null;t>0;){if(r=ft(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&dt(a,n)>=t-1)break;t--}i++}return ot}(e)}function vt(e){var t,n=e._a;return n&&-2===p(e).overflow&&(t=n[we]<0||n[we]>11?we:n[ke]<1||n[ke]>Te(n[_e],n[we])?ke:n[Se]<0||n[Se]>24||24===n[Se]&&(0!==n[Me]||0!==n[Oe]||0!==n[De])?Se:n[Me]<0||n[Me]>59?Me:n[Oe]<0||n[Oe]>59?Oe:n[De]<0||n[De]>999?De:-1,p(e)._overflowDayOfYear&&(t<_e||t>ke)&&(t=ke),p(e)._overflowWeeks&&-1===t&&(t=Pe),p(e)._overflowWeekday&&-1===t&&(t=Ce),p(e).overflow=t),e}var yt=/^\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)?)?$/,bt=/^\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)?)?$/,xt=/Z|[+-]\d\d(?::?\d\d)?/,_t=[["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]],wt=[["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/]],kt=/^\/?Date\((-?\d+)/i,St=/^(?:(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}))$/,Mt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ot(e){var t,n,r,a,i,o,s=e._i,l=yt.exec(s)||bt.exec(s),u=_t.length,c=wt.length;if(l){for(p(e).iso=!0,t=0,n=u;t<n;t++)if(_t[t][1].exec(l[1])){a=_t[t][0],r=!1!==_t[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=c;t<n;t++)if(wt[t][1].exec(l[3])){i=(l[2]||" ")+wt[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!xt.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),Tt(e)}else e._isValid=!1}function Dt(e){var t,n,r,a,i,o,s,l,u,c=St.exec(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}(e._i));if(c){if(n=c[3],r=c[2],a=c[5],i=c[6],o=c[7],s=[(l=c[4],u=parseInt(l,10),u<=49?2e3+u:u<=999?1900+u:u),Re.indexOf(n),parseInt(r,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),!function(e,t,n){return!e||Je.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(p(n).weekdayMismatch=!0,n._isValid=!1,!1)}(c[1],t=s,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return Mt[e];if(t)return 0;var r=parseInt(n,10),a=r%100;return(r-a)/100*60+a}(c[8],c[9],c[10]),e._d=Be.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Pt(e,t,n){return null!=e?e:null!=t?t:n}function Ct(e){var t,n,a,i,o,s=[];if(!e._d){for(a=function(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ke]&&null==e._a[we]&&function(e){var t,n,r,a,i,o,s,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,o=4,n=Pt(t.GG,e._a[_e],qe(It(),1,4).year),r=Pt(t.W,1),((a=Pt(t.E,1))<1||a>7)&&(l=!0)):(i=e._locale._week.dow,o=e._locale._week.doy,u=qe(It(),i,o),n=Pt(t.gg,e._a[_e],u.year),r=Pt(t.w,u.week),null!=t.d?((a=t.d)<0||a>6)&&(l=!0):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(l=!0)):a=i),r<1||r>$e(n,i,o)?p(e)._overflowWeeks=!0:null!=l?p(e)._overflowWeekday=!0:(s=Ue(n,r,a,i,o),e._a[_e]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=Pt(e._a[_e],a[_e]),(e._dayOfYear>ze(o)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),n=Be(o,0,e._dayOfYear),e._a[we]=n.getUTCMonth(),e._a[ke]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Se]&&0===e._a[Me]&&0===e._a[Oe]&&0===e._a[De]&&(e._nextDay=!0,e._a[Se]=0),e._d=(e._useUTC?Be:Ve).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Se]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(p(e).weekdayMismatch=!0)}}function Tt(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],p(e).empty=!0;var t,n,a,i,o,s,l,u=""+e._i,c=u.length,d=0;for(l=(a=j(e._f,e._locale).match(A)||[]).length,t=0;t<l;t++)(n=(u.match(pe(i=a[t],e))||[])[0])&&((o=u.substr(0,u.indexOf(n))).length>0&&p(e).unusedInput.push(o),u=u.slice(u.indexOf(n)+n.length),d+=n.length),N[i]?(n?p(e).empty=!1:p(e).unusedTokens.push(i),be(i,n,e)):e._strict&&!n&&p(e).unusedTokens.push(i);p(e).charsLeftOver=c-d,u.length>0&&p(e).unusedInput.push(u),e._a[Se]<=12&&!0===p(e).bigHour&&e._a[Se]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[Se]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[Se],e._meridiem),null!==(s=p(e).era)&&(e._a[_e]=e._locale.erasConvertYear(s,e._a[_e])),Ct(e),vt(e)}else Dt(e);else Ot(e)}function At(e){var t=e._i,n=e._f;return e._locale=e._locale||mt(e._l),null===t||void 0===n&&""===t?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),_(t)?new x(vt(t)):(c(t)?e._d=t:a(n)?function(e){var t,n,r,a,i,o,s=!1,l=e._f.length;if(0===l)return p(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<l;a++)i=0,o=!1,t=b({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],Tt(t),g(t)&&(o=!0),i+=p(t).charsLeftOver,i+=10*p(t).unusedTokens.length,p(t).score=i,s?i<r&&(r=i,n=t):(null==r||i<r||o)&&(r=i,n=t,o&&(s=!0));h(e,n||t)}(e):n?Tt(e):function(e){var t=e._i;l(t)?e._d=new Date(r.now()):c(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=kt.exec(e._i);null===t?(Ot(e),!1===e._isValid&&(delete e._isValid,Dt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):a(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Ct(e)):i(t)?function(e){if(!e._d){var t=Y(e._i);e._a=d([t.year,t.month,void 0===t.day?t.date:t.day,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Ct(e)}}(e):u(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),g(e)||(e._d=null),e))}function Rt(e,t,n,r,o){var l,u={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(i(e)&&s(e)||a(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=n,u._i=e,u._f=t,u._strict=r,(l=new x(vt(At(u))))._nextDay&&(l.add(1,"d"),l._nextDay=void 0),l}function It(e,t,n,r){return Rt(e,t,n,r,!1)}r.createFromInputFallback=k("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(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var Nt=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=It.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),Et=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=It.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()});function Ft(e,t){var n,r;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return It();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var jt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Lt(e){var t=Y(e),n=t.year||0,r=t.quarter||0,a=t.month||0,i=t.week||t.isoWeek||0,s=t.day||0,l=t.hour||0,u=t.minute||0,c=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,n,r=!1,a=jt.length;for(t in e)if(o(e,t)&&(-1===xe.call(jt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<a;++n)if(e[jt[n]]){if(r)return!1;parseFloat(e[jt[n]])!==q(e[jt[n]])&&(r=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*u+1e3*l*60*60,this._days=+s+7*i,this._months=+a+3*r+12*n,this._data={},this._locale=mt(),this._bubble()}function Wt(e){return e instanceof Lt}function zt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Yt(e,t){E(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+T(~~(e/60),2)+t+T(~~e%60,2)})}Yt("Z",":"),Yt("ZZ",""),fe("Z",de),fe("ZZ",de),ve(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Bt(de,e)});var Vt=/([\+\-]|\d\d)/gi;function Bt(e,t){var n,r,a=(t||"").match(e);return null===a?null:0===(r=60*(n=((a[a.length-1]||[])+"").match(Vt)||["-",0,0])[1]+q(n[2]))?0:"+"===n[0]?r:-r}function Ht(e,t){var n,a;return t._isUTC?(n=t.clone(),a=(_(e)||c(e)?e.valueOf():It(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),r.updateOffset(n,!1),n):It(e).local()}function Ut(e){return-Math.round(e._d.getTimezoneOffset())}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var $t=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Gt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Qt(e,t){var n,r,a,i,s,l,c=e,d=null;return Wt(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=$t.exec(e))?(n="-"===d[1]?-1:1,c={y:0,d:q(d[ke])*n,h:q(d[Se])*n,m:q(d[Me])*n,s:q(d[Oe])*n,ms:q(zt(1e3*d[De]))*n}):(d=Gt.exec(e))?c={y:Jt(d[2],n="-"===d[1]?-1:1),M:Jt(d[3],n),w:Jt(d[4],n),d:Jt(d[5],n),h:Jt(d[6],n),m:Jt(d[7],n),s:Jt(d[8],n)}:null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(i=It(c.from),s=It(c.to),a=i.isValid()&&s.isValid()?(s=Ht(s,i),i.isBefore(s)?l=Kt(i,s):((l=Kt(s,i)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(c={}).ms=a.milliseconds,c.M=a.months),r=new Lt(c),Wt(e)&&o(e,"_locale")&&(r._locale=e._locale),Wt(e)&&o(e,"_isValid")&&(r._isValid=e._isValid),r}function Jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Kt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Zt(e,t){return function(n,r){var a;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),Xt(this,Qt(n,r),e),this}}function Xt(e,t,n,a){var i=t._milliseconds,o=zt(t._days),s=zt(t._months);e.isValid()&&(a=null==a||a,s&&je(e,G(e,"Month")+s*n),o&&Q(e,"Date",G(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),a&&r.updateOffset(e,o||s))}Qt.fn=Lt.prototype,Qt.invalid=function(){return Qt(NaN)};var en=Zt(1,"add"),tn=Zt(-1,"subtract");function nn(e){return"string"==typeof e||e instanceof String}function rn(e,t){if(e.date()<t.date())return-rn(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function an(e){var t;return void 0===e?this._locale._abbr:(null!=(t=mt(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var on=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function sn(){return this._locale}var ln=1e3,un=6e4,cn=36e5,dn=126227808e5;function hn(e,t){return(e%t+t)%t}function fn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-dn:new Date(e,t,n).valueOf()}function pn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-dn:Date.UTC(e,t,n)}function gn(e,t){return t.erasAbbrRegex(e)}function mn(){var e,t,n=[],r=[],a=[],i=[],o=this.eras();for(e=0,t=o.length;e<t;++e)r.push(ge(o[e].name)),n.push(ge(o[e].abbr)),a.push(ge(o[e].narrow)),i.push(ge(o[e].name)),i.push(ge(o[e].abbr)),i.push(ge(o[e].narrow));this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+r.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}function vn(e,t){E(0,[e,e.length],0,t)}function yn(e,t,n,r,a){var i;return null==e?qe(this,r,a).year:(t>(i=$e(e,r,a))&&(t=i),bn.call(this,e,t,n,r,a))}function bn(e,t,n,r,a){var i=Ue(e,t,n,r,a),o=Be(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}E("N",0,0,"eraAbbr"),E("NN",0,0,"eraAbbr"),E("NNN",0,0,"eraAbbr"),E("NNNN",0,0,"eraName"),E("NNNNN",0,0,"eraNarrow"),E("y",["y",1],"yo","eraYear"),E("y",["yy",2],0,"eraYear"),E("y",["yyy",3],0,"eraYear"),E("y",["yyyy",4],0,"eraYear"),fe("N",gn),fe("NN",gn),fe("NNN",gn),fe("NNNN",function(e,t){return t.erasNameRegex(e)}),fe("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),ve(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var a=n._locale.erasParse(e,r,n._strict);a?p(n).era=a:p(n).invalidEra=e}),fe("y",le),fe("yy",le),fe("yyy",le),fe("yyyy",le),fe("yo",function(e,t){return t._eraYearOrdinalRegex||le}),ve(["y","yy","yyy","yyyy"],_e),ve(["yo"],function(e,t,n,r){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),t[_e]=n._locale.eraYearOrdinalParse?n._locale.eraYearOrdinalParse(e,a):parseInt(e,10)}),E(0,["gg",2],0,function(){return this.weekYear()%100}),E(0,["GG",2],0,function(){return this.isoWeekYear()%100}),vn("gggg","weekYear"),vn("ggggg","weekYear"),vn("GGGG","isoWeekYear"),vn("GGGGG","isoWeekYear"),W("weekYear","gg"),W("isoWeekYear","GG"),B("weekYear",1),B("isoWeekYear",1),fe("G",ue),fe("g",ue),fe("GG",ne,Z),fe("gg",ne,Z),fe("GGGG",oe,ee),fe("gggg",oe,ee),fe("GGGGG",se,te),fe("ggggg",se,te),ye(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=q(e)}),ye(["gg","GG"],function(e,t,n,a){t[a]=r.parseTwoDigitYear(e)}),E("Q",0,"Qo","quarter"),W("quarter","Q"),B("quarter",7),fe("Q",K),ve("Q",function(e,t){t[we]=3*(q(e)-1)}),E("D",["DD",2],"Do","date"),W("date","D"),B("date",9),fe("D",ne),fe("DD",ne,Z),fe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ve(["D","DD"],ke),ve("Do",function(e,t){t[ke]=q(e.match(ne)[0])});var xn=$("Date",!0);E("DDD",["DDDD",3],"DDDo","dayOfYear"),W("dayOfYear","DDD"),B("dayOfYear",4),fe("DDD",ie),fe("DDDD",X),ve(["DDD","DDDD"],function(e,t,n){n._dayOfYear=q(e)}),E("m",["mm",2],0,"minute"),W("minute","m"),B("minute",14),fe("m",ne),fe("mm",ne,Z),ve(["m","mm"],Me);var _n=$("Minutes",!1);E("s",["ss",2],0,"second"),W("second","s"),B("second",15),fe("s",ne),fe("ss",ne,Z),ve(["s","ss"],Oe);var wn,kn,Sn=$("Seconds",!1);for(E("S",0,0,function(){return~~(this.millisecond()/100)}),E(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),E(0,["SSS",3],0,"millisecond"),E(0,["SSSS",4],0,function(){return 10*this.millisecond()}),E(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),E(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),E(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),E(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),E(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),W("millisecond","ms"),B("millisecond",16),fe("S",ie,K),fe("SS",ie,Z),fe("SSS",ie,X),wn="SSSS";wn.length<=9;wn+="S")fe(wn,le);function Mn(e,t){t[De]=q(1e3*("0."+e))}for(wn="S";wn.length<=9;wn+="S")ve(wn,Mn);kn=$("Milliseconds",!1),E("z",0,0,"zoneAbbr"),E("zz",0,0,"zoneName");var On=x.prototype;function Dn(e){return e}On.add=en,On.calendar=function(e,t){var n;1===arguments.length&&(arguments[0]?_(n=arguments[0])||c(n)||nn(n)||u(n)||function(e){var t=a(e),n=!1;return t&&(n=0===e.filter(function(t){return!u(t)&&nn(e)}).length),t&&n}(n)||function(e){var t,n=i(e)&&!s(e),r=!1,a=["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=a.length;for(t=0;t<l;t+=1)r=r||o(e,a[t]);return n&&r}(n)||null==n?(e=arguments[0],t=void 0):function(e){var t,n=i(e)&&!s(e),r=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<a.length;t+=1)r=r||o(e,a[t]);return n&&r}(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var l=e||It(),d=Ht(l,this).startOf("day"),h=r.calendarFormat(this,d)||"sameElse",f=t&&(D(t[h])?t[h].call(this,l):t[h]);return this.format(f||this.localeData().calendar(h,this,It(l)))},On.clone=function(){return new x(this)},On.diff=function(e,t,n){var r,a,i;if(!this.isValid())return NaN;if(!(r=Ht(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=z(t)){case"year":i=rn(this,r)/12;break;case"month":i=rn(this,r);break;case"quarter":i=rn(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-a)/864e5;break;case"week":i=(this-r-a)/6048e5;break;default:i=this-r}return n?i:U(i)},On.endOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?pn:fn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=cn-hn(t+(this._isUTC?0:this.utcOffset()*un),cn)-1;break;case"minute":t=this._d.valueOf(),t+=un-hn(t,un)-1;break;case"second":t=this._d.valueOf(),t+=ln-hn(t,ln)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},On.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=F(this,e);return this.localeData().postformat(t)},On.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||It(e).isValid())?Qt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},On.fromNow=function(e){return this.from(It(),e)},On.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||It(e).isValid())?Qt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},On.toNow=function(e){return this.to(It(),e)},On.get=function(e){return D(this[e=z(e)])?this[e]():this},On.invalidAt=function(){return p(this).overflow},On.isAfter=function(e,t){var n=_(e)?e:It(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},On.isBefore=function(e,t){var n=_(e)?e:It(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},On.isBetween=function(e,t,n,r){var a=_(e)?e:It(e),i=_(t)?t:It(t);return!!(this.isValid()&&a.isValid()&&i.isValid())&&("("===(r=r||"()")[0]?this.isAfter(a,n):!this.isBefore(a,n))&&(")"===r[1]?this.isBefore(i,n):!this.isAfter(i,n))},On.isSame=function(e,t){var n,r=_(e)?e:It(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},On.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},On.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},On.isValid=function(){return g(this)},On.lang=on,On.locale=an,On.localeData=sn,On.max=Et,On.min=Nt,On.parsingFlags=function(){return h({},p(this))},On.set=function(e,t){if("object"==typeof e){var n,r=function(e){var t,n=[];for(t in e)o(e,t)&&n.push({unit:t,priority:V[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=Y(e)),a=r.length;for(n=0;n<a;n++)this[r[n].unit](e[r[n].unit])}else if(D(this[e=z(e)]))return this[e](t);return this},On.startOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?pn:fn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=hn(t+(this._isUTC?0:this.utcOffset()*un),cn);break;case"minute":t=this._d.valueOf(),t-=hn(t,un);break;case"second":t=this._d.valueOf(),t-=hn(t,ln)}return this._d.setTime(t),r.updateOffset(this,!0),this},On.subtract=tn,On.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},On.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},On.toDate=function(){return new Date(this.valueOf())},On.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?F(n,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",F(n,"Z")):F(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},On.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n="moment",r="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+r+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(On[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),On.toJSON=function(){return this.isValid()?this.toISOString():null},On.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},On.unix=function(){return Math.floor(this.valueOf()/1e3)},On.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},On.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},On.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""},On.eraNarrow=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""},On.eraAbbr=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""},On.eraYear=function(){var e,t,n,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until||i[e].until<=a&&a<=i[e].since)return(this.year()-r(i[e].since).year())*n+i[e].offset;return this.year()},On.year=Ye,On.isLeapYear=function(){return H(this.year())},On.weekYear=function(e){return yn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},On.isoWeekYear=function(e){return yn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},On.quarter=On.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},On.month=Le,On.daysInMonth=function(){return Te(this.year(),this.month())},On.week=On.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},On.isoWeek=On.isoWeeks=function(e){var t=qe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},On.weeksInYear=function(){var e=this.localeData()._week;return $e(this.year(),e.dow,e.doy)},On.weeksInWeekYear=function(){var e=this.localeData()._week;return $e(this.weekYear(),e.dow,e.doy)},On.isoWeeksInYear=function(){return $e(this.year(),1,4)},On.isoWeeksInISOWeekYear=function(){return $e(this.isoWeekYear(),1,4)},On.date=xn,On.day=On.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},On.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},On.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},On.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},On.hour=On.hours=st,On.minute=On.minutes=_n,On.second=On.seconds=Sn,On.millisecond=On.milliseconds=kn,On.utcOffset=function(e,t,n){var a,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Bt(de,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(a=Ut(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!t||this._changeInProgress?Xt(this,Qt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Ut(this)},On.utc=function(e){return this.utcOffset(0,e)},On.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m")),this},On.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Bt(ce,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},On.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?It(e).utcOffset():0,(this.utcOffset()-e)%60==0)},On.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},On.isLocal=function(){return!!this.isValid()&&!this._isUTC},On.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},On.isUtc=qt,On.isUTC=qt,On.zoneAbbr=function(){return this._isUTC?"UTC":""},On.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},On.dates=k("dates accessor is deprecated. Use date instead.",xn),On.months=k("months accessor is deprecated. Use month instead",Le),On.years=k("years accessor is deprecated. Use year instead",Ye),On.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),On.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return b(t,this),(t=At(t))._a?(e=t._isUTC?f(t._a):It(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var r,a=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),o=0;for(r=0;r<a;r++)q(e[r])!==q(t[r])&&o++;return o+i}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Pn=C.prototype;function Cn(e,t,n,r){var a=mt(),i=f().set(r,t);return a[n](i,e)}function Tn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return Cn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=Cn(e,r,n,"month");return a}function An(e,t,n,r){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var a,i=mt(),o=e?i._week.dow:0,s=[];if(null!=n)return Cn(t,(n+o)%7,r,"day");for(a=0;a<7;a++)s[a]=Cn(t,(a+o)%7,r,"day");return s}Pn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return D(r)?r.call(t,n):r},Pn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(A).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Pn.invalidDate=function(){return this._invalidDate},Pn.ordinal=function(e){return this._ordinal.replace("%d",e)},Pn.preparse=Dn,Pn.postformat=Dn,Pn.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return D(a)?a(e,t,n,r):a.replace(/%d/i,e)},Pn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return D(n)?n(t):n.replace(/%s/i,t)},Pn.set=function(e){var t,n;for(n in e)o(e,n)&&(D(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Pn.eras=function(e,t){var n,a,i,o=this._eras||mt("en")._eras;for(n=0,a=o.length;n<a;++n)switch("string"==typeof o[n].since&&(i=r(o[n].since).startOf("day"),o[n].since=i.valueOf()),typeof o[n].until){case"undefined":o[n].until=Infinity;break;case"string":i=r(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf()}return o},Pn.erasParse=function(e,t,n){var r,a,i,o,s,l=this.eras();for(e=e.toUpperCase(),r=0,a=l.length;r<a;++r)if(i=l[r].name.toUpperCase(),o=l[r].abbr.toUpperCase(),s=l[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[r];break;case"NNNN":if(i===e)return l[r];break;case"NNNNN":if(s===e)return l[r]}else if([i,o,s].indexOf(e)>=0)return l[r]},Pn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},Pn.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||mn.call(this),e?this._erasAbbrRegex:this._erasRegex},Pn.erasNameRegex=function(e){return o(this,"_erasNameRegex")||mn.call(this),e?this._erasNameRegex:this._erasRegex},Pn.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||mn.call(this),e?this._erasNarrowRegex:this._erasRegex},Pn.months=function(e,t){return e?a(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ie).test(t)?"format":"standalone"][e.month()]:a(this._months)?this._months:this._months.standalone},Pn.monthsShort=function(e,t){return e?a(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ie.test(t)?"format":"standalone"][e.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Pn.monthsParse=function(e,t,n){var r,a,i;if(this._monthsParseExact)return Fe.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=f([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},Pn.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||We.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=Ee),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Pn.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||We.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Ne),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Pn.week=function(e){return qe(e,this._week.dow,this._week.doy).week},Pn.firstDayOfYear=function(){return this._week.doy},Pn.firstDayOfWeek=function(){return this._week.dow},Pn.weekdays=function(e,t){var n=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ge(n,this._week.dow):e?n[e.day()]:n},Pn.weekdaysMin=function(e){return!0===e?Ge(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Pn.weekdaysShort=function(e){return!0===e?Ge(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Pn.weekdaysParse=function(e,t,n){var r,a,i;if(this._weekdaysParseExact)return tt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=f([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},Pn.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Ze),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Pn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Xe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Pn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=et),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Pn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Pn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},pt("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-Infinity,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===q(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=k("moment.lang is deprecated. Use moment.locale instead.",pt),r.langData=k("moment.langData is deprecated. Use moment.localeData instead.",mt);var Rn=Math.abs;function In(e,t,n,r){var a=Qt(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function Nn(e){return e<0?Math.floor(e):Math.ceil(e)}function En(e){return 4800*e/146097}function Fn(e){return 146097*e/4800}function jn(e){return function(){return this.as(e)}}var Ln=jn("ms"),Wn=jn("s"),zn=jn("m"),Yn=jn("h"),Vn=jn("d"),Bn=jn("w"),Hn=jn("M"),Un=jn("Q"),qn=jn("y");function $n(e){return function(){return this.isValid()?this._data[e]:NaN}}var Gn=$n("milliseconds"),Qn=$n("seconds"),Jn=$n("minutes"),Kn=$n("hours"),Zn=$n("days"),Xn=$n("months"),er=$n("years"),tr=Math.round,nr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rr(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var ar=Math.abs;function ir(e){return(e>0)-(e<0)||+e}function or(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,a,i,o,s,l=ar(this._milliseconds)/1e3,u=ar(this._days),c=ar(this._months),d=this.asSeconds();return d?(e=U(l/60),t=U(e/60),l%=60,e%=60,n=U(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=d<0?"-":"",i=ir(this._months)!==ir(d)?"-":"",o=ir(this._days)!==ir(d)?"-":"",s=ir(this._milliseconds)!==ir(d)?"-":"",a+"P"+(n?i+n+"Y":"")+(c?i+c+"M":"")+(u?o+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var sr=Lt.prototype;return sr.isValid=function(){return this._isValid},sr.abs=function(){var e=this._data;return this._milliseconds=Rn(this._milliseconds),this._days=Rn(this._days),this._months=Rn(this._months),e.milliseconds=Rn(e.milliseconds),e.seconds=Rn(e.seconds),e.minutes=Rn(e.minutes),e.hours=Rn(e.hours),e.months=Rn(e.months),e.years=Rn(e.years),this},sr.add=function(e,t){return In(this,e,t,1)},sr.subtract=function(e,t){return In(this,e,t,-1)},sr.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=z(e))||"quarter"===e||"year"===e)switch(n=this._months+En(t=this._days+r/864e5),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Fn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},sr.asMilliseconds=Ln,sr.asSeconds=Wn,sr.asMinutes=zn,sr.asHours=Yn,sr.asDays=Vn,sr.asWeeks=Bn,sr.asMonths=Hn,sr.asQuarters=Un,sr.asYears=qn,sr.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12):NaN},sr._bubble=function(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Nn(Fn(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=U(i/1e3),l.seconds=e%60,t=U(e/60),l.minutes=t%60,n=U(t/60),l.hours=n%24,o+=U(n/24),s+=a=U(En(o)),o-=Nn(Fn(a)),r=U(s/12),s%=12,l.days=o,l.months=s,l.years=r,this},sr.clone=function(){return Qt(this)},sr.get=function(e){return e=z(e),this.isValid()?this[e+"s"]():NaN},sr.milliseconds=Gn,sr.seconds=Qn,sr.minutes=Jn,sr.hours=Kn,sr.days=Zn,sr.weeks=function(){return U(this.days()/7)},sr.months=Xn,sr.years=er,sr.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,a=!1,i=nr;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(a=e),"object"==typeof t&&(i=Object.assign({},nr,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),r=function(e,t,n,r){var a=Qt(e).abs(),i=tr(a.as("s")),o=tr(a.as("m")),s=tr(a.as("h")),l=tr(a.as("d")),u=tr(a.as("M")),c=tr(a.as("w")),d=tr(a.as("y")),h=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||o<=1&&["m"]||o<n.m&&["mm",o]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(h=h||c<=1&&["w"]||c<n.w&&["ww",c]),(h=h||u<=1&&["M"]||u<n.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=r,rr.apply(null,h)}(this,!a,i,n=this.localeData()),a&&(r=n.pastFuture(+this,r)),n.postformat(r)},sr.toISOString=or,sr.toString=or,sr.toJSON=or,sr.locale=an,sr.localeData=sn,sr.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",or),sr.lang=on,E("X",0,0,"unix"),E("x",0,0,"valueOf"),fe("x",ue),fe("X",/[+-]?\d+(\.\d{1,3})?/),ve("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),ve("x",function(e,t,n){n._d=new Date(q(e))}),r.version="2.29.4",t=It,r.fn=On,r.min=function(){return Ft("isBefore",[].slice.call(arguments,0))},r.max=function(){return Ft("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=f,r.unix=function(e){return It(1e3*e)},r.months=function(e,t){return Tn(e,t,"months")},r.isDate=c,r.locale=pt,r.invalid=m,r.duration=Qt,r.isMoment=_,r.weekdays=function(e,t,n){return An(e,t,n,"weekdays")},r.parseZone=function(){return It.apply(null,arguments).parseZone()},r.localeData=mt,r.isDuration=Wt,r.monthsShort=function(e,t){return Tn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return An(e,t,n,"weekdaysMin")},r.defineLocale=gt,r.updateLocale=function(e,t){if(null!=t){var n,r,a=lt;null!=ut[e]&&null!=ut[e].parentLocale?ut[e].set(P(ut[e]._config,t)):(null!=(r=ft(e))&&(a=r._config),t=P(a,t),null==r&&(t.abbr=e),(n=new C(t)).parentLocale=ut[e],ut[e]=n),pt(e)}else null!=ut[e]&&(null!=ut[e].parentLocale?(ut[e]=ut[e].parentLocale,e===pt()&&pt(e)):null!=ut[e]&&delete ut[e]);return ut[e]},r.locales=function(){return S(ut)},r.weekdaysShort=function(e,t,n){return An(e,t,n,"weekdaysShort")},r.normalizeUnits=z,r.relativeTimeRounding=function(e){return void 0===e?tr:"function"==typeof e&&(tr=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==nr[e]&&(void 0===t?nr[e]:(nr[e]=t,"s"===e&&(nr.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=On,r.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"},r}()}),Chart$1=createCommonjsModule(function(e,t){e.exports=function(e){e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(e,n){return function(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[t[r]]=r);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var i in a)if(a.hasOwnProperty(i)){if(!("channels"in a[i]))throw new Error("missing channels property: "+i);if(!("labels"in a[i]))throw new Error("missing channel labels property: "+i);if(a[i].labels.length!==a[i].channels)throw new Error("channel and label counts mismatch: "+i);var o=a[i].channels,s=a[i].labels;delete a[i].channels,delete a[i].labels,Object.defineProperty(a[i],"channels",{value:o}),Object.defineProperty(a[i],"labels",{value:s})}a.rgb.hsl=function(e){var t,n,r=e[0]/255,a=e[1]/255,i=e[2]/255,o=Math.min(r,a,i),s=Math.max(r,a,i),l=s-o;return s===o?t=0:r===s?t=(a-i)/l:a===s?t=2+(i-r)/l:i===s&&(t=4+(r-a)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+s)/2,[t,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(e){var t,n,r,a,i,o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?a=i=0:(i=c/u,t=d(o),n=d(s),r=d(l),o===u?a=r-n:s===u?a=1/3+t-r:l===u&&(a=2/3+n-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*u]},a.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,r))*100,100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},a.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,a=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-a)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-a-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var r=n[e];if(r)return r;var a,i,o,s=Infinity;for(var l in t)if(t.hasOwnProperty(l)){var u=(i=e,o=t[l],Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)+Math.pow(i[2]-o[2],2));u<s&&(s=u,a=l)}return a},a.keyword.rgb=function(e){return t[e]},a.rgb.xyz=function(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(e){var t,n,r,a,i,o=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[i=255*l,i,i];t=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(r=o+1/3*-(u-1))<0&&r++,r>1&&r--,a[u]=255*(i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t);return a},a.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,a=n,i=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,a*=i<=1?i:2-i,[t,100*(0===r?2*a/(i+a):2*n/(r+n)),(r+n)/2*100]},a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,a=Math.floor(t)%6,i=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*i),l=255*r*(1-n*(1-i));switch(r*=255,a){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}},a.hsv.hsl=function(e){var t,n,r,a=e[0],i=e[1]/100,o=e[2]/100,s=Math.max(o,.01);return r=(2-i)*o,n=i*s,[a,100*(n=(n/=(t=(2-i)*s)<=1?t:2-t)||0),100*(r/=2)]},a.hwb.rgb=function(e){var t,n,r,a,i,o,s,l=e[0]/360,u=e[1]/100,c=e[2]/100,d=u+c;switch(d>1&&(u/=d,c/=d),r=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(r=1-r),a=u+r*((n=1-c)-u),t){default:case 6:case 0:i=n,o=a,s=u;break;case 1:i=a,o=n,s=u;break;case 2:i=u,o=n,s=a;break;case 3:i=u,o=a,s=n;break;case 4:i=a,o=u,s=n;break;case 5:i=n,o=u,s=a}return[255*i,255*o,255*s]},a.cmyk.rgb=function(e){var t=e[1]/100,n=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-r)+r)),255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},a.xyz.rgb=function(e){var t,n,r,a=e[0]/100,i=e[1]/100,o=e[2]/100;return n=-.9689*a+1.8758*i+.0415*o,r=.0557*a+-.204*i+1.057*o,t=(t=3.2406*a+-1.5372*i+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(e){var t,n,r;t=e[1]/500+(n=(e[0]+16)/116),r=n-e[2]/200;var a=Math.pow(n,3),i=Math.pow(t,3),o=Math.pow(r,3);return n=a>.008856?a:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},a.lab.lch=function(e){var t,n=e[0],r=e[1],a=e[2];return(t=360*Math.atan2(a,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+a*a),t]},a.lch.lab=function(e){var t,n=e[1];return t=e[2]/360*2*Math.PI,[e[0],n*Math.cos(t),n*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map(function(e){return e+e}).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,a=e[2]/255,i=Math.max(Math.max(n,r),a),o=Math.min(Math.min(n,r),a),s=i-o;return t=s<=0?0:i===n?(r-a)/s%6:i===r?2+(a-n)/s:4+(n-r)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(e){var t,n=e[1]/100,r=e[2]/100,a=0;return(t=r<.5?2*n*r:2*n*(1-r))<1&&(a=(r-.5*t)/(1-t)),[e[0],100*t,100*a]},a.hsv.hcg=function(e){var t=e[2]/100,n=e[1]/100*t,r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},a.hcg.rgb=function(e){var t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];var r,a=[0,0,0],i=e[0]/360%1*6,o=i%1,s=1-o;switch(Math.floor(i)){case 0:a[0]=1,a[1]=o,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=o;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=o,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return[255*(t*a[0]+(r=(1-t)*n)),255*(t*a[1]+r),255*(t*a[2]+r)]},a.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},a.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},a.hwb.hcg=function(e){var t=1-e[2]/100,n=t-e[1]/100,r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}(n={exports:{}}),n.exports}();function r(e,t){return function(n){return t(e(n))}}function a(e,t){for(var a=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;t[o].parent;)a.unshift(t[o].parent),i=r(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=a,i}var i={};Object.keys(n).forEach(function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});var t=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(n),r=t.length,a=0;a<r;a++)e[t[a]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var a=r.pop(),i=Object.keys(n[a]),o=i.length,s=0;s<o;s++){var l=i[s],u=t[l];-1===u.distance&&(u.distance=t[a].distance+1,u.parent=a,r.unshift(l))}return t}(e),r={},i=Object.keys(t),o=i.length,s=0;s<o;s++){var l=i[s];null!==t[l].parent&&(r[l]=a(l,t))}return r}(e);Object.keys(t).forEach(function(n){var r=t[n];i[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var r=n.length,a=0;a<r;a++)n[a]=Math.round(n[a]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(r),i[e][n].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})});var o=i,s={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},l={getRgba:u,getHsla:c,getRgb:function(e){var t=u(e);return t&&t.slice(0,3)},getHsl:function(e){var t=c(e);return t&&t.slice(0,3)},getHwb:d,getAlpha:function(e){var t=u(e);return t||(t=c(e))||(t=d(e))?t[3]:void 0},hexString:function(e,t){return t=void 0!==t&&3===e.length?t:e[3],"#"+m(e[0])+m(e[1])+m(e[2])+(t>=0&&t<1?m(Math.round(255*t)):"")},rgbString:function(e,t){return t<1||e[3]&&e[3]<1?h(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},rgbaString:h,percentString:function(e,t){return t<1||e[3]&&e[3]<1?f(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"},percentaString:f,hslString:function(e,t){return t<1||e[3]&&e[3]<1?p(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"},hslaString:p,hwbString:function(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"},keyword:function(e){return v[e.slice(0,3)]}};function u(e){if(e){var t=[0,0,0],n=1,r=e.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(r){a=(r=r[1])[3];for(var i=0;i<t.length;i++)t[i]=parseInt(r[i]+r[i],16);a&&(n=Math.round(parseInt(a+a,16)/255*100)/100)}else if(r=e.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(a=r[2],r=r[1],i=0;i<t.length;i++)t[i]=parseInt(r.slice(2*i,2*i+2),16);a&&(n=Math.round(parseInt(a,16)/255*100)/100)}else if(r=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(i=0;i<t.length;i++)t[i]=parseInt(r[i+1]);n=parseFloat(r[4])}else if(r=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(i=0;i<t.length;i++)t[i]=Math.round(2.55*parseFloat(r[i+1]));n=parseFloat(r[4])}else if(r=e.match(/(\w+)/)){if("transparent"==r[1])return[0,0,0,0];if(!(t=s[r[1]]))return}for(i=0;i<t.length;i++)t[i]=g(t[i],0,255);return n=n||0==n?g(n,0,1):1,t[3]=n,t}}function c(e){if(e){var t=e.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(n)?1:n,0,1)]}}}function d(e){if(e){var t=e.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(n)?1:n,0,1)]}}}function h(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function f(e,t){return"rgba("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%, "+(t||e[3]||1)+")"}function p(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function g(e,t,n){return Math.min(Math.max(t,e),n)}function m(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var v={};for(var y in s)v[s[y]]=y;var b=function(e){return e instanceof b?e:this instanceof b?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof e?(t=l.getRgba(e))?this.setValues("rgb",t):(t=l.getHsla(e))?this.setValues("hsl",t):(t=l.getHwb(e))&&this.setValues("hwb",t):"object"==typeof e&&(void 0!==(t=e).r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new b(e);var t};b.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e=(e%=360)<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return l.hexString(this.values.rgb)},rgbString:function(){return l.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return l.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return l.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return l.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return l.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return l.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return l.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;n<e.length;n++){var r=e[n]/255;t[n]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,r=e,a=void 0===t?.5:t,i=2*a-1,o=n.alpha()-r.alpha(),s=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*a+r.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new b,r=this.values,a=n.values;for(var i in r)r.hasOwnProperty(i)&&("[object Array]"===(t={}.toString.call(e=r[i]))?a[i]=e.slice(0):"[object Number]"===t?a[i]=e:console.error("unexpected color value:",e));return n}},b.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},b.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},b.prototype.getValues=function(e){for(var t=this.values,n={},r=0;r<e.length;r++)n[e.charAt(r)]=t[e][r];return 1!==t.alpha&&(n.a=t.alpha),n},b.prototype.setValues=function(e,t){var n,r,a=this.values,i=this.spaces,s=this.maxes,l=1;if(this.valid=!0,"alpha"===e)l=t;else if(t.length)a[e]=t.slice(0,e.length),l=t[e.length];else if(void 0!==t[e.charAt(0)]){for(n=0;n<e.length;n++)a[e][n]=t[e.charAt(n)];l=t.a}else if(void 0!==t[i[e][0]]){var u=i[e];for(n=0;n<e.length;n++)a[e][n]=t[u[n]];l=t.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===e)return!1;for(n=0;n<e.length;n++)r=Math.max(0,Math.min(s[e][n],a[e][n])),a[e][n]=Math.round(r);for(var c in i)c!==e&&(a[c]=o[e][c](a[e]));return!0},b.prototype.setSpace=function(e,t){var n=t[0];return void 0===n?this.getValues(e):("number"==typeof n&&(n=Array.prototype.slice.call(t)),this.setValues(e,n),this)},b.prototype.setChannel=function(e,t,n){var r=this.values[e];return void 0===n?r[t]:(n===r[t]||(r[t]=n,this.setValues(e,r)),this)},"undefined"!=typeof window&&(window.Color=b);var x=b;function _(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}var w,k={noop:function(){},uid:(w=0,function(){return w++}),isNullOrUndef:function(e){return null==e},isArray:function(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)},isObject:function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)},isFinite:function(e){return("number"==typeof e||e instanceof Number)&&isFinite(e)},valueOrDefault:function(e,t){return void 0===e?t:e},valueAtIndexOrDefault:function(e,t,n){return k.valueOrDefault(k.isArray(e)?e[t]:e,n)},callback:function(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)},each:function(e,t,n,r){var a,i,o;if(k.isArray(e))if(i=e.length,r)for(a=i-1;a>=0;a--)t.call(n,e[a],a);else for(a=0;a<i;a++)t.call(n,e[a],a);else if(k.isObject(e))for(i=(o=Object.keys(e)).length,a=0;a<i;a++)t.call(n,e[o[a]],o[a])},arrayEquals:function(e,t){var n,r,a,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=t[n],(a=e[n])instanceof Array&&i instanceof Array){if(!k.arrayEquals(a,i))return!1}else if(a!==i)return!1;return!0},clone:function(e){if(k.isArray(e))return e.map(k.clone);if(k.isObject(e)){for(var t=Object.create(e),n=Object.keys(e),r=n.length,a=0;a<r;++a)t[n[a]]=k.clone(e[n[a]]);return t}return e},_merger:function(e,t,n,r){if(_(e)){var a=t[e],i=n[e];k.isObject(a)&&k.isObject(i)?k.merge(a,i,r):t[e]=k.clone(i)}},_mergerIf:function(e,t,n){if(_(e)){var r=t[e],a=n[e];k.isObject(r)&&k.isObject(a)?k.mergeIf(r,a):t.hasOwnProperty(e)||(t[e]=k.clone(a))}},merge:function(e,t,n){var r,a,i,o,s,l=k.isArray(t)?t:[t],u=l.length;if(!k.isObject(e))return e;for(r=(n=n||{}).merger||k._merger,a=0;a<u;++a)if(k.isObject(t=l[a]))for(s=0,o=(i=Object.keys(t)).length;s<o;++s)r(i[s],e,t,n);return e},mergeIf:function(e,t){return k.merge(e,t,{merger:k._mergerIf})},extend:Object.assign||function(e){return k.merge(e,[].slice.call(arguments,1),{merger:function(e,t,n){t[e]=n[e]}})},inherits:function(e){var t=this,n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},r=function(){this.constructor=n};return r.prototype=t.prototype,n.prototype=new r,n.extend=k.inherits,e&&k.extend(n.prototype,e),n.__super__=t.prototype,n},_deprecated:function(e,t,n,r){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+r+'" instead')}},S=k;k.callCallback=k.callback,k.indexOf=function(e,t,n){return Array.prototype.indexOf.call(e,t,n)},k.getValueOrDefault=k.valueOrDefault,k.getValueAtIndexOrDefault=k.valueAtIndexOrDefault;var M={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return 1-Math.cos(e*(Math.PI/2))},easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0;return 0===e?0:1===e?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1),-1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0;return 0===e?0:1===e?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1),1*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0;return 0===e?0:2==(e/=.5)?1:(n||(n=.45),t=n/(2*Math.PI)*Math.asin(1),e<1?1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:1*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-M.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*M.easeInBounce(2*e):.5*M.easeOutBounce(2*e-1)+.5}},O={effects:M};S.easingEffects=M;var D=Math.PI,P=D/180,C=2*D,T=D/2,A=D/4,R=2*D/3,I={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,r,a,i){if(i){var o=Math.min(i,a/2,r/2),s=t+o,l=n+o,u=t+r-o,c=n+a-o;e.moveTo(t,l),s<u&&l<c?(e.arc(s,l,o,-D,-T),e.arc(u,l,o,-T,0),e.arc(u,c,o,0,T),e.arc(s,c,o,T,D)):s<u?(e.moveTo(s,n),e.arc(u,l,o,-T,T),e.arc(s,l,o,T,D+T)):l<c?(e.arc(s,l,o,-D,0),e.arc(s,c,o,0,D)):e.arc(s,l,o,-D,D),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,a)},drawPoint:function(e,t,n,r,a,i){var o,s,l,u,c,d=(i||0)*P;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(o=t.toString())||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(r,a),e.rotate(d),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(n)||n<=0)){switch(e.beginPath(),t){default:e.arc(r,a,n,0,C),e.closePath();break;case"triangle":e.moveTo(r+Math.sin(d)*n,a-Math.cos(d)*n),d+=R,e.lineTo(r+Math.sin(d)*n,a-Math.cos(d)*n),d+=R,e.lineTo(r+Math.sin(d)*n,a-Math.cos(d)*n),e.closePath();break;case"rectRounded":u=n-(c=.516*n),s=Math.cos(d+A)*u,l=Math.sin(d+A)*u,e.arc(r-s,a-l,c,d-D,d-T),e.arc(r+l,a-s,c,d-T,d),e.arc(r+s,a+l,c,d,d+T),e.arc(r-l,a+s,c,d+T,d+D),e.closePath();break;case"rect":if(!i){u=Math.SQRT1_2*n,e.rect(r-u,a-u,2*u,2*u);break}d+=A;case"rectRot":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+l,a-s),e.lineTo(r+s,a+l),e.lineTo(r-l,a+s),e.closePath();break;case"crossRot":d+=A;case"cross":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l),e.moveTo(r+l,a-s),e.lineTo(r-l,a+s);break;case"star":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l),e.moveTo(r+l,a-s),e.lineTo(r-l,a+s),d+=A,s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l),e.moveTo(r+l,a-s),e.lineTo(r-l,a+s);break;case"line":s=Math.cos(d)*n,l=Math.sin(d)*n,e.moveTo(r-s,a-l),e.lineTo(r+s,a+l);break;case"dash":e.moveTo(r,a),e.lineTo(r+Math.cos(d)*n,a+Math.sin(d)*n)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){var n=1e-6;return e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n},clipArea:function(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()},unclipArea:function(e){e.restore()},lineTo:function(e,t,n,r){var a=n.steppedLine;if(a){if("middle"===a){var i=(t.x+n.x)/2;e.lineTo(i,r?n.y:t.y),e.lineTo(i,r?t.y:n.y)}else"after"===a&&!r||"after"!==a&&r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}else n.tension?e.bezierCurveTo(r?t.controlPointPreviousX:t.controlPointNextX,r?t.controlPointPreviousY:t.controlPointNextY,r?n.controlPointNextX:n.controlPointPreviousX,r?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):e.lineTo(n.x,n.y)}},N=I;S.clear=I.clear,S.drawRoundedRectangle=function(e){e.beginPath(),I.roundedRect.apply(I,arguments)};var E={_set:function(e,t){return S.merge(this[e]||(this[e]={}),t)}};E._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var F=E,j=S.valueOrDefault,L={toLineHeight:function(e,t){var n=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,n,r,a;return S.isObject(e)?(t=+e.top||0,n=+e.right||0,r=+e.bottom||0,a=+e.left||0):t=n=r=a=+e||0,{top:t,right:n,bottom:r,left:a,height:t+r,width:a+n}},_parseFont:function(e){var t=F.global,n=j(e.fontSize,t.defaultFontSize),r={family:j(e.fontFamily,t.defaultFontFamily),lineHeight:S.options.toLineHeight(j(e.lineHeight,t.defaultLineHeight),n),size:n,style:j(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return r.string=function(e){return!e||S.isNullOrUndef(e.size)||S.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(r),r},resolve:function(e,t,n,r){var a,i,o,s=!0;for(a=0,i=e.length;a<i;++a)if(void 0!==(o=e[a])&&(void 0!==t&&"function"==typeof o&&(o=o(t),s=!1),void 0!==n&&S.isArray(o)&&(o=o[n],s=!1),void 0!==o))return r&&!s&&(r.cacheable=!1),o}},W={_factorize:function(e){var t,n=[],r=Math.sqrt(e);for(t=1;t<r;t++)e%t==0&&(n.push(t),n.push(e/t));return r===(0|r)&&n.push(r),n.sort(function(e,t){return e-t}).pop(),n},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,n=Math.round(t);return e===Math.pow(10,n)?n:t}},z=W;S.log10=W.log10;var Y=S,V=N,B=L,H=z;Y.easing=O,Y.canvas=V,Y.options=B,Y.math=H,Y.rtl={getRtlAdapter:function(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}},overrideTextDirection:function(e,t){var n,r;"ltr"!==t&&"rtl"!==t||(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)},restoreTextDirection:function(e){var t=e.prevTextDirection;void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}};var U=function(e){Y.extend(this,e),this.initialize.apply(this,arguments)};Y.extend(U.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=Y.extend({},e._model)),e._start={},e},transition:function(e){var t=this,n=t._model,r=t._start,a=t._view;return n&&1!==e?(a||(a=t._view={}),r||(r=t._start={}),function(e,t,n,r){var a,i,o,s,l,u,c,d,h,f=Object.keys(n);for(a=0,i=f.length;a<i;++a)if(u=n[o=f[a]],t.hasOwnProperty(o)||(t[o]=u),(s=t[o])!==u&&"_"!==o[0]){if(e.hasOwnProperty(o)||(e[o]=s),(c=typeof u)==typeof(l=e[o]))if("string"===c){if((d=x(l)).valid&&(h=x(u)).valid){t[o]=h.mix(d,r).rgbString();continue}}else if(Y.isFinite(l)&&Y.isFinite(u)){t[o]=l+(u-l)*r;continue}t[o]=u}}(r,a,n,e),t):(t._view=Y.extend({},n),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return Y.isNumber(this._model.x)&&Y.isNumber(this._model.y)}}),U.extend=Y.inherits;var q=U,$=q.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),G=$;Object.defineProperty($.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty($.prototype,"chartInstance",{get:function(){return this.chart},set:function(e){this.chart=e}}),F._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:Y.noop,onComplete:Y.noop}});var Q={animations:[],request:null,addAnimation:function(e,t,n,r){var a,i,o=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=n,r||(e.animating=!0),a=0,i=o.length;a<i;++a)if(o[a].chart===e)return void(o[a]=t);o.push(t),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(e){var t=Y.findIndex(this.animations,function(t){return t.chart===e});-1!==t&&(this.animations.splice(t,1),e.animating=!1)},requestAnimationFrame:function(){var e=this;null===e.request&&(e.request=Y.requestAnimFrame.call(window,function(){e.request=null,e.startDigest()}))},startDigest:function(){var e=this;e.advance(),e.animations.length>0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,r,a=this.animations,i=0;i<a.length;)t=(e=a[i]).chart,n=e.numSteps,r=Math.floor((Date.now()-e.startTime)/e.duration*n)+1,e.currentStep=Math.min(r,n),Y.callback(e.render,[t,e],t),Y.callback(e.onAnimationProgress,[e],t),e.currentStep>=n?(Y.callback(e.onAnimationComplete,[e],t),t.animating=!1,a.splice(i,1)):++i}},J=Y.options.resolve,K=["push","pop","shift","splice","unshift"];function Z(e,t){var n=e._chartjs;if(n){var r=n.listeners,a=r.indexOf(t);-1!==a&&r.splice(a,1),r.length>0||(K.forEach(function(t){delete e[t]}),delete e._chartjs)}}var X=function(e,t){this.initialize(e,t)};Y.extend(X.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,r=n.scales,a=e.getDataset(),i=n.options.scales;null!==t.xAxisID&&t.xAxisID in r&&!a.xAxisID||(t.xAxisID=a.xAxisID||i.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in r&&!a.yAxisID||(t.yAxisID=a.yAxisID||i.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&Z(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,r=n.getMeta(),a=n.getDataset().data||[],i=r.data;for(e=0,t=a.length;e<t;++e)i[e]=i[e]||n.createMetaData(e);r.dataset=r.dataset||n.createMetaDataset()},addElementAndReset:function(e){var t=this.createMetaData(e);this.getMeta().data.splice(e,0,t),this.updateElement(t,e,!0)},buildOrUpdateElements:function(){var e,t,n=this,r=n.getDataset(),a=r.data||(r.data=[]);n._data!==a&&(n._data&&Z(n._data,n),a&&Object.isExtensible(a)&&(t=n,(e=a)._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),K.forEach(function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),a=r.apply(this,t);return Y.each(e._chartjs.listeners,function(e){"function"==typeof e[n]&&e[n].apply(e,t)}),a}})}))),n._data=a),n.resyncElements()},_configure:function(){var e=this;e._config=Y.merge(Object.create(null),[e.chart.options.datasets[e._type],e.getDataset()],{merger:function(e,t,n){"_meta"!==e&&"data"!==e&&Y._merger(e,t,n)}})},_update:function(e){var t=this;t._configure(),t._cachedDataOpts=null,t.update(e)},update:Y.noop,transition:function(e){for(var t=this.getMeta(),n=t.data||[],r=n.length,a=0;a<r;++a)n[a].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],n=t.length,r=0;for(e.dataset&&e.dataset.draw();r<n;++r)t[r].draw()},getStyle:function(e){var t,n=this,r=n.getMeta(),a=r.dataset;return n._configure(),!1!==(t=a&&void 0===e?n._resolveDatasetElementOptions(a||{}):n._resolveDataElementOptions(r.data[e=e||0]||{},e)).fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var n,r,a,i,o=this,s=o.chart,l=o._config,u=e.custom||{},c=s.options.elements[o.datasetElementType.prototype._type]||{},d=o._datasetElementOptions,h={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:t};for(n=0,r=d.length;n<r;++n)a=d[n],i=t?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,h[a]=J([u[i],l[i],c[i]],f);return h},_resolveDataElementOptions:function(e,t){var n=this,r=e&&e.custom,a=n._cachedDataOpts;if(a&&!r)return a;var i,o,s,l,u=n.chart,c=n._config,d=u.options.elements[n.dataElementType.prototype._type]||{},h=n._dataElementOptions,f={},p={chart:u,dataIndex:t,dataset:n.getDataset(),datasetIndex:n.index},g={cacheable:!r};if(r=r||{},Y.isArray(h))for(o=0,s=h.length;o<s;++o)f[l=h[o]]=J([r[l],c[l],d[l]],p,t,g);else for(o=0,s=(i=Object.keys(h)).length;o<s;++o)f[l=i[o]]=J([r[l],c[h[l]],c[l],d[l]],p,t,g);return g.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(e){Y.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],n=e._index,r=e.custom||{},a=e._model,i=Y.getHoverColor;e.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=J([r.hoverBackgroundColor,t.hoverBackgroundColor,i(a.backgroundColor)],void 0,n),a.borderColor=J([r.hoverBorderColor,t.hoverBorderColor,i(a.borderColor)],void 0,n),a.borderWidth=J([r.hoverBorderWidth,t.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,n,r,a,i,o=this.getMeta().dataset,s={};if(o){for(i=o._model,a=this._resolveDatasetElementOptions(o,!0),e=0,t=(r=Object.keys(a)).length;e<t;++e)s[n=r[e]]=i[n],i[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var e=this,t=e.getMeta(),n=e.getDataset().data,r=t.data.length,a=n.length;a<r?t.data.splice(a,r-a):a>r&&e.insertElements(r,a-r)},insertElements:function(e,t){for(var n=0;n<t;++n)this.addElementAndReset(e+n)},onDataPush:function(){var e=arguments.length;this.insertElements(this.getDataset().data.length-e,e)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(e,t){this.getMeta().data.splice(e,t),this.insertElements(e,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),X.extend=Y.inherits;var ee=X,te=2*Math.PI;function ne(e,t){var n=t.startAngle,r=t.endAngle,a=t.pixelMargin,i=a/t.outerRadius,o=t.x,s=t.y;e.beginPath(),e.arc(o,s,t.outerRadius,n-i,r+i),t.innerRadius>a?e.arc(o,s,t.innerRadius-a,r+(i=a/t.innerRadius),n-i,!0):e.arc(o,s,a,r+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}F._set("global",{elements:{arc:{backgroundColor:F.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var re=q.extend({_type:"arc",inLabelRange:function(e){var t=this._view;return!!t&&Math.pow(e-t.x,2)<Math.pow(t.radius+t.hoverRadius,2)},inRange:function(e,t){var n=this._view;if(n){for(var r=Y.getAngleFromPoint(n,{x:e,y:t}),a=r.angle,i=r.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=te;for(;a>s;)a-=te;for(;a<o;)a+=te;return a>=o&&a<=s&&i>=n.innerRadius&&i<=n.outerRadius}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,r="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-r,0),pixelMargin:r,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/te)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+te,t.beginPath(),t.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),t.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),t.closePath(),e=0;e<a.fullCircles;++e)t.fill();a.endAngle=a.startAngle+n.circumference%te}t.beginPath(),t.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),t.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),t.closePath(),t.fill(),n.borderWidth&&function(e,t,n){var r="inner"===t.borderAlign;r?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&function(e,t,n,r){var a,i=n.endAngle;for(r&&(n.endAngle=n.startAngle+te,ne(e,n),n.endAngle=i,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=te,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+te,n.startAngle,!0),a=0;a<n.fullCircles;++a)e.stroke();for(e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.startAngle+te),a=0;a<n.fullCircles;++a)e.stroke()}(e,t,n,r),r&&ne(e,n),e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.endAngle),e.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),e.closePath(),e.stroke()}(t,n,a),t.restore()}}),ae=Y.valueOrDefault,ie=F.global.defaultColor;F._set("global",{elements:{line:{tension:.4,backgroundColor:ie,borderWidth:3,borderColor:ie,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var oe=q.extend({_type:"line",draw:function(){var e,t,n,r=this,a=r._view,i=r._chart.ctx,o=a.spanGaps,s=r._children.slice(),l=F.global,u=l.elements.line,c=-1,d=r._loop;if(s.length){if(r._loop){for(e=0;e<s.length;++e)if(t=Y.previousItem(s,e),!s[e]._view.skip&&t._view.skip){s=s.slice(e).concat(s.slice(0,e)),d=o;break}d&&s.push(s[0])}for(i.save(),i.lineCap=a.borderCapStyle||u.borderCapStyle,i.setLineDash&&i.setLineDash(a.borderDash||u.borderDash),i.lineDashOffset=ae(a.borderDashOffset,u.borderDashOffset),i.lineJoin=a.borderJoinStyle||u.borderJoinStyle,i.lineWidth=ae(a.borderWidth,u.borderWidth),i.strokeStyle=a.borderColor||l.defaultColor,i.beginPath(),(n=s[0]._view).skip||(i.moveTo(n.x,n.y),c=0),e=1;e<s.length;++e)n=s[e]._view,t=-1===c?Y.previousItem(s,e):s[c],n.skip||(c!==e-1&&!o||-1===c?i.moveTo(n.x,n.y):Y.canvas.lineTo(i,t._view,n),c=e);d&&i.closePath(),i.stroke(),i.restore()}}}),se=Y.valueOrDefault,le=F.global.defaultColor;function ue(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}F._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:le,borderColor:le,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ce=q.extend({_type:"point",inRange:function(e,t){var n=this._view;return!!n&&Math.pow(e-n.x,2)+Math.pow(t-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:ue,inXRange:ue,inYRange:function(e){var t=this._view;return!!t&&Math.abs(e-t.y)<t.radius+t.hitRadius},getCenterPoint:function(){var e=this._view;return{x:e.x,y:e.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y,padding:e.radius+e.borderWidth}},draw:function(e){var t=this._view,n=this._chart.ctx,r=t.pointStyle,a=t.rotation,i=t.radius,o=t.x,s=t.y,l=F.global,u=l.defaultColor;t.skip||(void 0===e||Y.canvas._isPointInArea(t,e))&&(n.strokeStyle=t.borderColor||u,n.lineWidth=se(t.borderWidth,l.elements.point.borderWidth),n.fillStyle=t.backgroundColor||u,Y.canvas.drawPoint(n,r,i,o,s,a))}}),de=F.global.defaultColor;function he(e){return e&&void 0!==e.width}function fe(e){var t,n,r,a,i;return he(e)?(t=e.x-(i=e.width/2),n=e.x+i,r=Math.min(e.y,e.base),a=Math.max(e.y,e.base)):(i=e.height/2,t=Math.min(e.x,e.base),n=Math.max(e.x,e.base),r=e.y-i,a=e.y+i),{left:t,top:r,right:n,bottom:a}}function pe(e,t,n){return e===t?n:e===n?t:e}function ge(e,t,n){var r=null===t,a=null===n,i=!(!e||r&&a)&&fe(e);return i&&(r||t>=i.left&&t<=i.right)&&(a||n>=i.top&&n<=i.bottom)}F._set("global",{elements:{rectangle:{backgroundColor:de,borderColor:de,borderSkipped:"bottom",borderWidth:0}}});var me=q.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=function(e){var t=fe(e),n=t.right-t.left,r=t.bottom-t.top,a=function(e,t,n){var r,a,i,o,s=e.borderWidth,l=function(e){var t=e.borderSkipped,n={};return t?(e.horizontal?e.base>e.x&&(t=pe(t,"left","right")):e.base<e.y&&(t=pe(t,"bottom","top")),n[t]=!0,n):n}(e);return Y.isObject(s)?(r=+s.top||0,a=+s.right||0,i=+s.bottom||0,o=+s.left||0):r=a=i=o=+s||0,{t:l.top||r<0?0:r>n?n:r,r:l.right||a<0?0:a>t?t:a,b:l.bottom||i<0?0:i>n?n:i,l:l.left||o<0?0:o>t?t:o}}(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b}}}(t),r=n.outer,a=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(r.x,r.y,r.w,r.h),r.w===a.w&&r.h===a.h||(e.save(),e.beginPath(),e.rect(r.x,r.y,r.w,r.h),e.clip(),e.fillStyle=t.borderColor,e.rect(a.x,a.y,a.w,a.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return ge(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return he(n)?ge(n,e,null):ge(n,null,t)},inXRange:function(e){return ge(this._view,e,null)},inYRange:function(e){return ge(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return he(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return he(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),ve={},ye=oe,be=ce,xe=me;ve.Arc=re,ve.Line=ye,ve.Point=be,ve.Rectangle=xe;var _e=Y._deprecated,we=Y.valueOrDefault;F._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),F._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var ke=ee.extend({dataElementType:ve.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,n=this;ee.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0,t=n._getIndexScale().options,_e("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),_e("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),_e("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),_e("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),_e("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,n,r=this,a=r.getMeta().data;for(r._ruler=r.getRuler(),t=0,n=a.length;t<n;++t)r.updateElement(a[t],t,e)},updateElement:function(e,t,n){var r=this,a=r.getMeta(),i=r.getDataset(),o=r._resolveDataElementOptions(e,t);e._xScale=r.getScaleForId(a.xAxisID),e._yScale=r.getScaleForId(a.yAxisID),e._datasetIndex=r.index,e._index=t,e._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:i.label,label:r.chart.data.labels[t]},Y.isArray(i.data[t])&&(e._model.borderSkipped=null),r._updateElementGeometry(e,t,n,o),e.pivot()},_updateElementGeometry:function(e,t,n,r){var a=this,i=e._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),c=a.calculateBarValuePixels(a.index,t,r),d=a.calculateBarIndexPixels(a.index,t,u,r);i.horizontal=l,i.base=n?s:c.base,i.x=l?n?s:c.head:d.center,i.y=l?d.center:n?s:c.head,i.height=l?d.size:void 0,i.width=l?void 0:d.size},_getStacks:function(e){var t,n,r=this._getIndexScale(),a=r._getMatchingVisibleMetas(this._type),i=r.options.stacked,o=a.length,s=[];for(t=0;t<o&&(n=a[t],(!1===i||-1===s.indexOf(n.stack)||void 0===i&&void 0===n.stack)&&s.push(n.stack),n.index!==e);++t);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var n=this._getStacks(e),r=void 0!==t?n.indexOf(t):-1;return-1===r?n.length-1:r},getRuler:function(){var e,t,n=this,r=n._getIndexScale(),a=[];for(e=0,t=n.getMeta().data.length;e<t;++e)a.push(r.getPixelForValue(null,e,n.index));return{pixels:a,start:r._startPixel,end:r._endPixel,stackCount:n.getStackCount(),scale:r}},calculateBarValuePixels:function(e,t,n){var r,a,i,o,s,l,u,c=this,d=c.chart,h=c._getValueScale(),f=h.isHorizontal(),p=d.data.datasets,g=h._getMatchingVisibleMetas(c._type),m=h._parseValue(p[e].data[t]),v=n.minBarLength,y=h.options.stacked,b=c.getMeta().stack,x=void 0===m.start?0:m.max>=0&&m.min>=0?m.min:m.max,_=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,w=g.length;if(y||void 0===y&&void 0!==b)for(r=0;r<w&&(a=g[r]).index!==e;++r)a.stack===b&&(i=void 0===(u=h._parseValue(p[a.index].data[t])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&i<0||m.max>=0&&i>0)&&(x+=i));return o=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+_))-o,void 0!==v&&Math.abs(l)<v&&(l=v,s=_>=0&&!f||_<0&&f?o-v:o+v),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,n,r){var a="flex"===r.barThickness?function(e,t,n){var r,a=t.pixels,i=a[e],o=e>0?a[e-1]:null,s=e<a.length-1?a[e+1]:null,l=n.categoryPercentage;return null===o&&(o=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-o),r=i-(i-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/t.stackCount,ratio:n.barPercentage,start:r}}(t,n,r):function(e,t,n){var r,a,i=n.barThickness,o=t.stackCount,s=t.pixels[e],l=Y.isNullOrUndef(i)?function(e,t){var n,r,a,i,o=e._length;for(a=1,i=t.length;a<i;++a)o=Math.min(o,Math.abs(t[a]-t[a-1]));for(a=0,i=e.getTicks().length;a<i;++a)r=e.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(r-n)):o,n=r;return o}(t.scale,t.pixels):-1;return Y.isNullOrUndef(i)?(r=l*n.categoryPercentage,a=n.barPercentage):(r=i*o,a=1),{chunk:r/o,ratio:a,start:s-r/2}}(t,n,r),i=this.getStackIndex(e,this.getMeta().stack),o=a.start+a.chunk*i+a.chunk/2,s=Math.min(we(r.maxBarThickness,Infinity),a.chunk*a.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),r=e.getMeta().data,a=e.getDataset(),i=r.length,o=0;for(Y.canvas.clipArea(t.ctx,t.chartArea);o<i;++o){var s=n._parseValue(a.data[o]);isNaN(s.min)||isNaN(s.max)||r[o].draw()}Y.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var e=this,t=Y.extend({},ee.prototype._resolveDataElementOptions.apply(e,arguments)),n=e._getIndexScale().options,r=e._getValueScale().options;return t.barPercentage=we(n.barPercentage,t.barPercentage),t.barThickness=we(n.barThickness,t.barThickness),t.categoryPercentage=we(n.categoryPercentage,t.categoryPercentage),t.maxBarThickness=we(n.maxBarThickness,t.maxBarThickness),t.minBarLength=we(r.minBarLength,t.minBarLength),t}}),Se=Y.valueOrDefault,Me=Y.options.resolve;F._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return(t.datasets[e.datasetIndex].label||"")+": ("+e.xLabel+", "+e.yLabel+", "+t.datasets[e.datasetIndex].data[e.index].r+")"}}}});var Oe=ee.extend({dataElementType:ve.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,n=t.getMeta();Y.each(n.data,function(n,r){t.updateElement(n,r,e)})},updateElement:function(e,t,n){var r=this,a=r.getMeta(),i=e.custom||{},o=r.getScaleForId(a.xAxisID),s=r.getScaleForId(a.yAxisID),l=r._resolveDataElementOptions(e,t),u=r.getDataset().data[t],c=r.index,d=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,t,c),h=n?s.getBasePixel():s.getPixelForValue(u,t,c);e._xScale=o,e._yScale=s,e._options=l,e._datasetIndex=c,e._index=t,e._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:i.skip||isNaN(d)||isNaN(h),x:d,y:h},e.pivot()},setHoverStyle:function(e){var t=e._model,n=e._options,r=Y.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Se(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=Se(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=Se(n.hoverBorderWidth,n.borderWidth),t.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(e,t){var n=this,r=n.chart,a=n.getDataset(),i=e.custom||{},o=a.data[t]||{},s=ee.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:r,dataIndex:t,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=Y.extend({},s)),s.radius=Me([i.radius,o.r,n._config.radius,r.options.elements.point.radius],l,t),s}}),De=Y.valueOrDefault,Pe=Math.PI,Ce=2*Pe,Te=Pe/2;F._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,n,r,a=document.createElement("ul"),i=e.data,o=i.datasets,s=i.labels;if(a.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(r=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&r.appendChild(document.createTextNode(s[t]));return a.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,r){var a=e.getDatasetMeta(0),i=a.controller.getStyle(r);return{text:n,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[r])||a.data[r].hidden,index:r}}):[]}},onClick:function(e,t){var n,r,a,i=t.index,o=this.chart;for(n=0,r=(o.data.datasets||[]).length;n<r;++n)(a=o.getDatasetMeta(n)).data[i]&&(a.data[i].hidden=!a.data[i].hidden);o.update()}},cutoutPercentage:50,rotation:-Te,circumference:Ce,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var n=t.labels[e.index],r=": "+t.datasets[e.datasetIndex].data[e.index];return Y.isArray(n)?(n=n.slice())[0]+=r:n+=r,n}}}});var Ae=ee.extend({dataElementType:ve.Arc,linkScales:Y.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&++t;return t},update:function(e){var t,n,r=this,a=r.chart,i=a.chartArea,o=a.options,s=1,l=1,u=0,c=0,d=r.getMeta(),h=d.data,f=o.cutoutPercentage/100||0,p=o.circumference,g=r._getRingWeight(r.index);if(p<Ce){var m=o.rotation%Ce,v=(m+=m>=Pe?-Ce:m<-Pe?Ce:0)+p,y=Math.cos(m),b=Math.sin(m),x=Math.cos(v),_=Math.sin(v),w=m<=0&&v>=0||v>=Ce,k=m<=Te&&v>=Te||v>=Ce+Te,S=m<=-Te&&v>=-Te||v>=Pe+Te,M=m===-Pe||v>=Pe?-1:Math.min(y,y*f,x,x*f),O=S?-1:Math.min(b,b*f,_,_*f),D=w?1:Math.max(y,y*f,x,x*f),P=k?1:Math.max(b,b*f,_,_*f);s=(D-M)/2,l=(P-O)/2,u=-(D+M)/2,c=-(P+O)/2}for(t=0,n=h.length;t<n;++t)h[t]._options=r._resolveDataElementOptions(h[t],t);for(a.borderWidth=r.getMaxBorderWidth(),a.outerRadius=Math.max(Math.min((i.right-i.left-a.borderWidth)/s,(i.bottom-i.top-a.borderWidth)/l)/2,0),a.innerRadius=Math.max(a.outerRadius*f,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(r._getVisibleDatasetWeightTotal()||1),a.offsetX=u*a.outerRadius,a.offsetY=c*a.outerRadius,d.total=r.calculateTotal(),r.outerRadius=a.outerRadius-a.radiusLength*r._getRingWeightOffset(r.index),r.innerRadius=Math.max(r.outerRadius-a.radiusLength*g,0),t=0,n=h.length;t<n;++t)r.updateElement(h[t],t,e)},updateElement:function(e,t,n){var r=this,a=r.chart,i=a.chartArea,o=a.options,s=o.animation,l=(i.left+i.right)/2,u=(i.top+i.bottom)/2,c=o.rotation,d=o.rotation,h=r.getDataset(),f=n&&s.animateRotate||e.hidden?0:r.calculateCircumference(h.data[t])*(o.circumference/Ce),p=e._options||{};Y.extend(e,{_datasetIndex:r.index,_index:t,_model:{backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,borderAlign:p.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:c,endAngle:d,circumference:f,outerRadius:n&&s.animateScale?0:r.outerRadius,innerRadius:n&&s.animateScale?0:r.innerRadius,label:Y.valueAtIndexOrDefault(h.label,t,a.data.labels[t])}});var g=e._model;n&&s.animateRotate||(g.startAngle=0===t?o.rotation:r.getMeta().data[t-1]._model.endAngle,g.endAngle=g.startAngle+g.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),n=this.getMeta(),r=0;return Y.each(n.data,function(n,a){e=t.data[a],isNaN(e)||n.hidden||(r+=Math.abs(e))}),r},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?Ce*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,r,a,i,o,s,l,u=0,c=this.chart;if(!e)for(t=0,n=c.data.datasets.length;t<n;++t)if(c.isDatasetVisible(t)){e=(r=c.getDatasetMeta(t)).data,t!==this.index&&(i=r.controller);break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)a=e[t],i?(i._configure(),o=i._resolveDataElementOptions(a,t)):o=a._options,"inner"!==o.borderAlign&&(u=(l=o.hoverBorderWidth)>(u=(s=o.borderWidth)>u?s:u)?l:u);return u},setHoverStyle:function(e){var t=e._model,n=e._options,r=Y.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=De(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=De(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=De(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t},_getRingWeight:function(e){return Math.max(De(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});F._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),F._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Re=ke.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Ie=Y.valueOrDefault,Ne=Y.options.resolve,Ee=Y.canvas._isPointInArea;function Fe(e,t){var n=e&&e.options.ticks||{},r=n.reverse,a=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:a,end:r?a:i}}F._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var je=ee.extend({datasetElementType:ve.Line,dataElementType:ve.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(e){var t,n,r=this,a=r.getMeta(),i=a.dataset,o=a.data||[],s=r._config,l=r._showLine=Ie(s.showLine,r.chart.options.showLines);for(r._xScale=r.getScaleForId(a.xAxisID),r._yScale=r.getScaleForId(a.yAxisID),l&&(void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),i._scale=r._yScale,i._datasetIndex=r.index,i._children=o,i._model=r._resolveDatasetElementOptions(i),i.pivot()),t=0,n=o.length;t<n;++t)r.updateElement(o[t],t,e);for(l&&0!==i._model.tension&&r.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var r,a,i=this,o=i.getMeta(),s=e.custom||{},l=i.getDataset(),u=i.index,c=l.data[t],d=i._xScale,h=i._yScale,f=o.dataset._model,p=i._resolveDataElementOptions(e,t);r=d.getPixelForValue("object"==typeof c?c:NaN,t,u),a=n?h.getBasePixel():i.calculatePointY(c,t,u),e._xScale=d,e._yScale=h,e._options=p,e._datasetIndex=u,e._index=t,e._model={x:r,y:a,skip:s.skip||isNaN(r)||isNaN(a),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:Ie(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(e){var t,n,r,a,i=this,o=i._config,s=e.custom||{},l=i.chart.options,u=l.elements.line,c=ee.prototype._resolveDatasetElementOptions.apply(i,arguments);return c.spanGaps=Ie(o.spanGaps,l.spanGaps),c.tension=Ie(o.lineTension,u.tension),c.steppedLine=Ne([s.steppedLine,o.steppedLine,u.stepped]),c.clip=function(e){var t,n,r,a;return Y.isObject(e)?(t=e.top,n=e.right,r=e.bottom,a=e.left):t=n=r=a=e,{top:t,right:n,bottom:r,left:a}}(Ie(o.clip,(t=i._yScale,r=Fe(i._xScale,n=c.borderWidth/2),{top:(a=Fe(t,n)).end,right:r.end,bottom:a.start,left:r.start}))),c},calculatePointY:function(e,t,n){var r,a,i,o,s,l,u=this.chart,c=this._yScale,d=0,h=0;if(c.options.stacked){for(o=+c.getRightValue(e),l=(s=u._getSortedVisibleDatasetMetas()).length,r=0;r<l&&(a=s[r]).index!==n;++r)"line"===a.type&&a.yAxisID===c.id&&((i=+c.getRightValue(u.data.datasets[a.index].data[t]))<0?h+=i||0:d+=i||0);return c.getPixelForValue(o<0?h+o:d+o)}return c.getPixelForValue(e)},updateBezierControlPoints:function(){var e,t,n,r,a=this.chart,i=this.getMeta(),o=i.dataset._model,s=a.chartArea,l=i.data||[];function u(e,t,n){return Math.max(Math.min(e,n),t)}if(o.spanGaps&&(l=l.filter(function(e){return!e._model.skip})),"monotone"===o.cubicInterpolationMode)Y.splineCurveMonotone(l);else for(e=0,t=l.length;e<t;++e)n=l[e]._model,r=Y.splineCurve(Y.previousItem(l,e)._model,n,Y.nextItem(l,e)._model,o.tension),n.controlPointPreviousX=r.previous.x,n.controlPointPreviousY=r.previous.y,n.controlPointNextX=r.next.x,n.controlPointNextY=r.next.y;if(a.options.elements.line.capBezierPoints)for(e=0,t=l.length;e<t;++e)Ee(n=l[e]._model,s)&&(e>0&&Ee(l[e-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),e<l.length-1&&Ee(l[e+1]._model,s)&&(n.controlPointNextX=u(n.controlPointNextX,s.left,s.right),n.controlPointNextY=u(n.controlPointNextY,s.top,s.bottom)))},draw:function(){var e,t=this,n=t.chart,r=t.getMeta(),a=r.data||[],i=n.chartArea,o=n.canvas,s=0,l=a.length;for(t._showLine&&(Y.canvas.clipArea(n.ctx,{left:!1===(e=r.dataset._model.clip).left?0:i.left-e.left,right:!1===e.right?o.width:i.right+e.right,top:!1===e.top?0:i.top-e.top,bottom:!1===e.bottom?o.height:i.bottom+e.bottom}),r.dataset.draw(),Y.canvas.unclipArea(n.ctx));s<l;++s)a[s].draw(i)},setHoverStyle:function(e){var t=e._model,n=e._options,r=Y.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Ie(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=Ie(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=Ie(n.hoverBorderWidth,n.borderWidth),t.radius=Ie(n.hoverRadius,n.radius)}}),Le=Y.options.resolve;F._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(e){var t,n,r,a=document.createElement("ul"),i=e.data,o=i.datasets,s=i.labels;if(a.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(r=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&r.appendChild(document.createTextNode(s[t]));return a.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,r){var a=e.getDatasetMeta(0),i=a.controller.getStyle(r);return{text:n,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[r])||a.data[r].hidden,index:r}}):[]}},onClick:function(e,t){var n,r,a,i=t.index,o=this.chart;for(n=0,r=(o.data.datasets||[]).length;n<r;++n)(a=o.getDatasetMeta(n)).data[i].hidden=!a.data[i].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return t.labels[e.index]+": "+e.yLabel}}}});var We=ee.extend({dataElementType:ve.Arc,linkScales:Y.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,r,a=this,i=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],c=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),t=0,n=i.data.length;t<n;t++)l[t]=s,r=a._computeAngle(t),u[t]=r,s+=r;for(t=0,n=c.length;t<n;++t)c[t]._options=a._resolveDataElementOptions(c[t],t),a.updateElement(c[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,n=t.chartArea,r=t.options,a=Math.min(n.right-n.left,n.bottom-n.top);t.outerRadius=Math.max(a/2,0),t.innerRadius=Math.max(r.cutoutPercentage?t.outerRadius/100*r.cutoutPercentage:1,0),t.radiusLength=(t.outerRadius-t.innerRadius)/t.getVisibleDatasetCount(),e.outerRadius=t.outerRadius-t.radiusLength*e.index,e.innerRadius=e.outerRadius-t.radiusLength},updateElement:function(e,t,n){var r=this,a=r.chart,i=r.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,c=l.xCenter,d=l.yCenter,h=o.startAngle,f=e.hidden?0:l.getDistanceFromCenterForValue(i.data[t]),p=r._starts[t],g=p+(e.hidden?0:r._angles[t]),m=s.animateScale?0:l.getDistanceFromCenterForValue(i.data[t]),v=e._options||{};Y.extend(e,{_datasetIndex:r.index,_index:t,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:c,y:d,innerRadius:0,outerRadius:n?m:f,startAngle:n&&s.animateRotate?h:p,endAngle:n&&s.animateRotate?h:g,label:Y.valueAtIndexOrDefault(u,t,u[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),n=0;return Y.each(t.data,function(t,r){isNaN(e.data[r])||t.hidden||n++}),n},setHoverStyle:function(e){var t=e._model,n=e._options,r=Y.getHoverColor,a=Y.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=a(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=a(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(e){var t=this,n=this.getMeta().count,r=t.getDataset(),a=t.getMeta();return isNaN(r.data[e])||a.data[e].hidden?0:Le([t.chart.options.elements.arc.angle,2*Math.PI/n],{chart:t.chart,dataIndex:e,dataset:r,datasetIndex:t.index},e)}});F._set("pie",Y.clone(F.doughnut)),F._set("pie",{cutoutPercentage:0});var ze=Ae,Ye=Y.valueOrDefault;F._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Ve=ee.extend({datasetElementType:ve.Line,dataElementType:ve.Point,linkScales:Y.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,r=this,a=r.getMeta(),i=a.dataset,o=a.data||[],s=r.chart.scale,l=r._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),i._scale=s,i._datasetIndex=r.index,i._children=o,i._loop=!0,i._model=r._resolveDatasetElementOptions(i),i.pivot(),t=0,n=o.length;t<n;++t)r.updateElement(o[t],t,e);for(r.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var r=this,a=e.custom||{},i=r.getDataset(),o=r.chart.scale,s=o.getPointPositionForValue(t,i.data[t]),l=r._resolveDataElementOptions(e,t),u=r.getMeta().dataset._model,c=n?o.xCenter:s.x,d=n?o.yCenter:s.y;e._scale=o,e._options=l,e._datasetIndex=r.index,e._index=t,e._model={x:c,y:d,skip:a.skip||isNaN(c)||isNaN(d),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Ye(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,n=e.chart.options,r=ee.prototype._resolveDatasetElementOptions.apply(e,arguments);return r.spanGaps=Ye(t.spanGaps,n.spanGaps),r.tension=Ye(t.lineTension,n.elements.line.tension),r},updateBezierControlPoints:function(){var e,t,n,r,a=this.getMeta(),i=this.chart.chartArea,o=a.data||[];function s(e,t,n){return Math.max(Math.min(e,n),t)}for(a.dataset._model.spanGaps&&(o=o.filter(function(e){return!e._model.skip})),e=0,t=o.length;e<t;++e)n=o[e]._model,r=Y.splineCurve(Y.previousItem(o,e,!0)._model,n,Y.nextItem(o,e,!0)._model,n.tension),n.controlPointPreviousX=s(r.previous.x,i.left,i.right),n.controlPointPreviousY=s(r.previous.y,i.top,i.bottom),n.controlPointNextX=s(r.next.x,i.left,i.right),n.controlPointNextY=s(r.next.y,i.top,i.bottom)},setHoverStyle:function(e){var t=e._model,n=e._options,r=Y.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Ye(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=Ye(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=Ye(n.hoverBorderWidth,n.borderWidth),t.radius=Ye(n.hoverRadius,n.radius)}});F._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(e){return"("+e.xLabel+", "+e.yLabel+")"}}}}),F._set("global",{datasets:{scatter:{showLine:!1}}});var Be={bar:ke,bubble:Oe,doughnut:Ae,horizontalBar:Re,line:je,polarArea:We,pie:ze,radar:Ve,scatter:je};function He(e,t){return e.native?{x:e.x,y:e.y}:Y.getRelativePosition(e,t)}function Ue(e,t){var n,r,a,i,o,s,l=e._getSortedVisibleDatasetMetas();for(r=0,i=l.length;r<i;++r)for(a=0,o=(n=l[r].data).length;a<o;++a)(s=n[a])._view.skip||t(s)}function qe(e,t){var n=[];return Ue(e,function(e){e.inRange(t.x,t.y)&&n.push(e)}),n}function $e(e,t,n,r){var a=Number.POSITIVE_INFINITY,i=[];return Ue(e,function(e){if(!n||e.inRange(t.x,t.y)){var o=e.getCenterPoint(),s=r(t,o);s<a?(i=[e],a=s):s===a&&i.push(e)}}),i}function Ge(e){var t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){var a=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(i,2))}}function Qe(e,t,n){var r=He(t,e);n.axis=n.axis||"x";var a=Ge(n.axis),i=n.intersect?qe(e,r):$e(e,r,!1,a),o=[];return i.length?(e._getSortedVisibleDatasetMetas().forEach(function(e){var t=e.data[i[0]._index];t&&!t._view.skip&&o.push(t)}),o):[]}var Je={modes:{single:function(e,t){var n=He(t,e),r=[];return Ue(e,function(e){if(e.inRange(n.x,n.y))return r.push(e),r}),r.slice(0,1)},label:Qe,index:Qe,dataset:function(e,t,n){var r=He(t,e);n.axis=n.axis||"xy";var a=Ge(n.axis),i=n.intersect?qe(e,r):$e(e,r,!1,a);return i.length>0&&(i=e.getDatasetMeta(i[0]._datasetIndex).data),i},"x-axis":function(e,t){return Qe(e,t,{intersect:!1})},point:function(e,t){return qe(e,He(t,e))},nearest:function(e,t,n){var r=He(t,e);n.axis=n.axis||"xy";var a=Ge(n.axis);return $e(e,r,n.intersect,a)},x:function(e,t,n){var r=He(t,e),a=[],i=!1;return Ue(e,function(e){e.inXRange(r.x)&&a.push(e),e.inRange(r.x,r.y)&&(i=!0)}),n.intersect&&!i&&(a=[]),a},y:function(e,t,n){var r=He(t,e),a=[],i=!1;return Ue(e,function(e){e.inYRange(r.y)&&a.push(e),e.inRange(r.x,r.y)&&(i=!0)}),n.intersect&&!i&&(a=[]),a}}},Ke=Y.extend;function Ze(e,t){return Y.where(e,function(e){return e.pos===t})}function Xe(e,t){return e.sort(function(e,n){var r=t?n:e,a=t?e:n;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function et(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function tt(e,t,n){var r,a,i=n.box,o=e.maxPadding;if(n.size&&(e[n.pos]-=n.size),n.size=n.horizontal?i.height:i.width,e[n.pos]+=n.size,i.getPadding){var s=i.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(r=t.outerWidth-et(o,e,"left","right"),a=t.outerHeight-et(o,e,"top","bottom"),r!==e.w||a!==e.h){e.w=r,e.h=a;var l=n.horizontal?[r,e.w]:[a,e.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function nt(e,t){var n,r=t.maxPadding;return n={left:0,top:0,right:0,bottom:0},(e?["left","right"]:["top","bottom"]).forEach(function(e){n[e]=Math.max(t[e],r[e])}),n}function rt(e,t,n){var r,a,i,o,s,l,u=[];for(r=0,a=e.length;r<a;++r)(o=(i=e[r]).box).update(i.width||t.w,i.height||t.h,nt(i.horizontal,t)),tt(t,n,i)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(i);return s&&rt(u,t,n)||l}function at(e,t,n){var r,a,i,o,s=n.padding,l=t.x,u=t.y;for(r=0,a=e.length;r<a;++r)o=(i=e[r]).box,i.horizontal?(o.left=o.fullWidth?s.left:t.left,o.right=o.fullWidth?n.outerWidth-s.right:t.left+t.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=t.top,o.bottom=t.top+t.h,o.height=o.bottom-o.top,l=o.right);t.x=l,t.y=u}F._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var it={defaults:{},addBox:function(e,t){e.boxes||(e.boxes=[]),t.fullWidth=t.fullWidth||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(){t.draw.apply(t,arguments)}}]},e.boxes.push(t)},removeBox:function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure:function(e,t,n){for(var r,a=["fullWidth","position","weight"],i=a.length,o=0;o<i;++o)n.hasOwnProperty(r=a[o])&&(t[r]=n[r])},update:function(e,t,n){if(e){var r=Y.options.toPadding((e.options.layout||{}).padding),a=t-r.width,i=n-r.height,o=function(e){var t=function(e){var t,n,r,a=[];for(t=0,n=(e||[]).length;t<n;++t)a.push({index:t,box:r=e[t],pos:r.position,horizontal:r.isHorizontal(),weight:r.weight});return a}(e),n=Xe(Ze(t,"left"),!0),r=Xe(Ze(t,"right")),a=Xe(Ze(t,"top"),!0),i=Xe(Ze(t,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:r.concat(i),chartArea:Ze(t,"chartArea"),vertical:n.concat(r),horizontal:a.concat(i)}}(e.boxes),s=o.vertical,l=o.horizontal,u=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:a,vBoxMaxWidth:a/2/s.length,hBoxMaxHeight:i/2}),c=Ke({maxPadding:Ke({},r),w:a,h:i,x:r.left,y:r.top},r);(function(e,t){var n,r,a;for(n=0,r=e.length;n<r;++n)(a=e[n]).width=a.horizontal?a.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,a.height=a.horizontal&&t.hBoxMaxHeight})(s.concat(l),u),rt(s,c,u),rt(l,c,u)&&rt(s,c,u),function(e){var t=e.maxPadding;function n(n){var r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(c),at(o.leftAndTop,c,u),c.x+=c.w,c.y+=c.h,at(o.rightAndBottom,c,u),e.chartArea={left:c.left,top:c.top,right:c.left+c.w,bottom:c.top+c.h},Y.each(o.chartArea,function(t){var n=t.box;Ke(n,e.chartArea),n.update(c.w,c.h)})}}},ot=function(e){return e&&e.default||e}(/*#__PURE__*/Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"})),st="$chartjs",lt="chartjs-",ut=lt+"size-monitor",ct=lt+"render-monitor",dt=lt+"render-animation",ht=["animationstart","webkitAnimationStart"],ft={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function pt(e,t){var n=Y.getStyle(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?Number(r[1]):void 0}var gt=!!function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(e){}return e}()&&{passive:!0};function mt(e,t,n){e.addEventListener(t,n,gt)}function vt(e,t,n){e.removeEventListener(t,n,gt)}function yt(e,t,n,r,a){return{type:e,chart:t,native:a||null,x:void 0!==n?n:null,y:void 0!==r?r:null}}function bt(e){var t=document.createElement("div");return t.className=e||"",t}var xt={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(e){if(!this.disableCSSInjection){var t=e.getRootNode?e.getRootNode():document;!function(e,t){var n=e[st]||(e[st]={});if(!n.containsStyles){n.containsStyles=!0,t="/* Chart.js */\n"+t;var r=document.createElement("style");r.setAttribute("type","text/css"),r.appendChild(document.createTextNode(t)),e.appendChild(r)}}(t.host?t:document.head,ot)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(this._ensureLoaded(e),function(e,t){var n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e[st]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var i=pt(e,"width");void 0!==i&&(e.width=i)}if(null===r||""===r)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var o=pt(e,"height");void 0!==i&&(e.height=o)}}(e,t),n):null},releaseContext:function(e){var t=e.canvas;if(t[st]){var n=t[st].initial;["height","width"].forEach(function(e){var r=n[e];Y.isNullOrUndef(r)?t.removeAttribute(e):t.setAttribute(e,r)}),Y.each(n.style||{},function(e,n){t.style[n]=e}),t.width=t.width,delete t[st]}},addEventListener:function(e,t,n){var r=e.canvas;if("resize"!==t){var a=n[st]||(n[st]={});mt(r,t,(a.proxies||(a.proxies={}))[e.id+"_"+t]=function(t){n(function(e,t){var n=ft[e.type]||e.type,r=Y.getRelativePosition(e,t);return yt(n,t,r.x,r.y,e)}(t,e))})}else!function(e,t,n){var r,a,i,o,s=e[st]||(e[st]={}),l=s.resizer=function(e){var t=1e6,n=bt(ut),r=bt(ut+"-expand"),a=bt(ut+"-shrink");r.appendChild(bt()),a.appendChild(bt()),n.appendChild(r),n.appendChild(a),n._reset=function(){r.scrollLeft=t,r.scrollTop=t,a.scrollLeft=t,a.scrollTop=t};var i=function(){n._reset(),e()};return mt(r,"scroll",i.bind(r,"expand")),mt(a,"scroll",i.bind(a,"shrink")),n}((r=function(){if(s.resizer){var r=n.options.maintainAspectRatio&&e.parentNode,a=r?r.clientWidth:0;t(yt("resize",n)),r&&r.clientWidth<a&&n.canvas&&t(yt("resize",n))}},i=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,i||(i=!0,Y.requestAnimFrame.call(window,function(){i=!1,r.apply(a,o)}))}));!function(e,t){var n=e[st]||(e[st]={}),r=n.renderProxy=function(e){e.animationName===dt&&t()};Y.each(ht,function(t){mt(e,t,r)}),n.reflow=!!e.offsetParent,e.classList.add(ct)}(e,function(){if(s.resizer){var t=e.parentNode;t&&t!==l.parentNode&&t.insertBefore(l,t.firstChild),l._reset()}})}(r,n,e)},removeEventListener:function(e,t,n){var r,a,i,o=e.canvas;if("resize"!==t){var s=((n[st]||{}).proxies||{})[e.id+"_"+t];s&&vt(o,t,s)}else i=(a=(r=o)[st]||{}).resizer,delete a.resizer,function(e){var t=e[st]||{},n=t.renderProxy;n&&(Y.each(ht,function(t){vt(e,t,n)}),delete t.renderProxy),e.classList.remove(ct)}(r),i&&i.parentNode&&i.parentNode.removeChild(i)}};Y.addEvent=mt,Y.removeEvent=vt;var _t=Y.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},xt._enabled?xt:{acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}});F._set("global",{plugins:{}});var wt={_plugins:[],_cacheId:0,register:function(e){var t=this._plugins;[].concat(e).forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),this._cacheId++},unregister:function(e){var t=this._plugins;[].concat(e).forEach(function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,n){var r,a,i,o,s,l=this.descriptors(e),u=l.length;for(r=0;r<u;++r)if("function"==typeof(s=(i=(a=l[r]).plugin)[t])&&((o=[e].concat(n||[])).push(a.options),!1===s.apply(i,o)))return!1;return!0},descriptors:function(e){var t=e.$plugins||(e.$plugins={});if(t.id===this._cacheId)return t.descriptors;var n=[],r=[],a=e&&e.config||{},i=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(e){if(-1===n.indexOf(e)){var t=e.id,a=i[t];!1!==a&&(!0===a&&(a=Y.clone(F.global.plugins[t])),n.push(e),r.push({plugin:e,options:a||{}}))}}),t.descriptors=r,t.id=this._cacheId,r},_invalidate:function(e){delete e.$plugins}},kt={constructors:{},defaults:{},registerScaleType:function(e,t,n){this.constructors[e]=t,this.defaults[e]=Y.clone(n)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?Y.merge(Object.create(null),[F.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){var n=this;n.defaults.hasOwnProperty(e)&&(n.defaults[e]=Y.extend(n.defaults[e],t))},addScalesToLayout:function(e){Y.each(e.scales,function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,it.addBox(e,t)})}},St=Y.valueOrDefault,Mt=Y.rtl.getRtlAdapter;F._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:Y.noop,title:function(e,t){var n="",r=t.labels,a=r?r.length:0;if(e.length>0){var i=e[0];i.label?n=i.label:i.xLabel?n=i.xLabel:a>0&&i.index<a&&(n=r[i.index])}return n},afterTitle:Y.noop,beforeBody:Y.noop,beforeLabel:Y.noop,label:function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),Y.isNullOrUndef(e.value)?n+=e.yLabel:n+=e.value,n},labelColor:function(e,t){var n=t.getDatasetMeta(e.datasetIndex).data[e.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:Y.noop,afterBody:Y.noop,beforeFooter:Y.noop,footer:Y.noop,afterFooter:Y.noop}}});var Ot={average:function(e){if(!e.length)return!1;var t,n,r=0,a=0,i=0;for(t=0,n=e.length;t<n;++t){var o=e[t];if(o&&o.hasValue()){var s=o.tooltipPosition();r+=s.x,a+=s.y,++i}}return{x:r/i,y:a/i}},nearest:function(e,t){var n,r,a,i=t.x,o=t.y,s=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){var l=e[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),c=Y.distanceBetweenPoints(t,u);c<s&&(s=c,a=l)}}if(a){var d=a.tooltipPosition();i=d.x,o=d.y}return{x:i,y:o}}};function Dt(e,t){return t&&(Y.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Pt(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Ct(e){var t=F.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:St(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:St(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:St(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:St(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:St(e.titleFontStyle,t.defaultFontStyle),titleFontSize:St(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:St(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:St(e.footerFontStyle,t.defaultFontStyle),footerFontSize:St(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Tt(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function At(e){return Dt([],Pt(e))}var Rt=q.extend({initialize:function(){this._model=Ct(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,n=t.beforeTitle.apply(e,arguments),r=t.title.apply(e,arguments),a=t.afterTitle.apply(e,arguments),i=[];return i=Dt(i,Pt(n)),i=Dt(i,Pt(r)),Dt(i,Pt(a))},getBeforeBody:function(){return At(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,r=n._options.callbacks,a=[];return Y.each(e,function(e){var i={before:[],lines:[],after:[]};Dt(i.before,Pt(r.beforeLabel.call(n,e,t))),Dt(i.lines,r.label.call(n,e,t)),Dt(i.after,Pt(r.afterLabel.call(n,e,t))),a.push(i)}),a},getAfterBody:function(){return At(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),r=t.footer.apply(e,arguments),a=t.afterFooter.apply(e,arguments),i=[];return i=Dt(i,Pt(n)),i=Dt(i,Pt(r)),Dt(i,Pt(a))},update:function(e){var t,n,r,a,i,o,s,l,u,c,d=this,h=d._options,f=d._model,p=d._model=Ct(h),g=d._active,m=d._data,v={xAlign:f.xAlign,yAlign:f.yAlign},y={x:f.x,y:f.y},b={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(g.length){p.opacity=1;var _=[],w=[];x=Ot[h.position].call(d,g,d._eventPosition);var k=[];for(t=0,n=g.length;t<n;++t)k.push((a=void 0,i=void 0,l=void 0,u=void 0,c=void 0,a=(r=g[t])._xScale,i=r._yScale||r._scale,o=r._index,u=(l=r._chart.getDatasetMeta(s=r._datasetIndex).controller)._getIndexScale(),c=l._getValueScale(),{xLabel:a?a.getLabelForIndex(o,s):"",yLabel:i?i.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:c?""+c.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:r._model.x,y:r._model.y}));h.filter&&(k=k.filter(function(e){return h.filter(e,m)})),h.itemSort&&(k=k.sort(function(e,t){return h.itemSort(e,t,m)})),Y.each(k,function(e){_.push(h.callbacks.labelColor.call(d,e,d._chart)),w.push(h.callbacks.labelTextColor.call(d,e,d._chart))}),p.title=d.getTitle(k,m),p.beforeBody=d.getBeforeBody(k,m),p.body=d.getBody(k,m),p.afterBody=d.getAfterBody(k,m),p.footer=d.getFooter(k,m),p.x=x.x,p.y=x.y,p.caretPadding=h.caretPadding,p.labelColors=_,p.labelTextColors=w,p.dataPoints=k,y=function(e,t,n,r){var a=e.x,i=e.y,o=e.caretPadding,s=n.xAlign,l=n.yAlign,u=e.caretSize+o,c=e.cornerRadius+o;return"right"===s?a-=t.width:"center"===s&&((a-=t.width/2)+t.width>r.width&&(a=r.width-t.width),a<0&&(a=0)),"top"===l?i+=u:i-="bottom"===l?t.height+u:t.height/2,"center"===l?"left"===s?a+=u:"right"===s&&(a-=u):"left"===s?a-=c:"right"===s&&(a+=c),{x:a,y:i}}(p,b=function(e,t){var n=e._chart.ctx,r=2*t.yPadding,a=0,i=t.body,o=i.reduce(function(e,t){return e+t.before.length+t.lines.length+t.after.length},0),s=t.title.length,l=t.footer.length,u=t.titleFontSize,c=t.bodyFontSize,d=t.footerFontSize;r+=s*u,r+=s?(s-1)*t.titleSpacing:0,r+=s?t.titleMarginBottom:0,r+=(o+=t.beforeBody.length+t.afterBody.length)*c,r+=o?(o-1)*t.bodySpacing:0,r+=l?t.footerMarginTop:0,r+=l*d,r+=l?(l-1)*t.footerSpacing:0;var h=0,f=function(e){a=Math.max(a,n.measureText(e).width+h)};return n.font=Y.fontString(u,t._titleFontStyle,t._titleFontFamily),Y.each(t.title,f),n.font=Y.fontString(c,t._bodyFontStyle,t._bodyFontFamily),Y.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?c+2:0,Y.each(i,function(e){Y.each(e.before,f),Y.each(e.lines,f),Y.each(e.after,f)}),h=0,n.font=Y.fontString(d,t._footerFontStyle,t._footerFontFamily),Y.each(t.footer,f),{width:a+=2*t.xPadding,height:r}}(this,p),v=function(e,t){var n,r,a,i,o,s=e._model,l=e._chart,u=e._chart.chartArea,c="center",d="center";s.y<t.height?d="top":s.y>l.height-t.height&&(d="bottom");var h=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===d?(n=function(e){return e<=h},r=function(e){return e>h}):(n=function(e){return e<=t.width/2},r=function(e){return e>=l.width-t.width/2}),a=function(e){return e+t.width+s.caretSize+s.caretPadding>l.width},i=function(e){return e-t.width-s.caretSize-s.caretPadding<0},o=function(e){return e<=f?"top":"bottom"},n(s.x)?(c="left",a(s.x)&&(c="center",d=o(s.y))):r(s.x)&&(c="right",i(s.x)&&(c="center",d=o(s.y)));var p=e._options;return{xAlign:p.xAlign?p.xAlign:c,yAlign:p.yAlign?p.yAlign:d}}(this,b),d._chart)}else p.opacity=0;return p.xAlign=v.xAlign,p.yAlign=v.yAlign,p.x=y.x,p.y=y.y,p.width=b.width,p.height=b.height,p.caretX=x.x,p.caretY=x.y,d._model=p,e&&h.custom&&h.custom.call(d,p),d},drawCaret:function(e,t){var n=this._chart.ctx,r=this.getCaretPosition(e,t,this._view);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)},getCaretPosition:function(e,t,n){var r,a,i,o,s,l,u=n.caretSize,c=n.cornerRadius,d=n.xAlign,h=n.yAlign,f=e.x,p=e.y,g=t.width,m=t.height;if("center"===h)s=p+m/2,"left"===d?(a=(r=f)-u,i=r,o=s+u,l=s-u):(a=(r=f+g)+u,i=r,o=s-u,l=s+u);else if("left"===d?(r=(a=f+c+u)-u,i=a+u):"right"===d?(r=(a=f+g-c-u)-u,i=a+u):(r=(a=n.caretX)-u,i=a+u),"top"===h)s=(o=p)-u,l=o;else{s=(o=p+m)+u,l=o;var v=i;i=r,r=v}return{x1:r,x2:a,x3:i,y1:o,y2:s,y3:l}},drawTitle:function(e,t,n){var r,a,i,o=t.title,s=o.length;if(s){var l=Mt(t.rtl,t.x,t.width);for(e.x=Tt(t,t._titleAlign),n.textAlign=l.textAlign(t._titleAlign),n.textBaseline="middle",r=t.titleFontSize,a=t.titleSpacing,n.fillStyle=t.titleFontColor,n.font=Y.fontString(r,t._titleFontStyle,t._titleFontFamily),i=0;i<s;++i)n.fillText(o[i],l.x(e.x),e.y+r/2),e.y+=r+a,i+1===s&&(e.y+=t.titleMarginBottom-a)}},drawBody:function(e,t,n){var r,a,i,o,s,l,u,c,d=t.bodyFontSize,h=t.bodySpacing,f=t._bodyAlign,p=t.body,g=t.displayColors,m=0,v=g?Tt(t,"left"):0,y=Mt(t.rtl,t.x,t.width),b=function(t){n.fillText(t,y.x(e.x+m),e.y+d/2),e.y+=d+h},x=y.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=Y.fontString(d,t._bodyFontStyle,t._bodyFontFamily),e.x=Tt(t,x),n.fillStyle=t.bodyFontColor,Y.each(t.beforeBody,b),m=g&&"right"!==x?"center"===f?d/2+1:d+2:0,s=0,u=p.length;s<u;++s){for(r=p[s],i=t.labelColors[s],n.fillStyle=a=t.labelTextColors[s],Y.each(r.before,b),l=0,c=(o=r.lines).length;l<c;++l){if(g){var _=y.x(v);n.fillStyle=t.legendColorBackground,n.fillRect(y.leftForLtr(_,d),e.y,d,d),n.lineWidth=1,n.strokeStyle=i.borderColor,n.strokeRect(y.leftForLtr(_,d),e.y,d,d),n.fillStyle=i.backgroundColor,n.fillRect(y.leftForLtr(y.xPlus(_,1),d-2),e.y+1,d-2,d-2),n.fillStyle=a}b(o[l])}Y.each(r.after,b)}m=0,Y.each(t.afterBody,b),e.y-=h},drawFooter:function(e,t,n){var r,a,i=t.footer,o=i.length;if(o){var s=Mt(t.rtl,t.x,t.width);for(e.x=Tt(t,t._footerAlign),e.y+=t.footerMarginTop,n.textAlign=s.textAlign(t._footerAlign),n.textBaseline="middle",r=t.footerFontSize,n.fillStyle=t.footerFontColor,n.font=Y.fontString(r,t._footerFontStyle,t._footerFontFamily),a=0;a<o;++a)n.fillText(i[a],s.x(e.x),e.y+r/2),e.y+=r+t.footerSpacing}},drawBackground:function(e,t,n,r){n.fillStyle=t.backgroundColor,n.strokeStyle=t.borderColor,n.lineWidth=t.borderWidth;var a=t.xAlign,i=t.yAlign,o=e.x,s=e.y,l=r.width,u=r.height,c=t.cornerRadius;n.beginPath(),n.moveTo(o+c,s),"top"===i&&this.drawCaret(e,r),n.lineTo(o+l-c,s),n.quadraticCurveTo(o+l,s,o+l,s+c),"center"===i&&"right"===a&&this.drawCaret(e,r),n.lineTo(o+l,s+u-c),n.quadraticCurveTo(o+l,s+u,o+l-c,s+u),"bottom"===i&&this.drawCaret(e,r),n.lineTo(o+c,s+u),n.quadraticCurveTo(o,s+u,o,s+u-c),"center"===i&&"left"===a&&this.drawCaret(e,r),n.lineTo(o,s+c),n.quadraticCurveTo(o,s,o+c,s),n.closePath(),n.fill(),t.borderWidth>0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},r={x:t.x,y:t.y},a=Math.abs(t.opacity<.001)?0:t.opacity;this._options.enabled&&(t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length)&&(e.save(),e.globalAlpha=a,this.drawBackground(r,t,e,n),r.y+=t.yPadding,Y.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Y.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,n=this,r=n._options;return n._lastActive=n._lastActive||[],"mouseout"===e.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(e,r.mode,r),r.reverse&&n._active.reverse()),(t=!Y.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(r.enabled||r.custom)&&(n._eventPosition={x:e.x,y:e.y},n.update(!0),n.pivot())),t}}),It=Rt;It.positioners=Ot;var Nt=Y.valueOrDefault;function Et(){return Y.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){if("xAxes"===e||"yAxes"===e){var a,i,o,s=n[e].length;for(t[e]||(t[e]=[]),a=0;a<s;++a)i=Nt((o=n[e][a]).type,"xAxes"===e?"category":"linear"),a>=t[e].length&&t[e].push({}),Y.merge(t[e][a],!t[e][a].type||o.type&&o.type!==t[e][a].type?[kt.getScaleDefaults(i),o]:o)}else Y._merger(e,t,n,r)}})}function Ft(){return Y.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){var a=t[e]||Object.create(null),i=n[e];"scales"===e?t[e]=Et(a,i):"scale"===e?t[e]=Y.merge(a,[kt.getScaleDefaults(i.type),i]):Y._merger(e,t,n,r)}})}function jt(e,t,n){var r,a=function(e){return e.id===r};do{r=t+n++}while(Y.findIndex(e,a)>=0);return r}function Lt(e){return"top"===e||"bottom"===e}function Wt(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}F._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var zt=function(e,t){return this.construct(e,t),this};Y.extend(zt.prototype,{construct:function(e,t){var n=this;t=function(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=Ft(F.global,F[e.type],e.options||{}),e}(t);var r=_t.acquireContext(e,t),a=r&&r.canvas,i=a&&a.height,o=a&&a.width;n.id=Y.uid(),n.ctx=r,n.canvas=a,n.config=t,n.width=o,n.height=i,n.aspectRatio=i?o/i:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,zt.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),r&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return wt.notify(e,"beforeInit"),Y.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),wt.notify(e,"afterInit"),e},clear:function(){return Y.canvas.clear(this),this},stop:function(){return Q.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,r=t.canvas,a=n.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(Y.getMaximumWidth(r))),o=Math.max(0,Math.floor(a?i/a:Y.getMaximumHeight(r)));if((t.width!==i||t.height!==o)&&(r.width=t.width=i,r.height=t.height=o,r.style.width=i+"px",r.style.height=o+"px",Y.retinaScale(t,n.devicePixelRatio),!e)){var s={width:i,height:o};wt.notify(t,"resize",[s]),n.onResize&&n.onResize(t,s),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;Y.each(t.xAxes,function(e,n){e.id||(e.id=jt(t.xAxes,"x-axis-",n))}),Y.each(t.yAxes,function(e,n){e.id||(e.id=jt(t.yAxes,"y-axis-",n))}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},r=[],a=Object.keys(n).reduce(function(e,t){return e[t]=!1,e},{});t.scales&&(r=r.concat((t.scales.xAxes||[]).map(function(e){return{options:e,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(e){return{options:e,dtype:"linear",dposition:"left"}}))),t.scale&&r.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),Y.each(r,function(t){var r=t.options,i=r.id,o=Nt(r.type,t.dtype);Lt(r.position)!==Lt(t.dposition)&&(r.position=t.dposition),a[i]=!0;var s=null;if(i in n&&n[i].type===o)(s=n[i]).options=r,s.ctx=e.ctx,s.chart=e;else{var l=kt.getScaleConstructor(o);if(!l)return;s=new l({id:i,type:o,options:r,ctx:e.ctx,chart:e}),n[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)}),Y.each(a,function(e,t){e||delete n[t]}),e.scales=n,kt.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,r=[],a=n.data.datasets;for(e=0,t=a.length;e<t;e++){var i=a[e],o=n.getDatasetMeta(e),s=i.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(e),o=n.getDatasetMeta(e)),o.type=s,o.order=i.order||0,o.index=e,o.controller)o.controller.updateIndex(e),o.controller.linkScales();else{var l=Be[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,e),r.push(o.controller)}}return r},resetElements:function(){var e=this;Y.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.reset()},e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,n,r,a,i=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),a=(r=i).options,Y.each(r.scales,function(e){it.removeBox(r,e)}),a=Ft(F.global,F[r.config.type],a),r.options=r.config.options=a,r.ensureScalesHaveIDs(),r.buildOrUpdateScales(),r.tooltip._options=a.tooltips,r.tooltip.initialize(),wt._invalidate(i),!1!==wt.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var o=i.buildOrUpdateControllers();for(t=0,n=i.data.datasets.length;t<n;t++)i.getDatasetMeta(t).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&Y.each(o,function(e){e.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],wt.notify(i,"afterUpdate"),i._layers.sort(Wt("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:i.render(e)}},updateLayout:function(){var e=this;!1!==wt.notify(e,"beforeLayout")&&(it.update(this,this.width,this.height),e._layers=[],Y.each(e.boxes,function(t){t._configure&&t._configure(),e._layers.push.apply(e._layers,t._layers())},e),e._layers.forEach(function(e,t){e._idx=t}),wt.notify(e,"afterScaleUpdate"),wt.notify(e,"afterLayout"))},updateDatasets:function(){var e=this;if(!1!==wt.notify(e,"beforeDatasetsUpdate")){for(var t=0,n=e.data.datasets.length;t<n;++t)e.updateDataset(t);wt.notify(e,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this,n=t.getDatasetMeta(e),r={meta:n,index:e};!1!==wt.notify(t,"beforeDatasetUpdate",[r])&&(n.controller._update(),wt.notify(t,"afterDatasetUpdate",[r]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=t.options.animation,r=Nt(e.duration,n&&n.duration),a=e.lazy;if(!1!==wt.notify(t,"beforeRender")){var i=function(e){wt.notify(t,"afterRender"),Y.callback(n&&n.onComplete,[e],t)};if(n&&r){var o=new G({numSteps:r/16.66,easing:e.easing||n.easing,render:function(e,t){var n=t.currentStep,r=n/t.numSteps;e.draw((0,Y.easing.effects[t.easing])(r),r,n)},onAnimationProgress:n.onProgress,onAnimationComplete:i});Q.addAnimation(t,o,r,a)}else t.draw(),i(new G({numSteps:0,chart:t}));return t}},draw:function(e){var t,n,r=this;if(r.clear(),Y.isNullOrUndef(e)&&(e=1),r.transition(e),!(r.width<=0||r.height<=0)&&!1!==wt.notify(r,"beforeDraw",[e])){for(n=r._layers,t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(r.chartArea);for(r.drawDatasets(e);t<n.length;++t)n[t].draw(r.chartArea);r._drawTooltip(e),wt.notify(r,"afterDraw",[e])}},transition:function(e){for(var t=this,n=0,r=(t.data.datasets||[]).length;n<r;++n)t.isDatasetVisible(n)&&t.getDatasetMeta(n).controller.transition(e);t.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,n,r=this,a=[];for(t=0,n=(r.data.datasets||[]).length;t<n;++t)e&&!r.isDatasetVisible(t)||a.push(r.getDatasetMeta(t));return a.sort(Wt("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,n,r=this;if(!1!==wt.notify(r,"beforeDatasetsDraw",[e])){for(n=(t=r._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)r.drawDataset(t[n],e);wt.notify(r,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n={meta:e,index:e.index,easingValue:t};!1!==wt.notify(this,"beforeDatasetDraw",[n])&&(e.controller.draw(t),wt.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(e){var t=this,n=t.tooltip,r={tooltip:n,easingValue:e};!1!==wt.notify(t,"beforeTooltipDraw",[r])&&(n.draw(),wt.notify(t,"afterTooltipDraw",[r]))},getElementAtEvent:function(e){return Je.modes.single(this,e)},getElementsAtEvent:function(e){return Je.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Je.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var r=Je.modes[t];return"function"==typeof r?r(this,e,n):[]},getDatasetAtEvent:function(e){return Je.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var r=n._meta[t.id];return r||(r=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),r},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t<n;++t)this.isDatasetVisible(t)&&e++;return e},isDatasetVisible:function(e){var t=this.getDatasetMeta(e);return"boolean"==typeof t.hidden?!t.hidden:!this.data.datasets[e].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(e){var t=this.id,n=this.data.datasets[e],r=n._meta&&n._meta[t];r&&(r.controller.destroy(),delete n._meta[t])},destroy:function(){var e,t,n=this,r=n.canvas;for(n.stop(),e=0,t=n.data.datasets.length;e<t;++e)n.destroyDatasetMeta(e);r&&(n.unbindEvents(),Y.canvas.clear(n),_t.releaseContext(n.ctx),n.canvas=null,n.ctx=null),wt.notify(n,"destroy"),delete zt.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new It({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var e=this,t=e._listeners={},n=function(){e.eventHandler.apply(e,arguments)};Y.each(e.options.events,function(r){_t.addEventListener(e,r,n),t[r]=n}),e.options.responsive&&(n=function(){e.resize()},_t.addEventListener(e,"resize",n),t.resize=n)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,Y.each(t,function(t,n){_t.removeEventListener(e,n,t)}))},updateHoverStyle:function(e,t,n){var r,a,i,o=n?"set":"remove";for(a=0,i=e.length;a<i;++a)(r=e[a])&&this.getDatasetMeta(r._datasetIndex).controller[o+"HoverStyle"](r);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,n=t.tooltip;if(!1!==wt.notify(t,"beforeEvent",[e])){t._bufferedRender=!0,t._bufferedRequest=null;var r=t.handleEvent(e);n&&(r=n._start?n.handleEvent(e):r|n.handleEvent(e)),wt.notify(t,"afterEvent",[e]);var a=t._bufferedRequest;return a?t.render(a):r&&!t.animating&&(t.stop(),t.render({duration:t.options.hover.animationDuration,lazy:!0})),t._bufferedRender=!1,t._bufferedRequest=null,t}},handleEvent:function(e){var t,n=this,r=n.options||{},a=r.hover;return n.lastActive=n.lastActive||[],n.active="mouseout"===e.type?[]:n.getElementsAtEventForMode(e,a.mode,a),Y.callback(r.onHover||r.hover.onHover,[e.native,n.active],n),"mouseup"!==e.type&&"click"!==e.type||r.onClick&&r.onClick.call(n,e.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),t=!Y.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,t}}),zt.instances={};var Yt=zt;function Vt(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Bt(e){this.options=e||{}}zt.Controller=zt,zt.types={},Y.configMerge=Ft,Y.scaleMerge=Et,Y.extend(Bt.prototype,{formats:Vt,parse:Vt,format:Vt,add:Vt,diff:Vt,startOf:Vt,endOf:Vt,_create:function(e){return e}}),Bt.override=function(e){Y.extend(Bt.prototype,e)};var Ht={_date:Bt},Ut={formatters:{values:function(e){return Y.isArray(e)?e:""+e},linear:function(e,t,n){var r=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(r)>1&&e!==Math.floor(e)&&(r=e-Math.floor(e));var a=Y.log10(Math.abs(r)),i="";if(0!==e)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=Y.log10(Math.abs(e)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),i=e.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),i=e.toFixed(l)}else i="0";return i},logarithmic:function(e,t,n){var r=e/Math.pow(10,Math.floor(Y.log10(e)));return 0===e?"0":1===r||2===r||5===r||0===t||t===n.length-1?e.toExponential():""}}},qt=Y.isArray,$t=Y.isNullOrUndef,Gt=Y.valueOrDefault,Qt=Y.valueAtIndexOrDefault;function Jt(e,t,n){var r,a=e.getTicks().length,i=Math.min(t,a-1),o=e.getPixelForTick(i),s=e._startPixel,l=e._endPixel,u=1e-6;if(!(n&&(r=1===a?Math.max(o-s,l-o):0===t?(e.getPixelForTick(1)-o)/2:(o-e.getPixelForTick(i-1))/2,(o+=i<t?r:-r)<s-u||o>l+u)))return o}function Kt(e){return e.drawTicks?e.tickMarkLength:0}function Zt(e){var t,n;return e.display?(t=Y.options._parseFont(e),n=Y.options.toPadding(e.padding),t.lineHeight+n.height):0}function Xt(e,t){return Y.extend(Y.options._parseFont({fontFamily:Gt(t.fontFamily,e.fontFamily),fontSize:Gt(t.fontSize,e.fontSize),fontStyle:Gt(t.fontStyle,e.fontStyle),lineHeight:Gt(t.lineHeight,e.lineHeight)}),{color:Y.options.resolve([t.fontColor,e.fontColor,F.global.defaultFontColor])})}function en(e){var t=Xt(e,e.minor);return{minor:t,major:e.major.enabled?Xt(e,e.major):t}}function tn(e){var t,n,r,a=[];for(n=0,r=e.length;n<r;++n)void 0!==(t=e[n])._index&&a.push(t);return a}function nn(e,t,n,r){var a,i,o,s,l=Gt(n,0),u=Math.min(Gt(r,e.length),e.length),c=0;for(t=Math.ceil(t),r&&(t=(a=r-n)/Math.floor(a/t)),s=l;s<0;)c++,s=Math.round(l+c*t);for(i=Math.max(l,0);i<u;i++)o=e[i],i===s?(o._index=i,c++,s=Math.round(l+c*t)):delete o.label}F._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Ut.formatters.values,minor:{},major:{}}});var rn=q.extend({zeroLineIndex:0,getPadding:function(){var e=this;return{left:e.paddingLeft||0,top:e.paddingTop||0,right:e.paddingRight||0,bottom:e.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){Y.callback(this.options.beforeUpdate,[this])},update:function(e,t,n){var r,a,i,o,s,l=this,u=l.options.ticks,c=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=e,l.maxHeight=t,l.margins=Y.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],r=0,a=l.ticks.length;r<a;++r)o.push({value:l.ticks[r],major:!1});return l._ticks=o,i=l._convertTicksToLabels((s=c<o.length)?function(e,t){for(var n=[],r=e.length/t,a=0,i=e.length;a<i;a+=r)n.push(e[Math.floor(a)]);return n}(o,c):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(i=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=i,l.afterUpdate(),l.minSize},_configure:function(){var e,t,n=this,r=n.options.ticks.reverse;n.isHorizontal()?(e=n.left,t=n.right):(e=n.top,t=n.bottom,r=!r),n._startPixel=e,n._endPixel=t,n._reversePixels=r,n._length=t-e},afterUpdate:function(){Y.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){Y.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0},afterSetDimensions:function(){Y.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){Y.callback(this.options.beforeDataLimits,[this])},determineDataLimits:Y.noop,afterDataLimits:function(){Y.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){Y.callback(this.options.beforeBuildTicks,[this])},buildTicks:Y.noop,afterBuildTicks:function(e){var t=this;return qt(e)&&e.length?Y.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=Y.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){Y.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var e=this,t=e.options.ticks;e.ticks=e.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){Y.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){Y.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,n,r,a,i,o,s=this,l=s.options,u=l.ticks,c=s.getTicks().length,d=u.minRotation||0,h=u.maxRotation,f=d;!s._isVisible()||!u.display||d>=h||c<=1||!s.isHorizontal()?s.labelRotation=d:(t=(e=s._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,r=Math.min(s.maxWidth,s.chart.width-t),t+6>(a=l.offset?s.maxWidth/c:r/(c-1))&&(a=r/(c-(l.offset?.5:1)),i=s.maxHeight-Kt(l.gridLines)-u.padding-Zt(l.scaleLabel),o=Math.sqrt(t*t+n*n),f=Y.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/a,1)),Math.asin(Math.min(i/o,1))-Math.asin(n/o))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){Y.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){Y.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,r=e.options,a=r.ticks,i=r.scaleLabel,o=r.gridLines,s=e._isVisible(),l="bottom"===r.position,u=e.isHorizontal();if(u?t.width=e.maxWidth:s&&(t.width=Kt(o)+Zt(i)),u?s&&(t.height=Kt(o)+Zt(i)):t.height=e.maxHeight,a.display&&s){var c=en(a),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,m=.4*c.minor.lineHeight,v=a.padding;if(u){var y=0!==e.labelRotation,b=Y.toRadians(e.labelRotation),x=Math.cos(b),_=Math.sin(b);t.height=Math.min(e.maxHeight,t.height+(_*p.width+x*(g.height-(y?g.offset:0))+(y?0:m))+v);var w,k,S=e.getPixelForTick(0)-e.left,M=e.right-e.getPixelForTick(e.getTicks().length-1);y?(w=l?x*h.width+_*h.offset:_*(h.height-h.offset),k=l?_*(f.height-f.offset):x*f.width+_*f.offset):(w=h.width/2,k=f.width/2),e.paddingLeft=Math.max((w-S)*e.width/(e.width-S),0)+3,e.paddingRight=Math.max((k-M)*e.width/(e.width-M),0)+3}else t.width=Math.min(e.maxWidth,t.width+(a.mirror?0:p.width+v+m)),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}e.handleMargins(),u?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){Y.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if($t(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,r,a=this;for(a.ticks=e.map(function(e){return e.value}),a.beforeTickToLabelConversion(),t=a.convertTicksToLabels(e)||a.ticks,a.afterTickToLabelConversion(),n=0,r=e.length;n<r;++n)e[n].label=t[n];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=function(e,t,n,r){var a,i,o,s,l,u,c,d,h,f,p,g,m,v=n.length,y=[],b=[],x=[],_=0,w=0;for(a=0;a<v;++a){if(s=n[a].label,e.font=u=(l=n[a].major?t.major:t.minor).string,c=r[u]=r[u]||{data:{},gc:[]},d=l.lineHeight,h=f=0,$t(s)||qt(s)){if(qt(s))for(i=0,o=s.length;i<o;++i)$t(p=s[i])||qt(p)||(h=Y.measureText(e,c.data,c.gc,h,p),f+=d)}else h=Y.measureText(e,c.data,c.gc,h,s),f=d;y.push(h),b.push(f),x.push(d/2),_=Math.max(h,_),w=Math.max(f,w)}function k(e){return{width:y[e]||0,height:b[e]||0,offset:x[e]||0}}return function(e,t){Y.each(e,function(e){var n,r=e.gc,a=r.length/2;if(a>t){for(n=0;n<a;++n)delete e.data[r[n]];r.splice(0,a)}})}(r,v),g=y.indexOf(_),m=b.indexOf(w),{first:k(0),last:k(v-1),widest:k(g),highest:k(m)}}(e.ctx,en(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,n,r,a;return qt(e)?(t=+this.getRightValue(e[0]),n=+this.getRightValue(e[1]),r=Math.min(t,n),a=Math.max(t,n)):(t=void 0,n=e=+this.getRightValue(e),r=e,a=e),{min:r,max:a,start:t,end:n}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:Y.noop,getPixelForValue:Y.noop,getValueForPixel:Y.noop,getPixelForTick:function(e){var t=this,n=t.options.offset,r=t._ticks.length,a=1/Math.max(r-(n?0:1),1);return e<0||e>r-1?null:t.getPixelForDecimal(e*a+(n?a/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,r,a,i=this,o=i.options.ticks,s=o.maxTicksLimit||i._length/i._tickSize()+1,l=o.major.enabled?function(e){var t,n,r=[];for(t=0,n=e.length;t<n;t++)e[t].major&&r.push(t);return r}(e):[],u=l.length,c=l[0],d=l[u-1];if(u>s)return function(e,t,n){var r,a,i=0,o=t[0];for(n=Math.ceil(n),r=0;r<e.length;r++)a=e[r],r===o?(a._index=r,o=t[++i*n]):delete a.label}(e,l,u/s),tn(e);if(r=function(e,t,n,r){var a,i,o,s,l=function(e){var t,n,r=e.length;if(r<2)return!1;for(n=e[0],t=1;t<r;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),u=(t.length-1)/r;if(!l)return Math.max(u,1);for(o=0,s=(a=Y.math._factorize(l)).length-1;o<s;o++)if((i=a[o])>u)return i;return Math.max(u,1)}(l,e,0,s),u>0){for(t=0,n=u-1;t<n;t++)nn(e,r,l[t],l[t+1]);return nn(e,r,Y.isNullOrUndef(a=u>1?(d-c)/(u-1):null)?0:c-a,c),nn(e,r,d,Y.isNullOrUndef(a)?e.length:d+a),tn(e)}return nn(e,r),tn(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=Y.toRadians(e.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),i=e._getLabelSizes(),o=t.autoSkipPadding||0,s=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return e.isHorizontal()?l*r>s*a?s/r:l/a:l*a<s*r?l/r:s/a},_isVisible:function(){var e,t,n,r=this,a=r.chart,i=r.options.display;if("auto"!==i)return!!i;for(e=0,t=a.data.datasets.length;e<t;++e)if(a.isDatasetVisible(e)&&((n=a.getDatasetMeta(e)).xAxisID===r.id||n.yAxisID===r.id))return!0;return!1},_computeGridLineItems:function(e){var t,n,r,a,i,o,s,l,u,c,d,h,f,p,g,m,v,y=this,b=y.chart,x=y.options,_=x.gridLines,w=x.position,k=_.offsetGridLines,S=y.isHorizontal(),M=y._ticksToDraw,O=M.length+(k?1:0),D=Kt(_),P=[],C=_.drawBorder?Qt(_.lineWidth,0,0):0,T=C/2,A=Y._alignPixel,R=function(e){return A(b,e,C)};for("top"===w?(t=R(y.bottom),s=y.bottom-D,u=t-T,d=R(e.top)+T,f=e.bottom):"bottom"===w?(t=R(y.top),d=e.top,f=R(e.bottom)-T,s=t+T,u=y.top+D):"left"===w?(t=R(y.right),o=y.right-D,l=t-T,c=R(e.left)+T,h=e.right):(t=R(y.left),c=e.left,h=R(e.right)-T,o=t+T,l=y.left+D),n=0;n<O;++n)$t((r=M[n]||{}).label)&&n<M.length||(n===y.zeroLineIndex&&x.offset===k?(p=_.zeroLineWidth,g=_.zeroLineColor,m=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(p=Qt(_.lineWidth,n,1),g=Qt(_.color,n,"rgba(0,0,0,0.1)"),m=_.borderDash||[],v=_.borderDashOffset||0),void 0!==(a=Jt(y,r._index||n,k))&&(i=A(b,a,p),S?o=l=c=h=i:s=u=d=f=i,P.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:c,y1:d,x2:h,y2:f,width:p,color:g,borderDash:m,borderDashOffset:v})));return P.ticksLength=O,P.borderValue=t,P},_computeLabelItems:function(){var e,t,n,r,a,i,o,s,l,u,c,d,h=this,f=h.options,p=f.ticks,g=f.position,m=p.mirror,v=h.isHorizontal(),y=h._ticksToDraw,b=en(p),x=p.padding,_=Kt(f.gridLines),w=-Y.toRadians(h.labelRotation),k=[];for("top"===g?(i=h.bottom-_-x,o=w?"left":"center"):"bottom"===g?(i=h.top+_+x,o=w?"right":"center"):"left"===g?(a=h.right-(m?0:_)-x,o=m?"left":"right"):(a=h.left+(m?0:_)+x,o=m?"right":"left"),e=0,t=y.length;e<t;++e)$t(r=(n=y[e]).label)||(s=h.getPixelForTick(n._index||e)+p.labelOffset,u=(l=n.major?b.major:b.minor).lineHeight,c=qt(r)?r.length:1,v?(a=s,d="top"===g?((w?1:.5)-c)*u:(w?0:.5)*u):(i=s,d=(1-c)*u/2),k.push({x:a,y:i,rotation:w,label:r,font:l,textOffset:d,textAlign:o}));return k},_drawGrid:function(e){var t=this,n=t.options.gridLines;if(n.display){var r,a,i,o,s,l=t.ctx,u=t.chart,c=Y._alignPixel,d=n.drawBorder?Qt(n.lineWidth,0,0):0,h=t._gridLineItems||(t._gridLineItems=t._computeGridLineItems(e));for(i=0,o=h.length;i<o;++i)a=(s=h[i]).color,(r=s.width)&&a&&(l.save(),l.lineWidth=r,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(d){var f,p,g,m,v=d,y=Qt(n.lineWidth,h.ticksLength-1,1),b=h.borderValue;t.isHorizontal()?(f=c(u,t.left,v)-v/2,p=c(u,t.right,y)+y/2,g=m=b):(g=c(u,t.top,v)-v/2,m=c(u,t.bottom,y)+y/2,f=p=b),l.lineWidth=d,l.strokeStyle=Qt(n.color,0),l.beginPath(),l.moveTo(f,g),l.lineTo(p,m),l.stroke()}}},_drawLabels:function(){var e=this;if(e.options.ticks.display){var t,n,r,a,i,o,s,l,u=e.ctx,c=e._labelItems||(e._labelItems=e._computeLabelItems());for(t=0,r=c.length;t<r;++t){if(o=(i=c[t]).font,u.save(),u.translate(i.x,i.y),u.rotate(i.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=i.textAlign,l=i.textOffset,qt(s=i.label))for(n=0,a=s.length;n<a;++n)u.fillText(""+s[n],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,n=e.options,r=n.scaleLabel;if(r.display){var a,i,o=Gt(r.fontColor,F.global.defaultFontColor),s=Y.options._parseFont(r),l=Y.options.toPadding(r.padding),u=s.lineHeight/2,c=n.position,d=0;if(e.isHorizontal())a=e.left+e.width/2,i="bottom"===c?e.bottom-u-l.bottom:e.top+u+l.top;else{var h="left"===c;a=h?e.left+u+l.top:e.right-u-l.top,i=e.top+e.height/2,d=h?-.5*Math.PI:.5*Math.PI}t.save(),t.translate(a,i),t.rotate(d),t.textAlign="center",t.textBaseline="middle",t.fillStyle=o,t.font=s.string,t.fillText(r.labelString,0,0),t.restore()}},draw:function(e){var t=this;t._isVisible()&&(t._drawGrid(e),t._drawTitle(),t._drawLabels())},_layers:function(){var e=this,t=e.options,n=t.ticks&&t.ticks.z||0,r=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&n!==r&&e.draw===e._draw?[{z:r,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:n,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:n,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,n=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter(function(r){return(!e||r.type===e)&&(n?r.xAxisID===t.id:r.yAxisID===t.id)})}});rn.prototype._draw=rn.prototype.draw;var an=rn,on=Y.isNullOrUndef,sn=an.extend({determineDataLimits:function(){var e,t=this,n=t._getLabels(),r=t.options.ticks,a=r.min,i=r.max,o=0,s=n.length-1;void 0!==a&&(e=n.indexOf(a))>=0&&(o=e),void 0!==i&&(e=n.indexOf(i))>=0&&(s=e),t.minIndex=o,t.maxIndex=s,t.min=n[o],t.max=n[s]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,r=e.maxIndex;e.ticks=0===n&&r===t.length-1?t:t.slice(n,r+1)},getLabelForIndex:function(e,t){var n=this,r=n.chart;return r.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(r.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;an.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var r,a,i,o=this;return on(t)||on(n)||(e=o.chart.data.datasets[n].data[t]),on(e)||(r=o.isHorizontal()?e.x:e.y),(void 0!==r||void 0!==e&&isNaN(t))&&(a=o._getLabels(),e=Y.valueOrDefault(r,e),t=-1!==(i=a.indexOf(e))?i:t,isNaN(t)&&(t=e)),o.getPixelForDecimal((t-o._startValue)/o._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}});sn._defaults={position:"bottom"};var ln=Y.isNullOrUndef,un=an.extend({getRightValue:function(e){return"string"==typeof e?+e:an.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var n=Y.sign(e.min),r=Y.sign(e.max);n<0&&r<0?e.max=0:n>0&&r>0&&(e.min=0)}var a=void 0!==t.min||void 0!==t.suggestedMin,i=void 0!==t.max||void 0!==t.suggestedMax;void 0!==t.min?e.min=t.min:void 0!==t.suggestedMin&&(e.min=null===e.min?t.suggestedMin:Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(e.max=null===e.max?t.suggestedMax:Math.max(e.max,t.suggestedMax)),a!==i&&e.min>=e.max&&(a?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,r=n.stepSize,a=n.maxTicksLimit;return r?e=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(e=t._computeTickLimit(),a=a||11),a&&(e=Math.min(a,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Y.noop,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),r={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:Y.valueOrDefault(t.fixedStepSize,t.stepSize)},a=e.ticks=function(e,t){var n,r,a,i,o=[],s=e.stepSize,l=s||1,u=e.maxTicks-1,c=e.min,d=e.max,h=e.precision,f=t.min,p=t.max,g=Y.niceNum((p-f)/u/l)*l;if(g<1e-14&&ln(c)&&ln(d))return[f,p];(i=Math.ceil(p/g)-Math.floor(f/g))>u&&(g=Y.niceNum(i*g/u/l)*l),s||ln(h)?n=Math.pow(10,Y._decimalPlaces(g)):(n=Math.pow(10,h),g=Math.ceil(g*n)/n),r=Math.floor(f/g)*g,a=Math.ceil(p/g)*g,s&&(!ln(c)&&Y.almostWhole(c/g,g/1e3)&&(r=c),!ln(d)&&Y.almostWhole(d/g,g/1e3)&&(a=d)),i=Y.almostEquals(i=(a-r)/g,Math.round(i),g/1e3)?Math.round(i):Math.ceil(i),r=Math.round(r*n)/n,a=Math.round(a*n)/n,o.push(ln(c)?r:c);for(var m=1;m<i;++m)o.push(Math.round((r+m*g)*n)/n);return o.push(ln(d)?a:d),o}(r,e);e.handleDirectionalChanges(),e.max=Y.max(a),e.min=Y.min(a),t.reverse?(a.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),an.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),r=t.min,a=t.max;an.prototype._configure.call(t),t.options.offset&&n.length&&(r-=e=(a-r)/Math.max(n.length-1,1)/2,a+=e),t._startValue=r,t._endValue=a,t._valueRange=a-r}}),cn={position:"left",ticks:{callback:Ut.formatters.linear}};function dn(e,t,n,r){var a,i,o=e.options,s=function(e,t,n){var r=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[r]&&(e[r]={pos:[],neg:[]}),e[r]}(t,o.stacked,n),l=s.pos,u=s.neg,c=r.length;for(a=0;a<c;++a)i=e._parseValue(r[a]),isNaN(i.min)||isNaN(i.max)||n.data[a].hidden||(l[a]=l[a]||0,u[a]=u[a]||0,o.relativePoints?l[a]=100:i.min<0||i.max<0?u[a]+=i.min:l[a]+=i.max)}function hn(e,t,n){var r,a,i=n.length;for(r=0;r<i;++r)a=e._parseValue(n[r]),isNaN(a.min)||isNaN(a.max)||t.data[r].hidden||(e.min=Math.min(e.min,a.min),e.max=Math.max(e.max,a.max))}var fn=un.extend({determineDataLimits:function(){var e,t,n,r,a=this,i=a.options,o=a.chart.data.datasets,s=a._getMatchingVisibleMetas(),l=i.stacked,u={},c=s.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===l)for(e=0;!l&&e<c;++e)l=void 0!==(t=s[e]).stack;for(e=0;e<c;++e)n=o[(t=s[e]).index].data,l?dn(a,u,t,n):hn(a,t,n);Y.each(u,function(e){r=e.pos.concat(e.neg),a.min=Math.min(a.min,Y.min(r)),a.max=Math.max(a.max,Y.max(r))}),a.min=Y.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=Y.isFinite(a.max)&&!isNaN(a.max)?a.max:1,a.handleTickRangeOptions()},_computeTickLimit:function(){var e,t=this;return t.isHorizontal()?Math.ceil(t.width/40):(e=Y.options._parseFont(t.options.ticks),Math.ceil(t.height/e.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForValue:function(e){var t=this;return t.getPixelForDecimal((+t.getRightValue(e)-t._startValue)/t._valueRange)},getValueForPixel:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange},getPixelForTick:function(e){var t=this.ticksAsNumbers;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])}});fn._defaults=cn;var pn=Y.valueOrDefault,gn=Y.math.log10,mn={position:"left",ticks:{callback:Ut.formatters.logarithmic}};function vn(e,t){return Y.isFinite(e)&&e>=0?e:t}var yn=an.extend({determineDataLimits:function(){var e,t,n,r,a,i,o=this,s=o.options,l=o.chart,u=l.data.datasets,c=o.isHorizontal();function d(e){return c?e.xAxisID===o.id:e.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&d(t)&&void 0!==t.stack){h=!0;break}if(s.stacked||h){var f={};for(e=0;e<u.length;e++){var p=[(t=l.getDatasetMeta(e)).type,void 0===s.stacked&&void 0===t.stack?e:"",t.stack].join(".");if(l.isDatasetVisible(e)&&d(t))for(void 0===f[p]&&(f[p]=[]),a=0,i=(r=u[e].data).length;a<i;a++){var g=f[p];n=o._parseValue(r[a]),isNaN(n.min)||isNaN(n.max)||t.data[a].hidden||n.min<0||n.max<0||(g[a]=g[a]||0,g[a]+=n.max)}}Y.each(f,function(e){if(e.length>0){var t=Y.min(e),n=Y.max(e);o.min=Math.min(o.min,t),o.max=Math.max(o.max,n)}})}else for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&d(t))for(a=0,i=(r=u[e].data).length;a<i;a++)n=o._parseValue(r[a]),isNaN(n.min)||isNaN(n.max)||t.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=Y.isFinite(o.min)?o.min:null,o.max=Y.isFinite(o.max)?o.max:null,o.minNotZero=Y.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;e.min=vn(t.min,e.min),e.max=vn(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(gn(e.min))-1),e.max=Math.pow(10,Math.floor(gn(e.max))+1)):(e.min=1,e.max=10)),null===e.min&&(e.min=Math.pow(10,Math.floor(gn(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(gn(e.min))+1):10),null===e.minNotZero&&(e.minNotZero=e.min>0?e.min:e.max<1?Math.pow(10,Math.floor(gn(e.max))):1)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),r={min:vn(t.min),max:vn(t.max)},a=e.ticks=function(e,t){var n,r,a=[],i=pn(e.min,Math.pow(10,Math.floor(gn(t.min)))),o=Math.floor(gn(t.max)),s=Math.ceil(t.max/Math.pow(10,o));0===i?(n=Math.floor(gn(t.minNotZero)),r=Math.floor(t.minNotZero/Math.pow(10,n)),a.push(i),i=r*Math.pow(10,n)):(n=Math.floor(gn(i)),r=Math.floor(i/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(i),10==++r&&(r=1,l=++n>=0?1:l),i=Math.round(r*Math.pow(10,n)*l)/l}while(n<o||n===o&&r<s);var u=pn(e.max,i);return a.push(u),a}(r,e);e.max=Y.max(a),e.min=Y.min(a),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),an.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(gn(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;an.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=pn(e.options.ticks.fontSize,F.global.defaultFontSize)/e._length),e._startValue=gn(t),e._valueOffset=n,e._valueRange=(gn(e.max)-gn(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(gn(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}});yn._defaults=mn;var bn=Y.valueOrDefault,xn=Y.valueAtIndexOrDefault,_n=Y.options.resolve,wn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Ut.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function kn(e){var t=e.ticks;return t.display&&e.display?bn(t.fontSize,F.global.defaultFontSize)+2*t.backdropPaddingY:0}function Sn(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function Mn(e){return 0===e||180===e?"center":e<180?"left":"right"}function On(e,t,n,r){var a,i,o=n.y+r/2;if(Y.isArray(t))for(a=0,i=t.length;a<i;++a)e.fillText(t[a],n.x,o),o+=r;else e.fillText(t,n.x,o)}function Dn(e,t,n){90===e||270===e?n.y-=t.h/2:(e>270||e<90)&&(n.y-=t.h)}function Pn(e){return Y.isNumber(e)?e:0}var Cn=un.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=kn(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;Y.each(t.data.datasets,function(a,i){if(t.isDatasetVisible(i)){var o=t.getDatasetMeta(i);Y.each(a.data,function(t,a){var i=+e.getRightValue(t);isNaN(i)||o.data[a].hidden||(n=Math.min(i,n),r=Math.max(i,r))})}}),e.min=n===Number.POSITIVE_INFINITY?0:n,e.max=r===Number.NEGATIVE_INFINITY?0:r,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/kn(this.options))},convertTicksToLabels:function(){var e=this;un.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(function(){var t=Y.callback(e.options.pointLabels.callback,arguments,e);return t||0===t?t:""})},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this,t=e.options;t.display&&t.pointLabels.display?function(e){var t,n,r,a=Y.options._parseFont(e.options.pointLabels),i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},o={};e.ctx.font=a.string,e._pointLabelSizes=[];var s,l,u,c=e.chart.data.labels.length;for(t=0;t<c;t++){r=e.getPointPosition(t,e.drawingArea+5),s=e.ctx,l=a.lineHeight,n=Y.isArray(u=e.pointLabels[t])?{w:Y.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},e._pointLabelSizes[t]=n;var d=e.getIndexAngle(t),h=Y.toDegrees(d)%360,f=Sn(h,r.x,n.w,0,180),p=Sn(h,r.y,n.h,90,270);f.start<i.l&&(i.l=f.start,o.l=d),f.end>i.r&&(i.r=f.end,o.r=d),p.start<i.t&&(i.t=p.start,o.t=d),p.end>i.b&&(i.b=p.end,o.b=d)}e.setReductions(e.drawingArea,i,o)}(e):e.setCenterPoint(0,0,0,0)},setReductions:function(e,t,n){var r=this,a=t.l/Math.sin(n.l),i=Math.max(t.r-r.width,0)/Math.sin(n.r),o=-t.t/Math.cos(n.t),s=-Math.max(t.b-(r.height-r.paddingTop),0)/Math.cos(n.b);a=Pn(a),i=Pn(i),o=Pn(o),s=Pn(s),r.drawingArea=Math.min(Math.floor(e-(a+i)/2),Math.floor(e-(o+s)/2)),r.setCenterPoint(a,i,o,s)},setCenterPoint:function(e,t,n,r){var a=this,i=n+a.drawingArea,o=a.height-a.paddingTop-r-a.drawingArea;a.xCenter=Math.floor((e+a.drawingArea+(a.width-t-a.drawingArea))/2+a.left),a.yCenter=Math.floor((i+o)/2+a.top+a.paddingTop)},getIndexAngle:function(e){var t=this.chart,n=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(Y.isNullOrUndef(e))return NaN;var n=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*n:(e-t.min)*n},getPointPosition:function(e,t){var n=this,r=n.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(r)*t+n.xCenter,y:Math.sin(r)*t+n.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this,n=t.min,r=t.max;return t.getPointPositionForValue(e||0,t.beginAtZero?0:n<0&&r<0?r:n>0&&r>0?n:0)},_drawGrid:function(){var e,t,n,r=this,a=r.ctx,i=r.options,o=i.gridLines,s=i.angleLines,l=bn(s.lineWidth,o.lineWidth),u=bn(s.color,o.color);if(i.pointLabels.display&&function(e){var t=e.ctx,n=e.options,r=n.pointLabels,a=kn(n),i=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),o=Y.options._parseFont(r);t.save(),t.font=o.string,t.textBaseline="middle";for(var s=e.chart.data.labels.length-1;s>=0;s--){var l=e.getPointPosition(s,i+(0===s?a/2:0)+5),u=xn(r.fontColor,s,F.global.defaultFontColor);t.fillStyle=u;var c=e.getIndexAngle(s),d=Y.toDegrees(c);t.textAlign=Mn(d),Dn(d,e._pointLabelSizes[s],l),On(t,e.pointLabels[s],l,o.lineHeight)}t.restore()}(r),o.display&&Y.each(r.ticks,function(e,n){0!==n&&(t=r.getDistanceFromCenterForValue(r.ticksAsNumbers[n]),function(e,t,n,r){var a,i=e.ctx,o=t.circular,s=e.chart.data.labels.length,l=xn(t.color,r-1),u=xn(t.lineWidth,r-1);if((o||s)&&l&&u){if(i.save(),i.strokeStyle=l,i.lineWidth=u,i.setLineDash&&(i.setLineDash(t.borderDash||[]),i.lineDashOffset=t.borderDashOffset||0),i.beginPath(),o)i.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{a=e.getPointPosition(0,n),i.moveTo(a.x,a.y);for(var c=1;c<s;c++)a=e.getPointPosition(c,n),i.lineTo(a.x,a.y)}i.closePath(),i.stroke(),i.restore()}}(r,o,t,n))}),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(_n([s.borderDash,o.borderDash,[]])),a.lineDashOffset=_n([s.borderDashOffset,o.borderDashOffset,0])),e=r.chart.data.labels.length-1;e>=0;e--)t=r.getDistanceFromCenterForValue(i.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),a.beginPath(),a.moveTo(r.xCenter,r.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var r,a,i=e.getIndexAngle(0),o=Y.options._parseFont(n),s=bn(n.fontColor,F.global.defaultFontColor);t.save(),t.font=o.string,t.translate(e.xCenter,e.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",Y.each(e.ticks,function(i,l){(0!==l||n.reverse)&&(r=e.getDistanceFromCenterForValue(e.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=t.measureText(i).width,t.fillStyle=n.backdropColor,t.fillRect(-a/2-n.backdropPaddingX,-r-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),t.fillStyle=s,t.fillText(i,0,-r))}),t.restore()}},_drawTitle:Y.noop});Cn._defaults=wn;var Tn=Y._deprecated,An=Y.options.resolve,Rn=Y.valueOrDefault,In=Number.MIN_SAFE_INTEGER||-9007199254740991,Nn=Number.MAX_SAFE_INTEGER||9007199254740991,En={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}},Fn=Object.keys(En);function jn(e,t){return e-t}function Ln(e){return Y.valueOrDefault(e.time.min,e.ticks.min)}function Wn(e){return Y.valueOrDefault(e.time.max,e.ticks.max)}function zn(e,t,n,r){var a=function(e,t,n){for(var r,a,i,o=0,s=e.length-1;o>=0&&o<=s;){if(i=e[r=o+s>>1],!(a=e[r-1]||null))return{lo:null,hi:i};if(i[t]<n)o=r+1;else{if(!(a[t]>n))return{lo:a,hi:i};s=r-1}}return{lo:i,hi:null}}(e,t,n),i=a.lo?a.hi?a.lo:e[e.length-2]:e[0],o=a.lo?a.hi?a.hi:e[e.length-1]:e[1],s=o[t]-i[t];return i[r]+(o[r]-i[r])*(s?(n-i[t])/s:0)}function Yn(e,t){var n=e._adapter,r=e.options.time,a=r.parser,i=a||r.format,o=t;return"function"==typeof a&&(o=a(o)),Y.isFinite(o)||(o="string"==typeof i?n.parse(o,i):n.parse(o)),null!==o?+o:(a||"function"!=typeof i||(o=i(t),Y.isFinite(o)||(o=n.parse(o))),o)}function Vn(e,t){if(Y.isNullOrUndef(t))return null;var n=e.options.time,r=Yn(e,e.getRightValue(t));return null===r||n.round&&(r=+e._adapter.startOf(r,n.round)),r}function Bn(e,t,n,r){var a,i,o=Fn.length;for(a=Fn.indexOf(e);a<o-1;++a)if((i=En[Fn[a]]).common&&Math.ceil((n-t)/((i.steps?i.steps:Nn)*i.size))<=r)return Fn[a];return Fn[o-1]}function Hn(e,t,n){var r,a,i=[],o={},s=t.length;for(r=0;r<s;++r)o[a=t[r]]=r,i.push({value:a,major:!1});return 0!==s&&n?function(e,t,n,r){var a,i,o=e._adapter,s=+o.startOf(t[0].value,r),l=t[t.length-1].value;for(a=s;a<=l;a=+o.add(a,1,r))(i=n[a])>=0&&(t[i].major=!0);return t}(e,i,o,n):i}var Un=an.extend({initialize:function(){this.mergeTicksOptions(),an.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,n=t.time||(t.time={}),r=e._adapter=new Ht._date(t.adapters.date);return Tn("time scale",n.format,"time.format","time.parser"),Tn("time scale",n.min,"time.min","ticks.min"),Tn("time scale",n.max,"time.max","ticks.max"),Y.mergeIf(n.displayFormats,r.formats()),an.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),an.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,n,r,a,i,o,s=this,l=s.chart,u=s._adapter,c=s.options,d=c.time.unit||"day",h=Nn,f=In,p=[],g=[],m=[],v=s._getLabels();for(e=0,n=v.length;e<n;++e)m.push(Vn(s,v[e]));for(e=0,n=(l.data.datasets||[]).length;e<n;++e)if(l.isDatasetVisible(e))if(Y.isObject((a=l.data.datasets[e].data)[0]))for(g[e]=[],t=0,r=a.length;t<r;++t)i=Vn(s,a[t]),p.push(i),g[e][t]=i;else g[e]=m.slice(0),o||(p=p.concat(m),o=!0);else g[e]=[];m.length&&(h=Math.min(h,m[0]),f=Math.max(f,m[m.length-1])),p.length&&(p=n>1?function(e){var t,n,r,a={},i=[];for(t=0,n=e.length;t<n;++t)a[r=e[t]]||(a[r]=!0,i.push(r));return i}(p).sort(jn):p.sort(jn),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=Vn(s,Ln(c))||h,f=Vn(s,Wn(c))||f,h=h===Nn?+u.startOf(Date.now(),d):h,f=f===In?+u.endOf(Date.now(),d)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:p,datasets:g,labels:m}},buildTicks:function(){var e,t,n,r=this,a=r.min,i=r.max,o=r.options,s=o.ticks,l=o.time,u=r._timestamps,c=[],d=r.getLabelCapacity(a),h=s.source,f=o.distribution;for(u="data"===h||"auto"===h&&"series"===f?u.data:"labels"===h?u.labels:function(e,t,n,r){var a,i=e._adapter,o=e.options,s=o.time,l=s.unit||Bn(s.minUnit,t,n,r),u=An([s.stepSize,s.unitStepSize,1]),c="week"===l&&s.isoWeekday,d=t,h=[];if(c&&(d=+i.startOf(d,"isoWeek",c)),d=+i.startOf(d,c?"day":l),i.diff(n,t,l)>1e5*u)throw t+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=d;a<n;a=+i.add(a,u,l))h.push(a);return a!==n&&"ticks"!==o.bounds||h.push(a),h}(r,a,i,d),"ticks"===o.bounds&&u.length&&(a=u[0],i=u[u.length-1]),a=Vn(r,Ln(o))||a,i=Vn(r,Wn(o))||i,e=0,t=u.length;e<t;++e)(n=u[e])>=a&&n<=i&&c.push(n);return r.min=a,r.max=i,r._unit=l.unit||(s.autoSkip?Bn(l.minUnit,r.min,r.max,d):function(e,t,n,r,a){var i,o;for(i=Fn.length-1;i>=Fn.indexOf(n);i--)if(En[o=Fn[i]].common&&e._adapter.diff(a,r,o)>=t-1)return o;return Fn[n?Fn.indexOf(n):0]}(r,c.length,l.minUnit,r.min,r.max)),r._majorUnit=s.major.enabled&&"year"!==r._unit?function(e){for(var t=Fn.indexOf(e)+1,n=Fn.length;t<n;++t)if(En[Fn[t]].common)return Fn[t]}(r._unit):void 0,r._table=function(e,t,n,r){if("linear"===r||!e.length)return[{time:t,pos:0},{time:n,pos:1}];var a,i,o,s,l,u=[],c=[t];for(a=0,i=e.length;a<i;++a)(s=e[a])>t&&s<n&&c.push(s);for(c.push(n),a=0,i=c.length;a<i;++a)l=c[a+1],s=c[a],void 0!==(o=c[a-1])&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(i-1)});return u}(r._timestamps.data,a,i,f),r._offsets=function(e,t,n,r,a){var i,o,s=0,l=0;return a.offset&&t.length&&(i=zn(e,"time",t[0],"pos"),s=1===t.length?1-i:(zn(e,"time",t[1],"pos")-i)/2,o=zn(e,"time",t[t.length-1],"pos"),l=1===t.length?o:(o-zn(e,"time",t[t.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(r._table,c,0,0,o),s.reverse&&c.reverse(),Hn(r,c,r._majorUnit)},getLabelForIndex:function(e,t){var n=this,r=n._adapter,a=n.chart.data,i=n.options.time,o=a.labels&&e<a.labels.length?a.labels[e]:"",s=a.datasets[t].data[e];return Y.isObject(s)&&(o=n.getRightValue(s)),i.tooltipFormat?r.format(Yn(n,o),i.tooltipFormat):"string"==typeof o?o:r.format(Yn(n,o),i.displayFormats.datetime)},tickFormatFunction:function(e,t,n,r){var a=this,i=a.options,o=i.time.displayFormats,s=a._majorUnit,l=o[s],u=n[t],c=i.ticks,d=s&&l&&u&&u.major,h=a._adapter.format(e,r||(d?l:o[a._unit])),f=d?c.major:c.minor,p=An([f.callback,f.userCallback,c.callback,c.userCallback]);return p?p(h,t,n):h},convertTicksToLabels:function(e){var t,n,r=[];for(t=0,n=e.length;t<n;++t)r.push(this.tickFormatFunction(e[t].value,t,e));return r},getPixelForOffset:function(e){var t=this,n=t._offsets,r=zn(t._table,"time",e,"pos");return t.getPixelForDecimal((n.start+r)*n.factor)},getPixelForValue:function(e,t,n){var r=this,a=null;if(void 0!==t&&void 0!==n&&(a=r._timestamps.datasets[n][t]),null===a&&(a=Vn(r,e)),null!==a)return r.getPixelForOffset(a)},getPixelForTick:function(e){var t=this.getTicks();return e>=0&&e<t.length?this.getPixelForOffset(t[e].value):null},getValueForPixel:function(e){var t=this,n=t._offsets,r=t.getDecimalForPixel(e)/n.factor-n.end,a=zn(t._table,"pos",r,"time");return t._adapter._create(a)},_getLabelSize:function(e){var t=this,n=t.options.ticks,r=t.ctx.measureText(e).width,a=Y.toRadians(t.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(a),o=Math.sin(a),s=Rn(n.fontSize,F.global.defaultFontSize);return{w:r*i+s*o,h:r*o+s*i}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,n=t.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,i=t.tickFormatFunction(e,0,Hn(t,[e],t._majorUnit),a),o=t._getLabelSize(i),s=Math.floor(t.isHorizontal()?t.width/o.w:t.height/o.h);return t.options.offset&&s--,s>0?s:1}});Un._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var qn={category:sn,linear:fn,logarithmic:yn,radialLinear:Cn,time:Un},$n={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Ht._date.override("function"==typeof e?{_id:"moment",formats:function(){return $n},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,r){return e(t).add(n,r).valueOf()},diff:function(t,n,r){return e(t).diff(e(n),r)},startOf:function(t,n,r){return t=e(t),"isoWeek"===n?t.isoWeekday(r).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),F._set("global",{plugins:{filler:{propagate:!0}}});var Gn={dataset:function(e){var t=e.fill,n=e.chart,r=n.getDatasetMeta(t),a=r&&n.isDatasetVisible(t)&&r.dataset._children||[],i=a.length||0;return i?function(e,t){return t<i&&a[t]._view||null}:null},boundary:function(e){var t=e.boundary,n=t?t.x:null,r=t?t.y:null;return Y.isArray(t)?function(e,n){return t[n]}:function(e){return{x:null===n?e.x:n,y:null===r?e.y:r}}}};function Qn(e,t,n){var r,a=e._model||{},i=a.fill;if(void 0===i&&(i=!!a.backgroundColor),!1===i||null===i)return!1;if(!0===i)return"origin";if(r=parseFloat(i,10),isFinite(r)&&Math.floor(r)===r)return"-"!==i[0]&&"+"!==i[0]||(r=t+r),!(r===t||r<0||r>=n)&&r;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function Jn(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,n,r,a,i,o=e.el._scale,s=o.options,l=o.chart.data.labels.length,u=e.fill,c=[];if(!l)return null;for(n=s.ticks.reverse?o.min:o.max,r=o.getPointPositionForValue(0,t=s.ticks.reverse?o.max:o.min),a=0;a<l;++a)i="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?t:n):o.getBasePosition(a),s.gridLines.circular&&(i.cx=r.x,i.cy=r.y,i.angle=o.getIndexAngle(a)-Math.PI/2),c.push(i);return c}(e):function(e){var t,n=e.el._model||{},r=e.el._scale||{},a=e.fill,i=null;if(isFinite(a))return null;if("start"===a?i=void 0===n.scaleBottom?r.bottom:n.scaleBottom:"end"===a?i=void 0===n.scaleTop?r.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:r.getBasePixel&&(i=r.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if(Y.isFinite(i))return{x:(t=r.isHorizontal())?i:null,y:t?null:i}}return null}(e)}function Kn(e,t,n){var r,a=e[t].fill,i=[t];if(!n)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!isFinite(a))return a;if(!(r=e[a]))return!1;if(r.visible)return a;i.push(a),a=r.fill}return!1}function Zn(e){var t=e.fill,n="dataset";return!1===t?null:(isFinite(t)||(n="boundary"),Gn[n](e))}function Xn(e){return e&&!e.skip}function er(e,t,n,r,a){var i,o,s,l;if(r&&a){for(e.moveTo(t[0].x,t[0].y),i=1;i<r;++i)Y.canvas.lineTo(e,t[i-1],t[i]);if(void 0===n[0].angle)for(e.lineTo(n[a-1].x,n[a-1].y),i=a-1;i>0;--i)Y.canvas.lineTo(e,n[i],n[i-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),i=a-1;i>0;--i)e.arc(o,s,l,n[i].angle,n[i-1].angle,!0)}}function tr(e,t,n,r,a,i){var o,s,l,u,c,d,h,f,p=t.length,g=r.spanGaps,m=[],v=[],y=0,b=0;for(e.beginPath(),o=0,s=p;o<s;++o)c=n(u=t[l=o%p]._view,l,r),d=Xn(u),h=Xn(c),i&&void 0===f&&d&&(s=p+(f=o+1)),d&&h?(y=m.push(u),b=v.push(c)):y&&b&&(g?(d&&m.push(u),h&&v.push(c)):(er(e,m,v,y,b),y=b=0,m=[],v=[]));er(e,m,v,y,b),e.closePath(),e.fillStyle=a,e.fill()}var nr={id:"filler",afterDatasetsUpdate:function(e,t){var n,r,a,i,o=(e.data.datasets||[]).length,s=t.propagate,l=[];for(r=0;r<o;++r)i=null,(a=(n=e.getDatasetMeta(r)).dataset)&&a._model&&a instanceof ve.Line&&(i={visible:e.isDatasetVisible(r),fill:Qn(a,r,o),chart:e,el:a}),n.$filler=i,l.push(i);for(r=0;r<o;++r)(i=l[r])&&(i.fill=Kn(l,r,s),i.boundary=Jn(i),i.mapper=Zn(i))},beforeDatasetsDraw:function(e){var t,n,r,a,i,o,s,l=e._getSortedVisibleDatasetMetas(),u=e.ctx;for(n=l.length-1;n>=0;--n)(t=l[n].$filler)&&t.visible&&(i=(r=t.el)._children||[],s=(a=r._view).backgroundColor||F.global.defaultColor,(o=t.mapper)&&s&&i.length&&(Y.canvas.clipArea(u,e.chartArea),tr(u,i,o,a,s,r._loop),Y.canvas.unclipArea(u)))}},rr=Y.rtl.getRtlAdapter,ar=Y.noop,ir=Y.valueOrDefault;function or(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}F._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,r=this.chart,a=r.getDatasetMeta(n);a.hidden=null===a.hidden?!r.data.datasets[n].hidden:null,r.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},r=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(n){var a=n.controller.getStyle(r?0:void 0);return{text:t[n.index].label,fillStyle:a.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(e){var t,n,r,a=document.createElement("ul"),i=e.data.datasets;for(a.setAttribute("class",e.id+"-legend"),t=0,n=i.length;t<n;t++)(r=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=i[t].backgroundColor,i[t].label&&r.appendChild(document.createTextNode(i[t].label));return a.outerHTML}});var sr=q.extend({initialize:function(e){var t=this;Y.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:ar,update:function(e,t,n){var r=this;return r.beforeUpdate(),r.maxWidth=e,r.maxHeight=t,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:ar,beforeSetDimensions:ar,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:ar,beforeBuildLabels:ar,buildLabels:function(){var e=this,t=e.options.labels||{},n=Y.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter(function(n){return t.filter(n,e.chart.data)})),e.options.reverse&&n.reverse(),e.legendItems=n},afterBuildLabels:ar,beforeFit:ar,fit:function(){var e=this,t=e.options,n=t.labels,r=t.display,a=e.ctx,i=Y.options._parseFont(n),o=i.size,s=e.legendHitBoxes=[],l=e.minSize,u=e.isHorizontal();if(u?(l.width=e.maxWidth,l.height=r?10:0):(l.width=r?10:0,l.height=e.maxHeight),r){if(a.font=i.string,u){var c=e.lineWidths=[0],d=0;a.textAlign="left",a.textBaseline="middle",Y.each(e.legendItems,function(e,t){var r=or(n,o)+o/2+a.measureText(e.text).width;(0===t||c[c.length-1]+r+2*n.padding>l.width)&&(d+=o+n.padding,c[c.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:r,height:o},c[c.length-1]+=r+n.padding}),l.height+=d}else{var h=n.padding,f=e.columnWidths=[],p=e.columnHeights=[],g=n.padding,m=0,v=0;Y.each(e.legendItems,function(e,t){var r=or(n,o)+o/2+a.measureText(e.text).width;t>0&&v+o+2*h>l.height&&(g+=m+n.padding,f.push(m),p.push(v),m=0,v=0),m=Math.max(m,r),v+=o+h,s[t]={left:0,top:0,width:r,height:o}}),g+=m,f.push(m),p.push(v),l.width+=g}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:ar,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,r=F.global,a=r.defaultColor,i=r.elements.line,o=e.height,s=e.columnHeights,l=e.width,u=e.lineWidths;if(t.display){var c,d=rr(t.rtl,e.left,e.minSize.width),h=e.ctx,f=ir(n.fontColor,r.defaultFontColor),p=Y.options._parseFont(n),g=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var m=or(n,g),v=e.legendHitBoxes,y=function(e,r){switch(t.align){case"start":return n.padding;case"end":return e-r;default:return(e-r+n.padding)/2}},b=e.isHorizontal();c=b?{x:e.left+y(l,u[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+y(o,s[0]),line:0},Y.rtl.overrideTextDirection(e.ctx,t.textDirection);var x=g+n.padding;Y.each(e.legendItems,function(t,r){var f=h.measureText(t.text).width,p=m+g/2+f,_=c.x,w=c.y;d.setWidth(e.minSize.width),b?r>0&&_+p+n.padding>e.left+e.minSize.width&&(w=c.y+=x,c.line++,_=c.x=e.left+y(l,u[c.line])):r>0&&w+x>e.top+e.minSize.height&&(_=c.x=_+e.columnWidths[c.line]+n.padding,c.line++,w=c.y=e.top+y(o,s[c.line]));var k=d.x(_);(function(e,t,r){if(!(isNaN(m)||m<=0)){h.save();var o=ir(r.lineWidth,i.borderWidth);if(h.fillStyle=ir(r.fillStyle,a),h.lineCap=ir(r.lineCap,i.borderCapStyle),h.lineDashOffset=ir(r.lineDashOffset,i.borderDashOffset),h.lineJoin=ir(r.lineJoin,i.borderJoinStyle),h.lineWidth=o,h.strokeStyle=ir(r.strokeStyle,a),h.setLineDash&&h.setLineDash(ir(r.lineDash,i.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(e,m/2);Y.canvas.drawPoint(h,r.pointStyle,s,l,t+g/2,r.rotation)}else h.fillRect(d.leftForLtr(e,m),t,m,g),0!==o&&h.strokeRect(d.leftForLtr(e,m),t,m,g);h.restore()}})(k,w,t),v[r].left=d.leftForLtr(k,v[r].width),v[r].top=w,function(e,t,n,r){var a=g/2,i=d.xPlus(e,m+a),o=t+a;h.fillText(n.text,i,o),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(i,o),h.lineTo(d.xPlus(i,r),o),h.stroke())}(k,w,t,f),b?c.x+=p+n.padding:c.y+=x}),Y.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,r,a,i=this;if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)for(a=i.legendHitBoxes,n=0;n<a.length;++n)if(e>=(r=a[n]).left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height)return i.legendItems[n];return null},handleEvent:function(e){var t,n=this,r=n.options,a="mouseup"===e.type?"click":e.type;if("mousemove"===a){if(!r.onHover&&!r.onLeave)return}else{if("click"!==a)return;if(!r.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===a?t&&r.onClick&&r.onClick.call(n,e.native,t):(r.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&r.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),r.onHover&&t&&r.onHover.call(n,e.native,t))}});function lr(e,t){var n=new sr({ctx:e.ctx,options:t,chart:e});it.configure(e,n,t),it.addBox(e,n),e.legend=n}var ur={id:"legend",_element:sr,beforeInit:function(e){var t=e.options.legend;t&&lr(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(Y.mergeIf(t,F.global.legend),n?(it.configure(e,n,t),n.options=t):lr(e,t)):n&&(it.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},cr=Y.noop;F._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var dr=q.extend({initialize:function(e){Y.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:cr,update:function(e,t,n){var r=this;return r.beforeUpdate(),r.maxWidth=e,r.maxHeight=t,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:cr,beforeSetDimensions:cr,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:cr,beforeBuildLabels:cr,buildLabels:cr,afterBuildLabels:cr,beforeFit:cr,fit:function(){var e,t=this,n=t.options,r=t.minSize={},a=t.isHorizontal();n.display?(e=(Y.isArray(n.text)?n.text.length:1)*Y.options._parseFont(n).lineHeight+2*n.padding,t.width=r.width=a?t.maxWidth:e,t.height=r.height=a?e:t.maxHeight):t.width=r.width=t.height=r.height=0},afterFit:cr,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var r,a,i,o=Y.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,c=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=Y.valueOrDefault(n.fontColor,F.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(a=d+(f-d)/2,i=c+l,r=f-d):(a="left"===n.position?d+l:f-l,i=c+(h-c)/2,r=h-c,u=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(a,i),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var p=n.text;if(Y.isArray(p))for(var g=0,m=0;m<p.length;++m)t.fillText(p[m],0,g,r),g+=s;else t.fillText(p,0,0,r);t.restore()}}});function hr(e,t){var n=new dr({ctx:e.ctx,options:t,chart:e});it.configure(e,n,t),it.addBox(e,n),e.titleBlock=n}var fr={},pr=nr,gr=ur,mr={id:"title",_element:dr,beforeInit:function(e){var t=e.options.title;t&&hr(e,t)},beforeUpdate:function(e){var t=e.options.title,n=e.titleBlock;t?(Y.mergeIf(t,F.global.title),n?(it.configure(e,n,t),n.options=t):hr(e,t)):n&&(it.removeBox(e,n),delete e.titleBlock)}};for(var vr in fr.filler=pr,fr.legend=gr,fr.title=mr,Yt.helpers=Y,function(){function e(e,t,n){var r;return"string"==typeof e?(r=parseInt(e,10),-1!==e.indexOf("%")&&(r=r/100*t.parentNode[n])):r=e,r}function t(e){return null!=e&&"none"!==e}function n(n,r,a){var i=document.defaultView,o=Y._getParentNode(n),s=i.getComputedStyle(n)[r],l=i.getComputedStyle(o)[r],u=t(s),c=t(l),d=Number.POSITIVE_INFINITY;return u||c?Math.min(u?e(s,n,a):d,c?e(l,o,a):d):"none"}Y.where=function(e,t){if(Y.isArray(e)&&Array.prototype.filter)return e.filter(t);var n=[];return Y.each(e,function(e){t(e)&&n.push(e)}),n},Y.findIndex=Array.prototype.findIndex?function(e,t,n){return e.findIndex(t,n)}:function(e,t,n){n=void 0===n?e:n;for(var r=0,a=e.length;r<a;++r)if(t.call(n,e[r],r,e))return r;return-1},Y.findNextWhere=function(e,t,n){Y.isNullOrUndef(n)&&(n=-1);for(var r=n+1;r<e.length;r++){var a=e[r];if(t(a))return a}},Y.findPreviousWhere=function(e,t,n){Y.isNullOrUndef(n)&&(n=e.length);for(var r=n-1;r>=0;r--){var a=e[r];if(t(a))return a}},Y.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Y.almostEquals=function(e,t,n){return Math.abs(e-t)<n},Y.almostWhole=function(e,t){var n=Math.round(e);return n-t<=e&&n+t>=e},Y.max=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.max(e,t)},Number.NEGATIVE_INFINITY)},Y.min=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.min(e,t)},Number.POSITIVE_INFINITY)},Y.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},Y.toRadians=function(e){return e*(Math.PI/180)},Y.toDegrees=function(e){return e*(180/Math.PI)},Y._decimalPlaces=function(e){if(Y.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},Y.getAngleFromPoint=function(e,t){var n=t.x-e.x,r=t.y-e.y,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:a}},Y.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},Y.aliasPixel=function(e){return e%2==0?0:.5},Y._alignPixel=function(e,t,n){var r=e.currentDevicePixelRatio,a=n/2;return Math.round((t-a)*r)/r+a},Y.splineCurve=function(e,t,n,r){var a=e.skip?t:e,i=t,o=n.skip?t:n,s=Math.sqrt(Math.pow(i.x-a.x,2)+Math.pow(i.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),u=s/(s+l),c=l/(s+l),d=r*(u=isNaN(u)?0:u),h=r*(c=isNaN(c)?0:c);return{previous:{x:i.x-d*(o.x-a.x),y:i.y-d*(o.y-a.y)},next:{x:i.x+h*(o.x-a.x),y:i.y+h*(o.y-a.y)}}},Y.EPSILON=Number.EPSILON||1e-14,Y.splineCurveMonotone=function(e){var t,n,r,a,i,o,s,l,u,c=(e||[]).map(function(e){return{model:e._model,deltaK:0,mK:0}}),d=c.length;for(t=0;t<d;++t)if(!(r=c[t]).model.skip){if(n=t>0?c[t-1]:null,(a=t<d-1?c[t+1]:null)&&!a.model.skip){var h=a.model.x-r.model.x;r.deltaK=0!==h?(a.model.y-r.model.y)/h:0}r.mK=!n||n.model.skip?r.deltaK:!a||a.model.skip?n.deltaK:this.sign(n.deltaK)!==this.sign(r.deltaK)?0:(n.deltaK+r.deltaK)/2}for(t=0;t<d-1;++t)a=c[t+1],(r=c[t]).model.skip||a.model.skip||(Y.almostEquals(r.deltaK,0,this.EPSILON)?r.mK=a.mK=0:(i=r.mK/r.deltaK,o=a.mK/r.deltaK,(l=Math.pow(i,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),r.mK=i*s*r.deltaK,a.mK=o*s*r.deltaK)));for(t=0;t<d;++t)(r=c[t]).model.skip||(a=t<d-1?c[t+1]:null,(n=t>0?c[t-1]:null)&&!n.model.skip&&(r.model.controlPointPreviousX=r.model.x-(u=(r.model.x-n.model.x)/3),r.model.controlPointPreviousY=r.model.y-u*r.mK),a&&!a.model.skip&&(r.model.controlPointNextX=r.model.x+(u=(a.model.x-r.model.x)/3),r.model.controlPointNextY=r.model.y+u*r.mK))},Y.nextItem=function(e,t,n){return n?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},Y.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},Y.niceNum=function(e,t){var n=Math.floor(Y.log10(e)),r=e/Math.pow(10,n);return(t?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,n)},Y.requestAnimFrame="undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},Y.getRelativePosition=function(e,t){var n,r,a=e.originalEvent||e,i=e.target||e.srcElement,o=i.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,r=s[0].clientY):(n=a.clientX,r=a.clientY);var l=parseFloat(Y.getStyle(i,"padding-left")),u=parseFloat(Y.getStyle(i,"padding-top")),c=parseFloat(Y.getStyle(i,"padding-right")),d=parseFloat(Y.getStyle(i,"padding-bottom")),h=o.bottom-o.top-u-d;return{x:n=Math.round((n-o.left-l)/(o.right-o.left-l-c)*i.width/t.currentDevicePixelRatio),y:r=Math.round((r-o.top-u)/h*i.height/t.currentDevicePixelRatio)}},Y.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},Y.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},Y._calculatePadding=function(e,t,n){return(t=Y.getStyle(e,t)).indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},Y._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},Y.getMaximumWidth=function(e){var t=Y._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,r=n-Y._calculatePadding(t,"padding-left",n)-Y._calculatePadding(t,"padding-right",n),a=Y.getConstraintWidth(e);return isNaN(a)?r:Math.min(r,a)},Y.getMaximumHeight=function(e){var t=Y._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,r=n-Y._calculatePadding(t,"padding-top",n)-Y._calculatePadding(t,"padding-bottom",n),a=Y.getConstraintHeight(e);return isNaN(a)?r:Math.min(r,a)},Y.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},Y.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var r=e.canvas,a=e.height,i=e.width;r.height=a*n,r.width=i*n,e.ctx.scale(n,n),r.style.height||r.style.width||(r.style.height=a+"px",r.style.width=i+"px")}},Y.fontString=function(e,t,n){return t+" "+e+"px "+n},Y.longestText=function(e,t,n,r){var a=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(a=r.data={},i=r.garbageCollect=[],r.font=t),e.font=t;var o,s,l,u,c,d=0,h=n.length;for(o=0;o<h;o++)if(null!=(u=n[o])&&!0!==Y.isArray(u))d=Y.measureText(e,a,i,d,u);else if(Y.isArray(u))for(s=0,l=u.length;s<l;s++)null==(c=u[s])||Y.isArray(c)||(d=Y.measureText(e,a,i,d,c));var f=i.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[i[o]];i.splice(0,f)}return d},Y.measureText=function(e,t,n,r,a){var i=t[a];return i||(i=t[a]=e.measureText(a).width,n.push(a)),i>r&&(r=i),r},Y.numberOfLabelLines=function(e){var t=1;return Y.each(e,function(e){Y.isArray(e)&&e.length>t&&(t=e.length)}),t},Y.color=x?function(e){return e instanceof CanvasGradient&&(e=F.global.defaultColor),x(e)}:function(e){return console.error("Color.js not found!"),e},Y.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:Y.color(e).saturate(.5).darken(.1).rgbString()}}(),Yt._adapters=Ht,Yt.Animation=G,Yt.animationService=Q,Yt.controllers=Be,Yt.DatasetController=ee,Yt.defaults=F,Yt.Element=q,Yt.elements=ve,Yt.Interaction=Je,Yt.layouts=it,Yt.platform=_t,Yt.plugins=wt,Yt.Scale=an,Yt.scaleService=kt,Yt.Ticks=Ut,Yt.Tooltip=It,Yt.helpers.each(qn,function(e,t){Yt.scaleService.registerScaleType(t,e,e._defaults)}),fr)fr.hasOwnProperty(vr)&&Yt.plugins.register(fr[vr]);Yt.platform.initialize();var yr=Yt;return"undefined"!=typeof window&&(window.Chart=Yt),Yt.Chart=Yt,Yt.Legend=fr.legend._element,Yt.Title=fr.title._element,Yt.pluginService=Yt.plugins,Yt.PluginBase=Yt.Element.extend({}),Yt.canvasHelpers=Yt.helpers.canvas,Yt.layoutService=Yt.layouts,Yt.LinearScaleBase=un,Yt.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){Yt[e]=function(t,n){return new Yt(t,Yt.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),yr}(function(){try{return moment$1}catch(e){}}())});const defaultDatasetIdKey="label";function reforwardRef(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function setOptions(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function setLabels(e,t){e.labels=t}function setDatasets(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultDatasetIdKey;const r=[];e.datasets=t.map(t=>{const a=e.datasets.find(e=>e[n]===t[n]);return a&&t.data&&!r.includes(a)?(r.push(a),Object.assign(a,t),a):{...t}})}function cloneData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultDatasetIdKey;const n={labels:[],datasets:[]};return setLabels(n,e.labels),setDatasets(n,e.datasets,t),n}function ChartComponent(e,t){const{height:n=150,width:r=300,redraw:a=!1,datasetIdKey:i,type:o,data:s,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...h}=e,f=React.useRef(null),p=React.useRef(),g=()=>{f.current&&(p.current=new Chart$1.Chart(f.current,{type:o,data:cloneData(s,i),options:l&&{...l},plugins:u}),reforwardRef(t,p.current))},m=()=>{reforwardRef(t,null),p.current&&(p.current.destroy(),p.current=null)};return React.useEffect(()=>{!a&&p.current&&l&&setOptions(p.current,l)},[a,l]),React.useEffect(()=>{!a&&p.current&&setLabels(p.current.config.data,s.labels)},[a,s.labels]),React.useEffect(()=>{!a&&p.current&&s.datasets&&setDatasets(p.current.config.data,s.datasets,i)},[a,s.datasets]),React.useEffect(()=>{p.current&&(a?(m(),setTimeout(g)):p.current.update(d))},[a,l,s.labels,s.datasets,d]),React.useEffect(()=>{p.current&&(m(),setTimeout(g))},[o]),React.useEffect(()=>(g(),()=>m()),[]),/*#__PURE__*/React__default.default.createElement("canvas",Object.assign({ref:f,role:"img",height:n,width:r},h),c)}const Chart=/*#__PURE__*/React.forwardRef(ChartComponent);var chartjsPluginDatasourcePrometheus_umd=createCommonjsModule(function(e,t){e.exports=function(){var e={exports:{}};!function(e,t){!function(e){var t={exports:{}},n=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},r=n,a=Object.prototype.toString;function i(e){return Array.isArray(e)}function o(e){return void 0===e}function s(e){return"[object ArrayBuffer]"===a.call(e)}function l(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===a.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}var h={isArray:i,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===a.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:l,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:c,isStream:function(e){return l(e)&&c(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===a.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:d,merge:function e(){var t={};function n(n,r){t[r]=u(t[r])&&u(n)?e(t[r],n):u(n)?e({},n):i(n)?n.slice():n}for(var r=0,a=arguments.length;r<a;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,function(t,a){e[a]=n&&"function"==typeof t?r(t,n):t}),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},f=h;function p(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var g=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(f.isURLSearchParams(t))r=t.toString();else{var a=[];f.forEach(t,function(e,t){null!=e&&(f.isArray(e)?t+="[]":e=[e],f.forEach(e,function(e){f.isDate(e)?e=e.toISOString():f.isObject(e)&&(e=JSON.stringify(e)),a.push(p(t)+"="+p(e))}))}),r=a.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},m=h;function v(){this.handlers=[]}v.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},v.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},v.prototype.forEach=function(e){m.forEach(this.handlers,function(t){null!==t&&e(t)})};var y=v,b=h,x=function(e,t,n,r,a){return e.config=t,n&&(e.code=n),e.request=r,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},w=x,k=function(e,t,n,r,a){var i=new Error(e);return w(i,t,n,r,a)},S=k,M=h,O=M.isStandardBrowserEnv()?{write:function(e,t,n,r,a,i){var o=[];o.push(e+"="+encodeURIComponent(t)),M.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),M.isString(r)&&o.push("path="+r),M.isString(a)&&o.push("domain="+a),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},D=h,P=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],C=h,T=C.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=C.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function A(e){this.message=e}A.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},A.prototype.__CANCEL__=!0;var R=A,I=h,N=O,E=g,F=T,j=k,L=_,W=R,z=h,Y=function(e,t){b.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})},V=x,B={"Content-Type":"application/x-www-form-urlencoded"};function H(e,t){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var U,q={transitional:_,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(U=function(e){return new Promise(function(t,n){var r,a=e.data,i=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}I.isFormData(a)&&delete i["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",c=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(u+":"+c)}var d=function(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}(e.baseURL,e.url);function h(){if(l){var r="getAllResponseHeaders"in l?function(e){var t,n,r,a={};return e?(D.forEach(e.split("\n"),function(e){if(r=e.indexOf(":"),t=D.trim(e.substr(0,r)).toLowerCase(),n=D.trim(e.substr(r+1)),t){if(a[t]&&P.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}(l.getAllResponseHeaders()):null;(function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(S("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)})(function(e){t(e),s()},function(e){n(e),s()},{data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}}if(l.open(e.method.toUpperCase(),E(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=h:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(h)},l.onabort=function(){l&&(n(j("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(j("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(j(t,e,(e.transitional||L).clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},I.isStandardBrowserEnv()){var f=(e.withCredentials||F(d))&&e.xsrfCookieName?N.read(e.xsrfCookieName):void 0;f&&(i[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&I.forEach(i,function(e,t){void 0===a&&"content-type"===t.toLowerCase()?delete i[t]:l.setRequestHeader(t,e)}),I.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(r=function(e){l&&(n(!e||e&&e.type?new W("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r))),a||(a=null),l.send(a)})}),U),transformRequest:[function(e,t){return Y(t,"Accept"),Y(t,"Content-Type"),z.isFormData(e)||z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)?e:z.isArrayBufferView(e)?e.buffer:z.isURLSearchParams(e)?(H(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):z.isObject(e)||t&&"application/json"===t["Content-Type"]?(H(t,"application/json"),function(e,t,n){if(z.isString(e))try{return(0,JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||q.transitional,n=!(t&&t.silentJSONParsing)&&"json"===this.responseType;if(n||t&&t.forcedJSONParsing&&z.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw V(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],function(e){q.headers[e]={}}),z.forEach(["post","put","patch"],function(e){q.headers[e]=z.merge(B)});var $=q,G=h,Q=$,J=function(e){return!(!e||!e.__CANCEL__)},K=h,Z=function(e,t,n){var r=this||Q;return G.forEach(n,function(n){e=n.call(r,e,t)}),e},X=J,ee=$,te=R;function ne(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new te("canceled")}var re=h,ae=function(e,t){t=t||{};var n={};function r(e,t){return re.isPlainObject(e)&&re.isPlainObject(t)?re.merge(e,t):re.isPlainObject(t)?re.merge({},t):re.isArray(t)?t.slice():t}function a(n){return re.isUndefined(t[n])?re.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function i(e){if(!re.isUndefined(t[e]))return r(void 0,t[e])}function o(n){return re.isUndefined(t[n])?re.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function s(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return re.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=l[e]||a,r=t(e);re.isUndefined(r)&&t!==s||(n[e]=r)}),n},ie="0.26.1",oe=ie,se={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){se[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var le={};se.transitional=function(e,t,n){function r(e,t){return"[Axios v"+oe+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,a,i){if(!1===e)throw new Error(r(a," has been removed"+(t?" in "+t:"")));return t&&!le[a]&&(le[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,i)}};var ue={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),a=r.length;a-- >0;){var i=r[a],o=t[i];if(o){var s=e[i],l=void 0===s||o(s,i,e);if(!0!==l)throw new TypeError("option "+i+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:se},ce=h,de=g,he=y,fe=function(e){return ne(e),e.headers=e.headers||{},e.data=Z.call(e,e.data,e.headers,e.transformRequest),e.headers=K.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),K.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||ee.adapter)(e).then(function(t){return ne(e),t.data=Z.call(e,t.data,t.headers,e.transformResponse),t},function(t){return X(t)||(ne(e),t&&t.response&&(t.response.data=Z.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},pe=ae,ge=ue,me=ge.validators;function ve(e){this.defaults=e,this.interceptors={request:new he,response:new he}}ve.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t.method=(t=pe(this.defaults,t)).method?t.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var n=t.transitional;void 0!==n&&ge.assertOptions(n,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1);var r=[],a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,r.unshift(e.fulfilled,e.rejected))});var i,o=[];if(this.interceptors.response.forEach(function(e){o.push(e.fulfilled,e.rejected)}),!a){var s=[fe,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(o),i=Promise.resolve(t);s.length;)i=i.then(s.shift(),s.shift());return i}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{i=fe(l)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},ve.prototype.getUri=function(e){return e=pe(this.defaults,e),de(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},ce.forEach(["delete","get","head","options"],function(e){ve.prototype[e]=function(t,n){return this.request(pe(n||{},{method:e,url:t,data:(n||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){ve.prototype[e]=function(t,n,r){return this.request(pe(r||{},{method:e,url:t,data:n}))}});var ye=ve,be=R;function xe(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}}),this.promise.then=function(e){var t,r=new Promise(function(e){n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e){n.reason||(n.reason=new be(e),t(n.reason))})}xe.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},xe.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},xe.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},xe.source=function(){var e;return{token:new xe(function(t){e=t}),cancel:e}};var _e=xe,we=h,ke=h,Se=n,Me=ye,Oe=ae,De=function e(t){var n=new Me(t),r=Se(Me.prototype.request,n);return ke.extend(r,Me.prototype,n),ke.extend(r,n),r.create=function(n){return e(Oe(t,n))},r}($);De.Axios=Me,De.Cancel=R,De.CancelToken=_e,De.isCancel=J,De.VERSION=ie,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},t.exports=De,t.exports.default=De;var Pe,Ce=t.exports;e.ResponseType=void 0,(Pe=e.ResponseType||(e.ResponseType={})).MATRIX="matrix",Pe.VECTOR="vector",Pe.SCALAR="scalar",Pe.STRING="string";class Te{constructor(e,t){if(e&&"string"!=typeof e)throw new Error("Wrong name format. Expected string.");if(t&&"object"!=typeof t)throw new Error("Wrong labels format. Expected object.");this.name=e,this.labels=t}static fromJSON(e){const t=e.__name__,n=Object.assign({},e);return delete n.__name__,new Te(t,n)}toString(){return(this.name?this.name:"")+"{"+Object.keys(this.labels).map(e=>e+'="'+this.labels[e]+'"').join(", ")+"}"}}class Ae{constructor(e,t){if("object"!=typeof e||"Date"!=e.constructor.name)throw new Error("Wrong time format. Expected Date.");if("number"!=typeof t)throw new Error("Wrong value format. Expected float.");this.time=e,this.value=t}static fromJSON(e){const t=new Date(1e3*e[0]),n=parseFloat(e[1]);return new Ae(t,n)}toString(){return this.time+": "+this.value}}class Re{constructor(e,t){this.metric=e,this.values=t}static fromJSON(e){const t=e.metric?Te.fromJSON(e.metric):null,n=e.values.map(Ae.fromJSON);return new Re(t,n)}}class Ie{constructor(e,t){this.metric=e,this.value=t}static fromJSON(e){const t=e.metric?Te.fromJSON(e.metric):null,n=Ae.fromJSON(e.value);return new Ie(t,n)}}class Ne{constructor(e,t){this.resultType=e,this.result=t}static fromJSON(t){const n=t.resultType;let r=null;switch(n){case e.ResponseType.MATRIX:r=t.result.map(Re.fromJSON);break;case e.ResponseType.VECTOR:r=t.result.map(Ie.fromJSON);break;case e.ResponseType.SCALAR:case e.ResponseType.STRING:r=t.result;break;default:throw new Error(`Unexpected resultType: ${n}`)}return new Ne(n,r)}}class Ee{constructor(e,t,n,r,a,i,o,s){if(e&&"object"!=typeof e)throw new Error(`Unexpected format for discoveredLabels. Got ${typeof e} instead of object`);if(t&&"object"!=typeof t)throw new Error(`Unexpected format for labels. Got ${typeof t} instead of object`);if(n&&"string"!=typeof n)throw new Error(`Unexpected format for scrapePool. Got ${typeof n} instead of string`);if(r&&"string"!=typeof r)throw new Error(`Unexpected format for scrapeUrl. Got ${typeof r} instead of string`);if(a&&"string"!=typeof a)throw new Error(`Unexpected format for lastError. Got ${typeof a} instead of string`);if(i&&("object"!=typeof i||"Date"!=i.constructor.name))throw new Error(`Unexpected format for lastScrape. Got ${typeof i} instead of object`);if(o&&"number"!=typeof o)throw new Error(`Unexpected format for lastScrapeDuration. Got ${typeof o} instead of number`);if(s&&"string"!=typeof s)throw new Error(`Unexpected format for health. Got ${typeof s} instead of string`);this.discoveredLabels=e,this.labels=t,this.scrapePool=n,this.scrapeUrl=r,this.lastError=a,this.lastScrape=i,this.lastScrapeDuration=o,this.health=s}static fromJSON(e){return new Ee(e.discoveredLabels,e.labels,e.scrapePool,e.scrapeUrl,e.lastError,e.lastScrape?new Date(e.lastScrape):null,e.lastScrapeDuration?parseFloat(e.lastScrapeDuration):null,e.health)}}class Fe{constructor(e,t,n,r,a){if(e&&("object"!=typeof e||"Date"!=e.constructor.name))throw new Error(`Unexpected format for activeAt. Got ${typeof e} instead of object`);if(t&&"object"!=typeof t)throw new Error(`Unexpected format for annotations. Got ${typeof t} instead of object`);if(n&&"object"!=typeof n)throw new Error(`Unexpected format for labels. Got ${typeof n} instead of object`);if(a&&"number"!=typeof a)throw new Error(`Unexpected format for value. Got ${typeof a} instead of number`);this.activeAt=e,this.annotations=t,this.labels=n,this.state=r,this.value=a}static fromJSON(e){return new Fe(e.activeAt?new Date(e.activeAt):null,e.annotations,e.labels,e.state,e.value?parseFloat(e.value):null)}}class je{constructor(e,t,n,r,a,i,o,s){this.alerts=e,this.annotations=t,this.duration=n,this.health=r,this.labels=a,this.name=i,this.query=o,this.type=s}static fromJSON(e){return new je(e.alerts?e.alerts.map(Fe.fromJSON):[],e.annotations,e.duration,e.health,e.labels,e.name,e.query,e.type)}}class Le{constructor(e,t,n,r){this.rules=e,this.file=t,this.interval=n,this.name=r}static fromJSON(e){return new Le(e.rules?e.rules.map(je.fromJSON):[],e.file,e.interval,e.name)}}class We{constructor(){this.baseURL="/api/v1/",this.headers={},this.auth=null,this.proxy=null,this.withCredentials=!1,this.timeout=1e4,this.preferPost=!1,this.warningHook=null}}e.Alert=Fe,e.InstantVector=Ie,e.Metric=Te,e.PrometheusConnectionOptions=We,e.PrometheusDriver=class{constructor(e){if(this.listifyIfNeeded=e=>e instanceof Array?e:[e],this.formatPromQlParams=e=>Object.entries(null!=e?e:{}).reduce((e,[t,n])=>(null!=n&&(n instanceof Array?n.filter(e=>null!=e).forEach(n=>e.append(`${t}[]`,n)):e.append(t,n)),e),new URLSearchParams),!(e=e||new We).endpoint)throw"Endpoint is required";e.endpoint=e.endpoint.replace(/\/$/,""),e.baseURL=e.baseURL||"/api/v1/",e.withCredentials=e.withCredentials||!1,e.timeout=e.timeout||1e4,this.options=e,this.axiosInstance=Ce.create(),this.options.requestInterceptor&&this.axiosInstance.interceptors.request.use(this.options.requestInterceptor.onFulfilled,this.options.requestInterceptor.onRejected),this.options.responseInterceptor&&this.axiosInstance.interceptors.response.use(this.options.responseInterceptor.onFulfilled,this.options.responseInterceptor.onRejected)}request(e,t,n,r){var a,i,o,s,l,u;const c=Object.assign({},this.options.headers||{});return this.axiosInstance.request({baseURL:this.options.endpoint+this.options.baseURL,url:t,method:e,params:this.formatPromQlParams(n),data:this.formatPromQlParams(r),headers:c,auth:(null===(a=this.options.auth)||void 0===a?void 0:a.username)&&(null===(i=this.options.auth)||void 0===i?void 0:i.password)?{username:this.options.auth.username,password:this.options.auth.password}:null,proxy:(null===(o=this.options.proxy)||void 0===o?void 0:o.host)&&(null===(s=this.options.proxy)||void 0===s?void 0:s.port)?{host:null===(l=this.options.proxy)||void 0===l?void 0:l.host,port:null===(u=this.options.proxy)||void 0===u?void 0:u.port}:null,withCredentials:this.options.withCredentials,timeout:this.options.timeout}).then(e=>this.handleResponse(e)).catch(e=>this.handleResponse(e))}handleResponse(e){const t=e.isAxiosError||!1;if(t&&(e=e.response),!e)throw{status:"error",errorType:"unexpected_error",error:"unexpected http error"};this.options.warningHook&&e.warnings&&e.warnings.length>0&&this.options.warningHook(e.warnings);const n=e.data;if(!n||null==n.status)throw{status:"error",errorType:"client_error",error:"unexpected client error"};if(t)throw e;return n.data}formatTimeToPrometheus(e,t){var n;if(e||(e=t),"number"==typeof e)return e/1e3;if("object"==typeof e&&"Date"==(null===(n=null==e?void 0:e.constructor)||void 0===n?void 0:n.name))return e.getTime()/1e3;throw new Error("Wrong time format. Expected number or Date.")}instantQuery(e,t,n){const r={query:e,time:this.formatTimeToPrometheus(t,new Date),timeout:n};return(this.options.preferPost?this.request("POST","query",null,r):this.request("GET","query",r)).then(e=>Ne.fromJSON(e))}rangeQuery(e,t,n,r,a){const i={query:e,start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n),step:r,timeout:a};return(this.options.preferPost?this.request("POST","query_range",null,i):this.request("GET","query_range",i)).then(e=>Ne.fromJSON(e))}series(e,t,n){const r={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n)};return(this.options.preferPost?this.request("POST","series",null,r):this.request("GET","series",r)).then(e=>e.map(Te.fromJSON))}labelNames(e,t,n){const r={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n)};return this.options.preferPost?this.request("POST","labels",null,r):this.request("GET","labels",r)}labelValues(e,t,n,r){const a={match:this.listifyIfNeeded(t),start:this.formatTimeToPrometheus(n,new Date),end:this.formatTimeToPrometheus(r,new Date)};return this.request("GET",`label/${e}/values`,a)}targets(e){return this.request("GET","targets",{query:e||"any"}).then(e=>({activeTargets:e.activeTargets?e.activeTargets.map(Ee.fromJSON):[],droppedTargets:e.droppedTargets?e.droppedTargets.map(Ee.fromJSON):[]}))}targetsMetadata(e,t,n){return this.request("GET","targets/metadata",{match_target:e,metric:t,limit:n})}metadata(e,t){return this.request("GET","metadata",{metric:e,limit:t})}rules(){return this.request("GET","rules").then(e=>(e.groups?e.groups:[]).map(Le.fromJSON))}alerts(){return this.request("GET","alerts").then(e=>(e.alerts?e.alerts:[]).map(Fe.fromJSON))}alertmanagers(){return this.request("GET","alertmanagers")}status(){return this.request("GET","status/config")}statusFlags(){return this.request("GET","status/flags")}statusRuntimeInfo(){return this.request("GET","status/runtimeinfo")}statusBuildinfo(){return this.request("GET","status/buildinfo")}statusTSDB(){return this.request("GET","status/tsdb")}adminSnapshot(e){return this.request("POST","admin/tsdb/snapshot",{skip_head:e})}adminDeleteSeries(e,t,n){const r={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(n)};return this.request("POST","admin/tsdb/delete_series",r)}adminCleanTombstones(){return this.request("POST","admin/tsdb/clean_tombstones")}},e.QueryResult=Ne,e.RangeVector=Re,e.Rule=je,e.RuleGroup=Le,e.SampleValue=Ae,e.Target=Ee,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,e.exports);var t={getPrometheusStepAuto:(e,t,n)=>{const r=(t.getTime()-e.getTime())/1e3,a=25*Math.floor(r/n);return a<1?1:a},getStartAndEndDates(e){if(e.type=e.type?e.type:"absolute","absolute"===e.type)return{type:"absolute",start:e.start,end:e.end};if("relative"===e.type)return{type:"absolute",start:new Date((new Date).getTime()+e.start),end:new Date((new Date).getTime()+e.end)};throw new Error("Unexpected options.timeRange value.")},executeQueries:(t,n,r,a,i)=>{const o=null!=n.find(e=>"string"==typeof e),s=t&&o?new e.exports.PrometheusDriver(t):null;return n.map(t=>"string"==typeof t?s.rangeQuery(t,r,a,i):t(r,a,i).then(t=>e.exports.QueryResult.fromJSON(t)))}};class n{constructor(){this.message="No data to display",this.font="16px normal 'Helvetica Nueue'",this.textAlign="center",this.textBaseline="middle",this.direction="ltr"}}class r{constructor(){this.message=null,this.font="16px normal 'Helvetica Nueue'",this.textAlign="center",this.textBaseline="middle",this.direction="ltr"}}class a{constructor(){this.prometheus=null,this.fillGaps=!1,this.tension=.4,this.cubicInterpolationMode="default",this.stepped=!1,this.fill=!1,this.borderWidth=3,this.borderColor=["rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],this.backgroundColor=["rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],this.noDataMsg=new n,this.errorMsg=new r,this.findInLabelMap=null,this.findInBorderColorMap=null,this.findInBackgroundColorMap=null,this.dataSetHook=null}assertPluginOptions(){if(!this.query)throw new Error("options.query is undefined");if(!this.timeRange)throw new Error("options.timeRange is undefined");if(null==this.timeRange.start)throw new Error("options.timeRange.start is undefined");if(null==this.timeRange.end)throw new Error("options.timeRange.end is undefined");if("object"!=typeof this.timeRange)throw new Error("options.timeRange must be a object");if("string"!=typeof this.timeRange.type)throw new Error("options.timeRange.type must be a string");if("relative"!=this.timeRange.type&&"absolute"!=this.timeRange.type)throw new Error('options.timeRange.type must be either "relative" or "absolute"');if("number"!=typeof this.timeRange.start&&("object"!=typeof this.timeRange.start||"Date"!=this.timeRange.start.constructor.name))throw new Error("options.timeRange.start must be a Date object (absolute) or integer (relative)");if("number"!=typeof this.timeRange.end&&("object"!=typeof this.timeRange.end||"Date"!=this.timeRange.end.constructor.name))throw new Error("options.timeRange.end must be a Date object (absolute) or integer (relative)");if(null!=this.timeRange.msUpdateInterval&&"number"!=typeof this.timeRange.msUpdateInterval)throw new Error("options.timeRange.msUpdateInterval must be a integer");if(null!=this.timeRange.msUpdateInterval&&this.timeRange.msUpdateInterval<1e3)throw new Error("options.timeRange.msUpdateInterval must be greater than 1s.")}getQueries(){var e,t;return"Array"!=(null===(t=null===(e=this.query)||void 0===e?void 0:e.constructor)||void 0===t?void 0:t.name)?[this.query]:this.query}}function i(e){e.config.options.scales=e.config.options.scales?e.config.options.scales:{},e.config.options.scales.xAxes=e.config.options.scales.xAxes&&e.config.options.scales.xAxes.length>0?e.config.options.scales.xAxes:[{}],e.config.options.scales.xAxes[0].time=e.config.options.scales.xAxes[0].time?e.config.options.scales.xAxes[0].time:{},e.config.options.scales.xAxes[0].type="time",e.config.options.scales.xAxes[0].distribution=e.config.options.scales.xAxes[0].distribution||"linear",e.config.options.scales.xAxes[0].time.minUnit=e.config.options.scales.xAxes[0].time.minUnit||"second"}function o(e,t,n){const r=t.metric.toString();return e.findInLabelMap&&e.findInLabelMap(t.metric)||r}function s(e,t,n){const r=e.fill?e.backgroundColor[n%e.backgroundColor.length]:"transparent";return e.findInBackgroundColorMap&&e.findInBackgroundColorMap(t.metric)||r}function l(e,t,n){const r=e.borderColor[n%e.borderColor.length];return e.findInBorderColorMap&&e.findInBorderColorMap(t.metric)||r}class u{constructor(){this.loading=!1,this.updateInterval=null,this.error=null}}return new class{constructor(){this.id="datasource-prometheus"}beforeInit(e,t){e["datasource-prometheus"]=new u}afterInit(e,t){if("line"!=e.config.type)throw"ChartDatasourcePrometheusPlugin is already compatible with Line chart\nFeel free to contribute for more!";if(!t)throw"ChartDatasourcePrometheusPlugin.options is undefined";const n=Object.assign(new a,t);n.assertPluginOptions(),n&&n.timeRange&&(n.timeRange.msUpdateInterval?e["datasource-prometheus"].updateInterval=setInterval(()=>{e.update()},n.timeRange.msUpdateInterval):e.update())}beforeUpdate(e,n){if(e["datasource-prometheus"]&&1==e["datasource-prometheus"].loading)return;const r=Object.assign(new a,n),u=r.prometheus,c=r.getQueries(),{start:d,end:h}=t.getStartAndEndDates(r.timeRange),f=r.timeRange.step||t.getPrometheusStepAuto(d,h,e.width),p=r.timeRange.minStep||f,g=p>=f?p:f;if(e["datasource-prometheus"]&&e["datasource-prometheus"].step==g&&e["datasource-prometheus"].start==d&&e["datasource-prometheus"].end==h)return;e["datasource-prometheus"].step=g,e["datasource-prometheus"].start=d,e["datasource-prometheus"].end=h,e["datasource-prometheus"].error=null;const m=t.executeQueries(u,c,d,h,g);let v={};if(e.data.datasets.length>0)for(let t in e.data.datasets){const n=e.data.datasets[t];let r=0;for(let e in n._meta)r=e;v[n.label]=!e.isDatasetVisible(n._meta[r].index)}const y=e.config.options.scales.yAxes;return e["datasource-prometheus"].loading=!0,Promise.all(m).then(t=>{const n=t.reduce((e,t,n)=>{const a=e.length,i=t.result.map((e,t)=>({yAxisID:y&&y.length>0?y[n%y.length].id:null,tension:r.tension,cubicInterpolationMode:r.cubicInterpolationMode||"default",stepped:r.stepped,fill:r.fill||!1,label:o(r,e),data:e.values.map((e,t)=>({t:e.time,y:e.value})),backgroundColor:s(r,e,a+t),borderColor:l(r,e,a+t),borderWidth:r.borderWidth,hidden:v[o(r,e)]||!1}));return e.concat(...i)},[]);e.data.datasets=n,e.data.datasets.length>0&&(r.fillGaps&&function(e,t,n,r,a){let i=a.timeRange.minStep||r;i=i>=r?i:r,e.data.datasets.forEach((r,a)=>{for(let e=r.data.length-2;e>0;e--)if(r.data[e+1].t-r.data[e].t>1100*i)for(let t=(r.data[e+1].t-r.data[e].t)/(1e3*i);t>1;t--){const t={t:new Date(r.data[e+1].t.getTime()-1e3*i),v:Number.NaN};r.data.splice(e+1,0,t)}if(Math.abs(t.getTime()-r.data[0].t)>1100*i)for(let n=Math.abs(t.getTime()-r.data[0].t)/(1e3*i);n>1;n--)e.data.datasets[a].data.unshift({t:new Date(r.data[0].t.getTime()-1e3*i),v:Number.NaN});if(Math.abs(n.getTime()-r.data[r.data.length-1].t)>1100*i)for(let t=Math.abs(n.getTime()-r.data[r.data.length-1].t)/(1e3*i);t>1;t--)e.data.datasets[a].data.push({t:new Date(r.data[e.data.datasets[a].data.length-1].t.getTime()+1e3*i),v:Number.NaN})})}(e,d,h,g,r),r.dataSetHook&&(e.data.datasets=r.dataSetHook(e.data.datasets)),i(e)),this.resumeRendering(e)}).catch(t=>{throw e.data.datasets=[],e["datasource-prometheus"].error="Failed to fetch data",i(e),this.resumeRendering(e),t}),!1}afterDraw(e,t){var n;const r=Object.assign(new a,t);if(null!=e["datasource-prometheus"].error){const t=e.ctx,a=e.width,i=e.height;return e.clear(),t.save(),t.direction=r.errorMsg.direction,t.textAlign=r.errorMsg.textAlign,t.textBaseline=r.errorMsg.textBaseline,t.font="16px normal 'Helvetica Nueue'",t.fillText((null===(n=r.errorMsg)||void 0===n?void 0:n.message)||e["datasource-prometheus"].error,a/2,i/2),void t.restore()}if(0==e.data.datasets.length){const t=e.ctx,n=e.width,a=e.height;return e.clear(),t.save(),t.direction=r.noDataMsg.direction,t.textAlign=r.noDataMsg.textAlign,t.textBaseline=r.noDataMsg.textBaseline,t.font=r.noDataMsg.font,t.fillText(r.noDataMsg.message,n/2,a/2),void t.restore()}}destroy(e){e["datasource-prometheus"].updateInterval&&clearInterval(e["datasource-prometheus"].updateInterval)}resumeRendering(e){e["datasource-prometheus"].loading=!0,e.update(),e["datasource-prometheus"].loading=!1}}}()}),ChartDatasourcePrometheusPlugin=/*@__PURE__*/getDefaultExportFromCjs(chartjsPluginDatasourcePrometheus_umd),INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function apply(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function arrayMap(e,t){for(var n=-1,r=e?e.length:0,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}function arrayPush(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,Symbol$1=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0,nativeMax=Math.max;function baseFlatten(e,t,n,r,a){var i=-1,o=e.length;for(n||(n=isFlattenable),a||(a=[]);++i<o;){var s=e[i];t>0&&n(s)?t>1?baseFlatten(s,t-1,n,r,a):arrayPush(a,s):r||(a[a.length]=s)}return a}function basePick(e,t){return basePickBy(e=Object(e),t,function(t,n){return n in e})}function basePickBy(e,t,n){for(var r=-1,a=t.length,i={};++r<a;){var o=t[r],s=e[o];n(s,o)&&(i[o]=s)}return i}function baseRest(e,t){return t=nativeMax(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,a=nativeMax(n.length-t,0),i=Array(a);++r<a;)i[r]=n[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=n[r];return o[t]=i,apply(e,this,o)}}function isFlattenable(e){return isArray(e)||isArguments(e)||!!(spreadableSymbol&&e&&e[spreadableSymbol])}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function isArguments(e){return isArrayLikeObject(e)&&hasOwnProperty.call(e,"callee")&&(!propertyIsEnumerable.call(e,"callee")||objectToString.call(e)==argsTag)}var isArray=Array.isArray;function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isFunction(e){var t=isObject(e)?objectToString.call(e):"";return t==funcTag||t==genTag}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}var pick=baseRest(function(e,t){return null==e?{}:basePick(e,arrayMap(baseFlatten(t,1),toKey))}),lodash_pick=pick,momentRange=createCommonjsModule(function(e,t){e.exports=function(e){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,n){var r=n(5)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){e.exports=n(18)()?Symbol:n(20)},function(t,n){t.exports=e},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return e.split("/")}Object.defineProperty(t,"__esModule",{value:!0}),t.DateRange=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.extendMoment=function(e){return e.range=function(t,n){return"string"==typeof t&&d.hasOwnProperty(t)?new h(e(this).startOf(t),e(this).endOf(t)):new h(t,n)},e.rangeFromInterval=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e();if(e.isMoment(r)||(r=e(r)),!r.isValid())throw new Error("Invalid date.");var a=r.clone().add(n,t),i=[];return i.push(e.min(r,a)),i.push(e.max(r,a)),new h(i)},e.rangeFromISOString=function(t){var n=i(t),r=e.parseZone(n[0]),a=e.parseZone(n[1]);return new h(r,a)},e.parseZoneRange=e.rangeFromISOString,e.fn.range=e.range,e.range.constructor=h,e.isRange=function(e){return e instanceof h},e.fn.within=function(e){return e.contains(this.toDate())},e};var u=r(n(2)),c=r(n(1)),d={year:!0,quarter:!0,month:!0,week:!0,day:!0,hour:!0,minute:!0,second:!0},h=t.DateRange=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=t,a=n;if(1===arguments.length||void 0===n)if("object"===(void 0===t?"undefined":s(t))&&2===t.length){var l=o(t,2);r=l[0],a=l[1]}else if("string"==typeof t){var c=i(t),d=o(c,2);r=d[0],a=d[1]}this.start=(0,u.default)(r||0===r?r:-864e13),this.end=(0,u.default)(a||0===a?a:864e13)}return l(e,[{key:"adjacent",value:function(e){var t=this.start.isSame(e.end),n=this.end.isSame(e.start);return t&&e.start.valueOf()<=this.start.valueOf()||n&&e.end.valueOf()>=this.end.valueOf()}},{key:"add",value:function(e){return this.overlaps(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{adjacent:!1})?new this.constructor(u.default.min(this.start,e.start),u.default.max(this.end,e.end)):null}},{key:"by",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeEnd:!1,step:1},n=this;return a({},c.default.iterator,function(){var r=t.step||1,a=Math.abs(n.start.diff(n.end,e))/r,i=t.excludeEnd||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=n.start.clone().add(o*r,e),s=i?!(o<a):!(o<=a);return o++,{done:s,value:s?void 0:t}}}})}},{key:"byRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeEnd:!1,step:1},n=this,r=t.step||1,i=this.valueOf()/e.valueOf()/r,o=Math.floor(i),s=t.excludeEnd||!1,l=0;return t.hasOwnProperty("exclusive")&&(s=t.exclusive),a({},c.default.iterator,function(){return o===1/0?{done:!0}:{next:function(){var t=(0,u.default)(n.start.valueOf()+e.valueOf()*l*r),a=o===i&&s?!(l<o):!(l<=o);return l++,{done:a,value:a?void 0:t}}}})}},{key:"center",value:function(){var e=this.start.valueOf()+this.diff()/2;return(0,u.default)(e)}},{key:"clone",value:function(){return new this.constructor(this.start.clone(),this.end.clone())}},{key:"contains",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,excludeEnd:!1},r=this.start.valueOf(),a=this.end.valueOf(),i=t.valueOf(),o=t.valueOf(),s=n.excludeStart||!1,l=n.excludeEnd||!1;return n.hasOwnProperty("exclusive")&&(s=l=n.exclusive),t instanceof e&&(i=t.start.valueOf(),o=t.end.valueOf()),(r<i||r<=i&&!s)&&(a>o||a>=o&&!l)}},{key:"diff",value:function(e,t){return this.end.diff(this.start,e,t)}},{key:"duration",value:function(e,t){return this.diff(e,t)}},{key:"intersect",value:function(e){var t=this.start.valueOf(),n=this.end.valueOf(),r=e.start.valueOf(),a=e.end.valueOf(),i=r==a;if(t==n){if(t==r||t==a)return null;if(t>r&&t<a)return this.clone()}else if(i){if(r==t||r==n)return null;if(r>t&&r<n)return new this.constructor(r,r)}return t<=r&&r<n&&n<a?new this.constructor(r,n):r<t&&t<a&&a<=n?new this.constructor(t,a):r<t&&t<=n&&n<a?this.clone():t<=r&&r<=a&&a<=n?new this.constructor(r,a):null}},{key:"isEqual",value:function(e){return this.start.isSame(e.start)&&this.end.isSame(e.end)}},{key:"isSame",value:function(e){return this.isEqual(e)}},{key:"overlaps",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{adjacent:!1},n=null!==this.intersect(e);return t.adjacent&&!n?this.adjacent(e):n}},{key:"reverseBy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,step:1},n=this;return a({},c.default.iterator,function(){var r=t.step||1,a=Math.abs(n.start.diff(n.end,e))/r,i=t.excludeStart||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=n.end.clone().subtract(o*r,e),s=i?!(o<a):!(o<=a);return o++,{done:s,value:s?void 0:t}}}})}},{key:"reverseByRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,step:1},n=this,r=t.step||1,i=this.valueOf()/e.valueOf()/r,o=Math.floor(i),s=t.excludeStart||!1,l=0;return t.hasOwnProperty("exclusive")&&(s=t.exclusive),a({},c.default.iterator,function(){return o===1/0?{done:!0}:{next:function(){var t=(0,u.default)(n.end.valueOf()-e.valueOf()*l*r),a=o===i&&s?!(l<o):!(l<=o);return l++,{done:a,value:a?void 0:t}}}})}},{key:"snapTo",value:function(e){var t=this.clone();return t.start.isSame((0,u.default)(-864e13))||(t.start=t.start.startOf(e)),t.end.isSame((0,u.default)(864e13))||(t.end=t.end.endOf(e)),t}},{key:"subtract",value:function(e){var t=this.start.valueOf(),n=this.end.valueOf(),r=e.start.valueOf(),a=e.end.valueOf();return null===this.intersect(e)?[this]:r<=t&&t<n&&n<=a?[]:r<=t&&t<a&&a<n?[new this.constructor(a,n)]:t<r&&r<n&&n<=a?[new this.constructor(t,r)]:t<r&&r<a&&a<n?[new this.constructor(t,r),new this.constructor(a,n)]:t<r&&r<n&&a<n?[new this.constructor(t,r),new this.constructor(r,n)]:[]}},{key:"toDate",value:function(){return[this.start.toDate(),this.end.toDate()]}},{key:"toString",value:function(){return this.start.format()+"/"+this.end.format()}},{key:"valueOf",value:function(){return this.end.valueOf()-this.start.valueOf()}}]),e}()},function(e,t,n){var r,a=n(6),i=n(13),o=n(9),s=n(15);r=e.exports=function(e,t){var n,r,o,l,u;return arguments.length<2||"string"!=typeof e?(l=t,t=e,e=null):l=arguments[2],null==e?(n=o=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),o=s.call(e,"w")),u={value:t,configurable:n,enumerable:r,writable:o},l?a(i(l),u):u},r.gs=function(e,t,n){var r,l,u,c;return"string"!=typeof e?(u=n,n=t,t=e,e=null):u=arguments[3],null==t?t=void 0:o(t)?null==n?n=void 0:o(n)||(u=n,n=void 0):(u=t,t=n=void 0),null==e?(r=!0,l=!1):(r=s.call(e,"c"),l=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:l},u?a(i(u),c):c}},function(e,t,n){e.exports=function(){}},function(e,t,n){e.exports=n(7)()?Object.assign:n(8)},function(e,t,n){e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){var r=n(10),a=n(14),i=Math.max;e.exports=function(e,t){var n,o,s,l=i(arguments.length,2);for(e=Object(a(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},o=1;o<l;++o)r(t=arguments[o]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){e.exports=function(e){return"function"==typeof e}},function(e,t,n){e.exports=n(11)()?Object.keys:n(12)},function(e,t,n){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){var r=n(0),a=Object.keys;e.exports=function(e){return a(r(e)?Object(e):e)}},function(e,t,n){var r=n(0),a=Array.prototype.forEach,i=Object.create;e.exports=function(e){var t=i(null);return a.call(arguments,function(e){r(e)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(e),t)}),t}},function(e,t,n){var r=n(0);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){e.exports=n(16)()?String.prototype.contains:n(17)},function(e,t,n){var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}},function(e,t,n){var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag]}},function(e,t,n){e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}},function(e,t,n){var r,a,i,o,s=n(4),l=n(21),u=Object.create,c=Object.defineProperties,d=Object.defineProperty,h=Object.prototype,f=u(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),o=!0}catch(e){}}var p=function(){var e=u(null);return function(t){for(var n,r,a=0;e[t+(a||"")];)++a;return e[t+=a||""]=!0,d(h,n="@@"+t,s.gs(null,function(e){r||(r=!0,d(this,n,s(e)),r=!1)})),n}}();i=function(e){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return a(e)},e.exports=a=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return o?r(t):(n=u(i.prototype),t=void 0===t?"":String(t),c(n,{__description__:s("",t),__name__:s("",p(t))}))},c(a,{for:s(function(e){return f[e]?f[e]:f[e]=a(String(e))}),keyFor:s(function(e){var t;for(t in l(e),f)if(f[t]===e)return t}),hasInstance:s("",r&&r.hasInstance||a("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||a("isConcatSpreadable")),iterator:s("",r&&r.iterator||a("iterator")),match:s("",r&&r.match||a("match")),replace:s("",r&&r.replace||a("replace")),search:s("",r&&r.search||a("search")),species:s("",r&&r.species||a("species")),split:s("",r&&r.split||a("split")),toPrimitive:s("",r&&r.toPrimitive||a("toPrimitive")),toStringTag:s("",r&&r.toStringTag||a("toStringTag")),unscopables:s("",r&&r.unscopables||a("unscopables"))}),c(i.prototype,{constructor:s(a),toString:s("",function(){return this.__name__})}),c(a.prototype,{toString:s(function(){return"Symbol ("+l(this).__description__+")"}),valueOf:s(function(){return l(this)})}),d(a.prototype,a.toPrimitive,s("",function(){var e=l(this);return"symbol"==typeof e?e:e.toString()})),d(a.prototype,a.toStringTag,s("c","Symbol")),d(i.prototype,a.toStringTag,s("c",a.prototype[a.toStringTag])),d(i.prototype,a.toPrimitive,s("c",a.prototype[a.toPrimitive]))},function(e,t,n){var r=n(19);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}}])}(moment$1)}),moment=momentRange.extendMoment(moment$1),getQueriesTimeRange=function(e,t){var n=moment(),r=andoncloudDashboardToolkit.normalizeShifts(null==t?void 0:t.shifts,n),a=andoncloudDashboardToolkit.getCurrentShift(n,r),i=andoncloudDashboardToolkit.getRecentShift(n,r);switch(e){case QueriesPeriod.CURRENT_SHIFT:return a?{startedAt:a.startedAt.toDate(),finishedAt:a.finishedAt.toDate()}:i?{startedAt:i.startedAt.toDate(),finishedAt:i.finishedAt.toDate()}:null;case QueriesPeriod.PREVIOUS_SHIFT:return i?{startedAt:i.startedAt.toDate(),finishedAt:i.finishedAt.toDate()}:null;default:return null}},colorName={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},isArrayish=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},simpleSwizzle=createCommonjsModule(function(e){var t=Array.prototype.concat,n=Array.prototype.slice,r=e.exports=function(e){for(var r=[],a=0,i=e.length;a<i;a++){var o=e[a];isArrayish(o)?r=t.call(r,n.call(o)):r.push(o)}return r};r.wrap=function(e){return function(){return e(r(arguments))}}}),colorString=createCommonjsModule(function(e){var t=Object.hasOwnProperty,n=Object.create(null);for(var r in colorName)t.call(colorName,r)&&(n[colorName[r]]=r);var a=e.exports={to:{},get:{}};function i(e,t,n){return Math.min(Math.max(t,e),n)}function o(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}a.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=a.get.hsl(e),n="hsl";break;case"hwb":t=a.get.hwb(e),n="hwb";break;default:t=a.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},a.get.rgb=function(e){if(!e)return null;var n,r,a,o=[0,0,0,1];if(n=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(a=n[2],n=n[1],r=0;r<3;r++){var s=2*r;o[r]=parseInt(n.slice(s,s+2),16)}a&&(o[3]=parseInt(a,16)/255)}else if(n=e.match(/^#([a-f0-9]{3,4})$/i)){for(a=(n=n[1])[3],r=0;r<3;r++)o[r]=parseInt(n[r]+n[r],16);a&&(o[3]=parseInt(a+a,16)/255)}else if(n=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)o[r]=parseInt(n[r+1],0);n[4]&&(o[3]=n[5]?.01*parseFloat(n[4]):parseFloat(n[4]))}else{if(!(n=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(n=e.match(/^(\w+)$/))?"transparent"===n[1]?[0,0,0,0]:t.call(colorName,n[1])?((o=colorName[n[1]])[3]=1,o):null:null;for(r=0;r<3;r++)o[r]=Math.round(2.55*parseFloat(n[r+1]));n[4]&&(o[3]=n[5]?.01*parseFloat(n[4]):parseFloat(n[4]))}for(r=0;r<3;r++)o[r]=i(o[r],0,255);return o[3]=i(o[3],0,1),o},a.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(n)?1:n,0,1)]}return null},a.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(n)?1:n,0,1)]}return null},a.to.hex=function(){var e=simpleSwizzle(arguments);return"#"+o(e[0])+o(e[1])+o(e[2])+(e[3]<1?o(Math.round(255*e[3])):"")},a.to.rgb=function(){var e=simpleSwizzle(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},a.to.rgb.percent=function(){var e=simpleSwizzle(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},a.to.hsl=function(){var e=simpleSwizzle(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},a.to.hwb=function(){var e=simpleSwizzle(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},a.to.keyword=function(e){return n[e.slice(0,3)]}});const reverseKeywords={};for(const e of Object.keys(colorName))reverseKeywords[colorName[e]]=e;const convert$1={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var conversions=convert$1;for(const e of Object.keys(convert$1)){if(!("channels"in convert$1[e]))throw new Error("missing channels property: "+e);if(!("labels"in convert$1[e]))throw new Error("missing channel labels property: "+e);if(convert$1[e].labels.length!==convert$1[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=convert$1[e];delete convert$1[e].channels,delete convert$1[e].labels,Object.defineProperty(convert$1[e],"channels",{value:t}),Object.defineProperty(convert$1[e],"labels",{value:n})}function comparativeDistance(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}function buildGraph(){const e={},t=Object.keys(conversions);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function deriveBFS(e){const t=buildGraph(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),r=Object.keys(conversions[e]);for(let a=r.length,i=0;i<a;i++){const a=r[i],o=t[a];-1===o.distance&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(a))}}return t}function link(e,t){return function(n){return t(e(n))}}function wrapConversion(e,t){const n=[t[e].parent,e];let r=conversions[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)n.unshift(t[a].parent),r=link(conversions[t[a].parent][a],r),a=t[a].parent;return r.conversion=n,r}convert$1.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=i-a;let s,l;i===a?s=0:t===i?s=(n-r)/o:n===i?s=2+(r-t)/o:r===i&&(s=4+(t-n)/o),s=Math.min(60*s,360),s<0&&(s+=360);const u=(a+i)/2;return l=i===a?0:u<=.5?o/(i+a):o/(2-i-a),[s,100*l,100*u]},convert$1.rgb.hsv=function(e){let t,n,r,a,i;const o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(a=0,i=0):(i=c/u,t=d(o),n=d(s),r=d(l),o===u?a=r-n:s===u?a=1/3+t-r:l===u&&(a=2/3+n-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*u]},convert$1.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const a=convert$1.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,100*i,100*r]},convert$1.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(1-t,1-n,1-r);return[100*((1-t-a)/(1-a)||0),100*((1-n-a)/(1-a)||0),100*((1-r-a)/(1-a)||0),100*a]},convert$1.rgb.keyword=function(e){const t=reverseKeywords[e];if(t)return t;let n,r=Infinity;for(const t of Object.keys(colorName)){const a=comparativeDistance(e,colorName[t]);a<r&&(r=a,n=t)}return n},convert$1.keyword.rgb=function(e){return colorName[e]},convert$1.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},convert$1.rgb.lab=function(e){const t=convert$1.rgb.xyz(e);let n=t[0],r=t[1],a=t[2];return n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*r-16,500*(n-r),200*(r-a)]},convert$1.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let a,i,o;if(0===n)return o=255*r,[o,o,o];a=r<.5?r*(1+n):r+n-r*n;const s=2*r-a,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,o=6*i<1?s+6*(a-s)*i:2*i<1?a:3*i<2?s+(a-s)*(2/3-i)*6:s,l[e]=255*o;return l},convert$1.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,a=n;const i=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,a*=i<=1?i:2-i,[t,100*(0===r?2*a/(i+a):2*n/(r+n)),(r+n)/2*100]},convert$1.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const a=Math.floor(t)%6,i=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*i),l=255*r*(1-n*(1-i));switch(r*=255,a){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}},convert$1.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,a=Math.max(r,.01);let i,o;o=(2-n)*r;const s=(2-n)*a;return i=n*a,i/=s<=1?s:2-s,i=i||0,o/=2,[t,100*i,100*o]},convert$1.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const a=n+r;let i;a>1&&(n/=a,r/=a);const o=Math.floor(6*t),s=1-r;i=6*t-o,0!=(1&o)&&(i=1-i);const l=n+i*(s-n);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=n;break;case 1:u=l,c=s,d=n;break;case 2:u=n,c=s,d=l;break;case 3:u=n,c=l,d=s;break;case 4:u=l,c=n,d=s;break;case 5:u=s,c=n,d=l}return[255*u,255*c,255*d]},convert$1.cmyk.rgb=function(e){const t=e[1]/100,n=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-r)+r)),255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},convert$1.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let a,i,o;return a=3.2406*t+-1.5372*n+-.4986*r,i=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=Math.min(Math.max(0,a),1),i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),[255*a,255*i,255*o]},convert$1.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},convert$1.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const a=n**3,i=t**3,o=r**3;return n=a>.008856?a:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},convert$1.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let a;return a=360*Math.atan2(r,n)/2/Math.PI,a<0&&(a+=360),[t,Math.sqrt(n*n+r*r),a]},convert$1.lch.lab=function(e){const t=e[1],n=e[2]/360*2*Math.PI;return[e[0],t*Math.cos(n),t*Math.sin(n)]},convert$1.rgb.ansi16=function(e,t=null){const[n,r,a]=e;let i=null===t?convert$1.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),0===i)return 30;let o=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===i&&(o+=60),o},convert$1.hsv.ansi16=function(e){return convert$1.rgb.ansi16(convert$1.hsv.rgb(e),e[2])},convert$1.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},convert$1.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},convert$1.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},convert$1.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},convert$1.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},convert$1.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.max(Math.max(t,n),r),i=Math.min(Math.min(t,n),r),o=a-i;let s,l;return s=o<1?i/(1-o):0,l=o<=0?0:a===t?(n-r)/o%6:a===n?2+(r-t)/o:4+(t-n)/o,l/=6,l%=1,[360*l,100*o,100*s]},convert$1.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let a=0;return r<1&&(a=(n-.5*r)/(1-r)),[e[0],100*r,100*a]},convert$1.hsv.hcg=function(e){const t=e[2]/100,n=e[1]/100*t;let r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},convert$1.hcg.rgb=function(e){const t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];const r=[0,0,0],a=e[0]/360%1*6,i=a%1,o=1-i;let s=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=i,r[2]=0;break;case 1:r[0]=o,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=i;break;case 3:r[0]=0,r[1]=o,r[2]=1;break;case 4:r[0]=i,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=o}return s=(1-t)*n,[255*(t*r[0]+s),255*(t*r[1]+s),255*(t*r[2]+s)]},convert$1.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},convert$1.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},convert$1.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},convert$1.hwb.hcg=function(e){const t=1-e[2]/100,n=t-e[1]/100;let r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],100*n,100*r]},convert$1.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},convert$1.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},convert$1.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},convert$1.gray.hsl=function(e){return[0,0,e[0]]},convert$1.gray.hsv=convert$1.gray.hsl,convert$1.gray.hwb=function(e){return[0,100,e[0]]},convert$1.gray.cmyk=function(e){return[0,0,0,e[0]]},convert$1.gray.lab=function(e){return[e[0],0,0]},convert$1.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},convert$1.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var route=function(e){const t=deriveBFS(e),n={},r=Object.keys(t);for(let e=r.length,a=0;a<e;a++){const e=r[a];null!==t[e].parent&&(n[e]=wrapConversion(e,t))}return n};const convert={},models=Object.keys(conversions);function wrapRaw(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function wrapRounded(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}models.forEach(e=>{convert[e]={},Object.defineProperty(convert[e],"channels",{value:conversions[e].channels}),Object.defineProperty(convert[e],"labels",{value:conversions[e].labels});const t=route(e);Object.keys(t).forEach(n=>{const r=t[n];convert[e][n]=wrapRounded(r),convert[e][n].raw=wrapRaw(r)})});var colorConvert=convert;const skippedModels=["keyword","gray","hex"],hashedModelKeys={};for(const e of Object.keys(colorConvert))hashedModelKeys[[...colorConvert[e].labels].sort().join("")]=e;const limiters={};function Color(e,t){if(!(this instanceof Color))return new Color(e,t);if(t&&t in skippedModels&&(t=null),t&&!(t in colorConvert))throw new Error("Unknown model: "+t);let n,r;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof Color)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=colorString.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,r=colorConvert[this.model].channels,this.color=t.value.slice(0,r),this.valpha="number"==typeof t.value[r]?t.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=colorConvert[this.model].channels;const n=Array.prototype.slice.call(e,0,r);this.color=zeroArray(n,r),this.valpha="number"==typeof e[r]?e[r]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const r=t.sort().join("");if(!(r in hashedModelKeys))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=hashedModelKeys[r];const{labels:a}=colorConvert[this.model],i=[];for(n=0;n<a.length;n++)i.push(e[a[n]]);this.color=zeroArray(i)}if(limiters[this.model])for(r=colorConvert[this.model].channels,n=0;n<r;n++){const e=limiters[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Color.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in colorString.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return colorString.to[t.model](n)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[...t.color,this.valpha];return colorString.to.rgb.percent(n)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=colorConvert[this.model],{labels:n}=colorConvert[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new Color([...this.color.map(roundToPlace(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new Color([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:getset("rgb",0,maxfn(255)),green:getset("rgb",1,maxfn(255)),blue:getset("rgb",2,maxfn(255)),hue:getset(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:getset("hsl",1,maxfn(100)),lightness:getset("hsl",2,maxfn(100)),saturationv:getset("hsv",1,maxfn(100)),value:getset("hsv",2,maxfn(100)),chroma:getset("hcg",1,maxfn(100)),gray:getset("hcg",2,maxfn(100)),white:getset("hwb",1,maxfn(100)),wblack:getset("hwb",2,maxfn(100)),cyan:getset("cmyk",0,maxfn(100)),magenta:getset("cmyk",1,maxfn(100)),yellow:getset("cmyk",2,maxfn(100)),black:getset("cmyk",3,maxfn(100)),x:getset("xyz",0,maxfn(95.047)),y:getset("xyz",1,maxfn(100)),z:getset("xyz",2,maxfn(108.833)),l:getset("lab",0,maxfn(100)),a:getset("lab",1),b:getset("lab",2),keyword(e){return void 0!==e?new Color(e):colorConvert[this.model].keyword(this.color)},hex(e){return void 0!==e?new Color(e):colorString.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new Color(e);const t=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),colorString.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return Color.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),a=void 0===t?.5:t,i=2*a-1,o=n.alpha()-r.alpha(),s=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return Color.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue(),n.alpha()*a+r.alpha()*(1-a))}};for(const e of Object.keys(colorConvert)){if(skippedModels.includes(e))continue;const{channels:t}=colorConvert[e];Color.prototype[e]=function(...t){return this.model===e?new Color(this):new Color(t.length>0?t:[...assertArray(colorConvert[this.model][e].raw(this.color)),this.valpha],e)},Color[e]=function(...n){let r=n[0];return"number"==typeof r&&(r=zeroArray(n,t)),new Color(r,e)}}function roundTo(e,t){return Number(e.toFixed(t))}function roundToPlace(e){return function(t){return roundTo(t,e)}}function getset(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(limiters[r]||(limiters[r]=[]))[t]=n;return e=e[0],function(r){let a;return void 0!==r?(n&&(r=n(r)),a=this[e](),a.color[t]=r,a):(a=this[e]().color[t],n&&(a=n(a)),a)}}function maxfn(e){return function(t){return Math.max(0,Math.min(e,t))}}function assertArray(e){return Array.isArray(e)?e:[e]}function zeroArray(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}var color=Color,Color$1=color,createGradient=function(e,t){return e.createLinearGradient(0,t.bottom,0,t.top)},getScale=function(e,t){var n=e.getDatasetMeta(t);return n.controller._yScale||n.controller.chart.scales[n.yAxisID]},GradientPlugin={id:"gradient",beforeDatasetsUpdate:function(e){var t=e.ctx,n=e.data.datasets;if(t&&n)for(var r=0;r<n.length;r++){var a=n[r],i=getScale(e,r);if(i){var o=createGradient(t,i),s=Color$1(a.borderColor);o.addColorStop(0,s.alpha(.1).hexa()),o.addColorStop(1,s.alpha(.5).hexa()),a.backgroundColor=o}}}};Chart$1.defaults.global.defaultFontSize=12,Chart$1.defaults.global.defaultFontColor="rgba(255, 255, 255, 0.75)";var PrometheusChart=function PrometheusChart(_ref){var data=_ref.data,settings=_ref.settings,chart=React.useRef(),_useState=React.useState({labels:[],datasets:[]}),chartData=_useState[0],_useState2=React.useState(null),queriesTimeRange=_useState2[0],setQueriesTimeRange=_useState2[1],_useState3=React.useState([]),timeLabels=_useState3[0],setTimeLabels=_useState3[1];return React.useEffect(function(){if(chart.current&&chart.current.update(),queriesTimeRange){var e=moment(queriesTimeRange.startedAt),t=moment(queriesTimeRange.finishedAt),n=moment.range(e,t);setTimeLabels(function(){return e.isBefore(t)?Array.from(n.by("minutes",{step:15})):Array.from(n.reverseBy("minutes",{step:15}))})}},[queriesTimeRange]),React.useEffect(function(){if(setQueriesTimeRange(getQueriesTimeRange(settings.queriesPeriod,data)),(null==settings?void 0:settings.queriesPeriod)===QueriesPeriod.CURRENT_SHIFT){var e=setInterval(function(){if(chart.current&&chart.current.options.plugins){var e=getQueriesTimeRange(settings.queriesPeriod,data);setQueriesTimeRange(e),chart.current.options.plugins["datasource-prometheus"].timeRange=_extends({},chart.current.options.plugins["datasource-prometheus"].timeRange,{start:null==e?void 0:e.startedAt,end:null==e?void 0:e.finishedAt}),chart.current.update()}},3e4);return function(){clearInterval(e)}}return function(){}},[data,settings]),queriesTimeRange&&React__default.default.createElement(Chart,{ref:chart,type:"line",data:chartData,plugins:[ChartDatasourcePrometheusPlugin,GradientPlugin],options:{scales:{xAxes:[_extends({type:"time",labels:timeLabels,time:{displayFormats:{millisecond:"HH:mm:ss.SSS",second:"HH:mm:ss",minute:"HH:mm",hour:"HH"}},ticks:{source:"labels"},gridLines:{color:"rgba(255, 255, 255, 0.1)"}},settings.xAxisUnit&&{scaleLabel:{display:!0,labelString:settings.xAxisUnit}})],yAxes:[_extends({gridLines:{color:"rgba(255, 255, 255, 0.1)"}},settings.xAxisUnit&&{scaleLabel:{display:!0,labelString:settings.yAxisUnit}})]},elements:{point:{radius:0}},maintainAspectRatio:!1,animation:{duration:0},plugins:{"datasource-prometheus":{prometheus:{endpoint:settings.endpointUrl},query:settings.prometheusQueries,timeRange:{type:"absolute",start:queriesTimeRange.startedAt,end:queriesTimeRange.finishedAt,step:30},fillGaps:!0,fill:!0}},legend:{labels:{filter:function filter(item){var regex=/{(?:[^{}]*)*}/,paramsMatch=item.text.match(regex),replaceAfter=function(e,t,n){return e.substring(0,t)+n};if(paramsMatch&&0!==paramsMatch.index){var matchIndex=paramsMatch.index||0,queryParams=eval("("+paramsMatch[0].replaceAll("=",":")+")");item.text=replaceAfter(item.text,matchIndex,JSON.stringify(lodash_pick(queryParams,settings.displayedQueryParams)))}else item.text=null==settings?void 0:settings.prometheusQueries[item.datasetIndex];return item}}}}})},WidgetView=function(e){var t=e.settings;return React__default.default.createElement(material.Box,{display:"flex",width:"100%",height:"100%",p:2},t&&React__default.default.createElement(PrometheusChart,{data:e.data,settings:t}))},_excluded=["url","wsUrl","lang","data"],Widget=function(e){var t=e.url,n=e.wsUrl,r=e.lang,a=e.data,i=_objectWithoutPropertiesLoose(e,_excluded),o=andoncloudDashboardToolkit.useGqlClients({url:t,wsUrl:n,lang:r}).graphqlSdk,s=React.useState(a),l=s[0],u=s[1];return React.useEffect(function(){!a&&o&&o.shifts().then(function(e){var t=e.shifts;return u(function(e){return _extends({},e||{},{shifts:t})})}).catch(function(){})},[a,o]),React__default.default.createElement(andoncloudWidgetBase.BaseWidget,_extends({url:t,lang:r,data:l,WidgetView:WidgetView,SettingsFormContent:SettingsFormContent,version:LIBRARY_VERSION,"data-testid":"prometheus-widget"},i))},getDisplayName=function(e){switch(e){case"en":return"PromQL chart";case"pl":return"Wykres PromQL";default:return"prometheus-widget"}},permissions=[];exports.Widget=Widget,exports.getDisplayName=getDisplayName,exports.permissions=permissions,exports.version=LIBRARY_VERSION;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|